@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,300..600;1,14..32,300..500&family=Geist+Mono:wght@300..500&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Sacramento&display=swap');

/* ─── Tokens ─── */

:root {
  --bg:        #EDEAE4;
  --surface:   #F4F1EC;
  --text:      #27211B;
  --muted:     #7A726A;
  --faint:     #B0A89E;
  --border:    #D5CFC8;
  --border-faint: #E2DDD7;

  --sans:   'Inter', system-ui, -apple-system, sans-serif;
  --mono:   'Geist Mono', ui-monospace, 'SF Mono', monospace;
  --script: 'Sacramento', 'Snell Roundhand', 'Brush Script MT', cursive;

  --width:  620px;
  --pad:    clamp(1.5rem, 6vw, 2.5rem);

  --ease:   cubic-bezier(0.22, 0.61, 0.18, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #131110;
    --surface:   #1C1917;
    --text:      #E4DDD5;
    --muted:     #857D76;
    --faint:     #544E49;
    --border:    #2B2723;
    --border-faint: #201D1A;
  }
}

/* ─── Reset ─── */

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

html {
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-optical-sizing: auto;
  line-height: 1.55;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }

::selection { background: var(--border); color: var(--text); }

/* ─── Nav ─── */

.nav {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.375rem var(--pad);
  max-width: calc(var(--width) + var(--pad) * 2);
  margin: 0 auto;
  width: 100%;
}

.nav-brand {
  font-family: var(--sans);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--text);
  white-space: nowrap;
  transition: color 0.25s var(--ease-soft);
}

.nav-brand:hover { color: var(--muted); }

.nav-links {
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  position: relative;
  font-family: var(--sans);
  font-size: 0.76rem;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0;
  transition: color 0.25s var(--ease-soft);
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  opacity: 0.5;
  transition: transform 0.3s var(--ease);
}

.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { transform: scaleX(1); }
.nav-links a.active { color: var(--text); }
.nav-links a.active::after { transform: scaleX(1); }

/* ─── Language switcher ─── */

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding-left: 0.4rem;
  border-left: 1px solid var(--border-faint);
}

.lang-option {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.03em;
  color: var(--muted);
  opacity: 0.6;
  transition: color 0.25s var(--ease-soft), opacity 0.25s var(--ease-soft);
}

.lang-option:hover { color: var(--text); opacity: 1; }

.lang-option.active {
  color: var(--text);
  opacity: 1;
  font-weight: 500;
}

/* ─── Main container ─── */

.container {
  flex: 1;
  max-width: calc(var(--width) + var(--pad) * 2);
  margin: 0 auto;
  width: 100%;
  padding: 0 var(--pad);
  transition: opacity 0.35s var(--ease), filter 0.35s var(--ease);
}

.container.is-leaving {
  opacity: 0;
  filter: blur(6px);
}

/* Same blur-out used while the page content swaps languages. */
.container.lang-switching {
  opacity: 0;
  filter: blur(6px);
}

/* ─── Footer ─── */

footer {
  padding: 2rem var(--pad);
  max-width: calc(var(--width) + var(--pad) * 2);
  margin: 0 auto;
  width: 100%;
}

.footer-inner {
  border-top: 1px solid var(--border-faint);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.footer-text {
  font-size: 0.73rem;
  color: var(--faint);
}

.footer-links {
  display: flex;
  gap: 1.25rem;
}

.footer-links a {
  font-size: 0.73rem;
  color: var(--faint);
  transition: color 0.25s var(--ease-soft);
}

.footer-links a:hover { color: var(--muted); }

/* ─── Utility ─── */

[hidden] { display: none !important; }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ─── Admin panel ─── */

.admin-panel {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--text);
  color: var(--bg);
  border-radius: 6px;
  padding: 1rem 1.125rem;
  min-width: 220px;
  z-index: 100;
  box-shadow: 0 8px 40px rgba(0,0,0,0.22);
  animation: blurReveal 0.5s var(--ease) both;
}

.admin-panel p.eyebrow {
  color: var(--bg);
  opacity: 0.45;
  margin-bottom: 0.75rem;
}

.admin-actions { display: flex; flex-direction: column; gap: 0.35rem; }

.admin-btn {
  background: var(--bg);
  color: var(--text);
  border: none;
  border-radius: 3px;
  font-family: var(--sans);
  font-size: 0.78rem;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  text-align: left;
  transition: opacity 0.2s, transform 0.2s var(--ease-soft);
  width: 100%;
}

.admin-btn:hover:not(:disabled) { opacity: 0.78; transform: translateX(2px); }
.admin-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.admin-status {
  font-size: 0.7rem;
  opacity: 0.5;
  font-style: italic;
  margin-top: 0.6rem;
  min-height: 0.9rem;
}

