/* v12 — evidence, plain copy, fewer props */
:root {
  --bg: #1b1b1b;
  --ink: #ececea;
  --soft: #d6d6d3;
  --mute: #bdbdb9;
  --line: #4a4a48;
  --red: #d4332f;
  --red-t: #ea5550;
  --code: #0e0e0e;
  --paper: #e8e6e0;
  --p-ink: #161616;
  --p-mute: #4a4945;
  --p-line: #b9b7b0;
  --p-red: #b02824;
  --g: clamp(16px, 5vw, 72px);
  --cw: min(1144px, 100vw - 2 * var(--g));
  --col-gap: clamp(16px, 2.1vw, 24px);
  --disp: 'Oswald', 'Arial Narrow', sans-serif;
  --text: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}


*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html:focus-within { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol, dl, dd, figure, p, h1, h2, h3, pre { margin: 0; padding: 0; }
ul, ol { list-style: none; }
em, i { font-style: normal; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: var(--bg); padding: 8px 12px; z-index: 100; font-weight: 600; font-size: 13px; }
.skip:focus { top: 12px; }
.wrap { width: var(--cw); margin-inline: auto; }
.sep { color: #77776f; padding-inline: .5em; }

/* ---------- redaction bar ---------- */
.rd {
  display: inline-block;
  height: 1.02em;
  vertical-align: -.17em;
  background: var(--ink);
  clip-path: inset(0 1px 1px 0);
  transform-origin: left center;
}
.rd-2 { width: 2ch; }
.rd-4 { width: 4ch; }
.rd-8 { width: 8ch; }

/* ---------- top bar ---------- */
.top {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 26px max(var(--g), (100% - 1144px) / 2);
  font: 600 13px/1 var(--text);
  letter-spacing: .02em;
  text-transform: uppercase;
}
.logo { color: var(--ink); margin-right: auto; }
.nav ul { display: flex; gap: 18px; }
.nav a { color: var(--mute); transition: color .2s; }
.nav a:hover, .logo:hover { color: var(--ink); }
.nav a, .logo { padding-block: 6px; }

/* ---------- hero ---------- */
.hero { padding-top: clamp(96px, 9vw, 128px); }
.hero .wrap { container-type: inline-size; }
.dossier {
  display: flex; flex-wrap: wrap; align-items: baseline; row-gap: 6px;
  font: 500 14px/1.4 var(--mono);
  color: var(--soft);
  letter-spacing: .02em;
}
.dossier .k { color: #8f8f8a; margin-right: .6ch; }
.dossier .sep { padding-inline: 1.2ch; }
.mega {
  font: 700 28.7cqi/.8 var(--disp);
  text-transform: uppercase;
  color: var(--red);
  white-space: nowrap;
  letter-spacing: -.012em;
  margin: clamp(10px, 1.4vw, 20px) 0 0 -.03em;
  padding: .06em 0 .08em;
  overflow: hidden;
}
.mega span { display: inline-block; }

.stage { margin-top: clamp(24px, 3vw, 44px); }

.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.blk { background: var(--code); padding: 18px 0 20px; min-width: 0; }
.blk + .blk { border-left: 1px solid #2e2e2c; }
.lab {
  font: 500 13px/1 var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink);
  padding: 0 22px 16px 22px;
}
.vul .lab { color: var(--red-t); }
.code {
  font: 400 clamp(14px, 1.05vw, 15px)/1.62 var(--mono);
  color: #e6e6e3;
  counter-reset: ln;
  tab-size: 4;
}
.code code { font: inherit; display: block; }
.ln {
  display: block;
  position: relative;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 1px 22px 1px calc(22px + 4ch + 8ch);
  text-indent: -8ch;
  counter-increment: ln;
}
.ln::before {
  content: counter(ln) / "";
  position: absolute;
  left: 22px;
  top: 1px;
  width: 2ch;
  text-indent: 0;
  text-align: right;
  color: #85857f;
}
.nw { white-space: nowrap; }
.ln.hit, .ln.ok { background: rgba(255, 255, 255, .035); }
.ln.hit::after, .ln.ok::after { content: ""; position: absolute; top: 0; bottom: 0; }
.ln.hit::after { left: 0; width: 4px; background: var(--red); }
.ln.ok::after { left: 7px; width: 2px; background: #cfcfcb; }
.kw { color: #a9a9a4; }
.st { color: #d8cfb8; }

.status {
  grid-column: 1 / -1;
  display: flex; flex-wrap: wrap; align-items: baseline; row-gap: 6px;
  margin-top: 16px;
  font: 500 13px/1.5 var(--mono);
  color: var(--soft);
}
.status code { font: inherit; color: var(--ink); }
.status .src { margin-left: auto; padding-left: 24px; color: var(--mute); border-bottom: 1px solid transparent; transition: color .2s, border-color .2s; }
.status .src:hover { color: var(--red-t); border-color: var(--red-t); }

/* drawn marks: the bundled font subsets have no check / cross / NE arrow */
.mk { display: inline-block; position: relative; width: .72em; height: .72em; margin-inline: .2em; vertical-align: -.04em; }
.mk-x { background: linear-gradient(45deg, transparent calc(50% - .75px), currentColor calc(50% - .75px) calc(50% + .75px), transparent calc(50% + .75px)), linear-gradient(-45deg, transparent calc(50% - .75px), currentColor calc(50% - .75px) calc(50% + .75px), transparent calc(50% + .75px)); }
.mk-ok::before { content: ""; position: absolute; left: .2em; top: -.02em; width: .3em; height: .58em; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(40deg); }
.ar {
  display: inline-block;
  width: .56em; height: .56em;
  margin-left: .25em;
  vertical-align: .08em;
  border-top: 1.5px solid; border-right: 1.5px solid;
  background: linear-gradient(to bottom right, transparent calc(50% - .75px), currentColor calc(50% - .75px) calc(50% + .75px), transparent calc(50% + .75px));
}

.intro {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--col-gap);
  row-gap: 24px;
  margin-top: clamp(40px, 4.4vw, 64px);
}
h1 {
  grid-column: 1 / 8;
  font: 600 clamp(28px, 3.3vw, 48px)/1.1 var(--text);
  letter-spacing: -.024em;
  text-wrap: balance;
}
.intro-r { grid-column: 8 / 13; padding-top: .35em; }
.lede { font-size: clamp(16px, 1.25vw, 18px); line-height: 1.55; color: var(--soft); max-width: 30em; text-wrap: pretty; }
.acts { display: flex; flex-wrap: wrap; gap: 28px; margin-top: clamp(20px, 2vw, 28px); font: 600 14px/1 var(--text); text-transform: uppercase; letter-spacing: .04em; }
.acts a { display: inline-block; padding: 6px 0 7px; border-bottom: 1px solid var(--line); transition: color .2s, border-color .2s; }
.acts a:hover { color: var(--red-t); border-color: var(--red-t); }

.ev { margin: 0; }
.ev img { width: 100%; height: auto; }


/* dot-separated lists: the leading dot of each row is clipped, so a dot never starts or ends a line */
.dots { overflow: hidden; font: 500 13px/1.7 var(--mono); color: var(--mute); }
.dots ul { display: flex; flex-wrap: wrap; margin-left: -3ch; }
.dots li { position: relative; padding-left: 3ch; }
.dots li::before { content: "·" / ""; position: absolute; left: 1ch; width: 1ch; text-align: center; color: #77776f; }

/* ---------- sections ---------- */
.sec { padding-top: clamp(88px, 9vw, 140px); }
#case { padding-top: clamp(72px, 7vw, 112px); }
.sec-head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 20px;
  margin-bottom: clamp(32px, 4.4vw, 64px);
}
.title {
  font: 600 clamp(30px, 4.6vw, 64px)/.9 var(--disp);
  text-transform: uppercase;
  color: var(--ink);
  letter-spacing: -.01em;
}
.sub { font: 500 13px/1.3 var(--mono); color: var(--mute); padding-bottom: .3em; text-align: right; }

/* tools */
.tools { border-top: 1px solid var(--line); }
.tools li {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "h pf" "d m";
  gap: 14px clamp(16px, 2vw, 28px);
  align-items: baseline;
  padding: clamp(22px, 2.4vw, 32px) 0 clamp(20px, 2.2vw, 28px);
  border-bottom: 1px solid var(--line);
}
.tools h3 { grid-area: h; font: 600 clamp(36px, 6.6vw, 92px)/.92 var(--disp); text-transform: uppercase; letter-spacing: -.005em; }
.tools h3 a { transition: color .2s; }
.tools h3 a::after { content: ""; position: absolute; inset: 0; }
.tools li:hover h3 a, .tools h3 a:focus-visible { color: var(--red-t); }
.tools h3 a:focus-visible { outline: 0; }
.tools li:has(a:focus-visible) { outline: 2px solid var(--red); outline-offset: 4px; }
.tools .pf { grid-area: pf; font: 500 15px/1.3 var(--mono); color: var(--ink); text-align: right; white-space: nowrap; }
.tools .d { grid-area: d; font-size: 16px; line-height: 1.5; color: var(--soft); max-width: 40em; text-wrap: pretty; }
.tools .m { grid-area: m; font: 500 13px/1.4 var(--mono); color: var(--mute); text-align: right; white-space: nowrap; }
.tools .m::after {
  content: ""; display: inline-block;
  width: .62em; height: .62em; margin-left: 1.2ch; vertical-align: .02em;
  color: var(--ink);
  border-top: 1.5px solid; border-right: 1.5px solid;
  background: linear-gradient(to bottom right, transparent calc(50% - .75px), currentColor calc(50% - .75px) calc(50% + .75px), transparent calc(50% + .75px));
  transition: transform .2s, color .2s;
}
.tools li:hover .m::after { color: var(--red-t); transform: translate(2px, -2px); }

/* ctf */
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.board li { padding: clamp(18px, 2vw, 28px) var(--col-gap) 0 0; min-width: 0; }

.big { font: 600 clamp(72px, 8vw, 120px)/.8 var(--disp); letter-spacing: -.02em; margin-left: -.04em; padding-top: .06em; }
.cap { margin-top: clamp(14px, 1.4vw, 20px); font: 500 13px/1.45 var(--mono); color: var(--soft); }
.ai { margin-top: 4px; font: 500 13px/1.45 var(--mono); color: var(--mute); }
.rank { margin-top: clamp(28px, 3vw, 40px); font: 400 clamp(17px, 1.4vw, 20px)/1.45 var(--text); color: var(--soft); }
.ctf-grid { display: grid; grid-template-columns: minmax(0, 4.5fr) minmax(0, 7fr); gap: clamp(36px, 6vw, 96px); align-items: start; margin-top: clamp(40px, 4.4vw, 64px); }
.ctf-p { font: 400 clamp(19px, 1.7vw, 24px)/1.38 var(--text); letter-spacing: -.01em; color: #dededb; }
.disc { margin-top: 28px; }
.links-inline { display: flex; gap: 28px; margin-top: 24px; font: 600 14px/1 var(--text); text-transform: uppercase; letter-spacing: .04em; }
.links-inline a { display: inline-block; border-bottom: 1px solid var(--line); padding: 4px 0 6px; transition: color .2s, border-color .2s; }
.links-inline a:hover { color: var(--red-t); border-color: var(--red-t); }

table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
caption { caption-side: top; text-align: left; padding-bottom: 20px; font: 500 13px/1.4 var(--mono); color: var(--mute); }
thead th { font: 500 13px/1 var(--mono); color: var(--mute); text-align: left; padding: 0 0 14px; border-bottom: 1px solid var(--line); }
tbody td, tbody th { padding: 15px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: baseline; }
tbody th { font: 500 clamp(17px, 1.5vw, 20px)/1.3 var(--text); }
td.pl { font: 600 clamp(26px, 2.6vw, 36px)/1 var(--disp); width: 20%; }
td.r, th.r { text-align: right; white-space: nowrap; padding-left: 16px; }
tbody td.r { font: 400 15px/1 var(--mono); color: var(--soft); }
thead th.r { padding-left: 16px; }

/* case: paper sheet */
.sheet {
  background: var(--paper);
  color: var(--p-ink);
  padding: clamp(22px, 3.4vw, 52px) clamp(20px, 3.4vw, 52px) clamp(28px, 3.6vw, 56px);
}
.sheet-h {
  position: relative;
  padding-bottom: clamp(18px, 2vw, 26px);
  border-bottom: 1px solid var(--p-line);
}
.file { font: 500 14px/1.3 var(--mono); letter-spacing: .06em; color: var(--p-mute); }
.stamp {
  position: absolute;
  right: clamp(8px, 3vw, 40px);
  bottom: 0;
  transform: translateY(52%) rotate(-4deg);
  font: 600 clamp(30px, 3.6vw, 52px)/1 var(--disp);
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--p-red);
  background: var(--paper);
  border: 2px solid var(--p-red);
  padding: .14em .3em .1em;
  white-space: nowrap;
}
.sheet-b {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  grid-template-rows: auto 1fr;
  grid-template-areas: "t ph" "note ph";
  column-gap: clamp(28px, 4vw, 64px);
  align-items: start;
  padding-top: clamp(56px, 6vw, 88px);
}
.sheet-t { grid-area: t; }
.sheet h3 { font: 600 clamp(28px, 3vw, 44px)/1.06 var(--disp); text-transform: uppercase; letter-spacing: -.003em; text-wrap: balance; }
.sheet-p { margin-top: 20px; font-size: 16px; line-height: 1.6; color: #2a2a28; max-width: 34em; text-wrap: pretty; }
.clone { margin-top: 26px; font: 500 15px/1.4 var(--mono); color: var(--p-ink); white-space: nowrap; }
.sheet .rd { background: #121212; }
.ev-red { grid-area: ph; }
.ev-red img { aspect-ratio: 16 / 11; object-fit: cover; object-position: 50% 45%; outline: 1px solid rgba(0, 0, 0, .16); outline-offset: -1px; }
.note { grid-area: note; align-self: end; margin-top: 32px; font: 500 13px/1.4 var(--mono); color: var(--p-mute); }

/* end */
.end { padding-top: clamp(72px, 7vw, 112px); container-type: inline-size; }
.end-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 0 clamp(32px, 6vw, 96px); align-items: start; }
.end-grid .title { grid-column: 1 / -1; margin-bottom: clamp(32px, 4.4vw, 64px); }
.end-p { margin-top: 0; padding-top: 14px; font-size: clamp(17px, 1.4vw, 20px); line-height: 1.45; color: var(--soft); }
.contacts { border-top: 1px solid var(--line); }
.contacts > div { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 16px; align-items: baseline; padding: 16px 0; border-bottom: 1px solid var(--line); }
.contacts dt { font: 500 13px/1.3 var(--mono); color: var(--mute); }
.contacts dd { font: 500 clamp(18px, 1.6vw, 22px)/1.3 var(--text); }
.contacts a { border-bottom: 1px solid transparent; transition: color .2s, border-color .2s; }
.contacts a:hover { color: var(--red-t); border-color: var(--red-t); }
.eof {
  font: 700 28.7cqi/.8 var(--disp);
  color: var(--ink);
  letter-spacing: -.012em;
  margin: clamp(72px, 8vw, 128px) 0 0 -.03em;
  padding: .06em 0 .02em;
  white-space: nowrap;
}

.foot {
  display: flex; justify-content: flex-start; align-items: center; flex-wrap: wrap; gap: 12px 16px;
  margin-top: clamp(36px, 4vw, 56px);
  padding: 22px 0 30px;
  border-top: 1px solid var(--line);
  font: 500 13px/1.4 var(--mono); color: var(--mute);
}
.foot .rd { background: var(--mute); }

/* ---------- motion (JS + no reduced-motion only) ---------- */
html.motion .mega span { transform: translateY(105%); transition: transform 1s cubic-bezier(.2,.8,.2,1); }
html.motion.ready .mega span { transform: none; }
html.motion .dossier .rd { transform: scaleX(0); transition: transform .3s cubic-bezier(.6,0,.2,1) .7s; }
html.motion.ready .dossier .rd { transform: none; }
html.motion .mega span:nth-child(2) { transition-delay: .05s; }
html.motion .mega span:nth-child(3) { transition-delay: .1s; }
html.motion .mega span:nth-child(4) { transition-delay: .15s; }
html.motion .mega span:nth-child(5) { transition-delay: .2s; }
html.motion .mega span:nth-child(6) { transition-delay: .25s; }
html.motion .mega span:nth-child(7) { transition-delay: .3s; }
html.motion .stage { opacity: 0; transition: opacity .8s ease .45s; }
html.motion.ready .stage { opacity: 1; }
html.motion [data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.8,.2,1); }
html.motion [data-reveal].in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html:focus-within { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- responsive ---------- */
@media (max-width: 1023px) {
  .ctf-grid { grid-template-columns: 1fr; }
  .end-grid { grid-template-columns: 1fr; }
  .end-p { margin: 0 0 32px; }
}

@media (max-width: 899px) {
  .pair { grid-template-columns: 1fr; }
  .blk + .blk { border-left: 0; border-top: 1px solid #2e2e2c; }
  .intro { display: block; }
  .intro-r { padding-top: 0; margin-top: 22px; }
  .lede { max-width: 36em; }
}

@media (max-width: 759px) {
  .top { padding: 18px 16px; gap: 14px; }
  .nav ul { gap: clamp(12px, 4vw, 18px); }
  .hero { padding-top: 88px; }
  .blk { padding: 14px 0 16px; }
  .lab { padding: 0 12px 12px; }
  .code { font-size: 13px; letter-spacing: -.01em; }
  .ln { padding: 1px 10px 1px calc(12px + 3ch + 8ch); text-indent: -8ch; }
  .ln::before { left: 10px; }
  .ln.ok::after { left: 4px; }
  .status { flex-direction: column; row-gap: 2px; }
  .status .sep { display: none; }
  .dossier { font-size: 13px; column-gap: 2.4ch; }
  .dossier .sep { display: none; }
  .status .src { margin: 8px 0 0; padding-left: 0; }
  .sec-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .sub { text-align: left; }
  .tools li { grid-template-columns: 1fr; grid-template-areas: "h" "pf" "d" "m"; gap: 10px; padding: 22px 0; }
  .tools h3 { font-size: clamp(32px, 10vw, 44px); }
  .tools .pf, .tools .m { text-align: left; white-space: normal; }
  .tools .d { font-size: 15px; }
  .board { grid-template-columns: 1fr; }
  .board li { display: grid; grid-template-columns: 3.2rem minmax(0, 1fr); grid-template-rows: 1fr auto auto; column-gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
  .big { grid-row: 1 / 4; font-size: 64px; }
  .cap { margin: 0; grid-column: 2; grid-row: 2; }
  .ai { grid-column: 2; grid-row: 3; }
  .rank { margin-top: 24px; }
  td.pl { width: 16%; }
  tbody td.r { font-size: 14px; }
  .sheet-b { grid-template-columns: 1fr; grid-template-rows: none; grid-template-areas: "t" "ph" "note"; padding-top: 28px; }
  .ev-red { margin-top: 28px; }
  .stamp { position: static; display: inline-block; margin-top: 14px; transform: rotate(-4deg); font-size: 28px; }
  .sheet-h { padding-bottom: 20px; }
  .contacts > div { grid-template-columns: 1fr; gap: 6px; }
}
