/* Audience Atlas — MAZDI.
   Every colour, radius and rule in the app is a token declared here.

   Brand rules this file obeys (input/MAZDI Design System):
     · Red #EA1C2A is an ACCENT ONLY — CTAs, rules, selection, headline
       emphasis. Never body text, never a background wash.
     · High contrast. No gradients, no pastels. Signature combos are
       red-on-white, black-on-white, red-on-black.
     · Sharp corners (0/2/4px). Pills for tags only. Hairline borders.
       Structure comes from whitespace and red rules, not from soft cards.
     · Outfit is the typeface. See --mono below for the one exception. */

:root {
  /* ---- MAZDI brand palette ---- */
  --mz-red:        #EA1C2A;
  --mz-red-hover:  #CF1825;
  --mz-red-press:  #B5141F;
  --mz-black:      #0C0C0C;
  --mz-black-lift: #1C1C1C;
  --mz-gray-dark:  #313131;
  --mz-gray-mid:   #888888;
  --mz-gray-light: #F5F5F5;
  --mz-white:      #FFFFFF;
  --mz-border:     #E2E2E2;
  --mz-border-dark:#2A2A2A;

  /* ---- Semantic surface + ink ---- */
  --page:     var(--mz-white);
  --surface:  var(--mz-white);
  --sunken:   var(--mz-gray-light);
  --ink:      var(--mz-black);
  --ink2:     var(--mz-gray-dark);
  --muted:    var(--mz-gray-mid);
  --line:     var(--mz-border);
  --line2:    #CFCFCF;
  --accent:   var(--mz-red);
  --accent-ink: var(--mz-white);

  /* The map plate is a map surface, not page chrome: MAZDI black in both
     themes. Red on black is a signature combo, so the heat layer sits right. */
  --plate:      var(--mz-black);
  --plate2:     #191919;
  --plate-line: #3A3A3A;

  --card:      var(--mz-white);
  --card-ink:  var(--mz-black);
  --card-ink2: var(--mz-gray-dark);

  /* ---- Categorical series ----
     The brand supplies one accent; a seven-group choropleth needs seven
     separable hues, so this palette extends it. MAZDI red anchors series 1
     (Hispanic or Latino, the agency's core audience); the rest are from the
     Okabe-Ito colour-vision-safe set and appear only inside data, never as
     chrome. Validated with scripts/palette.mjs — worst pair across all 21
     combinations is dE 10.9 (tritanopia). Colour is never the sole encoding:
     every chip, bar and legend row carries its label. Re-run the validator if
     you change any of these. */
  --s1: #EA1C2A;  /* Hispanic or Latino — MAZDI red */
  --s2: #0072B2;  /* Black or African American */
  --s3: #009E73;  /* Asian */
  --s4: #E69F00;  /* White */
  --s5: #CC79A7;  /* Two or more races */
  --s6: #56B4E9;  /* Am. Indian / Alaska Native */
  --s7: #4D4D4D;  /* Native Hawaiian / Pacific Islander */

  /* ---- Sequential ramp (choropleth): single hue, MAZDI red, L* 90→29 ---- */
  --q1: #FCDCDE;
  --q2: #F6A8AD;
  --q3: #EE6B74;
  --q4: #D81F2C;
  --q5: #8C1018;

  --shadow: none;          /* flat brand: hairlines do the work */
  --shadow-lg: 0 24px 60px rgba(12, 12, 12, .18);

  /* Outfit is the single brand typeface and carries every word in the app.
     It has no tabular-figure feature and its digits are proportional — "1" is
     321 units against "0" at 659 — which makes a seven-digit column jitter by
     roughly 30px. A data instrument needs figures on a grid, so numerals only
     use --mono. This is the one documented exception to the single-typeface
     system; it never touches display, headings, body, labels or buttons. */
  --ui: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: var(--ui);
  --mono: "Roboto Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-extrabold: 800;

  --r: 4px;
  --r-sm: 2px;
  --rule: 3px;             /* thick red divider */
  --gutter: 24px;
  --ease: cubic-bezier(.2, 0, 0, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page:    var(--mz-black);
    --surface: #131313;
    --sunken:  #1C1C1C;
    --ink:     var(--mz-white);
    --ink2:    #C4C4C4;
    --muted:   var(--mz-gray-mid);
    --line:    var(--mz-border-dark);
    --line2:   #3A3A3A;
    --accent:  #FF3B47;

    --card:      #1C1C1C;
    --card-ink:  var(--mz-white);
    --card-ink2: #C4C4C4;

    /* Lightened for a black ground; worst pair dE 8.4 (protanopia). */
    --s1: #FF4A54;
    --s2: #2E86D9;
    --s3: #00C08A;
    --s4: #F2A93B;
    --s5: #E07FC0;
    --s6: #8FD0F5;
    --s7: #BFBFBF;

    /* Inverted: the lowest bin recedes toward the plate so low-value places
       do not read as filled in. L* 7→74. */
    --q1: #2B0C0F;
    --q2: #5C1319;
    --q3: #99202B;
    --q4: #E03A46;
    --q5: #FF9AA1;

    --shadow-lg: 0 24px 60px rgba(0, 0, 0, .6);
  }
}