/* ══════════════════════════════════════
   ANIMATIONS — blur-in reveal system
══════════════════════════════════════ */

@keyframes blurReveal {
  from {
    opacity: 0;
    filter: blur(14px);
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

@keyframes wordReveal {
  from {
    opacity: 0;
    filter: blur(10px);
    transform: translateY(0.4em);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Arrival reveal ──
   Static page content blurs in from the top down on each load, a focus pull
   sweeping downward. Declared here in CSS (rather than switched on by a script
   after the page loads) so the hidden start-state is present at the very first
   paint: the content can never flash fully-visible for a frame before the
   reveal begins.
   `backwards` (not `both`): the from-state holds through each element's delay,
   then hands back to the base styles — a filled `filter: blur(0)` would persist
   and silently defeat focus-mode's blur on the chrome.
   Only the top elements need a visible stagger; anything lower reveals
   off-screen, so a shared delay is plenty. */
.archive-heading,
.archive-subhead,
.archive-intro,
.about-heading,
.about-body > p,
.about-cta,
.how-heading,
.how-subhead,
.how-intro,
.flow,
.how-section,
.how-outro {
  animation: blurReveal 0.9s var(--ease) backwards;
}

/* Archive */
.archive-heading { animation-delay: 0.04s; }
.archive-subhead { animation-delay: 0.11s; }
.archive-intro   { animation-delay: 0.18s; }

/* About */
.about-heading                 { animation-delay: 0.04s; }
.about-body > p                { animation-delay: 0.32s; }
.about-body > p:nth-of-type(1) { animation-delay: 0.11s; }
.about-body > p:nth-of-type(2) { animation-delay: 0.18s; }
.about-body > p:nth-of-type(3) { animation-delay: 0.25s; }
.about-cta                     { animation-delay: 0.42s; }

/* How it works */
.how-heading { animation-delay: 0.04s; }
.how-subhead { animation-delay: 0.11s; }
.how-intro   { animation-delay: 0.18s; }
.flow        { animation-delay: 0.25s; }
.how-section { animation-delay: 0.32s; }
.how-outro   { animation-delay: 0.40s; }

/* Same blur-in for content rendered by JS after load (archive items). These are
   inserted into the page only once their data arrives, so they can't flash
   before the reveal; the class is applied with a per-item `--reveal-delay`. */
.reveal {
  animation: blurReveal 1s var(--ease) backwards;
  animation-delay: var(--reveal-delay, 0s);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-delay: 0s !important;
    transition-duration: 0.001s !important;
  }
  body.is-leaving { opacity: 1; filter: none; }
}

/* ══════════════════════════════════════
   HOME PAGE
══════════════════════════════════════ */

.home-wrap {
  padding-top: clamp(3.5rem, 8vh, 6rem);
  padding-bottom: 6rem;
}

.home-eyebrow {
  margin-bottom: 1.25rem;
  animation: blurReveal 0.7s var(--ease) both;
}

.question-text {
  font-family: var(--sans);
  font-size: clamp(1.35rem, 2.6vw, 1.7rem);
  line-height: 1.34;
  font-weight: 400;
  letter-spacing: -0.014em;
  color: var(--text);
  text-wrap: balance;
}

/* The quiet frame that tells a first-time visitor what they're taking part in,
   without explaining the whole project. Eases in after the question settles. */
.question-frame {
  margin-top: 1.25rem;
  max-width: 30rem;
  font-size: 0.82rem;
  line-height: 1.6;
  font-style: italic;
  color: var(--muted);
  animation: blurReveal 0.85s var(--ease) backwards;
  animation-delay: 0.6s;
}

.question-frame a {
  font-style: normal;
  white-space: nowrap;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--border);
  transition: color 0.25s var(--ease-soft), text-decoration-color 0.25s;
}

.question-frame a:hover { color: var(--text); text-decoration-color: var(--text); }

/* word-by-word blur-in */
.word {
  display: inline-block;
  opacity: 0;
  will-change: transform, filter, opacity;
  animation: wordReveal 0.6s var(--ease) forwards;
}

.response-area {
  margin-top: 3rem;
}

/* The input region blurs in gently, top to bottom, like everything else —
   the rule, the field, then the controls each clarify in sequence.
   `backwards` fill keeps them hidden until their turn, then hands control
   back to the base styles so focus/typing transitions stay free. */
.response-rule,
.response-textarea-wrap,
.response-footer {
  animation: blurReveal 0.85s var(--ease) backwards;
}

.response-rule         { animation-delay: 0.22s; }
.response-textarea-wrap { animation-delay: 0.32s; }
.response-footer       { animation-delay: 0.42s; }
.response-note         { animation: blurReveal 0.85s var(--ease) backwards; animation-delay: 0.55s; }

.response-rule {
  border: none;
  border-top: 1px solid var(--border);
  margin-bottom: 1.75rem;
}

.response-textarea-wrap {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1rem 1.125rem;
  background: var(--surface);
  cursor: text;
  transition: border-color 0.3s var(--ease-soft),
              box-shadow 0.3s var(--ease-soft),
              transform 0.3s var(--ease);
}

/* accent line that draws in when the field is engaged */
.response-textarea-wrap::after {
  content: '';
  position: absolute;
  left: 1.125rem;
  right: 1.125rem;
  bottom: -1px;
  height: 1.5px;
  background: var(--muted);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: center;
  opacity: 0;
  transition: transform 0.45s var(--ease), opacity 0.3s var(--ease-soft);
}

.response-textarea-wrap:focus-within {
  border-color: var(--muted);
  box-shadow: 0 6px 28px -18px rgba(0,0,0,0.4);
  transform: translateY(-1px);
}

.response-textarea-wrap:focus-within::after {
  transform: scaleX(1);
  opacity: 0.55;
}

/* ─── Typing feedback ───
   While the field is actively being typed in it settles onto a slightly
   deeper shadow and the accent line lifts — the page feels like it's
   listening. Transition-driven, so it never blocks a keystroke. */
.response-textarea-wrap.typing {
  box-shadow: 0 9px 34px -16px rgba(0, 0, 0, 0.5);
}

.response-textarea-wrap.typing::after {
  opacity: 0.85;
}

/* Each keystroke sends a soft glow rippling along the accent line. Only
   opacity and a faint bloom animate — the line's draw-in transform is left
   untouched — so typing stays instant. */
.response-textarea-wrap.type-pulse::after {
  animation: typePulse 0.5s var(--ease);
}

@keyframes typePulse {
  0%   { opacity: 0.85; box-shadow: 0 0 0 0 rgba(122, 114, 106, 0); }
  35%  { opacity: 1;    box-shadow: 0 1px 11px 0 rgba(122, 114, 106, 0.4); }
  100% { opacity: 0.85; box-shadow: 0 0 0 0 rgba(122, 114, 106, 0); }
}

.response-textarea {
  font-family: var(--mono);
  font-size: 0.9rem;
  line-height: 1.78;
  letter-spacing: -0.01em;
  color: var(--text);
  background: transparent;
  border: none;
  outline: none;
  width: 100%;
  resize: none;
  min-height: clamp(5rem, 15vh, 7.5rem);
  overflow: hidden;
  display: block;
}

.response-textarea::placeholder {
  color: var(--faint);
  transition: color 0.3s var(--ease-soft);
}

.response-textarea:disabled {
  color: var(--muted);
  -webkit-text-fill-color: var(--muted);
}

/* ghost layer used for the fly-away animation on send */
.fly-ghost {
  position: absolute;
  top: 1rem;
  left: 1.125rem;
  right: 1.125rem;
  font-family: var(--mono);
  font-size: 0.9rem;
  line-height: 1.78;
  letter-spacing: -0.01em;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  pointer-events: none;
  margin: 0;
}

.fly-ghost span {
  display: inline-block;
  white-space: pre;
  will-change: transform, filter, opacity;
}

.response-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.875rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease),
              filter 0.9s var(--ease);
}

