/* Connor King — portfolio (experimental "sim" restyle). Plain CSS, no framework.
   Everything here works without JS; html.js unlocks the motion layer in fx.js. */

:root {
  --bg: #05080d;
  --bg-2: #080d14;
  --surface: rgba(16, 23, 33, 0.72);
  --surface-solid: #101721;
  --surface-2: #151e2a;
  --line: #1f2b3b;
  --line-hi: #2c3d53;
  --text: #e8eef5;
  --text-2: #cdd7e2;
  --muted: #95a3b4;
  --accent: #00c8ff;
  --accent-2: #7a5cff;
  --accent-3: #00ffc6;
  --accent-soft: rgba(0, 200, 255, 0.12);
  --glow: 0 0 0 1px rgba(0, 200, 255, .55), 0 0 24px rgba(0, 200, 255, .28), 0 0 64px rgba(0, 200, 255, .12);
  --radius: 14px;
  --max: 1180px;
  --gutter: clamp(16px, 4vw, 36px);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --cx: 50vw; --cy: 30vh;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: clip; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.7 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  position: relative;
  min-height: 100vh;
}

/* Page-wide blueprint grid that brightens around the cursor + film grain. */
body::before, body::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1; }
body::before {
  background:
    linear-gradient(rgba(0, 200, 255, .06) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(90deg, rgba(0, 200, 255, .06) 1px, transparent 1px) 0 0 / 56px 56px;
  -webkit-mask-image: radial-gradient(420px 420px at var(--cx) var(--cy), #000 0%, rgba(0,0,0,.25) 45%, rgba(0,0,0,.12) 100%);
  mask-image: radial-gradient(420px 420px at var(--cx) var(--cy), #000 0%, rgba(0,0,0,.25) 45%, rgba(0,0,0,.12) 100%);
}
body::after {
  z-index: 200; opacity: .06; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--accent); color: #001018; }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3 { line-height: 1.12; margin: 0 0 .5em; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.4rem, 7vw, 4.4rem); font-weight: 800; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.6rem, 4vw, 2.5rem); font-weight: 800; letter-spacing: -0.03em; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: #000; padding: 8px 12px; z-index: 300; }
.skip:focus { left: 8px; top: 8px; }

/* Cross-document page transitions (Chromium); harmless elsewhere. */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .28s var(--ease) both; }
::view-transition-new(root) { animation: vt-in .45s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-8px); filter: blur(4px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(12px); filter: blur(6px); } }
@media (prefers-reduced-motion: reduce) { ::view-transition-old(root), ::view-transition-new(root) { animation: none; } }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: linear-gradient(to bottom, rgba(5, 8, 13, .92), rgba(5, 8, 13, .7));
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid rgba(0, 200, 255, .12);
}
.site-header::after { /* scroll progress, driven by --progress from fx.js */
  content: ""; position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent), var(--accent-3));
  transform-origin: 0 50%; transform: scaleX(var(--progress, 0));
  box-shadow: 0 0 12px var(--accent);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); font-weight: 800; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand-mark {
  position: relative; font: 800 .95rem/1 var(--mono); color: #001018; background: var(--accent);
  border-radius: 8px; padding: 7px 8px; box-shadow: 0 0 18px rgba(0, 200, 255, .45);
  transition: transform .4s var(--ease), box-shadow .3s;
}
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.08); box-shadow: 0 0 28px rgba(0, 200, 255, .8); }
.nav { display: flex; gap: 4px 6px; flex-wrap: wrap; align-items: center; font-size: .92rem; }
.nav a {
  position: relative; color: var(--muted); padding: 7px 12px; border-radius: 999px;
  transition: color .2s, background .2s;
}
.nav a:hover { color: var(--text); text-decoration: none; background: rgba(255, 255, 255, .05); }
.nav a[aria-current="page"] { color: var(--text); background: var(--accent-soft); box-shadow: inset 0 0 0 1px rgba(0, 200, 255, .35); }
.kbd-btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  font: 600 .75rem/1 var(--mono); color: var(--accent); background: transparent;
  border: 1px solid rgba(0, 200, 255, .35); border-radius: 999px; padding: 7px 10px; margin-left: 4px;
  transition: background .2s, box-shadow .2s;
}
.kbd-btn:hover { background: var(--accent-soft); box-shadow: var(--glow); }

