/* ───────── Dark console theme ───────── */
:root {
  --bg: #0a0b0d;
  --bg-panel: #0f1114;
  --bg-panel-2: #13161a;
  --ink: #e8eaed;
  --ink-dim: #9aa0a6;
  --ink-dimmer: #5c6068;
  --line: #1e2228;
  --line-soft: #181b20;
  --accent: #7cffb2;
  --accent-alt: #ff4545;
  --accent-amber: #ffb84d;
  --accent-blue: #5bb0ff;

  --f-display: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --f-serif: 'Instrument Serif', ui-serif, Georgia, serif;

  --frame: 44px;
  --nav-w: 220px;
  --foot: 34px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; overflow: hidden; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--f-mono); font-size: 13px;
  -webkit-font-smoothing: antialiased;
  cursor: none;
}
@media (pointer: coarse) { body { cursor: auto; } }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; border: none; background: none; color: inherit; }
::selection { background: var(--accent); color: var(--bg); }

/* ───────── Decorative overlays ───────── */
.scan {
  position: fixed; inset: 0; pointer-events: none; z-index: 9998;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(255,255,255,.012) 3px 4px);
  mix-blend-mode: overlay;
}
.grid-bg {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 85%);
}

/* ───────── Cursor ───────── */
.cursor { position: fixed; left: 0; top: 0; pointer-events: none; z-index: 10000; }
.cursor-dot {
  position: absolute; left: 0; top: 0; width: 4px; height: 4px; border-radius: 50%;
  background: var(--accent); transform: translate(-50%, -50%);
  box-shadow: 0 0 8px var(--accent);
}
.cursor-ring {
  position: absolute; left: 0; top: 0; width: 32px; height: 32px;
  border: 1px solid var(--accent); transform: translate(-50%, -50%);
  transition: width .2s cubic-bezier(.2,.8,.2,1), height .2s cubic-bezier(.2,.8,.2,1), border-radius .2s ease;
}
.cursor-label {
  position: absolute; left: 0; top: 0; transform: translate(22px, 22px);
  font-family: var(--f-mono); font-size: 10px; color: var(--accent);
  letter-spacing: .1em; text-transform: uppercase; white-space: nowrap;
  text-shadow: 0 0 6px rgba(124,255,178,.5);
}
.cursor.hover .cursor-ring { width: 48px; height: 48px; border-radius: 4px; }
.cursor.press .cursor-ring { width: 24px; height: 24px; }
@media (pointer: coarse) { .cursor { display: none; } }

/* ───────── Frame chrome ───────── */
.frame-top, .frame-bot {
  position: fixed; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px; font-family: var(--f-mono); font-size: 11px;
  background: var(--bg-panel); border-color: var(--line);
  color: var(--ink-dim);
}
.frame-top { top: 0; height: var(--frame); border-bottom: 1px solid var(--line); }
.frame-bot { bottom: 0; height: var(--foot); border-top: 1px solid var(--line); }

.ft-left, .ft-right, .fb-left, .fb-right { display: flex; align-items: center; gap: 10px; }
.ft-left { color: var(--ink); }
.ft-logo { font-weight: 700; letter-spacing: .1em; color: var(--ink); }
.ft-sep { color: var(--ink-dimmer); }
.ft-sub { color: var(--ink-dim); }
.ft-build { color: var(--ink-dimmer); }
.ft-right { color: var(--ink-dim); }
.ft-right b { color: var(--accent); font-weight: 500; }
.live-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
  animation: blink 1.5s infinite;
}
@keyframes blink { 0%, 60% { opacity: 1; } 70%, 100% { opacity: .3; } }