:root[data-theme="dark"] {
  --page:    var(--mz-black);
  --surface: #131313;
  --sunken:  #1C1C1C;
  --ink:     var(--mz-white);
  --ink2:    #C4C4C4;
  --muted:   var(--mz-gray-mid);
  --line:    var(--mz-border-dark);
  --line2:   #3A3A3A;
  --accent:  #FF3B47;

  --card:      #1C1C1C;
  --card-ink:  var(--mz-white);
  --card-ink2: #C4C4C4;

  --s1: #FF4A54;
  --s2: #2E86D9;
  --s3: #00C08A;
  --s4: #F2A93B;
  --s5: #E07FC0;
  --s6: #8FD0F5;
  --s7: #BFBFBF;

  --q1: #2B0C0F;
  --q2: #5C1319;
  --q3: #99202B;
  --q4: #E03A46;
  --q5: #FF9AA1;

  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .6);
}

/* ------------------------------------------------------------------ base */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink2);
  font-family: var(--ui);
  font-size: 16px;
  font-weight: var(--fw-regular);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  margin: 0;
  color: var(--ink);
  letter-spacing: -.01em;
  line-height: 1.1;
  text-wrap: balance;
}

/* Numerals only — see the --mono note above. */
.num, .v, td.n, .ranks .v, .hovercard td, .legend, .tile .v {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.label {
  font-family: var(--ui);
  font-size: 12px;
  font-weight: var(--fw-bold);
  letter-spacing: .14em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--muted);
}

.wrap { max-width: 1440px; margin: 0 auto; padding: 0 var(--gutter); }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 0; box-shadow: 0 0 0 3px rgba(234, 28, 42, .4); border-radius: var(--r-sm); }

/* -------------------------------------------------------------- masthead */

.masthead { border-bottom: 1px solid var(--line); background: var(--surface); }
.masthead::after { content: ""; display: block; height: var(--rule); background: var(--accent); }

.masthead .wrap {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; padding-top: 22px; padding-bottom: 20px; flex-wrap: wrap;
}

