/* Salah Harb — v3 · Neo-Tokyo cyberpunk */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=JetBrains+Mono:wght@300;400;500;600&family=Noto+Sans+JP:wght@400;500;700&display=swap');

:root {
  --bg:           #05060a;
  --bg-1:         #0a0c14;
  --bg-2:         #0f1220;
  --panel:        #0d1120;
  --grid:         rgba(255, 43, 214, 0.07);
  --grid-2:       rgba(0, 234, 255, 0.05);

  --ink:          #e9ecf5;
  --ink-2:        #a6adc2;
  --mid:          #646b83;
  --dim:          #3a4058;
  --line:         rgba(150, 170, 210, 0.14);
  --line-hot:     rgba(255, 43, 214, 0.35);

  --mag:          #ff2bd6;
  --mag-2:        #ff6ee5;
  --cyan:         #00eaff;
  --cyan-2:       #66f4ff;
  --amber:        #ffb347;
  --lime:         #b4ff39;

  --shadow-mag:   0 0 24px rgba(255,43,214,0.35), 0 0 2px rgba(255,43,214,0.8);
  --shadow-cyan:  0 0 24px rgba(0,234,255,0.3),  0 0 2px rgba(0,234,255,0.7);

  --sans:         'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --mono:         'JetBrains Mono', ui-monospace, Menlo, monospace;
  --jp:           'Noto Sans JP', system-ui, sans-serif;

  --maxw:         1360px;
  --pad:          56px;

  --scanline-opacity: 0.12;
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg:      #f4efe6;
  --bg-1:    #ebe5d8;
  --bg-2:    #e2dbcb;
  --panel:   #eee8db;
  --grid:    rgba(214, 26, 168, 0.10);
  --grid-2:  rgba(0, 160, 180, 0.08);

  --ink:     #0e0a18;
  --ink-2:   #3a2f48;
  --mid:     #6a6177;
  --dim:     #a79cb0;
  --line:    rgba(20,10,40,0.16);
  --line-hot:rgba(214,26,168,0.35);

  --mag:     #d61aa8;
  --mag-2:   #ff3dc5;
  --cyan:    #00a8bf;
  --cyan-2:  #2dcae0;
  --amber:   #c87b10;
  --lime:    #7fb820;
  --shadow-mag:  0 0 20px rgba(214,26,168,0.25), 0 0 2px rgba(214,26,168,0.6);
  --shadow-cyan: 0 0 20px rgba(0,168,191,0.22),  0 0 2px rgba(0,168,191,0.6);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); }

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 20% 0%, rgba(255,43,214,0.08), transparent 60%),
    radial-gradient(ellipse 60% 60% at 100% 30%, rgba(0,234,255,0.06), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-1) 100%);
  min-height: 100vh;
}
html[data-theme="light"] body {
  background:
    radial-gradient(ellipse 80% 60% at 20% 0%, rgba(214,26,168,0.12), transparent 60%),
    radial-gradient(ellipse 60% 60% at 100% 30%, rgba(0,168,191,0.10), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-1) 100%);
}

/* background grid (global) */
body::before {
  content: "";
  position: fixed; inset: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    linear-gradient(var(--grid-2) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-2) 1px, transparent 1px);
  background-size: 80px 80px, 80px 80px, 16px 16px, 16px 16px;
  background-position: -1px -1px, -1px -1px, -1px -1px, -1px -1px;
  pointer-events: none; z-index: 0; opacity: .7;
  mask-image: radial-gradient(ellipse 100% 80% at 50% 30%, #000 30%, transparent 90%);
}

/* scanlines toggleable */
body.scanlines::after {
  content: "";
  position: fixed; inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(255,255,255,var(--scanline-opacity)) 0 1px,
    transparent 1px 3px
  );
  pointer-events: none; z-index: 9998; mix-blend-mode: overlay;
}

/* custom reticle cursor (desktop) */
@media (pointer: fine) {
  html, body, a, button { cursor: none; }
  .reticle {
    position: fixed; top: 0; left: 0;
    width: 28px; height: 28px;
    border: 1px solid var(--cyan);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none; z-index: 9999;
    mix-blend-mode: exclusion;
    transition: width .15s ease, height .15s ease, border-color .15s ease;
    will-change: transform;
  }
  .reticle::before, .reticle::after {
    content: ""; position: absolute; background: var(--cyan);
  }
  .reticle::before { left: 50%; top: -6px; width: 1px; height: 4px; transform: translateX(-50%); }
  .reticle::after  { left: 50%; bottom: -6px; width: 1px; height: 4px; transform: translateX(-50%); }
  .reticle .dot {
    position: absolute; top: 50%; left: 50%;
    width: 3px; height: 3px; background: var(--mag);
    border-radius: 50%; transform: translate(-50%,-50%);
    box-shadow: 0 0 8px var(--mag);
  }
  .reticle.hot { width: 48px; height: 48px; border-color: var(--mag); }
}

