/**
 * CYBERPUNK / AI HIGH-TENSION STYLESHEET
 * Gradient Descent & Transformer Attention Visualizers
 * Built-in Visual Project CMS (Neural Studio)
 * High Tension, Zero-Latency, Mobile Ergonomics
 */

/* ==========================================================================
   1. VARIABLES & DESIGN TOKENS
   ========================================================================== */
:root {
  --bg-primary: #050608;
  --bg-surface: #0a0c12;
  --bg-surface-elevated: #11141e;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(0, 240, 255, 0.4);

  --cyan-primary: #00f0ff;
  --green-acid: #00ff9d;
  --pink-neon: #ff0055;
  --amber-warn: #ffb703;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #4e5f73;

  --font-display: 'Syne', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, Menlo, Monaco, monospace;

  --transition-snappy: 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  --mobile-nav-height: 64px;
}

/* ==========================================================================
   2. RESET & BASE
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

/* The `hidden` attribute must win over component display rules (e.g. .cyber-btn's inline-flex),
   otherwise "hidden" link buttons with no destination stay visible */
[hidden] {
  display: none !important;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: #1c2230;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--cyan-primary);
}

/* ==========================================================================
   3. BACKGROUND & GLITCH OVERLAYS
   ========================================================================== */
#cyber-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

.scanline-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
  opacity: 0;
  transition: opacity var(--transition-smooth);
}

body.crt-active .scanline-overlay {
  opacity: 1;
  /* Was 30% black every 3px: it striped every glyph and made text look low-res.
     A fainter 4px pitch keeps the CRT texture without hurting legibility. */
  background: linear-gradient(
    rgba(18, 16, 16, 0) 50%,
    rgba(0, 0, 0, 0.12) 50%
  ), linear-gradient(
    90deg,
    rgba(255, 0, 0, 0.02),
    rgba(0, 255, 0, 0.01),
    rgba(0, 255, 0, 0.02)
  );
  background-size: 100% 4px, 6px 100%;
  /* Scanlines suit the neon night but stripe a bright daytime sky: fade them out by day */
  opacity: calc(1 - var(--day, 0) * 0.85);
}

.vignette {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  /* Edge vignette + a readability scrim under the left-aligned content column,
     so the dense neon city stays vivid at the edges without fighting the text. */
  background:
    radial-gradient(circle at center, transparent 35%, rgba(5, 6, 8, 0.9) 100%),
    linear-gradient(90deg, rgba(5, 6, 8, 0.72) 0%, rgba(5, 6, 8, 0.5) 45%, rgba(5, 6, 8, 0.18) 80%, rgba(5, 6, 8, 0.1) 100%);
  z-index: 1;
  /* --day (0 night … 1 day) is set by the city from Taipei time: the vignette eases off in
     daylight so the sky reads as day, while keeping enough scrim behind the text */
  opacity: calc(1 - var(--day, 0) * 0.5);
  transition: opacity 1.5s ease;
}

/* Page multi-page content wrapper */

.page-wrapper {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: opacity 0.6s ease, visibility 0.6s;
}

/* Scenery View: the page fades away and only the city remains */
body.scenery-mode { overflow: hidden; }
body.scenery-mode .page-wrapper,
body.scenery-mode #floating-preview {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
body.scenery-mode.scenery-idle { cursor: none; }
/* A name flight caught mid-air when scenery view opens: hide it with the rest of the page */
body.scenery-mode .hero-flight-word { display: none; }
/* Nothing between the visitor and the city: no edge vignette, scrim or scanlines */
body.scenery-mode .vignette,
body.scenery-mode .scanline-overlay {
  opacity: 0;
  transition: opacity 0.6s ease;
}
.scenery-bar {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 150;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  max-width: calc(100vw - 32px);
  font-family: var(--font-mono);
  transition: opacity 0.8s ease;
}
.scenery-bar[hidden] { display: none; }
body.scenery-idle .scenery-bar { opacity: 0; }
.scenery-exit {
  padding: 8px 16px;
  background: rgba(5, 6, 8, 0.72);
  border: 1px solid rgba(0, 240, 255, 0.45);
  color: var(--cyan-primary);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  white-space: nowrap;
}
.scenery-exit:hover, .scenery-exit:focus-visible {
  background: rgba(0, 240, 255, 0.12);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.35);
  outline: none;
}
.scenery-exit kbd {
  margin-left: 6px;
  padding: 0 5px;
  border: 1px solid rgba(0, 240, 255, 0.4);
  font-family: inherit;
  font-size: 0.66rem;
}
.scenery-hints {
  font-size: 0.64rem;
  color: var(--text-muted);
  text-shadow: 0 1px 4px #000;
  white-space: nowrap;
}
@media (hover: none) {
  .scenery-hints { display: none; }
}

/* ==========================================================================
   4. FLOATING PREVIEW (Desktop Only)
   ========================================================================== */
#floating-preview {
  position: fixed;
  top: 0;
  left: 0;
  width: 340px;
  border: 1px solid var(--border-highlight);
  background: rgba(10, 12, 18, 0.96);
  padding: 16px;
  pointer-events: none;
  z-index: 9998;
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7), 0 0 25px rgba(0, 240, 255, 0.15);
}

#floating-preview.active {
  opacity: 1;
  transform: scale(1);
}

.preview-art {
  width: 100%;
  height: 150px;
  border: 1px solid var(--border-subtle);
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-category {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--cyan-primary);
  margin-bottom: 4px;
  letter-spacing: 0.08em;
}

.preview-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.preview-tags {
  display: flex;
  gap: 6px;
}

/* ==========================================================================
   5. TOP HUD TELEMETRY BAR
   ========================================================================== */
.hud-telemetry-bar {
  position: sticky;
  top: 0;
  /* Above the site header (z 100, later in the DOM) so HUD dropdowns like the weather menu open over it */
  z-index: 110;
  width: 100%;
  background: rgba(5, 6, 8, 0.94);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 32px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.telemetry-left, .telemetry-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

#hud-sector {
  letter-spacing: 0.08em;
  color: var(--cyan-primary);
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
  font-weight: 700;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}
.status-indicator .beacon {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green-acid);
  box-shadow: 0 0 8px var(--green-acid);
  animation: pulseBeacon 1.8s infinite;
}
@keyframes pulseBeacon {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.hud-pill-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  cursor: pointer;
  transition: all var(--transition-snappy);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.hud-pill-btn:hover, .hud-pill-btn.active {
  color: var(--cyan-primary);
  border-color: var(--cyan-primary);
  background: rgba(0, 240, 255, 0.08);
}

/* Lowest quality tier (set by the city on slow machines): drop full-screen texture overlays */
html[data-quality="low"] .scanline-overlay,
html[data-quality="low"] .vignette::after {
  display: none;
}

/* Phones: HUD buttons shrink to their icons so the bar fits */
@media (max-width: 600px) {
  .hud-word { display: none; }
  .telemetry-right { gap: 6px; }
  .telemetry-right .hud-pill-btn { padding: 3px 7px; }
}

/* Taipei clock (HUD) */
.hud-clock { color: var(--text-secondary); letter-spacing: 0.06em; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Keyboard shortcuts panel (press ?) */
.keys-panel {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 170;
  width: min(360px, calc(100vw - 32px));
  padding: 14px 16px;
  background: rgba(8, 10, 16, 0.97);
  border: 1px solid rgba(0, 240, 255, 0.4);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 18px rgba(0, 240, 255, 0.12);
  font-family: var(--font-mono);
}
.keys-panel[hidden] { display: none; }
.keys-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--cyan-primary);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}
.keys-close {
  background: none;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 26px;
  height: 26px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}