.brandmark { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.brandmark img { height: 26px; width: auto; display: block; }
.brandmark .divider { width: 1px; height: 20px; background: var(--line2); }
.brandmark .kicker { color: var(--muted); }

.masthead h1 { font-size: 34px; font-weight: var(--fw-extrabold); letter-spacing: -.02em; }
.masthead h1 em { font-style: normal; color: var(--accent); }

.tagline { margin: 8px 0 0; color: var(--ink2); font-size: 15px; max-width: 64ch; }

.masthead-right { display: flex; align-items: center; gap: 14px; }
.vintage { margin: 0; text-align: right; }
.vintage b { display: block; color: var(--ink2); font-weight: var(--fw-regular); font-family: var(--mono); font-size: 11px; }

.ghost {
  background: transparent; border: 1px solid var(--line2); border-radius: var(--r-sm);
  padding: 7px 12px; font-size: 12px; font-weight: var(--fw-semibold); color: var(--ink2);
  transition: border-color var(--ease) 120ms, color var(--ease) 120ms;
}
.ghost:hover { border-color: var(--accent); color: var(--ink); }

/* Two states, both labelled, the live one filled. A control called "Theme"
   says neither what it does nor which way it is set. */
.themetoggle {
  display: inline-flex; border: 1px solid var(--line2);
  border-radius: var(--r-sm); overflow: hidden; background: var(--surface);
}
.themetoggle button {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: transparent; color: var(--muted);
  padding: 7px 12px; font-size: 12px; font-weight: var(--fw-semibold);
  line-height: 1; white-space: nowrap;
  transition: background var(--ease) 120ms, color var(--ease) 120ms;
}
.themetoggle button + button { border-left: 1px solid var(--line2); }
.themetoggle button svg { flex: none; }
.themetoggle button:hover { color: var(--ink); }
.themetoggle button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.themetoggle button:focus-visible { outline: 0; box-shadow: inset 0 0 0 2px var(--accent); }

@media (max-width: 720px) {
  .themetoggle button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .themetoggle button { padding: 8px 11px; }
}

/* --------------------------------------------------------------- filters */

.filters {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--page) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.filters .wrap { padding-top: 12px; padding-bottom: 12px; }

.frow {
  display: grid; grid-template-columns: 110px 1fr; gap: 14px;
  align-items: baseline; padding: 6px 0;
}
.frow + .frow { border-top: 1px solid var(--line); }
.frow[hidden] { display: none; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.chip {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line2); background: var(--surface); color: var(--ink2);
  border-radius: 999px; padding: 6px 13px;
  font-size: 13px; font-weight: var(--fw-medium); line-height: 1.2; white-space: nowrap;
  transition: border-color var(--ease) 120ms, color var(--ease) 120ms, background var(--ease) 120ms;
}
.chip:hover:not(:disabled) { border-color: var(--ink); color: var(--ink); }
/* Selection is red-on-white inverted to white-on-red: a signature combo,
   not a tint. No pastel fills anywhere. */
.chip[aria-pressed="true"] {
  background: var(--accent); border-color: var(--accent);
  color: var(--accent-ink); font-weight: var(--fw-semibold);
}
.chip[aria-pressed="true"] .dot { box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .85); }
.chip:disabled { opacity: .35; cursor: not-allowed; }
.chip .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.chip.sub { font-size: 12px; padding: 5px 11px; color: var(--muted); }
.chip.sub::before { content: "\2514"; font-family: var(--mono); opacity: .5; margin-right: -2px; }
.chip.head { font-weight: var(--fw-semibold); color: var(--ink2); }

select.chip {
  padding-right: 28px; appearance: none; font-weight: var(--fw-medium);
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}

/* ----------------------------------------------------------------- stage */

.stage {
  display: grid; grid-template-columns: minmax(0, 1fr) 336px; gap: 20px;
  padding-top: 24px; padding-bottom: 24px; align-items: start;
}

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.panel > header {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 13px 16px 11px; border-bottom: 1px solid var(--line);
}
.panel > header h2 { font-size: 16px; font-weight: var(--fw-semibold); }

/* ------------------------------------------------------------------- map */

.mapbox {
  position: relative; background: var(--plate);
  border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden; aspect-ratio: 975 / 610; touch-action: none; cursor: grab;
}
.mapbox.dragging { cursor: grabbing; }
.mapbox canvas, .mapbox svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.mapbox svg { pointer-events: none; }
.mapbox.shading svg { pointer-events: auto; }

