/* Fonts are loaded from index.html via <link rel="preconnect"> + <link rel="stylesheet">
   (an @import here serialized the request chain and delayed first paint). */

:root {
  --bg-floor: #131313;
  --bg-panel: #1A1A1A;
  --bg-card: #222222;
  --bg-elevated: #2A2A2A;
  --border: #333333;
  --border-light: #444444;
  --orange: #E8762B;
  --orange-dim: rgba(232,118,43,0.15);
  --linkedin-blue: #2E6B9E;
  --linkedin-dim: rgba(46,107,158,0.15);
  --artstation-purple: #5B4F9E;
  --artstation-dim: rgba(91,79,158,0.15);
  --orange-glow: rgba(232,118,43,0.4);
  --text-primary: #E5E2E1;
  --text-secondary: #A0A0A0;
  --text-dim: #666666;
  --cream: #F5E6D3;
  --font-head: 'Nova Square', 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'Space Mono', 'JetBrains Mono', monospace;
  --section-bg: rgba(19,19,19,0.82);
  --nav-bg: rgba(19,19,19,0.92);
  --paper-tint: rgba(255, 245, 230, 0.02);
}

/* â”€â”€ LIGHT MODE (dirty-white, not pure white) â”€â”€ */
[data-theme="light"] {
  --bg-floor: #D5D0CB;
  --bg-panel: #C8C3BD;
  --bg-card: #BDB8B2;
  --bg-elevated: #B3AEA8;
  --border: #A09B95;
  --border-light: #8A857F;
  --orange: #076eae;
  --orange-dim: rgba(7, 110, 174, 0.18);
  --orange-glow: rgba(7, 110, 174, 0.35);
  --text-primary: #1A1A1A;
  --text-secondary: #3A3A3A;
  --text-dim: #6A6A6A;
  --cream: #2A2420;
  --section-bg: rgba(213,208,203,0.82);
  --nav-bg: rgba(213,208,203,0.94);
}

[data-theme="light"] .mode-icon {
    color: var(--orange); /* Use the blue accent in light mode */
}

/* â”€â”€ LIGHT THEME PANEL OVERRIDES â”€â”€ */
[data-theme="light"] #hive-os-panel {
    background: rgba(101, 101, 106, 0.96); /* 30% lighter than original #23232a */
    filter: drop-shadow(0 0 1px rgba(7, 110, 174, 0.4))
            drop-shadow(0 8px 32px rgba(0, 0, 0, 0.3));
}
[data-theme="light"] #hive-os-panel::before {
    background: rgba(81, 81, 86, 0.98);
}
[data-theme="light"] .panel-edge-glow {
    background: linear-gradient(to left, rgba(7, 110, 174, 0.6) 26%, transparent 60%);
}
[data-theme="light"] .panel-toggle {
    background: rgba(240, 235, 230, 0.9);
}


*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

html { scroll-behavior: smooth; color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }

/* ── INDUSTRIAL SCROLLBAR (page-level; chat keeps its own thin bar) ── */
html { scrollbar-width: thin; scrollbar-color: var(--border-light) var(--bg-floor); }
body::-webkit-scrollbar { width: 11px; }
body::-webkit-scrollbar-track { background: var(--bg-floor); }
body::-webkit-scrollbar-thumb {
  background: var(--border);
  border: 2px solid var(--bg-floor);
}
body::-webkit-scrollbar-thumb:hover { background: var(--orange); }

body {
  background: var(--bg-floor);
  background-color: var(--bg-floor);
  position: relative;
  color: var(--text-primary);
  font-family: var(--font-body);
  overflow-x: hidden;
  cursor: none;
  user-select: none;
  -webkit-user-select: none;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-color: var(--paper-tint);
  pointer-events: none;
  z-index: 0;
}

/* â”€â”€ GRAIN OVERLAY â”€â”€ */
.grain-overlay {
  position: fixed; inset:0; z-index: 9997;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.35 0.45' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0.4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
  mix-blend-mode: overlay;
}

/* â”€â”€ GRID BACKGROUND â”€â”€ */
.grid-bg {
  position: fixed; inset:0; z-index:2;
  pointer-events: none;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.06;
}

/* â”€â”€ SIMULATION CANVAS â”€â”€ */
#sim-canvas {
  position: fixed; inset:0; z-index:1;
  width:100%; height:100%;
  pointer-events: none;
}

/* The wrap owns its own stacking context, permanently. Without this it sits at
   z-index:auto, so the moment the dropout puts a transform/filter on it the
   wrap collapses to layer 0 and #sim-canvas (layer 1) is punched in front of
   the whole page for the length of the glitch. Pinning it above the canvas
   changes nothing at rest - every section is already z-index:10 - and makes
   the paint order immune to the animation. */
#app-wrap {
  position: relative;
  z-index: 10;
}

/* â”€â”€ CUSTOM CURSOR â”€â”€ */
#cursor-dot {
  position: fixed; width:10px; height:10px;
  background: var(--orange); border-radius:40%;
  transform: translate(-50%,-50%);
  pointer-events: none; z-index:9999;
  transition: transform 0.08s, border-radius 0.2s;
  mix-blend-mode: difference;
}
#cursor-ring {
  position: fixed; width:36px; height:36px;
  border: 1.5px solid var(--orange);
  border-radius:40%;
  transform: translate(-50%,-50%);
  pointer-events: none; z-index:9998;
  transition: width 0.25s, height 0.25s, border-color 0.25s, border-radius 0.2s;
}
body:has(.hover-target:hover) #cursor-ring {
  width:50px; height:50px;
  border-color: var(--cream);
  background: rgba(232,118,43,0.05);
  border-radius:40%;
}

/* â”€â”€ SCANLINE ANIMATION â”€â”€ */
@keyframes scanline {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100vh); }
}
.scanline {
  position: fixed; top:0; left:0; width:100%; height:2px;
  background: linear-gradient(90deg, transparent, var(--orange-dim), transparent);
  z-index:8999; pointer-events:none;
  animation: scanline 8s linear infinite;
  opacity:0.3;
}

/* â”€â”€ NAV â”€â”€ */
nav.main-nav {
  position: fixed; top:0; left:0; width:100%; z-index:100;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--border);
  display: flex; align-items:center; justify-content:space-between;
  padding: 0 48px; height: 64px;
}
.nav-logo {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1;
}
.logo-main {
  color: var(--orange);
  white-space: nowrap;
  display: inline-block;
}
.logo-main span { color: var(--text-dim); font-weight:400; }
.logo-decipher {
  font-family: var(--font-mono);
  font-size: 0.45rem;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 2px;
  opacity: 0.7;
  min-width: 120px; /* Prevent jitter */
}
.text-error {
  color: #FF3333 !important;
  font-weight: 700;
  text-shadow: none !important; /* Matte look */
}
.nav-links { display:flex; gap:0; }
.nav-link {
  font-family: var(--font-mono);
  font-size:0.7rem; font-weight:500;
  letter-spacing:0.1em; text-transform:uppercase;
  color: var(--text-dim);
  text-decoration:none;
  padding: 22px 24px;
  border-left: 1px solid var(--border);
  transition: color 0.15s ease-out, background 0.15s ease-out;
  position:relative;
}
.nav-link:last-child { border-right: 1px solid var(--border); }
/* Double-layer underline: glow layer (::before) + crisp line (::after) */
.nav-link::before {
  content:''; position:absolute; bottom:-1px; left:0; width:100%; height:6px;
  background: var(--orange-glow); transform:scaleX(0); filter:blur(3px);
  transition: transform 0.15s ease-out; transform-origin: left;
  z-index:1;
}
.nav-link::after {
  content:''; position:absolute; bottom:0; left:0; width:100%; height:2px;
  background: var(--orange); transform:scaleX(0);
  transition: transform 0.15s ease-out; transform-origin: left;
  z-index:2;
}
/* Industrial hatch pattern behind active/hovered nav link */
.nav-link:hover, .nav-link.active {
  color: var(--orange);
  background:
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 4px,
      var(--orange-dim) 4px,
      var(--orange-dim) 5px
    ),
    var(--orange-dim);
}
.nav-link:hover::before, .nav-link.active::before { transform:scaleX(1); }
.nav-link:hover::after, .nav-link.active::after { transform:scaleX(1); }

/* Active link = target lock: four corner brackets snap onto the label once
   (no perpetual motion), the crisp underline below marks the section. */
@keyframes nav-lock-in {
  from { opacity: 0; transform: scale(1.22); }
  to   { opacity: 1; transform: scale(1); }
}
.nav-link.active::before {
  left: 7px;
  right: 7px;
  top: 6px;
  bottom: 6px;
  width: auto;
  height: auto;
  filter: none;
  background:
    linear-gradient(var(--orange), var(--orange)) left 0 top 0 / 9px 1.5px,
    linear-gradient(var(--orange), var(--orange)) left 0 top 0 / 1.5px 9px,
    linear-gradient(var(--orange), var(--orange)) right 0 top 0 / 9px 1.5px,
    linear-gradient(var(--orange), var(--orange)) right 0 top 0 / 1.5px 9px,
    linear-gradient(var(--orange), var(--orange)) left 0 bottom 0 / 9px 1.5px,
    linear-gradient(var(--orange), var(--orange)) left 0 bottom 0 / 1.5px 9px,
    linear-gradient(var(--orange), var(--orange)) right 0 bottom 0 / 9px 1.5px,
    linear-gradient(var(--orange), var(--orange)) right 0 bottom 0 / 1.5px 9px;
  background-repeat: no-repeat;
  pointer-events: none;
  animation: nav-lock-in 0.24s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.nav-status {
  font-family: var(--font-mono); font-size:0.65rem;
  color: var(--text-dim); letter-spacing:0.05em;
  display:flex; gap:16px; align-items:center;
}
.status-dot {
  width:6px; height:6px; background:#4CAF50;
  border-radius:50%; display:inline-block;
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0%,100% { opacity:1; } 50% { opacity:0.3; }
}
.lang-toggle {
  font-family: var(--font-mono); font-size:0.65rem;
  background: var(--bg-elevated); border:1px solid var(--border-light);
  color: var(--text-secondary); padding:6px 14px;
  cursor:pointer; text-transform:uppercase;
  transition: color 0.3s, border-color 0.3s, background 0.3s, box-shadow 0.3s;
  letter-spacing: 0.08em;
  position: relative;
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 0 100%);
}
.lang-toggle::after {
  content:''; position:absolute; top:0; right:0;
  width:8px; height:8px;
  border-bottom:1px solid var(--orange);
  transform: rotate(45deg) translate(-2px, -2px);
}
.lang-toggle:hover {
  border-color:var(--orange); color:var(--orange);
  background: var(--orange-dim);
  box-shadow: 0 0 8px var(--orange-dim);
}

section {
  min-height:100vh; position:relative; z-index:10;
  padding: 120px 64px 80px;
  background: var(--section-bg);
  backdrop-filter: blur(4px);
}

