/* ═══════════════════════════════════════════════════════════════
   The Upgrade (upgrade.html)
   Self-contained on purpose. upgrade.html loads css/fonts.css and
   this file, nothing else, so every token and every shared part
   (nav, buttons, hero, footer, back-to-top) is mirrored here the
   way css/grants.css and css/store.css mirror them. If the palette
   in css/style.css changes, update this file, css/grants.css,
   css/store.css and css/terms.css together.

   Art direction is the grants page with the volume turned down
   again. This is a page somebody reads all the way through and
   then fills in a long form at the bottom, so the loudest object
   on it is a field label, not a card. The numbered sections are
   the terms document's; the fields are the store drawer's, grown
   up from one phone box into a real form. Nothing here animates
   except the hero, because a form that moves while you type is a
   form people abandon.
   ═══════════════════════════════════════════════════════════════ */

/* ── Tokens (mirrored from css/style.css) ───────────────────── */
:root {
  color-scheme: light;

  --cream:    #FAF5EC;
  --cream-2:  #F4ECDD;
  --band:     #F6EFE1;
  --paper:    #FFFDF8;

  --ink:      #292437;
  --ink-2:    #4E4760;
  --muted:    #565068;

  --green:        #17A15E;
  --green-deep:   #096236;
  --green-bright: #2ED47F;

  --sun:        #FFC933;
  --sun-bright: #FFD23F;
  --amber:      #F0A31A;
  --amber-deep: #8A5A00;

  --violet:        #7C3AED;
  --violet-deep:   #5B21B6;
  --violet-bright: #A78BFA;
  --lilac:         #EDE6FB;

  --line:      rgba(41, 36, 55, .12);
  --line-soft: rgba(41, 36, 55, .07);

  --shadow-sm: 0 2px 8px rgba(70, 56, 110, .05), 0 12px 26px -16px rgba(70, 56, 110, .14);
  --shadow-md: 0 4px 14px rgba(70, 56, 110, .07), 0 24px 48px -22px rgba(70, 56, 110, .20);
  --shadow-lg: 0 6px 18px rgba(70, 56, 110, .08), 0 36px 74px -28px rgba(70, 56, 110, .26);

  --grad-brand: linear-gradient(100deg, var(--green-bright), var(--sun-bright) 48%, var(--violet-bright));
  --grad-text:  linear-gradient(105deg, var(--green-deep), var(--green) 30%, var(--violet) 88%);

  --mono:  'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --sans:  'Space Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;

  --nav-h: 70px;
  --maxw: 1220px;
  --r: 20px;
  --r-lg: 28px;

  --ease: cubic-bezier(.22, 1, .36, 1);

  --blob-a: 58% 42% 55% 45% / 55% 48% 52% 45%;
  --blob-b: 45% 55% 48% 52% / 48% 55% 45% 55%;
  --blob-c: 52% 48% 42% 58% / 45% 52% 55% 48%;

  /* The one colour this page adds: the red every invalid control and the
     error region share. Hardcoded rather than tokenised in style.css because
     no other page has a form long enough to need it. */
  --bad:      #B3261E;
  --bad-soft: rgba(179, 38, 30, .08);
  --bad-ring: rgba(179, 38, 30, .12);
}

/* Same ramp in a perceptual space where supported. Scoped to @supports
   rather than redeclared, because an unparseable value in a custom
   property fails at use time and would blank the clipped hero title. */
@supports (background: linear-gradient(in oklch, red, blue)) {
  :root {
    --grad-text: linear-gradient(105deg in oklch, var(--green-deep), var(--green) 26%, var(--violet) 92%);
  }
}

/* Dark theme: the cyber-terminal remap, same values as the homepage. */
:root[data-theme="dark"] {
  color-scheme: dark;

  --cream:   #060807;
  --cream-2: #0d1310;
  --band:    #0a0f0c;
  --paper:   #0c1310;

  --ink:   #e6f4ec;
  --ink-2: #a9c3b6;
  --muted: #8fa89a;

  --green:        #00ff9c;
  --green-deep:   #00ff9c;
  --green-bright: #00ff9c;

  --sun:        #ffd60a;
  --sun-bright: #ffe14d;
  --amber:      #ffb703;
  --amber-deep: #ffd60a;

  --violet:        #b6ff3a;
  --violet-deep:   #d2ff7d;
  --violet-bright: #b6ff3a;
  --lilac:         rgba(182, 255, 58, .13);

  --line:      rgba(0, 255, 156, .2);
  --line-soft: rgba(0, 255, 156, .13);

  --shadow-sm: 0 2px 10px rgba(0, 0, 0, .5),  0 0 0 1px rgba(0, 255, 156, .04);
  --shadow-md: 0 8px 26px rgba(0, 0, 0, .58), 0 0 22px -6px rgba(0, 255, 156, .18);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, .66), 0 0 34px -8px rgba(0, 255, 156, .26);

  --grad-brand: linear-gradient(100deg, var(--green), var(--violet) 50%, var(--sun));
  --grad-text:  linear-gradient(100deg, var(--green), var(--violet) 55%, var(--sun));

  --r: 14px;
  --r-lg: 18px;

  /* #B3261E on near-black is a bruise, not a warning. */
  --bad:      #ff8f7a;
  --bad-soft: rgba(255, 143, 122, .1);
  --bad-ring: rgba(255, 143, 122, .14);
}

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