.keys-close:hover { color: var(--pink-neon); border-color: var(--pink-neon); }
.keys-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 14px;
  align-items: center;
  font-size: 0.76rem;
  color: var(--text-secondary);
}
.keys-list dt { white-space: nowrap; color: var(--text-muted); }
kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 1px 6px;
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-bottom-width: 2px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-align: center;
}
.keys-foot { margin-top: 12px; font-size: 0.68rem; color: var(--text-muted); }
.keys-foot b { color: var(--cyan-primary); font-weight: 600; }
.footer-keys-hint {
  margin-left: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  cursor: pointer;
}
.footer-keys-hint:hover { color: var(--cyan-primary); }
@media (hover: none), (max-width: 900px) {
  .footer-keys-hint { display: none; } /* no keyboard on phones and tablets */
}

/* Konami code popup */
.konami-pop {
  position: fixed;
  top: 132px; /* below the site header, so it never covers its buttons */
  right: 16px;
  z-index: 160;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 32px);
  padding: 10px 16px 10px 10px;
  background: rgba(8, 10, 16, 0.95);
  border: 1px solid rgba(255, 183, 3, 0.55);
  box-shadow: 0 0 22px rgba(255, 183, 3, 0.25);
  font-family: var(--font-mono);
  transform: translateX(calc(100% + 24px));
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.konami-pop[hidden] { display: none; }
.konami-pop.show { transform: translateX(0); }
.konami-pop-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--amber-warn);
  border: 1px solid rgba(255, 183, 3, 0.6);
  font-size: 0.9rem;
}
.konami-pop-label { font-size: 0.62rem; letter-spacing: 0.14em; color: var(--amber-warn); }
.konami-pop-name { font-size: 0.82rem; font-weight: 700; color: var(--text-primary); }
@media (prefers-reduced-motion: reduce) {
  .konami-pop { transition: none; }
}

/* Weather picker (HUD) */
.weather-control {
  position: relative;
}
#btn-weather { color: var(--text-primary); }
#weather-btn-icon { color: var(--cyan-primary); margin-right: 4px; }
#btn-overclock-toggle {
  background: rgba(255, 0, 85, 0.08);
  border: 1px solid rgba(255, 0, 85, 0.45);
  box-shadow: 0 0 8px rgba(255, 0, 85, 0.2);
  transition: all var(--transition-snappy);
}

#btn-overclock-toggle:hover {
  background: rgba(255, 0, 85, 0.16);
  border-color: var(--pink-neon);
  box-shadow: 0 0 14px rgba(255, 0, 85, 0.45);
}

#btn-overclock-toggle.active {
  background: rgba(0, 255, 157, 0.14);
  border-color: var(--green-acid);
  box-shadow: 0 0 14px rgba(0, 255, 157, 0.45);
}

/* Header & Nav */
.main-header {
  position: relative;
  z-index: 100;
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 20px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-block {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-mark {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--bg-primary);
  background: var(--cyan-primary);
  padding: 4px 8px;
  letter-spacing: -0.05em;
  border-radius: 2px;
}

.logo-name-group {
  position: relative;
  display: flex;
  align-items: center;
}

/* The header name is a miniature of the hero title: same face, weight, tracking and gradient,
   so the hero name can fly into it and hand over without any visible change */
.logo-text {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.4rem;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  color: var(--text-primary);
  line-height: 1;
}
.logo-text .gradient-word,
.hero-flight-word.is-gradient {
  background: linear-gradient(90deg, #ffffff 0%, var(--cyan-primary) 25%, var(--green-acid) 50%, var(--cyan-primary) 75%, #ffffff 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: fxGradientFlow 6s linear infinite;
}

/* Hero flight (js/hero-flight.js): on home the big hero title is the name, so the header hides its
   own; the swap happens under the flying copy, so no fade is needed */
body.on-home .main-header .logo-text,
.main-header .logo-text.logo-flying { opacity: 0; }

/* VF mark: only shown beside the name. On home (no name in the header) it is folded away; it
   springs in as the flying name approaches and shrinks away as the name lifts off.
   Opacity/transform only, and its space is kept, so the name's landing spot never moves. */
body:not(.name-docked) .main-header .logo-mark {
  opacity: 0;
  transform: scale(0.45) rotate(-10deg);
  transition: opacity 0.28s ease, transform 0.3s ease-in;
}

/* VF mark: a slow breath of light and an occasional holographic scan; a pulse when the name docks */
.logo-mark {
  position: relative;
  overflow: hidden;
  animation: markBreathe 4.5s ease-in-out infinite;
}
.logo-mark::after {
  content: '';
  position: absolute;
  inset: -20% auto -20% 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.75), transparent);
  transform: translateX(-160%) skewX(-18deg);
  animation: markScan 7s ease-in-out infinite;
}
.logo-mark.is-docking { animation: markDock 0.55s cubic-bezier(0.2, 1.4, 0.4, 1), markBreathe 4.5s ease-in-out 0.55s infinite; }
@keyframes markBreathe {
  0%, 100% { box-shadow: 0 0 10px rgba(0, 240, 255, 0.35); }
  50% { box-shadow: 0 0 20px rgba(0, 240, 255, 0.7), 0 0 34px rgba(0, 240, 255, 0.2); }
}
@keyframes markScan {
  0%, 78% { transform: translateX(-160%) skewX(-18deg); }
  92%, 100% { transform: translateX(330%) skewX(-18deg); }
}
@keyframes markDock {
  0% { transform: scale(1); box-shadow: 0 0 10px rgba(0, 240, 255, 0.4); }
  35% { transform: scale(1.14); box-shadow: 0 0 30px rgba(0, 240, 255, 1), 0 0 60px rgba(0, 240, 255, 0.4); }
  100% { transform: scale(1); box-shadow: 0 0 12px rgba(0, 240, 255, 0.45); }
}
@media (prefers-reduced-motion: reduce) {
  .logo-mark, .logo-mark::after, .logo-mark.is-docking, .logo-text .gradient-word { animation: none; }
}
.hero-title-massive.hero-flying .hero-word { visibility: hidden; }
.hero-flight-word {
  position: fixed;
  z-index: 200;
  transform-origin: 0 0;
  pointer-events: none;
  white-space: nowrap;
  text-transform: uppercase;
  color: var(--text-primary);
  will-change: transform;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  /* A framed tab rail: reads as one clickable control group, like the HUD buttons */
  padding: 4px;
  background: rgba(8, 10, 16, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(0, 240, 255, 0.03);
}

.nav-link {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  color: rgba(226, 236, 248, 0.82);
  text-decoration: none;
  transition: all var(--transition-snappy);
  position: relative;
  letter-spacing: 0.08em;
  padding: 8px 14px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  z-index: 10;
  user-select: none;
}

.nav-num {
  font-size: 0.68rem;
  color: rgba(0, 240, 255, 0.55);
  letter-spacing: 0.04em;
  transition: color var(--transition-snappy);
}

/* Ensure child spans/glitch text NEVER intercept or detach clicks */
.nav-link *,
.mob-nav-item *,
.cyber-btn *,
.hud-pill-btn * {
  pointer-events: none !important;
}

.cyber-glitch-char {
  color: var(--cyan-primary);
  text-shadow: 0 0 8px var(--cyan-primary), 0 0 16px rgba(0, 240, 255, 0.6);
  font-family: var(--font-mono);
  pointer-events: none !important;
  user-select: none;
  display: inline;
  font-weight: 700;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: #ffffff;
  background: rgba(0, 240, 255, 0.07);
  border-color: rgba(0, 240, 255, 0.32);
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.55);
  outline: none;
}
.nav-link:hover .nav-num,
.nav-link:focus-visible .nav-num {
  color: var(--cyan-primary);
}

.nav-link.active {
  color: var(--cyan-primary);
  font-weight: 700;
  background: rgba(0, 240, 255, 0.1);
  border-color: rgba(0, 240, 255, 0.4);
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.4);
}
.nav-link.active .nav-num {
  color: var(--cyan-primary);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 10px;
  right: 10px;
  height: 2px;
  background: var(--cyan-primary);
  box-shadow: 0 0 8px var(--cyan-primary);
}