/* â”€â”€ HERO â”€â”€ */
.hero {
  display:flex; flex-direction:column;
  justify-content:center; align-items:flex-start;
  padding-left: 120px; position:relative; overflow:hidden;
  background: transparent;
  backdrop-filter: none;
}
.hero-label {
  font-family: var(--font-mono); font-size:0.7rem;
  color: var(--orange); letter-spacing:0.2em;
  text-transform:uppercase; margin-bottom:24px;
  opacity:0; animation: typeIn 0.6s 0.5s forwards;
}
.hero-name {
  font-family: var(--font-head); font-weight:700;
  font-size: clamp(3.5rem, 8vw, 7rem);
  line-height:0.95; letter-spacing:-0.02em;
  color: var(--cream); margin-bottom:8px;
  opacity:0; animation: slideUp 0.8s 0.8s forwards;
  /* Reactive grid mask â€” controlled by JS mousemove */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: fit-content;
}
.name-line {
  display: flex;
  justify-content: space-between;
  width: 100%;
}
.hero-name .outline-text {
  -webkit-text-stroke: 2px var(--text-dim);
  color: transparent;
}
.hero-subtitle {
  font-family: var(--font-mono); font-size:1rem;
  font-weight:500; letter-spacing:0.3em;
  text-transform:uppercase; color:var(--orange);
  margin-top:16px; margin-bottom:40px;
  opacity:0; animation: typeIn 0.6s 1.4s forwards;
}
.hero-desc {
  font-family: var(--font-body); font-size:1rem;
  color: var(--text-secondary); max-width:520px;
  line-height:1.7; margin-bottom:48px;
  opacity:0; animation: fadeIn 1s 1.8s forwards;
}
.hero-cta {
  display:flex; gap:16px;
  opacity:0; animation: fadeIn 1s 2.2s forwards;
}
/* Premium Industrial Buttons */
.btn-primary, .btn-secondary {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 16px 36px;
  cursor: pointer;
  position: relative;
  transition-property: transform, background-color, color, box-shadow, border-color;
  transition-duration: 0.4s;
  transition-timing-function: cubic-bezier(0.23, 1, 0.32, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  overflow: hidden;
  z-index: 5;
}

@keyframes grain-flicker {
  0%, 100% { transform: translate(0,0); }
  25% { transform: translate(-1px, 0.5px); }
  50% { transform: translate(0.5px, -1px); }
  75% { transform: translate(-0.5px, -0.5px); }
}

.btn-primary {
  background: var(--orange);
  color: #000;
  /* Simplified but stable clip-path */
  clip-path: polygon(
    0 0, 
    calc(100% - 14px) 0, 
    100% 14px, 
    100% 100%, 
    14px 100%, 
    0 calc(100% - 14px)
  );
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* Persistent Animated Grain */
.btn-primary::before {
  content: '';
  position: absolute;
  inset: -10%; /* Slightly larger to allow movement */
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.1;
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 1;
  animation: grain-flicker 0.4s steps(3) infinite;
}

/* Voxel/Cube Point Pattern */
.btn-primary .btn-pattern {
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(rgba(0,0,0,0.18) 1.5px, transparent 1.5px),
    linear-gradient(45deg, transparent 48%, rgba(0,0,0,0.05) 50%, transparent 52%);
  background-size: 8px 8px, 16px 16px;
  mask-image: linear-gradient(to right, black, transparent 75%);
  opacity: 0.7;
  z-index: 1;
  pointer-events: none;
}

.btn-primary .btn-text {
  position: relative;
  z-index: 2;
  transition: transform 0.3s;
}

.btn-primary:hover {
  background: var(--bg-floor);
  color: var(--orange);
  box-shadow: 
    inset 0 0 0 1px var(--orange-dim),
    0 0 30px var(--orange-glow);
  transform: translateY(-3px);
}

.btn-primary:hover .btn-text {
  transform: scale(1.05);
  text-shadow: 0 0 8px var(--orange-glow);
}

.btn-secondary {
  color: var(--text-secondary);
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
}

.btn-secondary:hover {
  color: var(--orange);
  border-color: var(--orange);
  background: var(--orange-dim);
  box-shadow: 0 0 20px var(--orange-dim);
  transform: translateY(-3px);
}

/* Stabilized Mechanical Corners */
.btn-primary [class^="corner-"],
.btn-secondary [class^="corner-"] {
  position: absolute;
  width: 10px;
  height: 10px;
  border: 2px solid var(--orange);
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  z-index: 10;
}

.corner-tl { top: 0; left: 0; border-bottom: none; border-right: none; }
.corner-tr { top: 0; right: 0; border-bottom: none; border-left: none; }
.corner-bl { bottom: 0; left: 0; border-top: none; border-right: none; }
.corner-br { bottom: 0; right: 0; border-top: none; border-left: none; }

/* Mechanical hover effect for corners */
.btn-primary:hover [class^="corner-"],
.btn-secondary:hover [class^="corner-"] {
  width: 18px;
  height: 18px;
  border-color: var(--cream);
  filter: drop-shadow(0 0 5px var(--orange));
}

/* Hero decorative */
.hero-coords {
  position:absolute; right:120px; bottom:80px;
  font-family:var(--font-mono); font-size:0.72rem;
  color:var(--text-dim); text-align:right;
  line-height:2; letter-spacing:0.05em;
}
.hero-vertical-line {
  position:absolute; right:80px; top:64px; bottom:0;
  width:1px; background: var(--border);
}
.hero-vertical-line::before {
  content:''; position:absolute; top:30%; width:8px; height:8px;
  right:-3.5px; background:var(--orange); border-radius:50%;
}
.hero-corner-tl, .hero-corner-br {
  position:absolute; width:40px; height:40px;
  border-color: var(--orange); opacity:0.3;
}
.hero-corner-tl { top:100px; left:64px; border-top:2px solid; border-left:2px solid; }
.hero-corner-br { bottom:40px; right:120px; border-bottom:2px solid; border-right:2px solid; }

/* â”€â”€ SECTION HEADERS â”€â”€ */
.section-header {
  display:flex; align-items:center; gap:16px;
  margin-bottom:56px;
}
.section-dot { width:10px; height:10px; background:var(--orange); }
.section-title {
  font-family:var(--font-head); font-size:2rem;
  font-weight:700; letter-spacing:0.08em;
  text-transform:uppercase; color:var(--cream);
  /* Prevent layout shift during glitch â€” fixed inline size */
  display:inline-block;
  min-width: max-content;
  white-space: nowrap;
}
.section-line { flex:1; height:2px; background:var(--border); position:relative; }
.section-line::after {
  content:''; position:absolute; right:0; top:-3px;
  width:8px; height:8px; border:2px solid var(--orange);
}
.section-code {
  font-family:var(--font-mono); font-size:0.6rem;
  color:var(--text-dim); letter-spacing:0.1em;
}

/* â”€â”€ IDENTITY / ABOUT â”€â”€ */
.identity-grid { display:grid; grid-template-columns:1fr 1fr; gap:48px; }
.bio-text { font-size:1rem; line-height:1.8; color:var(--text-secondary); user-select: text; -webkit-user-select: text; }
.bio-text p { margin-bottom:20px; }
.lang-line {
  font-family:var(--font-mono); font-size:0.75rem;
  color:var(--orange); letter-spacing:0.15em;
  margin-top:24px; padding-top:16px;
  border-top:1px solid var(--border);
}
.skills-panel {
  background:var(--bg-card); border:2px solid var(--border);
  padding:32px;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%);
  position:relative;
}
.skills-panel::before {
  content:'SKILL_MATRIX'; position:absolute; top:12px; right:16px;
  font-family:var(--font-mono); font-size:0.55rem;
  color:var(--text-dim); letter-spacing:0.15em;
}
.skill-item { margin-bottom:18px; }
.skill-label {
  display:flex; justify-content:space-between;
  font-family:var(--font-mono); font-size:0.7rem;
  font-weight:500; margin-bottom:6px;
  color:var(--text-secondary); letter-spacing:0.05em;
}
.skill-label span:last-child { color:var(--orange); }
.skill-track {
  height:6px; background:var(--bg-floor);
  border:1px solid var(--border); position:relative;
  overflow:hidden;
}
.skill-fill {
  height:100%; background:var(--orange);
  width:0; transition: width 1.2s cubic-bezier(0.23,1,0.32,1);
}
/* Skill bar fluctuation â€” applied by JS after initial fill */
.skill-fill.fluctuating {
  transition: none;
  animation: var(--fluct-anim);
}
@keyframes skill-fluct {
  0%, 100% { width: var(--fluct-base); }
  25% { width: var(--fluct-low); }
  50% { width: var(--fluct-high); }
  75% { width: var(--fluct-mid); }
}
/* Scan sweep on skill bar */
.skill-fill::after {
  content:''; position:absolute; top:0; left:0;
  width:30px; height:100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  animation: skill-scan 3s linear infinite;
  pointer-events:none;
}
@keyframes skill-scan {
  0% { transform: translateX(-30px); }
  100% { transform: translateX(var(--scan-width, 400px)); }
}

/* â”€â”€ PANEL SCREWS â”€â”€ */
.panel-screw {
  position:absolute; width:6px; height:6px;
  border:1px solid var(--text-dim); border-radius:50%;
}
.panel-screw::after {
  content:''; position:absolute; top:50%; left:50%;
  transform:translate(-50%,-50%); width:4px; height:1px;
  background:var(--text-dim);
}
.screw-tl { top:8px; left:8px; }
.screw-tr { top:8px; right:8px; }
.screw-bl { bottom:8px; left:8px; }
.screw-br { bottom:8px; right:8px; }

/* â”€â”€ EDUCATION â”€â”€ */
.edu-timeline { position:relative; padding-left:40px; }
.edu-timeline::before {
  content:''; position:absolute; left:12px; top:0; bottom:0;
  width:2px; background:var(--border);
}
.edu-item {
  position:relative; margin-bottom:40px;
  padding:24px 32px;
  background:var(--bg-card); border:1px solid var(--border);
  border-left:3px solid var(--orange);
  opacity:0; transform:translateX(-20px);
  transition: opacity 0.6s, transform 0.6s;
  z-index:2;
}
/* Stacked file sheets behind edu cards â€” expands on hover */
.edu-item::after {
  content:''; position:absolute; inset:0;
  background:var(--bg-elevated);
  border:1px solid var(--border);
  border-left:3px solid var(--orange);
  z-index:-1;
  transform: translate(4px, 5px);
  opacity:0.6;
  transition: transform 0.35s cubic-bezier(0.25,0.46,0.45,0.94), opacity 0.35s;
}
.edu-item:hover::after {
  transform: translate(7px, 9px);
  opacity:0.8;
}
.edu-item .edu-role {
  position:relative;
  padding-bottom:8px; margin-bottom:8px;
  border-bottom:1px dashed var(--border);
}
.edu-item .edu-role::before {
  content:'â–¸ FILE'; position:absolute; right:0; top:2px;
  font-family:var(--font-mono); font-size:0.5rem;
  color:var(--text-dim); letter-spacing:0.1em;
}
.edu-item.visible { opacity:1; transform:translateX(0); }
.edu-item::before {
  content:''; position:absolute; left:-49px; top:28px;
  width:14px; height:14px; background:var(--bg-floor);
  border:2px solid var(--orange);
  box-shadow: 0 0 6px var(--orange-dim), inset 0 0 3px var(--orange-dim);
  transition: box-shadow 0.3s, transform 0.3s;
}
.edu-item:hover::before {
  box-shadow: 0 0 10px var(--orange-glow), inset 0 0 4px var(--orange-dim);
  transform: scale(1.15);
}
.edu-role {
  font-family:var(--font-head); font-size:1rem;
  font-weight:700; color:var(--cream);
  text-transform:uppercase; letter-spacing:0.05em;
  margin-bottom:6px;
}
.edu-desc {
  font-family:var(--font-mono); font-size:0.8rem;
  color:var(--orange); line-height:1.6;
}

/* â”€â”€ EXPERIENCE â”€â”€ */
.exp-grid { display:grid; grid-template-columns:1fr 1fr; gap:24px; }
.exp-card {
  background:var(--bg-card);
  border:none; outline:none;
  padding:28px; position:relative; overflow:visible;
  z-index:2;
  /* Open-corner gradient borders */
  background-image:
    linear-gradient(var(--border), var(--border)),
    linear-gradient(var(--border), var(--border)),
    linear-gradient(var(--border), var(--border)),
    linear-gradient(var(--border), var(--border)),
    linear-gradient(var(--border), var(--border)),
    linear-gradient(var(--border), var(--border)),
    linear-gradient(var(--border), var(--border)),
    linear-gradient(var(--border), var(--border));
  background-size:
    2px 60%, 2px 60%,
    60% 2px, 60% 2px,
    2px 60%, 2px 60%,
    60% 2px, 60% 2px;
  background-position:
    0 0, 0 100%,
    0 0, 100% 0,
    100% 0, 100% 100%,
    0 100%, 100% 100%;
  background-repeat: no-repeat;
  background-origin: border-box;
  opacity:0; transform:translateY(20px);
  transition: opacity 0.6s, transform 0.6s, background-image 0.3s;
}
/* Stacked file sheets behind exp cards â€” expands on hover */
.exp-card::before {
  content:''; position:absolute; inset:0;
  background:var(--bg-elevated);
  border:1px solid var(--border);
  z-index:-1;
  transform: translate(4px, 5px);
  opacity:0.5;
  pointer-events:none;
  transition: transform 0.35s cubic-bezier(0.25,0.46,0.45,0.94), opacity 0.35s;
}
.exp-card:hover::before {
  transform: translate(7px, 9px);
  opacity:0.7;
}
.exp-card.visible { opacity:1; transform:translateY(0); }
.exp-card:hover {
  background-image:
    linear-gradient(var(--orange), var(--orange)),
    linear-gradient(var(--orange), var(--orange)),
    linear-gradient(var(--orange), var(--orange)),
    linear-gradient(var(--orange), var(--orange)),
    linear-gradient(var(--orange), var(--orange)),
    linear-gradient(var(--orange), var(--orange)),
    linear-gradient(var(--orange), var(--orange)),
    linear-gradient(var(--orange), var(--orange));
}
/* Hover top-line scan on exp-card */
.exp-card .exp-scan-line {
  position:absolute; top:0; left:0;
  width:100%; height:3px; background:var(--orange);
  transform:scaleX(0); transition:transform 0.4s;
  transform-origin:left; z-index:3;
}
.exp-card:hover .exp-scan-line { transform:scaleX(1); }
.exp-card .exp-idx {
  font-family:var(--font-mono); font-size:0.6rem;
  color:var(--text-dim); margin-bottom:12px;
  letter-spacing:0.1em;
  background:var(--bg-elevated); display:inline-block;
  padding:2px 8px; border-bottom:1px solid var(--border);
}
.exp-card .exp-role {
  font-family:var(--font-head); font-size:0.95rem;
  font-weight:700; color:var(--cream);
  text-transform:uppercase; letter-spacing:0.03em;
  margin-bottom:8px;
}
.exp-card .exp-desc {
  font-family:var(--font-body); font-size:0.85rem;
  color:var(--text-secondary); line-height:1.5;
}

/* â”€â”€ CONNECT â”€â”€ */
.connect-content { max-width:700px; }
.connect-text {
  font-size:1.1rem; color:var(--text-secondary);
  line-height:1.8; margin-bottom:16px;
}
.connect-info-row {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}
.connect-email, .connect-phone {
  font-family:var(--font-mono); font-size:1rem;
  color:var(--orange); text-decoration:none;
  letter-spacing:0.05em; display:flex;
  align-items: center; gap: 10px;
  border-bottom:2px solid transparent;
  transition: color 0.3s ease, border-color 0.3s ease, transform 0.3s ease, text-shadow 0.3s ease;
  user-select: text;
  -webkit-user-select: text;
}
.connect-email:hover, .connect-phone:hover { 
  border-color:var(--orange);
  transform: translateY(-2px);
  text-shadow: 0 0 8px var(--orange-glow);
}
.connect-phone svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.5px;
}
.connect-separator {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  opacity: 0.5;
}