.response-footer.fading {
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
}

.email-input {
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: -0.01em;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  outline: none;
  padding: 0.7rem 0.85rem;
  /* take whatever width is left over beside the Send control */
  flex: 1 1 auto;
  min-width: 0;
  transition: border-color 0.25s var(--ease-soft),
              box-shadow 0.25s var(--ease-soft);
}

.email-input:focus {
  border-color: var(--muted);
  box-shadow: 0 4px 20px -16px rgba(0,0,0,0.4);
}

.email-input::placeholder { color: var(--faint); }

.send-btn {
  background: var(--text);
  border: 1px solid var(--text);
  border-radius: 5px;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--bg);
  cursor: pointer;
  padding: 0.62rem 1.5rem;
  letter-spacing: 0;
  flex: 0 0 auto;
  /* muted until there is something to send */
  opacity: 0.4;
  transform: translateY(0);
  transition: opacity 0.3s var(--ease-soft),
              box-shadow 0.25s var(--ease-soft),
              transform 0.2s var(--ease);
  pointer-events: none;
}

.response-area.ready .send-btn {
  opacity: 1;
  pointer-events: auto;
}

.send-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px -14px rgba(0,0,0,0.55);
}

.send-btn:active:not(:disabled) { transform: translateY(0); box-shadow: none; }
.send-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* The line under the controls explaining what becomes of a response. */
.response-note {
  margin-top: 1.5rem;
  font-size: 0.72rem;
  line-height: 1.6;
  color: var(--faint);
  max-width: 34rem;
}