html {
  background: var(--cream);
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 18px);
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(15px, .55vw + 13.6px, 17px);
  line-height: 1.7;
  overflow-x: hidden;
  accent-color: var(--violet);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* js/upgrade.js toggles the error region with .hidden, and every display rule
   below outranks the UA's [hidden] {display:none}. Without this the empty
   alert box would sit under the button on every load. */
[hidden] { display: none !important; }

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
li { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

::selection { background: var(--violet); color: #FBF7EF; }

:focus-visible {
  outline: 3px solid var(--violet);
  outline-offset: 3px;
  border-radius: 6px;
}

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--cream-2); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--green-bright), var(--violet-bright));
  border-radius: 20px;
  border: 3px solid var(--cream-2);
}
::-webkit-scrollbar-thumb:hover { background: var(--violet); }
html { scrollbar-color: var(--violet-bright) var(--cream-2); }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

.skip {
  position: fixed; top: -100px; left: 16px; z-index: 999;
  background: var(--violet); color: #fff;
  padding: 10px 18px; border-radius: 999px; font-weight: 700;
  box-shadow: var(--shadow-md);
  transition: top .2s;
}
.skip:focus { top: 14px; }
:root[data-theme="dark"] .skip { color: #04120b; }

/* ── Nav: the same bar as grants.html and store.html ────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px;
  padding: 0 clamp(16px, 4vw, 42px);
  background: rgba(250, 245, 236, .86);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--line-soft);
  box-shadow: 0 14px 34px -22px rgba(70, 56, 110, .22);
}
:root[data-theme="dark"] .nav {
  background: rgba(6, 8, 7, .82);
  box-shadow: 0 14px 34px -22px rgba(0, 0, 0, .8);
}

.nav__brand { display: flex; align-items: center; gap: 10px; }
.nav__mark { color: var(--violet); display: grid; place-items: center; }
.nav__mark svg { animation: spinSlow 24s linear infinite; }
@keyframes spinSlow { to { transform: rotate(360deg); } }

.nav__name {
  font-family: var(--mono);
  font-weight: 700; font-size: 13.5px; letter-spacing: .2em;
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.nav__end { display: flex; align-items: center; gap: 14px; }
.nav__links { display: flex; align-items: center; gap: 2px; }
.nav__links a {
  position: relative;
  font-family: var(--mono); font-size: 14px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-2);
  padding: 9px 14px; border-radius: 999px;
  transition: color .25s, background .25s;
}
.nav__links a::after {
  content: ''; position: absolute; left: 14px; right: 14px; bottom: 4px;
  height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--green-bright), var(--violet-bright));
  transform: scaleX(0); transform-origin: left;
  transition: transform .3s var(--ease);
}
.nav__links a:hover { color: var(--violet); background: rgba(124, 58, 237, .07); }
.nav__links a:hover::after { transform: scaleX(1); }
:root[data-theme="dark"] .nav__links a:hover { background: rgba(0, 255, 156, .08); }

/* theme toggle, same control as the homepage */
.themetog {
  position: relative; flex: none;
  width: 58px; height: 30px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--cream-2);
  transition: border-color .25s, box-shadow .25s;
}
.themetog:hover { border-color: var(--violet); box-shadow: 0 0 0 4px rgba(124, 58, 237, .1); }
.themetog__thumb {
  position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--sun), var(--sun-bright));
  color: #6b4d00;
  transition: transform .35s var(--ease), background .35s;
}
.themetog__ico { position: absolute; transition: opacity .25s, transform .35s var(--ease); }
.themetog__ico--moon { opacity: 0; transform: rotate(-50deg) scale(.5); }
:root[data-theme="dark"] .themetog__thumb {
  transform: translateX(28px);
  background: linear-gradient(135deg, var(--green), var(--violet));
  color: #04120b;
  box-shadow: 0 0 14px rgba(0, 255, 156, .5);
}
:root[data-theme="dark"] .themetog__ico--sun  { opacity: 0; transform: rotate(50deg) scale(.5); }
:root[data-theme="dark"] .themetog__ico--moon { opacity: 1; transform: none; }
:root[data-theme="dark"] .themetog:hover { box-shadow: 0 0 0 4px rgba(0, 255, 156, .12); }