.connect-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:16px; }
.connect-btn {
  font-family:var(--font-mono); font-size:0.75rem;
  font-weight:700; letter-spacing:0.1em;
  text-transform:uppercase; text-decoration:none;
  text-align:center; padding:20px;
  border:none; color:var(--text-secondary);
  transition: color 0.3s, transform 0.3s; position:relative; overflow:hidden;
}
/* Open-corner L-bracket borders on connect buttons */
.connect-btn::before, .connect-btn::after {
  content:''; position:absolute; width:16px; height:16px;
  transition: width 0.35s, height 0.35s, border-color 0.3s;
  z-index:2;
}
.connect-btn::before { top:0;left:0; border-top:2px solid var(--border); border-left:2px solid var(--border); }
.connect-btn::after { bottom:0;right:0; border-bottom:2px solid var(--border); border-right:2px solid var(--border); }
.connect-btn .corner-a { position:absolute;top:0;right:0;width:16px;height:16px;border-top:2px solid var(--border);border-right:2px solid var(--border);transition:all 0.35s;z-index:2; }
.connect-btn .corner-b { position:absolute;bottom:0;left:0;width:16px;height:16px;border-bottom:2px solid var(--border);border-left:2px solid var(--border);transition:all 0.35s;z-index:2; }
/* Fill sweep on hover */
.connect-btn .btn-fill {
  position:absolute; inset:0;
  background:var(--orange); transform:translateY(100%);
  transition: transform 0.3s; z-index:0;
}
.connect-btn:hover { color:#000; }
.connect-btn:hover::before, .connect-btn:hover::after,
.connect-btn:hover .corner-a, .connect-btn:hover .corner-b { border-color:var(--orange); width:22px;height:22px; }
.connect-btn:hover .btn-fill { transform:translateY(0); }
.connect-btn span { position:relative; z-index:3; }
.connect-btn.primary-btn { background:var(--orange); color:#000; }
.connect-btn.primary-btn::before, .connect-btn.primary-btn::after { border-color:var(--orange); }
.connect-btn.primary-btn .corner-a, .connect-btn.primary-btn .corner-b { border-color:var(--orange); }
.connect-btn.primary-btn .btn-fill { background:#000; }
.connect-btn.primary-btn:hover { color:var(--orange); }

/* --- HIVE_OS HORIZONTAL PANEL --- */
#hive-panel-wrapper {
    position: absolute;
    top: calc(100vh - 65px); /* Moved up 75px (~2cm) from calc(100vh + 10px) */
    left: 30px;
    bottom: auto !important;
    z-index: 2000;
    pointer-events: none;
    display: flex;
    flex-direction: column; /* Changed to column to stack buttons above */
    align-items: center; /* Centered buttons relative to panel width */
    transform: translateY(-100%) scale(0.75);
    transform-origin: bottom left;
}

#hive-os-panel {
    position: relative;
    width: auto;
    max-width: 900px;
    height: auto;
    min-height: auto;
    background: rgba(16, 16, 20, 0.92); /* Tactical Zinc (from next-prompt.md) */
    border: none;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    z-index: 2;
    pointer-events: auto; /* Ensure panel interaction */
    padding: 1.2rem 1.5rem; /* Restored top padding since header row is gone */
    gap: 0.5rem; /* Tighter vertical gap */
    font-family: 'Space Mono', monospace;
    backdrop-filter: blur(12px);
    clip-path: polygon(
        0% 0%,
        95% 0%,
        100% 12%,
        100% 100%,
        66% 100%,
        60% 75%,
        0% 75%,
        0% 0%
    );
    filter: drop-shadow(0 0 1px rgba(232, 118, 43, 0.5))
            drop-shadow(0 2px 10px rgba(232, 118, 43, 0.18))
            drop-shadow(0 8px 32px rgba(0, 0, 0, 0.75));
}

.panel-sections-row {
    display: flex;
    gap: 1.5rem;
    width: 100%;
    margin-top: 0; /* Removed negative margin since header is gone */
    position: relative;
    z-index: 5;
}

/* Tactical Chassis */
#hive-os-panel::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: -4px;
    bottom: -4px;
    background: rgba(12, 12, 17, 0.72); /* translucent zinc under-plate */
    z-index: -1;
    clip-path: inherit;
}

.panel-edge-glow {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    /* Shortened gradient (fades out at 60% to reduce length by 40%) */
    background: linear-gradient(to left, rgba(232, 118, 43, 0.8) 26%, transparent 60%);
    clip-path: polygon(0 75%, 70.4% 75%, 74% 100%, 0 100%);
    pointer-events: none;
    z-index: 1; /* Sent to the back layer behind the menu */
    transform: translateY(-4px); /* Adjusted: moved down 0.5cm from previous state */
    animation: panel-glow-pulse 8s infinite ease-in-out;
}

/* --- PANEL DATA-BIT PARTICLES --- */
.panel-particles-container {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1; /* Same as glow, behind panel */
    overflow: hidden;
}

.data-bit {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--orange);
    opacity: 0.9;
    pointer-events: none;
    box-shadow: 0 0 6px var(--orange), 0 0 12px var(--orange-glow);
}

@keyframes panel-glow-pulse {
    0%, 100% { opacity: 0.3; filter: brightness(0.9); }
    50% { opacity: 0.7; filter: brightness(1.3); }
}

#hive-os-panel .panel-section .section-header {
    margin-bottom: 1rem;
    font-size: 0.8rem;
    color: var(--orange);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    display: flex;
    justify-content: space-between;
    opacity: 0.9;
}

#hive-os-panel .section-header span:first-child {
    font-weight: 700;
}

#hive-os-panel::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: repeating-linear-gradient(rgba(232, 118, 43, 0.02) 0, rgba(232, 118, 43, 0.02) 1px, transparent 1px, transparent 3px);
    pointer-events: none;
}

.panel-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.panel-section.upgrades {
    flex: 1 1 480px;
    align-self: flex-start; /* Don't stretch into clipped zone */
}

.panel-section.telemetry {
    flex: 0 0 240px;
    border-left: 1px solid rgba(232, 118, 43, 0.2);
    padding-left: 1.5rem;
}

#hive-os-panel .section-header {
    font-size: 0.8rem;
    color: var(--orange);
}

/* --- UPGRADE GRID --- */
.upgrade-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
    height: auto; /* Allow buttons to size naturally */
}

.upgrade-btn {
    background: rgba(30, 30, 38, 0.7); /* Slightly lighter button bg */
    border: 1px solid rgba(113, 113, 122, 0.4);
    color: var(--text-primary);
    padding: 0.6rem 0.75rem;
    height: 76px; /* Optimized tactical height */
    text-align: left;
    cursor: pointer;
    transition-property: border-color, background-color, transform, opacity, filter;
    transition-duration: 0.2s;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
}

.upgrade-btn:hover {
    border-color: var(--orange);
    background: rgba(232, 118, 43, 0.1);
}

.upgrade-btn:active {
    transform: translateY(1px);
}

.upgrade-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    filter: grayscale(1);
}

.btn-cost {
    font-size: 0.7rem;
    color: #ffffff;
    font-variant-numeric: tabular-nums; /* cost digits update without jitter */
}

.btn-label {
    font-size: 0.75rem;
    color: #5BB0EA; /* Brighter blue — readable on the always-dark panel (WCAG) */
    font-weight: 700;
    margin-top: 0.25rem;
    line-height: 1.1;
}

.btn-progress {
    width: 100%;
    height: 2px;
    background: rgba(232, 118, 43, 0.1);
    margin-top: 0.5rem;
}

.btn-progress-fill {
    height: 100%;
    background: var(--orange);
    width: 0%;
    transition: width 0.3s ease;
}

/* --- TELEMETRY --- */
.telemetry-feed {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.telemetry-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(232, 118, 43, 0.06);
    padding-bottom: 0.15rem;
}

.telemetry-label {
    font-size: 0.7rem;
    color: #ffffff; /* AÃ§Ä±k beyaz as requested */
    opacity: 0.85;
    white-space: nowrap;
}

.telemetry-value {
    font-size: 0.95rem;
    color: var(--orange);
    font-weight: 700;
    font-family: var(--font-head);
    line-height: 1;
    white-space: nowrap;
    margin-left: 0.75rem;
}

.telemetry-value.resources {
    font-size: 1.1rem;
}

.threat-assessment {
    margin-top: auto;
    padding: 0.5rem;
    background: rgba(255, 51, 51, 0.05);
    border: 1px solid rgba(255, 51, 51, 0.2);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.threat-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
}

.threat-status {
    color: #FF3333;
    font-weight: 900;
    animation: alert-pulse 2s infinite;
}

.threat-bar {
    display: flex;
    gap: 2px;
    height: 6px;
}

.threat-segment {
    flex: 1;
    background: rgba(255, 51, 51, 0.2);
}

.threat-segment.active {
    background: #FF3333;
}

@keyframes alert-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* --- SETTINGS --- */
.panel-header-row {
    width: 100%;
    padding: 0 10px;
    padding-right: 60px; /* Safety margin for clipped corner */
    margin-top: 55px; /* Buttons 1.5cm down to clear clip-path fully */
    margin-bottom: 5px;
    display: flex;
    justify-content: flex-end;
    position: relative;
    z-index: 10; /* Ensure interaction over overlapping rows */
}

.panel-settings {
    display: flex;
    gap: 8px;
    background: rgba(0, 0, 0, 0.4);
    padding: 4px;
    border: 1px solid var(--border);
    clip-path: polygon(4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%, 0 4px);
    margin-bottom: 25px;
    margin-left: 470px; /* Shifted another 4cm (~150px) right (320 + 150) */
    pointer-events: auto;
    z-index: 10;
}

.setting-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 4px 12px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
}

.setting-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.setting-btn.active {
    background: rgba(232, 118, 43, 0.15);
    color: var(--orange);
    border-color: var(--orange);
    box-shadow: 0 0 10px rgba(232, 118, 43, 0.1);
}

.setting-btn.active::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 2px; height: 100%;
    background: var(--orange);
}

/* â”€â”€ FOOTER â”€â”€ */
footer {
  padding:32px 64px;
  border-top:2px solid var(--border);
  display:flex; justify-content:space-between; align-items:center;
  font-family:var(--font-mono); font-size:0.6rem;
  color:var(--text-dim); letter-spacing:0.1em;
  background: var(--section-bg);
  backdrop-filter: blur(4px);
  position:relative; z-index:10;
}

