/* ===========================================================
   DESCRIPCS2 — link hub
   Design system: "loadout & scoreboard" — CS2's own equip grid
   and post-match stat line, redrawn as an original UI language.
   No Valve/CS2 assets. All marks below are hand-drawn originals.

   Layout rule: with JS on, the page is a fixed app shell. Top bar,
   one panel, footer. Every panel is built to fit the screen without
   vertical scrolling; the panel only scrolls as a last-resort
   fallback on very short screens. Without JS it is a normal
   stacked, scrollable document.
   =========================================================== */

@font-face {
  font-family: "Big Shoulders";
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url("fonts/big-shoulders-600.woff2") format("woff2");
}
@font-face {
  font-family: "Big Shoulders";
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url("fonts/big-shoulders-700.woff2") format("woff2");
}
@font-face {
  font-family: "Big Shoulders";
  font-weight: 900;
  font-style: normal;
  font-display: swap;
  src: url("fonts/big-shoulders-900.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("fonts/plex-sans-400.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url("fonts/plex-sans-500.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url("fonts/plex-sans-600.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("fonts/plex-mono-400.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url("fonts/plex-mono-500.woff2") format("woff2");
}

:root {
  /* ground */
  --bg: #15171a;
  --bg-deep: #101214;
  --panel: #1c1f24;
  --panel-hi: #262b32;
  --line: rgba(236, 231, 220, 0.09);
  --line-strong: rgba(236, 231, 220, 0.16);

  /* text */
  --bone: #ece7dc;
  --bone-dim: #b7b1a4;
  --bone-faint: #948e81;

  /* accents: T-side amber (content/loadout) + CT-side steel (proof/data) */
  --amber: #e2914f;
  --amber-ink: #2a1c10;
  --steel: #5fa8bd;
  --steel-hi: #83c3d6;

  /* type */
  --f-display: "Big Shoulders", "Arial Narrow", sans-serif;
  --f-body: "IBM Plex Sans", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, monospace;

  /* scale */
  --fs-2xs: 0.8125rem;
  --fs-xs: 0.9375rem;
  --fs-sm: 1rem;
  --fs-md: 1.25rem;
  --fs-lg: 1.5625rem;
  --fs-xl: 1.95rem;

  /* spacing (8px base) */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4rem;

  /* radius hierarchy: chips 2px, cards 8px, one pill */
  --r-sharp: 2px;
  --r-card: 8px;
  --r-pill: 999px;

  --ease-snap: cubic-bezier(0.2, 0, 0, 1);

  /* layout */
  --measure: 540px; /* legal pages */
  --wide: 1120px; /* app shell */
  --gutter: clamp(14px, 4vw, 32px);
  --gap: 8px;
  --tile-min: 4.25rem;
  --tile-max: 7rem;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--bone);
  font-family: var(--f-body);
  font-size: var(--fs-sm);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1,
h2 {
  margin: 0;
}

::selection {
  background: var(--amber);
  color: var(--amber-ink);
}

::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-deep);
}
::-webkit-scrollbar-thumb {
  background: var(--panel-hi);
  border-radius: var(--r-sharp);
}

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: var(--r-sharp);
}

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

/* ---------- ambient background: abstracted recoil-pattern field ---------- */

.spray-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: screen;
}

.spray-field svg {
  width: 100%;
  height: 100%;
}

/* ---------- shared prose links ---------- */

.section-lede a,
.about-lead a,
.point a,
.section-note a {
  color: var(--bone);
  border-bottom: 1px solid var(--line-strong);
  transition: color 140ms var(--ease-snap), border-color 140ms var(--ease-snap);
}

.section-note a {
  color: var(--bone-dim);
}

.section-lede a:hover,
.section-lede a:focus-visible,
.about-lead a:hover,
.about-lead a:focus-visible,
.point a:hover,
.point a:focus-visible,
.section-note a:hover,
.section-note a:focus-visible {
  color: var(--amber);
  border-color: var(--amber);
}

