/* Mehmet Bisen — portfolio v3 "Upstream". Hand-built, no frameworks.
   Cream / burnt orange; warm dark mode. Bayern red only via easter egg.
   v3: the meander-river timeline is the centerpiece; Work section dissolved
   into per-event right-side drawer popups; Summary replaces Now. */

/* ---------- tokens ---------- */
:root {
  --bg: #F8F1E4;
  --bg-raise: #FFFCF3;
  --ink: #1A150E;
  --ink-2: #5C5446;
  --ink-3: #8F8674;
  --line: #E5DAC4;
  --line-soft: #EFE7D4;
  --accent: #BF5700;
  --accent-soft: rgba(191, 87, 0, 0.09);
  --slot: #A16207;
  /* category shades — all orange family */
  --cat-edu: #E0A33D;   /* Education — light amber */
  --cat-work: #BF5700;  /* Work & internships — burnt orange */
  --cat-built: #8A3B00; /* Built & founded — deep ember */
  --cat-honor: #C57343; /* Honors & publications — copper */
  --wide: 72rem;
  --radius: 8px;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
html[data-theme="dark"] {
  --bg: #17130D;
  --bg-raise: #201A12;
  --ink: #F0E9DB;
  --ink-2: #ABA294;
  --ink-3: #776E5F;
  --line: #302921;
  --line-soft: #251F18;
  --accent: #E8752B;
  --accent-soft: rgba(232, 117, 43, 0.11);
  --slot: #D9A441;
  --cat-edu: #E8B054;
  --cat-work: #E8752B;
  --cat-built: #C25A14;
  --cat-honor: #D08A5C;
}
html[data-egg] { --accent: #DC052D; --accent-soft: rgba(220, 5, 45, 0.08); --cat-work: #DC052D; }
html[data-theme="dark"][data-egg] { --accent: #F0334F; --accent-soft: rgba(240, 51, 79, 0.1); --cat-work: #F0334F; }

/* ---------- base ---------- */
* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
  overflow-x: clip;
}
body.locked { overflow: hidden; }
a { color: var(--accent); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
strong { font-weight: 600; }
::selection { background: var(--accent); color: #fff; }

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; }
.mono { font-family: var(--mono); font-size: 0.8125rem; }
.muted { color: var(--ink-2); }
.tiny { font-size: 0.8125rem; color: var(--ink-3); }
.kicker { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.08em; color: var(--ink-2); text-transform: uppercase; }

/* particle canvas + cursor */
#field { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
header, main, footer, dialog { position: relative; z-index: 1; }
html.cursor-node, html.cursor-node * { cursor: none !important; }
html.cursor-node dialog.palette, html.cursor-node dialog.palette * { cursor: auto !important; }
#cursor-dot {
  position: fixed; left: 0; top: 0; width: 11px; height: 11px;
  margin: -5.5px 0 0 -5.5px;
  border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 2px var(--bg);
  pointer-events: none; z-index: 400; opacity: 0;
  translate: -100px -100px;
  transition: opacity 0.15s ease, scale 0.18s ease;
  will-change: translate;
}
#cursor-dot::after {
  content: ""; position: absolute; inset: -4.5px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 50%;
}
#cursor-dot.on { opacity: 1; }
#cursor-dot.hover { scale: 1.5; }

/* ---------- top nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.85rem clamp(1.1rem, 4vw, 3rem);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.nav .logo { font-family: var(--mono); font-weight: 700; font-size: 0.95rem; color: var(--ink); }
.nav .logo em { color: var(--accent); font-style: normal; }
.nav .links { display: flex; align-items: center; gap: clamp(0.8rem, 2.5vw, 1.6rem); }
.nav .links a { color: var(--ink-2); font-family: var(--mono); font-size: 0.8rem; }
.nav .links a:hover { color: var(--ink); text-decoration: none; }

.icon-btn {
  background: none; border: none; cursor: pointer; color: var(--ink-2);
  padding: 0.3rem; border-radius: 4px; display: inline-flex; font-size: 0.95rem;
}
.icon-btn:hover { color: var(--accent); }
.theme-toggle {
  border: 1px solid var(--line); border-radius: 999px;
  padding: 0.32rem 0.62rem; background: var(--bg-raise);
  transition: border-color 0.15s ease;
}
.theme-toggle:hover { border-color: var(--accent); }

/* ---------- shell ---------- */
.shell { max-width: var(--wide); margin: 0 auto; padding: 0 clamp(1.1rem, 4vw, 3rem); }

/* ---------- hero ---------- */
.hero {
  min-height: calc(100svh - 3.4rem);
  display: grid; align-content: center; gap: 2.6rem;
  padding-top: 3rem; padding-bottom: 4rem;
}
.hero-grid { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 880px) { .hero-grid { grid-template-columns: 1.6fr 1fr; } }
.hero h1 {
  font-size: clamp(3rem, 9.5vw, 6.5rem);
  line-height: 0.98; letter-spacing: -0.03em; text-transform: uppercase;
}
.hero h1 .last { color: var(--accent); display: block; }
.hero .bio { margin-top: 1.3rem; font-size: clamp(1.05rem, 1.8vw, 1.3rem); color: var(--ink-2); max-width: 30rem; }
.hero .kicker { margin-bottom: 1.1rem; }
.hero .cta-row { margin-top: 1.8rem; }

.portrait {
  justify-self: center;
  width: clamp(180px, 24vw, 280px); aspect-ratio: 1;
  border-radius: 50%;
  display: grid; place-items: center; text-align: center; padding: 1.2rem;
  border: 2px dashed color-mix(in srgb, var(--slot) 55%, transparent);
  background: color-mix(in srgb, var(--slot) 5%, transparent);
  color: var(--slot); font-family: var(--mono); font-size: 0.8rem;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.portrait.filled { border: 2px solid var(--line); padding: 0; background: none; }

/* hero stats — clickable proof cards */
.herostats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.8rem; }
@media (min-width: 780px) { .herostats { grid-template-columns: repeat(4, 1fr); } }
.hstat {
  all: unset; box-sizing: border-box; cursor: pointer;
  display: flex; flex-direction: column; gap: 0.55rem;
  padding: 1.05rem 1.1rem 1rem;
  background: var(--bg-raise);
  border: 1px solid var(--line); border-radius: 10px;
  position: relative; overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.hstat::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--hs, var(--accent));
}
.hstat .ic {
  width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center;
  color: var(--hs, var(--accent));
  background: color-mix(in srgb, var(--hs, var(--accent)) 10%, transparent);
}
.hstat .ic svg { width: 17px; height: 17px; }
.hstat .num { font-family: var(--mono); font-size: 1.3rem; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; }
.hstat .lbl { font-size: 0.78rem; color: var(--ink-3); line-height: 1.35; }
.hstat .go {
  position: absolute; right: 0.8rem; top: 0.9rem;
  font-family: var(--mono); font-size: 0.75rem; color: var(--ink-3);
  opacity: 0; transition: opacity 0.15s ease;
}
@media (hover: hover) {
  .hstat:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--hs, var(--accent)) 55%, var(--line)); }
  .hstat:hover .go { opacity: 1; }
}
.hstat:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- buttons & chips ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font: 500 0.9rem/1 var(--sans);
  color: var(--ink); background: var(--bg-raise);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.65rem 1rem; cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.cta-row { display: flex; flex-wrap: wrap; gap: 0.7rem; align-items: center; }
