/* ==========================================================================
   MIRAI — brand.css  ·  SLASH VARIANT
   "Midnight vault with gilded ledger lines."

   Design language taken from the Slash style reference. The structural rule
   that defines it is the serif/sans collision: DM Serif Display (standing in
   for Ivy Presto) on everything 28px and above, Inter on everything below.
   The boundary is never crossed — serif never goes under 28px, sans never
   over 48px.

   The palette is monochrome with a single warm copper accent, and a gilded
   gradient reserved for data visualisation only. No blue, no green, no
   chromatic accent of any kind. Elevation is surface steps and 1px hairlines,
   never shadows.
   ========================================================================== */

/* --------------------------------------------------------------------------
   FONTS — self-hosted. latin + latin-ext both loaded: the rupee sign U+20B9
   is not in the latin subset, and the dashboard figures need it.
   -------------------------------------------------------------------------- */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                 U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
                 U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* DM Serif Display ships a single weight, 400, in roman and italic. That is
   the whole family — there is no 500 to ask for, so nothing in this file may
   request one on the serif. Declaring a range here would be a lie that buys
   nothing: Chrome does not synthesise bold at 500, it just uses the 400 face.
   SIL Open Font License, so self-hosting is fine. */
@font-face {
  font-family: 'DM Serif Display';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/dmserif-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'DM Serif Display';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/dmserif-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                 U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
                 U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'DM Serif Display';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/dmserif-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'DM Serif Display';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/dmserif-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                 U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
                 U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --------------------------------------------------------------------------
   TIER 1 — SWATCHES
   -------------------------------------------------------------------------- */

:root {
  /* Surface stack */
  --swatch--obsidian:  #08080a;   /* 0 · page canvas */
  --swatch--onyx:      #040406;   /* 1 · card, one step deeper than the page */
  --swatch--carbon:    #121317;   /* 2 · elevated panels, inputs */
  --swatch--graphite:  #1c1d22;   /* 3 · hairlines, icon wells */

  /* Structure and text ramp */
  --swatch--slate:     #2e3038;
  --swatch--smoke:     #464853;

  /* Channel triplets for the three slate-range swatches. A colour used at a
     variable alpha cannot come from a hex token, and color-mix with
     `transparent` resolves to transparent BLACK — which makes anything fading
     out of view darken on the way. These let a swatch be written at any alpha
     without leaving the palette. */
  --swatch--obsidian-rgb:   8  8 10;     /* #08080a */

  /* Blue — the hero field only. The system is monochrome plus copper
     everywhere else; these exist so the first fold has an atmosphere and are
     deliberately not available to components. Luminance is capped: a brighter
     blue (a cyan at #0ea5e9, say) drops the copper eyebrow to 3.8:1 against
     the field's own brightest point. */
  --swatch--azure-rgb:     37  99 235;   /* #2563eb */
  --swatch--cobalt-rgb:    52  87 213;   /* #3457d5 */
  --swatch--indigo-rgb:    30  58 138;   /* #1e3a8a */
  --swatch--smoke-rgb:     70 72 83;     /* #464853 */
  --swatch--slate-rgb:     46 48 56;     /* #2e3038 */
  --swatch--graphite-rgb:  28 29 34;     /* #1c1d22 */
  --swatch--ash:       #5e616e;
  --swatch--steel:     #777a88;
  --swatch--fog:       #9194a1;
  --swatch--mist:      #acafb9;
  --swatch--silver:    #c7c9d1;
  --swatch--bone:      #e2e3e9;   /* default body tone on dark */
  --swatch--paper:     #ffffff;   /* headings and the one filled action */

  /* Light stack — added for the Superpower-style rhythm. The reference is
     dark-only; these are the warm counterparts so the page can alternate. */
  --swatch--linen:     #f4f3f1;   /* page canvas, warm off-white */
  --swatch--chalk:     #ffffff;   /* card on light */
  --swatch--parchment: #eceae6;   /* secondary light fill */
  --swatch--ink:       #0c0c0e;   /* headings on light */
  --swatch--graphite-l:#3f4149;   /* body on light */
  --swatch--pewter:    #646770;   /* muted on light — 4.7:1 on the
                                     darkest light ground (parchment) */
  --swatch--hairline-l:#dedcd7;   /* hairline on light */

  /* The only chromatic note. Category labels and editorial links only —
     never buttons, never icons, never large text. */
  --swatch--copper:    #cc9166;
  --swatch--copper-d:  #8f5a33;   /* copper on light — 5.2:1 on linen.
                                     The 13px eyebrow is small text, so it
                                     needs 4.5:1, not the 3:1 large-text bar. */

  /* Data visualisation only. */
  --gilded: linear-gradient(103deg,
              rgb(174, 147, 87),
              rgb(255, 240, 204) 40%,
              rgb(174, 147, 87) 70%,
              rgba(189, 157, 79, 0));

  /* ---- Typography ---- */
  --font--serif: 'DM Serif Display', Georgia, 'Times New Roman', serif;
  --font--sans:  'Inter', system-ui, -apple-system, sans-serif;
  --font--mono:  'Inter', system-ui, sans-serif;   /* no mono in this system */

  /* Type scale, straight from the reference. Fluid between 375 and 1440. */
  --text--display:      clamp(2.75rem, 0.60rem + 9.2vw, 5.5rem);   /* 88 */
  --text--heading-lg:   clamp(2.25rem, 0.95rem + 5.5vw, 4rem);     /* 64 */
  --text--heading:      clamp(2rem,    1.10rem + 3.8vw, 3.25rem);  /* 52 */
  --text--heading-sm:   clamp(1.75rem, 1.20rem + 2.3vw, 2.75rem);  /* 44 */
  --text--subheading:   1.5rem;                                     /* 24 */
  --text--body:         1.25rem;                                    /* 20 */
  --text--body-sm:      1.125rem;                                   /* 18 */
  --text--body-xs:      1rem;                                       /* 16 */
  --text--eyebrow:      0.8125rem;                                  /* 13 */
  --text--ui:           0.875rem;                                   /* 14 */

  --weight--light:   300;
  --weight--regular: 400;
  --weight--medium:  500;
  --weight--semi:    600;

  /* Serif carries slight POSITIVE tracking — the printed, engraved quality. */
  --track--serif:   0.01em;
  --track--body:    -0.04em;
  --track--body-sm: -0.02em;
  --track--eyebrow: -0.02em;

  /* ---- Layout · compact density ---- */
  --site--max:    1216px;
  --site--gutter: clamp(1.25rem, -0.4rem + 7vw, 4rem);
  --section--pad: clamp(5rem, 1.4rem + 15vw, 10rem);   /* 160px desktop */
  --grid--gap:    clamp(1rem, 0.6rem + 1.8vw, 2rem);

  --space--1: 0.25rem;
  --space--2: 0.5rem;
  --space--3: 0.75rem;
  --space--4: 1rem;
  --space--5: 1.5rem;
  --space--6: 2rem;
  --space--7: 2.5rem;
  --space--8: 3rem;

  --rule--width: 1px;
  --radius--pill: 9999px;   /* buttons, inputs, tags, badges */
  --radius--card: 10px;
  --radius--nav:  2px;

  --ease:     cubic-bezier(0.2, 0.8, 0.2, 1);
  /* The header's own curve. --ease decelerates hard out of the gate, which is
     right for something arriving and wrong for something resizing: the bar
     lurches then crawls. This one eases both ends. */
  --ease--header: cubic-bezier(0.33, 0, 0.16, 1);
  --duration: 600ms;

  --header--h: 68px;
}

/* --------------------------------------------------------------------------
   TIER 2 — THEME

   Two grounds. The page canvas is warm linen; the dark sections render as
   obsidian panels inset into it with a radius, after the way Superpower
   floats its dark bands on a light page. Rhythm comes from the alternation
   plus the gap, not from one or the other alone.
   -------------------------------------------------------------------------- */

:root,
.theme-dark {
  --theme--background:        var(--swatch--obsidian);
  --theme--background-panel:  var(--swatch--onyx);
  --theme--text:              var(--swatch--paper);
  --theme--text-secondary:    var(--swatch--bone);
  --theme--text-tertiary:     var(--swatch--fog);
  --theme--label:             var(--swatch--fog);
  --theme--rule:              var(--swatch--graphite);
  --theme--rule-strong:       var(--swatch--slate);
  --theme--accent:            var(--swatch--copper);
  --theme--attention:         var(--swatch--copper);

  --theme--btn-primary-bg:       var(--swatch--paper);
  --theme--btn-primary-bg-hover: var(--swatch--bone);
  --theme--btn-primary-text:     #000000;
  --theme--link:                 var(--swatch--paper);
  --theme--link-hover:           var(--swatch--copper);
}

.theme-light {
  --theme--background:        var(--swatch--linen);
  --theme--background-panel:  var(--swatch--chalk);
  --theme--text:              var(--swatch--ink);
  --theme--text-secondary:    var(--swatch--graphite-l);
  --theme--text-tertiary:     var(--swatch--pewter);
  --theme--label:             var(--swatch--pewter);
  --theme--rule:              var(--swatch--hairline-l);
  --theme--rule-strong:       #c9c6c0;
  --theme--accent:            var(--swatch--copper-d);
  --theme--attention:         var(--swatch--copper-d);

  --theme--btn-primary-bg:       var(--swatch--ink);
  --theme--btn-primary-bg-hover: #26262b;
  --theme--btn-primary-text:     var(--swatch--chalk);
  --theme--link:                 var(--swatch--ink);
  --theme--link-hover:           var(--swatch--copper-d);
}

/* --------------------------------------------------------------------------
   RESET & BASE
   -------------------------------------------------------------------------- */

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

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

body {
  margin: 0;
  font-family: var(--font--sans);
  font-size: var(--text--body-xs);
  font-weight: var(--weight--regular);
  line-height: 1.5;
  background: var(--swatch--linen);
  color: var(--swatch--graphite-l);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
}

img, svg { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--swatch--copper); outline-offset: 3px; }
::selection { background: var(--swatch--copper); color: #000; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: var(--space--4); top: -100px; z-index: 100;
  background: var(--swatch--paper); color: #000;
  padding: var(--space--3) var(--space--5); border-radius: var(--radius--pill);
  font-size: var(--text--ui); font-weight: var(--weight--medium);
  transition: top 150ms var(--ease);
}
.skip-link:focus { top: var(--space--4); }

