/* Styles for the main page. */
/* No scroll-behavior: smooth. Its duration varies per browser, so js/scroll.js
   animates scrolling itself. */
html {
  scroll-padding-top: var(--nav-h);
  scrollbar-color: var(--accent) transparent; scrollbar-width: thin;
}
body { overflow-x: hidden; }
body.no-scroll { overflow: hidden; }

.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: var(--z-skip-link); padding: 8px 14px;
  font-family: var(--font-mono); font-size: 0.82rem; color: var(--bg);
  background: var(--accent); border-radius: 3px;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* ══════════════════════════════════════════════════════════════
   DESKTOP NAV — dark bar, links centred
══════════════════════════════════════════════════════════════ */
#navbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--nav-h);
  display: flex; align-items: center; justify-content: center;
  padding: 0 48px; z-index: var(--z-nav);
  background: rgba(14,14,14,0.94); backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: background 0.4s var(--ease), box-shadow 0.4s;
}
#navbar.scrolled { background: rgba(10,10,10,0.98); box-shadow: 0 1px 0 var(--border); }
.nav-links { display: flex; gap: 40px; list-style: none; }
.nav-links a {
  font-family: var(--font-mono); font-size: 0.82rem; letter-spacing: 0.02em; font-weight: 400;
  color: var(--text-mid); transition: color 0.2s; position: relative;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: -4px; left: 0;
  width: 0; height: 1px; background: var(--accent); transition: width 0.3s var(--ease);
}
.nav-links a:hover, .nav-links a.active { color: var(--accent); }
.nav-links a:hover::after { width: 100%; }
/* "./" path prefix appears only on hover / current section. Inline (so it
   shares the label's baseline) but pulled left by its own width, so the
   labels don't shift. Smaller + dim because "/" is a tall glyph that
   otherwise towers over the lowercase label. */
.nav-links a::before {
  content: './'; display: inline-block; font-size: 0.85em;
  width: 1.45em; margin-left: -1.45em; padding-right: 0.2em; text-align: right;
  color: var(--text-dim); opacity: 0; transition: opacity 0.2s;
}
.nav-links a:hover::before, .nav-links a.active::before { opacity: 1; }

/* ══════════════════════════════════════════════════════════════
   MOBILE — floating hamburger (desktop nav hidden)
══════════════════════════════════════════════════════════════ */
.mob-hamburger {
  display: none;
  position: fixed; top: 18px; right: 18px; z-index: var(--z-hamburger);
  width: 44px; height: 44px;
  background: rgba(18,18,18,0.95);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-strong); /* same edge as .cmd-btn */
  box-shadow: 0 2px 20px rgba(0,0,0,0.5);
  cursor: pointer; border-radius: 6px;
  flex-direction: column; justify-content: center; align-items: center; gap: 5px;
  transition: background 0.2s, border-color 0.2s, opacity 0.2s;
}
.mob-hamburger:hover { border-color: var(--accent); }
.mob-hamburger span {
  display: block; width: 18px; height: 1.5px; background: var(--text);
  transition: transform 0.35s var(--ease), opacity 0.25s, width 0.3s var(--ease);
  transform-origin: center;
}
/* Menu has its own "esc" button in the window bar, so the hamburger steps aside */
.mob-hamburger.active { opacity: 0; pointer-events: none; }

/* ── MOBILE OVERLAY (dims the page as the menu slides over it) ── */
.mobile-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px);
  z-index: var(--z-menu-dim); opacity: 0; pointer-events: none; visibility: hidden; /* no full-screen blur while closed */
  transition: opacity 0.4s, visibility 0s 0.4s;
}
.mobile-overlay.show { opacity: 1; pointer-events: auto; visibility: visible; transition: opacity 0.4s; }

/* ── MOBILE SHELL — the mobile menu:
   types `ls`, prints the sections as directories, types `cd` on tap ── */
.mobile-shell {
  position: fixed; inset: 0; z-index: var(--z-menu); overflow-y: auto;
  display: flex; flex-direction: column; padding: 84px 22px 32px;
  background: var(--bg-shell); font-family: var(--font-mono);
  transform: translateX(100%); visibility: hidden;
  transition: transform 0.4s var(--ease), visibility 0.4s;
}
/* No visibility transition on the way in: the menu takes focus straight away */
.mobile-shell.open { transform: translateX(0); visibility: visible; transition: transform 0.4s var(--ease); }
.mobile-shell-close {
  position: absolute; top: 18px; right: 18px; height: 44px;
  font: inherit; font-size: 0.75rem; color: var(--text-dim); cursor: pointer;
  background: var(--bg-soft); border: 1px solid var(--border-strong); border-radius: 6px; padding: 0 12px;
  transition: color 0.2s, border-color 0.2s;
}
.mobile-shell-close:hover { color: var(--accent); border-color: var(--accent); }
.mobile-shell-line { font-size: 0.75rem; color: var(--text-dim); white-space: pre-wrap; min-height: 1.6em; }
.mobile-shell-line .u { color: var(--accent2); }
.mobile-shell-line .c { color: var(--text); }
.mobile-shell ul { list-style: none; margin: 14px 0 22px; }
.mobile-shell ul a {
  display: block; padding: 13px 0;
  border-bottom: 1px dashed rgba(255,255,255,0.08);
  font-size: 1.45rem; color: var(--text); letter-spacing: -0.02em;
  opacity: 0; transform: translateY(6px);
  transition: opacity 0.25s, transform 0.25s, color 0.2s;
}
.mobile-shell ul a.in { opacity: 1; transform: translateY(0); }
.mobile-shell ul a .s { color: var(--text-dim); }
.mobile-shell ul a:hover, .mobile-shell ul a.sel { color: var(--accent); }
.mobile-shell-footer { margin-top: auto; padding-top: 24px; opacity: 0; transition: opacity 0.3s; }
.mobile-shell-footer.in { opacity: 1; }
.mobile-shell-tools { display: flex; gap: 8px; margin-top: 16px; }
.mobile-shell-tools button { padding: 8px 12px; }