@media (max-width: 600px) {
  .site-header .wrap { padding-top: 8px; padding-bottom: 8px; min-height: 0; }
  .nav { width: 100%; justify-content: space-between; gap: 2px; font-size: .88rem; }
  .nav a { padding: 6px 8px; }
  .kbd-btn { padding: 6px 8px; margin-left: 0; }
}

/* ---------- Shared bits ---------- */
.eyebrow {
  display: flex; width: fit-content; align-items: center; gap: 10px;
  font: 600 .78rem/1.4 var(--mono); color: var(--accent); text-transform: uppercase; letter-spacing: .16em; margin-bottom: 16px;
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; box-shadow: 0 0 8px currentColor; }
.muted { color: var(--muted); }
.section { padding: clamp(64px, 10vw, 120px) 0; position: relative; counter-increment: sec; }
.section::before { /* hairline with a travelling glint */
  content: ""; position: absolute; top: 0; left: 50%; width: min(var(--max), 100% - 2 * var(--gutter)); transform: translateX(-50%); height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-hi) 20%, var(--line-hi) 80%, transparent);
}
main { counter-reset: sec; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin-bottom: clamp(28px, 4vw, 44px); }
.section-head h2 { margin: 0; }
.section-head h2::before {
  content: counter(sec, decimal-leading-zero) " //";
  content: counter(sec, decimal-leading-zero) " //" / "";
  display: block; font: 600 .78rem/1 var(--mono); letter-spacing: .16em; color: var(--accent); margin-bottom: 14px;
}
.section-head p { margin: 0; color: var(--muted); max-width: 60ch; }
.section-head > a { font: 600 .85rem/1.4 var(--mono); }

