/* Parth Narula portfolio. One stylesheet for every page.
   Identity: the red box. On his Hall of Fame screenshots Parth's name is always boxed in red,
   so the site borrows the language of a disclosure report: redaction bars, case files, stamps.
   Shape rule: everything is a sharp rectangle (--r: 3px). The red box is the only decoration.
   Theme rule: tokens live on :root and switch on html[data-theme]. */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo.woff2") format("woff2-variations"), url("../fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono.woff2") format("woff2-variations"), url("../fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "BS Stencil";
  src: url("../fonts/stencil.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --sans: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --stencil: "BS Stencil", "Archivo", Impact, sans-serif;

  --r: 3px;
  --max: 1320px;
  --gutter: clamp(16px, 4vw, 48px);
  --nav-h: 64px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  --z-nav: 50;
  --z-menu: 60;
  --z-dialog: 80;
  --z-toast: 90;

  /* Paper is used for things that are real documents in real life: Hall of Fame pages, photos. */
  --paper: #f6f4ee;
  --paper-2: #e6e2d8;
  --paper-ink: #191815;
  --paper-ink-2: #5f5a51;
  --paper-red: #c4141c;

  color-scheme: dark;
  --bg: #0b0b0c;
  --bg-rgb: 11, 11, 12;
  --bg-2: #101011;
  --surface: #141415;
  --surface-2: #1c1c1e;
  --line: rgba(240, 238, 233, 0.1);
  --line-2: rgba(240, 238, 233, 0.19);
  --text: #f0eee9;
  --text-2: #b9b5ad;
  --text-3: #918d85;
  --red: #ff4d40;
  --red-bg: #d81f26;
  --red-ink: #ffffff;
  --red-soft: rgba(255, 77, 64, 0.12);
  --red-line: rgba(255, 77, 64, 0.5);
  --green: #3ad07a;
  --glass: rgba(16, 16, 17, 0.72);
  --shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.8);
  --globe-dot: 185, 181, 173;
  --globe-accent: 255, 77, 64;
  --grain: 0.055;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f2efe8;
  --bg-rgb: 242, 239, 232;
  --bg-2: #ebe7de;
  --surface: #faf8f3;
  --surface-2: #ebe7dd;
  --line: rgba(25, 24, 21, 0.12);
  --line-2: rgba(25, 24, 21, 0.24);
  --text: #161512;
  --text-2: #49453e;
  --text-3: #686359;
  --red: #c4141c;
  --red-bg: #c4141c;
  --red-soft: rgba(196, 20, 28, 0.08);
  --red-line: rgba(196, 20, 28, 0.45);
  --green: #12804a;
  --glass: rgba(250, 248, 243, 0.8);
  --shadow: 0 20px 50px -26px rgba(40, 30, 20, 0.35);
  --globe-dot: 73, 69, 62;
  --globe-accent: 196, 20, 28;
  --grain: 0.035;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  padding-top: var(--nav-h);
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
body::after {
  /* Film grain. Fixed and non-interactive so it never repaints while scrolling. */
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: var(--z-toast);
  opacity: var(--grain);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
::selection { background: var(--red-bg); color: var(--red-ink); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

.ic { width: 1.15em; height: 1.15em; fill: currentColor; flex: none; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 16px; top: -100px; z-index: var(--z-toast); padding: 10px 16px; background: var(--red-bg); color: var(--red-ink); font-weight: 600; }
.skip:focus { top: 12px; }
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.mono { font-family: var(--mono); }
.muted { color: var(--text-2); }
.hint--touch { display: none; }
@media (hover: none), (pointer: coarse) { .hint--fine { display: none; } .hint--touch { display: inline; } }

/* ---------- Buttons, links, chips ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 46px; padding: 0 20px; border-radius: var(--r);
  font-weight: 600; font-size: 0.95rem; letter-spacing: 0.01em; white-space: nowrap;
  border: 1px solid transparent; transition: background-color 0.2s, border-color 0.2s, color 0.2s, transform 0.2s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn--red { background: var(--red-bg); color: var(--red-ink); }
.btn--red:hover { background: color-mix(in srgb, var(--red-bg) 86%, #000); }
.btn--ghost { border-color: var(--line-2); color: var(--text); background: rgba(var(--bg-rgb), 0.4); }
.btn--ghost:hover { border-color: var(--text); }
.btn--sm { height: 36px; padding: 0 14px; font-size: 0.86rem; gap: 8px; }
.btn .ic { width: 18px; height: 18px; }
.btn .ic--move { transition: transform 0.3s var(--ease); }
.btn:hover .ic--move { transform: translateX(3px); }

.link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--text); border-bottom: 1px solid var(--line-2); padding-bottom: 2px; transition: color 0.2s, border-color 0.2s; }
.link:hover { color: var(--red); border-color: var(--red); }
.link .ic { width: 15px; height: 15px; transition: transform 0.25s var(--ease); }
.link:hover .ic { transform: translate(2px, -2px); }

.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: var(--r);
  border: 1px solid var(--line-2); color: var(--text-2); font-size: 0.88rem; white-space: nowrap; transition: border-color 0.2s, color 0.2s, background-color 0.2s;
}
button.chip:hover { color: var(--text); border-color: var(--text-3); }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip .count { font-family: var(--mono); font-size: 0.74rem; color: var(--text-3); }
.chip[aria-pressed="true"] .count { color: var(--bg); opacity: 0.75; }

kbd { font-family: var(--mono); }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: var(--z-nav); height: var(--nav-h);
  border-bottom: 1px solid transparent; transition: background-color 0.3s, border-color 0.3s;
}
.nav.is-scrolled, .nav.is-solid { background: var(--glass); border-color: var(--line); -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%); }
.nav__inner { height: 100%; display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; flex: none; }
.brand__box {
  display: inline-block; padding: 3px 9px 2px; outline: 1.5px solid var(--red); outline-offset: -1.5px;
  font-weight: 800; font-stretch: 75%; text-transform: uppercase; letter-spacing: 0.02em; font-size: 1.02rem; line-height: 1.3;
  transition: background-color 0.2s, color 0.2s;
}
.brand:hover .brand__box { background: var(--red-bg); color: var(--red-ink); }
.nav__links { display: flex; gap: 4px; margin-left: auto; }
.nav__links a { position: relative; padding: 8px 12px; font-size: 0.92rem; font-weight: 500; color: var(--text-2); transition: color 0.2s; }
.nav__links a:hover { color: var(--text); }
.nav__links a[aria-current="true"], .nav__links a[aria-current="page"] { color: var(--text); }
.nav__links a[aria-current="true"]::after, .nav__links a[aria-current="page"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px; background: var(--red); }
.nav__tools { display: flex; align-items: center; gap: 8px; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: var(--r); border: 1px solid var(--line-2); color: var(--text-2); transition: color 0.2s, border-color 0.2s; }
.icon-btn:hover { color: var(--text); border-color: var(--text-3); }
.search-btn { width: auto; display: inline-flex; gap: 8px; padding: 0 10px 0 12px; font-size: 0.86rem; }
.search-btn kbd { font-size: 0.7rem; color: var(--text-3); border: 1px solid var(--line-2); border-radius: 2px; padding: 1px 5px; }
.theme-btn .ic-sun { display: none; }
:root[data-theme="light"] .theme-btn .ic-sun { display: block; }
:root[data-theme="light"] .theme-btn .ic-moon { display: none; }
.menu-btn { display: none; }

.mobile-menu {
  position: fixed; inset: var(--nav-h) 0 0; z-index: var(--z-menu); background: var(--bg);
  display: flex; flex-direction: column; padding: 16px var(--gutter) 32px; overflow-y: auto;
  opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity 0.25s var(--ease), transform 0.35s var(--ease), visibility 0s 0.35s;
}
.mobile-menu.is-open { opacity: 1; visibility: visible; transform: none; transition: opacity 0.25s var(--ease), transform 0.35s var(--ease); }
.mobile-menu a:not(.btn) { padding: 14px 0; border-bottom: 1px solid var(--line); font-weight: 800; font-stretch: 70%; text-transform: uppercase; font-size: 1.9rem; line-height: 1.1; }
.mobile-menu .btn { margin-top: 24px; }

@media (max-width: 1023px) {
  .nav__links { display: none; }
  .nav__tools { margin-left: auto; }
  .menu-btn { display: inline-grid; }
  .search-btn span, .search-btn kbd { display: none; }
  .search-btn { width: 38px; padding: 0; justify-content: center; }
}
@media (max-width: 420px) { .nav__cv { display: none; } }

/* ---------- Sections and section heads ---------- */
.section { padding-block: clamp(72px, 8.5vw, 120px); position: relative; }
.section--tight { padding-block: clamp(32px, 4vw, 56px); }
.sh { display: grid; gap: 16px; margin-bottom: clamp(36px, 5vw, 64px); max-width: 960px; }
.sh--split { max-width: none; grid-template-columns: 1fr minmax(0, 420px); align-items: end; gap: 16px 48px; }
.sh__no { font-family: var(--mono); font-size: 0.76rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); display: flex; align-items: center; gap: 10px; }
.sh__no span { color: var(--red); font-weight: 700; }
.sh__no span::after { content: "/"; color: var(--text-3); margin-left: 10px; font-weight: 400; }
.sh__title {
  position: relative; width: fit-content; max-width: 100%;
  font-weight: 800; font-stretch: 66%; text-transform: uppercase;
  font-size: clamp(2.4rem, 1.2rem + 4.6vw, 4.9rem); line-height: 0.92; letter-spacing: 0;
}
.sh__lede { font-size: clamp(1.02rem, 0.95rem + 0.3vw, 1.18rem); color: var(--text-2); max-width: 60ch; }
@media (max-width: 899px) { .sh--split { grid-template-columns: 1fr; } }

/* Declassify: a redaction bar sits on each section title and slides off when it scrolls in. */
@media (prefers-reduced-motion: no-preference) {
  .js .sh__title[data-reveal] { opacity: 1; transform: none; color: transparent; transition: color 0s 0.42s; }
  .js .sh__title[data-reveal]::after {
    content: ""; position: absolute; inset: 0.04em -0.06em; background: var(--text);
    transform: scaleX(0); transform-origin: left;
  }
  .js .sh__title[data-reveal].is-in { color: var(--text); }
  .js .sh__title[data-reveal].is-in::after { animation: declassify 0.9s var(--ease-in-out) forwards; }
}
@keyframes declassify {
  0% { transform: scaleX(0); transform-origin: left; }
  46% { transform: scaleX(1); transform-origin: left; }
  54% { transform: scaleX(1); transform-origin: right; }
  100% { transform: scaleX(0); transform-origin: right; }
}

/* Generic scroll reveal */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.9s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
}