/* ══════════════════════════════════════════════════════════════
   LAYOUT
══════════════════════════════════════════════════════════════ */
.container { max-width: 1160px; margin: 0 auto; padding: 0 48px; }

.section-title {
  font-size: clamp(2.2rem,4.5vw,3.8rem); font-weight: 300; letter-spacing: -0.02em;
  color: var(--text); margin-bottom: 48px;
}

/* Section labels read as shell commands: "> ls ~/projects▮" */
.section-label {
  font-family: var(--font-mono); font-size: 0.82rem; letter-spacing: 0.02em;
  font-weight: 400; color: var(--accent); margin-bottom: 18px;
  display: flex; align-items: center; gap: 10px;
}
.section-label-center { justify-content: center; }
.section-label::before { content: '>'; color: var(--accent2); }
.section-label::after {
  content: ''; width: 0.55em; height: 1em; margin-left: -4px; background: var(--accent2);
  animation: caret-blink 1.05s steps(1) infinite;
}

/* ══════════════════════════════════════════════════════════════
   BIDIRECTIONAL SCROLL REVEAL
   enter from below → .visible (up)
   exit past top   → .exit-up (subtle upward fold)
   exit below      → reset silently
══════════════════════════════════════════════════════════════ */
/* Hidden only under .js (set in <head>), so the page is readable when
   the script is off or fails to run. */
.reveal { transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.js .reveal { opacity: 0; transform: translateY(28px); }
.reveal.visible  { opacity: 1; transform: translateY(0); }
.reveal.exit-up  { opacity: 0; transform: translateY(-18px); }
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }

/* ══════════════════════════════════════════════════════════════
   HERO
══════════════════════════════════════════════════════════════ */
#home {
  min-height: 100vh; display: flex; flex-direction: column; justify-content: center;
  padding-top: calc(var(--nav-h) + 60px); padding-bottom: 80px;
  position: relative; overflow: hidden;
}
/* Editor-viewport floor: the grid tilted back in perspective, filling the
   lower part of the hero, with 256px major lines over 64px minor ones.
   It drifts toward the viewer; motion-off stops it (rules at the bottom). */
.hero-floor {
  position: absolute; left: 0; right: 0; bottom: 0; height: 58%;
  perspective: 520px; perspective-origin: 50% 0%; overflow: hidden; pointer-events: none;
  mask-image: linear-gradient(to bottom, transparent 0%, #000 45%, #000 80%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 45%, #000 80%, transparent 100%);
}
.hero-floor-plane {
  position: absolute; left: -60%; right: -60%; top: 0; height: 1400px;
  transform-origin: 50% 0; transform: rotateX(68deg);
  background-image:
    linear-gradient(rgba(183,219,216,0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(183,219,216,0.16) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 256px 256px, 256px 256px, 64px 64px, 64px 64px;
  background-position: 50% 0;
  animation: floor-drift 24s linear infinite;
}
@keyframes floor-drift { to { background-position: 50% 256px; } }
/* Axis gizmo in the hero's bottom-left corner, like an editor viewport's */
.hud-gizmo {
  position: absolute; left: 8px; bottom: 8px; width: 64px; height: 56px;
  font-family: var(--font-mono); font-size: 10px; line-height: 1;
}
:is(.hud-gizmo, .scene-gizmo) i { position: absolute; left: 8px; bottom: 8px; display: block; }
:is(.hud-gizmo, .scene-gizmo) .ax-x { width: 34px; height: 1.5px; background: var(--accent); }
:is(.hud-gizmo, .scene-gizmo) .ax-z { width: 1.5px; height: 34px; background: var(--accent2); }
:is(.hud-gizmo, .scene-gizmo) .ax-y { width: 24px; height: 1.5px; background: var(--text-dim); transform-origin: 0 50%; transform: rotate(-145deg); }
:is(.hud-gizmo, .scene-gizmo) b { position: absolute; font-weight: 400; }
:is(.hud-gizmo, .scene-gizmo) .lb-x { left: 46px; bottom: 3px; color: var(--accent); }
:is(.hud-gizmo, .scene-gizmo) .lb-z { left: 4px; top: -6px; color: var(--accent2); }
/* The rest of the page keeps a much fainter flat grid */
#projects, #work-history, #contact {
  background-image: linear-gradient(rgba(255,255,255,0.028) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,0.028) 1px, transparent 1px);
  background-size: 64px 64px; background-position: 50% 0;
}

/* ── Descent theme (the default) ─────────────────────────────────
   The 3D editor scene (js/scene.js) is one fixed canvas behind the whole
   page, so the hero's floor, the section grids and the work-history band
   step aside. Keyed on .js too: if the scripts never run, the classic
   look shows instead of an empty page. */
.scene, .scene-hud { display: none; }
.js[data-theme="descent"] .scene {
  display: block; position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: -1; pointer-events: none;
}
.js[data-theme="descent"] :is(.hero-floor, .hud-gizmo, .divider) { display: none; }
.js[data-theme="descent"] :is(#projects, #work-history, #contact) {
  background: transparent; border-color: transparent;
}
.js[data-theme="descent"] .timeline-rail::after { background: var(--bg); }
/* Viewport readout: axis gizmo, view mode, camera height. Wide screens only,
   where the corner is clear of the content. */
@media (min-width: 1280px) {
  .js[data-theme="descent"] .scene-hud {
    display: block; position: fixed; left: 24px; bottom: 56px; pointer-events: none;
    font-family: var(--font-mono); font-size: 10px; line-height: 1.5; color: var(--text-dim);
  }
}
.scene-gizmo { position: relative; width: 64px; height: 50px; margin-bottom: 6px; }
.scene-gizmo .lb-z { top: -8px; }
.scene-hud span { color: var(--accent2); }
/* Small status readout in the hero's top-right corner */
.hud {
  position: absolute; inset: calc(var(--nav-h) + 24px) 24px 24px; pointer-events: none;
}
.hud-status {
  position: absolute; top: 8px; right: 8px;
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-dim);
}
.hud-status span { color: var(--accent2); }
/* Hero content: centred */
.hero-inner {
  position: relative;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}

