/* ============ BAOGER — PERSONAL SITE · BOOT SEQUENCE + CHANNEL SCREEN ============ */

:root {
  --room: #0b0c0a;
  --frame: #060606;
  --paper: #d8d4cd;
  --ink: #17150f;
  --red: #e0483a;
  --blue: #2a44e0;
  --navy: #20242e;
  --cream: #ece5d6;
  --amber: #c9992e;
  --display: "Anton", "Arial Narrow", sans-serif;
  --label: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --mono: "Space Mono", "Courier New", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scrollbar-width: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; }

body {
  background: var(--room);
  font-family: var(--label);
  overflow-x: hidden;
  cursor: none;
}
@media (pointer: coarse) { body { cursor: auto; } }

button, a { cursor: none; }
@media (pointer: coarse) { button, a { cursor: auto; } }

.desktop-only { display: inline; }
.mobile-only { display: none; }
@media (pointer: coarse) {
  .desktop-only { display: none; }
  .mobile-only { display: inline; }
}

#scrollSpace { width: 1px; }

@keyframes blink { 50% { opacity: 0.25; } }

/* ============ PRELOADER — inside the TV frame ============ */
#preloader {
  position: fixed;
  inset: clamp(6px, 1vmin, 12px);
  border-radius: clamp(18px, 3vmin, 34px);
  overflow: hidden;
  z-index: 100;
  background: #0a0a0a;
  box-shadow:
    0 0 0 clamp(6px, 1vmin, 12px) var(--frame),
    inset 0 0 120px 30px rgba(0, 0, 0, 0.42),
    inset 0 0 12px 4px rgba(0, 0, 0, 0.65);
  transition: opacity 0.55s ease, visibility 0.55s;
}
#preloader.done { opacity: 0; visibility: hidden; pointer-events: none; }

/* ---- phase 1 · glitched SMPTE bars ---- */
#preBars { position: absolute; inset: 0; }
#preBars[hidden] { display: none; }

.smpte { position: absolute; inset: 0; display: flex; flex-direction: column; }
.smpte-main { flex: 1; display: flex; }
.smpte-main i { flex: 1; }
.s1 { background: #d963c8; } .s2 { background: #e3e34c; }
.s3 { background: #4cdbdb; } .s4 { background: #4cd44c; }
.s5 { background: #d94cd9; } .s6 { background: #dd4b4b; }
.s7 { background: #4b4bdd; }
.smpte-foot { height: 22%; display: flex; }
.smpte-foot i { flex: 1; }
.f1 { background: #232383; } .f2 { background: #101010; }
.f3 { background: #7c2380; } .f4 { background: #161616; }
.f5 { background: #3b3b3b; } .f6 { background: #0c0c0c; }
.f7 { background: #6e6e66; }

#preNoise {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none;
}

.pre-box {
  position: absolute; left: 50%; top: 46%;
  transform: translate(-50%, -50%);
  background: #0a0a0a;
  padding: clamp(24px, 4.5vmin, 48px) clamp(30px, 6vmin, 72px);
  text-align: center;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06), 0 20px 60px rgba(0,0,0,0.5);
}
.pre-word { display: flex; flex-direction: column; gap: 0.32em; margin-bottom: clamp(16px, 3vmin, 30px); }
.pre-word span {
  font-family: var(--label); font-weight: 700;
  font-size: clamp(20px, 3.4vmin, 38px);
  letter-spacing: 0.42em; text-indent: 0.42em;
  color: #f2efe8; line-height: 1;
}
.seg-bar {
  display: flex; gap: 3px; justify-content: center;
  margin-bottom: clamp(14px, 2.6vmin, 26px);
}
.seg-bar i {
  width: clamp(5px, 0.7vmin, 8px); height: clamp(12px, 2vmin, 20px);
  background: rgba(242, 239, 232, 0.16);
}
.seg-bar i.on { background: #f2efe8; }
.pre-skip {
  font-family: var(--label); font-weight: 500;
  font-size: clamp(9px, 1.2vmin, 12px);
  letter-spacing: 0.4em; text-indent: 0.4em;
  color: #d9c94a;
  animation: blink 1.2s steps(2) infinite;
}

/* ---- phase 2 · neural boot terminal ---- */
#preBoot {
  position: absolute; inset: 0;
  background: #0d0c09;
  padding: clamp(24px, 5vmin, 64px);
  color: var(--amber);
}
#preBoot[hidden] { display: none; }
#bootTitle {
  font-family: var(--mono); font-weight: 700;
  font-size: clamp(18px, 3.2vmin, 38px);
  letter-spacing: 0.55em;
  color: #d9b04a;
  text-shadow: 0 0 14px rgba(217, 176, 74, 0.35);
  min-height: 1.4em;
}
.boot-sub {
  font-family: var(--mono);
  font-size: clamp(9px, 1.2vmin, 12px);
  letter-spacing: 0.3em;
  color: rgba(201, 153, 46, 0.65);
  margin: 6px 0 clamp(14px, 2.6vmin, 26px);
}
.boot-sub[hidden] { visibility: hidden; display: block; }
#bootText {
  font-family: var(--mono);
  font-size: clamp(10px, 1.45vmin, 15px);
  line-height: 2.05;
  letter-spacing: 0.05em;
  white-space: pre-wrap;
  color: var(--amber);
  text-shadow: 0 0 10px rgba(201, 153, 46, 0.25);
}
#bootText .cur {
  display: inline-block; width: 0.6em; height: 1em;
  background: var(--amber); vertical-align: -0.15em;
  animation: blink 0.8s steps(2) infinite;
}

/* ============ SCREEN ============ */
#stage { position: fixed; inset: 0; }

#screen {
  position: absolute;
  inset: clamp(10px, 1.6vmin, 20px);
  border-radius: clamp(34px, 6vmin, 80px) / clamp(30px, 5vmin, 66px);
  background: #0d0d0d;
  overflow: hidden;
  box-shadow:
    0 0 0 clamp(8px, 1.4vmin, 16px) var(--frame),
    0 22px 60px rgba(0, 0, 0, 0.5),
    inset 0 0 140px 40px rgba(0, 0, 0, 0.45),
    inset 0 0 14px 5px rgba(0, 0, 0, 0.68);
}

#fluid {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 4; pointer-events: none;
  mix-blend-mode: screen; opacity: 0.85;
  transition: opacity 0.7s ease;
}
#staticCanvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 8; pointer-events: none; opacity: 0;
}