/* ---------- Redaction bar (used for anything that is real but not mine to publish) ---------- */
.redact { position: relative; display: block; height: 1.25em; width: 100%; }
.redact::before {
  content: "not mine to share"; position: absolute; inset: 0; display: flex; align-items: center; padding-left: 10px;
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--red);
  background: var(--red-soft); border: 1px dashed var(--red-line); white-space: nowrap; overflow: hidden;
}
.redact::after { content: ""; position: absolute; inset: 0; background: var(--text); transition: transform 0.45s var(--ease); transform-origin: 0 100%; }
.redact--b { width: 78%; }
.redact--c { width: 88%; }
.redact--d { width: 66%; }
.redact--inline { display: inline-block; width: 7.5em; height: 1.05em; vertical-align: -0.15em; }
.redact--inline::before { content: none; }
li:hover > .redact::after, .redact:hover::after { transform: translateY(-6px) rotate(-2.2deg); }

/* ---------- Hero ---------- */
.home .hero { margin-top: calc(-1 * var(--nav-h)); }
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: min(100svh, 1000px); display: flex; align-items: center;
  padding: calc(var(--nav-h) + 48px) 0 72px;
}
.hero__wall { position: absolute; inset: 0; z-index: -3; overflow: hidden; perspective: 1600px; background: var(--bg); }
.hero__plane {
  position: absolute; left: 58%; top: 50%; width: max(1560px, 118vw);
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 20px;
  transform: translate(-50%, -50%) rotateX(26deg) rotateZ(-14deg); transform-style: preserve-3d;
}
.hero__col { display: flex; flex-direction: column; gap: 20px; }
.hero__col canvas, .hero__col img { width: 100%; height: auto; opacity: 0; transition: opacity 1.2s var(--ease); }
.hero__col canvas.is-loaded, .hero__col img.is-loaded { opacity: 1; }
.hero__col:nth-child(even) { margin-top: -240px; }
@media (prefers-reduced-motion: no-preference) {
  .hero__col { animation: wall-up 110s linear infinite; will-change: transform; }
  .hero__col:nth-child(even) { animation-name: wall-down; animation-duration: 130s; }
  .hero__col:nth-child(3n) { animation-duration: 150s; }
  .hero.is-paused .hero__col { animation-play-state: paused; }
}
@keyframes wall-up { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(0, -50%, 0); } }
@keyframes wall-down { from { transform: translate3d(0, -50%, 0); } to { transform: translate3d(0, 0, 0); } }

/* The spotlight: a huge overlay with a transparent hole, moved with transform only. */
.hero__light {
  position: absolute; left: 0; top: 0; z-index: -2; width: 3000px; height: 3000px; margin: -1500px 0 0 -1500px;
  pointer-events: none; will-change: transform; transform: translate3d(72vw, 48vh, 0);
  background: radial-gradient(circle at center, rgba(var(--bg-rgb), 0) 0, rgba(var(--bg-rgb), 0.08) 90px, rgba(var(--bg-rgb), 0.72) 250px, rgba(var(--bg-rgb), 0.9) 420px);
}
.hero__shade {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(var(--bg-rgb), 0.92) 0%, rgba(var(--bg-rgb), 0.78) 34%, rgba(var(--bg-rgb), 0.08) 62%, rgba(var(--bg-rgb), 0) 100%),
    linear-gradient(0deg, var(--bg) 0%, rgba(var(--bg-rgb), 0) 22%),
    linear-gradient(180deg, rgba(var(--bg-rgb), 0.7) 0%, rgba(var(--bg-rgb), 0) 18%);
}
.hero__inner { position: relative; }
.hero__status {
  display: inline-flex; align-items: center; gap: 10px; padding: 7px 12px 7px 10px; border: 1px solid var(--line-2);
  background: var(--glass); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  font-family: var(--mono); font-size: 0.76rem; letter-spacing: 0.04em; color: var(--text-2);
}
.live-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex: none; }
.live-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--green); }
@media (prefers-reduced-motion: no-preference) { .live-dot::after { animation: ping 2.2s var(--ease) infinite; } }
@keyframes ping { 0% { transform: scale(1); opacity: 0.6; } 80%, 100% { transform: scale(2.8); opacity: 0; } }