.header-right-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-action-btn {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 8px 16px;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  text-decoration: none;
  background: transparent;
  cursor: pointer;
  transition: all var(--transition-snappy);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.header-action-btn:hover {
  border-color: var(--cyan-primary);
  color: var(--cyan-primary);
  background: rgba(0, 240, 255, 0.06);
}

.header-contact-btn {
  border-color: var(--green-acid);
  color: var(--green-acid);
}

.header-contact-btn:hover {
  background: var(--green-acid);
  color: var(--bg-primary);
  box-shadow: 0 0 18px rgba(0, 255, 157, 0.4);
}

/* ==========================================================================
   6. SPA MULTI-PAGE CONTAINER ARCHITECTURE
   ========================================================================== */
.page-container {
  width: 100%;
  flex: 1;
  position: relative;
  overflow-x: hidden;
}

.page-view {
  display: none;
  width: 100%;
}

.page-view.active {
  display: block;
  animation: cyberPageEnterDefault 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes cyberPageEnterDefault {
  from { opacity: 0; transform: translateY(12px); filter: blur(2px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0px); }
}

/* 1. Coordinated Outgoing Page Exits (Synchronized with camera perspective glide) */
.page-view.is-exiting-forward,
.page-view.active.is-exiting-forward {
  display: block !important;
  animation: cyberPageExitForward 0.24s cubic-bezier(0.35, 0, 0.8, 0.15) both !important;
  pointer-events: none !important;
}

.page-view.is-exiting-backward,
.page-view.active.is-exiting-backward {
  display: block !important;
  animation: cyberPageExitBackward 0.24s cubic-bezier(0.35, 0, 0.8, 0.15) both !important;
  pointer-events: none !important;
}

@keyframes cyberPageExitForward {
  0% {
    opacity: 1;
    transform: translateX(0);
    filter: blur(0px);
  }
  100% {
    opacity: 0;
    transform: translateX(-32px);
    filter: blur(3px);
  }
}

@keyframes cyberPageExitBackward {
  0% {
    opacity: 1;
    transform: translateX(0);
    filter: blur(0px);
  }
  100% {
    opacity: 0;
    transform: translateX(32px);
    filter: blur(3px);
  }
}

/* 2. Coordinated Incoming Page Enters (Directional Slide + Holographic Materialization) */
.page-view.active.enter-forward {
  animation: cyberPageEnterForward 0.38s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.page-view.active.enter-backward {
  animation: cyberPageEnterBackward 0.38s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes cyberPageEnterForward {
  0% {
    opacity: 0;
    transform: translateX(34px);
    filter: blur(3.5px);
  }
  50% {
    opacity: 0.9;
    filter: blur(0.6px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
    filter: blur(0px);
  }
}

@keyframes cyberPageEnterBackward {
  0% {
    opacity: 0;
    transform: translateX(-34px);
    filter: blur(3.5px);
  }
  50% {
    opacity: 0.9;
    filter: blur(0.6px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
    filter: blur(0px);
  }
}

/* 3. Staggered Tier 1: Top Monospace HUD Tags (Expanded Tracking & Cyber Sweep) */
.page-view.active .section-tag,
.page-view.active .hero-meta-row {
  animation: cyberTagEnterForward 0.36s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.page-view.active.enter-backward .section-tag,
.page-view.active.enter-backward .hero-meta-row {
  animation: cyberTagEnterBackward 0.36s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes cyberTagEnterForward {
  0% {
    opacity: 0;
    transform: translateX(22px);
    letter-spacing: 0.18em;
    color: #ffffff;
    text-shadow: 0 0 12px var(--cyan-primary), 0 0 24px var(--cyan-primary);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
    letter-spacing: 0.1em;
    color: var(--cyan-primary);
    text-shadow: none;
  }
}

@keyframes cyberTagEnterBackward {
  0% {
    opacity: 0;
    transform: translateX(-22px);
    letter-spacing: 0.18em;
    color: #ffffff;
    text-shadow: 0 0 12px var(--cyan-primary), 0 0 24px var(--cyan-primary);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
    letter-spacing: 0.1em;
    color: var(--cyan-primary);
    text-shadow: none;
  }
}

/* 4. Staggered Tier 2: Cinematic Display Headings (RGB Chromatic Split Converging) */
.page-view.active .page-main-title,
.page-view.active .hero-title-container {
  animation: cyberTitleEnterForward 0.44s cubic-bezier(0.16, 1, 0.3, 1) 0.04s both;
  will-change: transform, opacity, filter;
}

.page-view.active.enter-backward .page-main-title,
.page-view.active.enter-backward .hero-title-container {
  animation: cyberTitleEnterBackward 0.44s cubic-bezier(0.16, 1, 0.3, 1) 0.04s both;
  will-change: transform, opacity, filter;
}

@keyframes cyberTitleEnterForward {
  0% {
    opacity: 0;
    transform: translateX(28px) translateY(14px) skewX(-2deg);
    filter: blur(2.5px);
    text-shadow: -3px 0 var(--pink-neon), 3px 0 var(--cyan-primary), 0 0 18px rgba(0, 240, 255, 0.4);
  }
  60% {
    opacity: 0.95;
    transform: translateX(4px) translateY(2px) skewX(0.5deg);
    filter: blur(0.4px);
    text-shadow: -1px 0 var(--pink-neon), 1px 0 var(--cyan-primary), 0 0 8px rgba(0, 240, 255, 0.2);
  }
  100% {
    opacity: 1;
    transform: translateX(0) translateY(0) skewX(0deg);
    filter: blur(0);
    text-shadow: 0 0 0px transparent;
  }
}

@keyframes cyberTitleEnterBackward {
  0% {
    opacity: 0;
    transform: translateX(-28px) translateY(14px) skewX(2deg);
    filter: blur(2.5px);
    text-shadow: 3px 0 var(--pink-neon), -3px 0 var(--cyan-primary), 0 0 18px rgba(0, 240, 255, 0.4);
  }
  60% {
    opacity: 0.95;
    transform: translateX(-4px) translateY(2px) skewX(-0.5deg);
    filter: blur(0.4px);
    text-shadow: 1px 0 var(--pink-neon), -1px 0 var(--cyan-primary), 0 0 8px rgba(0, 240, 255, 0.2);
  }
  100% {
    opacity: 1;
    transform: translateX(0) translateY(0) skewX(0deg);
    filter: blur(0);
    text-shadow: 0 0 0px transparent;
  }
}

/* 5. Staggered Tier 3: Subtitles & Descriptive Narratives (Fluid Glide) */
.page-view.active .page-desc-text,
.page-view.active .personality-banner {
  animation: cyberDescEnterForward 0.46s cubic-bezier(0.16, 1, 0.3, 1) 0.08s both;
}

.page-view.active.enter-backward .page-desc-text,
.page-view.active.enter-backward .personality-banner {
  animation: cyberDescEnterBackward 0.46s cubic-bezier(0.16, 1, 0.3, 1) 0.08s both;
}

@keyframes cyberDescEnterForward {
  0% {
    opacity: 0;
    transform: translateX(20px) translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateX(0) translateY(0);
  }
}

@keyframes cyberDescEnterBackward {
  0% {
    opacity: 0;
    transform: translateX(-20px) translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateX(0) translateY(0);
  }
}

/* 6. Staggered Tier 4: Interactive Modules & Cards Cascade */
.page-view.active .works-ctrl-bar,
.page-view.active #projects-list,
.page-view.active #projects-grid,
.page-view.active .about-grid-layout,
.page-view.active .contact-grid,
.page-view.active .home-featured-wrapper {
  animation: cyberCardsEnterForward 0.52s cubic-bezier(0.16, 1, 0.3, 1) 0.12s both;
}

.page-view.active.enter-backward .works-ctrl-bar,
.page-view.active.enter-backward #projects-list,
.page-view.active.enter-backward #projects-grid,
.page-view.active.enter-backward .about-grid-layout,
.page-view.active.enter-backward .contact-grid,
.page-view.active.enter-backward .home-featured-wrapper {
  animation: cyberCardsEnterBackward 0.52s cubic-bezier(0.16, 1, 0.3, 1) 0.12s both;
}

@keyframes cyberCardsEnterForward {
  0% {
    opacity: 0;
    transform: translateX(18px) translateY(14px);
  }
  100% {
    opacity: 1;
    transform: translateX(0) translateY(0);
  }
}

@keyframes cyberCardsEnterBackward {
  0% {
    opacity: 0;
    transform: translateX(-18px) translateY(14px);
  }
  100% {
    opacity: 1;
    transform: translateX(0) translateY(0);
  }
}

.page-inner-content {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 40px 32px 80px;
}

.page-header-block {
  margin-bottom: 36px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 24px;
}

.header-action-split {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.section-tag {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--cyan-primary);
  margin-bottom: 8px;
  letter-spacing: 0.1em;
}

.page-main-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5.5vw, 4.2rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: var(--text-primary);
  line-height: 1.05;
  margin-bottom: 12px;
}

.page-desc-text {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 820px;
  line-height: 1.7;
  text-shadow: 0 1px 2px #000, 0 0 14px rgba(0, 0, 0, 0.9);
}

/* ==========================================================================
   7. HERO & HIGH-TENSION PERSONALITY BANNER
   ========================================================================== */
.hero-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--cyan-primary);
  letter-spacing: 0.08em;
}

.hero-title-container {
  margin-bottom: 24px;
}

.hero-title-massive {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 6.8rem);
  font-weight: 900;
  line-height: 0.94;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.hero-title-massive .gradient-word {
  background: linear-gradient(90deg, #ffffff 0%, var(--cyan-primary) 50%, var(--green-acid) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.personality-banner {
  border-left: 3px solid var(--cyan-primary);
  background: rgba(10, 12, 18, 0.7);
  padding: 24px 28px;
  margin-bottom: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}

.hero-actions-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Hero with just the action buttons: no panel around them */
.personality-banner.personality-banner--actions {
  background: none;
  border-left: none;
  padding: 0;
}

.cyber-btn {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 12px 22px;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-snappy);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 2px;
  border: none;
}

.cyber-btn-primary {
  background: var(--cyan-primary);
  color: var(--bg-primary);
  border: 1px solid var(--cyan-primary);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
}
.cyber-btn-primary:hover {
  background: #27f4ff;
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.55);
  transform: translateY(-2px);
}

.cyber-btn-studio {
  background: rgba(0, 255, 157, 0.1);
  color: var(--green-acid);
  border: 1px solid var(--green-acid);
}
.cyber-btn-studio:hover {
  background: var(--green-acid);
  color: var(--bg-primary);
  box-shadow: 0 0 20px rgba(0, 255, 157, 0.4);
}

.cyber-btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}
.cyber-btn-ghost:hover {
  border-color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   ABOUT ME // ARCHITECTURAL BLUEPRINT & PILLARS
   ========================================================================== */
.about-grid-layout {
  display: grid;
  grid-template-columns: 1.8fr 1fr;
  gap: 32px;
  align-items: flex-start;
}

.blueprint-diagram-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg-surface-elevated);
  padding: 24px;
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--cyan-primary);
  margin-top: 10px;
}

.blueprint-node-item {
  background: #090d16;
  border: 1px solid var(--border-subtle);
  padding: 14px 18px;
  transition: all var(--transition-snappy);
}
.blueprint-node-item:hover {
  border-color: var(--cyan-primary);
  transform: translateX(4px);
}

.node-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--cyan-primary);
  font-weight: 700;
  margin-bottom: 4px;
}
.node-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.node-desc {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.blueprint-arrow {
  text-align: center;
  font-family: var(--font-mono);
  color: var(--cyan-primary);
  font-size: 1.1rem;
  line-height: 0.8;
}

.pillars-grid-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 14px;
}