/* --------------------------------------------------------------------------
   LAYOUT
   -------------------------------------------------------------------------- */

.section {
  background: var(--theme--background);
  color: var(--theme--text-secondary);
  padding-block: var(--section--pad);
  position: relative;
}

.container {
  width: 100%; max-width: var(--site--max);
  margin-inline: auto; padding-inline: var(--site--gutter);
}

.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--grid--gap); }

@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  [class*="col-"] { grid-column: 1 / -1 !important; }
}

.col-1-5  { grid-column: 1 / span 5; }
.col-1-6  { grid-column: 1 / span 6; }
.col-1-7  { grid-column: 1 / span 7; }
.col-1-8  { grid-column: 1 / span 8; }
.col-1-10 { grid-column: 1 / span 10; }
.col-1-12 { grid-column: 1 / span 12; }
.col-2-9  { grid-column: 2 / span 8; }
.col-3-8  { grid-column: 3 / span 8; }
.col-7-12 { grid-column: 7 / span 6; }
.col-6-12 { grid-column: 6 / span 7; }
.col-8-12 { grid-column: 8 / span 5; }
.col-1-4  { grid-column: 1 / span 4; }
.col-5-12 { grid-column: 5 / span 8; }

.stack > * + * { margin-top: var(--space--5); }
.measure    { max-width: 62ch; }
.measure-sm { max-width: 52ch; }
.measure-xs { max-width: 40ch; }