a { color: var(--ink); text-decoration: none; position: relative; }
a:hover { color: var(--cyan); }

.page {
  position: relative; z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px var(--pad) 120px;
}
@media (max-width: 760px) { .page { padding: 14px 20px 80px; } :root { --pad: 20px; } }

/* ========= NAV ========= */
.nav3 {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  background: rgba(10,12,20,0.6);
  backdrop-filter: blur(10px);
  position: sticky; top: 12px; z-index: 100;
  border-radius: 2px;
}
html[data-theme="light"] .nav3 { background: rgba(244,239,230,0.72); }
.nav3 .brand {
  display: flex; align-items: baseline; gap: 12px;
  font-family: var(--sans); font-weight: 600; font-size: 15px; letter-spacing: 0.01em;
}
.nav3 .brand .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mag); box-shadow: 0 0 10px var(--mag); display: inline-block; }
.nav3 .brand small { font-family: var(--mono); font-size: 10px; color: var(--mid); letter-spacing: 0.06em; text-transform: uppercase; font-weight: 400; }
.nav3 nav { display: flex; gap: 4px; justify-content: center; font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; }
.nav3 nav a { padding: 8px 12px; color: var(--ink-2); border: 1px solid transparent; }
.nav3 nav a:hover { color: var(--cyan); border-color: var(--line); }
.nav3 nav a[aria-current="page"] { color: var(--ink); border-color: var(--mag); box-shadow: inset 0 0 0 1px rgba(255,43,214,0.2); }
.nav3 nav a[aria-current="page"]::before { content: "▸ "; color: var(--mag); }
.nav3 .utils { justify-self: end; display: flex; gap: 8px; align-items: center; font-family: var(--mono); font-size: 10.5px; color: var(--mid); }
.nav3 .utils .status { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border: 1px solid var(--line); }
.nav3 .utils .status .blink { width: 6px; height: 6px; background: var(--lime); border-radius: 50%; animation: blink 1.5s infinite; }
@keyframes blink { 0%, 60% { opacity: 1; } 61%, 100% { opacity: 0.25; } }
.chip-btn {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em;
  background: transparent; border: 1px solid var(--line); color: var(--ink-2);
  padding: 5px 9px; cursor: pointer; text-transform: uppercase;
}
.chip-btn:hover { border-color: var(--cyan); color: var(--cyan); }
.chip-btn[aria-pressed="true"] { border-color: var(--mag); color: var(--mag); }

@media (max-width: 760px) {
  .nav3 { grid-template-columns: 1fr; gap: 10px; }
  .nav3 .utils { justify-self: start; }
  .nav3 nav { justify-content: flex-start; flex-wrap: wrap; }
}

/* ========= HERO ========= */
.hero {
  position: relative;
  margin: 36px 0 20px;
  border: 1px solid var(--line);
  overflow: hidden;
  min-height: clamp(520px, 72vh, 780px);
  background: linear-gradient(180deg, var(--bg-1) 0%, var(--bg) 100%);
}
.hero .hud { position: absolute; top: 0; right: 0; bottom: 0; left: 44%; z-index: 1; border-left: 1px dashed var(--line); }
.hero .hud canvas { width: 100%; height: 100%; display: block; }
@media (max-width: 860px) { .hero .hud { left: 0; opacity: 0.35; } }
.hero .katakana {
  position: absolute; inset: 0; z-index: 2;
  font-family: var(--jp);
  color: rgba(255,43,214,0.12);
  font-size: 14px;
  pointer-events: none;
  overflow: hidden;
}
.hero .scan {
  position: absolute; inset: 0; z-index: 3;
  background: linear-gradient(180deg, transparent 0%, rgba(0,234,255,0.04) 50%, transparent 100%);
  background-size: 100% 200px;
  animation: scan 6s linear infinite;
  pointer-events: none;
}
@keyframes scan { 0% { background-position: 0 -200px; } 100% { background-position: 0 calc(100% + 200px); } }