.pillar-box {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  padding: 18px;
  transition: all var(--transition-snappy);
}
.pillar-box:hover {
  border-color: var(--green-acid);
  transform: translateY(-2px);
}

.pillar-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--green-acid);
  margin-bottom: 6px;
}
.pillar-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.pillar-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.about-profile-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 28px;
  position: sticky;
  top: 60px;
}
.profile-avatar-box {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}
.avatar-glitch-badge {
  width: 52px;
  height: 52px;
  background: var(--cyan-primary);
  color: var(--bg-primary);
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}
.profile-name-info h4 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
}
.profile-name-info span {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--cyan-primary);
}
.profile-name-info .profile-alt-names {
  margin-top: 4px;
  color: var(--text-muted);
}
.profile-specs-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}
.spec-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
  padding-bottom: 6px;
}
.spec-lbl { color: var(--text-muted); }
.spec-val { color: var(--text-primary); font-weight: 600; }

/* ==========================================================================
   9. WORKS GALLERY (Emotion Agency Style)
   ========================================================================== */
.works-ctrl-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.filter-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-pill {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 8px 16px;
  cursor: pointer;
  transition: all var(--transition-snappy);
  border-radius: 2px;
}

.filter-pill:hover, .filter-pill.active {
  border-color: var(--cyan-primary);
  color: var(--cyan-primary);
  background: rgba(0, 240, 255, 0.08);
}

.view-toggle-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  cursor: pointer;
}
.view-toggle-btn.active {
  color: var(--cyan-primary);
  border-color: var(--cyan-primary);
}

/* List View */
#projects-list {
  display: block;
}

.project-row {
  width: 100%;
  display: grid;
  grid-template-columns: 60px 1.8fr 140px 1.4fr 80px 50px;
  align-items: center;
  padding: 22px 16px;
  background: rgba(5, 7, 12, 0.62);
  border-bottom: 1px solid var(--border-subtle);
  transition: all var(--transition-snappy);
  cursor: pointer;
  outline: none;
}

.project-row:hover {
  background: rgba(0, 240, 255, 0.03);
  border-bottom-color: var(--border-highlight);
  transform: translateX(8px);
}

.proj-col-index {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
}
.project-row:hover .proj-col-index {
  color: var(--cyan-primary);
}

.proj-col-title {
  display: flex;
  flex-direction: column;
}

.proj-title-text {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  transition: color var(--transition-snappy);
}
.project-row:hover .proj-title-text {
  color: var(--cyan-primary);
}

.proj-subtitle-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  border: 1px solid;
  border-radius: 2px;
  letter-spacing: 0.05em;
}

.proj-col-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tech-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  background: var(--bg-surface-elevated);
  padding: 3px 8px;
  color: var(--text-secondary);
  border-radius: 2px;
}

.proj-col-year {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.proj-col-action {
  font-size: 1.4rem;
  color: var(--text-muted);
  transition: all var(--transition-snappy);
}
.project-row:hover .action-arrow {
  color: var(--cyan-primary);
  transform: translate(4px, -4px);
  display: inline-block;
}

/* Grid View */
#projects-grid {
  display: none;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.project-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all var(--transition-smooth);
}
.project-card:hover {
  border-color: var(--proj-accent);
  transform: translateY(-4px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.6);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  margin-bottom: 20px;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.card-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.6;
}

.card-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 16px;
}

.metric-val {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  display: block;
}

.metric-lbl {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.card-btn {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--cyan-primary);
}

/* Home Featured Cards */
.home-featured-wrapper {
  margin-top: 40px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 36px;
}

.home-sec-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
}

.home-sec-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.home-sec-link {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--cyan-primary);
  text-decoration: none;
}
.home-sec-link:hover {
  text-decoration: underline;
}

.featured-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.home-featured-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 28px;
  cursor: pointer;
  transition: all var(--transition-snappy);
}
.home-featured-card:hover {
  border-color: var(--proj-accent);
  transform: translateY(-3px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.6);
}