kbd {
  font-family: var(--mono); font-size: 0.72rem; color: var(--ink-2);
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px;
  padding: 0.05rem 0.35rem; background: var(--bg-raise);
}
.slot {
  display: inline-flex; align-items: baseline; gap: 0.4rem;
  font-family: var(--mono); font-size: 0.76rem; color: var(--slot);
  border: 1.5px dashed color-mix(in srgb, var(--slot) 50%, transparent);
  border-radius: 5px; padding: 0.15rem 0.5rem;
  background: color-mix(in srgb, var(--slot) 5%, transparent);
}
.slot::before { content: "◌"; font-size: 0.68rem; }

/* ---------- featured (the big three) ---------- */
.feat-grid { display: grid; gap: 1rem; }
@media (min-width: 880px) { .feat-grid { grid-template-columns: repeat(3, 1fr); align-items: stretch; } }
.feat-card {
  all: unset; box-sizing: border-box; cursor: pointer; position: relative;
  display: flex; flex-direction: column; gap: 0.7rem;
  padding: 1.5rem 1.4rem 1.3rem; border-radius: 12px;
  background: var(--bg-raise); border: 1px solid var(--line);
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.feat-card::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: var(--fc, var(--accent));
}
.feat-card .fi {
  width: 46px; height: 46px; border-radius: 12px;
  display: grid; place-items: center; color: var(--fc, var(--accent));
  background: color-mix(in srgb, var(--fc, var(--accent)) 10%, transparent);
}
.feat-card .fi svg { width: 24px; height: 24px; }
.feat-card .ft { font-weight: 700; font-size: 1.08rem; letter-spacing: -0.01em; line-height: 1.25; }
.feat-card .fs { font-size: 0.87rem; color: var(--ink-2); line-height: 1.45; }
.feat-card .fgo { margin-top: auto; padding-top: 0.4rem; font-family: var(--mono); font-size: 0.78rem; color: var(--fc, var(--accent)); }
@media (hover: hover) {
  .feat-card:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--fc, var(--accent)) 55%, var(--line));
    box-shadow: 0 14px 34px -18px color-mix(in srgb, var(--fc, var(--accent)) 55%, transparent);
  }
}
.feat-card:focus-visible { outline: 2px solid var(--fc, var(--accent)); outline-offset: 2px; }