/* --------------------------------------------------------------------------
   TYPOGRAPHY — the serif/sans boundary

   Serif: display, h1, h2, h3 (all land at 28px or above).
   Sans:  everything else. The boundary is never crossed.
   -------------------------------------------------------------------------- */

.display {
  font-family: var(--font--serif);
  font-size: var(--text--display);
  font-weight: var(--weight--regular);
  line-height: 1.0;
  letter-spacing: var(--track--serif);
  color: var(--theme--text);
  text-wrap: balance;
}

.h1 {
  font-family: var(--font--serif);
  font-size: var(--text--heading-lg);
  font-weight: var(--weight--regular);
  line-height: 1.13;
  letter-spacing: var(--track--serif);
  color: var(--theme--text);
  text-wrap: balance;
}

.h2 {
  font-family: var(--font--serif);
  font-size: var(--text--heading);
  font-weight: var(--weight--regular);
  line-height: 1.13;
  letter-spacing: var(--track--serif);
  color: var(--theme--text);
  text-wrap: balance;
}

.h3 {
  font-family: var(--font--serif);
  font-size: 1.75rem;                 /* 28 — the floor for the serif */
  font-weight: var(--weight--regular);
  line-height: 1.2;
  letter-spacing: var(--track--serif);
  color: var(--theme--text);
}