/* ---------- top bar: brand, language, tabs ---------- */

.topnav {
  position: sticky;
  top: 0;
  z-index: 10;
  flex-shrink: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line-strong);
}

.topnav-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 10px var(--gutter) 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "brand lang" "tabs tabs";
  align-items: center;
  column-gap: var(--sp-3);
}

.topnav-brand {
  grid-area: brand;
  justify-self: start;
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
  font-family: var(--f-display);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

.topnav-brand-main {
  font-size: 1.4rem;
  line-height: 1;
  color: var(--bone);
}

.topnav-brand-sep {
  font-size: 0.9rem;
  color: var(--bone-faint);
  font-weight: 600;
}

.topnav-brand-tag {
  font-size: 1rem;
  color: var(--amber);
  font-weight: 700;
}

.lang-switch {
  grid-area: lang;
  padding: 0.2rem 0.5rem;
  font-family: var(--f-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--bone-dim);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sharp);
  transition: color 140ms var(--ease-snap), border-color 140ms var(--ease-snap);
}

.lang-switch:hover,
.lang-switch:focus-visible {
  color: var(--amber);
  border-color: var(--amber);
}

.tablist {
  grid-area: tabs;
  margin-top: 2px;
  display: flex;
  justify-content: space-between;
  gap: clamp(6px, 2vw, 12px);
  overflow-x: auto;
  scrollbar-width: none;
}

.tablist::-webkit-scrollbar {
  display: none;
}

.tab {
  position: relative;
  flex: 0 0 auto;
  padding: 0.55rem 0.1rem 0.65rem;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(0.8125rem, 3.6vw, 0.9375rem);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--bone-faint);
  white-space: nowrap;
  transition: color 140ms var(--ease-snap);
}

.tab::after {
  content: "";
  position: absolute;
  left: 0.1rem;
  right: 0.1rem;
  bottom: 0;
  height: 2px;
  background: transparent;
  transition: background-color 140ms var(--ease-snap);
}

.tab:hover {
  color: var(--bone-dim);
}

.tab[aria-selected="true"] {
  color: var(--bone);
}

.tab[aria-selected="true"]::after {
  background: var(--amber);
}

/* ---------- page shell ---------- */

.page {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: var(--sp-5) var(--sp-4);
}

.app .page {
  max-width: var(--wide);
  padding: 12px var(--gutter);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel[hidden] {
  display: none;
}

/* no JS: stacked, scrollable document */
html:not(.js) .panel + .panel {
  margin-top: var(--sp-7);
}

/* JS: fixed app shell, one panel at a time, no page scroll */
.js .app {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overscroll-behavior: none;
}

.js .app .page {
  overflow: hidden;
}

.js .app .panel {
  flex: 1 1 auto;
  min-height: 0;
  margin: -3px;
  padding: 3px;
  overflow-x: hidden;
  overflow-y: auto; /* last-resort fallback only */
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--panel-hi) transparent;
}

/* centre a short panel without ever clipping a tall one */
.js .app .panel > :first-child {
  margin-top: auto;
}

.js .app .panel > :last-child {
  margin-bottom: auto;
}

/* ---------- headings ---------- */

.section-heading {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(1.55rem, 6vw, 1.95rem);
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  color: var(--bone);
}

.panel-head {
  flex: none;
}

.section-lede {
  max-width: 66ch;
  margin: 0.45rem 0 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--bone-dim);
}

.section-note {
  flex: none;
  margin: 0;
  padding: 0 2px;
  font-family: var(--f-mono);
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--bone-faint);
}

/* ---------- home: hero ---------- */

.hero {
  flex: none;
}

