/* =========================================================================
   Navin Hariharan — cyber-terminal portfolio
   Plain CSS, no build step. Sections follow the order in index.html.
   ========================================================================= */

/* ---------- 1. Tokens ---------- */
:root {
  --bg: #03050b;
  --bg-2: #070b1a;
  --glass: rgba(10, 18, 38, 0.55);
  --glass-strong: rgba(10, 18, 38, 0.82);
  --line: rgba(120, 170, 255, 0.14);
  --line-strong: rgba(120, 200, 255, 0.32);

  --text: #dbe7f3;
  --soft: #93a7bd;
  --faint: #6f8399;

  --cyan: #22e6ff;
  --green: #3dff8a;
  --magenta: #ff2bd6;
  --amber: #ffc857;

  --glow-cyan: 0 0 24px rgba(34, 230, 255, 0.45);
  --glow-green: 0 0 24px rgba(61, 255, 138, 0.4);
  --glow-magenta: 0 0 24px rgba(255, 43, 214, 0.45);

  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'Sora', ui-sans-serif, system-ui, -apple-system, sans-serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gutter: clamp(16px, 4vw, 56px);
  --max: 1280px;
  color-scheme: dark;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 700px at 80% -10%, rgba(34, 230, 255, 0.08), transparent 60%),
    radial-gradient(900px 600px at -10% 40%, rgba(255, 43, 214, 0.06), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 50%, var(--bg) 100%);
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.is-booting { overflow: hidden; }
::selection { background: var(--magenta); color: #000; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
kbd { font-family: var(--mono); font-size: 0.85em; padding: 1px 6px; border: 1px solid var(--line-strong); border-radius: 4px; color: var(--cyan); }
.mono { font-family: var(--mono); }
.dim { color: var(--faint); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 4px; box-shadow: var(--glow-cyan); }

.skip-link {
  position: fixed; top: 10px; left: 10px; z-index: 1000; padding: 10px 14px;
  background: var(--cyan); color: #000; font-family: var(--mono); border-radius: 6px;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }
.noscript { position: fixed; inset: auto 0 0; padding: 12px; text-align: center; background: var(--magenta); color: #000; }

/* ---------- 3. Boot sequence ---------- */
.boot {
  position: fixed; inset: 0; z-index: 900;
  display: grid; place-items: center; padding: var(--gutter);
  background: #010207;
  transition: opacity 0.6s var(--ease), visibility 0.6s;
}
.boot.is-done { opacity: 0; visibility: hidden; }
.boot-inner { width: min(640px, 100%); }
.boot-log {
  margin: 0 0 18px; min-height: 15.5em;
  font: 13px/1.6 var(--mono); color: var(--green); white-space: pre-wrap;
  text-shadow: 0 0 8px rgba(61, 255, 138, 0.5);
}
.boot-log .c { color: var(--cyan); text-shadow: 0 0 8px rgba(34, 230, 255, 0.5); }
.boot-log .m { color: var(--magenta); text-shadow: 0 0 8px rgba(255, 43, 214, 0.5); }
.boot-log .grant { display: inline-block; margin-top: 6px; padding: 2px 8px; background: var(--green); color: #000; text-shadow: none; }
.boot-bar { height: 3px; background: rgba(61, 255, 138, 0.12); overflow: hidden; }
.boot-bar span { display: block; height: 100%; width: 0; background: var(--green); box-shadow: var(--glow-green); transition: width 0.2s linear; }
.boot-hint { margin-top: 12px; font: 11px var(--mono); color: var(--faint); letter-spacing: 0.12em; text-transform: uppercase; }

/* ---------- 4. Ambient layers: rain, scanlines, grain, cursor ---------- */
.rain { position: fixed; inset: 0; z-index: 0; width: 100%; height: 100%; opacity: 0.32; pointer-events: none; }
.fx-scanlines {
  position: fixed; inset: 0; z-index: 800; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}
.fx-grain {
  position: fixed; inset: -50%; z-index: 801; pointer-events: none; opacity: 0.07;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 0.9s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}

.cursor-dot, .cursor-ring { position: fixed; top: 0; left: 0; z-index: 950; pointer-events: none; border-radius: 50%; opacity: 0; will-change: transform; }
.cursor-dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: var(--cyan); box-shadow: 0 0 12px var(--cyan), 0 0 24px var(--cyan); }
.cursor-ring {
  width: 38px; height: 38px; margin: -19px 0 0 -19px;
  border: 1px solid rgba(34, 230, 255, 0.6);
  box-shadow: 0 0 18px rgba(34, 230, 255, 0.35), inset 0 0 12px rgba(34, 230, 255, 0.2);
  transition: width 0.25s var(--ease), height 0.25s var(--ease), margin 0.25s var(--ease), border-color 0.25s, background-color 0.25s;
}
.has-cursor .cursor-dot, .has-cursor .cursor-ring { opacity: 1; }
.has-cursor, .has-cursor a, .has-cursor button { cursor: none; }
.has-cursor input, .has-cursor textarea { cursor: text; }
.cursor-ring.is-hover { width: 64px; height: 64px; margin: -32px 0 0 -32px; border-color: var(--magenta); background: rgba(255, 43, 214, 0.08); box-shadow: var(--glow-magenta); }

/* Route wipe used for section-to-section transitions */
.route {
  position: fixed; inset: 0; z-index: 850; pointer-events: none;
  display: grid; place-items: center;
  background:
    repeating-linear-gradient(90deg, rgba(34, 230, 255, 0.06) 0 1px, transparent 1px 48px),
    rgba(3, 5, 11, 0.92);
  clip-path: inset(0 100% 0 0);
}
.route span { font: 600 clamp(14px, 2vw, 18px) var(--mono); color: var(--cyan); letter-spacing: 0.12em; text-shadow: var(--glow-cyan); }
.route.is-in { animation: route-in 0.32s var(--ease) forwards; }
.route.is-out { animation: route-out 0.38s var(--ease) forwards; }
@keyframes route-in { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes route-out { from { clip-path: inset(0 0 0 0); } to { clip-path: inset(0 0 0 100%); } }

/* ---------- 5. HUD header, progress, rail ---------- */
.progress { position: fixed; inset: 0 0 auto; z-index: 700; height: 2px; background: rgba(34, 230, 255, 0.08); }
.progress span {
  display: block; height: 100%; width: 100%; transform-origin: left; transform: scaleX(0);
  background: linear-gradient(90deg, var(--green), var(--cyan), var(--magenta));
  box-shadow: 0 0 12px var(--cyan);
}
.hud {
  position: fixed; inset: 2px 0 auto; z-index: 600;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 14px var(--gutter);
  background: linear-gradient(to bottom, rgba(3, 5, 11, 0.9), rgba(3, 5, 11, 0.55));
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); font-weight: 700; line-height: 1; }
.logo-mark { display: block; width: 32px; height: 32px; border-radius: 50%; box-shadow: 0 0 14px rgba(34, 230, 255, 0.5), 0 0 0 1px var(--line-strong); }
.logo-path { display: inline-block; color: var(--soft); font-weight: 500; font-size: 15px; }
.hud-nav { display: flex; gap: 6px; font-family: var(--mono); font-size: 13px; }
.hud-nav a { position: relative; padding: 6px 12px; color: var(--soft); border-radius: 6px; transition: color 0.2s, background-color 0.2s; }
.hud-nav a::before { content: '/'; color: var(--faint); margin-right: 2px; }
.hud-nav a:hover, .hud-nav a.is-active { color: var(--cyan); background: rgba(34, 230, 255, 0.08); }
.hud-nav a.is-active::after {
  content: ''; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 1px; background: var(--cyan); box-shadow: var(--glow-cyan);
}
.hud-status { display: flex; align-items: center; gap: 16px; font-size: 12px; color: var(--soft); }
.lock { display: inline-flex; align-items: center; gap: 6px; color: var(--green); }
.lock i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: var(--glow-green); animation: blink 2s infinite; }
.menu-toggle { display: none; width: 40px; height: 40px; border: 1px solid var(--line-strong); border-radius: 8px; position: relative; }
.menu-toggle span { position: absolute; left: 11px; right: 11px; height: 2px; background: var(--cyan); transition: transform 0.3s var(--ease); }
.menu-toggle span:first-child { top: 15px; } .menu-toggle span:last-child { top: 23px; }
.menu-toggle[aria-expanded='true'] span:first-child { transform: translateY(4px) rotate(45deg); }
.menu-toggle[aria-expanded='true'] span:last-child { transform: translateY(-4px) rotate(-45deg); }
.mobile-nav {
  position: fixed; inset: 70px 0 auto; z-index: 590; display: grid; gap: 2px; padding: 12px var(--gutter) 20px;
  background: var(--glass-strong); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line-strong);
  font-family: var(--mono); font-size: 18px;
}
.mobile-nav[hidden] { display: none; }
.mobile-nav a { padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--soft); }
.mobile-nav a:hover { color: var(--cyan); }