/* Inter takes over below the boundary. */
.body-lg {
  font-family: var(--font--sans);
  font-size: var(--text--body);
  font-weight: var(--weight--light);
  line-height: 1.38;
  letter-spacing: var(--track--body);
  color: var(--theme--text-tertiary);
  text-wrap: pretty;
}
.body {
  font-family: var(--font--sans);
  font-size: var(--text--body-xs);
  font-weight: var(--weight--regular);
  line-height: 1.5;
  color: var(--theme--text-secondary);
  text-wrap: pretty;
}
.small {
  font-family: var(--font--sans);
  font-size: var(--text--ui);
  line-height: 1.5;
  color: var(--theme--text-tertiary);
}

/* Category eyebrow — copper, semibold, the typographic period before a block. */
.eyebrow, .section-label {
  display: block;
  font-family: var(--font--sans);
  font-size: var(--text--eyebrow);
  font-weight: var(--weight--semi);
  line-height: 1;
  letter-spacing: var(--track--eyebrow);
  color: var(--theme--accent);
}
.section-label { margin-bottom: var(--space--6); }

/* A pull-line is a serif moment, so it sits at the serif floor or above. */
.pull-line {
  font-family: var(--font--serif);
  font-size: clamp(1.75rem, 1.3rem + 1.9vw, 2.75rem);
  font-weight: var(--weight--regular);
  line-height: 1.2;
  letter-spacing: var(--track--serif);
  color: var(--theme--text);
  max-width: 40ch;
  text-wrap: pretty;
}
.pull-line--ruled {
  border-left: var(--rule--width) solid var(--theme--rule-strong);
  padding-left: var(--space--5);
}

.serif-italic { font-family: var(--font--serif); font-style: italic; }
.mono { font-family: var(--font--sans); font-variant-numeric: tabular-nums; }

.rule { border: 0; border-top: var(--rule--width) solid var(--theme--rule); margin: 0; }

/* --------------------------------------------------------------------------
   BUTTONS — pills. The white fill is a scarce resource: one per viewport.
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; gap: var(--space--2);
  padding: 10px 20px;
  font-family: var(--font--sans);
  font-size: var(--text--ui);
  font-weight: var(--weight--medium);
  line-height: 1.4;
  letter-spacing: -0.007em;
  border: var(--rule--width) solid transparent;
  border-radius: var(--radius--pill);
  cursor: pointer;
  transition: background-color 200ms var(--ease), color 200ms var(--ease),
              border-color 200ms var(--ease);
}

.btn--primary {
  background: var(--theme--btn-primary-bg);
  color: var(--theme--btn-primary-text);
  border-color: var(--theme--btn-primary-bg);
}
.btn--primary:hover {
  background: var(--theme--btn-primary-bg-hover);
  border-color: var(--theme--btn-primary-bg-hover);
}

/* Ghost outline — the secondary action beside it. */
.btn--ghost {
  background: transparent;
  color: var(--theme--text);
  border-color: var(--theme--text);
}
.btn--ghost:hover { background: color-mix(in srgb, var(--theme--text) 8%, transparent); }

.btn--sm { padding: 8px 16px; }

/* Editorial link — copper on hover, which is where the accent belongs. */
.link-arrow {
  display: inline-flex; align-items: center; gap: var(--space--2);
  font-family: var(--font--sans);
  font-size: var(--text--ui);
  font-weight: var(--weight--medium);
  color: var(--theme--link);
  transition: color 200ms var(--ease);
}
.link-arrow:hover { color: var(--theme--link-hover); }
.link-arrow .arrow { transition: transform 200ms var(--ease); }
.link-arrow:hover .arrow { transform: translateX(3px); }

.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space--4) var(--space--5); }

/* Attention marker — copper, the single accent. */
.dot {
  width: 6px; height: 6px; border-radius: var(--radius--pill);
  background: var(--theme--attention); flex: 0 0 auto; display: inline-block;
}

/* --------------------------------------------------------------------------
   HEADER
   -------------------------------------------------------------------------- */

.header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header--h);
  display: flex; align-items: center;
  background: color-mix(in srgb, var(--swatch--obsidian) 88%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: var(--rule--width) solid var(--swatch--graphite);
}

.header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space--6);
  width: 100%; max-width: var(--site--max);
  margin-inline: auto; padding-inline: var(--site--gutter);
}

/* Wordmark in the display serif — the brand signature. */
.wordmark {
  font-family: var(--font--serif);
  font-size: 1.5rem;
  font-weight: var(--weight--regular);   /* DM Serif Display has no 500 */
  letter-spacing: var(--track--serif);
  line-height: 1;
  color: var(--swatch--paper);
  white-space: nowrap;
}