.wordmark {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0 0.5rem;
  font-family: var(--f-display);
  font-weight: 900;
  line-height: 0.9;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

.wordmark-main {
  font-size: clamp(2.6rem, 12.5vw, 3.6rem);
  color: var(--bone);
}

.wordmark-sep {
  font-size: clamp(1.3rem, 5.4vw, 1.8rem);
  color: var(--bone-faint);
  font-weight: 600;
  transform: translateY(-0.08em);
}

.wordmark-tag {
  font-size: clamp(1.3rem, 5.4vw, 1.8rem);
  color: var(--amber);
  font-weight: 700;
}

.bio {
  max-width: 46ch;
  margin: 0.6rem 0 0;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--bone-dim);
}

/* ---------- home: loadout tiles ---------- */

.loadout {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: calc(2.6rem + 3 * var(--tile-max) + 2 * var(--gap));
}

.tiles {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(var(--tile-min), var(--tile-max));
  gap: var(--gap);
  align-content: center;
}

.tiles > li {
  display: flex;
  min-width: 0;
}

.tile {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "key . go" "icon name name";
  align-content: space-between;
  column-gap: 0.55rem;
  row-gap: 0.3rem;
  padding: 0.55rem 0.7rem;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-card);
  transition: background-color 140ms var(--ease-snap), border-color 140ms var(--ease-snap);
}

.tile-key {
  grid-area: key;
  display: grid;
  place-items: center;
  width: 1.4rem;
  height: 1.4rem;
  font-family: var(--f-mono);
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--bone-dim);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sharp);
  transition: background-color 140ms var(--ease-snap), color 140ms var(--ease-snap),
    border-color 140ms var(--ease-snap);
}

.tile-icon {
  grid-area: icon;
  align-self: center;
  width: 1.3rem;
  height: 1.3rem;
  /* each channel carries its own brand colour, set inline as --brand */
  color: var(--brand, var(--bone-dim));
  transition: transform 140ms var(--ease-snap);
}

.tile-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tile-name {
  grid-area: name;
  align-self: center;
  min-width: 0;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  color: var(--bone);
  overflow-wrap: anywhere;
}

.tile-go {
  grid-area: go;
  align-self: center;
  font-family: var(--f-mono);
  font-size: 1rem;
  line-height: 1;
  color: var(--bone-faint);
  transition: transform 140ms var(--ease-snap), color 140ms var(--ease-snap);
}

.tile:hover,
.tile:focus-visible {
  background: var(--panel-hi);
  border-color: rgba(226, 145, 79, 0.45);
}

.tile:hover .tile-key,
.tile:focus-visible .tile-key {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--amber-ink);
}

.tile:hover .tile-icon,
.tile:focus-visible .tile-icon {
  transform: translateX(2px);
}

.tile:hover .tile-go,
.tile:focus-visible .tile-go {
  color: var(--amber);
  transform: translateX(3px);
}

.tile:active {
  transform: scale(0.99);
}

/* ---------- stat cards: scoreboard + settings ---------- */

.stats {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  gap: var(--gap);
  align-content: center;
}

.stats > li {
  display: flex;
  min-width: 0;
}

.stats--rows {
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: minmax(4.75rem, 8rem);
  max-height: calc(4 * 8rem + 3 * var(--gap));
}

.stats--tiles {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(6.5rem, 9.25rem);
  max-height: calc(3 * 9.25rem + 2 * var(--gap));
}

.stat {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto 1fr auto;
  row-gap: 0.15rem;
  padding: 0.7rem 0.8rem;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-card);
  transition: background-color 140ms var(--ease-snap), border-color 140ms var(--ease-snap);
}

.stat:hover,
.stat:focus-visible {
  background: var(--panel-hi);
  border-color: rgba(95, 168, 189, 0.5);
}

.stat-name {
  grid-row: 1;
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1.2;
  color: var(--bone);
}

.stat-sub {
  grid-row: 2;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  font-size: 0.75rem;
  line-height: 1.3;
  color: var(--bone-faint);
}

.stat-val {
  grid-row: 3;
  align-self: end;
  font-family: var(--f-mono);
  font-weight: 500;
  font-size: clamp(1.4rem, 6.2vw, 1.8rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--steel);
  transition: color 140ms var(--ease-snap);
}