.btn {
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 10px; font-weight: 650; font-size: .95rem;
  border: 1px solid var(--line-hi); color: var(--text); background: rgba(16, 23, 33, .7);
  transition: border-color .25s, box-shadow .25s, transform .25s var(--ease), color .2s;
  transform: translate(var(--tx, 0), var(--ty, 0));
}
.btn::before { /* shine sweep */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .22) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .7s var(--ease);
}
.btn:hover { text-decoration: none; border-color: var(--accent); box-shadow: var(--glow); }
.btn:hover::before { transform: translateX(120%); }
.btn:active { transform: translate(var(--tx, 0), var(--ty, 0)) scale(.97); }
.btn-primary { background: linear-gradient(135deg, #2ee0ff, var(--accent) 45%, #0090ff); border-color: transparent; color: #001018; box-shadow: 0 6px 30px -6px rgba(0, 200, 255, .6); }
.btn-primary:hover { color: #001018; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.tags li {
  font: 500 .72rem/1 var(--mono); color: var(--text-2); background: rgba(0, 200, 255, .06);
  border: 1px solid rgba(0, 200, 255, .2); border-radius: 6px; padding: 6px 9px;
}

.badge {
  display: inline-flex; align-items: center; gap: 8px; font: 600 .75rem/1 var(--mono); color: var(--accent-3);
  background: rgba(0, 255, 198, .08); border: 1px solid rgba(0, 255, 198, .35); border-radius: 999px; padding: 7px 12px;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; transform: scale(.7); } }

/* ---------- Home hero (WebGL voxel field lives behind it) ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  min-height: min(100svh - 64px, 920px); display: flex; align-items: center;
  padding: clamp(64px, 12vw, 140px) 0 clamp(72px, 10vw, 120px);
  touch-action: pan-y;
}
.hero::before { /* fallback backdrop (no JS / no WebGL) */
  content: ""; position: absolute; inset: 0; z-index: -3; pointer-events: none;
  background:
    radial-gradient(900px 500px at 80% 20%, rgba(0, 200, 255, .18), transparent 70%),
    radial-gradient(700px 400px at 10% 90%, rgba(122, 92, 255, .14), transparent 70%),
    linear-gradient(rgba(0, 200, 255, .12) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(90deg, rgba(0, 200, 255, .12) 1px, transparent 1px) 0 0 / 48px 48px;
  -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent);
  mask-image: linear-gradient(to bottom, #000 40%, transparent);
}
.hero::after { /* scrim keeps the copy readable over the sim */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(5, 8, 13, .92) 0%, rgba(5, 8, 13, .7) 38%, rgba(5, 8, 13, .05) 75%),
    linear-gradient(to top, var(--bg) 0%, transparent 30%);
}
.hero .wrap { width: 100%; }
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; display: block; opacity: 0; transition: opacity 1.4s ease; }
.hero-canvas.ready { opacity: 1; }
.hero h1 {
  font-size: clamp(3.2rem, 13vw, 8.5rem); line-height: 1; padding-bottom: .06em; margin-bottom: .12em;
  background: linear-gradient(100deg, #fff 0%, #dff7ff 40%, var(--accent) 75%, var(--accent-2) 110%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 30px rgba(0, 200, 255, .25));
}
.hero .role { font: 600 clamp(1.05rem, 2.6vw, 1.5rem)/1.3 var(--mono); color: var(--text); margin-bottom: 24px; letter-spacing: -.01em; }
.hero .role::after { content: "_"; color: var(--accent); margin-left: 2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero .lede { color: var(--text-2); max-width: 60ch; font-size: 1.08rem; margin-bottom: 32px; text-shadow: 0 1px 12px rgba(5, 8, 13, .9); }
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 22px; font-size: .9rem; color: var(--muted); }

.hud { /* injected telemetry overlay */
  position: absolute; z-index: 1; right: var(--gutter); bottom: 28px; pointer-events: none;
  font: 500 .68rem/1.7 var(--mono); color: rgba(0, 200, 255, .8); letter-spacing: .08em; text-transform: uppercase;
  padding: 12px 14px; border: 1px solid rgba(0, 200, 255, .25); background: rgba(5, 8, 13, .55);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border-radius: 8px; min-width: 210px;
}
.hud b { color: var(--text); font-weight: 600; }
.hud .row { display: flex; justify-content: space-between; gap: 16px; }
.hud .hint { color: var(--accent-3); margin-top: 6px; }
.hero-frame { position: absolute; inset: 18px; z-index: 1; pointer-events: none; }
.hero-frame::before, .hero-frame::after { content: ""; position: absolute; width: 22px; height: 22px; border: 2px solid var(--accent); opacity: .7; }
.hero-frame::before { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.hero-frame::after { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.scroll-cue { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); width: 22px; height: 36px; border: 2px solid rgba(232, 238, 245, .4); border-radius: 12px; z-index: 1; pointer-events: none; }
.scroll-cue::after { content: ""; position: absolute; left: 50%; top: 6px; width: 3px; height: 7px; margin-left: -1.5px; background: var(--accent); border-radius: 2px; animation: cue 1.6s var(--ease) infinite; }
@keyframes cue { 0% { transform: translateY(0); opacity: 1; } 80% { transform: translateY(12px); opacity: 0; } 100% { opacity: 0; } }
@media (max-width: 720px) {
  .hud { left: var(--gutter); right: auto; bottom: 16px; min-width: 0; font-size: .6rem; padding: 8px 10px; }
  .hud .opt { display: none; }
  .scroll-cue { display: none; }
  .hero::after { background: linear-gradient(to bottom, rgba(5, 8, 13, .3), rgba(5, 8, 13, .55) 45%, rgba(5, 8, 13, .35) 80%, var(--bg)); }
  .hero .lede, .hero-meta { text-shadow: 0 1px 3px #05080d, 0 0 18px #05080d; }
  .hero { padding-bottom: 120px; }
}

/* ---------- Experience ---------- */
.timeline { display: grid; gap: 24px; position: relative; padding-left: 36px; }
.timeline::before, .timeline::after { content: ""; position: absolute; left: 9px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; }
.timeline::before { background: var(--line); }
.timeline::after {
  background: linear-gradient(to bottom, var(--accent-2), var(--accent), var(--accent-3));
  box-shadow: 0 0 14px var(--accent); transform-origin: top; transform: scaleY(var(--tl, 1));
}
.timeline .job::before { /* node */
  content: ""; position: absolute; left: -33px; top: 30px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent); box-shadow: 0 0 0 4px var(--bg), 0 0 16px var(--accent);
  transition: background .4s, transform .4s var(--ease);
}
.timeline .job.lit::before { background: var(--accent); transform: scale(1.15); }
.job {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(20px, 3vw, 32px); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: border-color .3s, box-shadow .3s;
}
.job:hover { border-color: rgba(0, 200, 255, .45); box-shadow: 0 20px 60px -30px rgba(0, 200, 255, .45); }
.job-head { display: flex; justify-content: space-between; align-items: baseline; gap: 4px 16px; flex-wrap: wrap; margin-bottom: 4px; }
.job-head h3 { margin: 0; font-size: 1.2rem; }
.job-dates { font: 600 .78rem/1.4 var(--mono); color: var(--accent); white-space: nowrap; background: var(--accent-soft); border-radius: 6px; padding: 4px 8px; }
.job-org { color: var(--muted); font-weight: 600; margin-bottom: 14px; font-size: .95rem; }
.job ul { margin: 0; padding-left: 0; list-style: none; }
.job li { position: relative; margin-bottom: .65em; color: var(--text-2); padding-left: 22px; }
.job li::before { content: "▸"; position: absolute; left: 0; color: var(--accent); }

.jobs-short { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); counter-reset: job; }
.job-short { counter-increment: job; overflow: hidden; }
.job-short::after {
  content: counter(job, decimal-leading-zero); position: absolute; right: 14px; top: 4px;
  font: 800 4.5rem/1 var(--mono); color: rgba(0, 200, 255, .07); pointer-events: none;
}
.job-short p { margin: 0; color: var(--text-2); }
.job-short .job-head { flex-direction: column; gap: 8px; align-items: flex-start; margin-bottom: 8px; }

/* ---------- Skills ---------- */
.skills { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.skill, .edu > div, .facts div, .meta { /* glass panels share the spotlight border */
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.skill { padding: 24px; transition: transform .35s var(--ease), border-color .3s; }
.skill:hover { border-color: rgba(0, 200, 255, .45); transform: translateY(-4px); }
.skill h3 { font: 600 .78rem/1.4 var(--mono); color: var(--accent); text-transform: uppercase; letter-spacing: .12em; }
.skill p { margin: 0; color: var(--text-2); }

/* ---------- Project cards ---------- */
.group-title {
  display: flex; align-items: center; gap: 14px;
  font: 600 .8rem/1.4 var(--mono); color: var(--text-2); text-transform: uppercase; letter-spacing: .16em; margin: 56px 0 20px;
}
.group-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-hi), transparent); }
.group-title:first-of-type { margin-top: 0; }
.cards { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); perspective: 1200px; }
.cards:has(> .card:only-child) { grid-template-columns: 1fr; }
.card {
  --mx: 50%; --my: 50%; --rx: 0deg; --ry: 0deg;
  position: relative; display: flex; flex-direction: column; isolation: isolate;
  background: var(--surface-solid); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; color: var(--text);
  transform: rotateX(var(--rx)) rotateY(var(--ry)); transform-style: preserve-3d;
  transition: border-color .3s, box-shadow .4s, transform .5s var(--ease);
}
.card::before { /* cursor spotlight */
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(0, 200, 255, .16), transparent 45%);
}
.card::after { /* scanline sweep on hover */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 40%; z-index: 2; pointer-events: none;
  background: linear-gradient(to bottom, transparent, rgba(0, 200, 255, .12), transparent);
  transform: translateY(-110%); opacity: 0;
}
.card:hover, .card:focus-visible {
  text-decoration: none; border-color: rgba(0, 200, 255, .6);
  box-shadow: 0 30px 80px -30px rgba(0, 200, 255, .5), 0 0 0 1px rgba(0, 200, 255, .3);
}
.card:hover::before, .card:focus-visible::before { opacity: 1; }
.card:hover::after { animation: sweep 1.1s var(--ease) both; }
@keyframes sweep { 0% { transform: translateY(-110%); opacity: 1; } 100% { transform: translateY(260%); opacity: 0; } }
.card.tilting { transition: border-color .3s, box-shadow .4s, transform .08s linear; }
.card-media { overflow: hidden; position: relative; }
.card img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; background: var(--surface-2); transition: transform .8s var(--ease), filter .5s; filter: saturate(.85) brightness(.9); }
.card:hover img, .card:focus-visible img { transform: scale(1.07); filter: saturate(1.1) brightness(1); }
.card-body { padding: 20px 20px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; transform: translateZ(30px); }
.card-body h3 { margin: 0; transition: color .2s; }
.card:hover .card-body h3 { color: var(--accent); }
.card-body p {
  margin: 0; color: var(--muted); font-size: .95rem; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* Featured studio card: wide, side-by-side on large screens */
@media (min-width: 860px) {
  .cards:has(> .card:only-child) .card { flex-direction: row; min-height: 320px; }
  .cards:has(> .card:only-child) .card img { width: 58%; height: 100%; aspect-ratio: auto; min-height: 320px; }
  .cards:has(> .card:only-child) .card-body { justify-content: center; padding: 36px; }
  .cards:has(> .card:only-child) .card-body h3 { font-size: 2rem; letter-spacing: -.03em; }
  .cards:has(> .card:only-child) .card-body p { -webkit-line-clamp: 4; line-clamp: 4; flex: none; font-size: 1.05rem; }
}

/* ---------- Education ---------- */
.edu { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.edu > div { padding: 24px; }
.edu h3 { margin-bottom: 8px; }
.edu p { margin: 0 0 4px; color: var(--muted); }

/* ---------- About ---------- */
.about { display: grid; gap: clamp(24px, 5vw, 64px); grid-template-columns: minmax(0, 320px) minmax(0, 1fr); align-items: start; }
.about-photo-wrap { position: relative; }
.about-photo { border-radius: var(--radius); border: 1px solid var(--line-hi); aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 0; width: 100%; box-shadow: 0 30px 80px -30px rgba(0, 200, 255, .45); }
.about > .about-photo, .about-photo-wrap { position: sticky; top: 96px; }
.about-body p { color: var(--text-2); max-width: 68ch; font-size: 1.05rem; }
@media (max-width: 720px) {
  .about { grid-template-columns: 1fr; }
  .about-photo { max-width: 240px; }
  .about > .about-photo { position: static; }
}
.facts { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); margin: 32px 0 0; padding: 0; }
.facts div { padding: 16px 18px; transition: border-color .3s; }
.facts div:hover { border-color: rgba(0, 200, 255, .45); }
.facts dt { font: 600 .72rem/1.4 var(--mono); color: var(--accent); text-transform: uppercase; letter-spacing: .12em; }
.facts dd { margin: 6px 0 0; color: var(--text); }

/* ---------- Contact ---------- */
#contact { overflow: hidden; }
#contact .wrap { position: relative; }
#contact::after {
  content: ""; position: absolute; z-index: -1; left: 50%; bottom: -60%; width: 900px; height: 600px; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(0, 200, 255, .16), transparent); pointer-events: none;
}
.contact { display: flex; flex-wrap: wrap; gap: 12px; }
.contact .btn { min-width: 0; overflow-wrap: anywhere; }

