/* First Impact teaser: one page, the instrument world (html[data-theme="dark"]).
   Every colour is a --fl-* token from ./tokens.css; the dial's inks live in dial.js.
   Flat by law: hairlines and the module colours only; no shadows, gradients or glow. */

@font-face {
  font-family: "Oswald";
  src: url("/assets/fonts/oswald.ttf") format("truetype");
  font-weight: 200 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("/assets/fonts/sourcesans3.ttf") format("truetype");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; }
html {
  /* the dial's side: the brief's min(72vh, 86vw, 640px), never wider than the gutters allow, and
     never so tall that the notify line and the foot leave the first screen (--rest: everything
     on the page that is not the dial, measured at 1440 x 900) */
  --rest: 400px;
  --dial: min(72vh, calc(100vh - var(--rest)), 86vw, 640px, calc(100vw - 2 * var(--fl-gutter)));
  background: var(--fl-ground);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
@supports (height: 1svh) {
  html { --dial: min(72svh, calc(100svh - var(--rest)), 86vw, 640px, calc(100vw - 2 * var(--fl-gutter))); }
}
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--fl-ground);
  color: var(--fl-text);
  font-family: var(--fl-font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.stage {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 3vh, 40px) var(--fl-gutter) 0;
  min-width: 0;
}

/* the design's cap-label: Oswald 600, wide tracking, muted */
.kicker, .foot {
  font-family: var(--fl-font-display);
  font-weight: 600;
  font-size: clamp(11px, calc(var(--dial) * 12 / 640), 12px);
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--fl-muted);
  line-height: 2;
}
.kicker { margin: 0 0 clamp(8px, 2vh, 20px); padding-left: .24em; text-align: center; }

.dialwrap {
  width: var(--dial);
  height: var(--dial);
  flex: none;
  position: relative;
}
.dial {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  touch-action: manipulation;
}
.dial text { font-family: var(--fl-font-display); font-weight: 600; }

/* the mode words: the current one olive; the others ease back over 200 ms */
.q { cursor: pointer; outline: none; }
.q .w { fill: var(--fl-text); transition: fill .2s linear; }
.q .s { fill: var(--fl-muted); transition: fill .2s linear; }
.q.on .w, .q.on .s { fill: var(--fl-olive); transition: none; }
.q .hit { stroke: none; }
.q:focus-visible .hit { stroke: var(--fl-olive); stroke-width: 1.5; }
.dial:not(.open) .q { pointer-events: none; }

