/* ============================================================================
   Resolving the PatchGAN Paradox - BraTS 2020
   Retro scientific instrument. Dark = amber CRT console. Light = lab report
   printed on manila stock. One superfamily (IBM Plex), square corners,
   hairline rules, mono chrome.
   ========================================================================== */

/* ---------- tokens ---------- */
:root {
  /* ---- light : printed lab report ---- */
  --bg:        #f1ede2;
  --bg-alt:    #e8e2d3;
  --surface:   #fbf8f0;
  --surface-2: #f2ede0;
  --plate:     #fbf9f3;   /* figure stock - identical in both themes */
  --text:      #191713;
  --text-2:    #48423a;
  --muted:     #7c7568;
  --border:    #dcd3c0;
  --border-2:  #c4b9a1;
  --grid:      rgba(140,120,75,.16);
  --scan:      transparent;

  --accent:    #b0600a;   /* burnt amber ink */
  --accent-2:  #f7ecd7;
  --on-accent: #fbf8f0;
  --cyan:      #0d6670;
  --ok:        #2c7538;
  --warn:      #92620a;
  --bad:       #ab3728;
  --glow:      none;

  --c-nec: #ab3728;   /* necrotic / non-enhancing core */
  --c-ede: #2c7538;   /* peritumoral edema             */
  --c-enh: #96700a;   /* GD-enhancing tumour           */

  --m-a:     #736e67;   /* Model A - baseline            */
  --m-b:     #ab3728;   /* Model B - checkerboard        */
  --m-c:     #67429c;   /* Model C - the paradox         */
  --m-d:     #b0600a;   /* Model D - the goldilocks zone */
  --m-clahe: #0d6670;   /* Model D + CLAHE               */

  /* aliases kept so existing markup keeps working */
  --m-unet:  #736e67;
  --m-4x4:   #b0600a;
  --m-enh:   #0d6670;
  --m-3x3:   #ab3728;
  --m-3x3ii: #67429c;

  --ff-sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --ff-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ff-display: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --wrap: 1080px;
  --wrap-wide: 1300px;
  --radius: 3px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:        #0a0b0d;
    --bg-alt:    #0e1013;
    --surface:   #121519;
    --surface-2: #181c21;
    --text:      #e7e3d8;
    --text-2:    #b2ada0;
    --muted:     #7a7d82;
    --border:    #23282e;
    --border-2:  #343b43;
    --grid:      rgba(245,165,36,.085);
    --scan:      rgba(255,255,255,.022);

    --accent:    #f5a524;
    --accent-2:  #241a09;
    --on-accent: #0a0b0d;
    --cyan:      #4fd1c5;
    --ok:        #5ec46a;
    --warn:      #f5a524;
    --bad:       #ef6f5e;
    --glow:      0 0 22px -6px rgba(245,165,36,.55);

    --c-nec: #ef6f5e;
    --c-ede: #5ec46a;
    --c-enh: #f5c724;

    --m-a:     #8b8e93;
    --m-b:     #ef6f5e;
    --m-c:     #b07dd8;
    --m-d:     #f5a524;
    --m-clahe: #4fd1c5;

    --m-unet:  #8b8e93;
    --m-4x4:   #f5a524;
    --m-enh:   #4fd1c5;
    --m-3x3:   #ef6f5e;
    --m-3x3ii: #b07dd8;
  }
}