/* â”€â”€ ANIMATIONS â”€â”€ */
@keyframes typeIn {
  from { opacity:0; transform:translateX(-20px); }
  to { opacity:1; transform:translateX(0); }
}
@keyframes slideUp {
  from { opacity:0; transform:translateY(40px); }
  to { opacity:1; transform:translateY(0); }
}
@keyframes fadeIn {
  from { opacity:0; } to { opacity:1; }
}
@keyframes flicker {
  0%,100% { opacity:1; } 50% { opacity:0.85; }
}
.scroll-reveal {
  opacity:0; transform:translateY(30px);
  transition: opacity 0.7s, transform 0.7s;
}
.scroll-reveal.visible { opacity:1; transform:translateY(0); }

/* â”€â”€ SCRAMBLE & ALIVENESS â”€â”€ */
.scramble-target {
  transition: color 0.2s, font-family 0.05s;
}
.scramble-target.scrambling {
  color: var(--orange);
  text-shadow: 0 0 8px var(--orange-glow);
}
/* Section titles: lock dimensions during glitch to prevent layout shift */
.section-title.scramble-target {
  display: inline-block;
  min-width: max-content;
  white-space: nowrap;
  vertical-align: top;
}

/* Scrambling Character Styles */
.scrambling {
  color: var(--orange);
  text-shadow: 0 0 8px var(--orange-glow);
  font-family: var(--font-mono);
  display: inline-block;
}

.scrambling-fixed {
  filter: contrast(1.2) brightness(1.1);
  white-space: nowrap !important;
}

.font-glitch-1 { font-family: 'JetBrains Mono', monospace !important; font-style: italic; opacity: 0.9; }
.font-glitch-2 { font-family: 'Courier New', Courier, monospace !important; font-weight: 700; }
.font-glitch-3 { font-family: 'Inter', sans-serif !important; font-weight: 300; filter: blur(0.3px); }
.font-glitch-size { letter-spacing: 0.02em; text-shadow: 1px 0 0 var(--orange-dim); }

.status-active { color: var(--orange); }

@keyframes scanline-fast {
  0% { transform: translateY(-100%); opacity: 0; }
  50% { opacity: 1; }
  100% { transform: translateY(1000%); opacity: 0; }
}
.scanline-burst {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent, var(--orange-glow), transparent);
  height: 40px; pointer-events: none; z-index: 100;
  animation: scanline-fast 0.4s linear forwards;
}

/* ── SIGNAL DROPOUT ──
   Reworked against the VHS reference shader. Tape does not hue-rotate the
   whole frame, invert it or desaturate it — the old keyframes did all three
   and read as a digital corruption meme. A worn tape only ever does four
   things, and it does them in this order of loudness:
     1. displaces lines HORIZONTALLY (wave, then per-line jitter)
     2. tears at the head-switching point near the bottom
     3. darkens along a travelling crease
     4. beats slightly brighter as the AC hum rolls through
   Vertical movement is a tiny roll at the switch, never a shake. The steps
   are stepped, not eased: a transport slips, it does not glide. */
@keyframes signal-interference {
  0%, 100% { transform: translate3d(0, 0, 0); filter: brightness(1); }
  6%   { transform: translate3d(-7px, 0, 0);     filter: brightness(1.06); }
  12%  { transform: translate3d(4px, 0, 0);      filter: brightness(0.97); }
  19%  { transform: translate3d(-2px, 0, 0);     filter: brightness(1.02); }
  27%  { transform: translate3d(9px, 0.5px, 0);  filter: brightness(1.10); }
  34%  { transform: translate3d(-5px, 0, 0);     filter: brightness(1); }
  41%  { transform: translate3d(1.5px, 0, 0);    filter: brightness(1.04); }
  49%  { transform: translate3d(-11px, 0, 0);    filter: brightness(0.94); }
  56%  { transform: translate3d(6px, -0.5px, 0); filter: brightness(1.08); }
  63%  { transform: translate3d(-3px, 0, 0);     filter: brightness(1.01); }
  71%  { transform: translate3d(7.5px, 0, 0);    filter: brightness(1.05); }
  79%  { transform: translate3d(-4px, 0, 0);     filter: brightness(0.99); }
  88%  { transform: translate3d(2px, 0, 0);      filter: brightness(1.02); }
  94%  { transform: translate3d(-1px, 0, 0);     filter: brightness(1); }
}

/* The head-switching tear: the loudest tell on a worn tape. A short band near
   the bottom where the drum picks the next track up mid-line — the content
   behind it shifts sideways and its channels rotate. backdrop-filter is what
   makes this real rather than a coloured overlay: it works on the actual page
   underneath, the way the shader's col.yzx swap works on the actual frame. */
@keyframes head-switch {
  0%   { transform: translate3d(0, 0, 0); opacity: 0; }
  12%  { transform: translate3d(-14px, 0, 0); opacity: 1; }
  30%  { transform: translate3d(9px, 0, 0); opacity: 1; }
  52%  { transform: translate3d(-20px, 0, 0); opacity: 1; }
  74%  { transform: translate3d(5px, 0, 0); opacity: 0.85; }
  100% { transform: translate3d(0, 0, 0); opacity: 0; }
}

/* One crease travelling down the frame, darkening as it passes. */
@keyframes tape-crease {
  from { background-position: 0 0, 0 -30%; }
  to   { background-position: 0 0, 0 130%; }
}

/* Scoped Glitch Animation. steps() on the transport: a tape slips between
   discrete line positions, it does not interpolate between them. */
#app-wrap.signal-glitch {
    animation: signal-interference 0.46s steps(1, end) both;
}

/* Scanlines, held low, plus the crease sweeping down. Two background layers
   on one element so the whole artifact costs a single composited layer. */
.signal-glitch::after {
  content: "";
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.16),
      rgba(0, 0, 0, 0.16) 1px,
      transparent 1px,
      transparent 3px
    ),
    linear-gradient(
      180deg,
      transparent 0%,
      rgba(0, 0, 0, 0.34) 42%,
      rgba(232, 118, 43, 0.10) 50%,
      rgba(0, 0, 0, 0.30) 58%,
      transparent 100%
    );
  background-size: 100% 3px, 100% 22%;
  background-repeat: repeat, no-repeat;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.7;
  animation: tape-crease 0.46s linear both;
}

.signal-glitch::before {
  content: "";
  position: fixed;
  left: -24px;
  right: -24px;
  bottom: 5.5%;
  height: 2.2vh;
  min-height: 12px;
  pointer-events: none;
  z-index: 9998;
  opacity: 0;
  /* Channel rotation on the real content behind the band, plus the smear the
     drum leaves. The reference does exactly this with col.yzx and snPhase. */
  backdrop-filter: hue-rotate(96deg) saturate(1.7) brightness(1.18) blur(0.4px);
  -webkit-backdrop-filter: hue-rotate(96deg) saturate(1.7) brightness(1.18) blur(0.4px);
  border-top: 1px solid rgba(255, 255, 255, 0.32);
  animation: head-switch 0.46s steps(1, end) both;
}

/* Logo no longer needs the global glitch skew */
.nav-logo {
  /* Keep base styles */
}

/* â”€â”€ MICRO PULSE on section dots â”€â”€ */
@keyframes dot-ping {
  0% { box-shadow: 0 0 0 0 var(--orange-glow); }
  70% { box-shadow: 0 0 0 10px rgba(232,118,43,0); }
  100% { box-shadow: 0 0 0 0 rgba(232,118,43,0); }
}
.section-dot { animation: dot-ping 3s infinite; }

/* â”€â”€ AMBIENT FLOAT for decorative corners â”€â”€ */
@keyframes ambient-float {
  0%,100% { transform:translate(0,0); }
  25% { transform:translate(2px,-3px); }
  50% { transform:translate(-1px,2px); }
  75% { transform:translate(3px,1px); }
}
.hero-corner-tl, .hero-corner-br {
  animation: ambient-float 6s ease-in-out infinite;
}
.hero-corner-br { animation-delay: -3s; }

/* â”€â”€ COORDS FLICKER â”€â”€ */
@keyframes coords-flicker {
  0%,93%,100% { opacity:0.6; }
  94% { opacity:0; }
  95% { opacity:0.6; }
  96% { opacity:0.2; }
  97% { opacity:0.6; }
}
.hero-coords { animation: coords-flicker 5s infinite; }

/* â”€â”€ STATUS DOT GLOW â”€â”€ */
.status-dot {
  box-shadow: 0 0 6px 2px rgba(76,175,80,0.5);
}

/* â”€â”€ SECTION LINE SHIMMER â”€â”€ */
@keyframes line-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.section-line {
  background: linear-gradient(90deg, var(--border) 40%, var(--orange) 50%, var(--border) 60%);
  background-size: 200% 100%;
  animation: line-shimmer 6s ease-in-out infinite;
}

/* â”€â”€ SKILL BAR GLOW â”€â”€ */
.skill-fill { box-shadow: 0 0 8px var(--orange-glow); position:relative; overflow:hidden; }
/* Segmented look */
.skill-track::after {
  content:''; position:absolute; inset:0;
  background: repeating-linear-gradient(90deg, transparent, transparent 18px, var(--bg-floor) 18px, var(--bg-floor) 20px);
  z-index:1;
}

/* â”€â”€ EXP CARD MICRO SCAN â”€â”€ */
@keyframes card-scan-tactical {
  0% { 
    mask-position: 0 -50%; 
    background-position: 0 -50%, 0 0, 0 0; 
  }
  100% { 
    mask-position: 0 150%; 
    background-position: 0 150%, 0 0, 0 0; 
  }
}
.exp-card::after {
  content:''; position:absolute; inset:0;
  pointer-events:none; z-index:3;
  opacity:0;
  /* Layer 1: Sharp leading line, Layer 2&3: Square pattern grid */
  background-image: 
    linear-gradient(var(--orange), var(--orange)),
    repeating-linear-gradient(90deg, var(--orange-dim) 0, var(--orange-dim) 1px, transparent 1px, transparent 12px),
    repeating-linear-gradient(0deg, var(--orange-dim) 0, var(--orange-dim) 1px, transparent 1px, transparent 12px);
  background-size: 100% 2px, 12px 12px, 12px 12px;
  background-repeat: no-repeat, repeat, repeat;
  
  /* Mask creates the "fade-out trail" effect */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, black 100%);
  -webkit-mask-size: 100% 50%;
  mask-size: 100% 50%; /* Trail is 50% of card height */
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  
  transition: opacity 0.3s;
}

.exp-card:hover::after {
  opacity:1;
  animation: card-scan-tactical 1.2s cubic-bezier(0.4, 0, 0.2, 1) 1 forwards;
}

/* Hover effect will now be handled by JS scramble */
.nav-link:hover {
  color: var(--orange);
}

/* â”€â”€ FOOTER SEPARATOR PULSE â”€â”€ */
@keyframes border-pulse {
  0%,100% { border-top-color: var(--border); }
  50% { border-top-color: var(--orange); }
}
footer {
  animation: border-pulse 8s ease-in-out infinite;
}

/* â”€â”€ SCROLL-TRIGGERED re-enter class â”€â”€ */
.scroll-reveal.re-enter {
  opacity:0; transform:translateY(30px);
}
.edu-item.re-enter {
  opacity:0; transform:translateX(-20px);
}
.exp-card.re-enter {
  opacity:0; transform:translateY(20px);
}

/* â”€â”€ LINKEDIN / ARTSTATION CUSTOM HOVER â”€â”€ */
#btn-linkedin:hover { color:#fff; }
#btn-linkedin:hover .btn-fill { background:var(--linkedin-blue); }
#btn-linkedin:hover::before, #btn-linkedin:hover::after,
#btn-linkedin:hover .corner-a, #btn-linkedin:hover .corner-b {
  border-color:var(--linkedin-blue); width:22px;height:22px;
}
#btn-artstation:hover { color:#fff; }
#btn-artstation:hover .btn-fill { background:var(--artstation-purple); }
#btn-artstation:hover::before, #btn-artstation:hover::after,
#btn-artstation:hover .corner-a, #btn-artstation:hover .corner-b {
  border-color:var(--artstation-purple); width:22px;height:22px;
}