.feat-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  margin-bottom: 14px;
}

.feat-card-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.feat-card-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 18px;
  line-height: 1.6;
}

.feat-card-tags {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.feat-inspect-link {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--cyan-primary);
}

/* ==========================================================================
   10. COMMS (PROMINENT GITHUB & EMAIL BADGES)
   ========================================================================== */
.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 36px;
  align-items: flex-start;
}

.contact-card-direct {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 36px;
}

.contact-title {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 12px;
  line-height: 1.1;
}

.comms-badges-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.big-comm-card {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  padding: 20px 24px;
  text-decoration: none;
  transition: all var(--transition-snappy);
  border-radius: 2px;
}
.big-comm-card:hover {
  border-color: var(--cyan-primary);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.comm-icon {
  font-size: 1.8rem;
  color: var(--cyan-primary);
}

.comm-info {
  display: flex;
  flex-direction: column;
}

.comm-lbl {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.comm-val {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ==========================================================================
   12. CLI TERMINAL
   ========================================================================== */
.terminal-window {
  background: #06080d;
  border: 1px solid var(--border-highlight);
  box-shadow: 0 0 35px rgba(0, 240, 255, 0.1);
  overflow: hidden;
}

.terminal-header {
  background: #0d1017;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.terminal-dots {
  display: flex;
  gap: 6px;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }

.terminal-body {
  padding: 18px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  height: 280px;
  overflow-y: auto;
  overflow-x: hidden;
  line-height: 1.6;
  color: #cfd8dc;
  word-break: break-word;
}

.term-line {
  margin-bottom: 8px;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-wrap; /* keep one command / field per line */
}
.term-intro { color: var(--cyan-primary); }
.term-input { color: var(--text-primary); }
.term-prompt { color: var(--cyan-primary); font-weight: 600; }
.cmd-hl { color: var(--green-acid); font-weight: 600; }
.term-success { color: var(--green-acid); }
.term-error { color: var(--pink-neon); }
.term-link { color: var(--cyan-primary); text-decoration: underline; }

.terminal-input-row {
  display: flex;
  align-items: center;
  padding: 12px 18px;
  background: #080a10;
  border-top: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

/* Suggestion bar under the terminal input (Tab completion, tappable on phones) */
.term-suggest {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 18px 8px;
  background: #080a10;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}
.term-chip {
  padding: 2px 8px;
  border: 1px solid rgba(0, 240, 255, 0.25);
  background: rgba(0, 240, 255, 0.05);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
}
.term-chip:hover { color: var(--cyan-primary); border-color: rgba(0, 240, 255, 0.5); }
.term-chip.is-current {
  color: #05070a;
  background: var(--cyan-primary);
  border-color: var(--cyan-primary);
}
.term-suggest-hint { color: var(--text-muted); }
.term-suggest-hint b { color: var(--cyan-primary); font-weight: 600; }

.terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  margin-left: 10px;
}

/* ==========================================================================
   13. PROJECT DETAIL MODAL / DRAWER
   ========================================================================== */
.cyber-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-smooth);
}

.cyber-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 6, 8, 0.88);
  backdrop-filter: blur(14px);
}

.modal-panel {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 840px;
  background: var(--bg-surface);
  border: 1px solid var(--cyan-primary);
  box-shadow: 0 0 50px rgba(0, 240, 255, 0.25);
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.97);
  transition: transform var(--transition-smooth);
}

.cyber-modal.active .modal-panel {
  transform: translateY(0) scale(1);
}

.modal-header-bar {
  background: #0e111a;
  border-bottom: 1px solid var(--border-subtle);
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-close-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 6px 14px;
  cursor: pointer;
  transition: all var(--transition-snappy);
}
.modal-close-btn:hover {
  color: var(--pink-neon);
  border-color: var(--pink-neon);
}

.modal-content-body {
  padding: 32px;
}

.modal-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 24px 0;
  background: var(--bg-surface-elevated);
  padding: 20px;
  border: 1px solid var(--border-subtle);
}

.modal-metric-box .val {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
}

.modal-metric-box .lbl {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.modal-actions {
  display: flex;
  gap: 14px;
  margin-top: 28px;
  flex-wrap: wrap;
}

/* ==========================================================================
   14. FOOTER & MOBILE BOTTOM HUD NAVIGATION
   ========================================================================== */
.main-footer {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 32px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(6, 8, 12, 0.97);
  border-top: 1px solid var(--border-subtle);
  z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom, 8px);
  box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.7);
}

.mob-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 0 6px;
  text-decoration: none;
  color: var(--text-muted);
  transition: all var(--transition-snappy);
  position: relative;
}

.mob-nav-icon {
  font-size: 1.25rem;
  line-height: 1;
  margin-bottom: 3px;
}

.mob-nav-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.mob-nav-item.active {
  color: var(--cyan-primary);
}

.mob-nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 25%;
  right: 25%;
  height: 2px;
  background: var(--cyan-primary);
  box-shadow: 0 0 10px var(--cyan-primary);
}

/* ==========================================================================
   15. RESPONSIVE BREAKPOINTS (Mobile & Tablet)
   ========================================================================== */
@media (max-width: 1024px) {
  .ai-principles-grid {
    grid-template-columns: 1fr;
  }
  .featured-cards-grid {
    grid-template-columns: 1fr;
  }
  .contact-grid {
    grid-template-columns: 1fr;
  }
  .about-grid-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .nav-links {
    gap: 2px;
  }
}