.hero__title { margin-top: clamp(40px, 6vh, 64px); display: grid; justify-items: start; }
.hero__name {
  position: relative; display: inline-block; padding: 0.07em 0.11em 0.02em;
  font-weight: 850; font-stretch: 62%; text-transform: uppercase; letter-spacing: 0.005em;
  font-size: clamp(5.2rem, 1rem + 16vw, 13rem); line-height: 0.84;
}
.hero__line { display: block; }
.redbox { position: absolute; inset: 0; pointer-events: none; }
.redbox i { position: absolute; background: var(--red); }
.redbox i:nth-child(1) { left: 0; top: 0; width: 100%; height: 3px; transform-origin: left; }
.redbox i:nth-child(2) { right: 0; top: 0; width: 3px; height: 100%; transform-origin: top; }
.redbox i:nth-child(3) { right: 0; bottom: 0; width: 100%; height: 3px; transform-origin: right; }
.redbox i:nth-child(4) { left: 0; bottom: 0; width: 3px; height: 100%; transform-origin: bottom; }
.redbox__tag {
  position: absolute; left: 0; bottom: 100%; white-space: nowrap;
  padding: 4px 9px 3px; background: var(--red-bg); color: var(--red-ink);
  font-family: var(--mono); font-weight: 600; font-stretch: 100%; text-transform: uppercase; letter-spacing: 0.06em; font-size: clamp(0.62rem, 0.55rem + 0.25vw, 0.78rem); line-height: 1.3;
}
.hero__role { margin-top: 26px; font-size: clamp(1.15rem, 0.95rem + 0.9vw, 1.65rem); font-weight: 500; line-height: 1.25; color: var(--text); max-width: 26ch; }
.hero__sub { margin-top: 16px; max-width: 54ch; font-size: clamp(1rem, 0.95rem + 0.25vw, 1.13rem); color: var(--text-2); }
.hero__sub strong { color: var(--text); font-weight: 600; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero__hint { display: flex; align-items: center; gap: 10px; margin-top: clamp(36px, 7vh, 72px); font-family: var(--mono); font-size: 0.74rem; color: var(--text-3); }
.hero__hint .ic { color: var(--red); width: 16px; height: 16px; }

/* Entrance choreography. JS adds .is-ready on <html> once fonts are in. */
@media (prefers-reduced-motion: no-preference) {
  .js [data-enter] { opacity: 0; transform: translateY(18px); }
  .js.is-ready [data-enter] { opacity: 1; transform: none; transition: opacity 0.8s var(--ease), transform 1s var(--ease); transition-delay: calc(var(--d, 0) * 90ms + 60ms); }
  .js .redbox i:nth-child(odd) { transform: scaleX(0); }
  .js .redbox i:nth-child(even) { transform: scaleY(0); }
  /* One continuous stroke: the long sides take longer than the short ones, so the pen moves at a
     constant speed around the box instead of pausing at every corner. */
  .js.is-ready .redbox i { transform: none; transition: transform 0.26s linear; }
  .js.is-ready .redbox i:nth-child(1) { transition-delay: 0.28s; }
  .js.is-ready .redbox i:nth-child(2) { transition-duration: 0.15s; transition-delay: 0.54s; }
  .js.is-ready .redbox i:nth-child(3) { transition-delay: 0.69s; }
  .js.is-ready .redbox i:nth-child(4) { transition-duration: 0.15s; transition-delay: 0.95s; transition-timing-function: cubic-bezier(0.3, 0, 0, 1); }
  .js .redbox__tag { opacity: 0; transform: translateY(6px); }
  .js.is-ready .redbox__tag { opacity: 1; transform: none; transition: opacity 0.35s var(--ease) 1.1s, transform 0.45s var(--ease) 1.1s; }
}

@media (max-width: 899px) {
  .hero { min-height: auto; padding-bottom: 56px; }
  .hero__plane { left: 50%; width: max(980px, 230vw); grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
  .hero__col { gap: 14px; }
  .hero__col:nth-child(n + 5) { display: none; }
  .hero__shade { background: linear-gradient(180deg, rgba(var(--bg-rgb), 0.55) 0%, rgba(var(--bg-rgb), 0.8) 45%, rgba(var(--bg-rgb), 0.94) 75%, var(--bg) 100%); }
  .hero__light { background: radial-gradient(circle at center, rgba(var(--bg-rgb), 0) 0, rgba(var(--bg-rgb), 0.1) 60px, rgba(var(--bg-rgb), 0.7) 170px, rgba(var(--bg-rgb), 0.86) 300px); }
}

/* ---------- 01 Record ---------- */
.ledger { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line-2); border-left: 1px solid var(--line); }
.ledger__cell { position: relative; display: flex; flex-direction: column; padding: 28px 26px 24px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transition: background-color 0.25s; }
.ledger__cell:hover { background: var(--surface); }
.ledger__cell::before { content: ""; position: absolute; left: -1px; top: -1px; width: 14px; height: 14px; border-left: 2px solid var(--red); border-top: 2px solid var(--red); opacity: 0; transition: opacity 0.25s; }
.ledger__cell:hover::before { opacity: 1; }
.ledger__num { order: -1; font-family: var(--stencil); font-weight: 800; font-size: clamp(3.4rem, 1.8rem + 4vw, 6.2rem); line-height: 0.9; letter-spacing: 0.01em; font-variant-numeric: tabular-nums; }
.ledger__num small { font-size: 0.42em; margin-right: 0.12em; vertical-align: 0.9em; letter-spacing: 0.04em; }
.ledger__cell--red .ledger__num { color: var(--red); }
.ledger dt { margin-top: 12px; font-weight: 600; font-size: 1.02rem; line-height: 1.35; }
.ledger__src { margin-top: auto; padding-top: 14px; }
.ledger__src a { font-family: var(--mono); font-size: 0.76rem; color: var(--text-3); border-bottom: 1px solid var(--line-2); transition: color 0.2s, border-color 0.2s; }
.ledger__src a:hover { color: var(--red); border-color: var(--red); }
@media (max-width: 899px) { .ledger { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ledger__cell { padding: 22px 16px 20px; } .ledger__src a { font-size: 0.7rem; line-height: 1.7; } }

.gap { margin-top: clamp(40px, 5vw, 64px); display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px 56px; padding: clamp(24px, 3vw, 40px); border: 1px dashed var(--line-2); background: var(--bg-2); }
.gap__title { font-weight: 800; font-stretch: 70%; text-transform: uppercase; font-size: clamp(1.7rem, 1.2rem + 1.4vw, 2.4rem); line-height: 1; }
.gap__text { display: grid; gap: 14px; align-content: start; justify-items: start; }
.gap__text p { color: var(--text-2); }
.gap__note { font-size: 0.92rem; }
.gap__list { display: grid; align-content: center; }
.gap__list li { display: grid; grid-template-columns: minmax(110px, 200px) minmax(0, 1fr); gap: 20px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); color: var(--text-2); }
.gap__list li:last-child { border-bottom: 0; }
@media (max-width: 899px) { .gap { grid-template-columns: 1fr; } .gap__list li { grid-template-columns: 96px minmax(0, 1fr); gap: 14px; font-size: 0.94rem; } }

/* ---------- 02 Scope ---------- */
.scope { display: flex; gap: 10px; height: clamp(500px, 64vh, 580px); }
.scope__item { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); background: var(--surface); transition: flex-grow 0.7s var(--ease), border-color 0.3s, background-color 0.3s; }
.scope__item:not(.is-open):hover { border-color: var(--line-2); background: var(--surface-2); }
.scope__item.is-open { flex-grow: 6; border-color: var(--line-2); }
.scope__item.is-open::before { content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 3px; background: var(--red); }
.scope__h { margin: 0; }
.scope__btn { width: 100%; display: flex; align-items: center; gap: 14px; padding: 22px 24px 18px; text-align: left; }
.scope__no { font-family: var(--mono); font-size: 0.76rem; color: var(--red); font-weight: 700; }
.scope__name { font-weight: 800; font-stretch: 62%; text-transform: uppercase; font-size: 2.6rem; line-height: 0.9; }
.scope__btn .ic { margin-left: auto; width: 26px; height: 26px; color: var(--text-3); }
.scope__item.is-open .scope__btn .ic { color: var(--red); }
.scope__body { padding: 6px 28px 28px; display: grid; gap: 24px; align-content: start; min-width: 440px; overflow-y: auto; }
@media (prefers-reduced-motion: no-preference) { .scope__body:not([hidden]) { animation: rise 0.6s var(--ease) both 0.12s; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.scope__lead { font-size: clamp(1.05rem, 0.95rem + 0.4vw, 1.3rem); line-height: 1.45; max-width: 46ch; }
.scope__tests { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; font-family: var(--mono); font-size: 0.8rem; color: var(--text-2); align-content: start; }
.scope__tests li { display: flex; gap: 10px; line-height: 1.45; }
.scope__tests li::before { content: "+"; color: var(--red); font-weight: 700; }
.scope__proof { display: grid; gap: 2px; align-content: start; border-top: 1px solid var(--line); padding-top: 16px; }
.scope__label { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); margin-bottom: 6px; }
.scope__proof a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 0.95rem; transition: color 0.2s; }
.scope__proof a:hover { color: var(--red); }
.scope__proof a .ic { width: 16px; height: 16px; color: var(--text-3); }
.scope__proof p:not(.scope__label) { color: var(--text-2); font-size: 0.95rem; max-width: 52ch; }
@media (min-width: 1024px) {
  .scope__item:not(.is-open) .scope__h { flex: 1; display: flex; }
  .scope__item:not(.is-open) .scope__btn { flex-direction: column; align-items: flex-start; padding: 22px 0 24px 20px; }
  .scope__item:not(.is-open) .scope__name { writing-mode: vertical-rl; transform: rotate(180deg); font-size: clamp(2.6rem, 1.4rem + 2vw, 3.6rem); margin-top: 14px; }
  .scope__item:not(.is-open) .scope__btn .ic { display: none; }
}
@media (min-width: 1200px) { .scope__body { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr); column-gap: 36px; min-width: 640px; } .scope__lead { grid-column: 1 / -1; } .scope__tests { grid-template-columns: 1fr; } .scope__proof { border-top: 0; padding-top: 0; } }
@media (max-width: 1023px) {
  .scope { flex-direction: column; height: auto; gap: 8px; }
  .scope__item { flex: none; }
  .scope__body { min-width: 0; padding: 0 20px 24px; }
  .scope__btn { padding: 18px 20px; }
  .scope__name { font-size: 2.1rem; }
}
@media (max-width: 559px) { .scope__tests { grid-template-columns: 1fr; } }

.certline { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 28px; font-family: var(--mono); font-size: 0.8rem; color: var(--text-3); }
.certline span { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.7rem; margin-right: 6px; }
.certline b { font-weight: 600; color: var(--text); border: 1px solid var(--line-2); padding: 4px 10px; border-radius: 2px; }
.certline .link { margin-left: 8px; font-family: var(--sans); font-size: 0.9rem; }