.fb-center { flex: 1; overflow: hidden; padding: 0 24px; color: var(--ink-dim); white-space: nowrap; }
.fb-center #tape { display: inline-block; animation: tape 40s linear infinite; }
@keyframes tape { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ───────── Side nav ───────── */
.frame-nav {
  position: fixed; left: 0; top: var(--frame); bottom: var(--foot);
  width: var(--nav-w); border-right: 1px solid var(--line);
  background: var(--bg-panel);
  padding: 18px 0; z-index: 40;
  display: flex; flex-direction: column;
}
.nav-section-label {
  padding: 0 18px; font-size: 10px; letter-spacing: .14em;
  color: var(--ink-dimmer); text-transform: uppercase; margin: 16px 0 8px;
}
.nav-item {
  display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center;
  padding: 10px 18px; color: var(--ink-dim); cursor: pointer;
  border-left: 2px solid transparent;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
  position: relative;
}
.nav-item:hover { background: var(--bg-panel-2); color: var(--ink); }
.nav-item.active { color: var(--ink); border-left-color: var(--accent); background: var(--bg-panel-2); }
.nav-item .ni-num { color: var(--ink-dimmer); font-size: 10px; }
.nav-item.active .ni-num { color: var(--accent); }
.nav-item .ni-label { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; font-weight: 500; }
.nav-item .ni-count { font-size: 10px; color: var(--ink-dimmer); }
.nav-item.active .ni-count { color: var(--accent); }

.nav-meta {
  margin-top: auto; padding: 18px; border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 12px;
  font-size: 10px; color: var(--ink-dimmer); text-transform: uppercase; letter-spacing: .08em;
}
.nav-meta .nm-row { display: flex; justify-content: space-between; }
.nav-meta .nm-row b { color: var(--ink); font-weight: 500; letter-spacing: 0; text-transform: none; font-family: var(--f-mono); }
.mini-chart { height: 28px; display: flex; align-items: flex-end; gap: 2px; }
.mini-chart .bar { flex: 1; background: var(--accent); opacity: .7; border-radius: 1px; min-height: 2px; }
.mini-chart .bar.hi { background: var(--accent); opacity: 1; }

/* ───────── Stage / pages ───────── */
.stage {
  position: fixed; left: var(--nav-w); right: 0; top: var(--frame); bottom: var(--foot);
  overflow: hidden; z-index: 10;
}
.page {
  position: absolute; inset: 0;
  overflow-y: auto; overflow-x: hidden;
  padding: 24px 28px 40px;
  opacity: 0; pointer-events: none; visibility: hidden;
  transform: translateY(20px);
  transition: opacity .35s ease, transform .45s cubic-bezier(.2,.8,.2,1);
}
.page.active {
  opacity: 1; pointer-events: auto; visibility: visible; transform: translateY(0);
}
.page::-webkit-scrollbar { width: 8px; }
.page::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

/* Transition sweep */
.transition {
  position: fixed; inset: 0; z-index: 9000; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
}
.trans-track {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg,
    var(--accent) 0 2px, transparent 2px 6px);
  transform: scaleX(0);
  transform-origin: left;
}
.trans-label {
  position: relative; color: var(--bg); background: var(--accent);
  padding: 6px 14px; font-size: 11px; letter-spacing: .2em; text-transform: uppercase;
  opacity: 0;
}
.transition.run .trans-track {
  animation: sweep .7s cubic-bezier(.7,0,.3,1);
}
.transition.run .trans-label { animation: labelPop .7s cubic-bezier(.7,0,.3,1); }
@keyframes sweep {
  0% { transform: scaleX(0); transform-origin: left; }
  50% { transform: scaleX(1); transform-origin: left; }
  50.01% { transform-origin: right; }
  100% { transform: scaleX(0); transform-origin: right; }
}
@keyframes labelPop {
  0%, 100% { opacity: 0; transform: translateY(8px); }
  40%, 60% { opacity: 1; transform: translateY(0); }
}

/* ───────── Panels / cards ───────── */
.panel {
  background: var(--bg-panel); border: 1px solid var(--line); border-radius: 6px;
  position: relative; overflow: hidden;
}
.panel.emph { background: var(--bg-panel-2); }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; border-bottom: 1px solid var(--line);
  font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-dim);
}
.panel-head .ph-title { color: var(--ink); font-weight: 500; }
.panel-head .ph-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.panel-head .ph-actions { display: flex; gap: 8px; color: var(--ink-dimmer); }
.panel-body { padding: 16px; }
.panel-body.pad-lg { padding: 24px; }

/* Stats */
.kv { display: flex; align-items: baseline; gap: 6px; margin: 6px 0; }
.kv .k { color: var(--ink-dimmer); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; min-width: 76px; }
.kv .v { color: var(--ink); font-size: 13px; }
.kv .v.accent { color: var(--accent); }
.kv .v.amber { color: var(--accent-amber); }