.st { fill: none; stroke: var(--plate-line); stroke-width: 1; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.mapbox.shading .st { fill: var(--plate2); cursor: pointer; }
.mapbox.shading .st.dim { fill: var(--plate2); opacity: .45; }
.st.sel { stroke: var(--mz-red); stroke-width: 1.8; }
.co { stroke: rgba(0, 0, 0, .4); stroke-width: .4; vector-effect: non-scaling-stroke; cursor: pointer; }
.co.hot, .st.hot { stroke: #fff; stroke-width: 1.8; }
#gOutline path { fill: none; stroke: rgba(255, 255, 255, .32); stroke-width: .9; vector-effect: non-scaling-stroke; pointer-events: none; }

.maptitle { position: absolute; left: 14px; top: 13px; color: #fff; pointer-events: none; text-shadow: 0 1px 8px rgba(0, 0, 0, .9); }
.maptitle b { display: block; font-size: 18px; font-weight: var(--fw-bold); letter-spacing: -.01em; }
.maptitle span { font-size: 11px; font-weight: var(--fw-bold); letter-spacing: .14em; text-transform: uppercase; opacity: .7; }

.zoomctl { position: absolute; right: 14px; top: 13px; display: flex; flex-direction: column; gap: 5px; }
.zoomctl button {
  width: 30px; height: 30px; border-radius: var(--r-sm);
  border: 1px solid rgba(255, 255, 255, .24); background: rgba(12, 12, 12, .74);
  color: #fff; font-size: 15px; line-height: 1; display: grid; place-items: center;
  backdrop-filter: blur(6px);
}
.zoomctl button:hover { border-color: var(--mz-red); background: var(--mz-red); }
.zoomctl button.wide { width: auto; padding: 0 9px; font-size: 10px; font-weight: var(--fw-bold); letter-spacing: .12em; }

.legend {
  position: absolute; left: 14px; bottom: 13px; display: flex; align-items: center; gap: 9px;
  color: rgba(255, 255, 255, .82); font-size: 10px; letter-spacing: .06em;
  pointer-events: none; text-shadow: 0 1px 8px rgba(0, 0, 0, .9);
}
.legend .ramp { display: flex; height: 8px; border-radius: var(--r-sm); overflow: hidden; }
.legend .ramp i { width: 26px; }

.hovercard {
  position: absolute; z-index: 5; min-width: 218px; padding: 12px 14px 11px;
  background: var(--card); color: var(--card-ink);
  border: 1px solid var(--line2); border-left: var(--rule) solid var(--accent);
  border-radius: var(--r-sm); box-shadow: var(--shadow-lg);
  pointer-events: none; opacity: 0; transition: opacity 100ms var(--ease);
}
.hovercard.on { opacity: 1; }
.hovercard h3 { font-size: 17px; font-weight: var(--fw-bold); line-height: 1.15; color: var(--card-ink); }
.hovercard .place { font-size: 10px; font-weight: var(--fw-bold); letter-spacing: .14em; text-transform: uppercase; opacity: .6; margin-top: 3px; }
.hovercard table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.hovercard th { text-align: left; font-weight: var(--fw-regular); font-size: 13px; color: var(--card-ink2); padding: 2px 0; }
.hovercard td { text-align: right; font-size: 13px; padding: 2px 0 2px 14px; white-space: nowrap; }
.hovercard tr.lead th { color: var(--card-ink); font-weight: var(--fw-semibold); }
.hovercard tr.lead td { font-weight: var(--fw-medium); }

.maphint { color: var(--muted); font-size: 13px; margin: 10px 2px 0; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ----------------------------------------------------------------- tiles */

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  border-top: var(--rule) solid var(--accent); padding: 12px 13px 13px; min-height: 96px;
}
.tile .k { display: block; margin-bottom: 7px; }
.tile .v { font-size: 22px; font-weight: var(--fw-medium); letter-spacing: -.02em; display: block; line-height: 1.1; color: var(--ink); }
.tile .s { color: var(--ink2); font-size: 13px; display: block; margin-top: 5px; line-height: 1.35; }

/* ------------------------------------------------------------------ rank */

.ranks { list-style: none; margin: 0; padding: 4px 0; max-height: 560px; overflow-y: auto; }
.ranks button {
  width: 100%; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 8px;
  align-items: baseline; background: none; border: 0; padding: 7px 16px; text-align: left;
}
.ranks button:hover, .ranks button:focus-visible { background: var(--sunken); }
.ranks .r { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.ranks .nm { font-size: 14px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranks .nm i { font-style: normal; font-size: 10px; font-weight: var(--fw-bold); letter-spacing: .1em; color: var(--muted); margin-left: 7px; }
.ranks .v { font-size: 13px; color: var(--ink); }
.ranks .bar { grid-column: 2 / 4; height: 3px; background: var(--sunken); overflow: hidden; }
.ranks .bar i { display: block; height: 100%; background: var(--series, var(--s1)); }

/* ----------------------------------------------------------- composition */

.compo { padding: 14px 16px 16px; }
.compbar { display: flex; height: 32px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-sm); }
.compbar button { border: 0; padding: 0; min-width: 2px; position: relative; transition: filter 120ms var(--ease); }
.compbar button:hover { filter: brightness(1.12); }
.compbar button[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--ink); }
.complegend { display: flex; flex-wrap: wrap; gap: 5px 18px; margin-top: 11px; }
.complegend div { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink2); }
.complegend .dot { width: 10px; height: 10px; border-radius: var(--r-sm); flex: none; }
.complegend b { font-family: var(--mono); font-weight: var(--fw-medium); color: var(--ink); }

/* ----------------------------------------------------------------- table */

.tablewrap { max-height: 520px; overflow: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { padding: 7px 16px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
table.data th:first-child, table.data td:first-child,
table.data th:nth-child(2), table.data td:nth-child(2) { text-align: left; }
table.data thead th {
  position: sticky; top: 0; z-index: 1; background: var(--surface);
  border-bottom: 2px solid var(--ink);
  font-size: 11px; font-weight: var(--fw-bold); letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); cursor: pointer;
}
table.data thead th.sorted { color: var(--accent); }
table.data thead th.sorted::after { content: " \25be"; }
table.data thead th.sorted.asc::after { content: " \25b4"; }
table.data td { color: var(--ink2); }
table.data td:nth-child(2) { color: var(--ink); }
table.data td.pl { font-size: 11px; font-weight: var(--fw-bold); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
table.data tbody tr:hover { background: var(--sunken); }

/* ----------------------------------------------------------------- notes */

.notes { margin-top: 20px; }
.notes .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px 28px; padding: 18px 16px; }
.notes h3 { font-family: var(--ui); font-size: 13px; font-weight: var(--fw-bold); letter-spacing: 0; margin-bottom: 5px; }
.notes p { margin: 0; color: var(--ink2); font-size: 14px; }
.notes .warn { border-left: var(--rule) solid var(--accent); padding-left: 14px; }
.notes .warn h3 { color: var(--accent); }

footer.src { padding: 22px 0 48px; color: var(--muted); font-size: 13px; }
footer.src code { font-family: var(--mono); font-size: 12px; }

/* ------------------------------------------------------------ responsive */

@media (max-width: 1080px) {
  .stage { grid-template-columns: minmax(0, 1fr); }
  .tiles { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
}
@media (max-width: 720px) {
  :root { --gutter: 16px; }
  .masthead h1 { font-size: 26px; }
  .frow { grid-template-columns: 1fr; gap: 5px; }
  .ranks { max-height: 420px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Logo swaps with the theme: the colour wordmark on light, white on black. */
.logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none; }
  :root:not([data-theme="light"]) .logo-dark { display: block; }
}
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }

/* ======================================================================
   Landing page. One screen: the tool, then one band, then the footer.
   The ask is a dialog, not a section you have to scroll through.
   ====================================================================== */

body.lp { background: var(--mz-white); color: var(--mz-gray-dark); }

.lp-top {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .94); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--mz-border);
}
.lp-top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 60px; }
.lp-brand { display: flex; align-items: center; gap: 12px; }
.lp-brand img { height: 24px; width: auto; }
/* The landing page hardcodes a white ground, so it must NOT follow
   prefers-color-scheme for the mark — on a dark-mode machine that swapped in
   the white wordmark and made it invisible on white. */
