/* ============================================================
   Guidefastly — "Doorstep" design system (v1, 28 Jul 2026)
   Replaces "First Light". Tokens are exact per STRATEGY-UNIQUENESS §2 —
   verbatim, per Leo's decision (28 Jul). Known measurement, accepted by Leo:
   --accent-text #C44D14 is 4.40:1 on --bg (4.75:1 on --surface); the contrast
   script reports that single pair as spec-pinned instead of failing.
   Budget: this file ≤10KB. Fonts: two self-hosted variable woff2, 76KB total.
   ============================================================ */

/* Relative ../fonts/ so the file works served at /css/doorstep.css AND opened
   from disk (PLAN-LAUNCH §3 resilience — root pages must work off hosting). */
@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-var.woff2") format("woff2-variations");
  font-weight: 400 800;
  font-stretch: 100% 110%;
  font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("../fonts/hanken-var.woff2") format("woff2-variations");
  font-weight: 400 800;
  font-display: swap;
}

:root {
  --bg:        #F5F6F8;
  --surface:   #FFFFFF;
  --ink:       #16181D;
  --panel:     #16181D;
  --panel-2:   #1E2128;
  --key:       #23272E;
  --muted:     #5A616E;
  --muted-inv: #8A919E;
  --line:      #E2E5EA;
  --line-inv:  #2A2E36;
  --paper-inv: #F5F6F8;
  --accent:    #FF6B2C;
  --accent-text: #C44D14;
  --r: 10px; --r-card: 14px; --r-pill: 99px;
  --font-display: "Archivo", -apple-system, sans-serif;
  --font-body: "Hanken Grotesk", -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: var(--font-body);
  font-size: 17px; line-height: 1.6;
  color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 800; letter-spacing: -.02em; line-height: 1.15;
}
p { max-width: 65ch; }
a { color: var(--accent-text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg { width: 1em; height: 1em; stroke-width: 2; vertical-align: -.125em; }

/* ---------- studio band (one full-bleed graphite section per page) ------- */
.band { background: var(--panel); color: var(--paper-inv); }
.band .muted, .band .kicker { color: var(--muted-inv); }
.band a { color: var(--paper-inv); }
.band hr, .band .hairline { border: 0; border-top: 1px solid var(--line-inv); }

/* ---------- keypad digits (the real-estate signal) ----------------------- */
.keypad { display: inline-flex; gap: 5px; }
.keypad .kd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.9em; height: 2.2em; padding: 0 .35em;
  background: var(--key); border: 1px solid var(--line-inv); border-radius: 6px;
  font-family: var(--font-display); font-weight: 800; font-stretch: 110%;
  color: var(--accent); font-size: .95em; line-height: 1;
}
.keypad.on-light .kd { background: var(--surface); border-color: var(--line); color: var(--accent-text); }
.keypad.sm .kd { font-size: .8em; min-width: 1.7em; height: 2em; }

/* ---------- waveform (sound-as-state) ------------------------------------ */
.wave { display: inline-flex; align-items: center; gap: 3px; height: 44px; }
.wave b {
  width: 4px; border-radius: 2px; background: var(--accent);
  height: calc(8px + var(--h, 10) * 1px);
}
.wave.playing b { animation: gf-wave 900ms ease-in-out infinite alternate; animation-delay: calc(var(--i, 0) * -80ms); }
@keyframes gf-wave { from { transform: scaleY(.45); } to { transform: scaleY(1.25); } }
.wave-btn {
  display: inline-flex; align-items: center; gap: 14px;
  background: none; border: 0; padding: 6px; cursor: pointer;
  border-radius: var(--r); font-family: inherit;
}
/* explicit play/pause affordance left of the wave (Leo, 28 Jul) */
.play-ic {
  flex-shrink: 0; width: 42px; height: 42px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--panel-2); border: 1px solid var(--line-inv); color: var(--accent);
}
.play-ic svg { width: 18px; height: 18px; }
.play-ic .p-pause { display: none; }
.is-playing .play-ic .p-play { display: none; }
.is-playing .play-ic .p-pause { display: block; }
.wave-btn:hover .play-ic { border-color: var(--accent); }
.on-light .play-ic, .play-ic.on-light { background: var(--surface); border-color: var(--line); color: var(--accent-text); }
/* first-tap loading: spinner INSIDE the circle — the button's DOM is never
   replaced (that's what used to make the wave vanish) */