/* â”€â”€ BOLT DOTS â”€â”€ */
.bolt-dot {
  position:absolute; width:5px; height:5px;
  background:var(--text-dim); border-radius:50%;
  z-index:5; pointer-events:none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
}
.bolt-tl { top:5px; left:5px; }
.bolt-tr { top:5px; right:5px; }
.bolt-bl { bottom:5px; left:5px; }
.bolt-br { bottom:5px; right:5px; }

/* â”€â”€ GRADIENT NAV BORDER â”€â”€ */
nav.main-nav {
  border-bottom: 2px solid transparent;
  border-image: linear-gradient(90deg, transparent 0%, var(--border) 20%, var(--orange) 50%, var(--border) 80%, transparent 100%) 1;
}

/* â”€â”€ FOOTER BOLTS â”€â”€ */
footer { position:relative; }
footer .bolt-dot { background:var(--text-dim); }

/* â”€â”€ HERO NAME GLOW PULSE â”€â”€ */
@keyframes hero-glow {
  0%, 100% { text-shadow: 0 0 0px transparent; }
  50% { text-shadow: 0 0 20px var(--orange-dim), 0 0 40px rgba(232,118,43,0.05); }
}
.hero-name {
  animation: slideUp 0.8s 0.8s forwards, hero-glow 6s 3s ease-in-out infinite;
}

/* â”€â”€ HERO VERTICAL LINE DOT PULSE â”€â”€ */
@keyframes vline-dot-pulse {
  0%, 100% { box-shadow: 0 0 4px var(--orange), 0 0 8px var(--orange-dim); transform:translate(3.5px, 0) scale(1); }
  50% { box-shadow: 0 0 10px var(--orange), 0 0 20px var(--orange-glow); transform:translate(3.5px, 0) scale(1.3); }
}
.hero-vertical-line::before {
  right:-3.5px;
  animation: vline-dot-pulse 3s ease-in-out infinite;
}

/* â”€â”€ CURSOR SQUARE ON HERO HOVER â”€â”€ */
.hero-name:hover ~ #cursor-ring,
body:has(.hero-name:hover) #cursor-ring {
  border-radius:20%;
}

/* â”€â”€ HAMBURGER MENU (hidden on desktop) â”€â”€ */
.nav-mobile-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  padding: 10px 8px;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  position: relative;
  z-index: 201;
  transition: border-color 0.3s;
}
.nav-mobile-toggle:hover { border-color: var(--orange); }
.hamburger-line {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-secondary);
  transition: transform 0.3s, opacity 0.3s, background 0.3s;
}
.nav-mobile-toggle.active .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
  background: var(--orange);
}
.nav-mobile-toggle.active .hamburger-line:nth-child(2) {
  opacity: 0;
}
.nav-mobile-toggle.active .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
  background: var(--orange);
}

/* â”€â”€ NAV RIGHT WRAPPER â”€â”€ */
.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* â”€â”€ MOBILE NAV OVERLAY â”€â”€ */
.nav-mobile-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(10, 10, 14, 0.96);
  backdrop-filter: blur(20px);
  z-index: 99;
  display: none;
  opacity: 0;
  transition: opacity 0.3s;
}
.nav-mobile-overlay.active {
  display: block;
  opacity: 1;
}

/* MINIMAL MODE TOGGLE (BOTTOM CENTER)
   NOTE: base rules kept ABOVE the responsive media queries below so the
   per-breakpoint overrides (size/position) win by source order. */
.bottom-theme-switcher {
    position: absolute;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    right: -17.5px;
    transform: translateY(calc(-1 * min(169px, max(0px, 100vh - 613px))));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    z-index: 9001;
    pointer-events: auto;
}

.mode-icon {
    background: none;
    border: none;
    font-family: var(--font-mono);
    color: var(--text-dim);
    cursor: pointer;
    transition:
        color 0.3s cubic-bezier(0.23, 1, 0.32, 1),
        opacity 0.3s cubic-bezier(0.23, 1, 0.32, 1),
        filter 0.3s cubic-bezier(0.23, 1, 0.32, 1),
        transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    opacity: 0.3;
    padding: 12px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 115px;
    height: 115px;
}

.mode-icon svg {
    width: 60%;
    height: 60%;
}

.mode-icon.active {
    color: var(--orange);
    opacity: 0.6;
    text-shadow: 0 0 20px var(--orange-dim);
}

.mode-icon:hover {
    opacity: 0.6;
    color: var(--orange);
}

.mode-center-sign {
    font-family: var(--font-mono);
    font-size: 2.9rem;
    color: var(--text-dim);
    opacity: 0.24;
    letter-spacing: 0.1em;
    user-select: none;
    pointer-events: none;
    margin: 0;
    line-height: 1;
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   RESPONSIVE â€” TIER 1: Small Desktop / Laptop
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
@media (max-width: 1400px) {
  section { padding: 100px 48px 64px; }
  .hero { padding-left: 80px; }
  .hero-coords { right: 80px; }
  .hero-corner-br { right: 80px; }
}

/* ═══════════════════════════════════════════
   RESPONSIVE — TIER 1b: Narrow desktop (nav fit)
   The band between the horizontal nav's natural width and the mobile drawer.
   ═══════════════════════════════════════════ */
@media (min-width: 901px) and (max-width: 1180px) {
  #main-nav { padding: 0 16px; }
  .nav-link { padding: 22px 10px; }
  .nav-right { gap: 10px; }
  /* Base sits at right:-17.5px, which only clears the frame on wide viewports;
     here the hero's own padding has shrunk and the icons hung off the edge. */
  .bottom-theme-switcher { right: 0; }
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   RESPONSIVE â€” TIER 2: Tablet
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
@media (max-width: 900px) {
  body { cursor: auto; }
  #cursor-dot, #cursor-ring { display: none; }

  /* Nav: Hamburger mode */
  nav.main-nav {
    padding: 0 16px;
    height: 56px;
    gap: 0;
  }
  .nav-mobile-toggle { display: flex; }
  .nav-links {
    position: fixed;
    top: 56px; left: 0;
    width: 100%; height: calc(100vh - 56px);
    background: rgba(10, 10, 14, 0.98);
    backdrop-filter: blur(24px);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    overflow-y: auto;
    padding-top: 20px;
  }
  .nav-links.open {
    transform: translateX(0);
  }
  .nav-link {
    border-left: none;
    border-bottom: 1px solid var(--border);
    padding: 20px 32px;
    font-size: 0.9rem;
    letter-spacing: 0.2em;
  }
  .nav-link:last-child { border-right: none; }
  .nav-status { font-size: 0.55rem; }
  .nav-status .status-dot { display: none; }
  .logo-decipher { display: none; }

  /* Hero */
  section { padding: 80px 24px 48px; }
  .hero {
    padding-left: 24px;
    padding-right: 24px;
    padding-bottom: 120px;
  }
  .hero-name { font-size: clamp(2.2rem, 10vw, 4.5rem); }
  .hero-subtitle {
    font-size: 0.85rem;
    letter-spacing: 0.15em;
    margin-bottom: 64px; /* Increased to prevent overlap with Hive OS panel */
  }
  .hero-desc {
    font-size: 0.9rem;
    max-width: 100%;
    margin-bottom: 32px;
  }
  .hero-cta { flex-direction: column; gap: 12px; width: 100%; max-width: 400px; }
  .btn-primary, .btn-secondary {
    text-align: center;
    display: block;
    width: 100%;
    padding: 14px 28px;
    box-sizing: border-box;
  }
  .hero-coords, .hero-vertical-line, .hero-corner-tl, .hero-corner-br { display: none; }

  /* Theme Switcher — top-right rail below the hamburger nav. The desktop
     translateY(-169px) lift leaked into this tier and parked the icons over
     the hero paragraph's first line (glyph-verified overlap). */
  .bottom-theme-switcher { bottom: auto; top: 72px; right: 20px; transform: translateY(0); }
  .mode-icon { width: 80px; height: 80px; }
  .mode-center-sign { font-size: 1.6rem; margin-top: 12px; }

  /* Identity */
  .identity-grid { grid-template-columns: 1fr; gap: 32px; }
  .skills-panel { padding: 24px; }

  /* Experience */
  .exp-grid { grid-template-columns: 1fr; }

  /* Connect */
  .connect-grid { grid-template-columns: 1fr 1fr; }
  .connect-content { max-width: 100%; }

  /* Education */
  .edu-timeline { padding-left: 28px; }
  .edu-item { padding: 18px 20px; }
  .edu-item::before { left: -37px; width: 12px; height: 12px; }

  /* Footer */
  footer {
    flex-direction: column;
    gap: 12px;
    text-align: center;
    padding: 24px 20px;
    font-size: 0.55rem;
  }

  /* Hive OS Panel - smaller on tablet */
  #hive-panel-wrapper {
    transform: translateY(-100%) scale(0.55);
    left: 10px;
    top: calc(100vh - 15px);
    width: auto;
  }
  #hive-os-panel { flex-direction: column; gap: 1rem; width: fit-content; max-width: 95vw; }
  .upgrade-grid { grid-template-columns: repeat(3, 1fr); }
  .panel-section.telemetry { border-left: none; border-top: 1px solid rgba(232, 118, 43, 0.2); padding-left: 0; padding-top: 1rem; flex: 0 0 auto; }

  /* Scanline */
  .scanline { opacity: 0.15; }
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   RESPONSIVE â€” TIER 3: Mobile Phone
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
@media (max-width: 600px) {
  section { padding: 72px 16px 40px; }

  /* Hero */
  .hero {
    padding-left: 16px;
    padding-right: 16px;
    padding-top: 80px;
    min-height: 100svh;
  }
  .hero-name {
    font-size: clamp(1.8rem, 12vw, 3.5rem);
  }
  .hero-label { font-size: 0.6rem; letter-spacing: 0.12em; margin-bottom: 16px; }
  .hero-subtitle {
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    margin-top: 12px;
    margin-bottom: 24px;
  }
  .hero-desc {
    font-size: 0.85rem;
    line-height: 1.6;
    margin-bottom: 24px;
  }
  .btn-primary, .btn-secondary {
    padding: 14px 24px;
    font-size: 0.7rem;
  }

  /* Theme Switcher — top-right rail on phones. The desktop translateY(-169px)
     lift leaked into this tier and parked the icons over the hero paragraph;
     the column fits cleanly in the void beside the stacked hero name. */
  .bottom-theme-switcher { bottom: auto; top: 72px; right: 20px; gap: 10px; transform: translateY(0); }
  .mode-icon { width: 60px; height: 60px; }
  .mode-center-sign { font-size: 1.6rem; margin: 0; }

  /* Section Headers */
  .section-header { gap: 10px; margin-bottom: 32px; flex-wrap: wrap; }
  .section-title { font-size: 1.4rem; }
  .section-code { font-size: 0.5rem; }
  .section-dot { width: 8px; height: 8px; }

  /* Identity */
  .bio-text { font-size: 0.9rem; line-height: 1.7; }
  .lang-line { font-size: 0.65rem; }
  .skills-panel { padding: 18px; }
  .skill-label { font-size: 0.6rem; }
  .skills-panel::before { font-size: 0.45rem; }

  /* Education */
  .edu-timeline { padding-left: 20px; }
  .edu-timeline::before { left: 6px; }
  .edu-item {
    padding: 14px 16px;
    margin-bottom: 24px;
  }
  .edu-item::before { left: -27px; width: 10px; height: 10px; }
  .edu-role { font-size: 0.85rem; }
  .edu-desc { font-size: 0.7rem; }
  .edu-item .edu-role::before { font-size: 0.4rem; }

  /* Experience */
  .exp-card { padding: 20px; }
  .exp-card .exp-idx { font-size: 0.5rem; }
  .exp-card .exp-role { font-size: 0.85rem; }
  .exp-card .exp-desc { font-size: 0.8rem; }

  /* Connect */
  .connect-grid { grid-template-columns: 1fr; }
  .connect-text { font-size: 0.95rem; }
  .connect-email { font-size: 0.85rem; word-break: break-all; }
  .connect-btn { padding: 16px; font-size: 0.7rem; }

  /* Footer */
  footer { padding: 20px 16px; font-size: 0.5rem; }

  /* Hive OS Panel - hide on mobile */
  #hive-panel-wrapper { display: none; }

  /* Chat - full width mobile */
  #chat-modal {
    width: calc(100vw - 24px) !important;
    max-width: 400px;
  }

  /* Disable ambient scan lines on mobile for performance */
  .scanline { display: none; }

  /* Nav links in mobile overlay */
  .nav-link { padding: 18px 24px; font-size: 0.8rem; }
  .nav-status { gap: 8px; }
  .lang-toggle { padding: 4px 10px; font-size: 0.55rem; }
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   RESPONSIVE â€” TIER 4: Tiny Screens
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
@media (max-width: 380px) {
  .hero-name { font-size: clamp(1.5rem, 14vw, 2.5rem); }
  .hero-label { font-size: 0.5rem; }
  .hero-subtitle { font-size: 0.6rem; }
  .hero-desc { font-size: 0.8rem; }
  .section-title { font-size: 1.2rem; }
  .btn-primary, .btn-secondary { padding: 12px 18px; font-size: 0.65rem; }
  .connect-btn { padding: 14px 12px; }
  nav.main-nav { height: 50px; }
  .logo-main { font-size: 0.7rem; }
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   RESPONSIVE â€” Landscape Phone
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
@media (max-height: 500px) and (orientation: landscape) {
  .hero { min-height: auto; padding-top: 64px; padding-bottom: 64px; }
  .hero-name { font-size: clamp(1.8rem, 6vw, 3rem); }
  .bottom-theme-switcher {
    position: fixed;
    bottom: calc(84px + env(safe-area-inset-bottom, 0px));
    right: 20px;
    transform: translateY(-40px);
  }
  .mode-icon { width: 50px; height: 50px; }
  .mode-center-sign { font-size: 1.3rem; }
  section { min-height: auto; }
  /* No vertical room for a game HUD on landscape phones — the ambient
     sim keeps running on the canvas, only the panel is hidden. */
  #hive-panel-wrapper { display: none; }
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   TOUCH DEVICE OVERRIDES
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
@media (hover: none) and (pointer: coarse) {
  body { cursor: auto; }
  #cursor-dot, #cursor-ring { display: none !important; }

  .nav-link { min-height: 44px; display: flex; align-items: center; }
  .connect-btn { min-height: 48px; }
  .btn-primary, .btn-secondary { min-height: 48px; display: flex; align-items: center; justify-content: center; }
  .upgrade-btn { min-height: 48px; }
  .lang-toggle { min-height: 36px; }

  .exp-card:hover::before { transform: translate(4px, 5px); opacity: 0.5; }
  .edu-item:hover::after { transform: translate(4px, 5px); opacity: 0.6; }
  .exp-card:hover::after { animation: none; opacity: 0; }
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   SAFE AREA (Notched Phones)
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
@supports (padding: env(safe-area-inset-bottom)) {
  footer { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  #hive-panel-wrapper { bottom: auto; }
}

/* ═══════════════════════════════════════════
   SHORT-VIEWPORT DESKTOP (laptops ≤1099px tall)
   The HIVE_OS panel is bottom-anchored while the hero copy is
   vertically centered — on 768–1080px-tall screens they collided and
   the panel covered the description and both CTA buttons (clicks on
   "ESTABLISH LINK" landed on game upgrade buttons). Top-anchor the
   hero copy and step the panel scale down as the viewport shortens.
   ═══════════════════════════════════════════ */
@media (min-width: 901px) and (max-height: 1099px) {
  .hero { justify-content: flex-start; padding-top: max(96px, 11vh); }
  .hero-label { margin-bottom: 16px; }
  .hero-name { font-size: min(clamp(3.5rem, 8vw, 7rem), 13vh); }
  .hero-subtitle { margin-top: 12px; margin-bottom: 28px; }
  .hero-desc { margin-bottom: 36px; }
}
@media (min-width: 901px) and (max-height: 940px) {
  #hive-panel-wrapper { transform: translateY(-100%) scale(0.62); }
}
@media (min-width: 901px) and (max-height: 820px) {
  .hero { padding-top: 88px; }
  .hero-name { font-size: min(clamp(3.5rem, 8vw, 7rem), 12vh); }
  .hero-subtitle { margin-bottom: 24px; }
  .hero-desc { margin-bottom: 28px; }
  #hive-panel-wrapper { transform: translateY(-100%) scale(0.55); }
}

/* HIVE_OS PANEL â€” INDUSTRIAL UI */
.hive-panel-tutorial {
    /* Own band under .panel-settings. It used to be absolute in the top band,
       where its 576px nowrap line painted over EMP / JAVELIN / OVERCHARGE. */
    margin: 5px 2px 3px;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--orange); /* Accent — readable over both light and dark page bg */
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    pointer-events: none;
    white-space: nowrap;
}

/* Theme-switcher base rules were relocated above the responsive media
   queries so the mobile/tablet overrides actually win the cascade. */


/* ── THEME TRANSITION OVERLAY ── */
.theme-transition-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-floor);
    opacity: 0;
    visibility: hidden;
    /* Instant appearance/disappearance for overlay visibility */
    transition: visibility 0s, opacity 0s;
    pointer-events: none;
    overflow: hidden;
}

.theme-transition-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Background Pattern & Grain (Reduced) */
.theme-transition-overlay::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(232, 118, 43, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(232, 118, 43, 0.03) 1px, transparent 1px),
        url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 32px 32px, 32px 32px, 256px 256px;
    opacity: 0.12;
    pointer-events: none;
    z-index: 1;
}

.theme-transition-overlay::after {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(0deg, rgba(0,0,0,0.03) 0px, rgba(0,0,0,0.03) 1px, transparent 1px, transparent 2px);
    pointer-events: none;
    z-index: 2;
}

/* System Logs Top-Right */
.system-logs-tr {
    position: absolute;
    top: 40px;
    right: 120px;
    width: 250px;
    height: 150px;
    font-family: var(--font-mono);
    font-size: 0.55rem;
    color: var(--orange);
    text-align: right;
    opacity: 0.6;
    overflow: hidden;
    z-index: 5;
    mask-image: linear-gradient(to bottom, transparent, black 20%, black 80%, transparent);
}

/* Coordinates Bottom-Left */
.coords-bl {
    position: absolute;
    bottom: 50px;
    left: 120px;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--orange);
    opacity: 0.7;
    z-index: 5;
    letter-spacing: 0.1em;
    line-height: 1.6;
}

/* Corner Brackets */
.corner-bracket {
    position: absolute;
    width: 80px;
    height: 80px;
    border: 1px solid var(--orange);
    z-index: 5;
    opacity: 0.15;
}

.corner-bracket.top-left { top: 40px; left: 40px; border-right: none; border-bottom: none; }
.corner-bracket.top-right { top: 40px; right: 40px; border-left: none; border-bottom: none; }
.corner-bracket.bottom-left { bottom: 40px; left: 40px; border-right: none; border-top: none; }
.corner-bracket.bottom-right { bottom: 40px; right: 40px; border-left: none; border-top: none; }

.theme-transition-overlay .overlay-content {
    position: relative;
    text-align: center;
    z-index: 10;
    width: 480px; /* 20% longer than 400px */
    padding: 40px;
}

/* Original Diagonal Stripes Loading Bar */
.theme-transition-overlay .loading-bar-container {
    width: 100%;
    height: 15px; /* 20% thicker than 12px */
    border: 1px solid var(--border);
    padding: 2px;
    background: var(--bg-panel);
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%);
}

