/* Night Frequency for the web: the app's colour roles (lib/design/tokens.dart), Figtree + JetBrains Mono, the flight
   strip as the code field and the push-to-talk key as the one primary action. Every colour lives in :root below. */
@font-face {
  font-family: "Figtree"; font-style: normal; font-weight: 300; font-display: swap;
  src: url("fonts/figtree-300.woff2") format("woff2");
}
@font-face {
  font-family: "Figtree"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/figtree-400.woff2") format("woff2");
}
@font-face {
  font-family: "Figtree"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/figtree-600.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("fonts/jetbrains-mono-500.woff2") format("woff2");
}

:root {
  color-scheme: light dark;
  /* Light: warm paper. */
  --canvas: #F2EDE5; --surface: #FFFFFF; --surface-raised: #FBF8F3;
  --strip: #FFFFFF; --strip-ink: #211D19; --strip-hint: #6B6055; --strip-edge: #857A6D;
  --ink: #211D19; --ink-2: #5B5249; --ink-3: #6B6055; --line: #DDD4C8; --highlight: rgba(255, 255, 255, 0.6);
  --amber: #FFB224; --on-amber: #211D19; --amber-edge: #B37800; --amber-text: #8A4B00;
  --mint: #146B4A; --mint-text: #146B4A; --coral: #B53F1E; --coral-text: #B53F1E; --focus: #211D19;
  --sans: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --arrive: cubic-bezier(0.2, 0, 0.2, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    /* Dark: charcoal glass with the amber readout. */
    --canvas: #1A1816; --surface: #24211E; --surface-raised: #2E2A26;
    --strip: #EFE6D6; --strip-ink: #1F1B17; --strip-hint: #6B6055; --strip-edge: #D9CDB8;
    --ink: #F5EFE6; --ink-2: #D3C9BD; --ink-3: #B5AA9D; --line: #3A3530; --highlight: rgba(255, 255, 255, 0.08);
    --amber-edge: #A86E00; --amber-text: #FFB224;
    --mint: #74D8AC; --mint-text: #74D8AC; --coral: #FF8466; --coral-text: #FF8466; --focus: #FFB224;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--canvas); color: var(--ink);
  font: 400 1rem/1.6 var(--sans); -webkit-font-smoothing: antialiased;
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
a { color: var(--amber-text); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2.5px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.skip {
  position: absolute; left: 0.75rem; top: -4rem; z-index: 5; padding: 0.75rem 1rem; border-radius: 12px;
  background: var(--surface); color: var(--ink); font-weight: 600;
}
.skip:focus { top: 0.75rem; }
.wrap { width: 100%; max-width: 72rem; margin-inline: auto; padding-inline: min(2rem, 5vw); }

/* Header: the brand mark and a carrier ruler. */
.top { background: var(--canvas); }
.top .wrap { display: flex; align-items: center; min-height: 4rem; }
.brand { display: flex; align-items: center; gap: 0.75rem; margin: 0; font-size: 1.0625rem; font-weight: 600; }
.mark { width: 2rem; height: 1.25rem; flex: none; }
.mark-body { fill: var(--amber); }
.mark-cut { fill: var(--canvas); }
.mark-lines { fill: none; stroke: var(--on-amber); stroke-width: 2; stroke-linecap: round; }
.top::after {
  content: ""; display: block; height: 0.5rem; opacity: 0.9;
  background: repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 0.5rem);
}

/* Layout: one bounded column on phones and tablets, two panes on wide screens. */
.layout {
  display: grid; gap: 1.5rem; padding-block: 2rem 3.5rem; grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "intro" "panel" "steps" "details";
}
.layout > * { animation: arrive 240ms var(--arrive) both; }
.layout > :nth-child(2) { animation-delay: 60ms; }
.layout > :nth-child(3) { animation-delay: 120ms; }
.layout > :nth-child(4) { animation-delay: 180ms; }
.intro { grid-area: intro; }
.panel { grid-area: panel; }
.steps { grid-area: steps; }
.details { grid-area: details; }
@media (max-width: 63.99rem) {
  .layout > * { width: 100%; max-width: 40rem; margin-inline: auto; }
  .layout > .details { max-width: 40rem; }
}
@media (min-width: 64rem) {
  .layout {
    grid-template-columns: minmax(0, 27fr) minmax(0, 35fr); align-items: start;
    column-gap: clamp(3rem, 6vw, 5rem); row-gap: 2rem; grid-template-rows: auto 1fr auto; padding-block: 3.5rem 4.5rem;
    grid-template-areas: "intro panel" "steps panel" "details details";
  }
}

.label { margin: 0 0 0.5rem; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.04em; color: var(--amber-text); }
h1 {
  margin: 0 0 1rem; font-size: clamp(2rem, 1.55rem + 1.9vw, 2.75rem); font-weight: 300; line-height: 1.15;
  letter-spacing: -0.01em; text-wrap: balance;
}
h2 { margin: 0; font-size: 1.375rem; font-weight: 600; line-height: 1.3; }
h3 { margin: 0 0 0.75rem; font-size: 1.0625rem; font-weight: 600; }
.lede { margin: 0; max-width: 34rem; font-size: 1.0625rem; color: var(--ink-2); }
.card, .panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: inset 0 1px 0 var(--highlight);
  padding: clamp(14px, 4.5vw, 32px);
}
.hint, .fine { margin: 0.5rem 0 0; font-size: 0.875rem; line-height: 1.5; color: var(--ink-2); }
.notice { margin: 1rem 0 0; padding: 1rem; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-raised); }