/* ---------- 03 Case files ---------- */
.cases { position: relative; border-top: 1px solid var(--line); }
.cases__pin { padding-block: clamp(72px, 8.5vw, 120px); }
.cases__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; }
.cases__head .sh { margin-bottom: clamp(28px, 4vw, 48px); }
.cases__ctrl { display: none; align-items: center; gap: 14px; margin-bottom: clamp(28px, 4vw, 48px); font-family: var(--mono); font-size: 0.78rem; color: var(--text-3); white-space: nowrap; }
.cases__bar { position: relative; width: 160px; height: 2px; background: var(--line-2); overflow: hidden; }
.cases__bar i { position: absolute; inset: 0; background: var(--red); transform: scaleX(0); transform-origin: left; }
.cases__viewport { overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.cases__viewport::-webkit-scrollbar { display: none; }
.cases__track { display: flex; gap: 20px; width: max-content; padding: 6px max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter))) 12px; }
.case {
  position: relative; flex: 0 0 min(430px, 84vw); scroll-snap-align: center; display: flex; flex-direction: column; gap: 18px;
  padding: 22px 24px 24px; background: var(--surface); border: 1px solid var(--line); min-height: 450px;
}
.case__top { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1px dashed var(--line-2); font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.case__no { color: var(--red); font-weight: 700; }
/* Severity on each case card, rated against CVSS. */
.case__top { align-items: center; }
.case__class { margin-left: auto; text-align: right; }
.sev { font-weight: 700; padding: 2px 7px; border: 1px solid currentColor; border-radius: 2px; letter-spacing: 0.08em; }
.sev--critical { color: var(--red); background: var(--red-soft); }
.sev--high { color: var(--text); }
.sev--medium { color: var(--text-3); }
.case__title { font-weight: 800; font-stretch: 70%; text-transform: uppercase; font-size: clamp(1.7rem, 1.4rem + 0.9vw, 2.2rem); line-height: 0.98; max-width: 15ch; }
.case--cve .case__title { font-family: var(--mono); font-stretch: 100%; text-transform: none; font-size: clamp(1.4rem, 1.2rem + 0.6vw, 1.7rem); letter-spacing: -0.02em; }
.case__meta { display: grid; gap: 6px; font-size: 0.9rem; }
.case__meta div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; align-items: baseline; }
.case__meta dt { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.case__story { color: var(--text-2); font-size: 0.97rem; }
.case__link { margin-top: auto; display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; font-family: var(--mono); font-size: 0.76rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--red); border-bottom: 1px solid var(--red-line); padding-bottom: 3px; }
.case__link:hover { border-color: var(--red); }
.case__link .ic { width: 15px; height: 15px; }
.stamp {
  margin-left: auto; align-self: center; padding: 5px 12px 3px; border: 3px double var(--red); color: var(--red);
  font-family: var(--stencil); font-weight: 800; font-size: 1.3rem; letter-spacing: 0.08em; text-transform: uppercase; line-height: 1;
  transform: rotate(-11deg); opacity: 0.85; pointer-events: none; white-space: nowrap;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='60'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.2 1.6'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='60'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.2 1.6'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
}
@media (prefers-reduced-motion: no-preference) {
  .js .case .stamp { opacity: 0; transform: rotate(-11deg) scale(1.9); }
  .js .case.is-in .stamp { opacity: 0.85; transform: rotate(-11deg) scale(1); transition: opacity 0.25s ease-in 0.25s, transform 0.4s cubic-bezier(0.5, 0, 0.75, 0) 0.25s; }
}
/* Pinned mode: the section scrolls sideways while the page scrolls down. JS sets the height. */
.cases.is-pinned .cases__pin { position: sticky; top: 0; height: 100vh; height: 100svh; display: flex; flex-direction: column; justify-content: center; padding-block: var(--nav-h) 24px; overflow: hidden; }
.cases.is-pinned .cases__viewport { overflow: visible; scroll-snap-type: none; }
.cases.is-pinned .cases__track { will-change: transform; }
.cases.is-pinned .cases__ctrl { display: flex; }
@media (max-height: 760px) { .cases.is-pinned .sh__lede { display: none; } .cases.is-pinned .case { min-height: 420px; } }

/* Case actions, the text version of the steps, and the replay overlay */
.case__actions { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.case__link { margin-top: 0; }
.case__replay {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--red-line); color: var(--red);
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; border-radius: var(--r);
  transition: background-color 0.2s, border-color 0.2s;
}
.case__replay:hover { background: var(--red-soft); border-color: var(--red); }
.case__replay .ic { width: 15px; height: 15px; }

.cases-text { border-top: 1px solid var(--line); }
.cases__steps-h { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); font-weight: 500; }
.cases-text .muted { font-size: 0.9rem; margin-bottom: 18px; max-width: 60ch; }
.steps { border-top: 1px solid var(--line); }
.steps:last-of-type { border-bottom: 1px solid var(--line); }
.steps summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 2px; cursor: pointer; list-style: none; }
.steps summary::-webkit-details-marker { display: none; }
.steps summary::after { content: "+"; color: var(--red); font-weight: 700; margin-left: auto; }
.steps[open] summary::after { content: "\2212"; }
.steps__case { font-weight: 650; }
.steps__n { font-family: var(--mono); font-size: 0.72rem; color: var(--text-3); }
.steps__list { display: grid; gap: 22px; padding: 6px 0 26px; max-width: 76ch; }
.steps__list p { color: var(--text-2); font-size: 0.95rem; }
.steps__label { display: flex; gap: 10px; color: var(--text) !important; font-weight: 650; margin-bottom: 4px; }
.steps__label i { font-style: normal; font-family: var(--mono); font-size: 0.72rem; color: var(--red); padding-top: 2px; }
.steps__code, .replay__code {
  position: relative; margin-top: 10px; padding: 14px 16px; background: var(--bg-2); border: 1px solid var(--line);
  border-left: 2px solid var(--red); overflow-x: auto; font-family: var(--mono); font-size: 0.78rem; line-height: 1.6; color: var(--text);
  white-space: pre; tab-size: 2;
}
.steps__code[data-lang]::before, .replay__code[data-lang]::before {
  content: attr(data-lang); position: absolute; right: 10px; top: 8px; font-size: 0.6rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-3);
}

.replay { position: fixed; inset: 0; z-index: var(--z-dialog); display: flex; align-items: center; justify-content: center; padding: clamp(8px, 3vw, 32px); background: rgba(5, 5, 6, 0.75); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transition: opacity 0.25s var(--ease); }
.replay.is-open { opacity: 1; }
.replay__dialog {
  width: min(900px, 100%); max-height: 100%; min-height: 0; display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--line-2); border-top: 3px solid var(--red); box-shadow: 0 50px 100px -30px rgba(0, 0, 0, 0.8);
  transform: translateY(10px) scale(0.99); transition: transform 0.3s var(--ease);
}
.replay.is-open .replay__dialog { transform: none; }
.replay__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 20px 16px; border-bottom: 1px solid var(--line); }
.replay__case { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--red); margin-bottom: 6px; }
.replay__title { font-weight: 800; font-stretch: 70%; text-transform: uppercase; font-size: clamp(1.3rem, 1.1rem + 1vw, 1.9rem); line-height: 1; }
.replay__track { display: flex; gap: 4px; padding: 0 20px; margin-top: 14px; }
.replay__track button { flex: 1; height: 3px; background: var(--line-2); cursor: pointer; transition: background-color 0.3s; }
.replay__track button.is-on { background: var(--red); }
.replay__body { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 20px 8px; overscroll-behavior: contain; }
.replay__steps { display: grid; gap: 14px; }
.replay__steps li { opacity: 0.18; transition: opacity 0.4s var(--ease); }
.replay__steps li.is-past { opacity: 0.5; }
.replay__steps li.is-on { opacity: 1; }
.replay__label { display: flex; gap: 10px; font-weight: 650; }
.replay__label i { font-style: normal; font-family: var(--mono); font-size: 0.72rem; color: var(--red); padding-top: 3px; }
.replay__body-text { color: var(--text-2); margin-top: 4px; }
.replay__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 14px 20px 18px; border-top: 1px solid var(--line); }
.replay__count { font-family: var(--mono); font-size: 0.74rem; color: var(--text-3); }
.replay__nav { display: flex; gap: 8px; margin-left: auto; }
.replay__nav .btn[disabled] { opacity: 0.4; pointer-events: none; }
.replay__link { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; color: var(--text-2); border-bottom: 1px solid var(--line-2); }
.replay__link:hover { color: var(--red); border-color: var(--red); }
.replay__link .ic { width: 14px; height: 14px; }
@media (max-width: 639px) {
  .replay__dialog { flex: 1; }
  .replay__foot { padding-bottom: 14px; }
  .replay__nav { width: 100%; margin-left: 0; }
  .replay__nav .btn { flex: 1; }
  .replay__link { order: 4; }
}

/* ---------- In their words ---------- */
.named__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.named__list a { display: grid; gap: 6px; height: 100%; padding: 18px 20px 16px; background: var(--bg); transition: background-color 0.2s; }
.named__list a:hover { background: var(--surface); }
.named__list b { font-weight: 650; font-size: 1rem; }
.named__list span { color: var(--text-2); font-size: 0.9rem; line-height: 1.45; }
.named__list em { margin-top: auto; padding-top: 8px; display: inline-flex; align-items: center; gap: 5px; font-style: normal; font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--red); }
.named__list em .ic { width: 12px; height: 12px; }

/* ---------- 04 First in ---------- */
.first { border-top: 1px solid var(--line); overflow: hidden; }
.firsts { display: grid; gap: 18px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); }
.firsts__row { overflow: hidden; padding-block: 8px; }
.firsts__track { display: flex; width: max-content; }
.firsts__set { display: flex; gap: 16px; padding-right: 16px; }
@media (prefers-reduced-motion: no-preference) {
  .firsts__track { animation: marquee 140s linear infinite; }
  .firsts__row--rev .firsts__track { animation-direction: reverse; animation-duration: 160s; }
  .firsts__row:hover .firsts__track, .firsts__row:focus-within .firsts__track, .first.is-paused .firsts__track { animation-play-state: paused; }
}
@media (prefers-reduced-motion: reduce) {
  .firsts { -webkit-mask-image: none; mask-image: none; }
  .firsts__row { overflow-x: auto; padding-inline: var(--gutter); }
  .firsts__set[aria-hidden="true"] { display: none; }
}
@keyframes marquee { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-50%, 0, 0); } }
.hof {
  width: 252px; min-height: 236px; display: flex; flex-direction: column; gap: 7px; padding: 12px 16px 14px;
  background: var(--paper); color: var(--paper-ink); border-radius: 4px; box-shadow: 0 16px 34px -22px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(0, 0, 0, 0.06);
  transition: transform 0.35s var(--ease);
}
.hof:hover, .hof:focus-visible { transform: translateY(-4px) rotate(-0.6deg); }
.hof__bar { display: flex; justify-content: space-between; gap: 8px; padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid var(--paper-2); font-family: var(--mono); font-size: 0.66rem; color: var(--paper-ink-2); }
.hof__bar span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hof__org { font-weight: 700; font-size: 1.02rem; line-height: 1.2; min-height: 2.4em; }
.hof__label { font-weight: 600; font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--paper-ink-2); }
.hof__entry { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; line-height: 1.3; }
.hof__entry i { font-style: normal; font-family: var(--mono); font-size: 0.66rem; color: var(--paper-ink-2); }
.hof__entry s { display: block; height: 7px; width: 62%; background: var(--paper-2); border-radius: 1px; }
.hof__entry + .hof__entry + .hof__entry s { width: 44%; }
.hof__entry--me { font-weight: 650; outline: 2px solid var(--paper-red); outline-offset: 0; padding: 2px 7px; margin-left: -7px; width: fit-content; }
.hof__go { margin-top: auto; padding-top: 6px; display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--paper-red); font-weight: 600; }
.hof__go .ic { width: 13px; height: 13px; }
.first__foot { margin-top: clamp(32px, 4vw, 48px); }

