/* =============================================================================
   secret.onfiremedia.com — application stylesheet
   Requires tokens.css to be loaded FIRST.
   Owner: design. Copy verbatim into public/app.css.

   RULES THIS FILE HONORS
   - No external requests: no @import, no @font-face, no url(). SVG is inline in
     the HTML, not referenced from CSS.
   - CSP-safe: every rule lives here. The HTML carries no style= attribute and
     no inline <style>, and JS never writes one either. Every visual state is
     driven by a class or a data-* attribute, both of which are plain
     setAttribute/classList calls that a strict style-src cannot break.
   - Selector discipline: single-class selectors, one level of nesting max, no
     element+class collisions. Modifiers are --suffix on the same block.
   ============================================================================= */

/* ---------------------------------------------------------------------------
   1. RESET + BASE
   --------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

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

h1, h2, h3, h4, p, ul, ol, figure, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
  margin: 0;
}

/* ---------------------------------------------------------------------------
   2. FOCUS — one ring, everywhere, always visible.
   --------------------------------------------------------------------------- */
:focus-visible {
  outline: var(--ring-w) solid var(--focus);
  outline-offset: var(--ring-offset);
  border-radius: var(--r-sm);
}
/* Keyboard users only; pointer clicks stay quiet. Never remove the ring. */
:focus:not(:focus-visible) { outline: none; }

.skip-link {
  position: absolute;
  left: var(--sp-4);
  top: var(--sp-4);
  z-index: 20;
  transform: translateY(-160%);
  background-color: var(--surface);
  color: var(--ink);
  border: 2px solid var(--focus);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  font-weight: 650;
  text-decoration: none;
}
.skip-link:focus { transform: translateY(0); }

/* ---------------------------------------------------------------------------
   3. TYPOGRAPHY PRIMITIVES

   THE ONE TYPE RULE OF THIS PRODUCT:
   anything a MACHINE produced (the secret, the link, a token, a count) is set
   in --font-mono. Anything a HUMAN wrote is set in --font-body / --font-display.
   Follow it without exception; it is the system.
   --------------------------------------------------------------------------- */
.h1, .h2 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: var(--track-display);
  line-height: var(--lh-tight);
  color: var(--ink);
  text-wrap: balance;
}
.h1 { font-size: var(--step-4); }
.h2 { font-size: var(--step-3); }
.lead {
  font-size: var(--step-1);
  line-height: var(--lh-snug);
  color: var(--ink-2);
  text-wrap: pretty;
}

.prose-tight { color: var(--ink-2); max-width: 60ch; font-size: var(--step--1); line-height: var(--lh-loose); }

/* Eyebrow: the utility voice. Small caps-ish, wide tracking, never a heading. */
.eyebrow {
  display: block;
  font-family: var(--font-body);
  font-size: var(--step--2);
  font-weight: 700;
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: #FF6727;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.95em;
  font-variant-ligatures: none;
}

.link {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
.link:hover { color: var(--accent-hover); }

.emph { color: var(--ink); font-weight: 650; }

/* ---------------------------------------------------------------------------
   4. PAGE LAYOUT
   --------------------------------------------------------------------------- */
.page-header {
  border-bottom: 1px solid var(--line);
  background-color: var(--surface);
}
.page-header-inner {
  max-width: var(--shell-form);
  margin-inline: auto;
  padding: var(--sp-4) var(--shell-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  text-decoration: none;
  color: inherit;
  border-radius: var(--r-md);
}
.brand-mark { flex: none; width: 22px; height: 32px; color: var(--brand-orange); }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-org {
  font-size: var(--step--2);
  font-weight: 700;
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--ink-3);
}
.brand-name {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-top: 3px;
}

.page-main {
  flex: 1 1 auto;
  width: 100%;
  padding-block: var(--sp-7) var(--sp-9);
}
@media (min-width: 40rem) { .page-main { padding-block: var(--sp-8) var(--sp-10); } }

.shell {
  width: 100%;
  max-width: var(--shell-form);
  margin-inline: auto;
  padding-inline: var(--shell-pad);
}
.shell--narrow { max-width: var(--shell-narrow); }

.page-footer {
  border-top: 1px solid var(--line);
  background-color: var(--surface);
  padding-block: var(--sp-6);
  font-size: var(--step--1);
  color: var(--ink-2);
}
.page-footer-inner {
  max-width: var(--shell-form);
  margin-inline: auto;
  padding-inline: var(--shell-pad);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3) var(--sp-5);
}
.footer-links { display: flex; flex-wrap: wrap; gap: var(--sp-4); }