@media (max-width: 900px) {
  .nav-links {
    display: none;
  }
  .mobile-bottom-nav {
    display: flex;
  }
  .hud-desktop-only {
    display: none !important;
  }
  .page-inner-content {
    padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 20px) + 30px);
  }
  .about-grid-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .pillars-grid-inner {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

@media (max-width: 768px) {
  /* Containers & Global Mobile Constraints */
  .page-container, .page-view, .page-wrapper {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }
  .page-inner-content {
    padding: 20px 16px calc(var(--mobile-nav-height) + 36px);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Top HUD Bar */
  .hud-telemetry-bar {
    padding: 6px 12px;
    font-size: 0.72rem;
    width: 100%;
    box-sizing: border-box;
  }
  .telemetry-left {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    gap: 8px;
  }
  .status-indicator {
    white-space: nowrap;
    flex-shrink: 0;
  }
  #hud-sector {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
    display: inline-block;
    vertical-align: bottom;
  }
  /* Weather button: icon + mode only on small screens */
  .wx-btn-word { display: none; }
  #btn-weather {
    padding: 3px 8px;
    font-size: 0.68rem;
    white-space: nowrap;
  }
  .telemetry-right {
    flex-shrink: 0;
  }
  #btn-overclock-toggle {
    padding: 3px 8px;
    font-size: 0.68rem;
    white-space: nowrap;
  }

  /* Main Header */
  .main-header {
    padding: 12px 16px;
    width: 100%;
    box-sizing: border-box;
  }
  .logo-text {
    font-size: 1.15rem;
  }
  .header-right-actions {
    gap: 8px;
  }
  .header-action-btn {
    padding: 6px 10px;
    font-size: 0.72rem;
  }

  /* Hero Section */
  .hero-meta-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.75rem;
    word-break: break-word;
  }
  .hero-title-massive {
    font-size: clamp(2.3rem, 9.5vw, 4rem);
    line-height: 1.0;
  }

  /* Personality Banner */
  .personality-banner {
    padding: 20px 16px;
    gap: 18px;
    width: 100%;
    box-sizing: border-box;
  }
  .hero-actions-group {
    width: 100%;
    flex-direction: column;
    gap: 10px;
  }
  .hero-actions-group .cyber-btn {
    width: 100%;
    justify-content: center;
  }

  /* Home Section Header */
  .home-sec-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .home-sec-title {
    font-size: 1.5rem;
  }
  .featured-cards-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .home-featured-card {
    padding: 20px 16px;
  }

  /* Works Section */
  .header-action-split {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .header-action-split .cyber-btn {
    width: 100%;
    justify-content: center;
  }
  .page-main-title {
    font-size: clamp(2.1rem, 7.5vw, 3.2rem);
  }
  .page-desc-text {
    font-size: 0.95rem;
    line-height: 1.6;
  }
  .works-ctrl-bar {
    margin-bottom: 20px;
  }
  .filter-pills-row {
    gap: 6px;
    width: 100%;
  }
  .filter-pill {
    padding: 6px 12px;
    font-size: 0.72rem;
  }
  .project-row {
    grid-template-columns: 28px minmax(0, 1fr) 28px;
    gap: 10px;
    padding: 16px 6px;
    width: 100%;
    box-sizing: border-box;
  }
  .proj-col-category, .proj-col-tags, .proj-col-year {
    display: none;
  }
  .proj-col-title {
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
  }
  .proj-title-text {
    font-size: 1.1rem;
    line-height: 1.25;
  }
  .proj-subtitle-text {
    font-size: 0.8rem;
    margin-top: 2px;
  }
  #projects-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .project-card {
    padding: 20px 16px;
  }
  .card-metrics {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  /* About Section */
  .about-grid-layout {
    grid-template-columns: 1fr;
    gap: 20px;
    width: 100%;
  }
  .pillars-grid-inner {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .blueprint-diagram-box {
    padding: 16px 12px;
  }
  .blueprint-node-item {
    padding: 12px 14px;
  }
  .node-title {
    font-size: 0.95rem;
  }
  .node-desc {
    font-size: 0.72rem;
    word-break: break-word;
  }
  .pillar-box {
    padding: 14px;
  }
  .pillar-name {
    font-size: 0.88rem;
  }
  .pillar-text {
    font-size: 0.8rem;
  }
  .about-profile-card {
    padding: 24px 16px;
  }

  /* Contact Section */
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 24px;
    width: 100%;
  }
  .contact-card-direct {
    padding: 20px 16px;
    width: 100%;
    box-sizing: border-box;
  }
  .contact-title {
    font-size: 1.6rem;
  }
  .big-comm-card {
    padding: 16px 14px;
    width: 100%;
    box-sizing: border-box;
    gap: 12px;
  }
  .comm-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
  }
  .comm-info {
    min-width: 0;
    flex: 1;
    overflow: hidden;
  }
  .comm-lbl {
    font-size: 0.65rem;
  }
  .comm-val {
    font-size: clamp(0.78rem, 3.4vw, 0.95rem);
    word-break: break-all;
    overflow-wrap: anywhere;
  }
  .social-links-row {
    flex-wrap: wrap;
    gap: 10px;
  }

  /* CLI Terminal Window */
  .terminal-window {
    width: 100%;
    box-sizing: border-box;
  }
  .terminal-header {
    padding: 8px 12px;
  }
  .terminal-title {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.7rem;
  }
  .terminal-body {
    padding: 12px 14px;
    font-size: 0.76rem;
    height: 240px;
    word-break: break-word;
    overflow-x: hidden;
  }
  .term-line {
    word-break: break-all;
    overflow-wrap: anywhere;
  }
  .terminal-input-row {
    padding: 10px 14px;
  }
  .terminal-input {
    font-size: 0.78rem;
    min-width: 0;
  }

  /* Modals and Forms */
  .cyber-modal {
    padding: 10px;
  }
  .modal-panel {
    max-height: 92vh;
    width: 100%;
  }
  .modal-content-body {
    padding: 18px 14px;
  }
  .modal-metrics-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .modal-actions {
    flex-direction: column;
    gap: 10px;
  }
  .modal-actions .cyber-btn {
    width: 100%;
    justify-content: center;
  }

  /* Footer */
  .main-footer {
    padding: 20px 16px;
    flex-direction: column;
    gap: 14px;
    text-align: center;
    margin-bottom: var(--mobile-nav-height);
  }

  #floating-preview {
    display: none !important;
  }
}

@media (max-width: 480px) {
  #hud-sector {
    max-width: 85px;
  }
  .header-contact-btn {
    display: none;
  }
  .header-action-btn {
    padding: 5px 8px;
    font-size: 0.7rem;
  }
  .contact-title {
    font-size: 1.35rem;
  }
  .page-main-title {
    font-size: 1.85rem;
  }
}

/* ==========================================================================
   16. HOLOGRAPHIC 3D TILT GLARE & EQUALIZER SPECTRUM
   ========================================================================== */
.card-hologram-glare {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease-out;
  z-index: 5;
  border-radius: inherit;
}

/* Audio Spectrum Visualizer Bars in HUD */
.hud-eq-visualizer {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 10px;
  margin-right: 4px;
}
.eq-bar {
  width: 2px;
  height: 4px;
  background: var(--green-acid);
  border-radius: 1px;
  transition: height 0.15s;
}
.eq-bar.dancing {
  animation: eqBounce 0.35s ease-in-out infinite alternate;
}
@keyframes eqBounce {
  0% { height: 2px; }
  100% { height: 10px; }
}

/* Theme Switch Flash & Overclock Mode */
.theme-switch-glitch {
  animation: screenGlitchFlash 0.22s ease-out;
}
@keyframes screenGlitchFlash {
  0% { filter: invert(0.2) hue-rotate(90deg); }
  50% { filter: invert(0) contrast(1.3); }
  100% { filter: none; }
}

.overclock-active #cyber-canvas {
  filter: drop-shadow(0 0 14px var(--cyan-primary)) contrast(1.15);
}

/* ==========================================================================
   INTERACTIVE NEURAL SYNAPSE GRAPH WIDGET
   ========================================================================== */
.synapse-canvas-wrapper {
  width: 100%;
  border: 1px solid var(--border-subtle);
  background: rgba(4, 6, 12, 0.88);
  position: relative;
  overflow: hidden;
  border-radius: 2px;
}

#synapse-canvas {
  width: 100%;
  height: 320px;
  display: block;
}

.synapse-legend {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 8px 12px;
  background: rgba(2, 4, 8, 0.85);
  border-top: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  flex-wrap: wrap;
}

/* ==========================================================================
   FLOATING CYBER TOAST NOTIFICATIONS
   ========================================================================== */
.cyber-toast {
  position: fixed;
  top: 48px;
  left: 50%;
  transform: translateX(-50%) translateY(-24px);
  background: rgba(6, 10, 18, 0.94);
  border: 1px solid var(--green-acid);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8), 0 0 16px rgba(0, 255, 157, 0.3);
  padding: 8px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--green-acid);
  font-weight: 700;
  letter-spacing: 0.06em;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 2px;
}

.cyber-toast.active {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-beacon {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green-acid);
  box-shadow: 0 0 8px var(--green-acid);
}

/* Audio Toggle Active State */
#btn-audio-toggle.active {
  border-color: var(--green-acid);
  background: rgba(0, 255, 157, 0.12);
  box-shadow: 0 0 12px rgba(0, 255, 157, 0.35);
}

@media (max-width: 768px) {
  /* Never split a word mid-glyph in the giant hero title; shrink instead */
  .hero-title-massive {
    font-size: clamp(1.6rem, 8.6vw, 3.4rem);
    word-break: normal;
    overflow-wrap: normal;
    hyphens: none;
  }

  /* The sector label doesn't fit next to the controls; keep the status beacon only */
  .hud-telemetry-bar .telemetry-left .hud-item {
    display: none;
  }
}


@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   KEYBOARD FOCUS VISIBILITY (accessibility)
   ========================================================================== */
:focus-visible {
  outline: 2px solid var(--cyan-primary);
  outline-offset: 3px;
}

.project-row:focus-visible,
.home-featured-card:focus-visible,
.project-card:focus-visible {
  outline: 2px solid var(--cyan-primary);
  outline-offset: -2px;
}