/* ── Layout ─────────────────────────────────────────────────── */
.wrap { width: min(var(--maxw), 100% - clamp(32px, 8vw, 96px)); margin-inline: auto; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--sans); font-size: 16px; font-weight: 600;
  letter-spacing: .01em;
  padding: 13px 24px; border-radius: 999px;
  border: 1.5px solid transparent;
  transition: transform .25s var(--ease), box-shadow .25s, background .25s, color .25s, border-color .25s;
  position: relative;
}
.btn svg { flex: none; transition: transform .25s var(--ease); }
.btn:hover { transform: translateY(-2px); }
.btn:hover svg { transform: translateX(3px); }

.btn--solid {
  background: linear-gradient(100deg, var(--green-bright), #19B56A);
  color: #10331F;
  box-shadow: 0 14px 30px -12px rgba(23, 161, 94, .55);
}
.btn--solid:hover { box-shadow: 0 18px 38px -12px rgba(23, 161, 94, .65); }

.btn--ghost {
  border-color: rgba(124, 58, 237, .4);
  color: var(--violet-deep);
  background: rgba(255, 253, 248, .6);
}
.btn--ghost:hover {
  background: var(--lilac);
  border-color: var(--violet);
  box-shadow: 0 12px 28px -14px rgba(124, 58, 237, .4);
}
:root[data-theme="dark"] .btn--solid { color: #04120b; box-shadow: 0 0 26px -6px rgba(0, 255, 156, .6); }
:root[data-theme="dark"] .btn--solid:hover { box-shadow: 0 0 34px -4px rgba(0, 255, 156, .75); }
:root[data-theme="dark"] .btn--ghost {
  background: rgba(182, 255, 58, .06);
  border-color: rgba(182, 255, 58, .45);
  color: var(--violet);
}
:root[data-theme="dark"] .btn--ghost:hover {
  background: rgba(182, 255, 58, .14);
  border-color: var(--violet);
  box-shadow: 0 0 22px -4px rgba(182, 255, 58, .5);
}

/* ── Hero ───────────────────────────────────────────────────── */
.hero {
  position: relative;
  padding: calc(var(--nav-h) + clamp(36px, 5.5vw, 66px)) 0 clamp(30px, 4vw, 46px);
  overflow: clip;
}
.hero::before {
  content: ''; position: absolute; z-index: 0; pointer-events: none;
  top: -190px; right: -150px;
  width: min(620px, 70vw); aspect-ratio: 1;
  background: linear-gradient(135deg, rgba(255, 201, 51, .55), rgba(46, 212, 127, .4) 58%, rgba(167, 139, 250, .28));
  border-radius: var(--blob-a);
  filter: blur(54px);
  animation: blobMorph 24s ease-in-out infinite;
}
.hero__glow {
  position: absolute; z-index: 0; pointer-events: none;
  left: -180px; bottom: -190px;
  width: min(500px, 64vw); aspect-ratio: 1;
  background: linear-gradient(35deg, rgba(167, 139, 250, .44), rgba(46, 212, 127, .2) 70%);
  border-radius: var(--blob-c);
  filter: blur(58px);
  animation: blobMorph 30s ease-in-out infinite reverse;
}
:root[data-theme="dark"] .hero::before {
  background: linear-gradient(135deg, rgba(0, 255, 156, .3), rgba(182, 255, 58, .2) 58%, rgba(255, 214, 10, .14));
}
:root[data-theme="dark"] .hero__glow {
  background: linear-gradient(35deg, rgba(0, 255, 156, .26), rgba(255, 214, 10, .12) 70%);
}

@keyframes blobMorph {
  0%, 100% { border-radius: 58% 42% 55% 45% / 55% 48% 52% 45%; transform: rotate(0deg); }
  33%      { border-radius: 45% 55% 48% 52% / 48% 55% 45% 55%; transform: rotate(4deg); }
  66%      { border-radius: 52% 48% 42% 58% / 45% 52% 55% 48%; transform: rotate(-3deg); }
}

.hero__inner { position: relative; z-index: 1; }

.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--green-deep);
  background: var(--paper);
  border: 1px solid rgba(23, 161, 94, .28); border-radius: 999px;
  padding: 8px 18px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 22px;
  animation: fadeUp .8s .1s both var(--ease);
}
.hero__eyebrow .dot {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: var(--green-bright);
  box-shadow: 0 0 0 3px rgba(46, 212, 127, .25);
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .45; transform: scale(.8); } }
:root[data-theme="dark"] .hero__eyebrow {
  background: rgba(0, 255, 156, .05);
  border-color: rgba(0, 255, 156, .3);
}
:root[data-theme="dark"] .hero__eyebrow .dot { box-shadow: 0 0 10px var(--green); }