/* ---------------------------------------------------------------------------
   5. INTRO (the thesis block above the form)
   --------------------------------------------------------------------------- */
.intro { margin-bottom: var(--sp-7); }
.intro > * + * { margin-top: var(--sp-4); }

/* ---------------------------------------------------------------------------
   6. SHEET — one continuous surface. Field groups are separated by hairlines,
   NOT by nested cards. This is what keeps it from reading as a Bootstrap form.
   --------------------------------------------------------------------------- */
.sheet {
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sheet);
  overflow: hidden;
}
.fieldgroup {
  padding: var(--sp-6) var(--sp-5);
  border-top: 1px solid var(--line);
}
.fieldgroup:first-child { border-top: 0; }
@media (min-width: 40rem) { .fieldgroup { padding: var(--sp-6); } }

.fieldgroup-head { margin-bottom: var(--sp-3); }
.fieldgroup-head > .eyebrow + .field-label { margin-top: var(--sp-1); }

.field-label {
  display: block;
  font-weight: 650;
  font-size: var(--step-0);
  color: var(--ink);
  line-height: var(--lh-snug);
}
.field-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
}
.field-optional { font-weight: 400; color: var(--ink-3); font-size: var(--step--1); }

.hint {
  display: block;
  margin-top: var(--sp-2);
  font-size: var(--step--1);
  line-height: var(--lh-loose);
  color: var(--ink-2);
  max-width: 62ch;
}
.hint--above { margin-top: 0; margin-bottom: var(--sp-3); }

/* The one place a legend/fieldset is used, reset to behave like a label. */
.fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.legend { padding: 0; display: block; }

/* ---------------------------------------------------------------------------
   7. BUTTONS
   --------------------------------------------------------------------------- */
.btn {
  --btn-bg: transparent;
  --btn-ink: var(--ink);
  --btn-line: var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: var(--control-h);
  padding: 0 var(--sp-5);
  background-color: var(--btn-bg);
  color: var(--btn-ink);
  border: 1px solid var(--btn-line);
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: var(--step-0);
  font-weight: 650;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease);
}
.btn:hover { background-color: var(--surface-hover); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.btn:disabled:hover, .btn[aria-disabled="true"]:hover { background-color: var(--btn-bg); }
.btn > .icon { flex: none; }

.btn--primary {
  --btn-bg: var(--btn-primary-bg);
  --btn-ink: var(--btn-primary-ink);
  --btn-line: var(--btn-primary-bg);
  font-weight: 750;
}
.btn--primary:hover {
  background-color: var(--btn-primary-bg-hover);
  border-color: var(--btn-primary-bg-hover);
  /* The only glow in the product. Spend the boldness once. */
  box-shadow: 0 0 0 4px var(--btn-primary-glow);
}

.btn--ghost { --btn-bg: transparent; --btn-line: var(--line-strong); }

.btn--quiet {
  --btn-line: transparent;
  --btn-ink: var(--ink-2);
  padding-inline: var(--sp-3);
  font-weight: 600;
}
.btn--quiet:hover { --btn-ink: var(--ink); }

.btn--danger { --btn-ink: var(--danger); --btn-line: var(--danger-line); }
.btn--danger:hover { background-color: var(--danger-bg); }

.btn--lg { min-height: var(--control-h-lg); font-size: var(--step-1); padding-inline: var(--sp-7); }
.btn--block { display: flex; width: 100%; }

.btn--icon {
  padding: 0;
  width: var(--control-h);
  min-height: var(--control-h);
  flex: none;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
}
/* Theme toggle lives in the header; icons swap by data-theme on <html>. */
.theme-toggle { --btn-line: var(--line); width: var(--control-h); padding: 0; flex: none; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun  { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun  { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: block; }
}

/* ---------------------------------------------------------------------------
   8. TEXT INPUTS
   --------------------------------------------------------------------------- */
.input, .textarea {
  display: block;
  width: 100%;
  background-color: var(--surface-sunken);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: var(--lh-snug);
  transition: border-color var(--dur-fast) var(--ease),
              background-color var(--dur-fast) var(--ease);
}
.input { min-height: var(--control-h); }
.input:hover, .textarea:hover { border-color: var(--ink-3); }
.input::placeholder, .textarea::placeholder { color: var(--ink-3); opacity: 1; }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); border-width: 2px; }