/* The code field is a flight strip in its holder. */
form { margin-top: 1.25rem; }
.field-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 0.5rem; }
.field-head label { font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.04em; }
.count { font: 500 0.8125rem/1 var(--mono); font-variant-numeric: tabular-nums; color: var(--ink-3); }
.strip {
  position: relative; background: var(--strip); border: 1px solid var(--strip-edge); border-radius: 10px;
  transition: border-color 120ms linear; container-type: inline-size;
}
.strip::before {
  content: ""; position: absolute; left: 0; top: 50%; width: 12px; height: 12px; border-radius: 50%;
  transform: translate(-50%, -50%); background: var(--surface); border: 1px solid var(--strip-edge);
  clip-path: inset(0 0 0 50%);
}
.strip:focus-within { outline: 2.5px solid var(--focus); outline-offset: 3px; }
.strip[data-invalid] { border: 2px solid var(--coral); }
.strip.shake { animation: shake 160ms linear 1; }
#code {
  display: block; width: 100%; min-height: 3.5rem; padding: 0.75rem 0.6em 0.75rem 1em; border: 0; outline: 0;
  background: transparent; color: var(--strip-ink); border-radius: 10px;
  font: 500 min(1.5rem, 7vw)/1.2 var(--mono); font-feature-settings: "zero" 1; letter-spacing: 0.12em;
  text-transform: uppercase;
}
/* Eleven characters at 0.72em each plus the padding fill 9.5em: the size follows the strip, so large text never clips. */
@supports (width: 1cqw) { #code { font-size: min(1.5rem, 10cqw); } }
#code::placeholder { color: var(--strip-hint); opacity: 1; letter-spacing: 0.12em; }
.field-error { margin: 0.5rem 0 0; font-size: 0.9375rem; font-weight: 600; color: var(--coral-text); }
.confirm { display: flex; gap: 0.75rem; align-items: flex-start; margin-top: 1.25rem; padding: 0.25rem 0; }
.confirm input { flex: none; width: 1.5rem; height: 1.5rem; margin: 0.1rem 0 0; accent-color: var(--amber-text); }
.confirm label { min-width: 0; overflow-wrap: anywhere; cursor: pointer; }

/* The one primary action: a short-travel key with a hard stop. */
.key {
  position: relative; display: block; width: 100%; min-height: 3.5rem; margin-top: 1.25rem; padding: 0.75rem 1.5rem;
  overflow: hidden; border: 0; border-radius: 999px; background: var(--amber); color: var(--on-amber);
  box-shadow: 0 3px 0 var(--amber-edge); font: 600 1.0625rem/1.3 var(--sans); cursor: pointer;
  transition: transform 90ms cubic-bezier(0.3, 0.9, 0.4, 1), box-shadow 90ms cubic-bezier(0.3, 0.9, 0.4, 1);
}
.key:active { transform: translateY(3px); box-shadow: 0 0 0 var(--amber-edge); }
.key[aria-busy="true"] { cursor: progress; }
.key[aria-busy="true"]::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 4px; background: var(--on-amber);
  transform: translateX(-100%); animation: scan 1.4s linear infinite;
}
.key-hint { margin-top: 0.75rem; }
.quiet {
  margin-top: 1rem; min-height: 3rem; padding: 0.5rem 1.25rem; border-radius: 999px; background: transparent;
  color: var(--ink); border: 1.5px solid var(--ink-2); font: 600 1rem/1.3 var(--sans); cursor: pointer;
}
.quiet:hover { background: var(--surface-raised); }