/* ── Hero profile photo ──────────────────────────────────────── */
/* Photo shown as a small app window: title bar with dots + filename.
   Easter egg: drag it by the bar, throw it, minimize it (see js/photo-window.js).
   The wrap keeps the window's place in the hero while it's away. */
.hero-photo-wrap {
  position: relative; width: 216px; margin-bottom: 40px;
}
/* A transform here would pin the fixed window to this box instead of the
   viewport, so the reveal effect has to step aside while it's floating. */
.hero-photo-wrap.floating { transform: none; opacity: 1; transition: none; }
.photo-win {
  border: 1px solid var(--border-teal); border-radius: 8px; overflow: hidden;
  background: var(--bg-soft); transform-origin: 0 0;
  transition: box-shadow 0.2s, border-color 0.2s;
}
/* Under the console (150 on desktop) and nav, over the page content */
.floating .photo-win {
  position: fixed; top: 0; left: 0; z-index: var(--z-photo); width: inherit;
  box-shadow: 0 10px 28px rgba(0,0,0,0.45);
}
.photo-win.dragging { box-shadow: 0 18px 44px rgba(0,0,0,0.6); border-color: var(--accent2); }
.photo-return {
  position: absolute; inset: 0; width: 100%;
  background: none; border: 1px dashed var(--border-teal); border-radius: 8px;
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-dim);
  cursor: pointer; transition: color 0.2s, border-color 0.2s;
}
.photo-return[hidden] { display: none; }
.photo-return:hover, .photo-return:focus-visible { color: var(--accent); border-color: var(--accent); }
.photo-bar {
  display: flex; align-items: center; gap: 6px; padding: 7px 10px;
  border-bottom: 1px solid var(--border-teal);
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-dim);
  user-select: none; -webkit-user-select: none;
}
/* Only under .js, so the bar can't block scrolling if the script never runs */
.js .photo-bar { cursor: grab; touch-action: none; }
.js .dragging .photo-bar { cursor: grabbing; }
.photo-bar em { margin-left: auto; font-style: normal; white-space: nowrap; }
.photo-bar em.denied { color: var(--accent); }
.photo-dot {
  position: relative; width: 9px; height: 9px; flex: none; padding: 0; border: 0;
  border-radius: 50%; background: var(--dot); color: var(--text);
  display: flex; align-items: center; justify-content: center;
  font: 500 9px/9px var(--font-mono); cursor: pointer;
}
.photo-dot::before { content: ''; position: absolute; inset: -4px; }
.photo-dot i { font-style: normal; opacity: 0; transition: opacity 0.15s; pointer-events: none; }
.photo-bar:hover .photo-dot i, .photo-dot:focus-visible i { opacity: 1; }
.photo-dot:focus-visible { outline: 1px solid var(--text); outline-offset: 2px; }
.photo-dot:nth-child(1) { background: var(--accent); color: var(--bg); }
.photo-dot:nth-child(2) { background: var(--accent2); color: var(--bg); }
@media (pointer: coarse) {
  .photo-bar { gap: 11px; padding: 10px; }
  .photo-dot { width: 13px; height: 13px; font-size: 11px; }
  .photo-dot::before { inset: -6px; }
}
/* Minimized window */
.photo-chip {
  position: fixed; z-index: var(--z-photo); left: 50%; translate: -50% 0;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px;
  background: var(--bg-soft); border: 1px solid var(--border-teal); border-radius: 8px;
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-mid);
  cursor: pointer; transition: color 0.2s, border-color 0.2s;
}
.photo-chip[hidden] { display: none; }
.photo-chip:hover, .photo-chip:focus-visible { color: var(--accent); border-color: var(--accent); }
.photo-chip img {
  width: 26px; height: 26px; border-radius: 4px; display: block;
  object-fit: cover; object-position: center top;
}
.hero-photo {
  width: 100%; height: 216px;
  object-fit: cover; object-position: center top; display: block;
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(237,193,201,0.15) 100%);
}