/* ---------- Project page ---------- */
.crumb { font: 600 .82rem/1.4 var(--mono); margin-bottom: 24px; display: flex; width: fit-content; gap: 8px; letter-spacing: .04em; transition: gap .3s var(--ease); }
.crumb:hover { gap: 14px; text-decoration: none; }
.project-hero {
  position: relative; overflow: hidden; isolation: isolate;
  padding: clamp(56px, 9vw, 112px) 0 clamp(40px, 6vw, 64px);
  border-bottom: 1px solid var(--line);
}
.project-hero::before { /* fallback backdrop */
  content: ""; position: absolute; inset: 0; z-index: -3;
  background: radial-gradient(800px 380px at 85% 0%, rgba(0, 200, 255, .16), transparent 70%), radial-gradient(600px 300px at 0% 100%, rgba(122, 92, 255, .12), transparent 70%);
}
.project-hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(90deg, rgba(5, 8, 13, .95) 0%, rgba(5, 8, 13, .8) 40%, rgba(5, 8, 13, .2) 100%), linear-gradient(to top, var(--bg), transparent 45%);
}
.hero-cover { /* project cover image backdrop, injected by fx.js */
  position: absolute; inset: -40px; z-index: -3; background-size: cover; background-position: center;
  filter: blur(1px) saturate(1.15); opacity: 0; transform: scale(1.05) translateY(var(--par, 0px));
  transition: opacity 1.2s ease;
}
.hero-cover.ready { opacity: .85; }
.project-hero h1 { font-size: clamp(2.1rem, 6vw, 4rem); max-width: 20ch; text-wrap: balance; }
.project-hero .lede { color: var(--text-2); font-size: 1.12rem; max-width: 64ch; margin-bottom: 22px; }
.project-layout { display: grid; gap: clamp(28px, 4vw, 56px); grid-template-columns: minmax(0, 1fr) 300px; align-items: start; padding: clamp(40px, 6vw, 72px) 0 56px; }
.project-layout aside { position: sticky; top: 96px; }
@media (max-width: 860px) { .project-layout { grid-template-columns: 1fr; } .project-layout aside { order: -1; position: static; } }
.prose p { color: var(--text-2); max-width: 70ch; font-size: 1.04rem; }
.prose ul, .prose ol { color: var(--text-2); padding-left: 0; list-style: none; max-width: 70ch; }
.prose ol { counter-reset: li; }
.prose li { position: relative; margin-bottom: .8em; padding-left: 26px; }
.prose ul > li::before { content: ""; position: absolute; left: 4px; top: .62em; width: 8px; height: 8px; border: 2px solid var(--accent); transform: rotate(45deg); box-shadow: 0 0 8px rgba(0, 200, 255, .6); }
.prose ol > li { counter-increment: li; padding-left: 34px; }
.prose ol > li::before { content: counter(li, decimal-leading-zero); position: absolute; left: 0; font: 700 .8rem/1.9 var(--mono); color: var(--accent); }
.prose h3 { margin: 2em 0 .8em; font-size: 1.35rem; display: flex; align-items: center; gap: 12px; }
.prose h3::before { content: ""; width: 4px; height: 1.1em; background: linear-gradient(var(--accent), var(--accent-2)); border-radius: 2px; box-shadow: 0 0 12px var(--accent); }
.prose strong { color: var(--text); font-weight: 650; background: linear-gradient(transparent 62%, rgba(0, 200, 255, .18) 62%); }
.meta { padding: 22px; margin: 0; display: grid; gap: 16px; overflow: hidden; }
.meta::before { content: "SPEC"; content: "SPEC" / ""; position: absolute; right: 12px; top: 10px; font: 700 .62rem/1 var(--mono); letter-spacing: .2em; color: rgba(0, 200, 255, .5); }
.meta dt { font: 600 .72rem/1.4 var(--mono); color: var(--accent); text-transform: uppercase; letter-spacing: .12em; }
.meta dd { margin: 4px 0 0; color: var(--text); font-size: .95rem; }