/* ---------- 05 Map ---------- */
.map { border-top: 1px solid var(--line); overflow: hidden; }
.map__grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.map__text .sh { margin-bottom: 32px; }
.map__visual { position: relative; width: 100%; max-width: 620px; aspect-ratio: 1; }
.globe { position: absolute; inset: 0; }
.globe canvas { width: 100%; height: 100%; touch-action: pan-y; cursor: grab; }
.globe canvas:active { cursor: grabbing; }
.globe::before {
  content: ""; position: absolute; inset: 9%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(var(--globe-accent), 0.1), rgba(var(--globe-accent), 0.025) 70%, transparent 100%);
  filter: blur(18px); pointer-events: none;
}
.globe__labels { position: absolute; inset: 0; pointer-events: none; }
.globe__label {
  position: absolute; left: 0; top: 0; white-space: nowrap;
  font-family: var(--mono); font-size: 0.7rem; color: var(--text);
  padding: 3px 8px; background: var(--glass); border: 1px solid var(--line-2);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  opacity: 0; will-change: transform, opacity;
}
.globe__label b { color: var(--red); font-weight: 700; margin-left: 6px; }
.globe__fallback { position: absolute; inset: 0; display: none; pointer-events: none; }
.globe__fallback img { width: 100%; height: 100%; }
html:not(.js) .globe__fallback, .globe.no-webgl .globe__fallback { display: block; }
.globe.no-webgl canvas, html:not(.js) .globe canvas { display: none; }
.globe__legend { position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); font-family: var(--mono); font-size: 0.72rem; color: var(--text-3); white-space: nowrap; display: flex; gap: 10px; align-items: center; }
.globe__legend i { width: 7px; height: 7px; background: var(--red); display: inline-block; }

.sector-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-bottom: 28px; }
.sector { display: grid; gap: 4px; padding: 16px 16px 14px; background: var(--bg); transition: background-color 0.2s; }
.sector:hover { background: var(--surface); }
.sector b { font-family: var(--stencil); font-weight: 800; font-size: 2.2rem; line-height: 1; }
.sector span { font-size: 0.84rem; color: var(--text-2); line-height: 1.3; }
.sector--lead { grid-column: span 2; }
.sector--lead b { color: var(--red); }
.sector--all { background: var(--surface); align-content: end; }
.sector--all b { font-family: var(--sans); font-size: 0.95rem; font-weight: 650; display: inline-flex; align-items: center; gap: 6px; }
.sector--all:hover b { color: var(--red); }
.country-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; margin-bottom: 28px; }
.country-list li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 0.94rem; }
.country-list .cc { font-family: var(--mono); font-size: 0.7rem; color: var(--text-3); width: 2.2em; }
.country-list .n { margin-left: auto; font-family: var(--mono); font-size: 0.82rem; color: var(--text-2); }
@media (max-width: 899px) {
  .map__grid { grid-template-columns: 1fr; }
  .map__visual { max-width: 460px; margin-inline: auto; order: 2; }
}
@media (max-width: 479px) { .sector-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .country-list { grid-template-columns: 1fr; } }

.names { margin-top: clamp(64px, 8vw, 112px); border-block: 1px solid var(--line); padding-block: 22px; overflow: hidden; }
.names__track, .names__list { display: flex; width: max-content; }
.names__track li { display: flex; align-items: center; white-space: nowrap; font-weight: 800; font-stretch: 62%; text-transform: uppercase; font-size: clamp(1.8rem, 1rem + 2.6vw, 3.2rem); line-height: 1; color: var(--text-3); padding-right: 0.6em; }
.names__track li::after { content: ""; width: 0.32em; height: 0.32em; border: 2px solid var(--red); margin-left: 0.6em; }
@media (prefers-reduced-motion: no-preference) { .names__track.is-looping { animation: marquee 70s linear infinite; } .names:hover .names__track { animation-play-state: paused; } }
@media (prefers-reduced-motion: reduce) { .names__track, .names__list { flex-wrap: wrap; width: auto; row-gap: 10px; } .names__track { padding-inline: var(--gutter); } }

/* ---------- 06 Proof desk ---------- */
.proof { border-top: 1px solid var(--line); }
.desk {
  position: relative; height: clamp(580px, 62vw, 880px); border: 1px solid var(--line); overflow: hidden;
  background: radial-gradient(120% 80% at 50% 0%, var(--surface) 0%, var(--bg-2) 70%);
}
.desk::before { content: ""; position: absolute; inset: 14px; border: 1px dashed var(--line); pointer-events: none; }
.polaroid {
  --dx: 0px; --dy: 0px; --r: 0deg;
  position: absolute; width: 18.5%; min-width: 146px; padding: 9px 9px 34px; background: var(--paper); color: var(--paper-ink);
  box-shadow: 0 22px 40px -22px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(0, 0, 0, 0.05);
  transform: translate(var(--dx), var(--dy)) rotate(var(--r)); transition: transform 0.45s var(--ease), box-shadow 0.25s;
  cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
}
.polaroid img { width: 100%; aspect-ratio: 4 / 5; height: auto; object-fit: cover; object-position: top; background: var(--paper-2); pointer-events: none; }
/* Photos shot in landscape have nothing worth keeping at the very top of the frame. */
.polaroid--wide img { object-position: center; }
.polaroid--trophy img { object-position: 34% center; }
.polaroid__cap { position: absolute; left: 11px; right: 11px; bottom: 10px; font-family: var(--mono); font-size: 0.68rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.polaroid:hover { box-shadow: 0 30px 50px -22px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(0, 0, 0, 0.05); }
/* Each row of photos sits in front of the row below it, so a photo can overlap the one
   underneath the way a real pile does without ever hiding its caption. Picking one up
   lifts it above everything (home.js raises z-index on drag). */
.polaroid:hover, .polaroid:focus-visible, .polaroid.is-dragging { z-index: 9; }
.polaroid.is-dragging { cursor: grabbing; transition: box-shadow 0.25s; box-shadow: 0 40px 60px -20px rgba(0, 0, 0, 0.9); }
.polaroid:nth-child(-n + 4) { z-index: 3; }
.polaroid:nth-child(n + 5):nth-child(-n + 8) { z-index: 2; }
.polaroid:nth-child(n + 9) { z-index: 1; }
.polaroid:nth-child(1) { left: 1.5%; top: 3%; --r: -6deg; }
.polaroid:nth-child(2) { left: 27%; top: 1%; --r: 4deg; }
.polaroid:nth-child(3) { left: 49%; top: 4.5%; --r: -3deg; }
.polaroid:nth-child(4) { left: 76%; top: 1.5%; --r: 5deg; }
.polaroid:nth-child(5) { left: 4%; top: 30%; --r: 3deg; }
.polaroid:nth-child(6) { left: 29.5%; top: 32%; --r: -5deg; }
.polaroid:nth-child(7) { left: 53%; top: 28.5%; --r: 6deg; }
.polaroid:nth-child(8) { left: 73%; top: 31%; --r: -4deg; }
.polaroid:nth-child(9) { left: 1%; top: 57%; --r: -3deg; }
.polaroid:nth-child(10) { left: 26.5%; top: 55%; --r: 5deg; }
.polaroid:nth-child(11) { left: 51%; top: 58%; --r: -7deg; }
.polaroid:nth-child(12) { left: 74.5%; top: 56%; --r: 4deg; }
.proof__foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px; margin-top: 24px; }
.proof__counts { display: flex; flex-wrap: wrap; gap: 8px 28px; font-size: 0.92rem; color: var(--text-2); }
.proof__counts b { font-family: var(--stencil); font-weight: 800; font-size: 1.5rem; color: var(--text); margin-right: 6px; vertical-align: -0.1em; }
@media (max-width: 899px) {
  .desk { height: auto; display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 28px 22px 32px; scrollbar-width: none; }
  .desk::-webkit-scrollbar { display: none; }
  .desk::before { content: none; }
  .polaroid { position: relative; left: auto !important; top: auto !important; flex: 0 0 172px; scroll-snap-align: center; cursor: pointer; touch-action: auto; }
  .polaroid:nth-child(odd) { --r: -2.5deg; }
  .polaroid:nth-child(even) { --r: 2.5deg; }
}