/* the wordmark (the phone splash's .wm scaled with the dial: 23 px beside a 360 dial) */
.wm {
  margin: clamp(10px, 2.4vh, 28px) 0 0;
  padding-left: .3em;                 /* balances the trailing tracking so the word centres */
  font-family: var(--fl-font-display);
  font-weight: 600;
  font-size: max(16px, calc(var(--dial) * 23 / 360));
  line-height: 1.15;
  letter-spacing: .3em;
  color: var(--fl-text);
  text-align: center;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.wm span { color: var(--fl-olive); }

/* the tagline (splash .tag: Source Sans 3 italic, muted, 13 px beside the 23 px wordmark) */
.tag {
  margin: .55em 0 0;
  font-family: var(--fl-font-body);
  font-style: italic;
  font-size: max(13px, calc(var(--dial) * 13 / 360));
  letter-spacing: .02em;
  line-height: 1.35;
  color: var(--fl-muted);
  text-align: center;
  max-width: 100%;
}

.foot {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 .9em;
  padding: clamp(16px, 3vh, 32px) var(--fl-gutter) clamp(12px, 2.4vh, 24px);
  text-align: center;
}
.foot > * + :not([hidden])::before { content: "·"; margin-right: .9em; }
.foot button {
  font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit;
  background: none; border: 0; padding: 0; margin: 0; cursor: pointer;
}
.foot button:hover { color: var(--fl-text); }
.foot button:focus-visible { outline: 1.5px solid var(--fl-olive); outline-offset: 3px; }
.foot [hidden] { display: none; }

/* notify me at launch: one line under the tagline. The design's grammar on instrument ground
   (language §1, §4, §9): no white field on dark, so the field is a dark module, --fl-panel with a
   1 px --fl-rule edge and the 10 px radius, one control tall; the quiet action is a dark module with
   the same edge and a light Oswald label (§4: on instrument, quiet actions are dark modules with the rule-coloured
   border). Focus takes the design's ink edge (the code cell's 2 px ink when current, the
   button's 2 px text outline). The line above carries the state in words, in its state's ink. */
.notify {
  width: min(100%, 420px);
  margin: clamp(14px, 2.6vh, 28px) 0 0;
}
.notify-state {
  margin: 0 0 8px;
  padding-left: .24em;
  font-family: var(--fl-font-display);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .24em;
  line-height: 2;
  text-transform: uppercase;
  text-align: center;
  color: var(--fl-muted);
}
.notify-state[data-tone="text"] { color: var(--fl-text); }
.notify-state[data-tone="warn"] { color: var(--fl-warn); }
.notify-state[data-tone="alarm"] { color: var(--fl-alarm); }
.notify-remove { color: var(--fl-muted); text-decoration: underline; text-decoration-color: var(--fl-rule); text-underline-offset: 3px; }
.notify-remove:hover { color: var(--fl-text); }
.notify-remove:focus-visible { outline: 2px solid var(--fl-text); outline-offset: 2px; }
.notify-row { display: flex; gap: 8px; }
.notify-field {
  flex: 1 1 0;
  min-width: 0;
  height: var(--fl-control);
  margin: 0;
  padding: 0 13px;
  border: 1px solid var(--fl-rule);
  border-radius: var(--fl-radius);
  background: var(--fl-panel);
  color: var(--fl-text);
  caret-color: var(--fl-text);
  font-family: var(--fl-font-body);
  font-size: 17px;            /* the design's bodyLarge */
  line-height: 24px;
  appearance: none;
  -webkit-appearance: none;
}
.notify-field::placeholder { color: var(--fl-muted); opacity: 1; }
.notify-field:focus { outline: none; }
.notify-field:focus-visible { border-color: var(--fl-text); outline: 1px solid var(--fl-text); outline-offset: -2px; }
.notify-send {
  flex: none;
  height: var(--fl-control);
  margin: 0;
  padding: 0 22px 0 calc(22px + .2em);
  border: 1px solid var(--fl-rule);
  border-radius: var(--fl-radius);
  background: var(--fl-panel);
  color: var(--fl-text);
  font-family: var(--fl-font-display);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .2em;
  text-transform: uppercase;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
.notify-send:hover, .notify-send:focus-visible { color: var(--fl-olive); }
.notify-send:focus-visible { outline: 2px solid var(--fl-text); outline-offset: 2px; }
.notify-send:disabled { color: var(--fl-muted); cursor: default; }
.notify-note {
  margin: 10px 0 0;
  font-family: var(--fl-font-body);
  font-size: 13px;
  line-height: 18px;
  color: var(--fl-muted);
  text-align: center;
  max-width: 100%;
}
.notify-note a { color: inherit; text-decoration: underline; text-decoration-color: var(--fl-rule); text-underline-offset: 3px; }
.notify-note a:hover { color: var(--fl-text); }
.notify-note a:focus-visible { outline: 2px solid var(--fl-text); outline-offset: 2px; }
@media (max-width: 480px) {
  .notify-row { flex-direction: column; }
  .notify-field { flex: none; }
}
/* the Worker's answer pages (worker.js): the wordmark, the line, the way back */
.answer { justify-content: center; gap: 14px; padding-bottom: clamp(16px, 3vh, 40px); }
.answer .wm { margin: 0; }
.answer .notify-state, .answer .notify-note { margin: 0; }
/* the privacy page (privacy.html): running text, the design's bodyMedium, left-aligned */
.privacy { width: min(100%, 34em); font-family: var(--fl-font-body); font-size: 15px; line-height: 21px; color: var(--fl-text); }
.privacy p { margin: 0 0 10px; }
.privacy a { color: inherit; text-decoration: underline; text-decoration-color: var(--fl-rule); text-underline-offset: 3px; }
.privacy a:hover { color: var(--fl-olive); }
.privacy a:focus-visible { outline: 2px solid var(--fl-text); outline-offset: 2px; }

/* the opening: until dial.js has drawn the rest mark, the seated dial stays hidden; the
   wordmark and tagline wait for their beats. Without JavaScript none of this applies. */
.intro:not(.drawn) .dial { visibility: hidden; }
.intro .wm, .intro .tag { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .q .w, .q .s { transition: none; }
}