.hero__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(38px, 7vw, 74px);
  line-height: 1.04;
  letter-spacing: -.015em;
  max-width: 16ch;
  text-wrap: balance;
  margin-bottom: 18px;
  animation: fadeUp .9s .2s both var(--ease);
}
.hero__title em {
  font-style: italic;
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
/* It carries tabindex="-1" only so the back-to-top button has a landing pad;
   nobody tabs to it, so it must not draw a ring when script moves focus. */
.hero__title:focus { outline: none; }

.hero__blurb {
  max-width: 58ch; color: var(--ink-2);
  font-size: clamp(15px, 1.15vw, 18px);
  animation: fadeUp .9s .32s both var(--ease);
}

.hero__fresh {
  margin-top: 16px;
  max-width: 62ch;
  padding-left: 14px;
  border-left: 3px solid var(--violet-bright);
  font-family: var(--mono); font-size: 12px; line-height: 1.75;
  letter-spacing: .01em;
  color: var(--muted);
  animation: fadeUp .9s .44s both var(--ease);
}
:root[data-theme="dark"] .hero__fresh { border-left-color: var(--violet); }

@keyframes fadeUp { from { opacity: 0; transform: translateY(26px); } }

/* ── The sheet ──────────────────────────────────────────────── */
/* One paper slab holding all six sections, the way css/terms.css holds the
   document. A form this long needs a single container to sit in, or the
   fieldsets read as six unrelated widgets floating on the cream. */
.body { padding: clamp(18px, 3vw, 32px) 0 clamp(40px, 6vw, 72px); }

.sheet {
  max-width: 78ch;
  margin-inline: auto;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: clamp(22px, 4.5vw, 54px);
}

/* ── Section headers ────────────────────────────────────────── */
.sec {
  padding: clamp(26px, 4vw, 38px) 0;
  border-top: 1px solid var(--line-soft);
  scroll-margin-top: calc(var(--nav-h) + 16px);
}
.sec:first-child { padding-top: 0; border-top: 0; }
.sec:last-child { padding-bottom: 0; }

.sec__head {
  display: flex; align-items: baseline; gap: 14px;
  margin-bottom: 18px;
}
.sec__num {
  font-family: var(--mono); font-weight: 700;
  font-size: 13px; letter-spacing: .08em;
  color: var(--violet);
  flex: none;
}
.sec__head h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(21px, 2.6vw, 27px);
  letter-spacing: -.01em;
  line-height: 1.2;
  flex: none;
}
/* The rule finishes the line the number and title start. It shrinks to
   nothing rather than wrapping, so a long title never pushes it onto a
   second row. */
.sec__rule {
  flex: 1 1 0;
  min-width: 0;
  height: 1px;
  border-radius: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}

/* Direct children only. A <p> nested in a list item, a field, or the
   confirmation block has its own measure and its own colour, and scoping the
   running-text rule this tightly is what saves this file from a column of
   overrides undoing it again. */
.sec > p { max-width: 68ch; color: var(--ink-2); margin-bottom: 14px; }
.sec > p:last-child { margin-bottom: 0; }
.sec a {
  color: var(--violet);
  font-weight: 600;
  border-bottom: 1px dashed rgba(124, 58, 237, .45);
  transition: color .2s, border-color .2s;
}
.sec a:hover { color: var(--green-deep); border-color: var(--green-deep); }
:root[data-theme="dark"] .sec a { border-bottom-color: rgba(182, 255, 58, .5); }

/* The line that closes section 04. Craft face, so it reads as Gene talking
   rather than as one more bullet. */
.sec > .sec__close {
  margin-top: 18px;
  max-width: 62ch;
  font-family: var(--serif); font-style: italic;
  font-size: clamp(16px, 1.6vw, 19px); line-height: 1.5;
  color: var(--ink);
}

/* ── The quiet aside ────────────────────────────────────────── */
/* The "I do not publish numbers" note. Band fill and a violet rule, no
   shadow: it is a footnote to the paragraph above it, not a callout. */