/* ==========================================================================
   CINEMATIC FX LAYER (js/fx.js)
   ========================================================================== */

/* --- Sliding nav indicator ------------------------------------------------- */
.nav-links.has-indicator {
  position: relative;
}
.nav-links.has-indicator .nav-link.active::after {
  display: none;
}
.nav-indicator {
  position: absolute;
  left: 0;
  bottom: 4px;
  height: 2px;
  width: 0;
  list-style: none;
  pointer-events: none;
  background: linear-gradient(90deg, var(--green-acid), var(--cyan-primary));
  box-shadow: 0 0 10px var(--cyan-primary), 0 0 22px rgba(0, 240, 255, 0.45);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Buttons: magnetic pull + neon sheen sweep ---------------------------- */
.cyber-btn,
.header-action-btn {
  transition: all var(--transition-snappy), translate 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.cyber-btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.cyber-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.45) 50%, transparent 70%);
  translate: -120% 0;
  transition: translate 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}
.cyber-btn-ghost::before {
  background: linear-gradient(110deg, transparent 30%, rgba(0, 240, 255, 0.22) 50%, transparent 70%);
}
.cyber-btn:hover::before {
  translate: 120% 0;
}

/* --- Cards: cursor-tracking neon border ----------------------------------- */
/* (sticky cards already create a containing block — don't override them) */
.fx-glow:not(.about-profile-card) {
  position: relative;
}
.fx-glow::before {
  content: '';
  position: absolute;
  inset: -1px;
  padding: 1px;
  border-radius: inherit;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 0%),
    var(--proj-accent, var(--cyan-primary)), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: 3;
}
.fx-glow:hover::before {
  opacity: 1;
}

/* --- Scroll reveal (uses `translate`, so it never fights tilt `transform`) -- */
.fx-reveal {
  opacity: 0;
  translate: 0 22px;
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1) var(--fx-delay, 0ms),
              translate 0.7s cubic-bezier(0.16, 1, 0.3, 1) var(--fx-delay, 0ms);
}
.fx-reveal.fx-in {
  opacity: 1;
  translate: 0 0;
}

/* --- Scroll progress line -------------------------------------------------- */
.fx-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 200;
  pointer-events: none;
  transform: scaleX(0);
  transform-origin: left;
  background: linear-gradient(90deg, var(--pink-neon), var(--cyan-primary), var(--green-acid));
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.7);
}

/* --- Hero title: flowing gradient + chromatic glitch on hover (no movement) */
.hero-title-massive .gradient-word {
  background: linear-gradient(90deg, #ffffff 0%, var(--cyan-primary) 25%, var(--green-acid) 50%, var(--cyan-primary) 75%, #ffffff 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: fxGradientFlow 6s linear infinite;
}
@keyframes fxGradientFlow {
  from { background-position: 0% 50%; }
  to { background-position: -200% 50%; }
}
.hero-title-massive:hover {
  animation: fxChromaFlash 0.45s steps(1, end);
}
.page-main-title:hover,
.logo-block:hover .logo-text {
  animation: fxChromaFlash 0.45s steps(1, end);
}
@keyframes fxChromaFlash {
  0%   { filter: drop-shadow(-4px 0 var(--pink-neon)) drop-shadow(4px 0 var(--cyan-primary)); }
  25%  { filter: drop-shadow(3px 0 var(--pink-neon)) drop-shadow(-3px 0 var(--green-acid)); }
  50%  { filter: drop-shadow(-2px 0 var(--pink-neon)) drop-shadow(2px 0 var(--cyan-primary)); }
  75%, 100% { filter: none; }
}

/* --- Logo mark: hover glitch, and the spring-in when it appears beside the name ---- */
.logo-mark {
  transition: filter 0.3s ease, opacity 0.35s ease, transform 0.5s cubic-bezier(0.2, 1.5, 0.4, 1);
}
.logo-block:hover .logo-mark {
  box-shadow: 0 0 24px rgba(0, 240, 255, 0.9), 0 0 48px rgba(0, 240, 255, 0.35);
  filter: drop-shadow(-2px 0 var(--pink-neon)) drop-shadow(2px 0 var(--green-acid));
}

/* --- Film grain (static image: zero per-frame cost) ------------------------ */
.vignette::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.06;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* --- Text selection in brand colors ---------------------------------------- */
::selection {
  background: rgba(0, 240, 255, 0.35);
  color: #ffffff;
}

@media (prefers-reduced-motion: reduce) {
  .hero-title-massive .gradient-word { animation: none; }
}

/* ==========================================================================
   MISSING COMPONENT STYLES
   These classes were used in the markup but never defined, so About-page
   content floated directly on the city with no panel behind it.
   ========================================================================== */
.about-main-col,
.about-sidebar-col {
  min-width: 0; /* let grid children shrink instead of overflowing */
}

.cyber-content-card {
  background: rgba(10, 12, 18, 0.92);
  border: 1px solid var(--border-subtle);
  padding: 28px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.card-inner-title {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--cyan-primary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.about-story-paragraphs {
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 1.02rem;
  line-height: 1.85;
  color: var(--text-secondary);
}
.about-story-paragraphs strong {
  color: var(--text-primary);
  font-weight: 600;
  background: linear-gradient(transparent 62%, rgba(0, 240, 255, 0.18) 62%);
}

.badge-cyan {
  color: var(--cyan-primary);
  border-color: rgba(0, 240, 255, 0.45);
  background: rgba(0, 240, 255, 0.06);
}
.badge-green {
  color: var(--green-acid);
  border-color: rgba(0, 255, 157, 0.45);
  background: rgba(0, 255, 157, 0.06);
}

.card-index,
.feat-card-index {
  color: var(--text-muted);
  letter-spacing: 0.1em;
}
.card-category {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}
.card-body {
  flex: 1;
}
.metric-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.feat-card-footer {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}
.home-featured-card:hover .feat-inspect-link {
  color: var(--proj-accent, var(--cyan-primary));
  letter-spacing: 0.08em;
}

.tag-pill {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 2px 8px;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.terminal-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--green-acid);
  letter-spacing: 0.1em;
}

.works-view-toggle {
  display: flex;
  gap: 6px;
}

/* ==========================================================================
   HEADER: never wrap labels; progressively drop extras on mid-size screens
   ========================================================================== */
.logo-text,
.nav-link,
.header-action-btn {
  white-space: nowrap;
}

@media (max-width: 1240px) {
  .header-right-actions .header-contact-btn {
    display: none; /* email copy is still in the footer and on the Contact page */
  }
  .nav-links {
    gap: 2px;
  }
}

@media (max-width: 1040px) and (min-width: 901px) {
  .main-header {
    padding: 16px 24px;
  }
  .nav-link {
    font-size: 0.76rem;
    padding: 8px 9px;
    gap: 6px;
  }
}

@media (max-width: 480px) {
  .big-comm-card .comm-val {
    font-size: 0.76rem;
    overflow-wrap: anywhere;
  }
  .terminal-body {
    font-size: 0.74rem;
  }
}

/* ==========================================================================
   TEXT SCRAMBLE: layout-stable rendering (js/scramble.js)
   ========================================================================== */
[data-scramble] {
  position: relative;
}
.scramble-ghost {
  visibility: hidden; /* real text keeps the box at its final size */
}
.scramble-layer {
  position: absolute;
  inset: 0;
  white-space: inherit;
  pointer-events: none;
}

/* Floating project preview: real project info (replaces the decorative attention heatmap) */
.preview-info {
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.preview-subtitle {
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--text-primary);
}
.preview-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}
.preview-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.preview-metric-val {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.preview-metric-lbl {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

/* Your other names under the big hero name */
.hero-alt-names {
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: clamp(0.85rem, 1.4vw, 1rem);
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  text-shadow: 0 1px 2px #000, 0 0 12px rgba(0, 0, 0, 0.9);
}

/* ==========================================================================
   PANELS: one surface for every card that sits on the city
   ========================================================================== */
:root {
  --panel-bg: rgba(8, 11, 17, 0.86);
  --panel-border: rgba(255, 255, 255, 0.09);
  --panel-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 18px 40px rgba(0, 0, 0, 0.42);
  --panel-pad: 28px;
}
.cyber-content-card,
.about-profile-card,
.contact-card-direct,
.home-featured-card,
.project-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  box-shadow: var(--panel-shadow);
  padding: var(--panel-pad);
}
.big-comm-card {
  background: rgba(255, 255, 255, 0.035);
  border-color: var(--panel-border);
  border-radius: 0;
}
.terminal-window { box-shadow: var(--panel-shadow), 0 0 28px rgba(0, 240, 255, 0.08); }
.project-row { background: rgba(8, 11, 17, 0.72); }
.card-inner-title { letter-spacing: 0.1em; }
.about-story-paragraphs, .page-desc-text, .card-desc, .feat-card-desc { line-height: 1.75; }
@media (max-width: 768px) {
  :root { --panel-pad: 20px; }
}

/* Before the city has drawn its first frame, the page is already the sky of this hour (first-sky.js) */
html, body { background: var(--first-sky, none) var(--bg-primary) fixed; }

/* Something in the city answers a click here */
html.city-hot, html.city-hot body { cursor: pointer; }

/* --- Sky panel: time slider + weather ------------------------------------- */
.sky-panel {
  position: fixed;
  top: 52px;
  right: 16px;
  z-index: 1200;
  width: min(330px, calc(100vw - 24px));
  padding: 14px 16px 16px;
  background: rgba(8, 10, 16, 0.96);
  border: 1px solid rgba(0, 240, 255, 0.35);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 14px rgba(0, 240, 255, 0.12);
  font-family: var(--font-mono);
}
body.scenery-mode .sky-panel { top: auto; right: 50%; translate: 50% 0; bottom: 84px; }
.sky-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sky-label { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.1em; color: var(--text-muted); }
.sky-label-gap { margin: 16px 0 8px; }
.sky-live {
  padding: 3px 8px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
}
.sky-live:hover, .sky-live:focus-visible { border-color: var(--cyan-primary); color: var(--cyan-primary); outline: none; }
.sky-live.is-live { color: var(--green-acid); border-color: rgba(0, 255, 157, 0.4); }
.sky-time-val {
  display: block;
  margin: 8px 0 6px;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-primary);
}
.sky-slider {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 22px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  touch-action: none;
}
.sky-slider::-webkit-slider-runnable-track { height: 6px; background: var(--sky-track); }
.sky-slider::-moz-range-track { height: 6px; background: var(--sky-track); }
.sky-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 18px;
  margin-top: -6px;
  background: #f8fafc;
  border: 2px solid #050608;
  outline: 1px solid rgba(0, 240, 255, 0.7);
}
.sky-slider::-moz-range-thumb {
  width: 12px;
  height: 16px;
  background: #f8fafc;
  border: 2px solid #050608;
  border-radius: 0;
  outline: 1px solid rgba(0, 240, 255, 0.7);
}
.sky-slider:focus-visible { outline: 1px solid var(--cyan-primary); outline-offset: 2px; }
.sky-panel {
  /* The day itself, as the slider's track: follows the timeline in js/daylight.js */
  --sky-track: linear-gradient(90deg,
    #0b1230 0%, #0b1230 20%, #d98f78 25%, #d98f78 27.5%, #6fb2e4 32%, #6fb2e4 68%,
    #ef8a45 72.5%, #ef8a45 76.5%, #0b1230 80.5%, #0b1230 100%);
}
.sky-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 0.6rem;
  color: var(--text-muted);
}
.sky-weather { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.sky-weather button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 4px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
}
.sky-weather .wx-icon { color: var(--cyan-primary); font-size: 0.9rem; }
.sky-weather button:hover,
.sky-weather button:focus-visible {
  color: var(--cyan-primary);
  border-color: rgba(0, 240, 255, 0.35);
  background: rgba(0, 240, 255, 0.06);
  outline: none;
}
.sky-weather button[aria-checked="true"] {
  color: var(--cyan-primary);
  background: rgba(0, 240, 255, 0.1);
  border-color: rgba(0, 240, 255, 0.55);
}
@media (max-width: 600px) {
  .sky-panel { top: 46px; right: 12px; }
}