.input--mono, .textarea--mono {
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  line-height: 1.55;
  font-variant-ligatures: none;
}

.textarea {
  min-height: 9.5rem;
  resize: vertical;
  field-sizing: content;
  max-height: 24rem;
}

/* Field + trailing button (passphrase show/hide, link + copy). */
.input-affix { display: flex; align-items: stretch; gap: var(--sp-2); }
.input-affix > .input { flex: 1 1 auto; min-width: 0; }
.input-affix > .btn { flex: none; }

/* Character counter parked under the textarea, right-aligned. */
.counter-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-top: var(--sp-2);
}
.counter {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
  white-space: nowrap;
}
.counter[data-state="warn"] { color: var(--warn); }
.counter[data-state="over"] { color: var(--danger); font-weight: 700; }

/* ---------------------------------------------------------------------------
   9. CHECKBOXES
   --------------------------------------------------------------------------- */
/* A <div>, not a wrapping <label>. The hint must NOT end up inside the
   accessible name, so the <label for> covers only .check-text and the hint is
   attached with aria-describedby. */
.check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--sp-1) var(--sp-3);
  align-items: start;
  padding: var(--sp-2) 0;
}
.check + .check { border-top: 1px solid var(--line); margin-top: var(--sp-2); padding-top: var(--sp-4); }
.check-input {
  grid-column: 1;
  grid-row: 1;
  appearance: none;
  -webkit-appearance: none;
  width: 1.375rem;
  height: 1.375rem;
  margin-top: 0.15rem;
  flex: none;
  border: 2px solid var(--line-strong);
  border-radius: var(--r-sm);
  background-color: var(--surface);
  cursor: pointer;
  display: grid;
  place-content: center;
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.check-input::after {
  content: "";
  width: 0.75rem;
  height: 0.4375rem;
  border-left: 2.5px solid var(--btn-primary-ink);
  border-bottom: 2.5px solid var(--btn-primary-ink);
  transform: rotate(-45deg) translate(1px, -1px);
  opacity: 0;
}
.check-input:checked { background-color: var(--brand-orange); border-color: var(--brand-orange); }
.check-input:checked::after { opacity: 1; }
.check-input:hover { border-color: var(--ink-3); }
.check-text { grid-column: 2; grid-row: 1; font-weight: 600; color: var(--ink); line-height: var(--lh-snug); cursor: pointer; }
.check-hint { grid-column: 2; grid-row: 2; font-size: var(--step--1); color: var(--ink-2); line-height: var(--lh-loose); }

/* ---------------------------------------------------------------------------
   10. CHIPSET — quick picks. Real <button>s in the form, real <input type=radio>
   in the generator (see .segmented).
   --------------------------------------------------------------------------- */
.chipset {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
/* Presets are radio-backed .segment markup. In a .chipset they read as pills;
   in the generator (.chipset--mono) they show literal separator glyphs, so
   they stay monospace. */
.chipset > .segment > .segment-label {
  border-radius: var(--r-pill);
  padding-inline: var(--sp-4);
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
}
.chipset--mono > .segment > .segment-label {
  font-family: var(--font-mono);
  padding-inline: var(--sp-3);
}
/* Radio-backed segmented control (generator separator). */
.segment { position: relative; display: inline-flex; }
.segment-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.segment-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  min-width: 3rem;
  padding: 0 var(--sp-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background-color: var(--surface);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}
.segment-input:hover + .segment-label { background-color: var(--surface-hover); color: var(--ink); }
.segment-input:checked + .segment-label {
  background-color: var(--brand-orange);
  border-color: var(--brand-orange);
  color: var(--ink-on-brand);
}
.segment-input:focus-visible + .segment-label {
  outline: var(--ring-w) solid var(--focus);
  outline-offset: var(--ring-offset);
}

/* ---------------------------------------------------------------------------
   11. THE LIFETIME CONTROL — the pair of expiry dials.

   Each dial = a radio-backed preset chipset + a numeric stepper.
   The number input is the single source of truth; the presets are a shortcut
   that writes into it. There is deliberately NO range slider — see DESIGN.md,
   "Why the expiry controls look like this".
   --------------------------------------------------------------------------- */
.lifetime { display: grid; gap: var(--sp-6); }
@media (min-width: 46rem) { .lifetime { grid-template-columns: 1fr 1fr; gap: var(--sp-6) var(--sp-7); } }

/* A dial is a <fieldset>. Keep it display:block — Firefox lays <legend> out
   incorrectly inside a grid or flex fieldset — and grid the inner .dial-body. */
.dial { display: block; }
.dial-label {
  font-weight: 650;
  color: var(--ink);
  font-size: var(--step-0);
  line-height: var(--lh-snug);
}
.dial-body { display: grid; gap: var(--sp-4); margin-top: var(--sp-3); }
.dial-custom { display: grid; gap: var(--sp-2); }
.dial-custom-label {
  font-size: var(--step--2);
  font-weight: 700;
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--ink-3);
}
.dial-custom-row { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.dial-unit { font-size: var(--step--1); color: var(--ink-2); }
.dial-range { color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* Stepper: −  [ 7 ]  + */
.stepper {
  display: inline-flex;
  align-items: stretch;
  flex: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background-color: var(--surface-sunken);
  overflow: hidden;
}
.stepper-btn {
  width: 2.5rem;
  min-height: var(--control-h);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  border: 0;
  color: var(--ink-2);
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.stepper-btn:hover { background-color: var(--surface-hover); color: var(--ink); }
.stepper-btn:disabled { opacity: 0.35; cursor: not-allowed; background-color: transparent; }
.stepper-input {
  width: 3.25rem;
  min-height: var(--control-h);
  border: 0;
  border-inline: 1px solid var(--line-strong);
  background-color: var(--surface);
  color: var(--ink);
  text-align: center;
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
  appearance: textfield;
}
.stepper-input::-webkit-outer-spin-button,
.stepper-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Live sentence under the pair. */
.lifetime-summary {
  margin-top: var(--sp-5);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3) var(--sp-4);
}
.lifetime-summary-text {
  font-size: var(--step--1);
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------------------
   12. EMBER METER — the signature.
   A row of small diamonds: one per remaining view, hollow for views already
   spent. It encodes a real quantity, so it earns its place. Above 10 views the
   marks stop being countable, so the meter hides itself and the numeric
   readout carries the information instead (set data-overflow="true").
   --------------------------------------------------------------------------- */
.ember-meter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
}
.ember-meter[data-overflow="true"] { display: none; }
.ember {
  width: 10px;
  height: 10px;
  flex: none;
  border-radius: 2px;
  transform: rotate(45deg);
  border: 1.5px solid var(--line-strong);
  background-color: transparent;
}
.ember[data-state="lit"] { background-color: var(--graphic); border-color: var(--graphic); }
/* The numeric stand-in. Exactly one of .ember-meter / .ember-readout is shown;
   both carry the same data-overflow value and the CSS picks. */
.ember-readout {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ember-readout[data-overflow="false"] { display: none; }

/* ---------------------------------------------------------------------------
   13. DISCLOSURE (More options, FAQ, generator)
   --------------------------------------------------------------------------- */
.disclosure { border: 0; }
.disclosure-summary {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: var(--control-h);
  padding: var(--sp-2) 0;
  font-weight: 650;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  border-radius: var(--r-sm);
}
.disclosure-summary::-webkit-details-marker { display: none; }
.disclosure-summary:hover { color: var(--accent); }
.disclosure-chevron {
  flex: none;
  color: var(--ink-3);
  transition: transform var(--dur-fast) var(--ease);
}
.disclosure[open] > .disclosure-summary > .disclosure-chevron { transform: rotate(90deg); }
.disclosure-body { padding-top: var(--sp-2); }

/* ---------------------------------------------------------------------------
   14. GENERATOR PANEL
   --------------------------------------------------------------------------- */
.genpanel {
  margin-top: var(--sp-3);
  padding: var(--sp-5);
  background-color: var(--surface-sunken);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  display: grid;
  gap: var(--sp-5);
}
.genpanel-grid { display: grid; gap: var(--sp-5); }
@media (min-width: 34rem) { .genpanel-grid { grid-template-columns: 1fr 1fr; } }

.genpanel-field { display: grid; gap: var(--sp-2); align-content: start; }
.genpanel-field-label { font-size: var(--step--1); font-weight: 700; color: var(--ink); }

.genpanel-preview {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: var(--control-h);
  padding: var(--sp-2) var(--sp-4);
  background-color: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  color: var(--ink);
  overflow-x: auto;
  overflow-wrap: anywhere;
}
.genpanel-preview[data-empty="true"] { color: var(--ink-3); font-style: normal; }

/* ---------------------------------------------------------------------------
   15. CALLOUTS + INLINE MESSAGES
   --------------------------------------------------------------------------- */
.callout {
  --callout-ink: var(--ink-2);
  --callout-bg: var(--surface-sunken);
  --callout-line: var(--line);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--sp-3);
  align-items: start;
  padding: var(--sp-4);
  background-color: var(--callout-bg);
  border: 1px solid var(--callout-line);
  border-radius: var(--r-md);
  font-size: var(--step--1);
  line-height: var(--lh-loose);
  color: var(--callout-ink);
}
.callout--warn   { --callout-bg: var(--warn-bg);   --callout-line: var(--warn-line);   --callout-ink: var(--warn); }
.callout--danger { --callout-bg: var(--danger-bg); --callout-line: var(--danger-line); --callout-ink: var(--danger); }
.callout--ok     { --callout-bg: var(--ok-bg);     --callout-line: var(--ok-line);     --callout-ink: var(--ok); }
.callout--info   { --callout-bg: var(--info-bg);   --callout-line: var(--info-line);   --callout-ink: var(--info); }
.callout-icon { flex: none; margin-top: 1px; }
.callout-title { display: block; font-weight: 700; margin-bottom: var(--sp-1); }
.callout-body { color: inherit; }
.callout:empty { display: none; }

/* Field-level error, sits directly under its input. */
.error-text {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--danger);
}
.error-text:empty { display: none; }

/* aria-live region wrapper: no visual weight of its own. */
.status-region { display: block; }
.status-region:empty { display: none; }

/* ---------------------------------------------------------------------------
   16. TURNSTILE SLOT
   The only third-party script on the site. Reserve its box so nothing shifts.
   --------------------------------------------------------------------------- */
.turnstile-slot {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}
.turnstile-slot > * { max-width: 100%; }

/* ---------------------------------------------------------------------------
   17. SUBMIT BAR
   --------------------------------------------------------------------------- */
.submit-bar {
  padding: var(--sp-5) var(--sp-5) var(--sp-6);
  border-top: 1px solid var(--line);
  background-color: var(--surface-sunken);
  display: grid;
  gap: var(--sp-3);
}
@media (min-width: 40rem) { .submit-bar { padding: var(--sp-6); } }
.submit-note { font-size: var(--step--1); color: var(--ink-2); text-align: center; }

/* Busy state on the primary button. */
.spinner {
  width: 1.125rem;
  height: 1.125rem;
  flex: none;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn[data-busy="true"] .btn-label-idle { display: none; }
.btn:not([data-busy="true"]) .btn-label-busy { display: none; }
.btn:not([data-busy="true"]) .spinner { display: none; }

/* ---------------------------------------------------------------------------
   18. RESULT — the link handoff
   --------------------------------------------------------------------------- */
.result { display: grid; gap: var(--sp-5); }

.linkbox {
  display: grid;
  gap: var(--sp-3);
  padding: var(--sp-5);
  background-color: var(--surface-sunken);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
}
.linkbox-label {
  font-size: var(--step--2);
  font-weight: 700;
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--ink-3);
}
/* A read-only <textarea>, not a <p>. It has to be selectable with the keyboard
   alone, and it has to wrap — an <input> does neither. */
.linkbox-value {
  display: block;
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  background-color: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  line-height: 1.5;
  font-variant-ligatures: none;
  resize: none;
  overflow-wrap: anywhere;
  field-sizing: content;
}
.linkbox-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.linkbox-actions > .btn { flex: 1 1 12rem; }

/* Copy button confirmation: swap label + icon by data-copied. */
.btn[data-copied="true"] { --btn-bg: var(--ok-bg); --btn-line: var(--ok-line); --btn-ink: var(--ok); }
.btn[data-copied="true"] .btn-label-idle,
.btn[data-copied="true"] .icon-copy { display: none; }
.btn:not([data-copied="true"]) .btn-label-done,
.btn:not([data-copied="true"]) .icon-check { display: none; }

.factlist { display: grid; gap: var(--sp-3); }
.fact {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--sp-3);
  align-items: start;
  font-size: var(--step--1);
  color: var(--ink-2);
}
.fact-icon { flex: none; color: var(--ink-3); margin-top: 2px; }
.fact-value { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------------------
   19. SECRET BLOCK — the revealed payload
   --------------------------------------------------------------------------- */
/* Also a read-only <textarea>: keyboard-selectable, natively scrollable, and
   announced as read-only edit text. A <pre> is none of those things. */
.secret-block {
  display: block;
  width: 100%;
  margin: 0;
  padding: var(--sp-5);
  background-color: var(--surface-sunken);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  font-family: var(--font-mono);
  font-size: 1rem;
  line-height: 1.65;
  font-variant-ligatures: none;
  overflow-wrap: anywhere;
  resize: vertical;
  field-sizing: content;
  min-height: 6rem;
  max-height: 26rem;
  user-select: text;
  -webkit-user-select: text;
}
/* Masked for shoulder-surfing. Rendered UNMASKED in the HTML; the script adds
   data-masked="true" on load. That way a JS-less browser still shows the
   secret, and everyone with JS gets it covered until they ask. */
.secret-block[data-masked="true"] {
  filter: blur(9px);
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}
.secret-shell { position: relative; display: grid; gap: var(--sp-3); }
.secret-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}
.secret-toolbar-group { display: flex; flex-wrap: wrap; gap: var(--sp-2); }

/* Eye / eye-off swap on the mask toggle. */
.btn[data-masked="true"] .icon-eye-off,
.btn[data-masked="true"] .btn-label-hide { display: none; }
.btn:not([data-masked="true"]) .icon-eye,
.btn:not([data-masked="true"]) .btn-label-show { display: none; }

/* ---------------------------------------------------------------------------
   20. DESTRUCTIVE ZONE
   --------------------------------------------------------------------------- */
.dangerzone {
  padding: var(--sp-5);
  border: 1px solid var(--danger-line);
  border-radius: var(--r-md);
  background-color: var(--danger-bg);
  display: grid;
  gap: var(--sp-3);
}
.dangerzone-title { font-weight: 700; color: var(--danger); }
.dangerzone-body { font-size: var(--step--1); color: var(--ink-2); line-height: var(--lh-loose); }
/* Step machine: data-step="idle" | "confirm" | "done" on .dangerzone */
.dangerzone[data-step="idle"]    .dz-confirm,
.dangerzone[data-step="idle"]    .dz-done,
.dangerzone[data-step="confirm"] .dz-idle,
.dangerzone[data-step="confirm"] .dz-done,
.dangerzone[data-step="done"]    .dz-idle,
.dangerzone[data-step="done"]    .dz-confirm { display: none; }
.dangerzone[data-step="done"] { border-color: var(--line); background-color: var(--surface-sunken); }

/* ---------------------------------------------------------------------------
   21. GATE PAGES (retrieve / passphrase / gone)
   --------------------------------------------------------------------------- */
.gate {
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sheet);
  padding: var(--sp-7) var(--sp-5);
  display: grid;
  gap: var(--sp-5);
  text-align: center;
  justify-items: center;
}
@media (min-width: 40rem) { .gate { padding: var(--sp-8) var(--sp-7); } }
.gate-glyph { color: var(--graphic); }
.gate-glyph--muted { color: var(--ink-3); }
.gate > .btn--block { max-width: 26rem; }
.gate-form { display: grid; gap: var(--sp-4); width: 100%; max-width: 24rem; text-align: left; }