/* texture stack (shared by screen + preloader) */
.grain {
  position: absolute; inset: -60px; z-index: 6; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  opacity: 0.14;
  animation: grainShift 0.6s steps(4) infinite;
  mix-blend-mode: overlay;
}
@keyframes grainShift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-18px, 12px); }
  50% { transform: translate(14px, -20px); }
  75% { transform: translate(-10px, -8px); }
  100% { transform: translate(0, 0); }
}
.crt-scanlines {
  position: absolute; inset: 0; z-index: 6; pointer-events: none;
  background: repeating-linear-gradient(0deg,
    rgba(0,0,0,0.08) 0 1px, transparent 1px 5px);
  mix-blend-mode: multiply;
}
.crt-vignette {
  position: absolute; inset: 0; z-index: 6; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 62%, rgba(0,0,0,0.38) 100%);
}
.corner-mark {
  position: absolute; z-index: 7; pointer-events: none;
  font-family: var(--label); font-weight: 400; font-size: 18px;
  color: #fff; mix-blend-mode: difference; opacity: 0.7;
}
.cm-tl { top: 14px; left: 50%; transform: translateX(-50%); }
.cm-br { bottom: 12px; left: 50%; transform: translateX(-50%); }

/* ============ TOP NAV ============ */
#topnav {
  position: absolute; z-index: 11;
  top: clamp(10px, 1.6vmin, 18px);
  left: clamp(10px, 1.6vmin, 20px);
  right: clamp(10px, 1.6vmin, 20px);
  display: flex; align-items: center; justify-content: space-between;
  padding: clamp(7px, 1.1vmin, 12px) clamp(14px, 2vmin, 24px);
  border: 1px solid rgba(45, 45, 45, 0.3);
  border-radius: 999px;
}
.nav-left, .nav-right { display: flex; align-items: center; }
.nav-link {
  background: none; border: none;
  font-family: var(--label); font-weight: 700;
  font-size: clamp(9px, 1.1vmin, 12px);
  letter-spacing: 0.2em;
  color: rgba(45, 45, 45, 0.8);
  padding: 3px 2px;
  border-bottom: 2px solid transparent;
  transition: opacity 0.2s, border-color 0.2s;
  opacity: 1;
}
.nav-link:hover { opacity: 0.6; }
.nav-link.active { opacity: 1; border-bottom-color: rgba(45, 45, 45, 0.8); }
.nav-right { gap: clamp(12px, 2.2vmin, 28px); }
@media (max-width: 640px) {
  .nav-right { gap: 12px; }
}

/* ============ OSD ============ */
#osd {
  position: absolute; bottom: clamp(14px, 2.6vmin, 30px); right: clamp(18px, 3vmin, 34px);
  z-index: 9; text-align: right;
  mix-blend-mode: difference; color: #fff;
  opacity: 0; transform: translateY(6px);
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}
#osd.show { opacity: 1; transform: none; }
#osdCh { display: block; font-family: var(--display); font-size: clamp(26px, 4.4vmin, 48px); line-height: 1; }
#osdName { display: block; font-family: var(--label); font-weight: 700; font-size: clamp(10px, 1.3vmin, 13px); letter-spacing: 0.35em; opacity: 0.7; }

/* ============ SCENES ============ */
#scenes { position: absolute; inset: 0; z-index: 3; }

.scene {
  position: absolute; inset: 0;
  padding: clamp(64px, 10vmin, 110px) clamp(20px, 4vmin, 56px) clamp(20px, 4vmin, 44px);
  display: flex; flex-direction: column;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}
.scene.live { pointer-events: auto; }
[data-roll] { will-change: transform; }

.ellipse {
  position: absolute; border: 1px solid currentColor;
  border-radius: 50%; opacity: 0.14; pointer-events: none;
}
.e1 { width: 120vmin; height: 46vmin; top: -10vmin; right: -26vmin; transform: rotate(-14deg); }
.e2 { width: 100vmin; height: 34vmin; bottom: 10vmin; left: -28vmin; transform: rotate(9deg); }
.e3 { width: 150vmin; height: 60vmin; top: 4vmin; left: 10vmin; transform: rotate(-7deg); }
.e4 { width: 110vmin; height: 44vmin; bottom: -14vmin; right: -20vmin; transform: rotate(12deg); }
.e5 { width: 130vmin; height: 50vmin; top: 20vmin; left: -30vmin; transform: rotate(-11deg); }