.sec > .aside {
  margin-top: 18px;
  max-width: 72ch;
  padding: 14px 18px;
  background: var(--band);
  border-left: 3px solid var(--violet);
  border-radius: 0 var(--r) var(--r) 0;
  font-family: var(--mono); font-size: 14.5px; line-height: 1.75;
  color: var(--muted);
}

/* ── Covered / not covered ──────────────────────────────────── */
/* auto-fit with a min(100%, ...) track, never a bare minmax(280px, 1fr):
   inside a padded sheet on a 360px phone a fixed track outgrows the sheet
   and scrolls the whole page sideways. */
.fit {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 14px;
  margin-top: 18px;
}
.fit__item {
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--cream);
}
.fit__label {
  font-family: var(--mono); font-size: 10.5px; font-weight: 700;
  letter-spacing: .2em; text-transform: uppercase;
}
/* Shape as well as hue: a tick and a slash, so the two halves stay apart
   for anyone who does not see the green and the amber. */
.fit__label::before { margin-right: 8px; }
.fit__item--yes { border-color: rgba(23, 161, 94, .35); }
.fit__item--yes .fit__label { color: var(--green-deep); }
.fit__item--yes .fit__label::before { content: '\2713'; }
.fit__item--no { border-color: rgba(240, 163, 26, .4); }
.fit__item--no .fit__label { color: var(--amber-deep); }
.fit__item--no .fit__label::before { content: '\2715'; }
.fit__text { color: var(--ink-2); font-size: 16px; line-height: 1.6; }

/* ── The six steps ──────────────────────────────────────────── */
/* Numbered by CSS rather than by the list marker, so the counter can be a
   circle in the brand gradient and still sit on the first text line. */
.steps { counter-reset: step; display: grid; gap: 16px; }
.steps__item {
  counter-increment: step;
  position: relative;
  padding-left: 46px;
}
.steps__item::before {
  content: counter(step);
  position: absolute; left: 0; top: 1px;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--lilac);
  border: 1.5px solid rgba(124, 58, 237, .35);
  color: var(--violet-deep);
  font-family: var(--mono); font-size: 12px; font-weight: 700;
  line-height: 1;
}
:root[data-theme="dark"] .steps__item::before {
  border-color: rgba(182, 255, 58, .4);
  color: var(--violet);
}
.steps__title {
  font-size: 16.5px; font-weight: 700; line-height: 1.5;
  color: var(--ink);
}
.steps__text { color: var(--ink-2); font-size: 16.5px; line-height: 1.65; }

/* ── What I look for ────────────────────────────────────────── */
.look { display: grid; gap: 9px; max-width: 68ch; }
.look li {
  position: relative;
  padding-left: 22px;
  color: var(--ink-2);
  font-size: 16.5px;
}
.look li::before {
  content: ''; position: absolute; left: 2px; top: .68em;
  width: 8px; height: 8px; border-radius: 50%;
  background: linear-gradient(135deg, var(--green-bright), var(--violet-bright));
}

/* ── FAQ ────────────────────────────────────────────────────── */
.faq { display: grid; gap: 4px; max-width: 72ch; }
.faq__q {
  margin-top: 14px;
  font-size: 16.5px; font-weight: 700; line-height: 1.5;
  color: var(--ink);
}
.faq__q:first-child { margin-top: 0; }
.faq__a {
  padding-left: 16px;
  border-left: 2px solid var(--line);
  color: var(--ink-2);
  font-size: 16.5px; line-height: 1.65;
}

/* ── The form ───────────────────────────────────────────────── */
.form { display: grid; gap: clamp(22px, 3vw, 32px); }

/* A fieldset carries a UA border, padding and a min-width of min-content
   that refuses to shrink inside a grid track. All three go.

   Deliberately NOT display:grid. Browsers still disagree about whether a
   <legend> is a grid item or is lifted out of the formatting context, and the
   two answers put the first field in two different places. Block flow plus a
   lobotomised-owl gap is boring and identical everywhere. */
.fset {
  border: 0; padding: 0; margin: 0;
  min-width: 0;
}
.fset > * + * { margin-top: 18px; }

.fset__legend {
  padding: 0;
  font-family: var(--mono); font-size: 14px; font-weight: 700;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--violet-deep);
}
:root[data-theme="dark"] .fset__legend { color: var(--violet); }

/* Grid rather than block so the label, help line, control and counter stack
   without their margins collapsing into each other. */
.field { display: grid; min-width: 0; }

/* The store drawer's voice: mono, uppercase, tracked out. It is a <p> rather
   than a <label> on the two groups, which is why the colour is set here and
   not on the element name. */