body.lp .lp-brand .logo-light { display: block; }
body.lp .lp-brand .logo-dark  { display: none; }
.lp-brand .divider { width: 1px; height: 17px; background: var(--mz-border); }
.lp-brand .label { color: var(--mz-gray-mid); }

.lp-cta {
  border: 0; border-radius: 2px; padding: 11px 18px; white-space: nowrap;
  background: var(--mz-red); color: #fff; font-size: 14px; font-weight: 600;
  transition: background 120ms var(--ease);
}
.lp-cta:hover { background: var(--mz-red-hover); }
.lp-cta:active { background: var(--mz-red-press); }

/* ---------------------------------------------------------------- intro */

.lp-intro { padding: clamp(30px, 5vw, 56px) 0 clamp(22px, 3vw, 34px); }
.lp-intro h1 {
  margin: 0; max-width: 20ch;
  font-size: clamp(32px, 5vw, 56px); font-weight: 800; line-height: 1.0;
  letter-spacing: -.025em; color: var(--mz-black);
}
.lp-intro h1 em { font-style: normal; color: var(--mz-red); }
.lp-intro .lede {
  margin: 16px 0 0; max-width: 68ch;
  font-size: 17px; line-height: 1.5; color: var(--mz-gray-dark);
}

/* ---------------------------------------------------------------- stage */