/* ---------- 07 Background ---------- */
.dossier { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: clamp(40px, 6vw, 88px); }
.dossier__h { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); font-weight: 500; padding-bottom: 10px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.timeline { display: grid; }
.role { position: relative; padding: 0 0 34px 30px; border-left: 1px solid var(--line-2); }
.role:last-child { padding-bottom: 4px; }
.role::before { content: ""; position: absolute; left: -5px; top: 9px; width: 9px; height: 9px; background: var(--bg); border: 2px solid var(--red); }
.role:first-child::before { background: var(--red); }
.role__top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; }
.role__title { font-size: 1.2rem; font-weight: 700; line-height: 1.3; }
.role__when { font-family: var(--mono); font-size: 0.74rem; color: var(--text-3); white-space: nowrap; }
.role__org { display: inline-block; margin-top: 4px; color: var(--text-2); font-size: 0.95rem; }
a.role__org { border-bottom: 1px solid var(--line-2); }
a.role__org:hover { color: var(--red); border-color: var(--red); }
.role ul { margin-top: 12px; display: grid; gap: 8px; }
.role li { position: relative; padding-left: 18px; color: var(--text-2); font-size: 0.97rem; }
.role li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 6px; height: 6px; background: var(--red); }
.side-block + .side-block { margin-top: 40px; }
/* Talks sits in the wide column under the roles, so the two columns end near each other
   instead of leaving most of a screen blank beside the sidebar. */
.dossier__main .side-block { margin-top: clamp(34px, 4vw, 52px); }
/* Portrait at the head of the side column. The frame and the red hairline match the
   proof cards so it reads as another record in the dossier rather than a stock headshot. */
.portrait { margin-bottom: clamp(30px, 4vw, 44px); }
.portrait__img { display: block; width: 100%; max-width: 320px; height: auto; border: 1px solid var(--line); border-radius: 2px; filter: grayscale(1) contrast(1.04); }
.portrait__cap { display: flex; flex-direction: column; gap: 3px; margin-top: 12px; max-width: 320px; padding-left: 11px; border-left: 2px solid var(--red); }
.portrait__cap b { font-size: 0.95rem; font-weight: 600; }
.portrait__cap span { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.04em; color: var(--text-3); }
@media (max-width: 899px) { .portrait__img, .portrait__cap { max-width: 260px; } }
.wins li { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 14px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--line); }
.wins b { font-family: var(--stencil); font-weight: 800; font-size: 1.5rem; line-height: 1; color: var(--red); white-space: nowrap; }
.wins li:first-child b { font-size: 1.3rem; }
.wins span { font-size: 0.95rem; }
.inline-link { color: var(--text); border-bottom: 1px solid var(--red-line); white-space: nowrap; }
.inline-link:hover { color: var(--red); border-color: var(--red); }
.side-note { margin-top: 10px; font-family: var(--mono); font-size: 0.74rem; color: var(--text-3); }
.certs li { display: grid; grid-template-columns: 80px minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--line); }
.certs b { font-family: var(--mono); font-size: 0.82rem; font-weight: 700; }
.certs span { font-size: 0.9rem; color: var(--text-2); }
.certs small { font-family: var(--mono); font-size: 0.7rem; color: var(--text-3); white-space: nowrap; }
.edu { display: grid; gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.edu b { font-weight: 650; }
.edu span { color: var(--text-2); font-size: 0.94rem; }
.edu small { font-family: var(--mono); font-size: 0.74rem; color: var(--text-3); }
.toolbox { margin-top: clamp(48px, 6vw, 72px); }
.tools { display: flex; flex-wrap: wrap; gap: 8px; }
.tools span { font-family: var(--mono); font-size: 0.78rem; padding: 6px 10px; border: 1px solid var(--line-2); color: var(--text-2); border-radius: 2px; }

/* Skills, grouped so the list reads as a map of the work rather than a pile of keywords. */
.skills__row { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 14px 28px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.skills__row:first-child { border-top: 1px solid var(--line); }
.skills dt { font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); padding-top: 7px; }

/* Things I have built, newest and most ambitious first. */
.builds { display: grid; gap: 20px; margin: 20px 0 22px; counter-reset: build; }
.build { position: relative; padding: 18px 20px; border: 1px solid var(--line); background: var(--surface); }
.build--wip { border-color: var(--red-line); background: var(--red-soft); }
.build__top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; }
.build__title { font-size: 1.08rem; font-weight: 700; }
.build__when { font-family: var(--mono); font-size: 0.72rem; color: var(--text-3); white-space: nowrap; }
.build--wip .build__when { color: var(--red); }
.build p { margin-top: 8px; color: var(--text-2); font-size: 0.96rem; max-width: 78ch; }
.build__note { font-family: var(--mono); font-size: 0.76rem; color: var(--text-3) !important; }
.build .link { margin-top: 12px; }
@media (min-width: 900px) { .builds { grid-template-columns: repeat(2, minmax(0, 1fr)); } .build--wip { grid-column: 1 / -1; } }
@media (max-width: 599px) { .skills__row { grid-template-columns: 1fr; gap: 8px; } .skills dt { padding-top: 0; } }
@media (max-width: 899px) { .dossier { grid-template-columns: 1fr; } }

/* ---------- 08 Replies ---------- */
.replies { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.reply { border: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; }
.reply__head { order: -1; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.reply__head > span:first-child { display: grid; font-size: 0.84rem; color: var(--text-3); }
.reply__head b { font-size: 0.98rem; color: var(--text); font-weight: 650; }
.reply__re { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); white-space: nowrap; padding-top: 4px; }
.reply blockquote { padding: 22px 20px 26px; }
.reply blockquote p { font-size: clamp(1.02rem, 0.95rem + 0.35vw, 1.2rem); line-height: 1.5; }
.reply blockquote p::before { content: "\201C"; color: var(--red); font-weight: 800; margin-right: 2px; }
.reply blockquote p::after { content: "\201D"; color: var(--red); font-weight: 800; margin-left: 2px; }
@media (max-width: 767px) { .replies { grid-template-columns: 1fr; } }

/* ---------- 09 Writing ---------- */
.shelf { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 4vw, 56px); }
.shelf__h { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line-2); font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); font-weight: 500; }
.shelf__h .ic { width: 16px; height: 16px; color: var(--text); }
.shelf__list { margin-bottom: 18px; }
.shelf__list a { display: block; padding: 13px 0; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 0.98rem; line-height: 1.35; transition: color 0.2s, padding-left 0.3s var(--ease); }
.shelf__list a:hover { color: var(--red); padding-left: 6px; }
.shelf__list small { display: block; margin-top: 4px; font-family: var(--mono); font-weight: 400; font-size: 0.7rem; color: var(--text-3); }
@media (max-width: 1023px) { .shelf { grid-template-columns: 1fr 1fr; } .shelf__col:first-child { grid-column: 1 / -1; } }
@media (max-width: 639px) { .shelf { grid-template-columns: 1fr; } }

/* ---------- 10 Contact ---------- */
.contact { position: relative; padding-block: clamp(96px, 12vw, 160px); border-top: 1px solid var(--line); overflow: hidden; }
.contact .sh__no { margin-bottom: 22px; }
.contact__title { font-weight: 850; font-stretch: 62%; text-transform: uppercase; font-size: clamp(2.7rem, 0.9rem + 7.4vw, 8.2rem); line-height: 0.9; max-width: 15ch; }
.contact__mark { position: relative; display: inline-block; white-space: nowrap; padding: 0.02em 0.08em 0; margin-block: 0.06em; color: var(--red); outline: 3px solid var(--red); outline-offset: 0; }
.contact__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px 56px; margin-top: clamp(36px, 5vw, 56px); align-items: end; }
.contact__lede { font-size: clamp(1.05rem, 0.95rem + 0.4vw, 1.3rem); color: var(--text-2); max-width: 40ch; }
.contact__actions { display: grid; gap: 18px; }
.contact__email { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.contact__email a { font-weight: 650; font-size: clamp(1.15rem, 0.9rem + 1vw, 1.6rem); border-bottom: 2px solid var(--red); line-height: 1.3; overflow-wrap: anywhere; }
.contact__email a:hover { color: var(--red); }
.contact__btns { display: flex; flex-wrap: wrap; gap: 12px; }
.contact__links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.contact__links a { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 0.94rem; transition: color 0.2s; }
.contact__links a:hover { color: var(--text); }
@media (max-width: 899px) { .contact__grid { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 56px 0 36px; font-size: 0.92rem; }
.footer__grid { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 32px; }
.footer__title { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); font-weight: 500; margin-bottom: 14px; }
.footer ul { display: grid; gap: 8px; }
.footer ul a { color: var(--text-2); }
.footer ul a:hover { color: var(--red); }
.footer__note { margin-top: 18px; color: var(--text-3); max-width: 44ch; font-size: 0.88rem; }
.footer__base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--text-3); font-size: 0.82rem; }
.footer__base kbd { font-size: 0.72rem; border: 1px solid var(--line-2); border-radius: 2px; padding: 1px 5px; }
@media (max-width: 899px) { .footer__grid { grid-template-columns: 1fr 1fr; } .footer__grid > div:first-child { grid-column: 1 / -1; } }

/* ---------- Verify mode ----------
   Claims get highlighted like a marked up document: red for claims with a public source, grey for
   claims that are private and available on request. The tag sits inline after the claim. */