/* ---------- sections ---------- */
section { padding: 4.2rem 0 0; }
.sec-head { display: flex; align-items: baseline; gap: 0.7rem; margin-bottom: 1.6rem; flex-wrap: wrap; }
.sec-head .idx { font-family: var(--mono); font-size: 0.8rem; color: var(--accent); }
.sec-head h2 { font-size: clamp(1.4rem, 3vw, 1.8rem); }
.sec-head .hint { margin-left: auto; }
.divider { border: none; height: 40px; margin: 3.6rem 0 0; position: relative; }
.divider::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--line); }
.divider::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 26px; height: 26px; transform: translate(-50%, -50%);
  border: 1px solid var(--line); border-radius: 50%; background: var(--bg);
}

/* ---------- the river (timeline) ---------- */
.cat-edu { --cc: var(--cat-edu); }
.cat-work { --cc: var(--cat-work); }
.cat-built { --cc: var(--cat-built); }
.cat-honor { --cc: var(--cat-honor); }

.legend { display: flex; flex-wrap: wrap; gap: 0.9rem 1.3rem; align-items: center; }
.legend .lg { display: inline-flex; align-items: center; gap: 0.45rem; font-family: var(--mono); font-size: 0.74rem; color: var(--ink-2); }
.legend .lg i { width: 10px; height: 10px; border-radius: 50%; background: var(--lc); }

.river { position: relative; margin-top: 2.2rem; }
.river-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.river-svg .bed { stroke: var(--accent); opacity: 0.07; stroke-width: 7; fill: none; }
.river-svg .stream { stroke: var(--accent); opacity: 0.28; stroke-width: 2; fill: none; }
.river-svg .flow { stroke: var(--accent); opacity: 0.75; stroke-width: 2; fill: none; }
.river .current {
  position: absolute; left: 0; top: 0; width: 7px; height: 7px; margin: -3.5px;
  border-radius: 50%; background: var(--accent); opacity: 0.7;
  display: none;
  offset-rotate: 0deg;
  animation: drift 50s linear infinite;
}
@keyframes drift {
  from { offset-distance: 0%; }
  to { offset-distance: 100%; }
}
.river .source-tag {
  position: absolute; transform: translate(-50%, 0.9rem);
  font-family: var(--mono); font-size: 0.72rem; color: var(--ink-3);
  white-space: nowrap;
}