.theme-transition-overlay .loading-bar {
    height: 100%;
    width: 0%;
    background: 
        repeating-linear-gradient(45deg, var(--orange) 0, var(--orange) 2px, transparent 2px, transparent 10px),
        repeating-linear-gradient(-45deg, var(--orange) 0, var(--orange) 2px, transparent 2px, transparent 10px);
    background-size: 14px 14px;
    animation: bar-pattern-move 1.5s linear infinite;
    /* Transition removed to allow precise JS sync */
}

@keyframes bar-pattern-move {
    from { background-position: 0 0, 0 0; }
    to { background-position: 14px 0, -14px 0; }
}

.theme-transition-overlay .status-text {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--orange);
    letter-spacing: 0.4em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.theme-transition-overlay .sub-status-text {
    font-family: var(--font-mono);
    font-size: 0.5rem;
    color: var(--orange);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    opacity: 0.5;
    margin-bottom: 20px;
}

.sliding-logs-container {
    height: 60px;
    overflow: hidden;
    position: relative;
    mask-image: linear-gradient(to top, transparent, black 20%, black 80%, transparent);
}

.sliding-log-item {
    font-family: var(--font-mono);
    font-size: 0.45rem;
    color: var(--orange);
    text-transform: uppercase;
    opacity: 0.6;
    margin-bottom: 4px;
    animation: slide-up-fade 2s forwards ease-out;
}

@keyframes slide-up-fade {
    0% { transform: translateY(20px); opacity: 0; }
    20% { transform: translateY(0); opacity: 0.6; }
    80% { transform: translateY(-20px); opacity: 0.6; }
    100% { transform: translateY(-40px); opacity: 0; }
}

/* ── KEYBOARD FOCUS (visible for tab users, invisible for mouse) ── */
:focus-visible {
    outline: 2px solid var(--orange);
    outline-offset: 3px;
}
.nav-link:focus-visible,
.upgrade-btn:focus-visible,
.setting-btn:focus-visible,
#hive-fab:focus-visible,
.chat-send-btn:focus-visible,
.chat-close-btn:focus-visible {
    outline: 2px solid var(--orange);
    outline-offset: 2px;
}

/* ── LIGHT-THEME MOBILE NAV (was hardcoded dark) ── */
[data-theme="light"] .nav-links {
    background: rgba(213, 208, 203, 0.98);
}
[data-theme="light"] .nav-mobile-overlay {
    background: rgba(213, 208, 203, 0.96);
}
[data-theme="light"] .nav-links .nav-link {
    color: var(--text-secondary);
}

/* ── REDUCED MOTION (accessibility) ──
   Strip perpetual motion/glitch while keeping final visible states.
   Scoped to html:not(.force-motion): the user can explicitly re-enable
   motion via the SIM STANDBY pill (persisted as localStorage 'dp-motion'),
   which puts .force-motion on <html> and bypasses this whole block. */
@media (prefers-reduced-motion: reduce) {
    html:not(.force-motion) *,
    html:not(.force-motion) *::before,
    html:not(.force-motion) *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
    html:not(.force-motion) .scanline,
    html:not(.force-motion) .grain-overlay,
    html:not(.force-motion) .section-dot,
    html:not(.force-motion) .hero-corner-tl,
    html:not(.force-motion) .hero-corner-br,
    html:not(.force-motion) .hero-coords,
    html:not(.force-motion) .data-bit,
    html:not(.force-motion) .panel-edge-glow {
        animation: none !important;
    }
    html:not(.force-motion) .nav-link.active::before {
        animation: none !important;
        transform: none;
        opacity: 1;
    }
    html:not(.force-motion) #app-wrap.signal-glitch {
        animation: none !important;
        filter: none !important;
    }
    html:not(.force-motion) #app-wrap.signal-glitch::after,
    html:not(.force-motion) #app-wrap.signal-glitch::before { display: none !important; }
    html:not(.force-motion) { scroll-behavior: auto !important; }
}

/* ── SIM STANDBY PILL (shown when OS requests reduced motion) ── */
#sim-standby {
    position: fixed;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    z-index: 8000;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--orange);
    background: rgba(10, 10, 14, 0.92);
    border: 1px solid var(--orange);
    padding: 10px 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
    box-shadow: 0 0 18px var(--orange-dim);
}
#sim-standby:hover {
    background: var(--orange);
    color: #000;
}
#sim-standby .standby-dot {
    width: 7px;
    height: 7px;
    background: currentColor;
    display: inline-block;
    animation: pulse-dot 1.6s infinite;
}
[data-theme="light"] #sim-standby {
    background: rgba(213, 208, 203, 0.94);
}
@media (max-width: 600px) {
    #sim-standby { bottom: 88px; font-size: 0.55rem; padding: 8px 14px; }
}

/* ═══════════════════════════════════════════
   PHASE 1 — VISUAL POLISH LAYER
   Micro-interaction + depth pass. Same soul:
   tactical orange, Space Mono, industrial.
   ═══════════════════════════════════════════ */