/* ── Boot sequence ───────────────────────────────────────────
   Typed over the hero on first visit; hero content stays hidden
   (.booting) until the log finishes, then fades away. */
#home.booting .reveal { opacity: 0; transform: translateY(28px); }
.boot-log {
  position: absolute; inset: 0; z-index: 5;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--bg); padding: 0 24px;
  transition: opacity 0.5s var(--ease), visibility 0.5s;
}
.boot-log.done { opacity: 0; visibility: hidden; }
.boot-log pre {
  font-family: var(--font-mono); font-size: 0.92rem; line-height: 1.75;
  color: var(--text-dim); white-space: pre-wrap; width: min(560px, 100%);
}
.boot-log .cmd  { color: var(--text); }
.boot-log .ok   { color: var(--accent2); }
.boot-log .skip {
  width: min(560px, 100%); margin-top: 18px;
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-dim);
}
.boot-log[hidden] { display: none; }
.hero-name {
  font-size: clamp(4rem,9vw,7.8rem); font-weight: 300; line-height: 0.9;
  letter-spacing: -0.02em; color: var(--text); margin-bottom: 32px;
}
.hero-name em { font-style: normal; color: var(--accent); }
/* Underscore-style cursor — a thin bar here would read as a letter "l" */
.hero-name .caret { width: 0.42em; height: 0.06em; min-height: 3px; vertical-align: 0; margin-left: 0.08em; }
.hero-title { font-size: 1.6rem; font-weight: 400; line-height: 1.3; color: var(--text); margin-bottom: 8px; }
.hero-meta, .hero-focus {
  font-family: var(--font-mono); font-size: 0.88rem; letter-spacing: 0.04em; text-wrap: balance;
}
.hero-meta { color: var(--text-dim); margin-bottom: 28px; }
.hero-focus { color: var(--accent2); margin-bottom: 28px; }
.hero-rule {
  font-family: var(--font-mono); font-size: 0.85rem; color: var(--text-dim);
  letter-spacing: -0.02em; margin: 0 auto 28px;
}
.hero-body {
  max-width: 640px; color: var(--text-mid); font-size: 1.11rem; line-height: 1.8;
  margin-bottom: 44px;
}
.hero-body strong { color: var(--text); font-weight: 600; }

.divider { height: 1px; background: var(--border); }

/* ══════════════════════════════════════════════════════════════
   PROJECTS
══════════════════════════════════════════════════════════════ */
#projects { padding: var(--gap) 0; }
/* Desktop / large screens: fixed 2 columns, full container width */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  list-style: none;
  gap: 64px;
}

.project-card { position: relative; background: var(--bg-card); overflow: hidden; aspect-ratio: 16/9; cursor: pointer; border-radius: 14px; }
.project-card img, .project-card video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
}
.project-card img { z-index: 1; filter: grayscale(15%); transition: opacity 0.5s, transform 0.6s var(--ease), filter 0.5s; }
.project-card video { z-index: 2; opacity: 0; transition: opacity 0.5s; }

/* Playing: the video fades in over the thumbnail */
.project-card.card-playing img  { opacity: 0; transform: scale(1.03); filter: grayscale(0%); }
.project-card.card-playing video { opacity: 1; }