.field__label {
  display: block;
  margin-bottom: 2px;
  font-family: var(--mono); font-size: 14px; font-weight: 700; letter-spacing: .18em;
  text-transform: uppercase; color: var(--ink-2);
}
.field__help {
  margin: 0 0 8px;
  font-family: var(--mono); font-size: 14px; color: var(--muted); line-height: 1.6;
}

.field__input,
.field__area,
.field__select {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  font-family: var(--sans); font-size: 16.5px; line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: border-color .25s, box-shadow .25s;
}
.field__area {
  resize: vertical;
  min-height: 96px;
  padding: 12px 14px;
}
.field__input:hover,
.field__area:hover,
.field__select:hover { border-color: rgba(124, 58, 237, .35); }
.field__input:focus-visible,
.field__area:focus-visible,
.field__select:focus-visible {
  outline: 3px solid var(--violet);
  outline-offset: 2px;
  border-radius: 12px;
}
.field__input[aria-invalid="true"],
.field__area[aria-invalid="true"],
.field__select[aria-invalid="true"] {
  border-color: var(--bad);
  box-shadow: 0 0 0 3px var(--bad-ring);
}
:root[data-theme="dark"] .field__input:hover,
:root[data-theme="dark"] .field__area:hover,
:root[data-theme="dark"] .field__select:hover { border-color: rgba(0, 255, 156, .45); }

/* The select. appearance:none kills the platform widget, so the chevron is a
   data URI: the CSP is img-src 'self' and this keeps the whole control in one
   file. Two copies, because the stroke has to change with the theme. */
.field__select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236E6680' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px 18px;
  cursor: pointer;
}
:root[data-theme="dark"] .field__select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237d9488' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
/* The dropdown list itself is painted by the OS, not by this file. Naming
   both colours stops a dark-theme visitor getting black text on black. */
.field__select option {
  background: var(--paper);
  color: var(--ink);
}

/* The counter under a textarea. A plain span, never a live region: at one
   announcement per keystroke a live counter makes the field unusable. */
.field__counter {
  margin-top: 5px;
  font-family: var(--mono); font-size: 12.5px; letter-spacing: .06em;
  color: var(--muted);
  text-align: right;
}

/* ── Checkbox and radio groups ──────────────────────────────── */
/* css/store.css has no group control to copy, so these are written against
   the same tokens the drawer's phone field uses: paper fill, --line border,
   12px radius, 44px minimum target. The box itself stays a real checkbox or
   radio: it has to be focusable, announce its own state, and be ticked by a
   <label for>. Only the accent colour and the 20px size are ours. */
.opts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 8px;
}
.opts--row { grid-template-columns: repeat(auto-fit, minmax(min(100%, 120px), max-content)); }

.opt {
  display: flex; align-items: center; gap: 10px;
  min-height: 44px;
  padding: 8px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: border-color .2s, background .2s;
}
.opt:hover { border-color: rgba(124, 58, 237, .35); background: var(--cream); }
:root[data-theme="dark"] .opt:hover { border-color: rgba(0, 255, 156, .45); }

.opt__box {
  width: 22px; height: 22px;
  flex: none;
  margin: 0;
  accent-color: var(--violet);
  cursor: pointer;
}
.opt__box:focus-visible { outline: 3px solid var(--violet); outline-offset: 2px; }
.opt__box[aria-invalid="true"] { outline: 2px solid var(--bad); outline-offset: 2px; }
:root[data-theme="dark"] .opt__box { accent-color: var(--green); }
:root[data-theme="dark"] .opt__box:focus-visible { outline-color: var(--green); }

.opt__label {
  font-size: 16px; line-height: 1.4; color: var(--ink-2);
  cursor: pointer;
}
/* The whole tile lights up when its control is on, so the group survives
   being read at a glance rather than one box at a time. */
.opt:has(.opt__box:checked) {
  border-color: var(--violet);
  background: var(--lilac);
}
.opt:has(.opt__box:checked) .opt__label { color: var(--violet-deep); font-weight: 600; }

/* ── Consent ────────────────────────────────────────────────── */
.consent {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 12px;
  align-items: start;
  padding: 16px 18px;
  background: var(--band);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
}
.consent__box {
  width: 22px; height: 22px;
  margin: 3px 0 0;
  accent-color: var(--violet);
  cursor: pointer;
}
.consent__box:focus-visible { outline: 3px solid var(--violet); outline-offset: 2px; }
.consent__box[aria-invalid="true"] { outline: 2px solid var(--bad); outline-offset: 2px; }
.consent__label {
  font-size: 15.5px; line-height: 1.6; color: var(--ink-2);
  cursor: pointer;
}
.consent__label a {
  color: var(--violet); font-weight: 600;
  border-bottom: 1px dashed rgba(124, 58, 237, .45);
}
.consent__label a:hover { color: var(--green-deep); border-color: var(--green-deep); }
:root[data-theme="dark"] .consent__box { accent-color: var(--green); }
:root[data-theme="dark"] .consent__box:focus-visible { outline-color: var(--green); }
:root[data-theme="dark"] .consent__label a { border-bottom-color: rgba(182, 255, 58, .5); }