/* ── Selection + numeric alignment ── */
::selection { background: var(--orange); color: #08080a; }
[data-theme="light"] ::selection { color: #f5f0ea; }
.telemetry-value, .hero-coords, .logo-decipher, #nav-clock {
    font-variant-numeric: tabular-nums;
}
.fps-readout {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.065em;
}
.fps-readout [data-fps-state="stable"] { color: var(--text-dim); }
.fps-readout [data-fps-state="strained"] {
    color: #d99a52;
    text-shadow: 0 0 8px rgba(217, 154, 82, 0.22);
}
.fps-readout [data-fps-state="critical"] {
    color: #b85e59;
    text-shadow: 0 0 8px rgba(184, 94, 89, 0.18);
}

/* ── Edge vignette: cockpit depth, above canvas, below content ── */
body::after {
    content: '';
    position: fixed; inset: 0;
    pointer-events: none; z-index: 3;
    background: radial-gradient(ellipse 125% 95% at 50% 42%, transparent 58%, rgba(0, 0, 0, 0.38) 100%);
}
[data-theme="light"] body::after {
    background: radial-gradient(ellipse 125% 95% at 50% 42%, transparent 62%, rgba(58, 48, 40, 0.15) 100%);
}

/* ── Nav UTC clock ── */
#nav-clock {
    color: var(--text-dim);
    letter-spacing: 0.08em;
    opacity: 0.85;
}
@media (max-width: 900px) { #nav-clock { display: none; } }

/* ── Hero name: staggered letter entrance (replaces block slideUp) ── */
@keyframes letter-in {
    from { opacity: 0; transform: translateY(0.45em) skewX(-6deg); filter: blur(4px); }
    to   { opacity: 1; transform: translateY(0) skewX(0deg); filter: blur(0); }
}
.hero-name {
    opacity: 1;
    animation: hero-glow 6s 3s ease-in-out infinite;
    position: relative;
    isolation: isolate;
    overflow: visible;
}
.hero-name .name-line span {
    opacity: 0;
    animation: letter-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: var(--li, 0.9s);
}
/* The glyph re-renders under a top-down scanline instead of popping back.
   The class is left on permanently (fill: both) so the load-time letter-in
   stagger never re-runs; is-disintegrating below must win while both apply. */
@keyframes hero-letter-rematerialize {
    0% {
        clip-path: inset(-12% -12% 104% -12%);
        filter: brightness(2.3);
        opacity: 1;
    }
    70% {
        clip-path: inset(-12% -12% -12% -12%);
        filter: brightness(1.55);
        opacity: 1;
    }
    100% {
        clip-path: inset(-12% -12% -12% -12%);
        filter: brightness(1);
        opacity: 1;
    }
}
.hero-name .name-line > span.is-rematerializing {
    animation: hero-letter-rematerialize 0.44s cubic-bezier(0.22, 1, 0.36, 1) both !important;
}
.hero-name .name-line > span.is-disintegrating {
    opacity: 0 !important;
    animation: none !important;
}
.hero-disintegration-fragment {
    position: fixed;
    z-index: 60;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    margin: 0;
    padding: 0;
    pointer-events: none;
    white-space: nowrap;
    transform-origin: center;
    will-change: transform, opacity, filter;
    contain: paint;
}
/* Micro ring where the cursor struck the glyph — ties cause to effect. */
.hero-impact-flash {
    position: fixed;
    z-index: 61;
    width: 22px;
    height: 22px;
    margin: 0;
    border: 1.5px solid var(--orange);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--orange-dim), inset 0 0 6px var(--orange-dim);
    pointer-events: none;
    will-change: transform, opacity;
}

/* ── Section ghost index numbers (01–04) behind headers ── */
section > .section-header { position: relative; }
section > .section-header::before {
    content: attr(data-num);
    position: absolute;
    right: 0; top: 50%;
    transform: translateY(-54%);
    font-family: var(--font-head);
    font-size: 6rem; font-weight: 700; line-height: 1;
    color: transparent;
    -webkit-text-stroke: 1px var(--border-light);
    opacity: 0.45;
    pointer-events: none; z-index: 0;
    letter-spacing: -0.02em;
}
@media (max-width: 600px) {
    section > .section-header::before { font-size: 3.4rem; opacity: 0.35; }
}

/* ── Education timeline: line draws itself on reveal ── */
.edu-timeline::before {
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 1.4s cubic-bezier(0.22, 1, 0.36, 1) 0.2s;
}
.edu-timeline.drawn::before { transform: scaleY(1); }

/* ── Button sheen sweep (replays on every hover) ── */
.btn-primary::after, .btn-secondary::after {
    content: '';
    position: absolute; top: 0; left: 0;
    width: 60%; height: 100%;
    background: linear-gradient(105deg, transparent 20%, rgba(255, 255, 255, 0.30) 50%, transparent 80%);
    transform: translateX(-170%) skewX(-12deg);
    pointer-events: none; z-index: 1;
}
.btn-primary:hover::after, .btn-secondary:hover::after {
    transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
    transform: translateX(300%) skewX(-12deg);
}

/* ── Magnetic buttons: JS feeds --mx/--my, existing transitions ease it ── */
.btn-primary { transform: translate(var(--mx, 0px), var(--my, 0px)); }
.btn-secondary { transform: translate(var(--mx, 0px), var(--my, 0px)); }
.btn-primary:hover { transform: translate(var(--mx, 0px), var(--my, 0px)) translateY(-3px); }
.btn-secondary:hover { transform: translate(var(--mx, 0px), var(--my, 0px)) translateY(-3px); }
.connect-btn { transform: translate(var(--mx, 0px), var(--my, 0px)); }

/* ── Experience cards: tactile lift on hover ── */
.exp-card {
    transition: opacity 0.6s, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
                background-image 0.3s, box-shadow 0.3s;
}
.exp-card.visible:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35), 0 0 0 1px var(--orange-dim);
}

/* ── Cursor: reticle crosshair ticks + target-lock spin ── */
#cursor-dot, #cursor-ring { left: -100px; top: -100px; }
#cursor-ring::before, #cursor-ring::after {
    content: '';
    position: absolute;
    opacity: 0.55;
    transition: opacity 0.25s;
}
#cursor-ring::before {
    left: 50%; top: -8px; bottom: -8px; width: 1.5px;
    transform: translateX(-50%);
    background: linear-gradient(to bottom,
        var(--orange) 0 6px, transparent 6px calc(100% - 6px), var(--orange) calc(100% - 6px) 100%);
}
#cursor-ring::after {
    top: 50%; left: -8px; right: -8px; height: 1.5px;
    transform: translateY(-50%);
    background: linear-gradient(to right,
        var(--orange) 0 6px, transparent 6px calc(100% - 6px), var(--orange) calc(100% - 6px) 100%);
}
body:has(.hover-target:hover) #cursor-ring::before,
body:has(.hover-target:hover) #cursor-ring::after { opacity: 1; }

/* ── OVERCHARGE button states ── */
@keyframes oc-pulse {
    0%, 100% { box-shadow: 0 0 4px rgba(232, 184, 75, 0.2); }
    50% { box-shadow: 0 0 14px rgba(232, 184, 75, 0.55); }
}
.setting-btn.oc-ready {
    color: #E8B84B;
    border-color: rgba(232, 184, 75, 0.5);
    animation: oc-pulse 1.8s infinite;
}
.setting-btn.oc-active {
    color: #000;
    background: #E8B84B;
    border-color: #E8B84B;
    font-weight: 700;
}

/* ── BOOT SEQUENCE (once per session; skipped under reduced motion) ── */
#boot-seq {
    position: fixed; inset: 0; z-index: 10002;
    background: #050507;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: opacity 0.4s;
}
#boot-seq.boot-done { opacity: 0; pointer-events: none; }
.boot-inner { width: min(430px, 86vw); }
.boot-title {
    color: #E8762B; font-size: 1rem; font-weight: 700;
    letter-spacing: 0.35em; margin-bottom: 18px;
}
.boot-title span { color: #555; font-weight: 400; letter-spacing: 0.1em; }
.boot-lines { min-height: 92px; margin-bottom: 14px; }
.boot-lines div {
    color: rgba(232, 118, 43, 0.75); font-size: 0.6rem;
    letter-spacing: 0.08em; line-height: 1.75; white-space: pre;
}
.boot-bar {
    height: 10px; border: 1px solid #333; padding: 2px;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%);
}
.boot-bar-fill {
    height: 100%; width: 0;
    background: repeating-linear-gradient(45deg, #E8762B 0, #E8762B 2px, transparent 2px, transparent 8px);
}
.boot-skip {
    margin-top: 14px; color: #444; font-size: 0.5rem;
    letter-spacing: 0.2em; text-align: right;
}

/* ── AUDIO HINT TOAST ── */
#audio-hint {
    position: fixed; left: 50%; bottom: 20px;
    transform: translateX(-50%);
    z-index: 8001;
    display: flex; align-items: center; gap: 10px;
    font-family: var(--font-mono); font-size: 0.6rem;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    background: rgba(10, 10, 14, 0.94);
    border: 1px solid var(--border-light);
    padding: 9px 12px;
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
    animation: ah-in 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    transition: opacity 0.3s, transform 0.3s;
}
#audio-hint.ah-out { opacity: 0; transform: translateX(-50%) translateY(10px); }
@keyframes ah-in {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
}
.ah-btn {
    font-family: var(--font-mono); font-size: 0.6rem;
    background: transparent; border: 1px solid var(--orange);
    color: var(--orange); padding: 4px 10px;
    cursor: pointer; letter-spacing: 0.1em;
}
.ah-btn:hover { background: var(--orange); color: #000; }
.ah-btn.ah-off { border-color: var(--border-light); color: var(--text-dim); }
[data-theme="light"] #audio-hint { background: rgba(213, 208, 203, 0.95); }

/* ═══════════════════════════════════════════
   POLISH PASS v11 — readability, typography, tactility
   ═══════════════════════════════════════════ */

/* ── Light-theme readability (WCAG): the blue accent was 2.8–3.6:1 on
   warm surfaces. Darker ink variants only where text must be read. ── */
[data-theme="light"] { --text-dim: #5E5B58; }
[data-theme="light"] .edu-desc { color: #04426B; }
[data-theme="light"] .hero-subtitle { color: #05537F; }
[data-theme="light"] .lang-line { color: #05537F; }

/* ── Calmer rag on running text ── */
.hero-desc, .bio-text p, .exp-card .exp-desc, .edu-desc, .connect-text {
  text-wrap: pretty;
}

/* ── Nav: scroll state (JS toggles .scrolled; inline border-color could
   never win against the border-image gradient) ── */
nav.main-nav.scrolled {
  border-image: linear-gradient(90deg, transparent 0%, var(--orange) 25%, var(--orange) 75%, transparent 100%) 1;
}

/* ── Tactile press states ── */
.btn-primary:active, .btn-secondary:active {
  transform: translate(var(--mx, 0px), var(--my, 0px)) translateY(-1px) scale(0.98);
}
.connect-btn:active { transform: translate(var(--mx, 0px), var(--my, 0px)) scale(0.97); }
.setting-btn:active, .lang-toggle:active { transform: translateY(1px); }

/* ── Chat close button: real hit area (was a bare 1.2rem glyph) ── */
.chat-close-btn {
  min-width: 36px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: color 0.2s;
}
.chat-close-btn:hover { color: var(--orange); }

/* ═══════════════════════════════════════════
   PREMIUM PASS v12 — structural cockpit details
   ═══════════════════════════════════════════ */

/* ── Hazard-tape section seams: each content section opens with a thin
   industrial warning band that fades out to the right ── */
#identity, #education, #experience, #connect {
  border-top: 1px solid var(--border);
}
#identity::before, #education::before, #experience::before, #connect::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 8px;
  background: repeating-linear-gradient(-45deg, var(--orange-dim) 0 10px, transparent 10px 22px);
  opacity: 0.55;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to right, black 30%, transparent 72%);
  mask-image: linear-gradient(to right, black 30%, transparent 72%);
}

/* ── Scroll progress rail: left-edge industrial track with an orange fill
   and a carriage tick (injected by main.js; desktop only) ── */
#scroll-rail {
  position: fixed;
  left: 0; top: 64px; bottom: 0;
  width: 3px;
  z-index: 95;
  pointer-events: none;
  border-right: 1px solid var(--border);
  background: repeating-linear-gradient(to bottom, var(--border) 0 2px, transparent 2px 10vh);
  opacity: 0.9;
}
#scroll-rail-fill {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 0%;
  background: linear-gradient(to bottom, var(--orange-dim), var(--orange));
  box-shadow: 0 0 8px var(--orange-glow);
}
#scroll-rail-fill::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0;
  width: 9px; height: 3px;
  background: var(--orange);
  box-shadow: 0 0 6px var(--orange-glow);
}
@media (max-width: 900px) { #scroll-rail { display: none; } }

/* ── Machined-metal edge light on the HIVE_OS panel ── */
#hive-os-panel {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), inset 0 -1px 0 rgba(0, 0, 0, 0.45);
}