/* Big number */
.bignum { font-family: var(--f-display); font-size: 64px; font-weight: 700; letter-spacing: -.04em; line-height: 1; color: var(--ink); }
.bignum .unit { color: var(--ink-dim); font-size: 16px; font-weight: 400; margin-left: 6px; letter-spacing: 0; }
.bignum .accent { color: var(--accent); }

/* Sparkline */
.spark { display: block; }
.spark path.line { stroke: var(--accent); fill: none; stroke-width: 1.4; }
.spark path.area { fill: var(--accent); opacity: .12; }

/* Terminal-ish lines */
.term {
  font-family: var(--f-mono); font-size: 12px; color: var(--ink-dim); line-height: 1.6;
}
.term .cmd::before { content: "$ "; color: var(--accent); }
.term .ok { color: var(--accent); }
.term .warn { color: var(--accent-amber); }
.term .err { color: var(--accent-alt); }
.term .cursor-blink {
  display: inline-block; width: 7px; height: 14px; background: var(--accent);
  vertical-align: middle; animation: blink 1s steps(1) infinite;
}

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px;
  border: 1px solid var(--line); border-radius: 3px;
  font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-dim);
}
.badge.live { border-color: var(--accent); color: var(--accent); }
.badge.live::before { content: "●"; }
.badge.amber { border-color: var(--accent-amber); color: var(--accent-amber); }
.badge.alt { border-color: var(--accent-alt); color: var(--accent-alt); }
.badge.blue { border-color: var(--accent-blue); color: var(--accent-blue); }

/* ───────── Page: Home ───────── */
.home-grid {
  display: grid; grid-template-columns: 3fr 2fr; grid-template-rows: auto auto auto; gap: 14px;
  min-height: 100%;
}
.hero-panel {
  grid-column: 1 / -1; padding: 0; position: relative; min-height: 340px;
  display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 0;
}
.hero-inner { padding: 36px 40px; position: relative; z-index: 2; min-width: 0; }
.hero-eyebrow {
  font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-dim);
  display: flex; align-items: center; gap: 12px; margin-bottom: 18px;
}
.hero-title {
  font-family: var(--f-display); font-weight: 800; letter-spacing: -.035em; line-height: .92;
  font-size: clamp(40px, 5.4vw, 84px); margin: 0; color: var(--ink);
  overflow-wrap: break-word;
}
.hero-title .accent { color: var(--accent); }
.hero-title .serif { font-family: var(--f-serif); font-style: italic; font-weight: 400; color: var(--accent-amber); }
.hero-title .stroke { -webkit-text-stroke: 1px var(--ink); color: transparent; }
.hero-sub {
  margin-top: 22px; max-width: 680px; font-family: var(--f-mono); font-size: 13px; line-height: 1.65; color: var(--ink-dim);
}
.hero-sub b { color: var(--ink); font-weight: 500; }

/* Hero console side graphic */
.hero-console {
  border-left: 1px solid var(--line);
  padding: 36px 28px 36px 24px;
  display: flex; flex-direction: column; gap: 10px;
  font-family: var(--f-mono); font-size: 11px; color: var(--ink-dim);
  min-width: 0; z-index: 1;
}
.hero-console .hc-row { display: flex; justify-content: space-between; }
.hero-console .hc-row b { color: var(--accent); font-weight: 500; }
.hero-waveform { height: 80px; position: relative; }
.hero-waveform svg { width: 100%; height: 100%; }