.stat-unit {
  grid-row: 4;
  font-size: 0.6875rem;
  line-height: 1.3;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--bone-faint);
}

.stat-go {
  grid-row: 3 / 5;
  align-self: end;
  font-family: var(--f-mono);
  font-weight: 500;
  font-size: 0.75rem;
  line-height: 1.3;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--steel);
  transition: color 140ms var(--ease-snap);
}

.stat:hover .stat-val,
.stat:focus-visible .stat-val,
.stat:hover .stat-go,
.stat:focus-visible .stat-go {
  color: var(--steel-hi);
}

/* cards that only show a value and link nowhere */
.stat--static:hover {
  background: var(--panel);
  border-color: var(--line-strong);
}

.stat--static:hover .stat-val {
  color: var(--steel);
}

.stat--note .stat-sub {
  -webkit-line-clamp: 4;
}

/* scoreboard rows on narrow screens: name left, number right */
.stats--rows .stat {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-content: center;
  align-items: center;
  column-gap: 0.8rem;
  padding: 0.8rem 1rem;
}

.stats--rows .stat-name {
  grid-column: 1;
  grid-row: 1;
  align-self: end;
}

.stats--rows .stat-sub {
  grid-column: 1;
  grid-row: 2;
  align-self: start;
}

.stats--rows .stat-val {
  grid-column: 2;
  grid-row: 1;
  align-self: end;
  justify-self: end;
  font-size: clamp(1.9rem, 8vw, 2.4rem);
}

.stats--rows .stat-unit {
  grid-column: 2;
  grid-row: 2;
  align-self: start;
  justify-self: end;
  text-align: right;
}

.stats--rows .stat-go {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  justify-self: end;
}

/* ---------- points: optimization + about ---------- */

.points {
  margin: 0;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.point {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-card);
  overflow: hidden;
}

.point dt {
  margin: 0;
  padding: 0.7rem 0.8rem 0.25rem;
  font-family: var(--f-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--steel);
}

.point dd {
  margin: 0;
  padding: 0 0.8rem 0.8rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--bone-dim);
}

.point dd p {
  margin: 0;
}

.point code {
  font-family: var(--f-mono);
  font-size: 0.95em;
  color: var(--bone);
}

/* JS builds a button inside the dt on narrow screens */
.point dt.has-toggle {
  padding: 0;
}

.point-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: 0.7rem 0.8rem;
  background: none;
  border: 0;
  border-radius: 0;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.point-toggle::after {
  content: "+";
  font-size: 1.05rem;
  line-height: 1;
  color: var(--bone-faint);
}

.point.open .point-toggle::after {
  content: "\2212";
  color: var(--amber);
}

.point-toggle:focus-visible {
  outline-offset: -3px;
}

.about-lead {
  max-width: 46ch;
  margin: 0.5rem 0 0;
  font-size: clamp(1rem, 4.4vw, 1.2rem);
  line-height: 1.4;
  color: var(--bone);
}

/* Keep About scrollable on short screens without a visible scrollbar.
   This also applies to expanded mobile answers. */
.js .app .panel--about,
.js .app .panel--about .point.open dd {
  scrollbar-width: none;
}

.js .app .panel--about::-webkit-scrollbar,
.js .app .panel--about .point.open dd::-webkit-scrollbar {
  display: none;
}

/* narrow screens with JS: one point open at a time, the open one fills the rest */
@media (max-width: 759px) {
  .js .point:not(.open) dd {
    display: none;
  }

  .js .point.open {
    flex: 1 1 auto;
    max-height: var(--open-max, 17rem);
  }

  .js .point.open dd {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    font-size: 0.9375rem;
    line-height: 1.5;
  }

  .points--opt {
    --open-max: 12rem;
  }

  .points--about {
    --open-max: 18rem;
  }

  .js .point.open dt {
    color: var(--amber);
  }
}

@media (max-width: 759px) and (min-height: 700px) {
  .js .point.open dd {
    font-size: 1rem;
  }

  .points--opt {
    --open-max: 13rem;
  }
}