/* ═══════════════ R10 — CINEMA & DETAIL PASS ═══════════════ */

/* ── Film grade: fixed edge vignette + living grain. One quiet layer that
   seats every effect in the same photographed frame (div via main.js). ── */
#film-grade {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 9990;
}
#film-grade::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(130% 100% at 50% 40%, transparent 58%, rgba(0, 0, 0, 0.18) 100%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.10), transparent 11%);
}
#film-grade::after {
  content: ''; position: absolute; inset: -40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  opacity: 0.028;
  mix-blend-mode: overlay;
  animation: film-grain-shift 0.9s steps(1) infinite;
}
@keyframes film-grain-shift {
  0%    { transform: translate(0, 0); }
  12.5% { transform: translate(-24px, 18px); }
  25%   { transform: translate(14px, -30px); }
  37.5% { transform: translate(-32px, -8px); }
  50%   { transform: translate(22px, 26px); }
  62.5% { transform: translate(-12px, 34px); }
  75%   { transform: translate(30px, -18px); }
  87.5% { transform: translate(-26px, -28px); }
  100%  { transform: translate(0, 0); }
}
[data-theme="light"] #film-grade::before {
  background: radial-gradient(130% 100% at 50% 40%, transparent 62%, rgba(31, 24, 16, 0.10) 100%);
}
[data-theme="light"] #film-grade::after {
  opacity: 0.018;
  mix-blend-mode: multiply;
}

/* ── Scroll rail: section waypoint ticks that ignite as the fill passes ── */
.rail-tick {
  position: absolute; left: 0;
  width: 9px; height: 2px;
  background: var(--border-light);
  transform: translateY(-1px);
  transition: background-color 0.3s;
}
.rail-tick.passed {
  background: var(--orange);
  box-shadow: 0 0 7px var(--orange-glow);
  animation: rail-tick-flash 0.5s ease-out;
}
@keyframes rail-tick-flash {
  0% { transform: translateY(-1px) scaleX(2.6); }
  100% { transform: translateY(-1px) scaleX(1); }
}

/* ── Skill bars: white-hot LED cap riding the fill + 12-cell HUD grid ── */
.skill-fill::before {
  content: ''; position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 3px;
  background: #ffd9ad;
  box-shadow: 0 0 6px var(--orange-glow), 0 0 12px var(--orange-dim);
  animation: skill-led-breathe 2.2s ease-in-out infinite;
  z-index: 2;
}
@keyframes skill-led-breathe {
  0%, 100% { opacity: 0.72; }
  50% { opacity: 1; }
}
.skill-track::after {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg,
    transparent 0,
    transparent calc(100% / 12 - 1px),
    var(--bg-floor) calc(100% / 12 - 1px),
    var(--bg-floor) calc(100% / 12));
  pointer-events: none;
  z-index: 3;
  opacity: 0.9;
}

/* ── Experience cards: pointer-tracked specular sheen (vars via main.js) ── */
.exp-card .exp-sheen {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.35s;
  background: radial-gradient(420px circle at var(--shx, 50%) var(--shy, 50%),
    rgba(255, 196, 138, 0.10),
    rgba(255, 196, 138, 0.04) 34%,
    transparent 62%);
}
.exp-card:hover .exp-sheen { opacity: 1; }
[data-theme="light"] .exp-card .exp-sheen {
  background: radial-gradient(420px circle at var(--shx, 50%) var(--shy, 50%),
    rgba(20, 26, 34, 0.07),
    rgba(20, 26, 34, 0.03) 34%,
    transparent 62%);
}

/* ── Education timeline: nodes ignite in sequence as the spine draws past ── */
@keyframes edu-node-ignite {
  0% {
    transform: scale(0.35);
    opacity: 0.15;
    box-shadow: 0 0 0 transparent;
  }
  55% {
    transform: scale(1.5);
    opacity: 1;
    box-shadow: 0 0 16px var(--orange-glow), inset 0 0 5px var(--orange-dim);
  }
  100% {
    transform: scale(1);
    opacity: 1;
    box-shadow: 0 0 6px var(--orange-dim), inset 0 0 3px var(--orange-dim);
  }
}
.edu-timeline.drawn .edu-item:nth-child(1)::before { animation: edu-node-ignite 0.5s 0.25s backwards; }
.edu-timeline.drawn .edu-item:nth-child(2)::before { animation: edu-node-ignite 0.5s 0.45s backwards; }
.edu-timeline.drawn .edu-item:nth-child(3)::before { animation: edu-node-ignite 0.5s 0.65s backwards; }
.edu-timeline.drawn .edu-item:nth-child(4)::before { animation: edu-node-ignite 0.5s 0.85s backwards; }
.edu-timeline.drawn .edu-item:nth-child(5)::before { animation: edu-node-ignite 0.5s 1.05s backwards; }
.edu-timeline.drawn .edu-item:nth-child(6)::before { animation: edu-node-ignite 0.5s 1.25s backwards; }

/* ── Hero label: OSD block caret while the boot text types, then one bloom ── */
.hero-label.osd-typing::after {
  content: '▌';
  margin-left: 3px;
  color: var(--orange);
  animation: osd-caret-blink 0.6s steps(2, jump-none) infinite;
}
@keyframes osd-caret-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}
.hero-label.osd-done {
  animation: hero-osd-bloom 0.55s ease-out forwards;
}
@keyframes hero-osd-bloom {
  0% { text-shadow: 0 0 18px var(--orange-glow), 0 0 4px var(--orange); opacity: 1; }
  100% { text-shadow: 0 0 0 transparent; opacity: 1; }
}

/* ── Hero vertical guide: a light pulse slides down the rail every 7s ── */
.hero-vertical-line::after {
  content: ''; position: absolute;
  left: 0; top: -70px;
  width: 1px; height: 70px;
  background: linear-gradient(to bottom, transparent, var(--orange), transparent);
  opacity: 0;
  animation: vline-energy 7s 2.4s ease-in infinite;
}
@keyframes vline-energy {
  0% { transform: translateY(0); opacity: 0; }
  3% { opacity: 0.9; }
  11% { transform: translateY(110vh); opacity: 0; }
  100% { transform: translateY(110vh); opacity: 0; }
}

/* ── Footer: EOF sign-off with a breathing block caret + heartbeat blip ── */
.footer-eof {
  position: absolute;
  left: 50%; bottom: 5px;
  transform: translateX(-50%);
  font-size: 0.5rem;
  letter-spacing: 0.18em;
  color: var(--text-dim);
  opacity: 0.75;
  white-space: nowrap;
}
.eof-caret {
  display: inline-block;
  width: 5px; height: 9px;
  margin-left: 5px;
  vertical-align: -1px;
  background: var(--orange);
  animation: osd-caret-blink 1.1s steps(2, jump-none) infinite;
}
footer::after {
  content: ''; position: absolute;
  top: -2px; left: 0;
  width: 26px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--orange), #fff);
  opacity: 0;
  animation: footer-blip 6s 3s linear infinite;
  pointer-events: none;
}
@keyframes footer-blip {
  0% { transform: translateX(-30px); opacity: 0; }
  2% { opacity: 0.9; }
  18% { transform: translateX(calc(100vw + 8px)); opacity: 0; }
  100% { transform: translateX(calc(100vw + 8px)); opacity: 0; }
}

/* ── R11: prism shards among the panel data-bits ── */
.data-prism {
    position: absolute;
    pointer-events: none;
    clip-path: polygon(50% 0%, 100% 28%, 78% 100%, 22% 100%, 0% 28%);
    background: linear-gradient(152deg,
        color-mix(in srgb, var(--orange) 90%, #fff) 0%,
        color-mix(in srgb, var(--orange) 62%, transparent) 46%,
        color-mix(in srgb, var(--orange) 26%, transparent) 100%);
    filter: drop-shadow(0 0 5px var(--orange-dim));
    opacity: 0;
    will-change: transform, opacity;
}

/* ── R10 motion guards ── */
html.hive-motion-off #film-grade::after,
html.hive-motion-off .rail-tick.passed,
html.hive-motion-off .skill-fill::before,
html.hive-motion-off .hero-label.osd-typing::after,
html.hive-motion-off .hero-label.osd-done,
html.hive-motion-off .hero-vertical-line::after,
html.hive-motion-off .eof-caret,
html.hive-motion-off footer::after {
  animation: none !important;
}
@media (prefers-reduced-motion: reduce) {
  html:not(.force-motion) #film-grade::after,
  html:not(.force-motion) .rail-tick.passed,
  html:not(.force-motion) .skill-fill::before,
  html:not(.force-motion) .hero-label.osd-typing::after,
  html:not(.force-motion) .hero-label.osd-done,
  html:not(.force-motion) .hero-vertical-line::after,
  html:not(.force-motion) .eof-caret,
  html:not(.force-motion) footer::after {
    animation: none !important;
  }
}

/* ── R13: wave-clear upgrade draft dock + ability buttons ── */
#draft-dock {
  position: fixed;
  left: 50%;
  bottom: 88px;
  transform: translateX(-50%);
  z-index: 5500;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}
.draft-head {
  font-family: var(--font-mono, 'Space Mono', monospace);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: #ffd9ad;
  text-shadow: 0 0 12px rgba(232, 118, 43, 0.45);
  animation: draft-head-in 0.4s cubic-bezier(0.16, 0.84, 0.44, 1) both;
}
.draft-row {
  display: flex;
  gap: 12px;
  pointer-events: auto;
}
.draft-card {
  --card-i: 0;
  width: 168px;
  min-height: 96px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  background: rgba(16, 16, 20, 0.92);
  border: 1px solid rgba(232, 118, 43, 0.38);
  color: #eae6df;
  cursor: pointer;
  font-family: var(--font-mono, 'Space Mono', monospace);
  animation: draft-card-in 0.5s cubic-bezier(0.16, 0.84, 0.44, 1) both;
  animation-delay: calc(var(--card-i) * 90ms);
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.draft-card:hover,
.draft-card:focus-visible {
  border-color: #e8762b;
  transform: translateY(-4px);
  box-shadow: 0 10px 26px rgba(232, 118, 43, 0.22);
}
.draft-name {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: #ffb36b;
}
.draft-desc {
  font-size: 10px;
  line-height: 1.45;
  color: rgba(234, 230, 223, 0.75);
}
.draft-stack {
  font-size: 9px;
  letter-spacing: 0.14em;
  color: #58c7e8;
}
#draft-dock.draft-out {
  opacity: 0;
  transform: translateX(-50%) translateY(14px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
@keyframes draft-card-in {
  from { opacity: 0; transform: translateY(18px) scale(0.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes draft-head-in {
  from { opacity: 0; letter-spacing: 0.4em; }
  to { opacity: 1; letter-spacing: 0.18em; }
}
.ability-btn.ability-ready {
  color: #8ee8ff;
  border-color: rgba(142, 232, 255, 0.5);
  text-shadow: 0 0 8px rgba(142, 232, 255, 0.35);
}
@media (max-width: 600px) {
  #draft-dock { bottom: 120px; }
  .draft-row { gap: 8px; }
  .draft-card { width: 118px; min-height: 88px; padding: 10px 11px; }
}
html.hive-motion-off .draft-card,
html.hive-motion-off .draft-head {
  animation: none !important;
}
@media (prefers-reduced-motion: reduce) {
  html:not(.force-motion) .draft-card,
  html:not(.force-motion) .draft-head {
    animation: none !important;
  }
}



/* ── DISPLAY FACE: NOVA SQUARE ──
   Nova Square ships one weight only. Every --font-head rule in this file asks
   for 700, which would leave the browser to smear a synthetic bold over a face
   that is already square and heavy. Pin the real weight and switch synthesis
   off; the hierarchy comes from size and tracking instead, which is how this
   face is meant to be set.
   Its counters are wide, so the negative tracking the previous grotesk needed
   is removed — at display size it was jamming the squares into each other. */
.hero-name,
.section-title,
.edu-role,
.exp-card .exp-role,
.mode-center-value,
.hero-name .name-line.outline-text {
  font-weight: 400;
  font-synthesis-weight: none;
  font-synthesis: none;
}

.hero-name { letter-spacing: 0.005em; }
.section-title { letter-spacing: 0.1em; }
.edu-role { letter-spacing: 0.07em; }
.exp-card .exp-role { letter-spacing: 0.05em; }