.r-ev { position: absolute; width: 0; height: 0; list-style: none; }
.r-node {
  all: unset; box-sizing: border-box; cursor: pointer;
  position: absolute; left: 0; top: 0;
  width: 64px; height: 64px; margin: -32px 0 0 -32px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--cc);
  color: var(--cc);
  display: grid; place-items: center;
  transition: scale 0.2s ease, box-shadow 0.2s ease;
  z-index: 2;
}
.r-node svg { width: 30px; height: 30px; }
.r-node::after { /* ripple ring */
  content: ""; position: absolute; inset: -2px; border-radius: 50%;
  border: 2px solid var(--cc); opacity: 0; pointer-events: none;
}
@media (hover: hover) {
  .r-node:hover { scale: 1.12; box-shadow: 0 6px 22px -8px color-mix(in srgb, var(--cc) 55%, transparent); }
  .r-node:hover::after { animation: ripple 0.7s ease-out; }
}
.r-node:focus-visible { outline: 2px solid var(--cc); outline-offset: 3px; }
.r-ev.active .r-node { scale: 1.12; box-shadow: 0 6px 22px -8px color-mix(in srgb, var(--cc) 55%, transparent); }
@keyframes ripple { from { opacity: 0.5; scale: 1; } to { opacity: 0; scale: 1.9; } }

.r-ev .trib { /* tributary tick node → label */
  position: absolute; top: 0; height: 1.5px; width: 26px;
  background: color-mix(in srgb, var(--cc) 55%, transparent);
}
.r-ev.side-r .trib { left: 36px; }
.r-ev.side-l .trib { right: 36px; }

.r-label { position: absolute; top: -0.55rem; width: 15rem; }
.r-ev.side-r .r-label { left: 70px; text-align: left; }
.r-ev.side-l .r-label { right: 70px; text-align: right; }
.r-label .dt { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3); }
.r-label .t {
  display: block; font-weight: 680; font-size: 1.22rem; letter-spacing: -0.015em;
  line-height: 1.2; margin: 0.15rem 0 0.2rem; color: var(--ink);
  background: none; border: none; padding: 0; font-family: inherit;
  text-align: inherit; width: 100%; cursor: pointer;
  transition: color 0.15s ease;
}
.r-label .t:focus-visible { outline: 2px solid var(--cc); outline-offset: 3px; border-radius: 3px; }
.r-label .o { font-size: 0.86rem; color: var(--ink-2); line-height: 1.4; }
.r-label .hi { list-style: none; margin: 0.15rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.12rem; }
.r-label .hi li { font-size: 0.84rem; color: var(--ink-2); line-height: 1.35; }
.r-label .hi li::before { content: "·"; color: var(--cc); font-weight: 700; margin-right: 0.35rem; }
.r-ev.side-l .r-label .hi li::before { content: ""; margin: 0; }
@media (max-width: 640px) {
  .r-ev.side-l .r-label .hi li::before { content: "·"; margin-right: 0.35rem; }
}
.r-label .role { display: block; font-family: var(--mono); font-size: 0.72rem; color: var(--ink-3); margin: -0.05rem 0 0.2rem; }
.r-label .chip {
  display: inline-block; margin-top: 0.35rem;
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--cc); border: 1px solid color-mix(in srgb, var(--cc) 45%, transparent);
  border-radius: 999px; padding: 0.08rem 0.5rem;
}
.r-label .t:hover { color: var(--cc); }
.r-ev { opacity: 0; transform: translateY(14px); transition: opacity 0.55s ease, transform 0.55s ease; }
.r-ev.seen { opacity: 1; transform: none; }

@media (max-width: 860px) and (min-width: 641px) {
  .r-label { width: 12.5rem; }
  .r-label .t { font-size: 1.05rem; }
}

/* mobile river */
@media (max-width: 640px) {
  .r-node { width: 48px; height: 48px; margin: -24px 0 0 -24px; }
  .r-node svg { width: 22px; height: 22px; }
  .r-ev.side-r .trib, .r-ev.side-l .trib { left: 28px; right: auto; width: 18px; }
  .r-label, .r-ev.side-l .r-label, .r-ev.side-r .r-label {
    left: 54px; right: auto; text-align: left; width: calc(100vw - 10.5rem);
  }
  .r-label .t { font-size: 1.05rem; }
}
@media (prefers-reduced-motion: reduce) {
  .r-ev { opacity: 1; transform: none; transition: none; }
  .r-node, .r-node::after { transition: none; animation: none !important; }
  .river .current { display: none !important; }
}