:root[data-theme="dark"] {
  --bg:        #0a0b0d;
  --bg-alt:    #0e1013;
  --surface:   #121519;
  --surface-2: #181c21;
  --text:      #e7e3d8;
  --text-2:    #b2ada0;
  --muted:     #7a7d82;
  --border:    #23282e;
  --border-2:  #343b43;
  --grid:      rgba(245,165,36,.085);
  --scan:      rgba(255,255,255,.022);

  --accent:    #f5a524;
  --accent-2:  #241a09;
  --on-accent: #0a0b0d;
  --cyan:      #4fd1c5;
  --ok:        #5ec46a;
  --warn:      #f5a524;
  --bad:       #ef6f5e;
  --glow:      0 0 22px -6px rgba(245,165,36,.55);

  --c-nec: #ef6f5e;
  --c-ede: #5ec46a;
  --c-enh: #f5c724;

  --m-a:     #8b8e93;
  --m-b:     #ef6f5e;
  --m-c:     #b07dd8;
  --m-d:     #f5a524;
  --m-clahe: #4fd1c5;

  --m-unet:  #8b8e93;
  --m-4x4:   #f5a524;
  --m-enh:   #4fd1c5;
  --m-3x3:   #ef6f5e;
  --m-3x3ii: #b07dd8;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 7rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--ff-sans);
  font-size: 16.5px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 { color: var(--text); line-height: 1.18; margin: 0 0 .6em; }
h1 {
  font-family: var(--ff-mono); font-weight: 500;
  font-size: clamp(1.85rem, 4.5vw, 2.95rem); letter-spacing: -.035em;
}
h2 {
  font-family: var(--ff-mono); font-weight: 500;
  font-size: clamp(1.38rem, 2.9vw, 1.82rem); letter-spacing: -.028em;
}
h3 { font-family: var(--ff-sans); font-size: 1.08rem; font-weight: 600; letter-spacing: -.008em; }
h4 { font-family: var(--ff-sans); font-size: .95rem; font-weight: 600; }
p  { margin: 0 0 1.05em; color: var(--text-2); }
a  { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
strong, b { color: var(--text); font-weight: 600; }
hr { border: 0; border-top: 1px dashed var(--border-2); margin: 3rem 0; }
img { max-width: 100%; height: auto; display: block; }
code { font-family: var(--ff-mono); font-size: .86em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
::selection { background: var(--accent); color: var(--on-accent); }

/* ---------- layout ---------- */
.wrap  { max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(1.1rem, 4vw, 2rem); }
.wrap-wide { max-width: var(--wrap-wide); margin-inline: auto; padding-inline: clamp(1.1rem, 4vw, 2rem); }
section { padding-block: clamp(3rem, 7vw, 5rem); position: relative; }
section + section { border-top: 1px solid var(--border); }
.lede { font-size: 1.1rem; color: var(--text-2); max-width: 66ch; }
.narrow { max-width: 74ch; }

/* auto-numbered section eyebrows - [01] [02] ... */
main { counter-reset: sec; }
main > section { counter-increment: sec; }
.eyebrow {
  font-family: var(--ff-mono); font-size: .69rem; font-weight: 500;
  letter-spacing: .2em; text-transform: uppercase; color: var(--muted);
  margin: 0 0 1rem; display: block;
}
.eyebrow::before {
  content: "[" counter(sec, decimal-leading-zero) "]";
  color: var(--accent); margin-right: .7em; letter-spacing: .1em;
}
.eyebrow.plain::before { content: none; }

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-head .bar { display: flex; align-items: center; gap: 1rem; height: 56px; }

.brand { display: flex; align-items: center; gap: .6rem; color: var(--text); font-size: .88rem; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 19px; height: 19px; flex: none; color: var(--accent); }
.brand .name { font-family: var(--ff-mono); font-weight: 600; letter-spacing: -.02em; }
.brand .sub { color: var(--muted); font-weight: 400; font-family: var(--ff-mono); font-size: .78rem; }
@media (max-width: 700px) { .brand .sub { display: none; } }

nav.main { margin-left: auto; display: flex; align-items: center; gap: .1rem; }
nav.main a {
  font-family: var(--ff-mono); color: var(--text-2); font-size: .755rem;
  letter-spacing: .07em; text-transform: uppercase;
  padding: .4rem .55rem; border-radius: 2px; white-space: nowrap;
  border-bottom: 1px solid transparent;
}
nav.main a:hover { color: var(--text); text-decoration: none; border-bottom-color: var(--border-2); }
nav.main a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }

.icon-btn {
  display: grid; place-items: center; width: 30px; height: 30px; flex: none;
  border: 1px solid var(--border-2); border-radius: 2px; background: var(--surface);
  color: var(--text-2); cursor: pointer; padding: 0;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.icon-btn svg { width: 14px; height: 14px; }
#navToggle { display: none; margin-left: .3rem; }

/* status strip */
.status {
  border-top: 1px solid var(--border); background: var(--bg-alt);
  font-family: var(--ff-mono); font-size: .645rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--muted);
  height: 26px; overflow: hidden; white-space: nowrap;
}
.status .row { display: flex; align-items: center; gap: 1.5rem; height: 26px; }
.status b { color: var(--text-2); font-weight: 500; }
.status .led {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  box-shadow: var(--glow); flex: none;
}
@media (max-width: 900px) { .status { display: none; } }

@media (max-width: 980px) {
  #navToggle { display: grid; }
  nav.main {
    position: fixed; inset: 56px 0 auto; flex-direction: column; align-items: stretch;
    gap: 0; background: var(--bg); border-bottom: 1px solid var(--border);
    padding: .4rem clamp(1.1rem, 4vw, 2rem) .9rem; margin-left: auto;
    max-height: calc(100dvh - 56px); overflow-y: auto;
  }
  nav.main:not(.open) { display: none; }
  nav.main a { padding: .68rem .2rem; font-size: .84rem; border-bottom: 1px solid var(--border); }
  nav.main a:last-child { border-bottom: 0; }
}

/* ---------- hero ---------- */
.hero {
  padding-block: clamp(3rem, 7.5vw, 5.5rem) clamp(2.4rem, 5.5vw, 3.6rem);
  border-bottom: 1px solid var(--border);
  position: relative; overflow: hidden;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 34px 34px;
  background-position: center top;
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(115% 95% at 22% -25%, transparent 0%, transparent 30%, var(--bg) 88%);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(to bottom, var(--scan) 0 1px, transparent 1px 3px);
}
.hero > * { position: relative; z-index: 1; }
.hero h1 { max-width: 21ch; margin-bottom: .45em; }
.hero h1::after {
  content: "_"; color: var(--accent); margin-left: .04em;
  animation: caret 1.15s steps(1) infinite;
}
@keyframes caret { 0%, 55% { opacity: 1; } 56%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .hero h1::after { animation: none; } }
.hero .lede { font-size: clamp(1.02rem, 1.9vw, 1.16rem); }

.hero-meta {
  display: flex; flex-wrap: wrap; gap: .45rem 1.6rem; margin-top: 2rem;
  font-family: var(--ff-mono); font-size: .74rem; color: var(--muted);
  padding-top: 1.1rem; border-top: 1px dashed var(--border-2);
}
.hero-meta b {
  color: var(--accent); font-weight: 500; letter-spacing: .1em;
  text-transform: uppercase; font-size: .655rem; margin-right: .15em;
}
.cta-row { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 2rem; }

/* split hero : copy left, evidence right */
.hero-split {
  display: grid; align-items: center;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1.8rem, 4.5vw, 3.6rem);
}
@media (max-width: 1000px) { .hero-split { grid-template-columns: minmax(0, 1fr); gap: 2.4rem; } }
.hero-split .lede { max-width: 46ch; }
.hero-split h1 { max-width: 18ch; font-size: clamp(1.8rem, 3.4vw, 2.5rem); }

.hero-fig { margin: 0; }
.triptych { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; }
.triptych .fig { aspect-ratio: 1 / 1; }
.triptych .fig img { height: 100%; object-fit: cover; }
.triptych span {
  display: block; margin-top: .5rem; text-align: center;
  font-family: var(--ff-mono); font-size: .585rem; letter-spacing: .13em;
  text-transform: uppercase; color: var(--muted);
}
.triptych span.out { color: var(--accent); }
.triptych > div:last-child .fig { border-color: var(--accent); }
.hero-fig figcaption { margin-top: 1rem; font-size: .74rem; }


.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .55rem 1rem; border-radius: 2px;
  font-family: var(--ff-mono); font-size: .765rem; font-weight: 500;
  letter-spacing: .07em; text-transform: uppercase;
  border: 1px solid var(--border-2); background: var(--surface); color: var(--text);
  cursor: pointer; transition: border-color .14s, color .14s, background .14s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: var(--glow); }