.response-note a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--border);
  transition: color 0.25s var(--ease-soft), text-decoration-color 0.25s;
}

.response-note a:hover { color: var(--text); text-decoration-color: var(--text); }

/* Submitted state — shown inside the response box, in place of the field */
.box-submitted {
  animation: blurReveal 0.6s var(--ease) both;
}

.submitted-note {
  font-size: 0.88rem;
  line-height: 1.62;
  color: var(--text);
  margin-bottom: 1.1rem;
}

.box-submitted-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
}

.submitted-link {
  font-size: 0.78rem;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--border);
  transition: color 0.25s var(--ease-soft), text-decoration-color 0.25s;
}

.submitted-link:hover { color: var(--text); text-decoration-color: var(--text); }

/* ── Email-notify card ──
   A distinct second surface beneath the thank-you: leave an address to be
   emailed once this question's reflection is published. Settles in just after
   the thank-you so the eye catches it as its own, separate invitation. */
.notify-card {
  margin-top: 1.5rem;
  padding: 1.15rem 1.25rem 1.05rem;
  background: var(--surface);
  border: 1px solid var(--border-faint);
  border-radius: 10px;
  animation: blurReveal 0.6s var(--ease) 0.22s both;
}

.notify-prompt {
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.32rem;
}

.notify-sub {
  font-size: 0.76rem;
  line-height: 1.55;
  color: var(--muted);
  margin-bottom: 0.85rem;
  max-width: 32rem;
}

.notify-form {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

/* Reuses .email-input for the field surface; just fill the row. */
.notify-input { flex: 1 1 auto; }

.notify-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  background: var(--text);
  color: var(--bg);
  border: 1px solid var(--text);
  border-radius: 5px;
  cursor: pointer;
  /* muted until the field holds a plausible address */
  opacity: 0.4;
  pointer-events: none;
  transition: opacity 0.3s var(--ease-soft),
              box-shadow 0.25s var(--ease-soft),
              transform 0.2s var(--ease);
}

.notify-card.ready .notify-btn { opacity: 1; pointer-events: auto; }
.notify-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 24px -14px rgba(0,0,0,0.55); }
.notify-btn:active { transform: translateY(0); box-shadow: none; }

.notify-card.sending .notify-input,
.notify-card.sending .notify-btn { opacity: 0.55; pointer-events: none; }

.notify-error {
  margin-top: 0.6rem;
  font-size: 0.74rem;
  font-style: italic;
  color: var(--muted);
}

.notify-note {
  margin-top: 0.7rem;
  font-size: 0.68rem;
  line-height: 1.5;
  color: var(--faint);
}

.notify-note a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--border);
  transition: color 0.25s var(--ease-soft), text-decoration-color 0.25s;
}

.notify-note a:hover { color: var(--text); text-decoration-color: var(--text); }

/* Prompt ↔ confirmation, toggled by the card's data-state. */
.notify-card[data-state="prompt"] .notify-confirm { display: none; }
.notify-card[data-state="done"]   .notify-ask { display: none; }

.notify-confirm {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  animation: blurReveal 0.5s var(--ease) both;
}

.notify-check {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
}

.notify-done {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text);
}

/* ══════════════════════════════════════
   FOCUS MODE — when the response field is engaged, the whole page
   recedes: nav, footer, the rule and the controls all soften out of
   focus and dim, so only the question and the field stay sharp.
   Everything eases back the instant the field is released.
══════════════════════════════════════ */

/* The chrome — header and footer — fully recedes: heavy blur, well dimmed.
   An explicit blur(0) start lets the filter animate smoothly (transitioning
   from `none` is unreliable across engines). translateZ(0) forces a
   compositing layer — without it Safari silently refuses to render the blur. */
.nav,
footer {
  filter: blur(0);
  transform: translateZ(0);
  will-change: filter;
  transition: filter 0.9s var(--ease), opacity 0.9s var(--ease);
}

/* The controls stay legible — they only soften slightly so the field clearly
   sits in front of them. The field itself lifts on a deeper shadow. */
.response-rule,
.response-footer,
.response-note,
.box-submitted {
  transition: opacity 0.9s var(--ease);
}

.question-text,
.response-textarea-wrap {
  transition: filter 0.9s var(--ease), opacity 0.9s var(--ease),
              transform 0.6s var(--ease), border-color 0.3s var(--ease-soft),
              box-shadow 0.5s var(--ease-soft);
}

body.focus-mode .nav,
body.focus-mode footer {
  filter: blur(8px);
  opacity: 0.2;
  pointer-events: none;
}