.lp-stage { background: var(--mz-black); padding: clamp(20px, 3vw, 32px) 0 clamp(26px, 4vw, 40px); }

.lp-controls { border-top: 1px solid #242424; margin-bottom: 16px; }
.lp-controls .frow {
  grid-template-columns: 92px 1fr; padding: 10px 0;
  border-top: 0; border-bottom: 1px solid #242424; align-items: center;
}
.lp-controls .frow .label { color: #7A7A7A; }

.lp-stage .chip { background: transparent; border-color: #3A3A3A; color: #C4C4C4; }
.lp-stage .chip:hover:not(:disabled) { border-color: #fff; color: #fff; }
.lp-stage .chip[aria-pressed="true"] { background: var(--mz-red); border-color: var(--mz-red); color: #fff; }

/* The one locked control. Names what is inside, so the trade is obvious. */
.lp-stage .chip.islocked {
  border-style: dashed; border-color: #4A4A4A; color: #9A9A9A;
  gap: 9px; padding: 7px 15px;
}
.lp-stage .chip.islocked:hover { border-color: var(--mz-red); border-style: solid; color: #fff; }
.lp-stage .chip.islocked b { color: #fff; font-weight: 600; }
.lp-stage .chip.islocked .eg { color: #7A7A7A; font-size: 12px; }
.lp-stage .chip.islocked:hover .eg { color: #B4B4B4; }
.lp-stage .chip.islocked .lockicon { color: var(--mz-red); font-size: 9px; line-height: 1; }
.lp-lockednote { font-size: 13px; color: #6E6E6E; }

.lp-stage .mapbox { border-color: #242424; }
.lp-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-top: 14px; }
.lp-stage .tile { background: #131313; border-color: #242424; border-top: 3px solid var(--mz-red); }
.lp-stage .tile .v { color: #fff; }
.lp-stage .tile .s { color: #9A9A9A; }
.lp-stage .tile .k { color: #7A7A7A; }

/* ----------------------------------------------------------------- band */

.lp-more { background: var(--mz-black); padding: 0 0 clamp(30px, 5vw, 52px); }
.lp-more .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
  border-top: 3px solid var(--mz-red); padding-top: 20px;
}
.lp-more p { margin: 0; font-size: 16px; color: #A8A8A8; max-width: 62ch; }
.lp-more p b { color: #fff; font-weight: 600; }

.lp-foot { background: var(--mz-white); padding: 26px 0 48px; border-top: 1px solid var(--mz-border); }
.lp-foot .wrap { display: grid; gap: 16px; }
.lp-sig { display: flex; align-items: center; gap: 12px; }
.lp-sig img { height: 26px; width: auto; display: block; }
.lp-sig span { font-size: 13px; color: var(--mz-gray-mid); max-width: 42ch; line-height: 1.5; }
.lp-sig b { color: var(--mz-black); font-weight: 600; }
.lp-foot p { margin: 0; font-size: 13px; color: var(--mz-gray-mid); line-height: 1.6; max-width: 92ch; }
.lp-foot .fine { margin-top: 9px; font-size: 12px; }

/* --------------------------------------------------------------- dialog */

dialog.gate {
  width: min(94vw, 430px); padding: clamp(24px, 3vw, 32px);
  border: 0; border-top: 3px solid var(--mz-red); border-radius: 2px;
  background: #fff; color: var(--mz-gray-dark);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
}
dialog.gate::backdrop { background: rgba(12, 12, 12, .72); backdrop-filter: blur(3px); }
dialog.gate .gate-mark { height: 20px; width: auto; display: block; margin-bottom: 16px; }
dialog.gate .label { color: var(--mz-red); }
dialog.gate h2 { margin: 12px 0 0; font-size: 25px; font-weight: 700; letter-spacing: -.01em; color: var(--mz-black); }
dialog.gate .sub { margin: 9px 0 22px; font-size: 15px; line-height: 1.5; color: var(--mz-gray-dark); }

.gate-x {
  position: absolute; top: 12px; right: 12px; width: 30px; height: 30px;
  border: 0; background: none; color: var(--mz-gray-mid); font-size: 24px; line-height: 1;
  border-radius: 2px;
}
.gate-x:hover { color: var(--mz-red); background: var(--mz-gray-light); }

dialog.gate .field { margin-bottom: 13px; }
dialog.gate .field label { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--mz-gray-mid); }
dialog.gate .field input {
  width: 100%; padding: 12px 14px; font: inherit; font-size: 16px; color: var(--mz-black);
  background: #fff; border: 1px solid #CFCFCF; border-radius: 2px;
  transition: border-color 120ms var(--ease);
}
dialog.gate .field input:focus { outline: 0; border-color: var(--mz-red); box-shadow: 0 0 0 3px rgba(234, 28, 42, .18); }
dialog.gate .field input::placeholder { color: #B5B5B5; }
dialog.gate #code { font-family: var(--mono); font-size: 28px; letter-spacing: .34em; text-align: center; padding: 14px 8px; }
dialog.gate .cta {
  width: 100%; margin-top: 8px; padding: 14px 18px; border: 0; border-radius: 2px;
  background: var(--mz-red); color: #fff; font-size: 15px; font-weight: 600;
  transition: background 120ms var(--ease);
}
dialog.gate .cta:hover:not(:disabled) { background: var(--mz-red-hover); }
dialog.gate .cta:disabled { opacity: .5; cursor: progress; }
dialog.gate .msg { margin: 12px 0 0; font-size: 14px; line-height: 1.45; min-height: 1.45em; color: var(--mz-gray-dark); }
dialog.gate .msg.err { color: var(--mz-red); font-weight: 500; }
dialog.gate .linkish { background: none; border: 0; padding: 0; margin-top: 14px; font-size: 14px; color: var(--mz-gray-mid); text-decoration: underline; text-underline-offset: 3px; }
dialog.gate .linkish:hover { color: var(--mz-red); }
dialog.gate .fine { margin: 18px 0 0; font-size: 12px; color: var(--mz-gray-mid); line-height: 1.55; }

@media (max-width: 720px) {
  .lp-controls .frow { grid-template-columns: 1fr; align-items: start; gap: 7px; }
  .lp-more .wrap { flex-direction: column; align-items: flex-start; }
}