.btn.primary:hover { filter: brightness(1.1); color: var(--on-accent); }
.btn svg { width: 14px; height: 14px; flex: none; }

/* ---------- cards & grids ---------- */
.grid { display: grid; gap: 1rem; }
.grid.g2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.grid.g3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.grid.g4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem 1.35rem; position: relative;
}
.card h3 { margin-bottom: .45rem; }
.card p:last-child { margin-bottom: 0; }
a.card { color: inherit; display: block; transition: border-color .14s, transform .14s; }
a.card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); }
a.card:hover h3 { color: var(--accent); }
a.card::after {
  content: "\2192"; position: absolute; top: 1.05rem; right: 1.2rem;
  font-family: var(--ff-mono); color: var(--border-2); transition: color .14s, transform .14s;
}
a.card:hover::after { color: var(--accent); transform: translateX(3px); }

.card.model { border-left: 2px solid var(--mc, var(--border)); }
.card.model .tag { border-color: var(--mc, var(--border-2)); color: var(--mc, var(--muted)); }
.readout {
  font-family: var(--ff-mono); font-size: .735rem; color: var(--muted);
  letter-spacing: .02em; font-variant-numeric: tabular-nums;
  margin-top: .85rem; padding-top: .6rem; border-top: 1px dashed var(--border-2);
}