/* ---------------------------------------------------------------------------
   22. FAQ
   --------------------------------------------------------------------------- */
.faq { margin-top: var(--sp-9); }
.faq-head { margin-bottom: var(--sp-5); }
.faq-list {
  border-top: 1px solid var(--line);
}
.faq-item { border-bottom: 1px solid var(--line); }
.faq-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-4) 0;
  min-height: var(--control-h);
  font-family: var(--font-display);
  font-size: var(--step-0);
  font-weight: 700;
  letter-spacing: -0.012em;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}
.faq-summary::-webkit-details-marker { display: none; }
.faq-summary:hover { color: var(--accent); }
.faq-chevron { flex: none; color: var(--ink-3); transition: transform var(--dur-fast) var(--ease); }
.faq-item[open] .faq-chevron { transform: rotate(90deg); }
.faq-body {
  padding-bottom: var(--sp-5);
  font-size: var(--step--1);
  line-height: var(--lh-loose);
  color: var(--ink-2);
  max-width: 68ch;
}
.faq-body > * + * { margin-top: var(--sp-3); }

/* ---------------------------------------------------------------------------
   23. UTILITIES
   --------------------------------------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.stack-sm > * + * { margin-top: var(--sp-2); }
.center { text-align: center; }
.is-hidden { display: none; }   /* JS show/hide hook — see HANDOFF.md */
.icon { width: 20px; height: 20px; flex: none; }
.icon--sm { width: 16px; height: 16px; }
.icon--lg { width: 40px; height: 40px; }