.video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line-hi); margin: 8px 0 36px; background: #000; box-shadow: 0 30px 80px -40px rgba(0, 200, 255, .5); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

main > .wrap > h2 { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
main > .wrap > h2::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-hi), transparent); }
.gallery { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); padding-bottom: 64px; }
.gallery a { position: relative; display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); transition: border-color .3s, box-shadow .3s, transform .4s var(--ease); }
.gallery a::after { content: "+"; position: absolute; inset: 0; display: grid; place-items: center; font: 300 2.4rem/1 var(--mono); color: #fff; background: rgba(0, 200, 255, .18); opacity: 0; transition: opacity .3s; }
.gallery a:hover, .gallery a:focus-visible { border-color: var(--accent); box-shadow: var(--glow); transform: translateY(-3px); }
.gallery a:hover::after, .gallery a:focus-visible::after { opacity: 1; }
.gallery img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .7s var(--ease); }
.gallery a:hover img { transform: scale(1.08); }
@media (min-width: 900px) { .gallery a:first-child { grid-column: span 2; grid-row: span 2; } }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 36px 0 64px; border-top: 1px solid var(--line); }
.pager a {
  position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; color: var(--text); font-weight: 700; transition: border-color .3s, box-shadow .3s;
}
.pager a::after { content: "←"; position: absolute; right: 18px; bottom: 16px; font: 600 1.2rem/1 var(--mono); color: var(--accent); opacity: 0; transform: translateX(10px); transition: all .35s var(--ease); }
.pager .next::after { content: "→"; right: auto; left: 18px; transform: translateX(-10px); }
.pager a:hover { border-color: var(--accent); text-decoration: none; box-shadow: var(--glow); }
.pager a:hover::after { opacity: 1; transform: none; }
.pager small { display: block; font: 600 .72rem/1.4 var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .14em; margin-bottom: 6px; }
.pager .next { text-align: right; }
@media (max-width: 480px) { .pager { grid-template-columns: 1fr; } .pager .next { text-align: left; } .pager .next::after { left: auto; right: 18px; content: "→"; } }