/* ---------- footer ---------- */

.site-footer {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: var(--sp-4);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-4);
  justify-content: space-between;
  font-family: var(--f-mono);
  font-size: var(--fs-2xs);
  color: var(--bone-faint);
}

.app .site-footer {
  max-width: var(--wide);
  padding: 10px var(--gutter) 12px;
  font-size: 0.75rem;
}

.site-footer a {
  color: var(--bone-dim);
  border-bottom: 1px solid transparent;
  transition: border-color 140ms var(--ease-snap), color 140ms var(--ease-snap);
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--amber);
  border-color: var(--amber);
}

.footer-links {
  display: flex;
  gap: var(--sp-4);
}

@media (max-width: 479px) {
  .app .site-footer > span {
    display: none;
  }

  .app .footer-links {
    width: 100%;
    justify-content: space-between;
  }
}

/* ---------- tablet + desktop: use the width ---------- */

@media (min-width: 760px) {
  :root {
    --gap: 12px;
    --tile-min: 5.25rem;
    --tile-max: 7.5rem;
  }

  .topnav-inner {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "brand tabs lang";
    column-gap: 2.25rem;
    padding-top: 0;
  }

  .topnav-brand-main {
    font-size: 1.6rem;
  }

  .tablist {
    justify-content: flex-start;
    gap: var(--sp-6);
    margin-top: 0;
  }

  .tab {
    padding: 1.15rem 0.1rem 1.2rem;
    font-size: 1rem;
  }

  .section-heading {
    font-size: clamp(2rem, 3.2vw, 2.6rem);
  }

  .section-lede {
    font-size: 0.9375rem;
  }

  .panel {
    gap: 1.25rem;
  }

  /* home: hero left, tiles right */
  .panel--home {
    flex-direction: row;
    align-items: center;
    gap: clamp(2rem, 6vw, 5rem);
  }

  .js .app .panel--home > :first-child,
  .js .app .panel--home > :last-child {
    margin-block: 0;
  }

  .panel--home .hero {
    flex: 1 1 0;
    min-width: 0;
  }

  .panel--home .loadout {
    flex: 1.1 1 0;
    min-width: 0;
    align-self: center;
    height: min(100%, 36rem);
    max-height: none;
  }

  .wordmark-main {
    font-size: clamp(3.6rem, 8.5vw, 6.6rem);
  }

  .wordmark-sep,
  .wordmark-tag {
    font-size: clamp(1.8rem, 3.8vw, 3rem);
  }

  .bio {
    margin-top: 1rem;
    font-size: 1.0625rem;
  }


  .tile {
    padding: 0.7rem 0.9rem;
  }

  .tile-name {
    font-size: 1.05rem;
  }

  /* scoreboard: every card in one row, however many there are */
  .stats--rows {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    grid-template-rows: minmax(10rem, 15rem);
    grid-auto-rows: minmax(10rem, 15rem);
    max-height: 15rem;
  }

  .stats--rows .stat {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto 1fr auto;
    align-content: stretch;
    align-items: stretch;
    padding: 1.1rem 1.25rem;
  }

  .stats--rows .stat-name,
  .stats--rows .stat-sub,
  .stats--rows .stat-val,
  .stats--rows .stat-unit,
  .stats--rows .stat-go {
    grid-column: 1;
    justify-self: start;
    text-align: left;
  }

  .stats--rows .stat-name {
    grid-row: 1;
    align-self: start;
    font-size: 1.05rem;
  }

  .stats--rows .stat-sub {
    grid-row: 2;
    font-size: 0.8125rem;
  }

  .stats--rows .stat-val {
    grid-row: 3;
    align-self: end;
    font-size: clamp(2.4rem, 4.4vw, 3.6rem);
  }

  .stats--rows .stat-unit {
    grid-row: 4;
    align-self: start;
    /* room for two lines, so the numbers line up across cards */
    min-height: 2.6em;
    font-size: 0.75rem;
  }

  .stats--rows .stat-go {
    grid-row: 3 / 5;
    align-self: end;
    font-size: 0.875rem;
  }

  /* settings: 3 x 2 */
  .stats--tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: minmax(7.5rem, 11rem);
    max-height: calc(2 * 11rem + var(--gap));
  }

  .stat {
    padding: 0.9rem 1.05rem;
  }

  .stat-name {
    font-size: 1.0625rem;
  }

  .stat-sub {
    font-size: 0.8125rem;
  }

  .stat-val {
    font-size: clamp(1.7rem, 3vw, 2.3rem);
  }

  .stat-unit {
    font-size: 0.75rem;
  }

  /* optimization: every point visible as a card */
  .points--opt {
    flex: 0 1 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13.75rem, 1fr));
    grid-auto-rows: 1fr;
    gap: var(--gap);
    align-content: center;
  }

  .point dt {
    padding: 0.9rem 1.05rem 0.35rem;
    font-size: 0.8125rem;
  }

  .point dd {
    padding: 0 1.05rem 1rem;
    font-size: 0.9rem;
  }

  /* about: lead left, four cards right */
  .panel--about {
    flex-direction: row;
    align-items: center;
    gap: clamp(2rem, 5vw, 4rem);
  }

  .js .app .panel--about > :first-child,
  .js .app .panel--about > :last-child {
    margin-block: 0;
  }

  .panel--about .panel-head {
    flex: 0.8 1 0;
    min-width: 0;
  }

  .about-lead {
    margin-top: 0.9rem;
    font-size: clamp(1.15rem, 1.9vw, 1.45rem);
  }

  .points--about {
    flex: 1.5 1 0;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 1fr;
    gap: var(--gap);
    align-content: center;
    align-self: center;
  }

  /* about with five or more cards: lead on top, three columns, so it still fits without scrolling */
  .panel--about:has(.point:nth-child(5)) {
    flex-direction: column;
    align-items: stretch;
    gap: var(--sp-4);
  }

  .js .app .panel--about:has(.point:nth-child(5)) > :first-child {
    margin-top: auto;
  }

  .js .app .panel--about:has(.point:nth-child(5)) > :last-child {
    margin-bottom: auto;
  }

  .panel--about:has(.point:nth-child(5)) .panel-head {
    flex: none;
  }

  .panel--about:has(.point:nth-child(5)) .about-lead {
    max-width: none;
    margin-top: 0.5rem;
  }

  .panel--about:has(.point:nth-child(5)) .points--about {
    flex: 0 1 auto;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-self: stretch;
  }
}