.header__actions { display: flex; align-items: center; gap: var(--space--3); }

.menu-toggle {
  display: none; background: none; border: 0;
  padding: var(--space--2) var(--space--3);
  font-size: var(--text--ui); color: var(--swatch--paper); cursor: pointer;
}

@media (max-width: 980px) {
  /* .header .nav--desktop, not .nav--desktop. `.nav { display: flex }` is
     declared further down this file at the same specificity, and a media
     query adds none — so the plain selector lost on source order and the
     desktop nav stayed visible at every width, overlapping the menu button
     and pushing the bar wider than the viewport. */
  .header .nav--desktop { display: none; }
  .header__actions .btn--ghost { display: none; }
  .menu-toggle { display: block; }
}

/* Full-screen mobile menu */
.menu {
  position: fixed; inset: 0; z-index: 60;
  background: var(--swatch--obsidian);
  padding: var(--space--4) 0;
  display: flex; flex-direction: column;
}
.menu[hidden] { display: none; }
.menu__top {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; max-width: var(--site--max); margin-inline: auto;
  padding-inline: var(--site--gutter); height: calc(var(--header--h) - var(--space--4));
}
.menu__links {
  flex: 1; display: flex; flex-direction: column; justify-content: flex-start;
  gap: var(--space--4); padding-inline: var(--site--gutter);
  max-width: var(--site--max); margin-inline: auto; width: 100%;
  overflow-y: auto; padding-block: var(--space--6);
}
.menu__foot {
  padding-inline: var(--site--gutter);
  max-width: var(--site--max); margin-inline: auto; width: 100%;
}
.menu__foot .btn { width: 100%; justify-content: center; padding-block: var(--space--4); }

/* --------------------------------------------------------------------------
   PRIMARY NAV
   -------------------------------------------------------------------------- */

.nav { display: flex; align-items: center; gap: var(--space--5); }
.nav__item { position: relative; }

.nav__link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  font-size: var(--text--ui);
  color: var(--swatch--fog);
  transition: color 200ms var(--ease);
}
.nav__link:hover, .nav__link[aria-current="page"] { color: var(--swatch--paper); }
.nav__item > .nav__link { padding-block: calc((var(--header--h) - 1.4em) / 2); }

.nav__caret {
  width: 5px; height: 5px;
  border-right: 1px solid currentColor; border-bottom: 1px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);
  opacity: 0.6; transition: transform 200ms var(--ease), opacity 200ms var(--ease);
}
.nav__item:hover .nav__caret, .nav__item:focus-within .nav__caret {
  opacity: 1; transform: rotate(225deg) translate(-2px, -2px);
}

.nav__panel {
  position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%) translateY(-6px);
  min-width: 330px; padding: var(--space--3);
  background: var(--swatch--carbon);
  border: var(--rule--width) solid var(--swatch--graphite);
  border-radius: var(--radius--card);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 180ms var(--ease), transform 180ms var(--ease), visibility 180ms;
  z-index: 60;
}
.nav__item:hover .nav__panel, .nav__item:focus-within .nav__panel {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.nav__panel ul { display: grid; gap: 2px; }
.nav__panel a {
  display: block; padding: var(--space--3) var(--space--4);
  border-radius: var(--radius--nav);
  transition: background-color 160ms var(--ease);
}
.nav__panel a:hover, .nav__panel a:focus-visible { background: rgba(255, 255, 255, 0.05); }
.nav__t {
  display: block; font-size: var(--text--ui);
  font-weight: var(--weight--medium); color: var(--swatch--paper);
}
.nav__d {
  display: block; margin-top: 2px; font-size: 12px; line-height: 1.35;
  color: var(--swatch--steel);
}

.menu__group { margin-bottom: var(--space--6); }
.menu__head {
  font-size: var(--text--eyebrow); font-weight: var(--weight--semi);
  letter-spacing: var(--track--eyebrow);
  color: var(--swatch--copper); margin-bottom: var(--space--3);
}
.menu__group a {
  display: block; padding-block: var(--space--2);
  font-family: var(--font--serif); font-size: 1.5rem;
  font-weight: var(--weight--regular); letter-spacing: var(--track--serif);
  color: var(--swatch--paper);
}

/* --------------------------------------------------------------------------
   FOOTER
   -------------------------------------------------------------------------- */

.footer {
  background: var(--swatch--obsidian);
  color: var(--swatch--fog);
  border-top: var(--rule--width) solid var(--swatch--graphite);
  padding-block: var(--space--8) var(--space--6);
  font-size: var(--text--ui);
}
.footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: var(--grid--gap); }
@media (max-width: 860px) { .footer__grid { grid-template-columns: 1fr 1fr; gap: var(--space--7); } }
@media (max-width: 560px) { .footer__grid { grid-template-columns: 1fr; } }