.verify-on [data-claim] { position: relative; background-color: var(--red-soft); outline: 1px dashed var(--red-line); outline-offset: 0; transition: outline-color 0.3s; }
.verify-on [data-claim].claim--private { background-color: color-mix(in srgb, var(--text) 6%, transparent); outline-color: var(--line-2); }
.verify-on [data-claim].claim--current { outline: 2px solid var(--red); }
@media (prefers-reduced-motion: no-preference) { .verify-on [data-claim].claim--current { animation: claim-flash 0.9s var(--ease); } }
@keyframes claim-flash { 0% { outline-offset: 10px; outline-color: transparent; } 100% { outline-offset: 0; } }
.claim-tag {
  display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; vertical-align: 0.12em; white-space: nowrap;
  padding: 2px 7px 1px; background: var(--red-bg); color: var(--red-ink); font-family: var(--mono); font-size: 0.62rem; font-weight: 600;
  font-style: normal; letter-spacing: 0.06em; text-transform: uppercase; line-height: 1.35; border: 0;
}
.claim-tag .ic { width: 11px; height: 11px; }
.claim-tag:hover { background: color-mix(in srgb, var(--red-bg) 80%, #000); }
.claim--private .claim-tag { background: var(--surface-2); color: var(--text); outline: 1px solid var(--line-2); }
.ledger__cell .claim-tag, .reply > .claim-tag { position: absolute; right: 12px; top: 12px; margin: 0; }
.ledger__src a.claim-tag, .ledger__src a.claim-tag:hover { color: var(--red-ink); border-bottom: 0; }
.reply > .claim-tag { top: -10px; }
.verify-bar {
  position: fixed; left: 50%; bottom: 16px; z-index: var(--z-toast); transform: translateX(-50%); width: min(760px, calc(100vw - 24px));
  display: flex; align-items: center; gap: 14px; padding: 10px 10px 10px 14px; background: var(--surface); border: 1px solid var(--line-2);
  border-top: 3px solid var(--red); box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.6);
}
.verify-bar__mode { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--red); font-weight: 700; white-space: nowrap; }
.verify-bar__box, .verify-fab__box { width: 12px; height: 12px; border: 2px solid var(--red); flex: none; }
.verify-bar__text { flex: 1; min-width: 0; font-size: 0.86rem; color: var(--text-2); line-height: 1.4; }
.verify-bar__nav { display: flex; gap: 6px; flex: none; }
.verify-fab {
  position: fixed; left: 16px; bottom: 16px; z-index: var(--z-nav); display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--surface); border: 1px solid var(--line-2); font-family: var(--mono); font-size: 0.72rem;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--text); box-shadow: var(--shadow);
  opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity 0.3s var(--ease), transform 0.4s var(--ease), border-color 0.2s;
}
.verify-fab.is-shown { opacity: 1; transform: none; pointer-events: auto; }
.verify-fab:hover { border-color: var(--red); }
.verify-on .verify-fab { display: none; }
.btn[aria-pressed="true"] { border-color: var(--red); color: var(--red); }
@media (max-width: 639px) {
  .verify-bar { flex-wrap: wrap; gap: 8px; bottom: 8px; }
  .verify-bar__text { flex: 1 1 100%; order: 3; font-size: 0.8rem; }
  .verify-bar__nav { margin-left: auto; }
}
@media print { .verify-bar, .verify-fab, .claim-tag { display: none !important; } }

/* ---------- Command palette ---------- */
.palette { position: fixed; inset: 0; z-index: var(--z-dialog); display: grid; place-items: start center; padding: min(14vh, 120px) 16px 16px; background: rgba(5, 5, 6, 0.6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); opacity: 0; transition: opacity 0.2s var(--ease); }
.palette.is-open { opacity: 1; }
.palette__box { width: min(640px, 100%); max-height: min(70vh, 560px); display: flex; flex-direction: column; border: 1px solid var(--line-2); background: var(--surface); box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.6); overflow: hidden; transform: translateY(-8px) scale(0.985); transition: transform 0.3s var(--ease); }
.palette.is-open .palette__box { transform: none; }
.palette__search { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.palette__search .ic { color: var(--red); width: 20px; height: 20px; }
.palette__search input { flex: 1; height: 56px; border: 0; background: transparent; font-size: 1.02rem; outline: none; }
.palette__search input::placeholder { color: var(--text-3); }
.palette__search kbd { font-size: 0.7rem; color: var(--text-3); border: 1px solid var(--line-2); border-radius: 2px; padding: 2px 6px; }
.palette__list { overflow-y: auto; padding: 8px; overscroll-behavior: contain; }
.palette__group { padding: 10px 10px 6px; font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); }
.palette__item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; text-align: left; color: var(--text-2); font-size: 0.95rem; cursor: pointer; border-left: 2px solid transparent; }
.palette__item .ic { width: 18px; height: 18px; color: var(--text-3); }
.palette__item small { margin-left: auto; font-family: var(--mono); font-size: 0.72rem; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 50%; }
.palette__item[aria-selected="true"] { background: var(--surface-2); color: var(--text); border-left-color: var(--red); }
.palette__item[aria-selected="true"] .ic { color: var(--red); }
.palette__empty, .palette__term { padding: 22px 14px; color: var(--text-2); font-size: 0.92rem; }
.palette__term { font-family: var(--mono); font-size: 0.82rem; line-height: 1.7; white-space: pre-wrap; color: var(--text); }
.palette__term .a { color: var(--red); }
.palette__foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 0.75rem; color: var(--text-3); }
.palette__foot kbd { border: 1px solid var(--line-2); border-radius: 2px; padding: 0 5px; margin-right: 4px; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: var(--z-toast); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 10px 16px; background: var(--text); color: var(--bg); font-size: 0.9rem; font-weight: 600; border-left: 3px solid var(--red); transition: opacity 0.3s var(--ease), transform 0.4s var(--ease); }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Sub pages (proof archive, organizations) ---------- */
.page-head { padding-top: clamp(48px, 7vw, 104px); padding-bottom: clamp(28px, 4vw, 48px); display: grid; gap: 18px; justify-items: start; }
.page-head h1 { font-weight: 850; font-stretch: 62%; text-transform: uppercase; font-size: clamp(3rem, 1.4rem + 7vw, 7.5rem); line-height: 0.88; }
.page-head h1 .boxed { color: var(--red); outline: 3px solid var(--red); outline-offset: 0.02em; padding: 0 0.08em; }
.page-head .lede { max-width: 62ch; font-size: clamp(1.02rem, 0.95rem + 0.3vw, 1.18rem); color: var(--text-2); }
.crumbs { display: flex; gap: 10px; align-items: center; font-family: var(--mono); font-size: 0.76rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.crumbs a:hover { color: var(--red); }
.subnav { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar { position: sticky; top: var(--nav-h); z-index: 10; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 14px 0; background: rgba(var(--bg-rgb), 0.9); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.filters { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; flex: 1 1 auto; min-width: 0; padding: 2px; }
.filters::-webkit-scrollbar { display: none; }
.search { position: relative; flex: 0 1 300px; min-width: 200px; }
.search .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); width: 18px; height: 18px; pointer-events: none; }
.search input { width: 100%; height: 40px; padding: 0 14px 0 40px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface); font-size: 0.92rem; outline: none; transition: border-color 0.2s; }
.search input:focus { border-color: var(--red); }
.search input::placeholder { color: var(--text-3); }
.sort { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 0.74rem; color: var(--text-3); }
.sort select { height: 40px; padding: 0 10px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface); font-family: var(--sans); font-size: 0.88rem; color: var(--text); }
.result-line { padding: 18px 0 8px; color: var(--text-3); font-size: 0.82rem; font-family: var(--mono); }
@media (max-width: 639px) { .toolbar { position: static; } .search { flex: 1 1 100%; } .sort { flex: 1 1 100%; } .sort select { flex: 1; } }

/* Trust block on the organizations page */
.trust { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px 56px; padding: clamp(24px, 3vw, 36px); border: 1px dashed var(--line-2); background: var(--bg-2); margin-bottom: clamp(48px, 6vw, 72px); }
.trust__nums { display: flex; flex-wrap: wrap; gap: 10px 36px; align-items: flex-end; align-content: start; }
.trust__nums p { display: grid; }
.trust__nums b { font-family: var(--stencil); font-weight: 800; font-size: clamp(2.6rem, 2rem + 2vw, 3.8rem); line-height: 1; }
.trust__nums p:first-child b { color: var(--red); }
.trust__nums span { font-size: 0.86rem; color: var(--text-2); }
.trust__text { display: grid; gap: 12px; align-content: start; }
.trust__text p { color: var(--text-2); }
@media (max-width: 899px) { .trust { grid-template-columns: 1fr; } }

