/* =========================================================================
   piaroussy.com — shared stylesheet
   Warm editorial paper-collage. Two pages, one visual system.
   Tokens per spec §2 (non-negotiable). Do not substitute.
   ========================================================================= */

:root {
  --paper:       #FDFBF7;  /* page background, card fill */
  --plum:        #2d2638;  /* all headline and body text on cream */
  --accent:      #8d76aa;  /* lavender: structural elements, borders, checkbox */
  --accent-2:    #b8a8cc;  /* lighter lavender: card borders, field borders */
  --pop:         #cdab70;  /* gold: highlighter swipe only, one per section */
  --muted:       #9d8fad;  /* kickers and small print only */
  --bg:          #1e1a24;  /* dark: reserved, not used on either page currently */
  --fg:          #FDFBF7;  /* cream text on dark */
  --shadow-hard: 6px 6px 0 rgba(45, 38, 56, 0.18);

  /* system tokens */
  --serif: Georgia, "Times New Roman", ui-serif, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 4px;
  --container: 660px;
  --ease-out-cubic: cubic-bezier(0.215, 0.61, 0.355, 1);
}

/* ---------- reset / base ---------- */

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--plum);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

@media (max-width: 640px) {
  body { font-size: 17px; }
}

img { max-width: 100%; display: block; }

a {
  color: var(--plum);
  text-decoration: underline;
  text-decoration-color: var(--accent-2);
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  transition: text-decoration-color 0.2s ease;
}
a:hover { text-decoration-color: var(--accent); }

/* ---------- paper grain overlay (spec §2) ---------- */
/* fixed, pointer-events none, 3–5% opacity. */

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  opacity: 0.04;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- layout ---------- */

.page {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

@media (max-width: 640px) {
  .page { padding: 0 20px; }
}

.section { margin-top: 72px; }

@media (max-width: 640px) {
  .section { margin-top: 56px; }
}

/* ---------- shared header block (spec §3) ---------- */
/* Sparkle mark + wordmark + tagline. No nav. Floats on the page. */

.site-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  padding-top: 40px;
  padding-bottom: 32px;
}

.site-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.site-header__mark {
  width: 28px;
  height: 28px;
  flex: none;
}

.site-header__name {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 18px;
  color: var(--plum);
  letter-spacing: 0.005em;
  text-transform: lowercase;
}

.site-header__tagline {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

@media (min-width: 641px) {
  .site-header {
    align-items: flex-start;
    text-align: left;
    padding-top: 48px;
    padding-bottom: 48px;
  }
}

/* ---------- typography ---------- */

.kicker {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin: 0 0 18px;
}

.headline {
  font-family: var(--serif);
  font-weight: 400;
  text-transform: lowercase;
  color: var(--plum);
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0;
  font-size: clamp(2.1rem, 6vw, 3.3rem);
}

.headline--sm {
  font-size: clamp(1.9rem, 5vw, 2.7rem);
}

.subline {
  font-size: clamp(1.05rem, 2.4vw, 1.2rem);
  line-height: 1.6;
  color: var(--plum);
  max-width: 40ch;
  margin: 20px 0 0;
}

.lede {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--plum);
  max-width: 54ch;
  margin: 18px 0 0;
}

.small {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

/* gold highlighter swipe (spec §2): behind text, one per section, never a text color */
.swipe {
  background-image: linear-gradient(120deg, var(--pop), var(--pop));
  background-repeat: no-repeat;
  background-size: 100% 0.44em;
  background-position: 0 82%;
  padding: 0 0.06em;
  border-radius: 1px;
}

/* ---------- buttons ---------- */

.btn {
  appearance: none;
  border: 1.5px solid var(--plum);
  background: var(--plum);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.2;
  padding: 15px 26px;
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s var(--ease-out-cubic),
              box-shadow 0.15s var(--ease-out-cubic),
              background 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-hard);
}
.btn:active { transform: translateY(0) scale(0.99); box-shadow: none; }

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn--block { width: 100%; }

/* ---------- forms ---------- */

.field { display: block; margin: 0; }

.field + .field { margin-top: 22px; }

.field__label {
  display: block;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 1rem;
  color: var(--plum);
  line-height: 1.45;
  margin-bottom: 6px;
}

.field__help {
  display: block;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 10px;
}

.input,
.textarea {
  width: 100%;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--plum);
  background: var(--paper);
  border: 1.5px solid var(--accent-2);
  border-radius: var(--radius);
  padding: 13px 15px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input::placeholder,
.textarea::placeholder { color: var(--muted); }