.footer .wordmark { font-size: 1.5rem; display: inline-block; }
.footer__head {
  font-size: var(--text--eyebrow); font-weight: var(--weight--semi);
  letter-spacing: var(--track--eyebrow);
  color: var(--swatch--copper); margin-bottom: var(--space--4);
}
.footer__list { display: flex; flex-direction: column; gap: var(--space--3); }
.footer__list a { transition: color 200ms var(--ease); }
.footer__list a:hover { color: var(--swatch--paper); }
.footer__bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space--3);
  margin-top: var(--space--8); padding-top: var(--space--5);
  border-top: var(--rule--width) solid var(--swatch--graphite);
  color: var(--swatch--steel);
}
.footer__bottom nav { display: flex; gap: var(--space--5); }

/* --------------------------------------------------------------------------
   FORM — pill fields, matching the buttons
   -------------------------------------------------------------------------- */

.field { display: flex; flex-direction: column; gap: var(--space--2); }
.field label {
  font-size: var(--text--eyebrow); font-weight: var(--weight--semi);
  letter-spacing: var(--track--eyebrow); color: var(--swatch--fog);
}
.field input, .field textarea {
  background: transparent;
  border: var(--rule--width) solid var(--swatch--steel);
  border-radius: var(--radius--pill);
  padding: 12px 20px; min-height: 46px;
  font-size: var(--text--body-xs); color: var(--swatch--bone);
  transition: border-color 200ms var(--ease);
}
.field textarea { min-height: 112px; resize: vertical; border-radius: var(--radius--card); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--swatch--paper); }
.field input::placeholder, .field textarea::placeholder { color: var(--swatch--steel); }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* --------------------------------------------------------------------------
   MOTION
   -------------------------------------------------------------------------- */