/* ---------- Lightbox ---------- */
.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.lightbox::backdrop { background: rgba(2, 4, 8, .92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.lightbox[open] img { animation: lb-in .45s var(--ease); }
@keyframes lb-in { from { opacity: 0; transform: scale(.94); filter: blur(6px); } }
.lightbox figure { margin: 0; height: 100%; display: flex; align-items: center; justify-content: center; padding: 64px 16px; }
.lightbox img { max-height: 100%; max-width: 100%; object-fit: contain; border-radius: 8px; box-shadow: 0 0 0 1px rgba(0, 200, 255, .3), 0 40px 120px -20px rgba(0, 200, 255, .35); }
.lightbox button {
  position: absolute; background: rgba(16, 23, 33, .85); color: var(--text); border: 1px solid var(--line-hi);
  border-radius: 999px; width: 46px; height: 46px; font-size: 1.3rem; cursor: pointer; line-height: 1; transition: border-color .2s, box-shadow .2s;
}
.lightbox button:hover { border-color: var(--accent); box-shadow: var(--glow); }
.lb-close { top: 12px; right: 12px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center; font: 600 .8rem var(--mono); color: var(--accent); letter-spacing: .2em; }
@media (prefers-reduced-motion: reduce) { .lightbox[open] img { animation: none; } }

/* ---------- Footer ---------- */
.site-footer { position: relative; border-top: 1px solid var(--line); padding: 36px 0 44px; color: var(--muted); font-size: .9rem; background: linear-gradient(to bottom, transparent, rgba(0, 200, 255, .03)); }
.site-footer .wrap { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.site-footer nav { display: flex; gap: 8px 20px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }
.footer-hint { font: 500 .72rem/1 var(--mono); color: var(--muted); opacity: .75; letter-spacing: .06em; }
.footer-hint kbd, .palette kbd { font: 600 .7rem/1 var(--mono); border: 1px solid var(--line-hi); border-bottom-width: 2px; border-radius: 4px; padding: 2px 5px; color: var(--text-2); background: var(--surface-2); }

/* ---------- Command palette (fx.js) ---------- */
.palette {
  width: min(640px, calc(100vw - 24px)); max-height: min(560px, 80vh); padding: 0; margin: 12vh auto auto;
  border: 1px solid rgba(0, 200, 255, .4); border-radius: 16px; color: var(--text);
  background: rgba(10, 15, 22, .94); box-shadow: 0 0 0 1px rgba(0, 200, 255, .1), 0 40px 120px -20px rgba(0, 200, 255, .4);
  overflow: hidden;
}
.palette[open] { display: flex; flex-direction: column; animation: pal-in .3s var(--ease); }
@keyframes pal-in { from { opacity: 0; transform: translateY(-12px) scale(.98); } }
.palette::backdrop { background: rgba(2, 4, 8, .6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.pal-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.pal-head span { font: 700 .95rem/1 var(--mono); color: var(--accent-3); }
.palette input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: var(--text); font: 500 1rem/1.4 var(--mono); }
.palette input::placeholder { color: var(--muted); }
.pal-list { list-style: none; margin: 0; padding: 8px; overflow: auto; flex: 1; }
.pal-list li { margin: 0; }
.pal-list a, .pal-list button {
  display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 12px; text-align: left;
  padding: 10px 12px; border-radius: 8px; border: 0; background: transparent; color: var(--text-2); font: 500 .92rem/1.3 var(--font); cursor: pointer;
}
.pal-list small { font: 600 .65rem/1 var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .12em; flex-shrink: 0; }
.pal-list [aria-selected="true"] { background: var(--accent-soft); color: var(--text); box-shadow: inset 2px 0 0 var(--accent); text-decoration: none; }
.pal-out { font: 500 .8rem/1.6 var(--mono); color: var(--accent-3); padding: 0 18px; min-height: 0; }
.pal-out:not(:empty) { padding: 10px 18px; border-top: 1px solid var(--line); }
.pal-foot { display: flex; gap: 14px; flex-wrap: wrap; padding: 10px 16px; border-top: 1px solid var(--line); font: 500 .7rem/1.4 var(--mono); color: var(--muted); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 260; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  font: 600 .8rem/1.4 var(--mono); color: #001018; background: var(--accent); padding: 10px 16px; border-radius: 999px;
  box-shadow: 0 10px 40px -8px rgba(0, 200, 255, .7); transition: all .35s var(--ease); max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Scroll reveals (only when JS is on and motion is allowed) ---------- */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0ms); }
.js .reveal.in { opacity: 1; transform: none; }
.js .hero .reveal, .js .project-hero .reveal { filter: blur(6px); transition: opacity .9s var(--ease), transform .9s var(--ease), filter .9s var(--ease); transition-delay: var(--d, 0ms); }
.js .hero .reveal.in, .js .project-hero .reveal.in { filter: none; }
.js .hero h1.reveal.in { filter: drop-shadow(0 0 30px rgba(0, 200, 255, .25)); }
.js .card.reveal { transform: translateY(40px) rotateX(8deg); }
.js .card.reveal.in { transform: rotateX(var(--rx)) rotateY(var(--ry)); transition: opacity .9s var(--ease), transform .9s var(--ease), border-color .3s, box-shadow .4s; transition-delay: var(--d, 0ms), var(--d, 0ms), 0s, 0s; }
.js .card.reveal.in.tilting { transition: border-color .3s, box-shadow .4s, transform .08s linear; }

/* ---------- Debug view easter egg (Konami / palette) ---------- */
.debug * { outline: 1px dashed rgba(0, 255, 198, .28) !important; outline-offset: -1px; }
.debug body::before { -webkit-mask-image: none; mask-image: none; opacity: 1; }

/* ---------- Motion off: OS setting or the palette's toggle ---------- */
@media (prefers-reduced-motion: reduce) {
  .js .reveal, .js .card.reveal { opacity: 1; transform: none; filter: none; transition: none; }
  .badge::before, .hero .role::after, .scroll-cue::after { animation: none; }
  .card, .card img, .btn, .gallery a, .gallery img, .skill { transition: none !important; }
  .card:hover::after { animation: none; }
}
.fx-off .reveal, .fx-off .card.reveal { opacity: 1 !important; transform: none !important; filter: none !important; transition: none !important; }
.fx-off .badge::before, .fx-off .hero .role::after, .fx-off .scroll-cue::after, .fx-off .card:hover::after { animation: none; }

@media (hover: none) {
  .card:hover { transform: none; }
  .card:active { transform: scale(.985); border-color: rgba(0, 200, 255, .6); }
  .gallery a::after { display: none; }
}

@media print {
  body::before, body::after, .hero-canvas, .hud, .hero-cover { display: none !important; }
  body { background: #fff; color: #000; }
}

@media (max-width: 720px) {
  .project-hero::after { background: linear-gradient(to bottom, rgba(5, 8, 13, .55), rgba(5, 8, 13, .82) 55%, var(--bg)); }
  .project-hero .lede { text-shadow: 0 1px 3px #05080d, 0 0 16px #05080d; }
  .timeline { padding-left: 26px; }
  .timeline::before, .timeline::after { left: 5px; }
  .timeline .job::before { left: -27px; width: 12px; height: 12px; }
}