/* no-JS river fallback: plain list */
.no-js .river-svg, .no-js .river .current, .no-js .river .source-tag { display: none; }
.no-js .r-ev { position: static; width: auto; height: auto; opacity: 1; transform: none; margin-bottom: 1.6rem; display: flex; gap: 1rem; align-items: flex-start; }
.no-js .r-node { position: static; margin: 0; flex-shrink: 0; }
.no-js .r-label, .no-js .r-ev.side-l .r-label { position: static; width: auto; text-align: left; }
.no-js .r-ev .trib { display: none; }

/* ---------- centered event popup (modal) ---------- */
.scrim {
  position: fixed; inset: 0; z-index: 90;
  background: color-mix(in srgb, var(--ink) 22%, transparent);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  opacity: 0; pointer-events: none; transition: opacity 0.28s ease;
}
.drawer {
  position: fixed; left: 50%; top: 50%; z-index: 100;
  translate: -50% -50%;
  width: min(46rem, 93vw);
  max-height: min(85vh, 85svh);
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: 14px;
  scale: 0.96; opacity: 0; pointer-events: none;
  transition: scale 0.28s cubic-bezier(0.32, 0.72, 0.25, 1), opacity 0.22s ease;
  display: flex; flex-direction: column;
  box-shadow: 0 32px 80px rgba(10, 8, 5, 0.22);
  overflow: hidden;
}
html.drawer-open .scrim { opacity: 1; pointer-events: auto; }
html.drawer-open .drawer { scale: 1; opacity: 1; pointer-events: auto; }
@media (prefers-reduced-motion: reduce) { .drawer { transition: opacity 0.2s ease; scale: 1; } }
.drawer-head {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 1.1rem 1.3rem; border-bottom: 1px solid var(--line-soft);
}
.drawer-head .d-ic {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--cc); color: var(--cc);
  display: grid; place-items: center;
}
.drawer-head .d-ic svg { width: 20px; height: 20px; }
.drawer-head .d-meta { min-width: 0; }
.drawer-head .d-meta .dt { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.drawer-head .d-meta .chip {
  font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--cc); border: 1px solid color-mix(in srgb, var(--cc) 45%, transparent);
  border-radius: 999px; padding: 0.05rem 0.45rem; margin-left: 0.4rem;
}
.drawer-head .close {
  all: unset; cursor: pointer; margin-left: auto;
  width: 34px; height: 34px; border-radius: 8px;
  display: grid; place-items: center; color: var(--ink-2);
  border: 1px solid var(--line);
}
.drawer-head .close:hover { color: var(--accent); border-color: var(--accent); }
.drawer-head .close:focus-visible { outline: 2px solid var(--accent); }
.drawer-body { overflow-y: auto; padding: 1.3rem 1.5rem 2.2rem; overscroll-behavior: contain; }
.drawer-body h3 { font-size: 1.45rem; margin-bottom: 0.3rem; }
.drawer-body .block { margin-top: 1rem; }
.drawer-body .block:first-of-type { margin-top: 0; }
.d-role { font-family: var(--mono); font-size: 0.8rem; color: var(--accent); margin-bottom: 0.9rem; }
.d-list { list-style: none; margin: 0.3rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.7rem; }
.d-list li { position: relative; padding-left: 1.15rem; color: var(--ink-2); font-size: 0.95rem; }
.d-list li::before { content: ""; position: absolute; left: 0; top: 0.52em; width: 7px; height: 7px; border-radius: 50%; background: var(--cc, var(--accent)); }
.d-list li strong { color: var(--ink); }
.d-cols { display: grid; gap: 1.2rem; margin-top: 1.1rem; }
@media (min-width: 720px) { .d-cols { grid-template-columns: 1fr 1fr; align-items: start; } }