.js [data-anim] {
  opacity: 0; transform: translateY(12px);
  transition: opacity var(--duration) var(--ease), transform var(--duration) var(--ease);
  transition-delay: var(--anim-delay, 0ms);
}
.js [data-anim].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-anim] { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --------------------------------------------------------------------------
   INSET DARK PANELS

   The Superpower move: dark sections are not full-bleed bands, they are
   panels floating on the light page with a margin and a radius. The light
   sections stay flush, so the page reads as linen with obsidian cards set
   into it rather than as stripes.
   -------------------------------------------------------------------------- */

.section.theme-dark {
  margin-inline: var(--panel--inset);
  border-radius: var(--radius--panel);
  overflow: hidden;
}

:root {
  --panel--inset:  clamp(0.5rem, -0.3rem + 3vw, 1.5rem);
  --radius--panel: clamp(16px, 0.5rem + 1vw, 28px);
}

/* Consecutive dark panels join into one, rather than showing a seam of linen
   between them. */
.section.theme-dark + .section.theme-dark {
  margin-top: calc(var(--panel--inset) * -1);
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}
.section.theme-dark:has(+ .section.theme-dark) {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  padding-bottom: 0;
}

/* The last panel on a page needs the same inset at the bottom that the first
   one gets at the top. Without it the panel's rounded bottom corners sit
   directly on the footer's full-width top edge — the radius meets a hard line
   and the panel stops reading as a panel. A light last section needs nothing:
   those are flush by design and run into the footer correctly.

   Double the side inset, not equal to it. The footer is obsidian too, so a
   24px strip of linen between two black masses reads as a scratch rather than
   as a gap; at twice that the panel clearly ends before the footer begins. */
main > .section.theme-dark:last-child {
  margin-bottom: calc(var(--panel--inset) * 2);
}

/* Panels need their own inner gutter now that they are inset. */
.section.theme-dark > .container { padding-inline: clamp(1.25rem, -0.2rem + 6vw, 3.5rem); }

/* --------------------------------------------------------------------------
   HEADER — full width at rest, floating pill once scrolled

   Superpower's behaviour: at the top of the page the bar spans the full
   width on the page ground with dark type; as soon as you scroll it
   contracts into a translucent dark pill floating over the content.

   Only .header__inner changes — background, radius, border and max-width.
   The fixed wrapper never moves, so nothing reflows and the transition has
   no jank.

   The PILL is the default state, not the top state. Without JavaScript the
   class is never added, and a transparent full-width bar would leave dark
   type sitting on the dark hero panel as soon as anyone scrolled. Defaulting
   to the pill means the header is readable over any ground, and JS only
   opts into the wider treatment while it is genuinely at the top.
   -------------------------------------------------------------------------- */

.header {
  --header--h: 52px;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 80;
  padding-block: var(--space--3);
  background: transparent;
  border: 0;
  backdrop-filter: none;
  height: auto;
  transform: none;
  max-width: none;
  width: 100%;
  /* No padding here. The wrapper is a plain full-width strip and the inner
     owns every dimension that changes, so the whole transition is one
     interpolation on one element. */
  padding-inline: 0;
}

/* Every property that changes between the two states has to be interpolable,
   or the browser swaps it at the halfway point and the whole move reads as a
   cut. Three of them were not:

     max-width: calc(...) -> none      `none` is not a length
     backdrop-filter: blur(16px) -> none   `none` is not a filter list
     background/border-color -> transparent  interpolates, but `transparent`
                               is rgba(0,0,0,0), so a white hairline fades
                               out through grey instead of just fading

   So the geometry — the largest and most visible part of the change — was
   never animating at all. It snapped while the type colour faded around it.

   The fixes, in order:
     · width comes from margin-inline, not max-width. Both ends are lengths,
       and max() of two <length-percentage> values interpolates cleanly.
     · the filter list keeps its shape and goes to zero, not to `none`.
     · both colours fade to a zero-alpha version of themselves, so the hue
       never shifts on the way out. */

.header__inner {
  height: var(--header--h);
  /* .header is a flex container, so this is a flex item: width:100% is its
     flex basis and flex-shrink pulls it in to leave room for the margins.
     width:auto would size it to its content instead. */
  width: 100%;
  max-width: none;

  /* The pill's inset: the panel inset on narrow viewports, half the leftover
     space once the viewport is wider than the site measure. Same result the
     old max-width + auto margins gave, expressed as a length so it can be
     animated to zero. */
  margin-inline: max(
    var(--panel--inset),
    calc((100% - var(--site--max) + 2rem) / 2)
  );

  padding-inline: var(--space--5);

  /* Half the bar's height, not --radius--pill. A 9999px radius clamps to a
     pill at any size, so interpolating it to 0 sits visually unchanged until
     it drops under 26px — the corners would hold their shape for most of the
     move and then square off in the last few frames. Starting at the real
     radius makes the corners open evenly across the whole transition. */
  border-radius: calc(var(--header--h) / 2);

  position: relative;
  backdrop-filter: saturate(160%) blur(16px);
  border: var(--rule--width) solid rgb(255 255 255 / 0.12);

  transition:
    margin 420ms var(--ease--header),
    padding 420ms var(--ease--header),
    border-radius 420ms var(--ease--header),
    border-color 300ms var(--ease--header),
    backdrop-filter 300ms var(--ease--header);
}

/* THE BAR'S GROUND — a slate ramp, not the page's own black.

   Obsidian at 92% made the bar disappear into the hero panel behind it. This
   lifts it clear of every ground on the page while staying inside the palette:
   smoke into slate into graphite, on the 103deg the gilded gradient already
   uses. 96% rather than lower because the bar passes over linen as often as
   obsidian, and the fold behind it must not change how light the bar reads:
   at 94% a light fold lifted the smoke stop far enough to pull the nav links
   to 4.6:1, close enough to the floor to be worth the two points. The blur
   still shows through.

   It lives on a pseudo-element because a gradient cannot be transitioned.
   Chrome treats background-image as a discrete property: two linear-gradients
   swap at the halfway point however well their stops match, which is the same
   cut this transition was just rebuilt to avoid. Opacity always interpolates.

   Absolutely-positioned children of a flex container are not flex items, so
   this sits outside the layout; the real children are lifted above it. */
.header__inner::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;        /* tracks the parent's radius as it animates */
  background-image: linear-gradient(
    103deg,
    rgb(var(--swatch--smoke-rgb)    / 0.96),
    rgb(var(--swatch--slate-rgb)    / 0.96) 52%,
    rgb(var(--swatch--graphite-rgb) / 0.96)
  );
  transition: opacity 300ms var(--ease--header);
}

.header__inner > * { position: relative; z-index: 1; }

.header.is-top .header__inner::before { opacity: 0; }

/* At the top: full width, no pill, no fill — the page ground shows through
   and the type goes dark to sit on it. */