.kicker {
  font-family: var(--label); font-weight: 700;
  font-size: clamp(11px, 1.5vmin, 15px);
  letter-spacing: 0.35em; opacity: 0.75;
  margin-bottom: clamp(10px, 2vmin, 20px);
}
.mega-title {
  font-family: var(--display);
  font-size: clamp(56px, 11.5vmin, 150px);
  line-height: 0.9;
  letter-spacing: 0.01em;
}
.lede {
  font-family: var(--label); font-weight: 500;
  font-size: clamp(12px, 1.75vmin, 18px);
  letter-spacing: 0.1em; line-height: 1.75;
  max-width: 72ch; opacity: 0.92;
  margin-top: clamp(12px, 2.4vmin, 26px);
}

/* --- 0 SYNC --- */
.sc-sync { color: #efe9dc; align-items: center; justify-content: center; }
.bars { position: absolute; inset: 0; display: flex; }
.bars i { flex: 1; opacity: 0.85; }
.bars .b1 { background: #a9a9a1; } .bars .b2 { background: #b3b32f; }
.bars .b3 { background: #2fb3b3; } .bars .b4 { background: #2fa32f; }
.bars .b5 { background: #a32fa3; } .bars .b6 { background: #b33232; }
.bars .b7 { background: #3232b3; }
.sync-center {
  position: relative; z-index: 1; text-align: center;
  background: rgba(8, 8, 8, 0.88);
  padding: clamp(18px, 3.6vmin, 40px) clamp(28px, 6vmin, 72px);
}
.sync-logo { font-family: var(--display); font-size: clamp(48px, 9vmin, 110px); line-height: 1; }
.sync-sub { font-family: var(--label); font-weight: 700; font-size: clamp(10px, 1.4vmin, 14px); letter-spacing: 0.4em; opacity: 0.7; margin-top: 8px; }
.sync-hint {
  font-family: var(--label); font-weight: 700;
  font-size: clamp(10px, 1.3vmin, 13px); letter-spacing: 0.35em;
  margin-top: clamp(14px, 2.6vmin, 28px); opacity: 0.85;
}
.hint-arrow { display: inline-block; animation: hintBob 1.2s ease-in-out infinite; }
@keyframes hintBob { 50% { transform: translateY(4px); } }

/* --- 1 HOME --- */
.sc-home {
  background: var(--paper);
  color: var(--ink);
  padding: 0;
  overflow: hidden;
}
.home-center {
  position: absolute; inset: 0;
  display: flex; align-items: flex-end; justify-content: center;
}
.mega-name {
  position: relative; z-index: 3;
  font-family: var(--display);
  font-size: clamp(110px, 26vmin, 340px);
  line-height: 0.78;
  letter-spacing: 0.02em;
  color: var(--ink);
  margin-bottom: clamp(24px, 5vmin, 68px);
}
.mega-name .lt { display: inline-block; will-change: transform, opacity; }
.home-portrait {
  position: absolute; z-index: 2;
  left: 50%; bottom: 0;
  transform: translateX(-50%);
  will-change: transform;
}
.bust-img {
  display: block;
  width: clamp(270px, 58vmin, 720px);
  height: auto;
}
/* grayscale base + color layer revealed around the cursor */
.bust-gray {
  filter: grayscale(1) contrast(1.05) drop-shadow(0 18px 44px rgba(0, 0, 0, 0.28));
}
.bust-color {
  position: absolute; left: 0; top: 0;
  --rx: 50%; --ry: 35%; --rr: 0px;
  -webkit-mask-image: radial-gradient(circle var(--rr) at var(--rx) var(--ry), #000 62%, transparent 100%);
  mask-image: radial-gradient(circle var(--rr) at var(--rx) var(--ry), #000 62%, transparent 100%);
}

/* name scramble flicker */
.mega-name .lt.scr { opacity: 0.85; }

.side-label {
  position: absolute; z-index: 3; display: flex; align-items: center; gap: 14px;
  color: rgba(23, 21, 15, 0.22); /* pale/ghosted until its side is hovered */
  transition: color 0.5s ease;
  perspective: 800px;
  cursor: none; user-select: none;
}
.side-left { left: clamp(14px, 3.5vmin, 56px); top: 50%; transform: translateY(-50%); }
.side-right { right: clamp(14px, 3.5vmin, 56px); top: 50%; transform: translateY(-50%); }
.side-left.hot { color: var(--red); }
.side-right.hot { color: #2f52c9; }
.big-num {
  font-family: var(--display);
  font-size: clamp(88px, 19vmin, 260px);
  line-height: 0.82;
  display: inline-block;
  transform-style: preserve-3d;
  transform-origin: center bottom;
  /* default: tilted back and pale — faintly visible, lifts upright on hover */
  transform: rotateX(-24deg) translateY(4%);
  opacity: 0.18;
  transition:
    transform 0.55s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.5s ease,
    letter-spacing 0.45s ease;
  letter-spacing: 0.02em;
}
/* active: stands back up, fully shown */
.side-label.hot .big-num {
  transform: rotateX(0deg) translateY(0);
  opacity: 1;
  letter-spacing: -0.01em;
}
/* drum-roll spin while the number scrambles */
.big-num.rolling {
  animation: numSpin 0.4s linear infinite;
  opacity: 1;
}
@keyframes numSpin {
  0% { transform: rotateX(0deg); }
  100% { transform: rotateX(360deg); }
}
.side-vert {
  font-family: var(--label); font-weight: 700;
  font-size: clamp(10px, 1.4vmin, 14px);
  letter-spacing: 0.4em;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}
/* --- 2 PROJECTS --- */
.sc-projects { background: var(--red); color: #f4ede1; }
.proj-intro {
  position: absolute; inset: 0; z-index: 4;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: clamp(0px, 0.5vmin, 8px);
  pointer-events: none; overflow: hidden;
  will-change: transform, opacity;
}
.pi-line {
  font-family: var(--display);
  font-size: clamp(42px, 9.4vmin, 132px);
  line-height: 0.9; letter-spacing: 0.01em;
  color: #f4ede1; white-space: nowrap;
  will-change: transform, opacity;
}
.proj-head { position: relative; z-index: 1; }
.list-viewport {
  flex: 1; min-height: 0; position: relative; z-index: 1;
  margin-top: clamp(14px, 3vmin, 34px);
  overflow: hidden;
  perspective: 900px;
}
.proj-list { list-style: none; will-change: transform; }
.proj-row {
  padding: clamp(10px, 2.2vmin, 26px) 0;
  border-top: 1px solid rgba(244, 237, 225, 0.35);
  will-change: transform, opacity;
  transform-style: preserve-3d;
}
.proj-link {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 20px; width: 100%;
  color: inherit; text-decoration: none;
  cursor: none;
}
.proj-row h3 {
  font-family: var(--display);
  font-size: clamp(34px, 6.4vmin, 84px);
  line-height: 0.95; letter-spacing: 0.01em;
  color: #16100e;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.14);
  transition: transform 0.25s ease, color 0.18s ease, text-shadow 0.18s ease;
}
.proj-link:hover h3 {
  transform: translateX(14px);
  color: #fdf6ea;
  text-shadow: 0 2px 10px rgba(40, 4, 2, 0.6);
}
.proj-row p {
  font-family: var(--label); font-weight: 800;
  font-size: clamp(12px, 1.6vmin, 17px);
  letter-spacing: 0.16em; white-space: nowrap; opacity: 1;
  color: #16100e;
  transition: color 0.18s ease;
}
.proj-link:hover p { color: #fdf6ea; }
.proj-row .yr {
  font-size: 0.85em; font-weight: 800;
  opacity: 0.85; margin-left: 10px;
}

/* --- 2 STORY (blue gallery) --- */
.sc-story { background: var(--blue); color: #eef1ff; }
/* fine film grain over the WHOLE scene (background + cards) so it reads as one
   printed surface — subtle, no hard diagonal weave (contact-sheet style) */
.sc-story::after {
  content: ""; position: absolute; inset: 0; z-index: 8; pointer-events: none;
  background-image:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.03) 0 1px, transparent 1px 3px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='w'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23w)'/%3E%3C/svg%3E");
  background-size: 3px 3px, 150px 150px;
  mix-blend-mode: overlay;
  opacity: 0.16;
  animation: grainShift 0.7s steps(4) infinite;
}
.story-intro {
  position: absolute; inset: 0; z-index: 4;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: clamp(0px, 0.5vmin, 8px);
  pointer-events: none; overflow: hidden;
  will-change: transform, opacity;
}
.si-line {
  font-family: var(--display);
  font-size: clamp(42px, 9.4vmin, 132px);
  line-height: 0.9; letter-spacing: 0.01em;
  color: #eef1ff; white-space: nowrap;
  will-change: transform, opacity;
}
.story-head { position: relative; z-index: 1; }
.story-head .mega-title { color: #f4f6ff; }
.story-head .lede { color: rgba(238, 241, 255, 0.82); max-width: 62ch; }
.story-viewport {
  flex: 1; min-height: 0; position: relative; z-index: 1;
  margin-top: clamp(14px, 3vmin, 30px);
  overflow: hidden;
  /* soft veil pressing the whole gallery at the top & bottom edges — cards fade
     into the background as they enter/leave the viewport (gallery veil) */
  -webkit-mask-image: linear-gradient(180deg,
    transparent 0, rgba(0,0,0,0.35) 3%, #000 11%,
    #000 86%, rgba(0,0,0,0.35) 96%, transparent 100%);
  mask-image: linear-gradient(180deg,
    transparent 0, rgba(0,0,0,0.35) 3%, #000 11%,
    #000 86%, rgba(0,0,0,0.35) 96%, transparent 100%);
}
/* 4 independent columns, each parallax-scrolled at its own speed via JS */
.story-gallery {
  display: flex; align-items: flex-start;
  gap: clamp(10px, 1.6vmin, 20px);
  height: 100%;
}
.story-col {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  will-change: transform;
  /* auto-scroll upward forever; -50% aligns with the duplicated card set */
  animation: storyRise 26s linear infinite;
}
/* cols 1 & 3 run fast, cols 2 & 4 run slow */
.story-col:nth-child(odd)  { animation-duration: 21s; }
.story-col:nth-child(even) { animation-duration: 33s; }
/* pause so cards are easy to hover / click */
.story-gallery:hover .story-col { animation-play-state: paused; }
@keyframes storyRise {
  from { transform: translateY(0); }
  to   { transform: translateY(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .story-col { animation: none; }
}
.st-card {
  display: block; position: relative;
  margin-bottom: clamp(10px, 1.6vmin, 20px);
  border-radius: 10px; overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  text-decoration: none;
  /* default: only a touch muted so the art stays visible under the light blue veil */
  filter: saturate(0.94) brightness(0.97) contrast(1.02);
  transition: transform .55s cubic-bezier(.2,.7,.2,1),
              filter .5s ease, box-shadow .5s ease, border-color .5s ease;
  will-change: transform, filter;
}
/* placeholder-only cards keep a fixed ratio; image cards use their natural ratio */
.st-card.st-tall { aspect-ratio: 3 / 4; }
.st-card.st-sq { aspect-ratio: 1 / 1; }
.st-card img,
.st-card .st-ph { transition: transform .7s cubic-bezier(.2,.7,.2,1); }
.st-card img { width: 100%; height: auto; display: block; }

/* bottom-left caption chip on each frame */
.st-cap {
  position: absolute; left: clamp(7px, 1vmin, 12px); bottom: clamp(7px, 1vmin, 12px);
  z-index: 5; max-width: calc(100% - 22px);
  font-family: var(--label); font-weight: 700;
  font-size: clamp(8.5px, 1.05vmin, 11.5px); letter-spacing: 0.12em;
  text-transform: uppercase; color: #f2f5ff; white-space: nowrap;
  padding: 4px 8px; border-radius: 5px;
  background: rgba(8, 11, 30, 0.62);
  border: 1px solid rgba(180, 205, 255, 0.22);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  transition: background .3s ease, border-color .3s ease;
}
.st-card:hover .st-cap {
  background: rgba(46, 68, 200, 0.8);
  border-color: rgba(200, 218, 255, 0.55);
}

/* light even blue veil — tints each card but the art still shows through */
.st-card::after {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(180deg, rgba(58,88,235,0.14), rgba(30,48,165,0.22));
  transition: opacity .5s ease;
}

/* faint live grain on each card (the shared scene grain does the heavy lifting) */
.st-card::before {
  content: ""; position: absolute; inset: -20%; z-index: 3; pointer-events: none;
  opacity: 0.14; mix-blend-mode: overlay;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  animation: stGrain 0.9s steps(4) infinite;
}
@keyframes stGrain {
  0%   { background-position: 0 0; }
  25%  { background-position: -32px 18px; }
  50%  { background-position: 20px -30px; }
  75%  { background-position: -24px -12px; }
  100% { background-position: 14px 26px; }
}

/* hover: card lifts, wakes up to full colour, screen-wash pulls back, neon glow */
.st-card:hover {
  transform: translateY(-7px) scale(1.018);
  filter: saturate(1.18) brightness(1.05) contrast(1.04);
  border-color: rgba(180, 205, 255, 0.55);
  box-shadow:
    0 20px 55px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(180, 205, 255, 0.4),
    0 0 34px rgba(120, 150, 255, 0.4);
  z-index: 6;
}
.st-card:hover::after { opacity: 0.16; }
.st-card:hover::before { opacity: 0.32; }
.st-card:hover img,
.st-card:hover .st-ph { transform: scale(1.07); }

.st-ph {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display);
  font-size: clamp(28px, 5vmin, 64px);
  color: rgba(255, 255, 255, 0.3);
  background: linear-gradient(160deg, rgba(120,150,255,0.18), rgba(40,58,150,0.26));
}
.story-foot {
  position: absolute; z-index: 9;
  left: 0; right: 0; bottom: 0;
  padding: clamp(48px, 9vmin, 120px) clamp(20px, 4vmin, 56px) clamp(20px, 4vmin, 44px);
  border-top: none;
  /* top is transparent so the frames still show through, fading down into a
     solid deep-blue panel where the nav sits */
  background: linear-gradient(180deg,
    rgba(12, 16, 46, 0) 0%,
    rgba(12, 16, 46, 0.7) 34%,
    rgba(12, 16, 46, 0.96) 62%,
    #0c102e 100%);
  transform: translateY(140%);
  opacity: 0;
  will-change: transform, opacity;
}
.story-foot .ct-foot-nav a,
.story-foot .ct-foot-right a { color: #eef1ff; }
.story-foot .ct-foot-nav a:hover,
.story-foot .ct-foot-right a:hover { color: #bcd0ff; }
.story-foot .ct-foot-loc { color: rgba(238, 241, 255, 0.6); }

/* --- 3 JOURNEY (legacy, unused) --- */
.sc-journey { background: var(--paper); color: #17140f; }
.jr-head { position: relative; z-index: 1; }
.jr-mega { color: var(--red); }
.jr-lede { color: rgba(23, 20, 15, 0.9); max-width: 60ch; }
.jr-viewport {
  flex: 1; min-height: 0; position: relative; z-index: 1;
  margin-top: clamp(12px, 2.4vmin, 28px);
  overflow: hidden;
}
.jr-list { list-style: none; will-change: transform; }
.jr-row {
  display: flex; align-items: flex-start;
  gap: clamp(14px, 2.6vmin, 40px);
  padding: clamp(14px, 2.4vmin, 30px) clamp(24px, 5vmin, 72px) clamp(14px, 2.4vmin, 30px) 0;
  border-top: 1px solid rgba(23, 20, 15, 0.18);
  will-change: transform, opacity;
}
.jr-num {
  font-family: var(--display);
  font-size: clamp(20px, 2.8vmin, 34px);
  color: rgba(23, 20, 15, 0.62);
  min-width: 1.8em; line-height: 1.1;
}
.jr-body { flex: 1; min-width: 0; }
.jr-title {
  font-family: var(--display);
  font-size: clamp(26px, 4.8vmin, 60px);
  line-height: 0.98; letter-spacing: 0.01em;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.jr-title a { color: inherit; text-decoration: none; transition: color 0.18s ease; cursor: none; }
.jr-title a:hover { color: var(--red); }
.jr-tag {
  font-family: var(--label); font-weight: 800;
  font-size: clamp(9px, 1.1vmin, 12px);
  letter-spacing: 0.18em;
  background: #17140f; color: var(--paper);
  padding: 4px 10px; border-radius: 3px;
  transform: translateY(-2px);
}
.jr-role {
  font-family: var(--label); font-weight: 800;
  font-size: clamp(11px, 1.4vmin, 15px);
  letter-spacing: 0.18em; color: var(--red);
  margin-top: 10px;
}
.jr-desc {
  font-family: var(--label); font-weight: 500;
  font-size: clamp(11px, 1.4vmin, 15px);
  line-height: 1.55; letter-spacing: 0.02em;
  color: rgba(23, 20, 15, 0.88);
  margin-top: 10px; max-width: 62ch;
}
.jr-year {
  font-family: var(--label); font-weight: 800;
  font-size: clamp(12px, 1.5vmin, 16px);
  letter-spacing: 0.1em; white-space: nowrap;
  color: #17140f;
  text-align: right; min-width: 5.5em;
  padding-top: 6px;
}
.jr-links {
  display: flex; flex-wrap: wrap; gap: 10px 18px;
  margin-top: 14px;
}
.jr-links a {
  font-family: var(--label); font-weight: 800;
  font-size: clamp(10px, 1.2vmin, 13px);
  letter-spacing: 0.14em;
  color: var(--red); text-decoration: none;
  border: 1px solid rgba(224, 72, 58, 0.5);
  padding: 5px 11px; border-radius: 3px;
  cursor: none;
  transition: background 0.18s ease, color 0.18s ease;
}
.jr-links a:hover { background: var(--red); color: var(--paper); }

/* --- 3 ARTWORKS --- */
.sc-artworks { background: var(--navy); color: #e9e6da; }
.art-head { position: relative; z-index: 1; }
.art-viewport {
  flex: 1; min-height: 0; position: relative; z-index: 1;
  display: flex; align-items: center;
  overflow: hidden;
  perspective: 1000px;
  margin-top: clamp(10px, 2vmin, 22px);
}
.art-track {
  display: flex; gap: clamp(16px, 3vmin, 36px);
  padding: 0 clamp(20px, 4vmin, 56px);
  will-change: transform;
  transform-style: preserve-3d;
}
.art-card { flex: 0 0 auto; will-change: transform, opacity; transform-style: preserve-3d; }
.art-ph {
  width: clamp(170px, 24vmin, 320px);
  height: clamp(210px, 30vmin, 400px);
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(44px, 7vmin, 84px);
  border: 1px solid rgba(233, 230, 218, 0.25);
}
.c1 { background: #d8503f; color: #f4e8d8; }
.c2 { background: #e5dcc6; color: #232323; }
.c3 { background: #31543e; color: #e5dcc6; }
.c4 { background: #d9a13b; color: #232323; }
.c5 { background: #7a86b8; color: #10131c; }
.art-card figcaption {
  display: flex; justify-content: space-between;
  font-family: var(--label); font-weight: 700;
  font-size: clamp(10px, 1.3vmin, 14px); letter-spacing: 0.25em;
  margin-top: 10px; opacity: 0.85;
}
.art-card em { font-style: normal; opacity: 0.5; }

/* --- 4 CONTACT --- */
.sc-contact { background: #ece7dc; color: #17140f; justify-content: flex-start; }
.contact-inner {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  height: 100%; width: 100%;
}

/* ---- SKILLS ---- */
.ct-skills { flex: 0 0 auto; }
.skill-tags {
  list-style: none; display: flex; flex-wrap: wrap;
  gap: clamp(8px, 1.2vmin, 14px);
  margin-top: clamp(12px, 2.2vmin, 24px);
  max-width: 1000px;
}
.skill-tags li {
  font-family: var(--label); font-weight: 700;
  font-size: clamp(9px, 1.15vmin, 12px); letter-spacing: 0.14em;
  color: #17140f;
  padding: clamp(6px, 1vmin, 10px) clamp(10px, 1.6vmin, 16px);
  border: 1px solid rgba(23, 20, 15, 0.35);
  border-radius: 999px;
  white-space: nowrap;
  will-change: transform, opacity;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.skill-tags li:hover { background: var(--red); border-color: var(--red); color: #fff; }

/* ---- CTA ---- */
.ct-cta {
  flex: 1 1 auto;
  display: flex; flex-direction: column; justify-content: center;
  will-change: transform, opacity;
}
.ct-kicker {
  font-family: var(--label); font-weight: 800;
  font-size: clamp(11px, 1.5vmin, 15px); letter-spacing: 0.32em;
  color: var(--red); margin-bottom: clamp(10px, 1.8vmin, 20px);
}
.ct-title {
  font-family: var(--display);
  font-size: clamp(40px, 8.4vmin, 118px);
  line-height: 0.9; letter-spacing: 0.005em; color: #17140f;
}
.ct-btn {
  align-self: flex-start;
  margin-top: clamp(18px, 3.2vmin, 40px);
  font-family: var(--label); font-weight: 800;
  font-size: clamp(11px, 1.5vmin, 15px); letter-spacing: 0.2em;
  color: #ece7dc; background: #17140f;
  text-decoration: none;
  padding: clamp(12px, 1.8vmin, 18px) clamp(20px, 3vmin, 34px);
  border-radius: 999px;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.ct-btn:hover { background: var(--red); color: #fff; transform: translateY(-2px); }

/* ---- FOOTER ---- */
.ct-footer {
  flex: 0 0 auto;
  display: flex; justify-content: space-between; align-items: flex-end;
  padding-top: clamp(16px, 2.6vmin, 30px);
  border-top: 1px solid rgba(23, 20, 15, 0.22);
  will-change: transform, opacity;
}
.ct-foot-nav { display: flex; flex-direction: column; gap: clamp(2px, 0.5vmin, 6px); }
.ct-foot-nav a {
  font-family: var(--display);
  font-size: clamp(15px, 2.2vmin, 26px); line-height: 1.05;
  color: #17140f; text-decoration: none;
  transition: color 0.2s, transform 0.2s;
}
.ct-foot-nav a:hover { color: var(--red); transform: translateX(4px); }
.ct-foot-right { display: flex; flex-direction: column; align-items: flex-end; gap: clamp(4px, 0.8vmin, 8px); }
.ct-foot-right a {
  font-family: var(--display);
  font-size: clamp(15px, 2.2vmin, 26px);
  color: #17140f; text-decoration: none;
  transition: color 0.2s;
}
.ct-foot-right a:hover { color: var(--red); }
.ct-foot-loc {
  font-family: var(--label); font-weight: 600;
  font-size: clamp(9px, 1.2vmin, 12px); letter-spacing: 0.2em;
  color: rgba(23, 20, 15, 0.55);
}
.sc-contact .end-note {
  margin-top: clamp(8px, 1.4vmin, 16px);
  color: rgba(23, 20, 15, 0.5); opacity: 0.5;
}

.contact-big-legacy {
  display: inline-block;
  font-family: var(--display);
  font-size: clamp(30px, 6.4vmin, 92px);
  color: #efe9dc; text-decoration: none;
  border-bottom: 3px solid rgba(239, 233, 220, 0.4);
  margin-top: clamp(14px, 3vmin, 34px);
  transition: border-color 0.2s, color 0.2s;
  will-change: transform, letter-spacing;
}
.contact-big:hover { color: var(--red); border-color: var(--red); }
.contact-links { display: flex; gap: clamp(20px, 4vmin, 46px); margin-top: clamp(20px, 4vmin, 44px); }
.contact-links a {
  font-family: var(--label); font-weight: 700;
  font-size: clamp(11px, 1.5vmin, 15px); letter-spacing: 0.3em;
  color: rgba(239, 233, 220, 0.7); text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.contact-links a:hover { color: #efe9dc; border-color: #efe9dc; }
.end-note {
  font-family: var(--label); font-weight: 500;
  font-size: clamp(10px, 1.3vmin, 13px); letter-spacing: 0.3em;
  opacity: 0.45; margin-top: clamp(26px, 5vmin, 60px);
}

/* ============ GAME OVERLAY ============ */
#gameOverlay {
  position: absolute; inset: 0; z-index: 10;
  background: rgba(6, 6, 6, 0.94);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 20px; color: #efe9dc;
}
#gameOverlay[hidden] { display: none; }
.game-title { font-family: var(--display); font-size: clamp(32px, 5vmin, 60px); }
.game-sub { font-family: var(--label); font-weight: 700; font-size: 12px; letter-spacing: 0.3em; margin: 10px 0 18px; opacity: 0.8; }
#snakeCanvas {
  border: 1px solid rgba(239,233,220,0.4);
  background: #0a0f0a;
  max-width: 92%; max-height: 56%;
  image-rendering: pixelated;
}
.game-hint {
  font-family: var(--label); font-weight: 700; margin-top: 14px;
  color: var(--red); letter-spacing: 0.3em; font-size: 12px;
  animation: blink 1.4s steps(2) infinite;
}

/* ============ CURSOR ============ */
#cursor {
  position: fixed; left: 0; top: 0; z-index: 200;
  width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border: 1.5px solid #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--label); font-size: 15px; color: #fff;
  mix-blend-mode: difference;
  pointer-events: none;
  transition: width 0.2s, height 0.2s, margin 0.2s;
  will-change: transform;
}
#cursor.hover { width: 52px; height: 52px; margin: -26px 0 0 -26px; }
@media (pointer: coarse) { #cursor { display: none; } }

/* ============================================================
   MOBILE — every desktop effect, tuned for phones
   (the scroll engine, fluid, grain, marquee & branching all
    run the same; this only re-scales layout & typography)
   ============================================================ */
@media (max-width: 720px) {
  /* tighter TV frame → more usable screen */
  #screen { inset: 8px; border-radius: 30px / 26px;
    box-shadow: 0 0 0 8px var(--frame), 0 14px 40px rgba(0,0,0,0.5),
      inset 0 0 90px 26px rgba(0,0,0,0.45), inset 0 0 10px 4px rgba(0,0,0,0.66); }

  /* PERF: these overlays sit above the animating fluid canvas; with mix-blend-mode
     the browser must re-blend the whole screen every frame. On mobile we freeze the
     grain animation and switch to plain alpha compositing (cheap) so scrolling stays
     smooth while keeping the texture look. */
  .grain { animation: none; mix-blend-mode: normal; opacity: 0.05; }
  .crt-scanlines { mix-blend-mode: normal; }
  .sc-story::after { animation: none; mix-blend-mode: normal; opacity: 0.1; }

  /* top nav */
  #topnav { top: 8px; left: 8px; right: 8px; padding: 6px 11px; gap: 8px; }
  .nav-left, .nav-right { min-width: 0; }
  .nav-link { font-size: 9.5px; letter-spacing: 0.06em; padding: 2px 1px; white-space: nowrap; }
  .nav-right { gap: 11px; }

  /* scene padding */
  .scene { padding: 58px 18px 22px; }

  /* shared headings */
  .mega-title { font-size: clamp(40px, 12vw, 96px); }
  .lede { font-size: clamp(12px, 3.4vw, 16px); line-height: 1.6; letter-spacing: 0.06em; }

  /* HOME */
  .mega-name { font-size: clamp(56px, 17vw, 120px); margin-bottom: 22px; letter-spacing: 0; }
  .bust-img { width: clamp(210px, 64vw, 340px); }
  .side-left  { left: 8px;  gap: 6px; }
  .side-right { right: 8px; gap: 6px; }
  .big-num { font-size: clamp(42px, 13.5vw, 96px); }
  .side-vert { font-size: 9px; letter-spacing: 0.26em; }

  /* PROJECTS — stack title over meta */
  .proj-link { flex-direction: column; align-items: flex-start; gap: 4px; }
  .proj-row { padding: 12px 0; }
  .proj-row h3 { font-size: clamp(30px, 9vw, 66px); }
  .proj-row p { white-space: normal; font-size: 11px; letter-spacing: 0.12em; }
  .proj-row .yr { margin-left: 8px; }
  .pi-line { font-size: clamp(40px, 13vw, 120px); }

  /* JOURNEY — stack, year as a red label on top */
  .jr-row { flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px 0; }
  .jr-num { display: none; }
  .jr-year { order: -1; text-align: left; min-width: 0; padding-top: 0;
    color: var(--red); font-size: 12px; }
  .jr-title { font-size: clamp(24px, 7.5vw, 46px); gap: 10px; }
  .jr-tag { font-size: 9px; padding: 3px 8px; }
  .jr-role { font-size: 12px; margin-top: 6px; }
  .jr-desc { font-size: 12.5px; max-width: none; line-height: 1.55; margin-top: 8px; }
  .jr-links { margin-top: 10px; }

  /* STORY — JS collapses to a 2-column marquee on mobile (wider frames, no repeats
     visible on first view) */
  .si-line { font-size: clamp(40px, 13vw, 120px); }
  .story-gallery { gap: 10px; }
  .st-cap { font-size: 8px; padding: 3px 6px; letter-spacing: 0.05em; white-space: normal; }
  .story-foot { flex-direction: column; align-items: flex-start; gap: 12px;
    padding: 64px 18px 22px; }

  /* SKILL / CONTACT */
  .ct-title { font-size: clamp(34px, 11vw, 92px); }
  .ct-kicker { font-size: 11px; letter-spacing: 0.2em; }
  .skill-tags { gap: 7px; margin-top: 14px; }
  .skill-tags li { font-size: 9px; padding: 6px 10px; }
  .ct-footer { flex-direction: column; align-items: flex-start; gap: 14px; }
  .ct-foot-right { align-items: flex-start; }
  .ct-foot-nav a, .ct-foot-right a { font-size: clamp(16px, 5vw, 24px); }
  .end-note { font-size: 10px; margin-top: 16px; }

  /* boot terminal */
  #bootTitle { font-size: clamp(20px, 7vw, 34px); letter-spacing: 0.32em; }
  .boot-sub { font-size: 9px; letter-spacing: 0.2em; }
  #bootText { font-size: clamp(10px, 3vw, 14px); line-height: 1.85; }
  #preBoot { padding: 40px 22px; }
}

/* small phones */
@media (max-width: 480px) {
  .scene { padding: 54px 14px 18px; }
  .mega-name { font-size: clamp(50px, 17vw, 96px); margin-bottom: 18px; }
  .big-num { font-size: clamp(38px, 15vw, 78px); }
  .side-vert { font-size: 8px; letter-spacing: 0.2em; }
  .story-gallery { gap: 8px; }
  .st-cap { font-size: 7.5px; padding: 2px 5px; }
  .jr-links a { font-size: 10px; padding: 4px 9px; }
  #topnav { padding: 5px 9px; }
  .nav-link { letter-spacing: 0.03em; font-size: 9px; }
  .nav-right { gap: 9px; }
}

/* touch: no hover, so the 01 / 02 gates read as clear tappable buttons */
@media (pointer: coarse) {
  .side-left  { color: rgba(224, 72, 58, 0.6); }
  .side-right { color: rgba(47, 82, 201, 0.62); }
  .big-num { opacity: 0.62; transform: rotateX(-8deg); }
  .side-vert { opacity: 0.95; }
}