.block .k {
  font-family: var(--mono); font-size: 0.7rem; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--accent); display: block; margin-bottom: 0.25rem;
}
.block p { color: var(--ink-2); font-size: 0.95rem; }
.stack { font-family: var(--mono); font-size: 0.78rem; color: var(--ink-3); margin-top: 0.5rem; }
.metric-row { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-top: 1rem; }
.metric {
  border: 1px solid var(--line); border-radius: 5px; padding: 0.4rem 0.65rem;
  font-family: var(--mono); font-size: 0.8rem; color: var(--ink); background: var(--bg);
}
.metric .fn { color: var(--ink-3); font-size: 0.7rem; display: block; }
.testimonial {
  margin-top: 1rem; padding: 0.8rem 1rem; border-left: 2px solid var(--accent);
  background: var(--accent-soft); border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.9rem; color: var(--ink-2);
}
.video-slot {
  margin-top: 1rem;
  border: 1.5px dashed var(--line); border-radius: var(--radius);
  background: var(--bg);
  aspect-ratio: 16 / 9;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem;
  color: var(--ink-3); text-align: center; padding: 1rem;
}
.video-slot .play {
  width: 42px; height: 42px; border-radius: 50%;
  border: 1.5px solid var(--line); display: grid; place-items: center; font-size: 0.85rem;
}
.video-slot .vtitle { font-size: 0.88rem; color: var(--ink-2); font-weight: 500; }
.diagram-wrap { margin-top: 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); padding: 1rem; }
.diagram-wrap svg { width: 100%; height: auto; display: block; }
.diagram-wrap .d-box { fill: var(--bg-raise); stroke: var(--line); }
.diagram-wrap .d-label { fill: var(--ink-2); font: 500 11px var(--mono); }
.diagram-wrap .d-line { stroke: var(--line); stroke-width: 1; }
.diagram-wrap .d-sub { fill: var(--ink-2); font: 500 9px var(--mono); }
.diagram-wrap .d-ic-s { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- xl popup (xPM) ---------- */
.drawer.xl { width: min(76rem, 96vw); max-height: min(92vh, 92svh); }
.statband { display: grid; gap: 0.8rem; margin-top: 1.15rem; }
@media (min-width: 720px) { .statband { grid-template-columns: repeat(3, 1fr); } }
.sstat {
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--line));
  background: var(--accent-soft);
  border-radius: 10px; padding: 1rem 1.1rem 0.95rem;
}
.sstat .n {
  display: block; font-family: var(--mono); font-weight: 700;
  font-size: clamp(1.45rem, 2.2vw, 1.8rem); line-height: 1.1;
  letter-spacing: -0.02em; color: var(--accent);
}
.sstat .l { display: block; margin-top: 0.3rem; font-size: 0.8rem; line-height: 1.4; color: var(--ink-2); }
.hero-diagram { margin-top: 1.2rem; padding: 1.4rem 1.4rem 1rem; }
@media (max-width: 640px) {
  .hero-diagram { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .hero-diagram svg { min-width: 620px; }
}
.pillars { display: grid; gap: 1rem; margin-top: 1.1rem; }
@media (min-width: 880px) { .pillars { grid-template-columns: repeat(3, 1fr); align-items: start; } }
.pillar {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg); padding: 1rem 1.1rem 1.2rem;
}
.pillar h4 { font-size: 0.95rem; display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.65rem; }
.pillar h4 i { width: 9px; height: 9px; border-radius: 50%; background: var(--cc, var(--accent)); flex-shrink: 0; }
.pillar .d-list { gap: 0.55rem; }
.pillar .d-list li { font-size: 0.88rem; }
.yt-card {
  display: block; position: relative; border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; background: #000;
}
.yt-card img { width: 100%; height: auto; display: block; aspect-ratio: 16 / 9; object-fit: cover; }
.yt-card .yt-meta {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 0.6rem 0.85rem; display: flex; align-items: center; gap: 0.55rem;
  font-size: 0.85rem; font-weight: 500; color: #fff;
  background: linear-gradient(transparent, rgba(10, 8, 5, 0.82));
}
.yt-card .play {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  border: 1.5px solid rgba(255, 255, 255, 0.75);
  display: grid; place-items: center; font-size: 0.68rem;
}
.yt-card:hover { text-decoration: none; border-color: var(--accent); }
.yt-card:hover .play { background: var(--accent); border-color: var(--accent); }
.film { margin: 0; }
.film video { width: 100%; height: auto; display: block; border: 1px solid var(--line); border-radius: var(--radius); background: #000; }
.film figcaption { margin-top: 0.4rem; }
.shot-slot {
  margin-top: 1rem; border: 1.5px dashed var(--line); border-radius: var(--radius);
  background: var(--bg); min-height: 7.5rem;
  display: grid; place-items: center; text-align: center; padding: 1rem;
}
.d-cols .shot-slot { margin-top: 0; }

/* catalogue gallery — swipe or arrow through screenshots */
.gal { position: relative; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg); }
.gal-track {
  display: flex; overflow-x: auto;
  scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.gal-track::-webkit-scrollbar { display: none; }
.gal-slide { flex: 0 0 100%; scroll-snap-align: start; margin: 0; }
.gal-slide img { width: 100%; height: auto; display: block; aspect-ratio: 8 / 5; object-fit: cover; background: #fff; }
.gal-btn {
  all: unset; cursor: pointer; position: absolute; top: 50%; translate: 0 -50%;
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.05rem; line-height: 1;
  color: var(--ink); background: color-mix(in srgb, var(--bg-raise) 88%, transparent);
  border: 1px solid var(--line);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.gal-btn.prev { left: 0.6rem; }
.gal-btn.next { right: 0.6rem; }
.gal-btn:hover { border-color: var(--accent); color: var(--accent); }
.gal-btn:focus-visible { outline: 2px solid var(--accent); }
.gal-count {
  position: absolute; right: 0.65rem; bottom: 0.6rem;
  font-family: var(--mono); font-size: 0.7rem; color: var(--ink);
  background: color-mix(in srgb, var(--bg-raise) 88%, transparent);
  border: 1px solid var(--line); border-radius: 999px; padding: 0.12rem 0.55rem;
}
.gal-cap { margin-top: 0.45rem; }
.no-js .gal-btn, .no-js .gal-count { display: none; }

/* details stash: hidden templates; visible stacked when no JS */
#ev-details { display: none; }
.no-js #ev-details { display: block; max-width: 44rem; }
.no-js #ev-details article { border-top: 1px solid var(--line); padding: 1.6rem 0; }

/* ---------- summary ---------- */
.duo { display: grid; gap: 2rem; }
@media (min-width: 880px) { .duo { grid-template-columns: 1fr 1.2fr; align-items: start; } }
.scout { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg-raise); }
.scout .s-head {
  padding: 1rem 1.2rem; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  background: radial-gradient(circle at 50% 140%, var(--accent-soft), transparent 60%);
}
.scout .s-head .who { font-weight: 700; }
.scout .s-head .pos { font-family: var(--mono); font-size: 0.7rem; color: var(--ink-2); text-align: right; }
.scout table { width: 100%; border-collapse: collapse; }
.scout td { padding: 0.55rem 1.2rem; border-top: 1px solid var(--line-soft); font-size: 0.88rem; }
.scout td:first-child { color: var(--ink-2); }
.scout td:last-child { text-align: right; font-family: var(--mono); font-weight: 600; }
.scout .s-foot { padding: 0.65rem 1.2rem; border-top: 1px solid var(--line); }
.linky { all: unset; cursor: pointer; color: var(--accent); }
.linky:hover { text-decoration: underline; }

.recent { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-raise); overflow: hidden; }
.recent .rc-head { padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); font-weight: 700; }
.recent .rc-head .tiny { font-weight: 400; margin-left: 0.5rem; }
.recent ul { list-style: none; margin: 0; padding: 0; }
.recent li { border-top: 1px solid var(--line-soft); }
.recent li:first-child { border-top: none; }
.recent .rc-row {
  all: unset; box-sizing: border-box; cursor: pointer; width: 100%;
  display: grid; grid-template-columns: auto auto 1fr auto; gap: 0.8rem; align-items: baseline;
  padding: 0.75rem 1.2rem;
}
.recent .rc-row:hover { background: var(--accent-soft); }
.recent .rc-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.recent .rc-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--cc); align-self: center; }
.recent .rc-dt { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-3); white-space: nowrap; }
.recent .rc-t { font-weight: 600; font-size: 0.92rem; }
.recent .rc-go { font-family: var(--mono); font-size: 0.78rem; color: var(--ink-3); }
@media (max-width: 640px) {
  .recent .rc-row { grid-template-columns: auto 1fr auto; }
  .recent .rc-dt { display: none; }
}