.home-cell { min-height: 220px; }
.home-cell .bignum { margin-bottom: 12px; }
.status-list { display: flex; flex-direction: column; gap: 8px; font-size: 12px; }
.status-list .row { display: grid; grid-template-columns: 14px 1fr auto; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.status-list .row:last-child { border-bottom: none; }
.status-list .dot { width: 6px; height: 6px; border-radius: 50%; }
.status-list .dot.ok { background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.status-list .dot.warn { background: var(--accent-amber); }
.status-list .dot.alt { background: var(--accent-alt); }
.status-list .name { color: var(--ink); }
.status-list .val { color: var(--ink-dim); font-size: 11px; }

/* ───────── Page: Work ───────── */
.work-wrap { display: grid; grid-template-columns: 380px 1fr; gap: 14px; align-items: start; }
.work-list { display: flex; flex-direction: column; gap: 8px; padding-right: 4px; position: sticky; top: 0; }
.work-row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center;
  padding: 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg-panel);
  cursor: pointer; transition: border-color .2s ease, background .2s ease;
}
.work-row:hover { border-color: var(--ink-dim); }
.work-row.active { border-color: var(--accent); background: var(--bg-panel-2); box-shadow: 0 0 0 1px var(--accent) inset; }
.work-row .wr-num { font-family: var(--f-mono); font-size: 10px; color: var(--ink-dimmer); letter-spacing: .1em; }
.work-row.active .wr-num { color: var(--accent); }
.work-row .wr-title { font-family: var(--f-display); font-size: 20px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.work-row .wr-role { font-size: 11px; color: var(--ink-dim); margin-top: 2px; }
.work-row .wr-arrow { color: var(--ink-dimmer); }
.work-row.active .wr-arrow { color: var(--accent); }

.work-detail { background: var(--bg-panel); border: 1px solid var(--line); border-radius: 6px; display: flex; flex-direction: column; }
.wd-head {
  display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: start;
  padding: 20px 22px; border-bottom: 1px solid var(--line);
}
.wd-head h2 { font-family: var(--f-display); font-size: 40px; font-weight: 800; letter-spacing: -.035em; line-height: 1; margin: 0; color: var(--ink); }
.wd-head h2 em { font-family: var(--f-serif); font-style: italic; font-weight: 400; color: var(--accent-amber); }
.wd-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.wd-metrics { display: flex; gap: 20px; justify-content: flex-end; text-align: right; }
.wd-metrics .m .v { font-family: var(--f-display); font-size: 28px; font-weight: 700; color: var(--ink); letter-spacing: -.02em; }
.wd-metrics .m .v.accent { color: var(--accent); }
.wd-metrics .m .l { font-size: 10px; color: var(--ink-dimmer); text-transform: uppercase; letter-spacing: .1em; margin-top: 2px; }

.wd-body { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; padding: 22px; align-items: start; }
.wd-narr { font-family: var(--f-mono); font-size: 13px; line-height: 1.7; color: var(--ink-dim); }
.wd-narr p { margin: 0 0 14px; }
.wd-narr p b { color: var(--ink); font-weight: 500; }
.wd-stack-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.wd-stack-list .s {
  padding: 8px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 4px;
  display: flex; justify-content: space-between; align-items: center; font-size: 12px;
}
.wd-stack-list .s::before { content: "▸"; color: var(--accent); margin-right: 8px; }

.wd-art {
  background: var(--bg); border: 1px solid var(--line); border-radius: 4px;
  padding: 16px; font-family: var(--f-mono); font-size: 11px; color: var(--ink-dim);
  display: flex; flex-direction: column; gap: 12px;
  overflow: hidden;
}
.wd-art .art-title { color: var(--accent); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.wd-art svg { width: 100%; height: auto; }

/* ───────── Page: Writing ───────── */
.writing-layout { display: grid; grid-template-columns: 1fr 320px; gap: 14px; }
.writing-list { display: flex; flex-direction: column; }
.writing-row {
  display: grid; grid-template-columns: 120px 1fr auto; gap: 18px; align-items: baseline;
  padding: 18px 4px; border-bottom: 1px solid var(--line); cursor: pointer;
  transition: background .15s ease, padding .25s ease;
}
.writing-row:hover { background: var(--bg-panel); padding-left: 12px; padding-right: 12px; }
.writing-row .w-date { font-family: var(--f-mono); font-size: 11px; color: var(--ink-dimmer); }
.writing-row .w-title { font-family: var(--f-display); font-size: 22px; font-weight: 600; letter-spacing: -.02em; color: var(--ink); line-height: 1.15; }
.writing-row .w-blurb { font-size: 12px; color: var(--ink-dim); margin-top: 6px; max-width: 560px; line-height: 1.55; }
.writing-row .w-tag { font-size: 10px; color: var(--accent); letter-spacing: .1em; text-transform: uppercase; }
.writing-aside { display: flex; flex-direction: column; gap: 14px; }

/* Publications list */
.pub-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.pub-row {
  display: grid; grid-template-columns: 140px 1fr; gap: 24px;
  padding: 16px 4px; border-bottom: 1px solid var(--line); align-items: start;
  transition: background .15s ease, padding .2s ease;
}
.pub-row:hover { background: var(--bg-panel); padding-left: 12px; padding-right: 12px; }
.pub-meta { display: flex; flex-direction: column; gap: 4px; font-family: var(--f-mono); }
.pub-year { font-size: 16px; color: var(--accent); font-weight: 600; letter-spacing: -.01em; }
.pub-venue { font-size: 10px; color: var(--ink-dimmer); text-transform: uppercase; letter-spacing: .12em; }
.pub-title { font-family: var(--f-display); font-size: 17px; font-weight: 500; letter-spacing: -.01em; color: var(--ink); line-height: 1.3; }
.pub-authors { font-family: var(--f-mono); font-size: 11px; color: var(--ink-dim); margin-top: 6px; line-height: 1.55; }
.pub-tail { font-family: var(--f-mono); font-size: 11px; color: var(--ink-dimmer); margin-top: 6px; display: flex; gap: 8px; flex-wrap: wrap; }
.pub-tail .pub-sep { color: var(--ink-dimmer); }

/* ───────── Page: About ───────── */
.about-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; }
.bio-panel { padding: 32px; }
.bio-lede { font-family: var(--f-display); font-size: 28px; font-weight: 500; line-height: 1.25; letter-spacing: -.015em; color: var(--ink); }
.bio-lede em { font-family: var(--f-serif); font-style: italic; font-weight: 400; color: var(--accent-amber); }
.bio-lede .mute { color: var(--ink-dim); }
.bio-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; margin-top: 28px; }
.bio-stat { background: var(--bg-panel); padding: 18px; }
.bio-stat .n { font-family: var(--f-display); font-size: 44px; font-weight: 700; letter-spacing: -.03em; line-height: 1; color: var(--ink); }
.bio-stat .n .sup { font-family: var(--f-mono); font-size: 10px; color: var(--accent); margin-left: 5px; vertical-align: top; }
.bio-stat .l { font-size: 10px; color: var(--ink-dimmer); text-transform: uppercase; letter-spacing: .1em; margin-top: 8px; }