/* Label: always-visible gradient + title only */
.project-label {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 3;
  padding: 44px 18px 14px;
  background: linear-gradient(to top, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.45) 55%, transparent 100%);
}
.project-label-title {
  font-size: 1.2rem; font-weight: 600; color: #fff;
  text-shadow: 0 1px 5px rgba(0,0,0,0.6); letter-spacing: 0.01em;
}
/* Role: hidden by default, fades in on hover / tap */
.project-label-role {
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 400;
  color: rgba(255,255,255,0.72); margin-top: 5px;
  opacity: 0; transform: translateY(5px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.project-card:hover .project-label-role,
.project-card:has(.project-open:focus-visible) .project-label-role { opacity: 1; transform: translateY(0); }

/* "Click to expand" chip — shown on hover */
.project-expand-hint {
  position: absolute; top: 12px; right: 12px; z-index: 4;
  background: rgba(14,14,14,0.82); color: var(--accent);
  font-family: var(--font-mono); font-size: 0.72rem;
  padding: 5px 12px; border-radius: 999px; opacity: 0; transform: translateY(-4px);
  transition: opacity 0.3s, transform 0.3s var(--ease); pointer-events: none;
}
.project-card:hover .project-expand-hint,
.project-card:has(.project-open:focus-visible) .project-expand-hint { opacity: 1; transform: translateY(0); }
/* The button is the keyboard route in (clicks anywhere on the card also work);
   it looks like the plain title, and the focus ring goes on the whole card. */
.project-open { all: unset; cursor: pointer; }
.project-card:has(.project-open:focus-visible) { outline: 2px solid var(--accent2); outline-offset: 2px; }

/* ══════════════════════════════════════════════════════════════
   LIGHTBOX
══════════════════════════════════════════════════════════════ */
.lightbox-overlay {
  position: fixed; inset: 0; z-index: var(--z-lightbox);
  background: rgba(0,0,0,0.88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  opacity: 0; pointer-events: none; visibility: hidden; /* no hidden tab stops while closed */
  transition: opacity 0.45s var(--ease), visibility 0s 0.45s;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 24px 60px; overflow-y: auto;
}
.lightbox-overlay.open { opacity: 1; pointer-events: auto; visibility: visible; transition: opacity 0.45s var(--ease); }

/* Panel: drops in from slightly above, scales up from 0.94 */
.lightbox {
  width: 100%; max-width: 900px; background: var(--bg-soft);
  border: 1px solid var(--border-teal); border-radius: 8px; overflow: hidden;
  transform: translateY(40px) scale(0.94); opacity: 0;
  transition: transform 0.55s var(--ease), opacity 0.55s var(--ease);
  position: relative; margin: auto;
}
.lightbox-overlay.open .lightbox {
  transform: translateY(0) scale(1); opacity: 1;
}

/* Window title bar, like the hero photo's. The pink dot and the ✕ on the
   right both close the window. */
.lightbox-bar {
  display: flex; align-items: center; gap: 6px; padding: 9px 12px;
  border-bottom: 1px solid var(--border-teal);
  font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-dim);
}
.lightbox-bar > span { width: 11px; height: 11px; border-radius: 50%; flex: none; background: var(--dot); }
.lightbox-bar > span:nth-of-type(1) { background: var(--accent2); }
.lightbox-bar em {
  flex: 1; min-width: 0; text-align: center; font-style: normal;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lightbox-dot-close {
  width: 11px; height: 11px; border-radius: 50%; flex: none; padding: 0; border: 0;
  background: var(--accent); cursor: pointer; position: relative;
}
.lightbox-dot-close::after {
  content: '×'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 10px; line-height: 1; color: var(--bg); opacity: 0; transition: opacity 0.15s;
}
.lightbox-bar:hover .lightbox-dot-close::after { opacity: 1; }
.lightbox-close {
  background: none; border: 0; padding: 0 2px; cursor: pointer;
  font: inherit; color: var(--text-dim); transition: color 0.2s;
}
.lightbox-close:hover, .lightbox-close:focus-visible { color: var(--accent); }

/* Video section */
.lightbox-video-wrap { position: relative; width: 100%; padding-top: 56.25%; background: #000; }
.lightbox-video-wrap video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; display: block;
}

/* Custom controls */
.video-controls {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 10;
  padding: 14px 16px 16px;
  background: linear-gradient(to top,rgba(0,0,0,0.82) 0%,transparent 100%);
  display: flex; align-items: center; gap: 12px;
  opacity: 0; transition: opacity 0.25s;
}
.lightbox-video-wrap:hover .video-controls,
.lightbox-video-wrap:focus-within .video-controls { opacity: 1; }

.vc-play {
  flex-shrink: 0; width: 32px; height: 32px; background: none;
  border: 1px solid rgba(255,255,255,0.45); cursor: pointer; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.2s, background 0.2s; color: #fff;
}
.vc-play:hover { border-color: #fff; background: rgba(255,255,255,0.1); }
.vc-play svg { width: 11px; height: 11px; fill: currentColor; }
.vc-play .icon-pause { display: none; }
.vc-play.playing .icon-play  { display: none; }
.vc-play.playing .icon-pause { display: block; }

.vc-time {
  font-size: 0.72rem; font-weight: 500; color: rgba(255,255,255,0.8);
  letter-spacing: 0.04em; white-space: nowrap; flex-shrink: 0;
}
.vc-scrubber { flex: 1; height: 3px; background: rgba(255,255,255,0.2); position: relative; cursor: pointer; border-radius: 2px; touch-action: none; }
/* Taller invisible hit area — 3px is too thin for a finger */
.vc-scrubber::before { content: ''; position: absolute; inset: -12px 0; }
.vc-progress { height: 100%; background: var(--accent); border-radius: 2px; width: 0%; pointer-events: none; }
.vc-scrubber:hover .vc-progress, .vc-scrubber:focus-visible .vc-progress { background: #fff; }
.vc-scrubber:focus-visible { outline-offset: 5px; }

/* Lightbox body — slides up after panel lands */
.lightbox-body {
  padding: 32px 36px 36px; border-top: 1px solid rgba(255,255,255,0.12);
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.lightbox-overlay.open .lightbox-body {
  opacity: 1; transform: translateY(0);
  transition: opacity 0.5s var(--ease) 0.28s, transform 0.5s var(--ease) 0.28s;
}
.lightbox-title { font-size: 1.75rem; font-weight: 400; letter-spacing: -0.01em; color: var(--text); margin-bottom: 16px; }
.lightbox-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.lightbox-tag {
  font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 500;
  color: var(--accent); border: 1px solid rgba(237,193,201,0.22);
  padding: 4px 12px; background: rgba(237,193,201,0.06); border-radius: 999px;
}
.lightbox-section-label { font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; font-weight: 500; color: var(--text-dim); margin-bottom: 10px; }
.lightbox-overview { margin-top: 20px; }
.lightbox-studio { font-size: 0.72rem; letter-spacing: 0.05em; font-weight: 500; color: var(--accent2); margin-bottom: 24px; }
.lightbox-desc { font-size: 0.92rem; color: var(--text-mid); line-height: 1.75; margin-bottom: 24px; }
.lightbox-highlights { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.lightbox-highlights li { font-size: 0.88rem; color: var(--text-mid); line-height: 1.65; padding-left: 20px; position: relative; }
.lightbox-highlights li::before { content: '—'; position: absolute; left: 0; color: var(--accent); font-size: 0.65rem; top: 3px; }
.lightbox-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.lightbox-links:empty { margin-top: 0; }
.lb-link-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  text-decoration: none; transition: opacity 0.2s, transform 0.2s;
}
.lb-link-btn:hover { opacity: 0.82; transform: translateY(-1px); }
.lb-link-btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.lb-link-trailer {
  background: #cc0000; color: #fff;
  box-shadow: 0 4px 18px rgba(255,0,0,0.35);
}
.lb-link-play {
  background: var(--accent); color: var(--bg);
  box-shadow: 0 4px 18px rgba(237,193,201,0.3);
}

/* ══════════════════════════════════════════════════════════════
   WORK HISTORY
══════════════════════════════════════════════════════════════ */
#work-history {
  padding: var(--gap) 0;
  background: var(--bg-soft);
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
/* Open timeline: mono years | teal rail with a node per role | role details */
.timeline { display: flex; flex-direction: column; list-style: none; }
.timeline-entry { display: grid; grid-template-columns: 180px 28px 1fr; gap: 0 22px; }
.timeline-meta { text-align: right; padding-top: 6px; font-family: var(--font-mono); }
.timeline-period { font-size: 0.82rem; color: var(--accent); white-space: nowrap; }
.timeline-company { font-size: 0.9rem; color: var(--accent2); margin-top: 6px; line-height: 1.4; }
.timeline-rail { position: relative; }
.timeline-rail::before {
  content: ''; position: absolute; left: 13px; top: 0; bottom: 0; width: 1px;
  background: rgba(183,219,216,0.4);
}
.timeline-entry:first-child .timeline-rail::before { top: 12px; }
.timeline-entry:last-child .timeline-rail::before { bottom: auto; height: 12px; }
.timeline-rail::after {
  content: ''; position: absolute; left: 8px; top: 8px; width: 11px; height: 11px;
  border-radius: 50%; border: 2px solid var(--accent2); background: var(--bg-soft);
}
.timeline-entry.current .timeline-rail::after {
  background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-lt);
}
.timeline-main { padding-bottom: 56px; }
.timeline-entry:last-child .timeline-main { padding-bottom: 0; }
.timeline-role { font-size: 1.3rem; font-weight: 400; letter-spacing: -0.01em; color: var(--text); }
.timeline-current {
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--accent2);
  border: 1px solid var(--border-teal); border-radius: 3px; padding: 2px 7px;
  display: inline-flex; align-items: center; gap: 6px; vertical-align: 3px; margin-left: 10px;
}
.timeline-current::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent2); box-shadow: 0 0 6px var(--accent2);
}
.timeline-promotion { font-size: 0.8rem; color: var(--text-dim); margin-top: 6px; }
.timeline-promotion b { font-weight: 500; color: var(--accent2); }
.timeline-content { margin-top: 22px; }
.timeline-project { font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; color: var(--accent2); margin-bottom: 10px; }
.timeline-bullets + .timeline-project { margin-top: 22px; }
.timeline-bullets { list-style: none; display: flex; flex-direction: column; gap: 8px; max-width: 70ch; }
.timeline-bullets li { font-size: 0.94rem; color: var(--text-mid); line-height: 1.65; padding-left: 20px; position: relative; }
.timeline-bullets a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.timeline-bullets li::before { content: '›'; position: absolute; left: 2px; top: -1px; color: var(--accent); font-family: var(--font-mono); }

/* ══════════════════════════════════════════════════════════════
   CONTACT
══════════════════════════════════════════════════════════════ */
#contact { padding: var(--gap) 0; text-align: center; }
.contact-headline {
  font-size: clamp(2.8rem,6vw,6rem); font-weight: 300; letter-spacing: -0.02em;
  color: var(--text); line-height: 1.05; margin-bottom: 44px;
}
.contact-headline em { font-style: normal; color: var(--accent); }
.contact-links { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }

/* ══════════════════════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════════════════════ */
footer {
  border-top: 1px solid var(--border);
  padding: 13px 48px;
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bg-soft);
}
.footer-copy { font-size: 0.72rem; letter-spacing: 0.1em; font-weight: 500; color: var(--text-dim); }

/* ══════════════════════════════════════════════════════════════
   DROP-DOWN CONSOLE — toggled with ` (or a >_ console button: nav bar on
   desktop, menu on mobile)
══════════════════════════════════════════════════════════════ */
/* --vv-top and --vv-h track the area the keyboard leaves visible (js/console.js) */
.console {
  --console-top: 0px;
  position: fixed; top: calc(var(--console-top) + var(--vv-top, 0px)); left: 0; right: 0; z-index: var(--z-console);
  height: min(46vh, 420px); max-height: calc(var(--vv-h, 100vh) - var(--console-top));
  min-height: 64px; /* the input row, however little room the keyboard leaves */
  display: flex; flex-direction: column;
  background: var(--bg-shell); border-bottom: 1px solid var(--accent2);
  font-family: var(--font-mono); font-size: 0.86rem; line-height: 1.6; color: var(--text-mid);
  transform: translateY(-101%); visibility: hidden;
  transition: transform 0.35s var(--ease), visibility 0.35s;
}
/* No visibility transition on the way in: the input takes focus straight away */
.console.open { transform: translateY(0); visibility: visible; transition: transform 0.35s var(--ease); }
.console-close {
  position: absolute; top: 10px; right: 16px; z-index: 1;
  font: inherit; font-size: 0.75rem; color: var(--text-dim);
  background: rgba(10,13,13,0.9); border: 1px solid var(--border); border-radius: 4px;
  padding: 6px 10px; cursor: pointer; transition: color 0.2s, border-color 0.2s;
}
.console-close:hover { color: var(--accent); border-color: var(--accent); }
.console-out { flex: 1; overflow-y: auto; padding: 48px 24px 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.console-out .c-cmd { color: var(--text); }
.console-out .c-ok  { color: var(--accent2); }
.console-out .c-err { color: var(--accent); }
.console-out .c-hl  { color: var(--accent2); font-weight: 700; }
.console-out a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.console-in { flex-shrink: 0; display: flex; align-items: center; gap: 10px; padding: 10px 24px 14px; border-top: 1px solid var(--border); }
.console-in label { color: var(--accent2); }
.console-in input {
  flex: 1; min-width: 0; background: none; border: 0; outline: none;
  font: inherit; color: var(--text); caret-color: var(--accent2);
}
.console-toggle, .motion-toggle {
  font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-dim);
  background: none; border: 1px solid var(--border); border-radius: 4px;
  padding: 3px 8px; cursor: pointer; transition: color 0.2s, border-color 0.2s;
}
.console-toggle:hover, .motion-toggle:hover { color: var(--accent2); border-color: var(--accent2); }
/* "off" and "on" take the same width, so the button doesn't shift when it flips */
.motion-toggle b { display: inline-block; min-width: 3ch; font-weight: 400; color: var(--accent2); text-align: left; }
/* Does nothing without the main script */
html:not(.js) .motion-toggle { display: none; }
/* Both toggles, pinned to the right of the desktop nav bar */
.nav-tools {
  position: absolute; right: 48px; top: 50%; transform: translateY(-50%);
  display: flex; gap: 8px;
}
.nav-tools button { padding: 5px 10px; color: var(--text-mid); border-color: var(--border-strong); }
.nav-tools button:hover { color: var(--accent2); border-color: var(--accent2); }
/* Both labels share one grid cell so the button keeps the wider one's
   width — it doesn't shift under the cursor when it flips. */
.nav-console { position: relative; display: inline-grid; }
.nav-console .when-closed, .nav-console .when-open { grid-area: 1 / 1; }
.nav-console .when-open { visibility: hidden; }
.nav-console[aria-expanded="true"] .when-open { visibility: visible; }
.nav-console[aria-expanded="true"] .when-closed { visibility: hidden; }
/* Instant hover hint for the ` shortcut (native title tooltips are slow/unreliable) */
.nav-console-hint {
  position: absolute; top: calc(100% + 8px); right: 0;
  white-space: nowrap; font-size: 0.7rem; color: var(--text-mid);
  background: var(--bg-soft); border: 1px solid var(--border-strong); border-radius: 3px;
  padding: 4px 8px; pointer-events: none;
  opacity: 0; transform: translateY(-4px); transition: opacity 0.15s, transform 0.15s;
}
/* The backtick is a tiny glyph — enlarge + colour it so it reads */
.nav-console-hint b { font-size: 1.35em; font-weight: 500; color: var(--accent2); line-height: 0; vertical-align: -0.15em; }
.nav-console:hover .nav-console-hint, .nav-console:focus-visible .nav-console-hint { opacity: 1; transform: translateY(0); }
/* Once used, the hint has done its job — fade it until the pointer leaves */
.nav-console.hint-off .nav-console-hint { opacity: 0; transform: translateY(-4px); }

/* ══════════════════════════════════════════════════════════════
   WRONG WAY — the console's `run` easter egg (see js/wrong-way.js)
══════════════════════════════════════════════════════════════ */
.console.ww-playing { height: min(78vh, 680px); max-height: none; background: #0a0d0d; }
.console.ww-playing .console-out, .console.ww-playing .console-in { display: none; }
.ww {
  flex: 1; min-height: 0; width: 100%; margin: 0; overflow: hidden;
  font: inherit; font-variant-ligatures: none; line-height: 1.15; color: var(--text-mid);
  white-space: pre; cursor: default; user-select: none; -webkit-user-select: none;
  touch-action: none; -webkit-touch-callout: none; text-align: center;
}
.ww-sky   { color: var(--text-dim); opacity: 0.7; }
.ww-grass { color: var(--accent2); opacity: 0.32; }
.ww-track { color: var(--accent); opacity: 0.42; }
.ww-line  { color: var(--text); opacity: 0.85; }
.ww-hud   { color: var(--accent2); }
.ww-a     { color: var(--text); font-weight: 700; }
.ww-b     { color: var(--accent2); font-weight: 700; }
.ww-c     { color: #ffd98a; font-weight: 700; }
.ww-say   { color: var(--text); font-style: italic; }
.ww-hands { color: var(--text-mid); }
.ww-flash { color: var(--accent); font-weight: 700; }
/* Touch: fill the screen, so a thumb can't miss the game and close the console.
   The close button is the only way out, and sits above the HUD. */
@media (max-width: 768px), (pointer: coarse) {
  .console.ww-playing { top: 0; z-index: var(--z-console); height: 100vh; height: 100dvh; }
  .console.ww-playing .console-close { display: block; }
  .ww { padding-top: 48px; }
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════════ */
/* Centred links would run into the buttons on narrow desktop widths */
@media (max-width: 960px) { #navbar { justify-content: flex-start; } }

/* Desktop: the console drops out from under the nav bar, so the nav
   button stays put and doubles as its close button. */
@media (min-width: 769px) {
  .console { --console-top: var(--nav-h); z-index: var(--z-console-desktop); }
  .console-close { display: none; }
  .console-out { padding-top: 16px; }
}

@media (max-width: 768px) {
  :root { --gap: 72px; }

  /* Hide desktop nav; show floating hamburger */
  #navbar { display: none; }
  .mob-hamburger { display: flex; }

  #home { padding-top: 64px; padding-bottom: 48px; }
  .hud { inset: 76px 12px 12px; }
  .hud-status, .hud-gizmo { display: none; }
  html { scroll-padding-top: 24px; }
  .container { padding: 0 20px; }
  .hero-photo-wrap { width: 172px; margin-bottom: 28px; }
  .hero-photo { height: 172px; }
  .hero-title { font-size: 1.35rem; }
  .hero-meta, .hero-focus { font-size: 0.8rem; margin-bottom: 20px; }
  .hero-name { font-size: clamp(3.2rem,13vw,5rem); margin-bottom: 18px; }
  .hero-rule { margin-bottom: 16px; }
  .hero-body { margin-bottom: 24px; font-size: 1rem; line-height: 1.65; }

  .projects-grid { grid-template-columns: 1fr; gap: 12px; }

  .timeline-entry { grid-template-columns: 22px 1fr; gap: 0 14px; }
  .timeline-meta { grid-column: 2; grid-row: 1; text-align: left; padding: 4px 0 8px; }
  .timeline-company { font-size: 0.78rem; margin-top: 2px; }
  .timeline-rail { grid-column: 1; grid-row: 1 / span 2; }
  .timeline-rail::before { left: 10px; }
  .timeline-rail::after { left: 5px; }
  .timeline-main { grid-column: 2; padding-bottom: 44px; }
  .timeline-role { font-size: 1.15rem; }
  .timeline-current { margin-left: 6px; }

  .lightbox-overlay { padding: 16px 12px 40px; }
  .lightbox-body { padding: 24px 20px 28px; }
  .video-controls { opacity: 1; } /* always visible on touch */

  footer { flex-direction: column; text-align: center; padding: 13px 24px; }

  .console { height: 50vh; height: 50dvh; font-size: 0.8rem; }
  .console-out, .console-in { padding-left: 16px; padding-right: 16px; }
}

/* Nothing to hover on touch screens, so the role and hint are always shown */
@media (max-width: 768px), (hover: none) {
  .project-label-role, .project-expand-hint { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
  .contact-links { flex-direction: column; align-items: center; }
}

/* Landscape phones and other short viewports. With the keyboard up, the
   console's output can't spare room for the close button. */
@media (max-height: 520px) {
  .mobile-shell { padding-top: 24px; }
  .mobile-shell ul { margin: 6px 0 10px; }
  .mobile-shell ul a { font-size: 1.1rem; padding: 7px 0; }
  .console-out { padding-top: 8px; }
}

/* Animations off: the OS setting unless data-motion overrides it (js/prefs.js).
   The media query also covers visitors without JS, so keep both blocks in step. */
@media (prefers-reduced-motion: reduce) {
  :root:not([data-motion="on"]) *, :root:not([data-motion="on"]) *::before, :root:not([data-motion="on"]) *::after { animation: none !important; transition: none !important; }
  :root:not([data-motion="on"]) .reveal, :root:not([data-motion="on"]) .reveal.exit-up { opacity: 1; transform: none; }
  :root:not([data-motion="on"]) .lightbox, :root:not([data-motion="on"]) .lightbox-body, :root:not([data-motion="on"]) .project-card.card-playing img { transform: none; }
}
:root[data-motion="off"] *, :root[data-motion="off"] *::before, :root[data-motion="off"] *::after { animation: none !important; transition: none !important; }
:root[data-motion="off"] .reveal, :root[data-motion="off"] .reveal.exit-up { opacity: 1; transform: none; }
:root[data-motion="off"] .lightbox, :root[data-motion="off"] .lightbox-body, :root[data-motion="off"] .project-card.card-playing img { transform: none; }