/* Email + Send stay readable, just quieted a little behind the live field. */
body.focus-mode .response-rule,
body.focus-mode .response-footer,
body.focus-mode .response-note,
body.focus-mode .box-submitted {
  opacity: 0.55;
}

body.focus-mode .question-text {
  opacity: 0.92;
}

/* The input box reads as the single foreground surface while typing. */
body.focus-mode .response-textarea-wrap {
  box-shadow: 0 18px 60px -22px rgba(0, 0, 0, 0.55);
}

/* ══════════════════════════════════════
   ARCHIVE PAGE
══════════════════════════════════════ */

.archive-wrap {
  padding-top: clamp(3rem, 7vh, 5rem);
  padding-bottom: 6rem;
}

.archive-heading {
  font-family: var(--sans);
  font-size: clamp(1.3rem, 3vw, 1.55rem);
  font-weight: 500;
  letter-spacing: -0.022em;
  margin-bottom: 0.5rem;
}

.archive-subhead {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.archive-intro {
  font-size: 0.9rem;
  line-height: 1.66;
  color: var(--text);
  max-width: 34rem;
  margin-bottom: 3.5rem;
}

.archive-list {
  list-style: none;
}

.archive-item {
  border-top: 1px solid var(--border-faint);
  padding: 1.75rem 0;
}

.archive-item:last-child {
  border-bottom: 1px solid var(--border-faint);
}

.archive-item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.6rem;
}

.archive-q-num {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--faint);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.archive-meta {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--faint);
  letter-spacing: 0.04em;
  text-align: right;
  white-space: nowrap;
}

.archive-question {
  font-family: var(--sans);
  font-size: 0.96rem;
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.archive-question.no-reflection {
  color: var(--muted);
}

.archive-toggle {
  background: none;
  border: none;
  font-family: var(--sans);
  font-size: 0.76rem;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--border);
  transition: color 0.25s var(--ease-soft), text-decoration-color 0.25s;
}

.archive-toggle:hover { color: var(--text); text-decoration-color: var(--text); }

/* When the toggle is scrolled to the top, leave a little air above it. */
.archive-toggle { scroll-margin-top: clamp(1rem, 3vh, 1.75rem); }

.archive-status {
  font-size: 0.76rem;
  color: var(--faint);
  font-style: italic;
}

.archive-question-teased {
  font-family: var(--sans);
  font-size: 0.96rem;
  line-height: 1.5;
  color: transparent;
  background: var(--border);
  border-radius: 2px;
  user-select: none;
  filter: blur(4px);
  pointer-events: none;
  margin-bottom: 0.75rem;
  /* text is a placeholder never sent from server */
}

.archive-teased-label {
  font-size: 0.76rem;
  color: var(--faint);
  font-style: italic;
}

.reflection-block {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-faint);
  overflow: hidden;
}

/* Each rendered block clarifies in sequence — the same gentle blur-in as the
   rest of the page, cascading line by line rather than landing all at once. */
.reflection-block > * {
  font-family: var(--sans);
  font-size: 0.93rem;
  line-height: 1.72;
  color: var(--text);
  margin-bottom: 1.15em;
  opacity: 0;
  filter: blur(8px);
  transform: translateY(10px);
  animation: blurReveal 0.8s var(--ease) forwards;
  animation-delay: var(--reveal-delay, 0s);
}

.reflection-block > *:last-child { margin-bottom: 0; }

/* Collapse: the reverse of the blur-in reveal — the reflection lifts, blurs and
   fades out as one before it's removed from the flow. */
.reflection-block.collapsing {
  animation: blurCollapse 0.5s var(--ease) forwards;
}

@keyframes blurCollapse {
  from { opacity: 1; filter: blur(0); transform: translateY(0); }
  to   { opacity: 0; filter: blur(8px); transform: translateY(-8px); }
}

.reflection-block h4 {
  font-size: 1.02rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  margin-bottom: 0.7em;
}

.reflection-block h5 {
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 0.6em;
}

.reflection-block ul,
.reflection-block ol {
  padding-left: 1.25em;
}

.reflection-block li { margin-bottom: 0.4em; }

.reflection-block blockquote {
  border-left: 2px solid var(--border);
  padding-left: 1em;
  color: var(--muted);
  font-style: italic;
}

.reflection-block strong { font-weight: 600; color: var(--text); }
.reflection-block em { font-style: italic; }

.reflection-block a {
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--border);
  transition: text-decoration-color 0.25s;
}

.reflection-block a:hover { text-decoration-color: var(--text); }

.reflection-block code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--surface);
  padding: 0.05em 0.35em;
  border-radius: 3px;
}