/* console readout tiles */
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.05rem 1.15rem; position: relative;
}
.stat::before, .stat::after {
  content: ""; position: absolute; width: 8px; height: 8px;
  border: 1px solid var(--border-2); pointer-events: none;
}
.stat::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.stat::after  { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.stat .k {
  font-family: var(--ff-mono); font-size: .645rem; letter-spacing: .17em;
  text-transform: uppercase; color: var(--muted); margin-bottom: .55rem;
}
.stat .v {
  font-family: var(--ff-mono); font-size: 1.7rem; font-weight: 500;
  letter-spacing: -.045em; color: var(--text); line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.stat .v small { font-size: .5em; color: var(--muted); margin-left: .18em; letter-spacing: 0; }
.stat .d { font-size: .77rem; color: var(--muted); margin-top: .5rem; line-height: 1.5; }
.stat.hl { border-color: var(--accent); background: var(--accent-2); }
.stat.hl::before, .stat.hl::after { border-color: var(--accent); }
.stat.hl .v { color: var(--accent); }
.stat.hl .k { color: var(--accent); }

/* ---------- tables ---------- */
.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .855rem; }
caption {
  caption-side: top; text-align: left; padding: .95rem 1.1rem .4rem;
  font-size: .755rem; color: var(--muted); font-family: var(--ff-mono); line-height: 1.6;
}
th, td { padding: .64rem .95rem; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
thead th {
  font-family: var(--ff-mono); font-size: .645rem; font-weight: 500; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted); background: var(--surface-2);
  border-bottom: 1px solid var(--border-2);
}
tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
td.num, th.num { text-align: right; font-family: var(--ff-mono); font-variant-numeric: tabular-nums; }
tr.best td { background: var(--accent-2) !important; }
tr.best td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
td .swatch { display: inline-block; width: 8px; height: 8px; margin-right: .6rem; }
td .wrapok { white-space: normal; }

/* ---------- figures : printed plates ---------- */
figure { margin: 1.7rem 0; }
.fig {
  border: 1px solid var(--border-2); border-radius: var(--radius);
  background: var(--plate); overflow: hidden; position: relative;
}
.fig img { width: 100%; cursor: zoom-in; }
figcaption {
  font-size: .785rem; color: var(--muted); margin-top: .75rem; line-height: 1.6;
  padding-left: .85rem; border-left: 1px solid var(--border-2);
}
figcaption b { color: var(--text-2); font-weight: 600; }
.fig-scroll { overflow: auto; max-height: 620px; }
.fig-scroll img { min-width: 620px; }
.fig.diagram { background: var(--surface); }

/* ---------- prose ---------- */
.prose h2 { margin-top: 2.8rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.prose h3 { margin-top: 2rem; color: var(--text); }
.prose > :first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.prose ul, .prose ol { color: var(--text-2); padding-left: 1.4rem; margin: 0 0 1.1em; }
.prose li { margin-bottom: .45em; }
.prose li::marker { color: var(--accent); font-family: var(--ff-mono); font-size: .85em; }
.prose a { text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; }
.prose a:hover { text-decoration-style: solid; }

.note {
  border: 1px solid var(--border); border-left: 2px solid var(--accent);
  background: var(--surface); padding: 1rem 1.2rem; border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.6rem 0; font-size: .885rem; color: var(--text-2);
}
.note p:last-child { margin-bottom: 0; }
.note b { color: var(--text); }
.note.warn { border-left-color: var(--warn); }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: .55rem 1.5rem; font-size: .855rem; margin: 0; }
.kv dt {
  font-family: var(--ff-mono); font-size: .69rem; color: var(--muted);
  letter-spacing: .1em; text-transform: uppercase; padding-top: .2rem;
}
.kv dd { margin: 0; color: var(--text-2); }

pre {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.15rem; overflow-x: auto; font-family: var(--ff-mono);
  font-size: .78rem; line-height: 1.65; color: var(--text-2); margin: 1.4rem 0;
}
pre code { font-size: inherit; }
p code, li code, td code, dd code, figcaption code {
  background: var(--surface-2); border: 1px solid var(--border);
  padding: .06em .34em; border-radius: 2px; color: var(--text);
}
a code { color: inherit; }

/* class legend chips */
.legend { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.legend li {
  display: inline-flex; align-items: center; gap: .5rem; font-size: .735rem;
  font-family: var(--ff-mono); color: var(--text-2);
  border: 1px solid var(--border); border-radius: 2px; padding: .2rem .6rem .2rem .45rem;
  background: var(--surface);
}
.legend i { width: 8px; height: 8px; flex: none; }

.tag {
  display: inline-block; font-family: var(--ff-mono); font-size: .62rem; letter-spacing: .13em;
  text-transform: uppercase; color: var(--muted); border: 1px solid var(--border-2);
  border-radius: 2px; padding: .16rem .45rem; vertical-align: middle;
}
.tag.ok   { color: var(--ok);     border-color: color-mix(in srgb, var(--ok) 55%, transparent); }
.tag.acc  { color: var(--accent); border-color: var(--accent); }
.tag.bad  { color: var(--bad);    border-color: color-mix(in srgb, var(--bad) 55%, transparent); }

/* ---------- charts ---------- */
.chart-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.2rem 1.3rem 1rem; position: relative;
}
.chart-head { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; margin-bottom: 1rem; }
.chart-head h3 { margin: 0; font-size: .95rem; font-family: var(--ff-mono); font-weight: 500; letter-spacing: -.02em; }
.chart-head .hint { font-family: var(--ff-mono); font-size: .665rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-left: auto; }
.chart-wrap { overflow-x: auto; }
.chart-wrap svg { display: block; width: 100%; min-width: 440px; height: auto; overflow: visible; }
.grid-line { stroke: var(--border); }
.axis-line { stroke: var(--border-2); }
.tick-label { fill: var(--muted); font-family: var(--ff-mono); font-size: 9.5px; }
.axis-title { fill: var(--muted); font-family: var(--ff-mono); font-size: 9px; letter-spacing: .14em; }
.series-line { fill: none; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.chart-legend { display: flex; flex-wrap: wrap; gap: .35rem .9rem; margin-top: .9rem; padding: 0; list-style: none; }
.chart-legend li { display: inline-flex; align-items: center; gap: .45rem; font-family: var(--ff-mono); font-size: .695rem; color: var(--text-2); cursor: pointer; user-select: none; }
.chart-legend li.off { opacity: .28; }
.chart-legend i { width: 13px; height: 2px; flex: none; }

/* bar comparison */
.barlist { list-style: none; margin: 0; padding: 0; }
.barlist li { display: grid; grid-template-columns: minmax(120px, 168px) 1fr max-content; gap: .85rem; align-items: center; padding: .4rem 0; font-size: .82rem; }
.barlist .lbl { font-family: var(--ff-mono); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .755rem; }
.barlist .track { height: 7px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.barlist .bar { display: block; height: 100%; min-width: 2px; }
.barlist .val { font-family: var(--ff-mono); font-variant-numeric: tabular-nums; font-size: .775rem; color: var(--text); }
@media (max-width: 520px) { .barlist li { grid-template-columns: 1fr max-content; } .barlist .track { grid-column: 1 / -1; } }

/* ---------- timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 10px; bottom: 10px; width: 1px; background: var(--border-2); }
.timeline > li { position: relative; padding: 0 0 1.6rem 2rem; }
.timeline > li::before {
  content: ""; position: absolute; left: 0; top: 8px; width: 11px; height: 11px;
  background: var(--bg); border: 1px solid var(--border-2);
}
.timeline > li.hit::before { border-color: var(--accent); background: var(--accent); }
.timeline > li.miss::before { border-color: var(--bad); background: var(--bad); }
.timeline h3 { margin-bottom: .25rem; font-size: 1rem; }
.timeline .meta { font-family: var(--ff-mono); font-size: .7rem; color: var(--muted); margin-bottom: .4rem; letter-spacing: .04em; }
.timeline p { margin-bottom: 0; font-size: .89rem; }

/* ---------- gallery ---------- */
.gallery { display: grid; gap: 1.7rem; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.gallery figure { margin: 0; }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 200; display: none;
  background: rgba(6,7,9,.94); padding: 2.5rem 1.5rem; overflow: auto;
  align-items: center; justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: min(1500px, 100%); background: var(--plate); border-radius: 2px; cursor: zoom-out; }
.lightbox .close {
  position: fixed; top: 1rem; right: 1.15rem; width: 32px; height: 32px;
  border-radius: 2px; border: 1px solid rgba(255,255,255,.3); background: rgba(0,0,0,.5);
  color: #fff; cursor: pointer; display: grid; place-items: center; font-size: 1.1rem; line-height: 1;
}

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--border); padding-block: 2.75rem 3rem; background: var(--bg-alt); }
.site-foot .cols { display: grid; gap: 1.8rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.site-foot h4 {
  font-family: var(--ff-mono); font-size: .645rem; letter-spacing: .19em; text-transform: uppercase;
  color: var(--accent); font-weight: 500; margin-bottom: .8rem;
}
.site-foot ul { list-style: none; margin: 0; padding: 0; }
.site-foot li { margin-bottom: .38rem; }
.site-foot a { color: var(--text-2); font-size: .83rem; }
.site-foot a:hover { color: var(--accent); }
.site-foot .fine {
  margin-top: 2.3rem; padding-top: 1.3rem; border-top: 1px dashed var(--border-2);
  font-family: var(--ff-mono); font-size: .695rem; color: var(--muted);
  display: flex; flex-wrap: wrap; gap: .45rem 1.6rem; letter-spacing: .03em;
}
.site-foot .fine p { margin: 0; color: inherit; }

/* ---------- utility ---------- */
.mt0 { margin-top: 0; } .mt1 { margin-top: 1rem; } .mt2 { margin-top: 2rem; } .mt3 { margin-top: 3rem; }
.mb0 { margin-bottom: 0; } .mb1 { margin-bottom: 1rem; } .mb2 { margin-bottom: 2rem; }
.muted { color: var(--muted); }
.small { font-size: .845rem; }
.mono { font-family: var(--ff-mono); }
.center { text-align: center; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bg-alt { background: var(--bg-alt); }