/* --- The district's name, passing through the frame during the flight ----- */
.fx-sector {
  position: fixed;
  left: 0;
  right: 0;
  top: 40%;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  text-align: center;
  color: #fff;
  pointer-events: none;
  opacity: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75), 0 0 22px rgba(0, 0, 0, 0.6);
}
.fx-sector span {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.32em;
  color: var(--cyan-primary);
}
.fx-sector strong {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: 0.04em;
}
.fx-sector.run { animation: fxSectorPass 1.05s cubic-bezier(0.3, 0, 0.3, 1) 0.1s both; }
@keyframes fxSectorPass {
  0% { opacity: 0; translate: 0 10px; letter-spacing: 0.1em; }
  28% { opacity: 1; }
  68% { opacity: 1; }
  100% { opacity: 0; translate: 0 -10px; letter-spacing: 0.02em; }
}
@media (prefers-reduced-motion: reduce) {
  .fx-sector { display: none; }
}

/* By day the sky behind the page is bright: a soft shade under the text column keeps it readable.
   --day is 0 at night, so none of this exists after dark. */
.page-wrapper::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(90deg,
    rgba(6, 10, 18, calc(var(--day, 0) * 0.62)),
    rgba(6, 10, 18, calc(var(--day, 0) * 0.3)) 55%,
    rgba(6, 10, 18, calc(var(--day, 0) * 0.1)));
}
.page-desc-text, .hero-alt-names, .section-tag, .home-sec-link {
  text-shadow: 0 1px 3px rgba(0, 0, 0, calc(var(--day, 0) * 0.9));
}
.page-desc-text, .hero-alt-names { color: color-mix(in srgb, var(--text-secondary), #fff calc(var(--day, 0) * 55%)); }

/* What the sky is doing outside, right now */
.sky-facts { margin: 12px 0 0; display: grid; gap: 5px; }
.sky-facts > div { display: grid; grid-template-columns: 16px 1fr; gap: 6px; align-items: baseline; }
.sky-facts dt { color: var(--cyan-primary); font-size: 0.74rem; text-align: center; }
.sky-facts dd { margin: 0; color: var(--text-secondary); font-size: 0.7rem; line-height: 1.5; }
.sky-credit { margin-top: 10px; font-size: 0.6rem; color: var(--text-muted); }
.sky-credit a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* HUD: one line at every width. Words step aside in order of importance, nothing wraps. */
.hud-telemetry-bar { flex-wrap: nowrap; }
.hud-telemetry-bar .hud-item, .status-indicator, .hud-pill-btn { white-space: nowrap; }
.telemetry-left { min-width: 0; flex: 1 1 auto; overflow: hidden; }
.telemetry-right { flex: 0 0 auto; margin-left: 14px; }
.telemetry-left .hud-item { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1320px) {
  .status-indicator .hud-word, .status-indicator + .hud-item { display: none; }
}
@media (max-width: 1100px) {
  .telemetry-right .wx-btn-word, .telemetry-right .hud-word { display: none; }
  .telemetry-right { gap: 8px; }
}
@media (max-width: 860px) {
  .hud-clock, .hud-clock ~ .hud-item, .telemetry-left .hud-item:has(+ .hud-clock) { display: none; }
}

/* A keyboard user always sees where they are */
:where(a, button, input, [role="button"], [tabindex]):focus-visible {
  outline: 2px solid var(--cyan-primary);
  outline-offset: 2px;
}
::selection { background: rgba(0, 240, 255, 0.32); color: #fff; }
.sky-credit { color: var(--text-secondary); opacity: 0.75; }