/* Proof archive grid (masonry columns with real aspect ratios so nothing jumps) */
.masonry { columns: 4 240px; column-gap: 14px; padding-block: 12px 80px; }
.shot { break-inside: avoid; margin-bottom: 14px; display: block; width: 100%; text-align: left; overflow: hidden; border: 1px solid var(--line); background: var(--surface); position: relative; transition: border-color 0.3s, transform 0.5s var(--ease); }
.shot:hover { border-color: var(--red-line); transform: translateY(-3px); }
.shot img { width: 100%; background: var(--surface-2); }
.shot__cap { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--line); }
.shot__cap b { font-weight: 600; font-size: 0.9rem; line-height: 1.3; }
.shot__cap > span { font-family: var(--mono); font-size: 0.66rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; }
.shot__domain { display: block; font-family: var(--mono); font-size: 0.72rem; color: var(--text-3); margin-top: 2px; font-weight: 400; }
.empty { padding: 80px 0; text-align: center; color: var(--text-2); display: grid; gap: 14px; justify-items: center; }
.empty .ic { width: 32px; height: 32px; color: var(--text-3); }
.skeleton { break-inside: avoid; margin-bottom: 14px; background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%) 0 0 / 200% 100%; border: 1px solid var(--line); }
@media (prefers-reduced-motion: no-preference) { .skeleton { animation: shimmer 1.4s linear infinite; } }
@keyframes shimmer { to { background-position: -200% 0; } }
.sk-a { height: 420px; } .sk-b { height: 520px; } .sk-c { height: 380px; } .sk-d { height: 470px; }

/* Lightbox. Sizes come from the viewport, never from percentages, so the image always fits. */
.lightbox { position: fixed; inset: 0; z-index: var(--z-dialog); height: 100vh; height: 100dvh; display: flex; flex-direction: column; background: rgba(6, 6, 7, 0.95); color: #eeece7; opacity: 0; transition: opacity 0.25s var(--ease); }
.lightbox.is-open { opacity: 1; }
.lightbox__bar { flex: none; height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 var(--gutter); }
.lightbox .icon-btn { color: #c9c6bf; border-color: rgba(255, 255, 255, 0.2); background: rgba(10, 10, 11, 0.6); }
.lightbox .icon-btn:hover { color: #fff; border-color: rgba(255, 255, 255, 0.5); }
.lightbox__count { font-family: var(--mono); font-size: 0.8rem; color: #9d9991; }
.lightbox__tools { display: flex; gap: 8px; }
.lightbox__stage { position: relative; flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 72px; overflow: hidden; }
.lightbox__stage img {
  display: block; width: auto; height: auto;
  max-width: min(1400px, calc(100vw - 160px));
  max-height: calc(100vh - 160px); max-height: calc(100dvh - 160px);
  object-fit: contain; border-radius: 2px; transition: opacity 0.25s; cursor: zoom-in;
}
.lightbox__stage img.is-loading { opacity: 0.35; }
.lightbox.is-zoomed .lightbox__stage { overflow: auto; display: block; padding: 0 16px 16px; overscroll-behavior: contain; }
.lightbox.is-zoomed .lightbox__stage img { max-height: none; max-width: min(1400px, 100%); margin-inline: auto; cursor: zoom-out; }
.lightbox.is-zoomed .lightbox__nav { display: none; }
.lightbox__nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; }
.lightbox__nav--prev { left: 14px; }
.lightbox__nav--next { right: 14px; }
.lightbox__info { flex: none; min-height: 72px; padding: 12px var(--gutter) 18px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; align-items: center; }
.lightbox__info b { font-size: 1.02rem; font-weight: 650; }
.lightbox__info span { font-family: var(--mono); font-size: 0.78rem; color: #9d9991; margin-left: 10px; }
.lightbox__links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.lightbox__links a { color: #d6d3cc; font-size: 0.88rem; display: inline-flex; gap: 6px; align-items: center; border-bottom: 1px solid rgba(255, 255, 255, 0.2); }
.lightbox__links a:hover { color: #fff; border-color: #fff; }
.lightbox__links a.is-verify { color: #ff6a5e; border-color: rgba(255, 106, 94, 0.5); }
@media (max-width: 639px) {
  .lightbox__stage { padding: 0 8px 60px; }
  .lightbox__stage img { max-width: calc(100vw - 16px); max-height: calc(100vh - 220px); max-height: calc(100dvh - 220px); }
  .lightbox__nav { top: auto; bottom: 8px; transform: none; width: 44px; height: 44px; }
  .lightbox__nav--prev { left: auto; right: 64px; }
  .lightbox__nav--next { right: 12px; }
}

/* Organizations directory */
.top50 { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.top50 li { position: relative; background: var(--bg); padding: 16px 18px; display: grid; grid-template-columns: 2.6ch minmax(0, 1fr); gap: 2px 12px; align-content: start; transition: background-color 0.2s; }
.top50 li:hover { background: var(--surface); }
.top50 .rank { grid-row: span 3; font-family: var(--mono); font-size: 0.74rem; color: var(--text-3); padding-top: 3px; }
.top50 b { font-weight: 650; font-size: 0.96rem; line-height: 1.3; }
.top50 b a { display: inline-flex; align-items: center; gap: 4px; }
.top50 b a:hover { color: var(--red); }
.top50 b .ic { width: 13px; height: 13px; color: var(--text-3); }
.top50 span { font-family: var(--mono); font-size: 0.72rem; color: var(--text-3); }
.top50 .top50__first { color: var(--red); margin-top: 4px; }
.top50 li.is-first { box-shadow: inset 2px 0 0 var(--red); }
.dir { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.dir th { position: sticky; top: calc(var(--nav-h) + var(--toolbar-h, 69px)); z-index: 5; background: var(--bg); text-align: left; font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); font-weight: 500; padding: 12px 12px; border-bottom: 1px solid var(--line-2); }
.dir td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.dir tbody tr { transition: background-color 0.15s; }
.dir tbody tr:hover { background: var(--surface); }
.dir tr.is-first td:first-child { box-shadow: inset 2px 0 0 var(--red); }
.dir .org b { font-weight: 650; display: block; line-height: 1.3; }
.dir .org span { font-family: var(--mono); font-size: 0.74rem; color: var(--text-3); }
.dir .org em { display: block; font-style: normal; font-size: 0.8rem; color: var(--text-2); margin-top: 2px; }
/* What I reported to the organization, under its name. Red because it is the finding,
   not the recognition: the badges in the next column are what they gave back. */
.dir .org .found { display: block; margin-top: 4px; font-family: var(--mono); font-size: 0.7rem;
  letter-spacing: 0.02em; color: var(--red); }
.dir .sec, .dir .ctry { color: var(--text-2); white-space: nowrap; }
.badges, .proofs { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { font-size: 0.72rem; padding: 2px 8px; border: 1px solid var(--line-2); color: var(--text-2); white-space: nowrap; border-radius: 2px; }
.badge--first { border-color: var(--red-line); color: var(--red); background: var(--red-soft); font-weight: 600; }
.verify { display: inline-flex; align-items: center; gap: 4px; font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.02em; padding: 3px 8px; border: 1px solid var(--red-line); color: var(--red); white-space: nowrap; border-radius: 2px; transition: background-color 0.2s; }
.verify:hover { background: var(--red-soft); }
.verify .ic { width: 12px; height: 12px; }
.verify--soft { border-color: var(--line-2); color: var(--text-2); }
.verify--soft:hover { background: var(--surface-2); }
.dir-wrap { padding-bottom: 80px; }
@media (max-width: 767px) {
  .dir thead { display: none; }
  .dir, .dir tbody, .dir tr, .dir td { display: block; }
  .dir tr { padding: 14px 0 14px 10px; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
  .dir tr.is-first { box-shadow: inset 2px 0 0 var(--red); }
  .dir tr.is-first td:first-child { box-shadow: none; }
  .dir td { padding: 0; border: 0; }
  .dir .org, .dir td.badges-cell, .dir td.proof-cell { flex: 1 0 100%; }
  .dir .sec::after { content: ","; }
  .dir td.badges-cell { margin-top: 4px; }
  .dir td.proof-cell:has(.proofs:empty) { display: none; }
}

/* 404 */
.notfound { min-height: calc(100dvh - var(--nav-h) - 160px); display: grid; place-items: center; text-align: center; padding: 64px var(--gutter); }
.notfound h1 { font-family: var(--stencil); font-weight: 800; font-size: clamp(6rem, 3rem + 14vw, 14rem); line-height: 0.9; }
.notfound h1 span { display: inline-block; line-height: 0.86; color: var(--red); outline: 4px solid var(--red); padding: 0.06em 0.06em 0; margin-inline: 0.04em; }
.notfound p { color: var(--text-2); margin: 20px auto 28px; max-width: 44ch; }
.notfound .actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

/* ---------- Print: the homepage prints as a clean summary ---------- */
@media print {
  :root { --bg: #fff; --bg-rgb: 255, 255, 255; --bg-2: #fff; --surface: #fff; --text: #000; --text-2: #333; --text-3: #555; --line: #ddd; --line-2: #bbb; --red: #b00; }
  body { padding-top: 0; }
  body::after, .nav, .hero__wall, .hero__light, .hero__shade, .hero__hint, .names, .desk, .map__visual, .palette, .toast, .skip, .footer, .cases__ctrl, .firsts { display: none !important; }
  .section, .cases__pin, .contact { padding-block: 24px; }
  .js [data-reveal], .js [data-enter] { opacity: 1 !important; transform: none !important; }
  .js .sh__title[data-reveal] { color: #000 !important; }
  .js .sh__title[data-reveal]::after { display: none; }
  .scope { display: block; height: auto; }
  .scope__body[hidden] { display: grid !important; }
  .cases__track { flex-wrap: wrap; width: auto; transform: none !important; }
  .case { break-inside: avoid; }
  a { text-decoration: underline; }
}