.rail { position: fixed; right: 18px; top: 50%; z-index: 500; display: grid; gap: 14px; transform: translateY(-50%); }
.rail a { display: grid; place-items: center; width: 26px; height: 26px; }
.rail a span {
  font: 10px var(--mono); color: transparent; width: 8px; height: 8px; border: 1px solid var(--faint);
  transform: rotate(45deg); transition: all 0.3s var(--ease); display: grid; place-items: center; overflow: hidden;
}
.rail a:hover span, .rail a.is-active span { border-color: var(--cyan); background: var(--cyan); box-shadow: var(--glow-cyan); }
.rail a.is-active span { width: 12px; height: 12px; }

/* ---------- 6. Shared building blocks ---------- */
main { position: relative; z-index: 2; }
.section { position: relative; max-width: var(--max); margin: 0 auto; padding: clamp(96px, 14vw, 170px) var(--gutter) 0; }
.section-head { max-width: 760px; margin-bottom: clamp(36px, 5vw, 60px); }
.section-tag { font-size: 13px; color: var(--green); letter-spacing: 0.08em; text-shadow: 0 0 10px rgba(61, 255, 138, 0.45); }
.section-head h2 {
  margin-top: 10px; font-size: clamp(36px, 6vw, 72px); font-weight: 800; line-height: 1; letter-spacing: -0.035em;
  background: linear-gradient(100deg, #fff 30%, var(--cyan) 70%, var(--magenta));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.section-sub { margin-top: 16px; color: var(--soft); font-size: 17px; max-width: 58ch; }

.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 16px;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 20px 60px -30px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* Neon border: a rotating conic gradient revealed on hover */
.neon { position: relative; isolation: isolate; }
.neon::before {
  content: ''; position: absolute; inset: -1px; z-index: -1; border-radius: inherit; padding: 1px;
  background: conic-gradient(from var(--angle, 0deg), var(--cyan), var(--magenta), var(--green), var(--cyan));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity 0.35s var(--ease);
  animation: spin-angle 4s linear infinite;
}
.neon:hover::before, .neon:focus-within::before { opacity: 1; }
@property --angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@keyframes spin-angle { to { --angle: 360deg; } }

.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  height: 50px; padding: 0 24px; border-radius: 10px;
  font: 600 14px var(--mono); letter-spacing: 0.02em;
  transition: box-shadow 0.3s var(--ease), background-color 0.3s, color 0.3s, border-color 0.3s;
  will-change: transform;
}
.btn span { pointer-events: none; display: inline-block; transition: transform 0.2s var(--ease); }
.btn-primary { background: var(--cyan); color: #00131a; box-shadow: 0 0 0 rgba(34, 230, 255, 0); }
.btn-primary:hover { box-shadow: 0 0 30px rgba(34, 230, 255, 0.6), 0 0 80px rgba(34, 230, 255, 0.25); }
.btn-ghost { border: 1px solid var(--line-strong); color: var(--text); background: rgba(34, 230, 255, 0.04); }
.btn-ghost:hover { border-color: var(--magenta); color: var(--magenta); box-shadow: var(--glow-magenta); }
.btn:active span { transform: scale(0.96); }

.circuit { position: absolute; pointer-events: none; fill: none; stroke: rgba(34, 230, 255, 0.22); stroke-width: 1; }
.circuit circle { fill: var(--cyan); stroke: none; filter: drop-shadow(0 0 4px var(--cyan)); }
.circuit path { stroke-dasharray: 900; stroke-dashoffset: 900; animation: trace 6s var(--ease) forwards; }
@keyframes trace { to { stroke-dashoffset: 0; } }

/* Scroll reveal */
.reveal { opacity: 0; transform: translate3d(0, 36px, 0); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- 7. Hero ---------- */
.hero {
  position: relative; height: 100svh; min-height: 600px; max-width: 1440px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center;
  column-gap: 24px; padding: clamp(80px, 11vh, 104px) var(--gutter) clamp(52px, 8vh, 72px);
}
.circuit-hero { inset: 0; width: 100%; height: 100%; opacity: 0.8; }
.hero-copy { position: relative; z-index: 2; }

/* Dossier: the portrait presented as an operator ID card */
.dossier {
  display: grid; grid-template-columns: clamp(132px, 15vh, 168px) minmax(0, 1fr); gap: 20px; align-items: center;
  margin: 0 0 clamp(16px, 2.6vh, 26px); padding: 14px; max-width: 540px;
  background: var(--glass); border: 1px solid var(--line-strong); border-radius: 16px;
  backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 24px 60px -34px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.dossier-photo {
  position: relative; width: 100%; aspect-ratio: 1244 / 1599; flex: none; border-radius: 10px; overflow: hidden;
  background: linear-gradient(135deg, rgba(34, 230, 255, 0.25), rgba(61, 255, 138, 0.22));
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
/* aspect-ratio matches the photo (1244×1599), so object-fit never distorts it */
.dossier-photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; filter: grayscale(1) contrast(1.05); transition: filter 0.6s var(--ease); }
.dossier:hover .dossier-photo img { filter: grayscale(0.1) contrast(1.05); }
/* Duotone wash: cyan shadows, magenta highlights, lifted on hover */
.dossier-duo {
  position: absolute; inset: 0; pointer-events: none; mix-blend-mode: color; opacity: 0.55;
  background: linear-gradient(145deg, #22e6ff 0%, #6a4bff 55%, #ff2bd6 100%); transition: opacity 0.6s var(--ease);
}
.dossier:hover .dossier-duo { opacity: 0.2; }
.dossier-photo.is-fallback { display: grid; place-items: center; }
.dossier-photo.is-fallback img, .dossier-photo.is-fallback .dossier-duo { display: none; }
.dossier-photo.is-fallback::after { content: 'NH'; font: 700 44px var(--mono); color: var(--cyan); text-shadow: var(--glow-cyan); }
.dossier-scan {
  position: absolute; left: 0; right: 0; top: 0; height: 26%; pointer-events: none;
  background: linear-gradient(to bottom, rgba(34, 230, 255, 0.5), transparent);
  box-shadow: 0 0 16px rgba(34, 230, 255, 0.7); animation: scan 3.4s var(--ease) infinite;
}
@keyframes scan { 0%, 100% { transform: translateY(-30%); opacity: 0; } 15% { opacity: 1; } 55% { transform: translateY(380%); opacity: 1; } 75% { opacity: 0; } }
.dossier-reticle { position: absolute; inset: 0; pointer-events: none; opacity: 0.5; }
.dossier-reticle i { position: absolute; background: rgba(34, 230, 255, 0.5); }
.dossier-reticle i:first-child { left: 50%; top: 0; bottom: 0; width: 1px; }
.dossier-reticle i:last-child { top: 50%; left: 0; right: 0; height: 1px; }
.dossier-photo .corner { position: absolute; width: 12px; height: 12px; border: 2px solid var(--cyan); }
.dossier-photo .tl { top: 5px; left: 5px; border-right: 0; border-bottom: 0; }
.dossier-photo .tr { top: 5px; right: 5px; border-left: 0; border-bottom: 0; }
.dossier-photo .bl { bottom: 5px; left: 5px; border-right: 0; border-top: 0; }
.dossier-photo .br { bottom: 5px; right: 5px; border-left: 0; border-top: 0; }
.dossier-data { display: flex; flex-direction: column; justify-content: center; gap: 10px; font-size: 11.5px; min-width: 0; }
.dossier-data .eyebrow { margin: 0; font-size: 11px; }
.dossier-data dl { display: grid; gap: 6px; margin: 0; }
.dossier-data dl div { display: grid; grid-template-columns: 66px minmax(0, 1fr); gap: 8px; align-items: baseline; padding-bottom: 6px; border-bottom: 1px dashed var(--line); }
.dossier-data dl div:last-child { border-bottom: 0; padding-bottom: 0; }
.dossier-data dt { color: var(--faint); letter-spacing: 0.08em; }
.dossier-data dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.dossier-data .verified { color: var(--green); }
.dossier-status { display: flex; align-items: center; gap: 8px; color: var(--green); letter-spacing: 0.06em; font-size: 10.5px; }
.pulse-sm { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: var(--glow-green); animation: blink 1.4s infinite; flex: none; }

.eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--green); }
.blink-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: var(--glow-green); animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: 0.25; } }

.hero-title { margin: clamp(10px, 1.6vh, 18px) 0 clamp(8px, 1.2vh, 14px); font-size: clamp(44px, min(8vw, 11vh), 104px); font-weight: 800; line-height: 0.9; letter-spacing: -0.045em; }
/* Glitch: two clipped copies of the text jitter in cyan and magenta */
.glitch { position: relative; display: inline-block; color: #f4fbff; text-shadow: 0 0 30px rgba(34, 230, 255, 0.25); }
.glitch::before, .glitch::after {
  content: attr(data-text); position: absolute; inset: 0; pointer-events: none;
}
.glitch::before { color: var(--cyan); transform: translate(-2px, 0); clip-path: inset(0 0 100% 0); mix-blend-mode: screen; animation: glitch-a 4.5s infinite steps(1); }
.glitch::after { color: var(--magenta); transform: translate(2px, 0); clip-path: inset(100% 0 0 0); mix-blend-mode: screen; animation: glitch-b 4.5s infinite steps(1); }
@keyframes glitch-a {
  0%, 86%, 100% { clip-path: inset(0 0 100% 0); }
  87% { clip-path: inset(10% 0 62% 0); transform: translate(-4px, -1px); }
  89% { clip-path: inset(48% 0 30% 0); transform: translate(3px, 1px); }
  91% { clip-path: inset(75% 0 8% 0); transform: translate(-2px, 0); }
}
@keyframes glitch-b {
  0%, 86%, 100% { clip-path: inset(100% 0 0 0); }
  88% { clip-path: inset(30% 0 50% 0); transform: translate(4px, 1px); }
  90% { clip-path: inset(62% 0 18% 0); transform: translate(-3px, -1px); }
  92% { clip-path: inset(5% 0 80% 0); transform: translate(2px, 0); }
}
.glitch.is-hot::before, .glitch.is-hot::after { animation-duration: 0.6s; }

.hero-role { display: flex; align-items: center; gap: 10px; min-height: 1.6em; font-size: clamp(18px, 2.2vw, 26px); color: var(--cyan); text-shadow: 0 0 12px rgba(34, 230, 255, 0.55); }
.prompt { color: var(--magenta); text-shadow: var(--glow-magenta); }
.caret { color: var(--green); animation: blink 0.9s steps(1) infinite; font-size: 0.85em; }
.hero-lede { margin-top: clamp(12px, 1.8vh, 20px); max-width: 52ch; font-size: clamp(15px, 1.3vw, 18px); color: var(--soft); }
.hero-lede strong { color: var(--text); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: clamp(18px, 2.8vh, 32px); }

.globe-wrap { position: relative; z-index: 1; aspect-ratio: 1; width: 100%; max-width: min(620px, 62vh); justify-self: center; }
.globe { position: absolute; inset: 0; }
.globe canvas { display: block; width: 100% !important; height: 100% !important; }
.globe.is-fallback {
  border-radius: 50%; margin: 12%;
  background:
    repeating-radial-gradient(circle at 50% 50%, transparent 0 22px, rgba(255, 255, 255, 0.16) 22px 23px),
    repeating-linear-gradient(90deg, transparent 0 30px, rgba(255, 255, 255, 0.1) 30px 31px);
  box-shadow: inset 0 0 80px rgba(255, 255, 255, 0.18), 0 0 70px rgba(255, 255, 255, 0.12);
}
.globe-hud { position: absolute; inset: 0; pointer-events: none; font-size: 11px; color: rgba(215, 230, 245, 0.7); }
.gh-top { position: absolute; top: 4%; left: 0; right: 0; display: flex; justify-content: space-between; letter-spacing: 0.14em; }
.live { display: inline-flex; align-items: center; gap: 6px; color: #e9f2fb; }
.live i { width: 6px; height: 6px; border-radius: 50%; background: #e9f2fb; box-shadow: 0 0 10px rgba(255, 255, 255, 0.7); animation: blink 1s infinite; }
.gh-stats { position: absolute; left: 0; bottom: 6%; display: grid; gap: 10px; }
.gh-stats b { display: block; font-size: 18px; color: #f2f7fc; text-shadow: 0 0 12px rgba(255, 255, 255, 0.4); font-weight: 500; }
.gh-stats small { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.gh-feed { position: absolute; right: 0; bottom: 6%; display: grid; gap: 4px; text-align: right; width: 230px; }
.gh-feed li { color: rgba(215, 230, 245, 0.7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: feed-in 0.5s var(--ease); }
.gh-feed li b { color: #f2f7fc; font-weight: 500; }
@keyframes feed-in { from { opacity: 0; transform: translateX(12px); } }

.scroll-cue { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); font-size: 12px; color: var(--faint); letter-spacing: 0.1em; animation: bob 2.4s var(--ease) infinite; }
.scroll-cue:hover { color: var(--cyan); }
@keyframes bob { 50% { transform: translate(-50%, 6px); } }

/* ---------- 8. Ops: terminal + counters ---------- */
.ops-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 24px; align-items: stretch; }
.terminal { display: flex; flex-direction: column; overflow: hidden; min-height: 440px; border-color: rgba(61, 255, 138, 0.22); }
.term-bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: rgba(0, 0, 0, 0.3); }
.dots { display: flex; gap: 6px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; }
.dots i:nth-child(2) { background: #febc2e; } .dots i:nth-child(3) { background: #28c840; }
.term-title { flex: 1; font-size: 12px; color: var(--soft); text-align: center; }
.term-mode { font-size: 10px; padding: 2px 8px; border: 1px solid var(--green); color: var(--green); border-radius: 4px; letter-spacing: 0.1em; }
.term-mode.is-live { border-color: var(--magenta); color: var(--magenta); }
.term-body {
  flex: 1; padding: 16px 18px 8px; font-size: 13.5px; line-height: 1.7; color: #c8f7d8; overflow-y: auto; max-height: 420px;
  text-shadow: 0 0 6px rgba(61, 255, 138, 0.25);
}
.term-body .line { white-space: pre-wrap; word-break: break-word; }
.term-body .cmd { color: var(--text); }
.term-body .cmd .ps1 { color: var(--green); }
.term-body .ok { color: var(--green); }
.term-body .err { color: var(--magenta); }
.term-body .dim { color: var(--faint); }
.term-body .c { color: var(--cyan); }
.term-body a { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; }
.term-input { display: flex; align-items: center; gap: 10px; padding: 12px 18px 16px; font-size: 13.5px; border-top: 1px dashed var(--line); }
.ps1 { color: var(--green); white-space: nowrap; }
.term-input input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; color: var(--text); caret-color: var(--green); }
.term-input input::placeholder { color: var(--faint); }
.term-input:focus-within { background: rgba(61, 255, 138, 0.04); }

.counters { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.counter { padding: 22px; display: flex; flex-direction: column; justify-content: space-between; gap: 18px; min-height: 160px; }
.counter b {
  font: 700 clamp(40px, 4.4vw, 58px) var(--mono); letter-spacing: -0.04em; line-height: 1;
  color: var(--cyan); text-shadow: var(--glow-cyan);
}
.counter:nth-child(2) b { color: var(--green); text-shadow: var(--glow-green); }
.counter:nth-child(3) b { color: var(--magenta); text-shadow: var(--glow-magenta); }
.counter span { color: var(--soft); font-size: 14px; }
.counter .bar { height: 2px; background: var(--line); overflow: hidden; }
.counter .bar i { display: block; height: 100%; width: 0; background: currentColor; transition: width 1.6s var(--ease); }
.counter.is-visible .bar i { width: 100%; }

/* ---------- 9. Projects ---------- */
.hexfield {
  position: absolute; inset: 60px 0 0; z-index: -1; pointer-events: none; opacity: 0.5;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='56' height='97' viewBox='0 0 56 97'><path d='M28 0 L56 16 V48 L28 64 L0 48 V16 Z M28 64 V97' fill='none' stroke='%2322e6ff' stroke-opacity='0.12'/></svg>");
  mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 70%);
}
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.filters button {
  padding: 8px 14px; font-size: 13px; color: var(--soft); border: 1px solid var(--line); border-radius: 8px;
  background: rgba(34, 230, 255, 0.03); transition: all 0.25s var(--ease);
}
.filters button:hover { color: var(--cyan); border-color: var(--line-strong); }
.filters button[aria-pressed='true'] { color: #00131a; background: var(--cyan); border-color: var(--cyan); box-shadow: var(--glow-cyan); }
.filters button .n { opacity: 0.6; margin-left: 6px; }

.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 18px; perspective: 1200px; }
.pcard {
  --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 50%;
  position: relative; display: flex; flex-direction: column; min-height: 320px; padding: 24px;
  transform: rotateX(var(--rx)) rotateY(var(--ry)); transform-style: preserve-3d;
  transition: transform 0.4s var(--ease), border-color 0.3s, box-shadow 0.3s;
}
.pcard::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(400px circle at var(--mx) var(--my), rgba(34, 230, 255, 0.12), transparent 40%);
  opacity: 0; transition: opacity 0.3s;
}
.pcard:hover::after { opacity: 1; }
.pcard:hover { box-shadow: 0 30px 80px -30px rgba(34, 230, 255, 0.35); }
.pcard.is-hidden { display: none; }
.pcard-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; }
.classif { padding: 3px 8px; border: 1px solid currentColor; border-radius: 4px; color: var(--magenta); }
.pcard[data-cat='AI'] .classif { color: var(--cyan); }
.pcard[data-cat='Games'] .classif { color: var(--amber); }
.pcard[data-cat='Products'] .classif { color: var(--green); }
.fileno { color: var(--faint); }
.pcard h3 { margin: 26px 0 10px; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; transform: translateZ(30px); }
.pcard h3 .scramble { display: inline-block; }
.pcard p { color: var(--soft); font-size: 15px; transform: translateZ(20px); }
.pcard .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.tags li { font: 11.5px var(--mono); padding: 3px 8px; border-radius: 5px; color: var(--cyan); background: rgba(34, 230, 255, 0.08); border: 1px solid rgba(34, 230, 255, 0.18); }
.pcard-foot { margin-top: auto; padding-top: 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font: 12px var(--mono); color: var(--faint); }
.pcard-foot .metric { color: var(--green); }
.open-file { font: 600 12px var(--mono); color: var(--cyan); padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 6px; transition: all 0.2s; }
.open-file:hover { background: var(--cyan); color: #00131a; }
.pcard-detail { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.45s var(--ease); }
.pcard-detail > div { overflow: hidden; }
.pcard.is-open .pcard-detail { grid-template-rows: 1fr; }
.pcard-detail p { padding-top: 16px; margin-top: 16px; border-top: 1px dashed var(--line-strong); color: var(--text); font-size: 14.5px; }
.pcard-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.pcard-links a { font: 12px var(--mono); padding: 6px 10px; border-radius: 6px; border: 1px solid var(--line-strong); color: var(--text); transition: all 0.2s; }
.pcard-links a:hover { border-color: var(--green); color: var(--green); box-shadow: var(--glow-green); }

.archive { margin-top: 40px; padding: 20px 24px; }
.archive h3 { font-size: 13px; color: var(--green); font-weight: 500; margin-bottom: 8px; }
.archive li a {
  display: grid; grid-template-columns: 210px minmax(0, 1fr) 80px 60px; gap: 16px; align-items: baseline;
  padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; transition: color 0.2s, padding 0.3s var(--ease);
}
.archive li:last-child a { border-bottom: 0; }
.archive li a:hover { color: var(--cyan); padding-left: 10px; }
.archive .a-name { font-family: var(--mono); }
.archive .a-name::before { content: '-rw-r--r-- '; color: var(--faint); }
.archive .a-note { color: var(--soft); }
.archive .a-lang, .archive .a-stars { font: 12px var(--mono); color: var(--faint); text-align: right; }
.archive .a-stars { color: var(--amber); }

/* ---------- 10. Arsenal ---------- */
.cap-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.flip { perspective: 1200px; min-height: 280px; }
.flip-inner {
  position: relative; width: 100%; height: 100%; min-height: 280px; display: block; text-align: left;
  transform-style: preserve-3d; transition: transform 0.8s var(--ease); border-radius: 16px;
}
.flip.is-flipped .flip-inner { transform: rotateY(180deg); }
/* Each face carries its own glass look; the inner stays a plain 3D container
   so backdrop-filter never flattens the preserve-3d context. */
.flip-face { position: absolute; inset: 0; padding: 24px; display: flex; flex-direction: column; border-radius: 16px; text-align: left; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flip-back { transform: rotateY(180deg); }
.cap-code {
  font: 700 64px var(--mono); line-height: 1; letter-spacing: -0.05em; color: transparent;
  -webkit-text-stroke: 1px var(--c, var(--cyan)); filter: drop-shadow(0 0 10px var(--c, var(--cyan)));
}
.flip-front h3 { margin-top: auto; font-size: 22px; font-weight: 700; }
.flip-front p { margin-top: 8px; color: var(--soft); font-size: 14.5px; }
.meter { margin-top: 16px; display: flex; align-items: center; gap: 10px; font: 11px var(--mono); color: var(--faint); }
.meter-track { flex: 1; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.meter-track i { display: block; height: 100%; width: 0; background: var(--c, var(--cyan)); box-shadow: 0 0 10px var(--c, var(--cyan)); transition: width 1.4s var(--ease) 0.2s; }
.flip.is-visible .meter-track i { width: var(--lvl); }
.flip-hint { position: absolute; top: 24px; right: 24px; font: 11px var(--mono); color: var(--faint); }
.flip-back h3 { font: 600 13px var(--mono); color: var(--c, var(--cyan)); letter-spacing: 0.08em; }
.flip-back ul { margin-top: 18px; display: grid; gap: 8px; }
.flip-back li { font: 14px var(--mono); color: var(--text); display: flex; gap: 10px; }
.flip-back li::before { content: '›'; color: var(--c, var(--cyan)); }
.flip[data-c='magenta'] { --c: var(--magenta); }
.flip[data-c='green'] { --c: var(--green); }
.flip[data-c='cyan'] { --c: var(--cyan); }

.hex-wrap { margin-top: 64px; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.hex-grid { display: flex; flex-wrap: wrap; justify-content: center; max-width: 920px; padding-bottom: 26px; }
.hex-grid li {
  --s: 104px;
  width: var(--s); height: calc(var(--s) * 1.1547); margin: 3px 3px calc(var(--s) * -0.2887);
  display: grid; place-items: center; text-align: center;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: rgba(34, 230, 255, 0.06);
  font: 500 12.5px var(--mono); color: var(--soft);
  transition: background-color 0.3s, color 0.3s, transform 0.3s var(--ease);
}
.hex-grid li:nth-child(15n + 9) { margin-left: calc(var(--s) * 0.5 + 6px); }
.hex-grid li.sec { --hc: 255, 43, 214; }
.hex-grid li.ai { --hc: 34, 230, 255; }
.hex-grid li.dev { --hc: 61, 255, 138; }
.hex-grid li.ops { --hc: 255, 200, 87; }
.hex-grid li { background: rgba(var(--hc), 0.07); }
.hex-grid li:hover, .hex-grid li.is-lit { background: rgba(var(--hc), 0.85); color: #000; transform: scale(1.06); }
.hex-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; font-size: 12px; color: var(--soft); }
.hex-legend li::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 8px; transform: rotate(45deg); }
.hex-legend .sec::before { background: var(--magenta); } .hex-legend .ai::before { background: var(--cyan); }
.hex-legend .dev::before { background: var(--green); } .hex-legend .ops::before { background: var(--amber); }

/* ---------- 11. Log: timeline + certs ---------- */
.log-layout { position: relative; display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 20px; }
.log-trace { width: 20px; height: 100%; }
.log-trace path { fill: none; stroke: var(--cyan); stroke-width: 2; filter: drop-shadow(0 0 4px var(--cyan)); stroke-dasharray: 1000; stroke-dashoffset: 1000; }
.timeline { display: grid; gap: 18px; }
.entry { position: relative; display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 20px; align-items: start; padding: 22px 24px; }
.entry-main { display: flex; gap: 16px; align-items: flex-start; min-width: 0; }
.entry-text { min-width: 0; }
/* Entries with no logo pad the text so their titles line up with logo'd ones. */
.entry--nologo .entry-main { padding-left: 68px; }
.entry-logo { width: 52px; height: 52px; border-radius: 12px; object-fit: contain; background: rgba(0, 0, 0, 0.25); padding: 4px; transition: transform 0.3s var(--ease); }
.entry:hover .entry-logo { transform: scale(1.06); }
.entry::before {
  content: ''; position: absolute; left: -33px; top: 30px; width: 10px; height: 10px; transform: rotate(45deg);
  background: var(--bg); border: 2px solid var(--cyan); box-shadow: var(--glow-cyan);
}
.entry-when { font: 12px var(--mono); color: var(--green); padding-top: 4px; }
.entry-level { display: inline-block; margin-top: 8px; font: 10px var(--mono); padding: 2px 6px; border-radius: 4px; color: var(--magenta); border: 1px solid rgba(255, 43, 214, 0.4); letter-spacing: 0.1em; }
.entry h3 { font-size: 21px; font-weight: 700; letter-spacing: -0.01em; }
.entry h3 small { display: block; margin-top: 2px; font: 400 14px var(--mono); color: var(--cyan); }
.entry p { margin-top: 8px; color: var(--soft); font-size: 15px; }

.certs-title { margin: 70px 0 20px; font-size: 14px; color: var(--green); font-weight: 500; }
.certs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; perspective: 1000px; }
.cert {
  --rx: 0deg; --ry: 0deg;
  display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 20px; align-items: center; padding: 16px;
  transform: rotateX(var(--rx)) rotateY(var(--ry)); transition: transform 0.4s var(--ease);
}
.cert img { border-radius: 10px; aspect-ratio: 4 / 3; object-fit: cover; filter: saturate(0.7) hue-rotate(-10deg); transition: filter 0.4s; }
.cert:hover img { filter: none; }
.cert-short { font: 700 13px var(--mono); color: var(--green); letter-spacing: 0.1em; }
.cert h4 { margin: 4px 0; font-size: 19px; font-weight: 700; }
.cert p { font: 12px var(--mono); color: var(--faint); }
.cert .verify { display: inline-block; margin-top: 10px; font: 11px var(--mono); color: var(--cyan); }

/* ---------- 12. Contact ---------- */
.contact { padding-bottom: 100px; }
.circuit-contact { left: 0; right: 0; top: 40px; height: 300px; width: 100%; opacity: 0.6; }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px; align-items: stretch; }
.channel { padding: 26px; display: grid; gap: 16px; align-content: start; }
.ch-head { margin: 0; font-size: 12.5px; color: var(--green); display: flex; align-items: center; gap: 8px; letter-spacing: 0.04em; }
.ch-check { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; font-size: 13px; }
.ch-check li { display: grid; grid-template-columns: 54px 84px minmax(0, 1fr); gap: 10px; align-items: baseline; color: var(--soft); }
.ch-check b { color: var(--green); font-weight: 500; }
.ch-check li > span { color: var(--text); overflow-wrap: anywhere; }
.ch-sub { margin: 6px 0 0; font-size: 12.5px; color: var(--faint); }
.ch-open { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ch-open li { position: relative; padding-left: 20px; font-size: 14px; color: var(--text); line-height: 1.45; }
.ch-open li::before { content: '▸'; position: absolute; left: 0; color: var(--cyan); font-family: var(--mono); }
#start-chat { justify-self: start; margin-top: 4px; }

.links { display: grid; gap: 14px; }
.email-big {
  font-size: clamp(20px, 2.6vw, 30px); font-weight: 700; color: var(--cyan); text-shadow: var(--glow-cyan);
  overflow-wrap: anywhere; border-bottom: 1px dashed var(--line-strong); padding-bottom: 12px;
}
.email-big:hover { color: #fff; }
.copy { justify-self: start; font-size: 12px; color: var(--soft); }
.copy:hover { color: var(--green); }
.socials { margin-top: 12px; display: grid; gap: 10px; }
.socials a {
  display: grid; grid-template-columns: 1fr auto 20px; gap: 14px; align-items: center; padding: 16px 18px;
  transition: transform 0.3s var(--ease);
}
.socials a:hover { transform: translateX(6px); }
.socials .s-label { font-weight: 600; }
.socials .s-handle { font: 12px var(--mono); color: var(--faint); }
.socials .s-arrow { color: var(--cyan); font-family: var(--mono); }

.footer {
  position: relative; z-index: 2; max-width: var(--max); margin: 0 auto;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  padding: 28px var(--gutter) 40px; border-top: 1px solid var(--line); font-size: 12px; color: var(--soft);
}
.footer a:hover { color: var(--cyan); }

/* ---------- 13. Responsive ---------- */
@media (max-width: 1100px) {
  /* Stacked: let the hero grow with its content instead of a fixed screen height. */
  .hero { grid-template-columns: 1fr; height: auto; min-height: 100svh; padding-top: 110px; row-gap: 20px; }
  .hero-title { font-size: clamp(44px, 12vw, 92px); }
  .globe-wrap { max-width: min(520px, 76vw); order: 2; }
  .ops-grid { grid-template-columns: 1fr; }
  .counters { grid-template-columns: repeat(4, 1fr); }
  .cap-grid { grid-template-columns: repeat(2, 1fr); }
  .rail { display: none; }
}
@media (max-width: 860px) {
  .hud-nav, .hud-status time { display: none; }
  .menu-toggle { display: block; }
  .counters { grid-template-columns: 1fr 1fr; }
  .contact-grid, .certs { grid-template-columns: 1fr; }
  .archive li a { grid-template-columns: minmax(0, 1fr) auto; }
  .archive .a-note { grid-column: 1 / -1; grid-row: 2; }
  .archive .a-lang { display: none; }
  .entry { grid-template-columns: 1fr; gap: 12px; }
  .entry-when { display: flex; align-items: center; gap: 10px; }
  .entry-logo { width: 44px; height: 44px; }
  .entry--nologo .entry-main { padding-left: 0; }
  .gh-feed { display: none; }
}
@media (max-width: 600px) {
  .hud-status { display: none; }
  .cap-grid { grid-template-columns: 1fr; }
  .hex-grid li { --s: 78px; font-size: 11px; }
  .hex-grid li:nth-child(15n + 9) { margin-left: 3px; }
  .cert { grid-template-columns: 110px minmax(0, 1fr); }
  .term-body { font-size: 12px; }
  .term-input { font-size: 12px; }
  .ps1 { display: none; }
  .term-input::before { content: '$'; color: var(--green); }
  .log-layout { grid-template-columns: 12px minmax(0, 1fr); gap: 16px; }
  .entry::before { left: -24px; }
  .archive .a-name::before { content: ''; }
  .counter { padding: 18px; min-height: 140px; }
}

/* ---------- 14. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .fx-grain { animation: none; }
  .reveal { opacity: 1; transform: none; }
  .circuit path, .log-trace path { stroke-dashoffset: 0; }
  .glitch::before, .glitch::after { display: none; }
}