/* Outcomes: an inline panel with a glyph, a heading and the next step; the edge carries the tone. */
.outcomes { margin: 0; }
.outcome {
  --tone: var(--amber); --tone-text: var(--amber-text); margin-top: 1.5rem; padding: 1.25rem 1.25rem 1.25rem 1.5rem;
  background: var(--surface-raised); border: 1px solid var(--line); border-left: 6px solid var(--tone); border-radius: 10px;
}
.outcome[hidden] { display: none; }
.outcome:not([hidden]) { animation: arrive 240ms var(--arrive) both; }
.outcome[data-tone="ok"] { --tone: var(--mint); --tone-text: var(--mint-text); }
.outcome[data-tone="bad"] { --tone: var(--coral); --tone-text: var(--coral-text); }
.outcome p { margin: 0.75rem 0 0; }
.outcome .fine { color: var(--ink-2); }
.outcome-head { display: flex; align-items: center; gap: 0.75rem; }
.outcome-head h2 { font-size: 1.25rem; }
.outcome-head h2:focus-visible { outline-offset: 4px; }
.glyph { width: 1.75rem; height: 1.75rem; flex: none; color: var(--tone-text); }
.latch, .marks { margin: 0.75rem 0 0; padding: 0; list-style: none; }
.latch li, .marks li {
  display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.625rem 0; border-top: 1px solid var(--line);
}
.latch li:first-child, .marks li:first-child { border-top: 0; }
.latch svg, .marks svg { flex: none; width: 1.375rem; height: 1.375rem; margin-top: 0.1rem; color: var(--mint-text); }
.marks-hold svg { color: var(--ink-2); }
.latch li { animation: latch 160ms cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
.latch li:nth-child(2) { animation-delay: 90ms; }
.latch li:nth-child(3) { animation-delay: 180ms; }
.latch li:nth-child(4) { animation-delay: 270ms; }
.latch li:nth-child(5) { animation-delay: 360ms; }

/* How it works, and what is deleted. */
.steps { padding-top: 0.5rem; }
.steps h2 { font-size: 1.125rem; }
.steps ol { margin: 0.75rem 0 0; padding: 0; list-style: none; }
.steps li { display: flex; gap: 0.75rem; align-items: baseline; padding: 0.375rem 0; color: var(--ink-2); }
.n {
  flex: none; display: inline-grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink); font: 500 0.875rem/1 var(--mono);
}
.details { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 48rem) { .details { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.details .card { background: var(--surface); }

.foot { border-top: 1px solid var(--line); }
.foot nav { display: flex; flex-wrap: wrap; gap: 0 1.5rem; padding-block: 0.75rem; }
.foot a {
  display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--ink-2); font-size: 0.9375rem;
}

@keyframes arrive { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes latch {
  0% { opacity: 0; transform: translateX(-8px) scale(0.98); }
  60% { opacity: 1; transform: translateX(1px) scale(1.01); }
  100% { opacity: 1; transform: none; }
}
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@keyframes scan { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }

/* Reduced motion is designed, not removed: a short cross-fade, states that switch in place, a label that pulses slowly. */
@media (prefers-reduced-motion: reduce) {
  .layout > *, .outcome:not([hidden]) { animation: fade 120ms linear both; animation-delay: 0ms; }
  .latch li, .strip.shake { animation: none; }
  .key, .key:active, .strip { transition: none; }
  .key[aria-busy="true"]::after { display: none; animation: none; }
  .key[aria-busy="true"] .key-label { animation: pulse 2s ease-in-out infinite; }
}
@media (forced-colors: active) {
  .key, .quiet, .strip, .card, .outcome { border: 2px solid CanvasText; }
  .key { forced-color-adjust: none; background: ButtonFace; color: ButtonText; box-shadow: none; }
}