/* ══════════════════════════════════════
   ABOUT PAGE
══════════════════════════════════════ */

.about-wrap {
  padding-top: clamp(3rem, 7vh, 5rem);
  padding-bottom: 6rem;
  max-width: 560px;
}

.about-heading {
  font-family: var(--sans);
  font-size: clamp(1.3rem, 3vw, 1.55rem);
  font-weight: 500;
  letter-spacing: -0.022em;
  margin-bottom: 2.5rem;
}

.about-body p {
  font-family: var(--sans);
  font-size: 0.95rem;
  line-height: 1.72;
  color: var(--text);
  margin-bottom: 1.3em;
}

.about-body p:last-child { margin-bottom: 0; }

.about-body .note {
  font-style: italic;
  color: var(--muted);
}

/* ─── Signature: a script name that draws itself on, then an underline swash ─── */

.about-signoff {
  margin-top: 2.6rem;
  display: inline-block;
  color: var(--muted);
  /* Hold the from-state through the delay so nothing flashes before it writes. */
  animation: fadeIn 0.3s var(--ease-soft) both;
  animation-delay: 0.7s;
}

.about-signature {
  display: block;
  font-family: var(--script);
  font-size: clamp(2.1rem, 7vw, 2.7rem);
  font-weight: 400;
  line-height: 1.15;
  color: var(--text);
  /* The pen sweep: reveal left to right. Top/bottom are slack so the script's
     tall capital and ascenders (and any descenders) are never clipped. */
  clip-path: inset(-0.35em 100% -0.3em 0);
  animation: signWrite 1.15s var(--ease) forwards;
  animation-delay: 0.8s;
}

.sig-flourish {
  display: block;
  width: clamp(120px, 30vw, 165px);
  height: 18px;
  margin-top: 0.05rem;
  margin-left: 0.1rem;
  overflow: visible;
  color: var(--faint);
}

.sig-flourish path {
  stroke-dasharray: 320;
  stroke-dashoffset: 320;
  animation: sigDraw 0.85s var(--ease) forwards;
  /* Start once the name has nearly finished writing. */
  animation-delay: 1.75s;
}

@keyframes signWrite {
  from { clip-path: inset(-0.35em 100% -0.3em 0); }
  to   { clip-path: inset(-0.35em 0 -0.3em 0); }
}

@keyframes sigDraw {
  to { stroke-dashoffset: 0; }
}

.about-cta {
  margin-top: 3rem;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.about-cta a {
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--border);
  transition: color 0.25s var(--ease-soft), text-decoration-color 0.25s;
}

.about-cta a:hover { color: var(--text); text-decoration-color: var(--text); }

/* ══════════════════════════════════════
   HOW IT WORKS (technical deep dive)
══════════════════════════════════════ */

.how-wrap {
  padding-top: clamp(3rem, 7vh, 5rem);
  padding-bottom: 6rem;
  max-width: 600px;
}

.how-heading {
  font-family: var(--sans);
  font-size: clamp(1.3rem, 3vw, 1.55rem);
  font-weight: 500;
  letter-spacing: -0.022em;
  margin-bottom: 0.5rem;
}

.how-subhead {
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 2.4rem;
}

.how-intro {
  font-family: var(--sans);
  font-size: 0.95rem;
  line-height: 1.72;
  color: var(--text);
  margin-bottom: 2.6rem;
}

.how-section { margin-bottom: 2.1rem; }

.how-section h2 {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--muted);
  margin-bottom: 0.7rem;
}

.how-section p {
  font-family: var(--sans);
  font-size: 0.95rem;
  line-height: 1.72;
  color: var(--text);
  margin-bottom: 0.8em;
}

.how-section p:last-child { margin-bottom: 0; }

.how-section ul {
  list-style: none;
  margin: 0.5rem 0 0.2rem;
  padding: 0;
}

.how-section li {
  position: relative;
  padding-left: 1.15rem;
  margin-bottom: 0.55rem;
  font-family: var(--sans);
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text);
}

.how-section li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--faint);
}

.how-section li b { font-weight: 500; }

.how-outro {
  font-family: var(--sans);
  font-size: 0.95rem;
  line-height: 1.72;
  font-style: italic;
  color: var(--muted);
  margin: 2.6rem 0 0;
}

/* ─── The sketch: a vertical flow of the loop ─── */

.flow {
  margin: 0 0 3rem;
  padding: 1.7rem 1.4rem 1.6rem;
  background: var(--surface);
  border: 1px solid var(--border-faint);
  border-radius: 12px;
}

.flow-caption {
  font-family: var(--mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--faint);
  text-align: center;
  margin-bottom: 1.4rem;
}

.flow-node {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0.7rem 0.85rem;
}