.wave-btn.is-loading .play-ic .p-play, .wave-btn.is-loading .play-ic .p-pause { display: none; }
.wave-btn.is-loading .play-ic::after {
  content: ""; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent;
  animation: gf-rot .7s linear infinite;
}
@keyframes gf-rot { to { transform: rotate(360deg); } }
/* live analyser mode: inline transforms drive the bars — CSS loop off */
.wave.live b { animation: none; }
/* transient status in the label slot (e.g. AUDIO UNAVAILABLE) */
.wave-btn.show-label .playing-label { visibility: visible; }
.playing-label {
  font-family: var(--font-body); font-weight: 700; font-size: .78rem;
  letter-spacing: .04em; color: var(--accent); visibility: hidden;
}
.is-playing .playing-label { visibility: visible; }

/* caption typed during playback; complete when static / reduced motion */
.caption { font-family: var(--font-display); font-weight: 800; }
.caption .name { color: var(--accent); }
.caret { display: inline-block; width: 2px; height: 1em; background: var(--accent); vertical-align: -2px; animation: gf-caret 1s steps(1) infinite; }
@keyframes gf-caret { 50% { opacity: 0; } }

/* ---------- phone frame --------------------------------------------------- */
.phone {
  background: var(--panel-2); border-radius: 18px; padding: 8px;
  border: 1px solid var(--line-inv);
  width: 100%; max-width: 300px;
}
.phone .screen { background: var(--panel); border-radius: 12px; overflow: hidden; }

/* ---------- quick chips --------------------------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-pill); padding: 8px 16px;
  font-family: var(--font-body); font-weight: 700; font-size: .92rem; color: var(--ink);
  text-decoration: none; cursor: pointer;
}
.chip svg { color: var(--accent-text); }
.chip:hover { border-color: var(--accent); }
.band .chip { background: var(--panel-2); border-color: var(--line-inv); color: var(--paper-inv); }
.band .chip svg { color: var(--accent); }

/* ---------- buttons (one primary per screen) ------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--r-pill); padding: 13px 28px;
  font-family: var(--font-body); font-weight: 800; font-size: 1rem;
  cursor: pointer; text-decoration: none; border: 0;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
}
.btn.primary { background: var(--accent); color: var(--ink); }
.btn.primary:hover { transform: translateY(-1px); }
.btn.secondary { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn.secondary:hover { border-color: var(--muted); }
.band .btn.secondary { color: var(--paper-inv); border-color: var(--line-inv); }
.band .btn.secondary:hover { border-color: var(--muted-inv); }

/* ---------- cards / misc -------------------------------------------------- */
.card-lt {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-card); padding: 20px 22px;
}
.kicker {
  font-family: var(--font-body); font-weight: 700; font-size: .82rem;
  letter-spacing: .05em; color: var(--muted);
  display: inline-flex; align-items: center; gap: 8px;
}
.kicker .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.fineprint { font-size: .88rem; color: var(--muted); }
.band .fineprint { color: var(--muted-inv); }

input[type="text"], input[type="email"], input[type="url"], textarea {
  width: 100%; background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--r); padding: 12px 14px;
  font-family: var(--font-body); font-size: 16px; color: var(--ink);
}
input:focus, textarea:focus { outline: none; border-color: var(--accent); }
label { display: block; font-weight: 700; font-size: .92rem; margin: 14px 0 6px; }

/* ---------- motion discipline --------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .wave.playing b { animation: none; }
  .caret { animation: none; opacity: 0; }
  .kicker .dot { animation: none; }
  .wave-btn.is-loading .play-ic::after { animation-duration: 1.6s; }
  * { transition: none !important; }
}