.header.is-top .header__inner {
  margin-inline: 0px;
  padding-inline: var(--site--gutter);
  border-radius: 0px;
  backdrop-filter: saturate(100%) blur(0px);
  border-color: rgb(255 255 255 / 0);
}

/* Type colour follows the state, not the section behind it. */
.header .wordmark   { color: var(--swatch--paper); }
/* Silver, not fog. Fog reads 4.4:1 on slate — under the floor — and worse on
   the smoke end of the ramp. Silver clears 5.5:1 at the lightest stop. */
.header .nav__link  { color: var(--swatch--silver); }
.header .nav__link:hover { color: var(--swatch--paper); }
.header .btn--ghost { color: var(--swatch--paper); border-color: rgba(255,255,255,0.45); }
.header .btn--ghost:hover { background: rgba(255,255,255,0.08); }
.header .btn--primary {
  background: var(--swatch--paper); color: #000;
  border-color: var(--swatch--paper);
}
.header .btn--primary:hover { background: var(--swatch--bone); border-color: var(--swatch--bone); }
.header .menu-toggle { color: var(--swatch--paper); }

.header.is-top .wordmark  { color: var(--swatch--ink); }
.header.is-top .nav__link { color: var(--swatch--pewter); }
.header.is-top .nav__link:hover { color: var(--swatch--ink); }
.header.is-top .btn--ghost {
  color: var(--swatch--ink); border-color: rgba(12, 12, 14, 0.35);
}
.header.is-top .btn--ghost:hover { background: rgba(12, 12, 14, 0.06); }
.header.is-top .btn--primary {
  background: var(--swatch--ink); color: var(--swatch--chalk);
  border-color: var(--swatch--ink);
}
.header.is-top .btn--primary:hover { background: #26262b; border-color: #26262b; }
.header.is-top .menu-toggle { color: var(--swatch--ink); }

/* The type fades on the same curve as the shape it sits in, a touch quicker,
   so the colours have settled by the time the bar stops moving rather than
   arriving after it. */
.header .wordmark, .header .nav__link, .header .btn, .header .menu-toggle {
  transition: color 300ms var(--ease--header),
              background-color 300ms var(--ease--header),
              border-color 300ms var(--ease--header);
}

/* The bar occupies its own strip of page ground, so the inset hero panel
   begins below it — inset on all four sides, not just three. */
body { padding-top: calc(52px + var(--space--3) * 2 + var(--panel--inset)); }
.hero, .page-hero { padding-top: calc(var(--section--pad) * 0.85); }

@media (max-width: 980px) {
  .header { --header--h: 48px; }
  body { padding-top: calc(48px + var(--space--3) * 2 + var(--panel--inset)); }
}

@media (prefers-reduced-motion: reduce) {
  .header, .header__inner, .header__inner::before, .header .wordmark,
  .header .nav__link, .header .btn, .header .menu-toggle { transition: none; }
}

/* --------------------------------------------------------------------------
   MEDIA FRAME

   A rounded, full-width media slot. Superpower runs photography edge to edge
   inside these; Mirai has none yet, so each frame carries its own abstract
   visual and is marked in the source where a real asset belongs.
   -------------------------------------------------------------------------- */

.media {
  position: relative;
  border-radius: var(--radius--panel);
  overflow: hidden;
  background: var(--swatch--onyx);
  aspect-ratio: 16 / 7;
}
.media > img,
.media > video {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.media--tall { aspect-ratio: 4 / 3; }
.media--wide { aspect-ratio: 21 / 8; }

/* Copy overlaid on media needs a legibility wash from the bottom. */
.media__overlay {
  position: absolute; inset: auto 0 0 0;
  padding: var(--space--7) var(--space--6) var(--space--6);
  background: linear-gradient(to top, rgba(8,8,10,0.92), rgba(8,8,10,0.55) 45%, transparent);
  color: var(--swatch--paper);
}
.media__overlay .h3, .media__overlay .body { color: inherit; }
.media__caption {
  margin-top: var(--space--3);
  font-size: var(--text--eyebrow);
  color: var(--swatch--pewter);
}

/* A frame with no asset yet: hairline, label, no fake photograph. */
.media--placeholder {
  background: var(--swatch--parchment);
  border: var(--rule--width) dashed var(--swatch--hairline-l);
  display: grid; place-items: center;
}
.media--placeholder p {
  font-size: var(--text--eyebrow);
  font-weight: var(--weight--semi);
  letter-spacing: var(--track--eyebrow);
  color: var(--swatch--pewter);
  text-align: center; max-width: 34ch;
  padding: var(--space--5);
}