.hero .inner {
  position: relative; z-index: 5;
  padding: 28px 32px;
  display: grid; grid-template-rows: auto 1fr auto; height: 100%;
  min-height: clamp(520px, 72vh, 780px);
  pointer-events: none;
}
.hero .inner a, .hero .inner button { pointer-events: auto; }
.hero .eyebrow {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px;
  font-family: var(--mono); font-size: 10.5px;
  color: var(--mid); letter-spacing: 0.12em; text-transform: uppercase;
  max-width: 42%;
}
@media (max-width: 860px) { .hero .eyebrow { max-width: 100%; } }
.hero .eyebrow .group { display: flex; gap: 16px; flex-wrap: wrap; }
.hero .eyebrow b { color: var(--mag); font-weight: 500; }
.hero .eyebrow .k { color: var(--cyan); }

.hero h1 {
  font-family: var(--sans);
  font-size: clamp(44px, 7vw, 104px);
  line-height: 0.9;
  font-weight: 500;
  letter-spacing: -0.045em;
  margin: 24px 0 20px;
  align-self: center;
  position: relative;
  text-transform: uppercase;
  max-width: 42%;
}
@media (max-width: 860px) { .hero h1 { max-width: 100%; font-size: clamp(44px, 12vw, 88px); } }
.hero h1 .jp-super {
  display: block;
  font-family: var(--jp);
  font-weight: 400;
  font-size: clamp(14px, 1.2vw, 18px);
  letter-spacing: 0.2em;
  color: var(--cyan);
  margin-bottom: 16px;
  opacity: 0.85;
}
.hero h1 .line { display: block; position: relative; }
.hero h1 .line span { position: relative; display: inline-block; }
.hero h1 .line .amp {
  color: var(--mag);
  font-weight: 400;
  font-style: italic;
  text-shadow: 0 0 40px var(--mag), 0 0 8px var(--mag);
}
.hero h1 .glitch { position: relative; }
.hero h1 .glitch::before, .hero h1 .glitch::after {
  content: attr(data-text); position: absolute; left: 0; top: 0; width: 100%;
  overflow: hidden;
}
.hero h1 .glitch::before { color: var(--mag); transform: translate(-2px, 0); clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%); mix-blend-mode: screen; }
.hero h1 .glitch::after  { color: var(--cyan); transform: translate(2px, 0);  clip-path: polygon(0 60%, 100% 60%, 100% 100%, 0 100%); mix-blend-mode: screen; }
.hero h1 .glitch.shake::before { animation: glitchA .6s steps(2) forwards; }
.hero h1 .glitch.shake::after  { animation: glitchB .6s steps(2) forwards; }
@keyframes glitchA { 0% {transform: translate(-2px,0);} 20% {transform: translate(-6px,1px);} 40% {transform: translate(2px,-2px);} 100% {transform: translate(-2px,0);} }
@keyframes glitchB { 0% {transform: translate(2px,0);} 20% {transform: translate(6px,-1px);} 40% {transform: translate(-2px,2px);} 100% {transform: translate(2px,0);} }

.hero .foot {
  display: grid; grid-template-columns: 1fr;
  gap: 24px; align-items: end;
  padding-top: 28px;
  border-top: 1px dashed var(--line);
  max-width: 42%;
}
@media (max-width: 860px) { .hero .foot { grid-template-columns: 1fr; gap: 20px; max-width: 100%; } }
.hero .lede {
  font-size: clamp(16px, 1.4vw, 19px);
  line-height: 1.5; color: var(--ink-2); margin: 0; max-width: 50ch;
}
.hero .lede em { font-style: normal; color: var(--cyan); }
.hero .lede b { font-weight: 500; color: var(--mag); }
.hero .stamp {
  font-family: var(--mono); font-size: 11px; color: var(--mid);
  display: grid; grid-template-columns: auto 1fr; gap: 4px 14px;
}
.hero .stamp dt { color: var(--cyan); text-transform: uppercase; letter-spacing: 0.1em; }
.hero .stamp dd { margin: 0; color: var(--ink-2); }