/* ── The one error region ───────────────────────────────────── */
/* The store drawer's .drawer__err, unchanged in shape: red left rule, tinted
   fill, ink text. One per form, written by js/upgrade.js. */
.form__err {
  padding: 12px 16px;
  border-left: 3px solid var(--bad);
  border-radius: 0 12px 12px 0;
  background: var(--bad-soft);
  color: var(--ink); font-size: 15.5px; line-height: 1.6;
}
.form__err a {
  color: var(--violet); font-weight: 600;
  border-bottom: 1px dashed rgba(124, 58, 237, .45);
  overflow-wrap: anywhere;
}
.form__err a:hover { color: var(--green-deep); border-color: var(--green-deep); }
:root[data-theme="dark"] .form__err a { border-bottom-color: rgba(182, 255, 58, .5); }

.form__go { width: 100%; }
.form__go[disabled] { opacity: .55; cursor: not-allowed; }
.form__go[disabled]:hover { transform: none; box-shadow: 0 14px 30px -12px rgba(23, 161, 94, .55); }
:root[data-theme="dark"] .form__go[disabled]:hover { box-shadow: 0 0 26px -6px rgba(0, 255, 156, .6); }

/* ── The honeypot ───────────────────────────────────────────── */
/* Off screen, not display:none. A bot that skips unrendered fields would walk
   straight past this one, and then the trap catches nothing. The wrapper
   carries aria-hidden in the markup, so no screen reader ever offers it. */
.hp {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* ── The confirmation ───────────────────────────────────────── */
/* Replaces the form on a 200. It is the only state change on this page that
   throws work away, so it has to read as an arrival rather than as an error
   the form left behind. */
.done {
  display: grid;
  gap: 14px;
  justify-items: start;
  padding: clamp(22px, 3vw, 32px);
  background: var(--band);
  border: 1px solid rgba(23, 161, 94, .3);
  border-left: 3px solid var(--green);
  border-radius: var(--r);
}
.done:focus { outline: none; }
.done:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; }
.done__mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(46, 212, 127, .18);
  color: var(--green-deep);
  font-size: 17px; line-height: 1;
}
:root[data-theme="dark"] .done__mark { background: rgba(0, 255, 156, .14); color: var(--green); }
.done__text { max-width: 62ch; color: var(--ink-2); font-size: 16.5px; line-height: 1.65; }

/* ── Tail: the line from Gene ───────────────────────────────── */
.tail {
  background: var(--band);
  box-shadow: inset 0 1px 0 var(--line-soft), inset 0 -1px 0 var(--line-soft);
  padding: clamp(34px, 5vw, 56px) 0;
}
.tail__eyebrow {
  font-family: var(--mono); font-size: 10.5px; font-weight: 700;
  letter-spacing: .24em; text-transform: uppercase;
  color: var(--violet-deep);
  margin-bottom: 10px;
}
:root[data-theme="dark"] .tail__eyebrow { color: var(--violet); }
.tail__body {
  max-width: 62ch;
  font-family: var(--serif); font-style: italic;
  font-size: clamp(17px, 2vw, 22px); line-height: 1.45;
  color: var(--ink);
}