.input:focus,
.textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(141, 118, 170, 0.15);
}

.textarea {
  min-height: 120px;
  resize: vertical;
}

/* error state: plum text + lavender underline, never red (spec §2) */
.field--error .input,
.field--error .textarea {
  border-color: transparent;
  border-bottom: 2px solid var(--accent);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: none;
}
.field__error {
  display: none;
  font-size: 14px;
  color: var(--plum);
  margin-top: 6px;
}
.field--error .field__error { display: block; }

/* checkbox */
.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  cursor: pointer;
  font-size: 1rem;
  color: var(--plum);
  line-height: 1.45;
}

.checkbox input {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  border: 1.5px solid var(--accent);
  border-radius: 3px;
  background: var(--paper);
  cursor: pointer;
  display: grid;
  place-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.checkbox input::after {
  content: "";
  width: 10px;
  height: 6px;
  border-left: 2px solid var(--paper);
  border-bottom: 2px solid var(--paper);
  transform: rotate(-45deg) scale(0);
  transition: transform 0.15s var(--ease-out-cubic);
  margin-top: -2px;
}
.checkbox input:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.checkbox input:checked::after { transform: rotate(-45deg) scale(1); }
.checkbox input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- cards (spec §2: hard shadow, no blur, settle crooked) ---------- */

.card {
  background: var(--paper);
  border: 1.5px solid var(--accent-2);
  border-radius: var(--radius);
  padding: 26px 24px;
  box-shadow: var(--shadow-hard);
  transform: rotate(-0.6deg);
  transition: transform 0.2s var(--ease-out-cubic);
}
.card:nth-child(even) { transform: rotate(0.6deg); }
.card:hover { transform: rotate(0deg); }

.card__title {
  font-family: var(--serif);
  font-weight: 400;
  text-transform: lowercase;
  font-size: 1.35rem;
  line-height: 1.2;
  color: var(--plum);
  margin: 0 0 10px;
}

.card__body {
  font-size: 1rem;
  line-height: 1.55;
  color: var(--plum);
  margin: 0;
}

/* ---------- form status swap (success / error) ---------- */

.form-status {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--plum);
  max-width: 46ch;
}

/* crossfade swap wrapper */
.swap { position: relative; }
.swap__panel { transition: opacity 0.3s ease; }
.swap__panel[hidden] { display: none; }

/* ---------- footer ---------- */

.site-footer {
  margin-top: 80px;
  padding: 40px 0 56px;
  text-align: center;
}

.site-footer__door {
  font-size: 1rem;
  color: var(--plum);
  margin: 0 0 26px;
}

.site-footer__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 18px;
  font-size: 14px;
  color: var(--muted);
}

.site-footer__row a { color: var(--muted); }
.site-footer__row a:hover { color: var(--plum); }

.site-footer__mark {
  width: 24px;
  height: 24px;
  margin: 0 auto 20px;
}

@media (min-width: 641px) {
  .site-footer__row { gap: 8px 22px; }
}

/* ---------- scroll reveal motion (spec §2) ---------- */
/* fade in + 12px upward drift, 0.5s ease-out-cubic, 80ms stagger. */
/* Hidden only when JS is available; no-JS users see everything. */

.js .reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s var(--ease-out-cubic),
              transform 0.5s var(--ease-out-cubic);
  transition-delay: calc(var(--i, 0) * 80ms);
  will-change: opacity, transform;
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- utilities ---------- */

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* =========================================================================
   Landing page — /playbook
   ========================================================================= */

.hero { padding-top: 8px; }

.hero__form { margin-top: 28px; }

.form-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.field--grow { flex: 1 1 auto; min-width: 0; }
.field--grow .input { width: 100%; }

.hero__fineprint { margin: 14px 0 0; }
.checkbox { margin-top: 16px; }

.form-status--error { color: var(--plum); margin-top: 16px; }

.whats-inside .cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 22px;
}

/* stacked form + single-column cards on phones */
@media (max-width: 560px) {
  .form-row { flex-direction: column; gap: 14px; }
  .form-row .btn { width: 100%; }
  .whats-inside .cards { grid-template-columns: 1fr; gap: 22px; }
}

/* =========================================================================
   DFY form page — /work-with-me
   ========================================================================= */

.dfy__intro { margin-bottom: 40px; }
.dfy__form .field + .field { margin-top: 30px; }
.dfy__submit { margin-top: 34px; }

/* ---------- reduced motion (spec §2: reveals instant, swipes pre-rendered) --- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .card { transition: none; }
}