/* corner brackets */
.brackets { position: absolute; inset: 8px; z-index: 6; pointer-events: none; }
.brackets::before, .brackets::after,
.brackets > i::before, .brackets > i::after {
  content: ""; position: absolute; width: 18px; height: 18px;
  border: 1px solid var(--mag);
}
.brackets::before { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.brackets::after  { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.brackets > i { position: absolute; inset: 0; pointer-events: none; }
.brackets > i::before { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.brackets > i::after  { bottom: 0; right: 0; border-left: 0; border-top: 0; }

/* ========= TICKER ========= */
.ticker {
  border: 1px solid var(--line);
  background: rgba(255,43,214,0.04);
  padding: 10px 0;
  font-family: var(--mono); font-size: 11px;
  color: var(--ink-2);
  letter-spacing: 0.08em; text-transform: uppercase;
  margin: 16px 0 72px;
  overflow: hidden;
  position: relative;
}
.ticker .track { display: flex; gap: 48px; white-space: nowrap; animation: tick 40s linear infinite; width: max-content; will-change: transform; }
.ticker .track span { display: inline-flex; align-items: center; gap: 48px; }
.ticker .track span::after { content: "◆"; color: var(--mag); margin-left: 48px; }
@keyframes tick { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
.ticker:hover .track { animation-play-state: paused; }

/* ========= SECTION ========= */
.sec { margin: 96px 0; position: relative; }
.sec-head {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 24px;
  align-items: end;
  margin-bottom: 36px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.sec-head::after {
  content: ""; position: absolute; left: 0; bottom: -1px;
  width: 110px; height: 1px; background: var(--mag); box-shadow: 0 0 10px var(--mag);
}
.sec-head .num { font-family: var(--mono); font-size: 11px; color: var(--mag); letter-spacing: 0.15em; }
.sec-head .num b { color: var(--cyan); font-weight: 500; }
.sec-head h2 {
  font-family: var(--sans); font-weight: 500;
  font-size: clamp(26px, 3.4vw, 46px);
  letter-spacing: -0.025em;
  margin: 0; text-transform: uppercase;
}
.sec-head h2 .slash { color: var(--mag); font-weight: 400; margin-right: 8px; }
.sec-head h2 .jp {
  font-family: var(--jp); font-weight: 400;
  color: var(--ink-2); font-size: 0.45em; margin-left: 14px; vertical-align: middle;
  letter-spacing: 0.2em; opacity: .65;
}
.sec-head .right { font-family: var(--mono); font-size: 11px; color: var(--mid); text-align: right; }
@media (max-width: 720px) {
  .sec-head { grid-template-columns: 1fr; gap: 4px; align-items: start; }
  .sec-head::after { width: 60px; }
  .sec-head .right { text-align: left; }
}

/* ========= BIO ========= */
.bio {
  display: grid;
  grid-template-columns: 1.1fr 1.3fr;
  gap: 48px;
  align-items: start;
}
@media (max-width: 860px) { .bio { grid-template-columns: 1fr; gap: 24px; } }
.bio .drop {
  font-size: clamp(20px, 2vw, 26px);
  line-height: 1.3;
  color: var(--ink);
  font-weight: 400;
  padding-right: 10px;
  border-left: 1px solid var(--mag);
  padding-left: 22px;
  position: relative;
}
.bio .drop::before {
  content: "▸"; position: absolute; left: -7px; top: 0;
  background: var(--bg); color: var(--mag); font-family: var(--mono); font-size: 10px; padding: 2px;
}
.bio .drop em { color: var(--cyan); font-style: normal; }
.bio .body p { margin: 0 0 14px; color: var(--ink-2); max-width: 64ch; }
.bio .body .mono { font-family: var(--mono); color: var(--cyan); font-size: 0.92em; }

/* ========= BUTTONS ========= */
.btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.btn3 {
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  border: 1px solid var(--line); background: transparent; color: var(--ink);
  padding: 11px 18px; text-decoration: none;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  transition: color .2s, background .2s, border-color .2s;
}
.btn3::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,43,214,0.12), transparent);
  transform: translateX(-100%); transition: transform .45s ease;
}
.btn3:hover::before { transform: translateX(100%); }
.btn3:hover { color: var(--cyan); border-color: var(--cyan); }
.btn3.primary { background: var(--mag); color: #0a0012; border-color: var(--mag); box-shadow: var(--shadow-mag); }
.btn3.primary:hover { background: var(--cyan); color: #00151a; border-color: var(--cyan); box-shadow: var(--shadow-cyan); }
.btn3 .k { color: var(--mag); font-weight: 500; }
.btn3.primary .k { color: #0a0012; }

/* ========= PROJECTS ========= */
.p-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
}
.p-card {
  grid-column: span 6;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(13,17,32,0.6), rgba(13,17,32,0.3));
  padding: 18px 20px 22px;
  position: relative;
  transition: border-color .25s, transform .25s, box-shadow .25s;
}
html[data-theme="light"] .p-card { background: linear-gradient(180deg, rgba(255,255,255,0.5), rgba(255,255,255,0.2)); }
.p-card:hover { border-color: var(--cyan); transform: translateY(-2px); box-shadow: 0 0 40px rgba(0,234,255,0.1); }
.p-card::before {
  content: ""; position: absolute; top: -1px; left: -1px; width: 14px; height: 14px;
  border-top: 1px solid var(--mag); border-left: 1px solid var(--mag);
}
.p-card::after {
  content: ""; position: absolute; bottom: -1px; right: -1px; width: 14px; height: 14px;
  border-bottom: 1px solid var(--mag); border-right: 1px solid var(--mag);
}
.p-card.feature { grid-column: span 12; }
@media (max-width: 860px) { .p-card, .p-card.feature { grid-column: span 12; } }

.p-card .meta { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10.5px; color: var(--mid); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 14px; }
.p-card .meta b { color: var(--cyan); font-weight: 500; }
.p-card .meta .id { color: var(--mag); }
.p-card h3 {
  font-family: var(--sans); font-weight: 500;
  font-size: clamp(22px, 2.4vw, 32px);
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0 0 12px;
}
.p-card.feature h3 { font-size: clamp(28px, 3.4vw, 44px); }
.p-card h3 em { font-style: normal; color: var(--mag); }
.p-card h3 em.cy { color: var(--cyan); }
.p-card p { color: var(--ink-2); max-width: 62ch; margin: 0 0 14px; font-size: 15px; }
.p-card .tags {
  font-family: var(--mono); font-size: 10.5px; color: var(--mid); letter-spacing: 0.08em;
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px;
}
.p-card .tags span { border: 1px solid var(--line); padding: 3px 8px; color: var(--ink-2); }
.p-card .tags span.hot { border-color: var(--mag); color: var(--mag); }
.p-card .tags span.cy { border-color: var(--cyan); color: var(--cyan); }

/* feature viz band */
.p-card .band {
  height: 240px;
  margin: 0 -20px 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  background:
    repeating-linear-gradient(90deg, rgba(0,234,255,0.04) 0 1px, transparent 1px 60px),
    repeating-linear-gradient(0deg, rgba(255,43,214,0.04) 0 1px, transparent 1px 60px),
    linear-gradient(180deg, var(--bg-2), var(--bg-1));
}
.p-card .band canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.p-card .band .badge {
  position: absolute; top: 10px; left: 12px;
  font-family: var(--mono); font-size: 10px; color: var(--cyan); letter-spacing: 0.1em;
}
.p-card .band .badge.r { left: auto; right: 12px; top: auto; bottom: 10px; color: var(--mag); }
.p-card .band .corner { position: absolute; width: 20px; height: 20px; border: 1px solid var(--cyan); }
.p-card .band .corner.tr { top: 8px; right: 8px; border-left: 0; border-bottom: 0; }
.p-card .band .corner.bl { bottom: 8px; left: 8px; border-right: 0; border-top: 0; }

/* ========= INTERESTS ========= */
.tags-wall {
  display: flex; flex-wrap: wrap; gap: 8px;
  font-family: var(--mono); font-size: 12px; color: var(--ink-2);
}
.tags-wall span {
  border: 1px solid var(--line); padding: 7px 12px;
  background: rgba(255,255,255,0.02);
  letter-spacing: 0.04em;
  transition: color .2s, border-color .2s, transform .2s;
}
.tags-wall span:hover { color: var(--cyan); border-color: var(--cyan); transform: translateY(-1px); }
.tags-wall span.hot { background: rgba(255,43,214,0.08); color: var(--mag); border-color: var(--line-hot); }
.tags-wall span.hot:hover { color: var(--mag); border-color: var(--mag); box-shadow: var(--shadow-mag); }

/* ========= GALLERY ========= */
.gal3 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 860px) { .gal3 { grid-template-columns: repeat(2, 1fr); } }
.gal3 .tile {
  aspect-ratio: 3/4;
  border: 1px solid var(--line);
  background: var(--bg-2);
  position: relative; overflow: hidden;
  margin: 0;
}
.gal3 .tile canvas, .gal3 .tile svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.gal3 .tile .cap {
  position: absolute; left: 8px; bottom: 8px;
  font-family: var(--mono); font-size: 10px; color: var(--cyan); letter-spacing: 0.08em;
  background: rgba(5,6,10,0.7); padding: 3px 6px; border: 1px solid var(--line);
  text-transform: uppercase;
}
.gal3 .tile .code {
  position: absolute; top: 8px; right: 8px;
  font-family: var(--mono); font-size: 9.5px; color: var(--mag);
  background: rgba(5,6,10,0.7); padding: 2px 6px; border: 1px solid var(--line);
}

/* ========= OFF-HOURS pull ========= */
.pull {
  font-size: clamp(22px, 2.4vw, 34px);
  line-height: 1.3;
  max-width: 40ch;
  color: var(--ink);
  font-weight: 300;
  letter-spacing: -0.01em;
  padding: 8px 0 8px 26px;
  border-left: 1px solid var(--cyan);
}
.pull .mag { color: var(--mag); }
.pull .cy { color: var(--cyan); }

/* ========= FOOTER ========= */
.foot3 {
  margin-top: 120px;
  padding: 32px 0 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 36px;
  font-family: var(--mono); font-size: 12px;
  color: var(--mid); letter-spacing: 0.04em;
  position: relative;
}
.foot3::before {
  content: ""; position: absolute; left: 0; top: -1px; width: 120px; height: 1px;
  background: var(--cyan); box-shadow: 0 0 10px var(--cyan);
}
.foot3 h5 {
  color: var(--mag); font-family: var(--mono); font-size: 10.5px; margin: 0 0 10px;
  letter-spacing: 0.12em; text-transform: uppercase;
}
.foot3 h5::before { content: "[ "; color: var(--ink-2); }
.foot3 h5::after  { content: " ]"; color: var(--ink-2); }
.foot3 a { color: var(--ink-2); display: block; padding: 3px 0; }
.foot3 a:hover { color: var(--cyan); }
.foot3 .mark {
  display: flex; flex-direction: column; gap: 14px;
}
.foot3 .mark .sig { font-family: var(--sans); font-weight: 600; color: var(--ink); font-size: 22px; letter-spacing: -0.01em; text-transform: uppercase; }
.foot3 .mark .sig .mag { color: var(--mag); }
.foot3 .mark .loc { color: var(--ink-2); font-size: 11px; }
.foot3 .mark .time { color: var(--cyan); font-size: 11px; }
@media (max-width: 860px) { .foot3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 540px) { .foot3 { grid-template-columns: 1fr; } }

::selection { background: var(--mag); color: #0a0012; }
html[data-theme="light"] ::selection { background: var(--mag); color: #fff; }

/* ========= PAGE HEAD (sub-pages) ========= */
.ph3 {
  position: relative;
  padding: 48px 0 56px;
  margin: 36px 0 48px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(13,17,32,0.7), rgba(13,17,32,0.2));
  overflow: hidden;
}
html[data-theme="light"] .ph3 { background: linear-gradient(180deg, rgba(255,255,255,0.4), rgba(255,255,255,0.1)); }
.ph3::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(0,234,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,234,255,0.06) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at 20% 30%, #000 30%, transparent 80%);
}
.ph3 .inner { position: relative; padding: 0 32px; z-index: 2; }
.ph3 .eyebrow { font-family: var(--mono); font-size: 10.5px; color: var(--mag); letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 18px; }
.ph3 .eyebrow b { color: var(--cyan); font-weight: 500; }
.ph3 h1 {
  font-family: var(--sans); font-weight: 500; text-transform: uppercase;
  font-size: clamp(40px, 7vw, 104px);
  line-height: 0.9; letter-spacing: -0.035em; margin: 0 0 20px;
}
.ph3 h1 .slash { color: var(--mag); }
.ph3 h1 .jp { display: block; font-family: var(--jp); font-size: 0.14em; letter-spacing: 0.3em; color: var(--cyan); font-weight: 400; margin-bottom: 12px; text-transform: none; opacity: 0.9; }
.ph3 .lede { font-size: clamp(15px, 1.4vw, 19px); color: var(--ink-2); max-width: 66ch; margin: 0; line-height: 1.5; }
.ph3 .lede a { color: var(--cyan); border-bottom: 1px solid var(--line); }
.ph3 .lede a:hover { border-color: var(--cyan); }

.ph3 .stat-row {
  display: flex; flex-wrap: wrap; gap: 20px 36px; margin-top: 28px;
  padding-top: 22px; border-top: 1px dashed var(--line);
  font-family: var(--mono); font-size: 11px; color: var(--mid); text-transform: uppercase; letter-spacing: 0.08em;
}
.ph3 .stat-row .stat b { color: var(--cyan); font-weight: 500; display: block; font-size: 22px; font-family: var(--sans); letter-spacing: -0.01em; margin-bottom: 2px; }
.ph3 .stat-row .stat b.mag { color: var(--mag); }

/* ========= TIMELINE ========= */
.tl3 { list-style: none; margin: 0; padding: 0; }
.tl3 li {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 36px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  position: relative;
}
.tl3 li:first-child { border-top: 1px solid var(--mag); }
.tl3 li::before {
  content: ""; position: absolute; left: 166px; top: 28px;
  width: 10px; height: 10px; border: 1px solid var(--mag); background: var(--bg);
  transform: rotate(45deg);
}
.tl3 li:first-child::before { background: var(--mag); box-shadow: var(--shadow-mag); }
.tl3 .when { font-family: var(--mono); font-size: 11px; color: var(--mag); letter-spacing: 0.1em; text-transform: uppercase; padding-top: 6px; }
.tl3 .what h4 { font-family: var(--sans); font-weight: 500; font-size: 20px; margin: 0 0 4px; letter-spacing: -0.01em; }
.tl3 .what h4 em { font-style: normal; color: var(--cyan); }
.tl3 .what .where { font-family: var(--mono); font-size: 10.5px; color: var(--ink-2); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.06em; }
.tl3 .what ul { margin: 6px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 14.5px; }
.tl3 .what ul li { padding: 0; border: 0; display: list-item; margin-bottom: 4px; grid-template-columns: unset; }
.tl3 .what ul li::before { content: none; }
.tl3 .what ul li::marker { color: var(--mag); }
@media (max-width: 720px) {
  .tl3 li { grid-template-columns: 1fr; gap: 6px; }
  .tl3 li::before { display: none; }
}

/* ========= KV ========= */
.kv3 { list-style: none; margin: 0; padding: 0; }
.kv3 li {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.kv3 li:first-child { border-top: 1px solid var(--cyan); }
.kv3 .k { font-family: var(--mono); font-size: 10.5px; color: var(--cyan); letter-spacing: 0.08em; text-transform: uppercase; padding-top: 2px; }
.kv3 .k::before { content: "// "; color: var(--mid); }
.kv3 .v { color: var(--ink-2); font-size: 15.5px; }
.kv3 .v b { color: var(--mag); font-weight: 500; }
@media (max-width: 720px) { .kv3 li { grid-template-columns: 1fr; gap: 4px; } }

/* ========= PUBLICATIONS ========= */
.pubs3 { list-style: none; margin: 0; padding: 0; counter-reset: pub; }
.pubs3 li {
  display: grid;
  grid-template-columns: 60px 90px 1fr 140px;
  gap: 24px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  align-items: baseline;
  counter-increment: pub;
  position: relative;
  transition: background .2s;
}
.pubs3 li:first-child { border-top: 1px solid var(--mag); }
.pubs3 li:hover { background: linear-gradient(90deg, rgba(255,43,214,0.06), transparent 70%); }
.pubs3 .n { font-family: var(--mono); font-size: 10.5px; color: var(--mid); letter-spacing: 0.05em; }
.pubs3 .n::before { content: "P." counter(pub, decimal-leading-zero); }
.pubs3 .yr { font-family: var(--mono); font-size: 12px; color: var(--mag); font-weight: 500; }
.pubs3 .t { font-size: 15.5px; line-height: 1.4; letter-spacing: -0.005em; color: var(--ink); }
.pubs3 .t em { color: var(--ink-2); font-style: normal; font-size: 13.5px; display: block; margin-top: 4px; }
.pubs3 .t .venue { display: block; font-family: var(--mono); font-size: 10.5px; color: var(--cyan); margin-top: 6px; letter-spacing: 0.02em; }
.pubs3 .kind { font-family: var(--mono); font-size: 10px; color: var(--mid); text-align: right; text-transform: uppercase; letter-spacing: 0.12em; border: 1px solid var(--line); padding: 4px 8px; justify-self: end; }
.pubs3 li.wip .kind { color: var(--amber); border-color: rgba(255,179,71,0.4); }
.pubs3 li.wip .yr { color: var(--amber); }
@media (max-width: 860px) {
  .pubs3 li { grid-template-columns: 1fr; gap: 4px; padding: 16px 0; }
  .pubs3 .kind { text-align: left; justify-self: start; }
}

/* ========= TWEAKS PANEL ========= */
.tweaks {
  position: fixed; right: 16px; bottom: 16px; z-index: 1000;
  width: 280px;
  border: 1px solid var(--mag);
  background: rgba(10,12,20,0.92);
  backdrop-filter: blur(14px);
  padding: 14px 16px;
  font-family: var(--mono); font-size: 11px; color: var(--ink-2);
  box-shadow: var(--shadow-mag);
  display: none;
}
html[data-theme="light"] .tweaks { background: rgba(244,239,230,0.94); }
.tweaks.on { display: block; }
.tweaks h6 { margin: 0 0 10px; font-size: 10.5px; color: var(--mag); letter-spacing: 0.14em; text-transform: uppercase; }
.tweaks h6::before { content: "[ "; color: var(--ink-2); } .tweaks h6::after { content: " ]"; color: var(--ink-2); }
.tweaks .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px dashed var(--line); }
.tweaks .row:first-of-type { border-top: 0; }
.tweaks .row label { color: var(--cyan); letter-spacing: 0.06em; text-transform: uppercase; font-size: 10px; }
.tweaks .pill { display: inline-flex; gap: 4px; }
.tweaks .pill button {
  font-family: var(--mono); font-size: 10px; padding: 4px 8px;
  background: transparent; border: 1px solid var(--line); color: var(--ink-2); cursor: pointer; text-transform: uppercase; letter-spacing: 0.08em;
}
.tweaks .pill button[aria-pressed="true"] { border-color: var(--mag); color: var(--mag); background: rgba(255,43,214,0.1); }
.tweaks .toggle {
  font-family: var(--mono); font-size: 10px; padding: 4px 10px;
  background: transparent; border: 1px solid var(--line); color: var(--ink-2); cursor: pointer; text-transform: uppercase; letter-spacing: 0.08em;
}
.tweaks .toggle[aria-pressed="true"] { border-color: var(--cyan); color: var(--cyan); background: rgba(0,234,255,0.08); }
.tweaks input[type=range] { flex: 1; accent-color: var(--mag); }

/* ========= MOTION — reduced ========= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  body::after, .hero .scan { display: none; }
}

/* focus ring — lime is the only neon that reads against both cyan and magenta UI */
:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; border-radius: 2px; box-shadow: 0 0 0 4px rgba(180,255,57,0.25); }
.reticle ~ *:focus-visible, :focus-visible { cursor: auto; }

/* ========= MOBILE POLISH ========= */
@media (max-width: 760px) {
  /* Prevent iOS zoom on tap: interactive elements need >=16px */
  .nav3 nav { gap: 0; font-size: 11px; width: 100%; overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; justify-content: flex-start; }
  .nav3 nav::-webkit-scrollbar { display: none; }
  .nav3 nav a { padding: 12px 12px; min-height: 44px; display: inline-flex; align-items: center; flex: 0 0 auto; font-size: 11px; }
  .nav3 nav a[aria-current="page"] { font-size: 12px; }
  .chip-btn { font-size: 12.5px; padding: 11px 14px; min-height: 44px; }
  .btn3 { min-height: 44px; padding: 12px 18px; }
  .pubs3 .kind { align-self: start; }

  /* body text bump for readability */
  body { font-size: 16px; }
  .hero .lede { font-size: 16px; }
  .bio .body p { font-size: 15.5px; }

  /* Hide decorative overlays that were stomping on hero content */
  .hero .hud,
  .hero .katakana,
  .hero .brackets { display: none !important; }
  .hero .scan { opacity: 0.4; }

  /* Make the hero inner stack cleanly on mobile — no more overlap */
  .hero {
    margin: 16px 0 12px;
    padding: 28px 20px 32px;
    min-height: auto;
  }
  .hero .inner { position: relative; z-index: 2; gap: 20px; }
  .hero .eyebrow { gap: 10px; flex-wrap: wrap; font-size: 10.5px; }
  .hero .eyebrow .group { flex-wrap: wrap; }
  .hero h1 .jp-super { font-size: 14px; margin-bottom: 6px; }
  .hero .foot { max-width: 100%; padding-top: 20px; }
  .hero .stamp { grid-template-columns: 60px 1fr; font-size: 12px; }

  /* disable the custom cursor — touch devices don't need it and it hides taps */
  html, body, a, button { cursor: auto !important; }
  .reticle { display: none !important; }
}

/* very narrow phones */
@media (max-width: 380px) {
  :root { --pad: 16px; }
  .page { padding-left: 14px; padding-right: 14px; }
  .nav3 .brand small { display: none; }
  .nav3 .utils .status { padding: 4px 6px; font-size: 10px; }
}