/* ---------------------------------------------------------------------------
   24. THE ONE ORCHESTRATED MOMENT
   When the link comes back, the result panel rises once and the ember marks
   light in sequence. Nothing else on the site animates on entry.
   --------------------------------------------------------------------------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes ignite {
  from { opacity: 0; transform: rotate(45deg) scale(0.4); }
  to   { opacity: 1; transform: rotate(45deg) scale(1); }
}
.animate-rise { animation: rise var(--dur-slow) var(--ease) both; }
.animate-rise .ember { animation: ignite 200ms var(--ease) both; }
.animate-rise .ember:nth-child(1) { animation-delay:  60ms; }
.animate-rise .ember:nth-child(2) { animation-delay: 100ms; }
.animate-rise .ember:nth-child(3) { animation-delay: 140ms; }
.animate-rise .ember:nth-child(4) { animation-delay: 180ms; }
.animate-rise .ember:nth-child(5) { animation-delay: 220ms; }
.animate-rise .ember:nth-child(n+6) { animation-delay: 260ms; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .spinner { animation: none; border-top-color: currentColor; opacity: 0.6; }
}

/* Windows High Contrast / forced-colors: keep every boundary visible. */
@media (forced-colors: active) {
  .btn, .input, .textarea, .segment-label, .sheet, .gate,
  .callout, .linkbox, .secret-block, .stepper { border: 1px solid CanvasText; }
  .check-input:checked { background-color: Highlight; }
  .ember[data-state="lit"] { background-color: CanvasText; border-color: CanvasText; }
  .secret-block[data-masked="true"] { filter: none; color: Canvas; background-color: Canvas; }
}