/* ---------- footer ---------- */
footer { margin-top: 4.5rem; border-top: 1px solid var(--line); }
.foot-inner {
  max-width: var(--wide); margin: 0 auto; padding: 2.2rem clamp(1.1rem, 4vw, 3rem) 2.8rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: 1.2rem 2rem;
}
.monogram {
  width: 42px; height: 42px; border: 1.5px solid var(--ink); border-radius: 50%;
  display: grid; place-items: center; font: 700 0.9rem var(--mono); letter-spacing: -0.05em;
  flex-shrink: 0;
}
.foot-links { display: flex; flex-wrap: wrap; gap: 1.1rem; font-family: var(--mono); font-size: 0.8rem; }
.colophon { flex-basis: 100%; font-size: 0.76rem; color: var(--ink-3); }
.egg-hint { font-size: 0.68rem; color: color-mix(in srgb, var(--ink-3) 50%, transparent); font-family: var(--mono); }
.egg-card {
  display: none; flex-basis: 100%; max-width: 26rem;
  border: 1px solid var(--accent); border-radius: var(--radius);
  padding: 0.9rem 1.1rem; background: var(--accent-soft);
  font-family: var(--mono); font-size: 0.8rem;
}
html[data-egg] .egg-card { display: block; }

/* ---------- command palette ---------- */
dialog.palette {
  width: min(92vw, 34rem); border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg-raise); color: var(--ink); padding: 0;
  margin: 12vh auto auto; box-shadow: 0 24px 60px rgba(0,0,0,0.18);
}
dialog.palette::backdrop { background: rgba(10, 8, 5, 0.35); backdrop-filter: blur(2px); }
.palette input {
  width: 100%; border: none; border-bottom: 1px solid var(--line);
  background: transparent; color: var(--ink);
  font: 400 1rem var(--sans); padding: 0.9rem 1.1rem; outline: none;
}
.palette ul { list-style: none; margin: 0; padding: 0.4rem; max-height: 46vh; overflow: auto; }
.palette li button {
  all: unset; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  width: 100%; box-sizing: border-box; padding: 0.55rem 0.7rem; cursor: pointer;
  font-size: 0.92rem; color: var(--ink); border-radius: 6px;
}
.palette li[aria-selected="true"] button, .palette li button:hover { background: var(--accent-soft); }
.palette li .hint { font-family: var(--mono); font-size: 0.7rem; color: var(--ink-3); }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity 0.55s ease, transform 0.55s ease; }
.reveal.seen { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------- satellite pages ---------- */
.page { max-width: 40rem; margin: 0 auto; padding: 3.2rem 1.1rem 4rem; }
.page .back { font-family: var(--mono); font-size: 0.8rem; }
.now-list { list-style: none; padding: 0; margin-top: 1.4rem; display: flex; flex-direction: column; gap: 0.9rem; }
.now-list li { padding-left: 1.1rem; position: relative; color: var(--ink-2); }
.now-list li::before { content: "—"; position: absolute; left: 0; color: var(--accent); }
.stamp { font-family: var(--mono); font-size: 0.78rem; color: var(--ink-3); }
.case {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-raise); padding: 1.5rem 1.4rem; margin-top: 1.3rem;
}
.case h3 { font-size: 1.2rem; margin-bottom: 0.6rem; }
.pitch-proof { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1.2rem 0; }

/* ---------- no-JS ---------- */
.no-js .reveal { opacity: 1; transform: none; }
.no-js #field, .no-js .kbd-only { display: none !important; }

@media print {
  .nav, #field, .egg-hint, .portrait, .drawer, .scrim { display: none !important; }
  body { background: #fff; color: #000; }
  #ev-details { display: block; }
}