/* Eight optimization cards: two rows of four. */
@media (min-width: 1100px) {
  .points--opt {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ---------- large screens: scale the whole UI up, keep the same fit ---------- */

@media (min-width: 1500px) and (min-height: 860px) {
  html:has(body.app) {
    font-size: 112.5%;
  }

  :root {
    --wide: 1240px;
  }
}

@media (min-width: 1900px) and (min-height: 980px) {
  html:has(body.app) {
    font-size: 125%;
  }

  :root {
    --wide: 1360px;
  }
}

/* ---------- legal pages ---------- */

.page--legal {
  padding-top: var(--sp-6);
  padding-bottom: var(--sp-8);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--f-mono);
  font-size: var(--fs-2xs);
  color: var(--bone-dim);
  border-bottom: 1px solid transparent;
  transition: color 140ms var(--ease-snap), border-color 140ms var(--ease-snap);
}

.back-link:hover,
.back-link:focus-visible {
  color: var(--amber);
  border-color: var(--amber);
}

.legal-title {
  margin: var(--sp-6) 0 0;
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(2.25rem, 9vw, 3rem);
  text-transform: uppercase;
  letter-spacing: -0.01em;
  color: var(--bone);
}

.legal-updated {
  margin: var(--sp-2) 0 var(--sp-7);
  font-family: var(--f-mono);
  font-size: var(--fs-2xs);
  color: var(--bone-faint);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.legal section + section {
  margin-top: var(--sp-6);
}

.legal h2 {
  font-family: var(--f-body);
  font-weight: 600;
  font-size: var(--fs-lg);
  color: var(--bone);
  margin: 0 0 var(--sp-3);
}

.legal p {
  max-width: 62ch;
  margin: 0;
  color: var(--bone-dim);
  line-height: 1.65;
}

.legal p + p,
.legal p + ul,
.legal ul + p {
  margin-top: var(--sp-3);
}

.legal p a,
.legal li a {
  color: var(--bone);
  border-bottom: 1px solid var(--line-strong);
  transition: color 140ms var(--ease-snap), border-color 140ms var(--ease-snap);
}

.legal p a:hover,
.legal p a:focus-visible,
.legal li a:hover,
.legal li a:focus-visible {
  color: var(--amber);
  border-color: var(--amber);
}

.legal ul {
  max-width: 62ch;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.legal li {
  position: relative;
  padding-left: var(--sp-4);
  color: var(--bone-dim);
  line-height: 1.6;
}

.legal li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 5px;
  height: 5px;
  background: var(--amber);
  border-radius: var(--r-sharp);
}

/* ---------- short screens: tighten, never hide ---------- */

@media (max-height: 700px) {
  :root {
    --gap: 6px;
    --tile-min: 3.75rem;
  }

  .app .page {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .panel {
    gap: 8px;
  }

  .topnav-inner {
    padding-top: 6px;
  }

  .tab {
    padding-top: 0.4rem;
    padding-bottom: 0.5rem;
  }

  .section-heading {
    font-size: clamp(1.4rem, 5.6vw, 1.65rem);
  }

  .section-lede {
    margin-top: 0.35rem;
    font-size: 0.8125rem;
    line-height: 1.42;
  }


  .wordmark-main {
    font-size: clamp(2.2rem, 10.5vw, 3rem);
  }

  .bio {
    margin-top: 0.4rem;
    font-size: 0.875rem;
  }

  .loadout {
    gap: 0.4rem;
  }

  .tile {
    padding: 0.4rem 0.6rem;
    row-gap: 0.15rem;
  }

  .stat {
    padding: 0.5rem 0.7rem;
  }

  .stats--rows .stat {
    padding: 0.5rem 0.9rem;
  }

  .point dt {
    padding: 0.55rem 0.7rem 0.15rem;
  }

  .points {
    gap: 3px;
  }

  .point-toggle {
    padding: 0.4rem 0.7rem;
  }

  .point dd {
    padding: 0 0.7rem 0.45rem;
    font-size: 0.8125rem;
    line-height: 1.45;
  }

  .about-lead {
    margin-top: 0.35rem;
    font-size: 1rem;
  }

  .app .site-footer {
    padding-top: 6px;
    padding-bottom: 8px;
  }
}

@media (max-height: 660px) {
  .topnav-inner {
    padding-top: 4px;
  }

  .tab {
    padding-top: 0.3rem;
    padding-bottom: 0.4rem;
  }

  .app .page {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .app .site-footer {
    padding-top: 4px;
    padding-bottom: 6px;
  }
}

/* landscape phones: wide but very short */
@media (min-width: 760px) and (max-height: 520px) {
  :root {
    --tile-min: 3.25rem;
  }

  .stats--tiles {
    grid-auto-rows: minmax(5.25rem, 9.375rem);
  }

  .stats--rows {
    grid-auto-rows: minmax(6.875rem, 12.5rem);
  }

  .point dt {
    padding: 0.55rem 0.85rem 0.2rem;
  }

  .point dd {
    padding: 0 0.85rem 0.6rem;
    font-size: 0.8125rem;
    line-height: 1.4;
  }
}

/* ---------- entrance: one authored HUD boot-in ---------- */

@media (prefers-reduced-motion: no-preference) {
  @keyframes wipe-in {
    from {
      clip-path: inset(0 100% 0 0);
    }
    to {
      clip-path: inset(0 0 0 0);
    }
  }

  .tile,
  .stat,
  .point {
    animation: wipe-in 380ms var(--ease-snap) both;
    animation-delay: calc(var(--i, 0) * 45ms + 40ms);
  }
}

/* ---------- 404: a recoil pattern that misses the crosshair ---------- */

.miss-field {
  position: fixed;
  inset: 3.25rem 0 2.75rem;
  z-index: 0;
  pointer-events: none;
  opacity: 0.14;
}

.miss-field svg {
  display: block;
  width: 50%;
  height: 100%;
  margin-left: auto;
}

.page--nf {
  max-width: var(--wide);
  padding: var(--sp-6) var(--gutter) var(--sp-7);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--sp-6);
}

.nf .site-footer {
  max-width: var(--wide);
  padding: var(--sp-3) var(--gutter) var(--sp-4);
}

.nf .wordmark-main {
  font-size: clamp(4.5rem, 24vw, 6rem);
}

.nf .wordmark-sep,
.nf .wordmark-tag {
  font-size: clamp(1.6rem, 7vw, 2.4rem);
}

.nf-lede {
  max-width: 38ch;
  margin: 1rem 0 0;
  font-size: 1.0625rem;
  line-height: 1.45;
  color: var(--bone-dim);
}

.nf-lede--tr {
  margin-top: 0.4rem;
  font-size: 0.9375rem;
  color: var(--bone-faint);
}

.nf-routes {
  width: 100%;
  max-width: 24rem;
}

.routes {
  margin-top: var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.route {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3rem;
  padding: 0.55rem 0.8rem;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-card);
  transition: background-color 140ms var(--ease-snap), border-color 140ms var(--ease-snap);
}

.route-key {
  flex: none;
  display: grid;
  place-items: center;
  width: 1.4rem;
  height: 1.4rem;
  font-family: var(--f-mono);
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--bone-dim);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sharp);
  transition: background-color 140ms var(--ease-snap), color 140ms var(--ease-snap),
    border-color 140ms var(--ease-snap);
}

.route-name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  line-height: 1.2;
  color: var(--bone);
}