/* Never let a secret onto paper by accident. */
@media print {
  .secret-block, .linkbox-value { filter: blur(10px); }
  .btn, .page-footer, .faq { display: none; }
}

/* ---------------------------------------------------------------------------
   25. LATE ADDITIONS — page chrome that has exactly one home
   --------------------------------------------------------------------------- */

/* The eyebrow above the FAQ carries a shield glyph; keep them on one line. */
.faq-head .eyebrow { display: flex; align-items: center; gap: var(--sp-2); }
.faq-head .h2 { margin-top: var(--sp-2); }

/* Lifetime block sits below its caption. */
.fieldgroup-head + .lifetime { margin-top: var(--sp-5); }

.footer-note { color: var(--ink-2); }

/* Large flame on the retrieval page. */
.gate-flame { width: 36px; height: 52px; color: var(--brand-orange); }

/* Placeholder that stands in for the Turnstile iframe until the script paints.
   Ships as-is: if Turnstile is blocked, the user still sees a labelled box
   rather than a silent gap. */
.turnstile-placeholder {
  display: flex;
  align-items: center;
  width: 300px;
  max-width: 100%;
  min-height: 65px;
  padding: var(--sp-3) var(--sp-4);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
  background-color: var(--surface-sunken);
  color: var(--ink-3);
  font-size: var(--step--1);
}

/* Reasons list on the "gone" page. */
.reason-list { display: grid; gap: var(--sp-2); margin: var(--sp-2) 0 var(--sp-3); }
.reason-list > li { display: flex; gap: var(--sp-2); color: var(--ink-2); }
.reason-list > li::before { content: "\2013"; color: var(--ink-3); flex: none; }
.reason-note { color: var(--ink-2); }