.timeline { padding: 20px; display: flex; flex-direction: column; gap: 0; }
.timeline-row {
  display: grid; grid-template-columns: 70px 14px 1fr; gap: 14px; align-items: start;
  padding: 10px 0; font-size: 12px;
  position: relative;
}
.timeline-row .yr { color: var(--accent); font-family: var(--f-mono); font-size: 11px; }
.timeline-row .bullet { position: relative; height: 100%; }
.timeline-row .bullet::before { content: ""; position: absolute; left: 5px; top: 4px; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.timeline-row .bullet::after { content: ""; position: absolute; left: 6.5px; top: 10px; width: 1px; bottom: -10px; background: var(--line); }
.timeline-row:last-child .bullet::after { display: none; }
.timeline-row .tx { color: var(--ink); font-size: 12px; line-height: 1.4; }
.timeline-row .tx .sub { color: var(--ink-dim); display: block; font-size: 11px; margin-top: 2px; font-family: var(--f-mono); }

/* ───────── Page: Contact ───────── */
.contact-layout { display: grid; grid-template-columns: 1.3fr 1fr; gap: 14px; align-items: start; }
.contact-main { padding: 44px; display: flex; flex-direction: column; justify-content: space-between; }
.contact-big { font-family: var(--f-display); font-size: clamp(44px, 6vw, 80px); font-weight: 800; letter-spacing: -.04em; line-height: .95; color: var(--ink); margin: 0; }
.contact-big em { font-family: var(--f-serif); font-style: italic; font-weight: 400; color: var(--accent-amber); }
.contact-big .stroke { -webkit-text-stroke: 1px var(--ink); color: transparent; }
.contact-mail {
  display: inline-flex; align-items: center; gap: 14px; margin-top: 28px;
  font-family: var(--f-display); font-size: 26px; font-weight: 500; color: var(--ink);
  padding: 10px 0; border-bottom: 1px solid var(--line);
  transition: color .2s ease, border-color .2s ease;
}
.contact-mail:hover { color: var(--accent); border-color: var(--accent); }
.contact-mail .arrow { transition: transform .2s ease; }
.contact-mail:hover .arrow { transform: translate(4px, -4px) rotate(-0deg); }

.contact-socials { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 34px; }
.contact-socials a {
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px;
  border: 1px solid var(--line); border-radius: 4px; font-family: var(--f-mono); font-size: 12px; color: var(--ink);
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.contact-socials a:hover { border-color: var(--accent); color: var(--accent); background: var(--bg-panel-2); }

.contact-foot {
  border-top: 1px solid var(--line); padding-top: 16px; margin-top: auto;
  display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-dimmer);
}

.contact-side { display: flex; flex-direction: column; gap: 14px; }
.ping {
  padding: 14px; display: grid; grid-template-columns: 12px 1fr auto; gap: 10px; align-items: center;
  font-size: 12px; border-bottom: 1px solid var(--line);
}
.ping:last-child { border-bottom: none; }
.ping .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.ping .dot.amber { background: var(--accent-amber); box-shadow: 0 0 6px var(--accent-amber); }
.ping .who { color: var(--ink); }
.ping .who span { color: var(--ink-dim); font-size: 11px; display: block; margin-top: 2px; }
.ping .t { color: var(--ink-dimmer); font-size: 10px; font-family: var(--f-mono); }

/* ───────── Tweaks ───────── */
.tweaks-panel {
  position: fixed; right: 16px; bottom: calc(var(--foot) + 14px); z-index: 200;
  width: 280px; background: var(--bg-panel-2); border: 1px solid var(--line); border-radius: 6px;
  padding: 14px; font-family: var(--f-mono); font-size: 11px; color: var(--ink-dim);
  box-shadow: 0 20px 50px -10px rgba(0,0,0,.6);
}
.tweaks-panel h4 { font-family: var(--f-display); font-weight: 700; font-size: 12px; margin: 0 0 10px; color: var(--ink); display: flex; align-items: center; gap: 8px; letter-spacing: .08em; text-transform: uppercase; }
.tweaks-panel h4::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.tweak-row { display: grid; grid-template-columns: 80px 1fr; gap: 10px; align-items: center; margin-bottom: 8px; }
.tweak-row label { color: var(--ink-dimmer); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.tweak-row input[type=color] { width: 100%; height: 24px; background: transparent; border: 1px solid var(--line); border-radius: 3px; padding: 1px; cursor: pointer; }
.tweak-row input[type=range] { width: 100%; accent-color: var(--accent); }
.tweak-row select { background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 3px; padding: 4px 6px; font-family: var(--f-mono); font-size: 10px; }

/* Responsive: hero console stacks before nav collapses */
@media (max-width: 1280px) {
  .hero-panel { grid-template-columns: 1fr; }
  .hero-console { border-left: none; border-top: 1px dashed var(--line); padding: 22px 40px 28px; }
}

/* ───────── Responsive: tablet / mobile ───────── */
@media (max-width: 900px) {
  :root {
    --nav-w: 0px;
    --foot: 58px;
    --frame: 40px;
  }

  /* Layouts collapse to single column */
  .home-grid, .work-wrap, .writing-layout, .about-layout, .contact-layout { grid-template-columns: 1fr; }
  .wd-body { grid-template-columns: 1fr; }
  .hero-panel { grid-template-columns: 1fr; }
  .hero-console { display: none; }
  .work-list { position: static; }

  /* Frame top: keep logo + time, drop everything else */
  .frame-top { padding: 0 12px; font-size: 10px; }
  .ft-logo { font-size: 11px; letter-spacing: .06em; }
  .ft-left .ft-sep, .ft-sub { display: none; }
  .ft-right span:not(.live-dot):not(#status-word):not(#local-time) { display: none; }
  .ft-right .ft-sep { display: none; }
  .ft-right { gap: 8px; }

  /* Frame bot: hide on mobile, nav takes over */
  .frame-bot { display: none; }

  /* Nav becomes horizontal bottom tab bar */
  .frame-nav {
    display: flex !important;
    flex-direction: row;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: var(--foot);
    padding: 0;
    border-right: none;
    border-top: 1px solid var(--line);
    z-index: 60;
    background: var(--bg-panel);
  }
  .frame-nav > *:not(.nav-item) { display: none !important; }
  .nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2px;
    padding: 6px 4px;
    border-left: none;
    border-top: 2px solid transparent;
    grid-template-columns: none;
    text-align: center;
  }
  .nav-item.active {
    border-left-color: transparent;
    border-top-color: var(--accent);
  }
  .nav-item .ni-num { font-size: 9px; letter-spacing: .08em; color: var(--ink-dimmer); }
  .nav-item .ni-label { font-size: 10px; letter-spacing: .08em; }
  .nav-item .ni-count { display: none; }

  /* Page padding tighter */
  .page { padding: 14px 14px 24px; }

  /* Hero */
  .hero-inner { padding: 22px 18px; }
  .hero-title { font-size: clamp(30px, 9vw, 56px); line-height: .95; }
  .hero-sub { font-size: 12px; margin-top: 16px; }
  .hero-eyebrow { flex-wrap: wrap; gap: 8px; font-size: 9px; margin-bottom: 12px; }

  /* Panels */
  .panel-body { padding: 14px; }
  .panel-head { padding: 10px 14px; font-size: 9px; }

  /* Typography scale */
  .bignum { font-size: 44px; }
  .bio-stat .n { font-size: 36px; }
  .contact-big { font-size: clamp(36px, 10vw, 56px) !important; }
  .bio-lede { font-size: clamp(18px, 4.5vw, 24px); }

  /* Section headers on pages (h2) */
  .page h2 { font-size: clamp(26px, 7vw, 36px) !important; line-height: 1; }
  .wd-head h2 { font-size: clamp(26px, 7vw, 34px); }
  .wd-head { padding: 16px 16px; grid-template-columns: 1fr; gap: 12px; }
  .wd-metrics { flex-wrap: wrap; gap: 16px; justify-content: flex-start; text-align: left; }
  .wd-metrics .m .v { font-size: 22px; }

  /* Work rows */
  .wd-body { padding: 16px; gap: 14px; }
  .work-row { padding: 12px; }
  .work-row .wr-title { font-size: 17px; }

  /* Writing rows: stack date/tag above title */
  .writing-row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 14px 4px;
  }
  .writing-row > :last-child { font-size: 10px; color: var(--ink-dimmer); }

  /* Publications: stack meta above body */
  .pub-row { grid-template-columns: 1fr; gap: 8px; padding: 14px 4px; }
  .pub-meta { flex-direction: row; align-items: baseline; gap: 12px; }
  .pub-year { font-size: 14px; }

  /* Bio grid: keep 2x2 */
  .bio-panel { padding: 20px; }
  .bio-stat { padding: 14px; }

  /* Timeline compact */
  .timeline-row { grid-template-columns: 70px 14px 1fr; gap: 10px; }

  /* Contact */
  .contact-main { padding: 22px 18px; }
  .contact-mail {
    font-size: clamp(18px, 6vw, 26px);
    gap: 10px;
    flex-wrap: wrap;
    overflow-wrap: anywhere;
    word-break: break-all;
  }
  .contact-mail .arrow svg { width: 18px; height: 18px; }
  .contact-foot { flex-direction: column; align-items: flex-start; gap: 8px; }

  /* Hide tweaks panel on mobile */
  .tweaks-panel, #tweaks-root button { display: none !important; }

  /* Decorative overlays softened */
  .scan { opacity: .6; }
  .grid-bg { background-size: 32px 32px; }

  /* Transition: smaller label */
  .trans-label { font-size: 9px; padding: 4px 10px; }
}

@media (max-width: 480px) {
  .frame-top { font-size: 9px; padding: 0 10px; }
  .ft-right #status-word { font-size: 9px; }
  .nav-item .ni-label { font-size: 9px; }
  .nav-item .ni-num { display: none; }
  .hero-title { font-size: clamp(26px, 10vw, 44px); }
  .bio-grid { grid-template-columns: 1fr; }
  .wd-metrics { gap: 12px; }
  .wd-metrics .m .v { font-size: 20px; }
}