.route-go {
  font-family: var(--f-mono);
  line-height: 1;
  color: var(--bone-faint);
  transition: transform 140ms var(--ease-snap), color 140ms var(--ease-snap);
}

/* the way home reads as the equipped slot */
.route--main .route-key {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--amber-ink);
}

.route:hover,
.route:focus-visible {
  background: var(--panel-hi);
  border-color: rgba(226, 145, 79, 0.45);
}

.route:hover .route-key,
.route:focus-visible .route-key {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--amber-ink);
}

.route:hover .route-go,
.route:focus-visible .route-go {
  color: var(--amber);
  transform: translateX(3px);
}

.route:active {
  transform: scale(0.99);
}

@media (min-width: 760px) {
  .miss-field svg {
    width: 100%;
    margin-left: 0;
  }

  .page--nf {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: clamp(2rem, 6vw, 5rem);
  }

  .nf-copy {
    flex: 1 1 0;
    min-width: 0;
  }

  .nf-routes {
    flex: 0 0 22rem;
  }

  .nf .wordmark-main {
    font-size: 6rem;
  }

  .nf .wordmark-sep,
  .nf .wordmark-tag {
    font-size: clamp(2rem, 3.6vw, 2.8rem);
  }

  .nf-lede {
    font-size: 1.125rem;
  }
}

/* one authored moment: the shots climb, one at a time, and go wide */
@media (prefers-reduced-motion: no-preference) {
  @keyframes shot-land {
    from {
      opacity: 0;
      transform: scale(2.4);
    }
    to {
      opacity: 1;
      transform: scale(1);
    }
  }

  .miss-field g:last-child circle {
    transform-box: fill-box;
    transform-origin: center;
    animation: shot-land 200ms var(--ease-snap) both;
    animation-delay: calc(var(--i, 0) * 42ms + 150ms);
  }
}