.flow-num {
  flex: none;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
}

.flow-text {
  font-family: var(--sans);
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text);
}

.flow-tag {
  margin-left: auto;
  flex: none;
  align-self: flex-start;
  font-family: var(--mono);
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.18rem 0.42rem;
  border-radius: 5px;
}

.flow-private .flow-tag { color: var(--muted); background: var(--border-faint); }
.flow-public .flow-tag  { color: var(--surface); background: var(--muted); }

.flow-gate {
  border-style: dashed;
  border-color: var(--muted);
  background: transparent;
}

.flow-gate .flow-text { font-weight: 500; }

/* Connector: a thin line with a small chevron, drawn between nodes. */
.flow-link {
  position: relative;
  height: 26px;
}

.flow-link::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 6px;
  width: 1px;
  background: var(--border);
  transform: translateX(-50%);
}

.flow-link::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 6px;
  height: 6px;
  border-right: 1px solid var(--muted);
  border-bottom: 1px solid var(--muted);
  transform: translate(-50%, 0) rotate(45deg);
}

.flow-branch {
  font-family: var(--sans);
  font-size: 0.76rem;
  font-style: italic;
  color: var(--muted);
  text-align: center;
  margin: 0.8rem 0 0.1rem;
}

.flow-loop {
  font-family: var(--mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--faint);
  text-align: center;
  margin-top: 1.5rem;
}

/* ─── Mic button (main page → navigates to /record.html) ─── */

.voice-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.62rem 1.1rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.2s var(--ease-soft), border-color 0.2s var(--ease-soft);
}

.voice-btn:hover {
  color: var(--text);
  border-color: var(--muted);
}

/* ══════════════════════════════════════
   RECORD PAGE
══════════════════════════════════════ */

.record-wrap {
  padding-top: clamp(3.5rem, 8vh, 6rem);
  padding-bottom: 6rem;
}

.record-eyebrow {
  margin-bottom: 1.25rem;
}

.record-rule {
  margin-bottom: 2rem;
}

/* Spectrogram canvas */
.waveform {
  display: block;
  width: 100%;
  height: 140px;
  border-radius: 3px;
}

/* Meta row: status text left, timer right */
.record-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 1rem;
}

.record-status {
  font-size: 0.8rem;
  color: var(--faint);
  letter-spacing: 0.01em;
  transition: color 0.4s var(--ease-soft);
}

.record-status.rec-status-live {
  color: #c0392b;
}

.record-timer {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  color: var(--faint);
}

/* Thin time-progress bar */
.record-progress {
  width: 100%;
  height: 1px;
  background: var(--border-faint);
  border-radius: 1px;
  margin-top: 0.6rem;
  overflow: hidden;
}

.record-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--muted);
  border-radius: 1px;
  transition: width 1s linear;
}

/* The big record / stop button */
.record-btn-wrap {
  display: flex;
  justify-content: center;
  margin-top: 2.5rem;
}

.record-btn {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.25s var(--ease-soft),
              color 0.25s var(--ease-soft),
              background 0.25s var(--ease-soft),
              transform 0.2s var(--ease);
}

.record-btn:hover:not(:disabled) {
  border-color: var(--muted);
  color: var(--text);
  transform: scale(1.04);
}

.record-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* Recording state: red ring pulse */
.record-btn.is-recording {
  border-color: rgba(192, 57, 43, 0.55);
  color: #c0392b;
  background: rgba(192, 57, 43, 0.06);
  animation: recRing 1.8s ease-out infinite;
}

.record-btn.is-uploading {
  border-color: rgba(192, 57, 43, 0.3);
  color: #c0392b;
  opacity: 0.5;
}

@keyframes recRing {
  0%   { box-shadow: 0 0 0 0   rgba(192, 57, 43, 0.30); }
  65%  { box-shadow: 0 0 0 14px rgba(192, 57, 43, 0);   }
  100% { box-shadow: 0 0 0 0   rgba(192, 57, 43, 0);    }
}

/* Icon swap */
.rec-icon-mic  { display: block; }
.rec-icon-stop { display: none;  }
.record-btn.is-recording .rec-icon-mic,
.record-btn.is-uploading .rec-icon-mic  { display: none;  }
.record-btn.is-recording .rec-icon-stop,
.record-btn.is-uploading .rec-icon-stop { display: block; }

/* Permission-denied / error note */
.record-denied {
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
  text-align: center;
  margin-top: 1.75rem;
}

/* Submitted state on the record page */
.record-submitted {
  margin-top: 2.5rem;
  animation: blurReveal 0.7s var(--ease) both;
}

.rec-back-link {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.78rem;
  color: var(--faint);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--border);
  transition: color 0.25s var(--ease-soft), text-decoration-color 0.25s;
}