/* ── Footer: the same plum evening as the homepage ──────────── */
.foot {
  position: relative; overflow: hidden;
  background: #241F35;
  color: #F6F1E6;
  padding: 56px 0 48px;
  text-align: center;
}
:root[data-theme="dark"] .foot { background: var(--band); border-top: 1px solid var(--line-soft); }
.foot::before, .foot::after {
  content: ''; position: absolute; pointer-events: none; filter: blur(52px);
}
.foot::before {
  top: -110px; left: -80px; width: 360px; aspect-ratio: 1;
  background: radial-gradient(circle, rgba(46, 212, 127, .2), transparent 70%);
  border-radius: var(--blob-a);
}
.foot::after {
  bottom: -140px; right: -60px; width: 400px; aspect-ratio: 1;
  background: radial-gradient(circle, rgba(124, 58, 237, .3), transparent 70%);
  border-radius: var(--blob-c);
}
:root[data-theme="dark"] .foot::before { background: radial-gradient(circle, rgba(0, 255, 156, .16), transparent 70%); }
:root[data-theme="dark"] .foot::after  { background: radial-gradient(circle, rgba(255, 214, 10, .13), transparent 70%); }
.foot__inner { position: relative; z-index: 1; display: grid; gap: 8px; padding: 0 18px 40px; }
.foot__sig {
  font-family: var(--mono); font-weight: 700; font-size: 15px; letter-spacing: .2em;
  background: linear-gradient(90deg, var(--green-bright), var(--sun-bright) 55%, var(--violet-bright));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  width: fit-content; margin-inline: auto;
}
.foot__meta {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .12em;
  color: rgba(246, 241, 230, .66); text-transform: uppercase;
}
:root[data-theme="dark"] .foot__meta { color: var(--muted); }
.foot__contact { font-size: 14.5px; color: rgba(246, 241, 230, .8); }
:root[data-theme="dark"] .foot__contact { color: var(--ink-2); }
.foot__contact a { text-decoration: underline; text-underline-offset: 3px; }
.foot__contact a:hover { color: var(--sun-bright); }
.foot__home {
  margin-top: 6px;
  font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
  color: rgba(246, 241, 230, .55);
}
:root[data-theme="dark"] .foot__home { color: var(--muted); }
.foot__home a:hover { color: var(--sun-bright); }

/* ── Back to top ────────────────────────────────────────────── */
.totop {
  position: fixed; right: 22px; bottom: 22px; z-index: 40;
  width: 50px; height: 50px; display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-soft);
  background: var(--paper);
  color: var(--violet);
  box-shadow: var(--shadow-md);
  opacity: 0; visibility: hidden; transform: translateY(14px);
  transition: .35s var(--ease);
}
.totop.show { opacity: 1; visibility: visible; transform: none; }
.totop:hover {
  background: var(--violet); color: #fff;
  border-color: var(--violet);
  transform: translateY(-3px);
  box-shadow: 0 18px 36px -14px rgba(124, 58, 237, .55);
}
/* --violet becomes acid lime on black, so white text on it would vanish. */
:root[data-theme="dark"] .totop:hover {
  color: #04120b;
  box-shadow: 0 0 24px -4px rgba(182, 255, 58, .6);
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 860px) {
  .hero__fresh { font-size: 11.5px; }
  .sheet { padding: clamp(20px, 5vw, 34px); }
}

@media (max-width: 560px) {
  .nav { gap: 8px; padding: 0 12px; }
  .nav__links a { padding: 8px 8px; font-size: 12.5px; letter-spacing: .04em; }
  .nav__end { gap: 8px; }
  .hero__title { font-size: clamp(32px, 10vw, 46px); }
  .hero__eyebrow { font-size: 10.5px; letter-spacing: .16em; }
  /* The rule needs room the title no longer has, so it drops out and the
     header becomes number over title rather than a squeezed single line. */
  .sec__head { flex-wrap: wrap; gap: 8px 12px; }
  .sec__rule { display: none; }
  .steps__item { padding-left: 40px; }
  .steps__item::before { width: 26px; height: 26px; font-size: 11px; }
  .opts--row { grid-template-columns: repeat(auto-fit, minmax(min(100%, 100px), 1fr)); }
  .totop { right: 14px; bottom: 14px; width: 44px; height: 44px; }
}

/* ── Reduced motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    /* Zeroing the delay too, or the hero's staggered fadeUp holds its
       `from` frame (opacity 0) for up to half a second and the headline
       is simply missing for a visitor who asked for less motion. */
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
  }
}

/* ── Print: the program, without the machinery ──────────────── */
@media print {
  :root, :root[data-theme="dark"] {
    --cream: #fff; --paper: #fff; --band: #fff; --cream-2: #fff;
    --ink: #000; --ink-2: #1a1a1a; --muted: #444;
    --violet: #000; --violet-deep: #000; --lilac: #fff;
    --green-deep: #000; --amber-deep: #000;
    --line: #bbb; --line-soft: #ddd;
  }
  .nav, .skip, .totop, .hero__glow { display: none !important; }
  .hero::before, .foot::before, .foot::after { display: none !important; }
  .hero { padding: 10px 0 18px; }
  .body { padding: 0 0 18px; }
  .sheet { box-shadow: none; border: 0; padding: 0; max-width: none; }
  .sec { break-inside: avoid-page; }
  .hero__title em, .nav__name, .foot__sig {
    background: none !important;
    -webkit-text-fill-color: initial !important;
    color: #000 !important;
  }
  .foot { background: #fff; color: #000; padding: 20px 0; }
  .foot__meta, .foot__contact, .foot__home { color: #333; }
}