.rec-back-link:hover { color: var(--muted); text-decoration-color: var(--muted); }

/* ─── Mobile ─── */

@media (max-width: 540px) {
  .response-footer { flex-direction: column; align-items: stretch; gap: 0.75rem; }
  .email-input { width: 100%; }
  .send-btn { width: 100%; text-align: center; }
  .voice-btn { width: 100%; justify-content: center; }
  .archive-item-header { flex-direction: column; gap: 0.25rem; }
  .archive-meta { text-align: left; }
  .admin-panel { bottom: 1rem; right: 1rem; left: 1rem; min-width: 0; }
  .footer-inner { flex-direction: column; gap: 0.5rem; }

  .home-wrap {
    padding-top: clamp(1.25rem, 4vh, 2.5rem);
    padding-bottom: 1.5rem;
  }

  .question-frame { margin-top: 1rem; }

  .response-area { margin-top: 1.75rem; }

  .response-rule { margin-bottom: 1.25rem; }

  .response-note { margin-top: 1.1rem; }
}

/* ─── Admin ─── */

.nav-end {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-admin-label {
  font-size: 0.76rem;
  color: var(--muted);
  font-weight: 500;
}

.admin-logout-btn {
  font-family: var(--sans);
  font-size: 0.76rem;
  color: var(--muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
}

.admin-logout-btn:hover {
  color: var(--text);
  border-color: var(--text);
}

.admin-main {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem var(--pad) 4rem;
  flex: 1;
}

.admin-section-title {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.admin-active {
  padding-bottom: 2rem;
}

.admin-question-text {
  font-size: 1.05rem;
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.admin-stats {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.admin-actions {
  display: flex;
  gap: 0.625rem;
  flex-wrap: wrap;
}

.admin-btn {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}

.admin-btn:hover {
  border-color: var(--text);
}

.admin-btn-secondary {
  color: var(--muted);
}

.admin-action-status {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.75rem;
  min-height: 1.2em;
}

.admin-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0 0 1.5rem;
}

.admin-question-list {
  display: flex;
  flex-direction: column;
}

.admin-question-row {
  border-top: 1px solid var(--border-faint);
}

.admin-question-row:last-child {
  border-bottom: 1px solid var(--border-faint);
}

.admin-question-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  width: 100%;
  padding: 0.875rem 0;
  background: none;
  border: none;
  color: inherit;
  font-family: var(--sans);
  font-size: 0.88rem;
  cursor: pointer;
  text-align: left;
}

.admin-toggle {
  font-size: 0.7rem;
  color: var(--faint);
  width: 0.75rem;
  flex-shrink: 0;
}

.admin-question-label {
  flex: 1;
  color: var(--muted);
}

.admin-question-label em {
  font-style: normal;
  color: var(--text);
}

.admin-question-meta {
  font-size: 0.75rem;
  color: var(--faint);
  white-space: nowrap;
}

.admin-question-detail {
  padding-bottom: 1.5rem;
}

.admin-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 0.875rem;
}

.admin-tab {
  font-family: var(--sans);
  font-size: 0.78rem;
  padding: 0.3rem 0.7rem;
  border-radius: 4px;
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
}

.admin-tab.active {
  background: var(--surface);
  color: var(--text);
}

.admin-tab:hover:not(.active) {
  color: var(--text);
}

.admin-tab-content {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.admin-loading,
.admin-empty {
  font-size: 0.82rem;
  color: var(--muted);
  padding: 0.25rem 0;
}

.admin-response-row {
  padding: 0.75rem;
  background: var(--surface);
  border-radius: 6px;
  border: 1px solid var(--border-faint);
}

.admin-response-text {
  font-size: 0.85rem;
  line-height: 1.5;
  margin-bottom: 0.5rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.admin-response-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: var(--muted);
}

.admin-delete-btn {
  font-family: var(--sans);
  font-size: 0.72rem;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.admin-delete-btn:hover {
  color: #c0392b;
}

.admin-rejection-row {
  padding: 0.625rem 0.75rem;
  background: var(--surface);
  border-radius: 6px;
  border: 1px solid var(--border-faint);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  opacity: 0.75;
}

.admin-rejection-badge {
  font-family: var(--mono);
  font-size: 0.68rem;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  background: var(--border);
  color: var(--muted);
  align-self: flex-start;
}

.admin-rejection-meta {
  font-size: 0.7rem;
  color: var(--faint);
}

.admin-subscriber-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-faint);
}

.admin-subscriber-row:last-child {
  border-bottom: none;
}

.admin-sub-status {
  font-size: 0.72rem;
  color: var(--faint);
}

.admin-sub-status.notified {
  color: var(--muted);
}
