/* ============================================
   CYBERPUNK PORTFOLIO — Bruno Rodriguez
   Stack: vanilla HTML / CSS / JS
   ============================================ */

/* ------- TOKENS ------- */
:root {
  --bg: #050508;
  --bg-1: #0a0a12;
  --bg-2: #10101c;
  --line: #1c1c2a;
  --line-2: #2a2a3d;
  --text: #e6e9f2;
  --text-dim: #8a8fa3;
  --text-faint: #5a5f73;

  --cyan: #00f5ff;
  --cyan-soft: rgba(0, 245, 255, 0.55);
  --cyan-dim: rgba(0, 245, 255, 0.18);
  --cyan-glow: rgba(0, 245, 255, 0.35);

  --magenta: #ff0080;
  --magenta-soft: rgba(255, 0, 128, 0.6);
  --magenta-dim: rgba(255, 0, 128, 0.15);

  --amber: #ffb547;
  --green: #4ade80;

  --font-display: 'Space Grotesk', 'Space Mono', ui-monospace, monospace;
  --font-mono: 'JetBrains Mono', 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --maxw: 1280px;
  --pad-x: clamp(20px, 4vw, 64px);

  --ease: cubic-bezier(.2, .8, .2, 1);
  --t: .35s var(--ease);
}

/* ------- RESET ------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body, h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; padding: 0; }
ul { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }

body {
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  cursor: none;
}

/* ------- GLOBAL TEXTURES ------- */
/* fine noise grain over everything */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 1000;
  opacity: .055;
  mix-blend-mode: overlay;
  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='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
/* faint scanlines */
body::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 999;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0) 0,
    rgba(255,255,255,0) 2px,
    rgba(255,255,255,0.018) 3px,
    rgba(255,255,255,0) 4px
  );
}

/* ------- CUSTOM CURSOR ------- */
.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  mix-blend-mode: screen;
}
.cursor-dot {
  width: 6px; height: 6px;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan), 0 0 24px var(--cyan-glow);
  transition: width .2s, height .2s, background .2s;
}
.cursor-ring {
  width: 36px; height: 36px;
  border: 1px solid var(--cyan-soft);
  transition: width .25s var(--ease), height .25s var(--ease), border-color .25s;
}
body.cursor-hover .cursor-dot { width: 10px; height: 10px; background: var(--magenta); box-shadow: 0 0 12px var(--magenta), 0 0 30px var(--magenta-soft); }
body.cursor-hover .cursor-ring { width: 56px; height: 56px; border-color: var(--magenta-soft); }

/* hide cursor on touch or small screens */
@media (hover: none), (max-width: 720px) {
  body { cursor: auto; }
  .cursor-dot, .cursor-ring { display: none; }
}

/* ------- TYPOGRAPHY HELPERS ------- */
.mono { font-family: var(--font-mono); }
.kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.kicker .k-num {
  color: var(--magenta);
  font-weight: 500;
  letter-spacing: .12em;
  text-shadow: 0 0 12px rgba(255, 0, 128, .35);
}
.kicker::before {
  content: "";
  width: 24px; height: 1px;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan-glow);
}
h2.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.02;
  letter-spacing: -.02em;
  margin-top: 18px;
  color: var(--text);
}
h2.section-title em {
  font-style: normal;
  background: linear-gradient(110deg, var(--cyan), #b6f6ff 50%, var(--magenta));
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}

/* ------- LAYOUT WRAPPER ------- */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
}
section {
  position: relative;
  padding: clamp(80px, 12vh, 140px) 0;
}
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 56px;
  flex-wrap: wrap;
}
.section-head .meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  letter-spacing: .1em;
  white-space: nowrap;
}
.section-head .meta b { color: var(--magenta); font-weight: 500; }

/* ------- NAVBAR ------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 16px var(--pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(to bottom, rgba(5,5,8,.7), rgba(5,5,8,.2));
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: background .3s, border-color .3s, padding .3s;
}
.nav.scrolled {
  background: rgba(5,5,8,.85);
  border-bottom-color: var(--cyan-dim);
  padding-top: 12px; padding-bottom: 12px;
  box-shadow: 0 1px 0 0 rgba(0, 245, 255, 0.08), 0 8px 30px rgba(0,0,0,.4);
}
.nav-brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -.01em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  position: relative;
}
.nav-brand .bracket { color: var(--cyan); font-family: var(--font-mono); font-weight: 400; }
.nav-brand .glitch {
  position: relative;
  display: inline-block;
}
.nav-brand:hover .glitch { animation: glitch 600ms steps(2, end); }
.nav-brand:hover .glitch::before,
.nav-brand:hover .glitch::after { opacity: 1; }
.nav-brand .glitch::before,
.nav-brand .glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}
.nav-brand .glitch::before { color: var(--cyan); transform: translate(-1.5px, 0); mix-blend-mode: screen; }
.nav-brand .glitch::after  { color: var(--magenta); transform: translate( 1.5px, 0); mix-blend-mode: screen; }
@keyframes glitch {
  0%   { transform: translate(0,0); }
  20%  { transform: translate(-1px, 1px); }
  40%  { transform: translate(1px, -1px); }
  60%  { transform: translate(-1px, 0); }
  80%  { transform: translate(1px, 1px); }
  100% { transform: translate(0,0); }
}
.nav-links {
  display: flex;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 13px;
  align-items: center;
}
.nav-links a {
  padding: 8px 14px;
  border-radius: 6px;
  color: var(--text-dim);
  letter-spacing: .02em;
  transition: color var(--t), background var(--t);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.nav-links a .idx { color: var(--text-faint); font-size: 11px; }
.nav-links a:hover { color: var(--text); background: rgba(255,255,255,.04); }
.nav-links a:hover .idx { color: var(--cyan); }
.nav-cta {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 9px 16px;
  border: 1px solid var(--cyan-dim);
  color: var(--cyan);
  border-radius: 4px;
  letter-spacing: .08em;
  text-transform: uppercase;
  transition: all var(--t);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.nav-cta::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse 1.8s infinite;
}
.nav-cta:hover { background: var(--cyan-dim); border-color: var(--cyan-soft); }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}
.nav-menu-btn { display: none; }

/* ------- HERO ------- */
.hero {
  /* Horizon-anchored hero. Height is content-driven, not viewport-locked.
     Layout zones (top → bottom):
     - Navbar (fixed, outside hero)
     - Top ribbon (absolute, below navbar)
     - Sky / content area (flows normally)
     - Horizon line (absolute, sits at top edge of HUD)
     - HUD bar (NORMAL FLOW — anchors the bottom)
     - Grid floor (absolute, fills space behind HUD + a bit above) */
  --ribbon-h: 44px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(0, 80, 110, .35) 0%, transparent 60%),
    radial-gradient(ellipse 60% 60% at 50% 100%, rgba(0, 60, 90, .25) 0%, transparent 70%),
    linear-gradient(to bottom, #060611 0%, var(--bg) 40%, #030308 100%);
}

/* Film grain — fine noise texture, adds tactile depth without color */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
  mix-blend-mode: overlay;
}
/* Scanline sweep — single bright line drifts slowly down, reinforces HUD/CRT aesthetic */
.hero::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 1px;
  background: linear-gradient(to right,
    transparent 0%,
    rgba(0, 245, 255, .06) 15%,
    rgba(0, 245, 255, .18) 50%,
    rgba(0, 245, 255, .06) 85%,
    transparent 100%);
  z-index: 11;
  pointer-events: none;
  animation: heroScan 12s ease-in-out 3s infinite;
}
@keyframes heroScan {
  0%   { transform: translateY(0); opacity: 0; }
  5%   { opacity: 1; }
  95%  { opacity: 1; }
  100% { transform: translateY(100vh); opacity: 0; }
}

/* ---------- HERO STAGE (perf-friendly grid scene) ---------- */
.hero-stage {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  contain: layout paint style;
}

/* The receding floor — single GPU-composited layer.
   Sits BEHIND the HUD bar, extending up past the horizon for the perspective effect. */
.grid-floor {
  position: absolute;
  bottom: 0; left: 50%;
  width: 260%;
  height: 220px; /* fixed, predictable — matches HUD+buffer area */
  transform: translate3d(-50%, 0, 0) perspective(700px) rotateX(58deg);
  transform-origin: 50% 0%;
  background-image:
    linear-gradient(to right, rgba(0, 245, 255, .38) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 245, 255, .38) 1px, transparent 1px),
    linear-gradient(to right, rgba(0, 245, 255, .12) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 245, 255, .12) 1px, transparent 1px);
  background-size: 160px 160px, 160px 160px, 40px 40px, 40px 40px;
  -webkit-mask-image: linear-gradient(to bottom,
    #000 0%, #000 40%,
    rgba(0,0,0,.7) 70%,
    transparent 100%);
          mask-image: linear-gradient(to bottom,
    #000 0%, #000 40%,
    rgba(0,0,0,.7) 70%,
    transparent 100%);
  animation: gridScroll 10s linear infinite;
  will-change: background-position;
}
@keyframes gridScroll {
  from { background-position: 0 0, 0 0, 0 0, 0 0; }
  to   { background-position: 0 160px, 0 160px, 0 40px, 0 40px; }
}

/* Sky particles canvas — sits above the HUD area */
.sky-canvas {
  position: absolute;
  left: 0; right: 0; top: 0; bottom: 70px;
  width: 100%;
  display: block;
  z-index: 1;
  pointer-events: none;
}

/* Horizon — crisp glowing line, anchored at the top edge of the HUD bar */
.horizon-line {
  position: absolute;
  left: 0; right: 0;
  bottom: 70px; /* sits at HUD top */
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(0, 245, 255, .25) 12%,
    rgba(0, 245, 255, .95) 45%,
    rgba(180, 250, 255, 1) 50%,
    rgba(0, 245, 255, .95) 55%,
    rgba(255, 0, 128, .35) 80%,
    transparent 100%);
  box-shadow:
    0 0 12px rgba(0, 245, 255, .7),
    0 0 36px rgba(0, 245, 255, .35);
  z-index: 2;
}
/* Soft haze JUST above the horizon — atmosphere/depth */
.horizon-haze {
  position: absolute;
  left: 0; right: 0;
  bottom: 70px;
  height: 140px;
  transform: translateY(0);
  background: linear-gradient(to top,
    rgba(0, 245, 255, .14) 0%,
    rgba(0, 245, 255, .04) 60%,
    transparent 100%);
  z-index: 1;
  pointer-events: none;
}
/* Sky dome glow — anchored to horizon */
.sky-glow {
  position: absolute;
  left: 50%;
  bottom: 70px;
  width: 75%;
  height: 380px;
  transform: translate(-50%, 0);
  /* Gradient soft enough without filter:blur (blur on a large element
     forces an expensive GPU rasterization pass every composite frame) */
  background: radial-gradient(ellipse at 50% 100%,
    rgba(0, 245, 255, .16) 0%,
    rgba(0, 245, 255, .07) 25%,
    rgba(120, 80, 255, .05) 50%,
    transparent 75%);
  z-index: 1;
  pointer-events: none;
}

/* Pulsing data points — placed on the grid floor (below horizon) */
.grid-dots {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 220px;
  z-index: 2;
  pointer-events: none;
}
.grid-dots span {
  position: absolute;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan), 0 0 18px rgba(0, 245, 255, .5);
  opacity: 0;
  animation: pulseDot 4.5s ease-in-out infinite;
}
.grid-dots span:nth-child(1) { top: 20%; left: 18%; animation-delay: 0s; }
.grid-dots span:nth-child(2) { top: 38%; left: 72%; animation-delay: 1.4s; background: #ff5fb0; box-shadow: 0 0 8px #ff5fb0, 0 0 18px rgba(255, 0, 128, .5); }
.grid-dots span:nth-child(3) { top: 28%; left: 44%; animation-delay: 2.6s; }
.grid-dots span:nth-child(4) { top: 50%; left: 28%; animation-delay: 3.4s; }
.grid-dots span:nth-child(5) { top: 16%; left: 86%; animation-delay: 0.7s; }
@keyframes pulseDot {
  0%, 100% { opacity: 0; transform: scale(.6); }
  45% { opacity: 1; transform: scale(1); }
  70% { opacity: .15; transform: scale(.9); }
}

/* HUD corner brackets — premium framing detail */
.hero-ribbon {
  position: absolute;
  top: 72px;
  left: 0; right: 0;
  z-index: 4;
  height: var(--ribbon-h);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(to right, transparent, rgba(0, 245, 255, .04), transparent);
  display: flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .15em;
  color: var(--text-faint);
  text-transform: uppercase;
}
.hero-ribbon .hr-cell {
  padding: 0 var(--pad-x);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.hero-ribbon .hr-mid {
  flex: 1;
  justify-content: center;
  color: var(--cyan);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}
.hero-ribbon .hr-right {
  margin-left: auto;
  color: var(--text-dim);
}
.hero-ribbon .dot {
  color: var(--green);
  font-size: 8px;
  animation: pulse 1.8s infinite;
}

/* Left + right rails — vertical rotated framing */
.hero-rail {
  position: absolute;
  top: calc(72px + var(--ribbon-h));
  bottom: 0;
  width: 32px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}
.hero-rail-l { left: 0; }
.hero-rail-r { right: 0; }
.hero-rail .rail-line {
  width: 1px;
  flex: 1;
  background: linear-gradient(to bottom, transparent, var(--line) 20%, var(--line) 80%, transparent);
}
.hero-rail .rail-text {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .3em;
  color: var(--text-faint);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  padding: 16px 0;
  white-space: nowrap;
}
.hero-rail-l .rail-text { transform: rotate(180deg); }
.hero-rail .rail-blink { color: var(--cyan); animation: blink 2.4s ease-in-out infinite; }
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

/* Subtle mouse-follow accent */
.hero .hero-spot {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(circle 320px at var(--mx, 50%) var(--my, 50%),
    rgba(0, 245, 255, 0.08) 0%,
    transparent 60%);
  mix-blend-mode: screen;
  transition: opacity .5s;
  opacity: 0;
}
.hero:hover .hero-spot { opacity: 1; }

.hero .vignette {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 95% 60% at 50% 35%, transparent 30%, rgba(5,5,8,.4) 85%, var(--bg) 100%);
  pointer-events: none;
  z-index: 1;
}

/* Hero content wrap — normal flow, content-driven height */
.hero .hero-wrap {
  position: relative;
  z-index: 3;
  padding-top: calc(72px + var(--ribbon-h) + 48px);
  padding-bottom: 64px;
  padding-left: calc(var(--pad-x) + 56px);
  padding-right: calc(var(--pad-x) + 56px);
}
.hero-content {
  max-width: 900px;
}
/* Kicker as UI chip inside the hero — more badge-like, distinguishes it from section kickers */
.hero-content .kicker {
  border: 1px solid rgba(0, 245, 255, .2);
  padding: 5px 14px 5px 8px;
  border-radius: 2px;
  background: rgba(0, 245, 255, .04);
  box-shadow: inset 0 0 12px rgba(0, 245, 255, .04), 0 0 0 1px rgba(0,0,0,.4);
}
.hero-content .kicker::before { display: none; } /* border replaces the dash */

/* HUD bar — full-width strip in NORMAL FLOW at the bottom of the hero */
.hero-hud {
  position: relative;
  z-index: 4;
  background: linear-gradient(180deg,
    rgba(5, 5, 12, .85) 0%,
    rgba(5, 5, 12, .65) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid rgba(0, 245, 255, .4);
  border-bottom: 1px solid var(--line);
  box-shadow:
    0 -16px 40px -8px rgba(0, 245, 255, .18),
    0 -2px 0 0 rgba(0, 245, 255, .08);
}
/* Corner brackets — top-left and top-right of the HUD bar */
.hero-hud::before,
.hero-hud::after {
  content: '';
  position: absolute;
  top: -1px;
  width: 12px; height: 12px;
  pointer-events: none;
  border-top: 2px solid var(--cyan);
  box-shadow: 0 0 8px var(--cyan-glow);
}
.hero-hud::before { left: 0;  border-left:  2px solid var(--cyan); }
.hero-hud::after  { right: 0; border-right: 2px solid var(--cyan); }

.hud-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  font-family: var(--font-mono);
}
.hud-cell {
  position: relative;
  padding: 14px clamp(16px, 3vw, 32px);
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-left: 1px solid var(--line);
}
.hud-cell:first-child { border-left: 0; }
.hud-cell::before {
  /* tiny tick mark connecting cell to the horizon */
  content: "";
  position: absolute;
  top: -1px; left: 50%;
  width: 1px; height: 6px;
  background: var(--cyan);
  box-shadow: 0 0 6px var(--cyan-glow);
  transform: translate(-50%, -100%);
  opacity: .5;
}
.hud-cell:first-child::before { display: none; }
.hud-cell:last-child::before { display: none; }

.hud-k {
  font-size: 10px;
  letter-spacing: .2em;
  color: var(--text-faint);
  text-transform: uppercase;
}
.hud-v {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.2vw, 26px);
  color: var(--text);
  line-height: 1;
  letter-spacing: -.01em;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}
.hud-v b { color: var(--magenta); font-weight: 400; text-shadow: 0 0 14px rgba(255, 0, 128, .35); }
.hud-v .hud-plus { color: var(--magenta); font-size: 14px; }
.hud-v-text { font-size: clamp(15px, 1.4vw, 18px); color: var(--text); }
.hud-v-status { color: var(--green); font-size: clamp(14px, 1.3vw, 16px); text-shadow: 0 0 10px rgba(74, 222, 128, .35); }

@media (prefers-reduced-motion: reduce) {
  .grid-floor, .grid-dots span, .hero-ribbon .dot, .hero-rail .rail-blink { animation: none !important; }
  .grid-dots span { opacity: .9; }
}

@media (max-width: 1020px) {
  .hero .hero-wrap {
    padding-left: calc(var(--pad-x) + 32px);
    padding-right: calc(var(--pad-x) + 32px);
    padding-top: calc(72px + var(--ribbon-h) + 32px);
    padding-bottom: 48px;
  }
}

@media (max-width: 720px) {
  .hero {
    --ribbon-h: 36px;
  }
  .grid-floor {
    height: 180px;
    width: 280%;
    background-size: 128px 128px, 128px 128px, 32px 32px, 32px 32px;
  }
  .horizon-line, .horizon-haze, .sky-glow { bottom: 56px; }
  .sky-canvas { bottom: 56px; }
  .grid-dots { height: 180px; }
  @keyframes gridScroll {
    from { background-position: 0 0, 0 0, 0 0, 0 0; }
    to   { background-position: 0 128px, 0 128px, 0 32px, 0 32px; }
  }
  .hero .hero-wrap {
    padding-left: var(--pad-x);
    padding-right: var(--pad-x);
    padding-top: calc(64px + var(--ribbon-h) + 24px);
    padding-bottom: 36px;
  }
  .hero-ribbon {
    top: 64px;
    font-size: 9px;
    letter-spacing: .1em;
  }
  .hero-ribbon .hr-cell { padding: 0 12px; }
  .hero-ribbon .hr-right { display: none; }
  .hero-rail { display: none; }
  .sky-canvas { display: none; }
  .hero-hud .hud-inner { grid-template-columns: repeat(2, 1fr); }
  .hud-cell { padding: 10px 14px; }
  .hud-cell::before { display: none; }
  .hud-cell:nth-child(3) { border-top: 1px solid var(--line); border-left: 0; }
  .hud-cell:nth-child(4) { border-top: 1px solid var(--line); }
  .hud-k { font-size: 9px; }
  .hud-v { font-size: 18px; }
}

.hero-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(56px, 11vw, 168px);
  line-height: 0; /* kills the phantom whitespace-node line box */
  letter-spacing: -.045em;
  margin: 16px 0 0;
  /* ambient glow — depth without blur jank at large sizes */
  filter: drop-shadow(0 0 48px rgba(0, 245, 255, .12))
          drop-shadow(0 4px 24px rgba(0, 0, 0, .6));
}

/* Bio block with left vertical accent — connects copy to the system */
.hero-bio-block {
  position: relative;
  margin-top: 24px;
  padding-left: 20px;
  max-width: 56ch;
}
.hbb-rail {
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 1px;
  background: linear-gradient(to bottom,
    var(--cyan) 0%,
    var(--cyan-soft) 50%,
    transparent 100%);
  box-shadow: 0 0 8px var(--cyan-glow);
}
.hero-name .line {
  display: block;
  overflow: hidden;
  white-space: nowrap; /* prevents "_" from wrapping to a second line at large font-sizes */
  line-height: .92; /* restored here so glyphs render correctly */
}
.hero-name .line span {
  display: inline-block;
}
.hero-name .holo {
  background: linear-gradient(110deg, #fff, var(--cyan) 35%, #fff 55%, var(--magenta) 85%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  animation: holoShift 8s ease-in-out infinite;
}
@keyframes holoShift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
.hero-name .holo-r {
  background: linear-gradient(110deg, var(--magenta) 10%, #fff 45%, var(--cyan) 80%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  animation: holoShiftR 10s ease-in-out infinite;
}
@keyframes holoShiftR {
  0%, 100% { background-position: 100% 50%; }
  50%      { background-position:   0% 50%; }
}

.hero-typer {
  font-family: var(--font-mono);
  font-size: clamp(15px, 1.6vw, 20px);
  color: var(--text);
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.hero-typer .prompt { color: var(--cyan); }
.hero-typer .role { color: var(--text); min-width: 4ch; }
.hero-typer .caret {
  display: inline-block;
  width: 10px; height: 1.1em;
  background: var(--cyan);
  vertical-align: -0.15em;
  box-shadow: 0 0 8px var(--cyan-glow);
  animation: caret 1s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }

.hero-bio {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-dim);
  margin: 0;
}
.hero-bio .h { color: var(--text); }

.hero-actions {
  display: flex;
  gap: 16px;
  margin-top: 28px;
  flex-wrap: wrap;
}
.btn {
  --bc: var(--cyan);
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text);
  border: 1px solid var(--bc);
  background: transparent;
  border-radius: 2px;
  overflow: hidden;
  transition: color var(--t), border-color var(--t), background var(--t), box-shadow var(--t), transform var(--t);
}
.btn::before {
  /* corner accents */
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px dashed var(--cyan-dim);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--t);
}
.btn:hover::before { opacity: 1; }
.btn.primary {
  background: linear-gradient(90deg,
    rgba(0, 245, 255, .12) 0%,
    rgba(0, 245, 255, .04) 40%,
    rgba(255, 0, 128, .04) 60%,
    rgba(255, 0, 128, .1) 100%);
  border-color: var(--cyan);
  box-shadow:
    0 0 18px rgba(0, 245, 255, .15),
    inset 0 1px 0 rgba(255,255,255,.05);
}
.btn.primary:hover {
  background: linear-gradient(90deg,
    rgba(0, 245, 255, .2) 0%,
    rgba(0, 245, 255, .08) 40%,
    rgba(255, 0, 128, .08) 60%,
    rgba(255, 0, 128, .18) 100%);
  box-shadow:
    0 0 36px rgba(0, 245, 255, .3),
    0 0 80px rgba(0, 245, 255, .1),
    inset 0 0 24px rgba(0, 245, 255, .06);
  transform: translateY(-1px);
}
.btn.ghost {
  color: var(--text-dim);
  border-color: var(--line-2);
}
.btn.ghost:hover {
  color: var(--text);
  border-color: rgba(0, 245, 255, .45);
  background: rgba(0, 245, 255, .04);
  box-shadow: 0 0 18px rgba(0, 245, 255, .1);
}
.btn .arrow { transition: transform var(--t); }
.btn:hover .arrow { transform: translateX(4px); }

/* ripple */
.ripple {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, var(--cyan-soft), transparent 65%);
  transform: translate(-50%, -50%) scale(0);
  animation: ripple 700ms var(--ease) forwards;
  mix-blend-mode: screen;
}
@keyframes ripple {
  to { transform: translate(-50%, -50%) scale(12); opacity: 0; }
}

/* ------- ABOUT ------- */
.about-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 64px;
  align-items: start;
}
.avatar-wrap {
  position: relative;
  width: 280px;
  height: 280px;
}
.avatar-wrap::before {
  /* rotating gradient ring */
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--cyan), var(--magenta), var(--cyan), transparent 80%, var(--cyan));
  animation: spin 6s linear infinite;
  filter: blur(2px);
  z-index: 0;
}
.avatar-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--bg);
  z-index: 1;
}
@keyframes spin { to { transform: rotate(360deg); } }
.avatar {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  z-index: 2;
  background:
    radial-gradient(circle at 50% 35%, #1a1a28 0%, #0a0a14 70%),
    var(--bg);
  border: 1px solid var(--line-2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 86px;
  color: var(--cyan);
  letter-spacing: -.02em;
  text-shadow: 0 0 24px var(--cyan-glow);
}
.avatar .avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  filter: contrast(1.05) saturate(.85) brightness(.95);
  transition: filter .4s var(--ease);
}
.avatar-wrap:hover .avatar-img {
  filter: contrast(1.1) saturate(1) brightness(1);
}
.avatar .grid-pattern {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(0, 245, 255, 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 245, 255, 0.08) 1px, transparent 1px);
  background-size: 16px 16px;
  opacity: .8;
  z-index: 3;
  mix-blend-mode: screen;
  pointer-events: none;
}
.avatar .avatar-scan {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 2px,
    rgba(0, 245, 255, 0.06) 3px,
    transparent 4px
  );
  mix-blend-mode: screen;
}
.avatar .glyph {
  position: relative;
  z-index: 2;
}
.avatar-tag {
  position: absolute;
  bottom: -10px; left: 50%;
  transform: translateX(-50%);
  background: var(--bg);
  border: 1px solid var(--cyan-dim);
  color: var(--cyan);
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  z-index: 3;
  white-space: nowrap;
}

.about-text { padding-top: 8px; }
.about-text p {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-dim);
  margin-top: 16px;
  max-width: 60ch;
}
.about-text p:first-of-type { color: var(--text); font-size: 15px; }
.about-text strong { color: var(--cyan); font-weight: 500; }

.about-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 32px;
  margin-top: 28px;
  font-family: var(--font-mono);
  font-size: 13px;
}
.about-meta dt { color: var(--text-faint); font-size: 11px; letter-spacing: .15em; text-transform: uppercase; }
.about-meta dd { color: var(--text); margin-top: 2px; }

.skills {
  margin-top: 48px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.skill-group {
  position: relative;
  padding: 20px 0 0;
  border-top: 1px solid var(--line);
}
.skill-group:first-child { border-top: 1px solid var(--cyan-dim); }
.sg-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.sg-num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .2em;
  color: var(--magenta);
}
.skill-group:nth-child(2) .sg-num { color: var(--cyan); }
.skill-group:nth-child(3) .sg-num { color: var(--text-faint); }
.sg-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -.01em;
  color: var(--text);
}
.sg-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--text-faint);
  text-transform: uppercase;
  margin-left: auto;
}
.sg-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sg-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .04em;
  padding: 7px 12px;
  background: rgba(255,255,255,.02);
  border: 1px solid var(--line-2);
  color: var(--text-dim);
  transition: all var(--t);
  position: relative;
}
.skill-group:nth-child(1) .sg-tag {
  color: var(--text);
  border-color: var(--cyan-dim);
  background: linear-gradient(180deg, rgba(0,245,255,.04), rgba(0,245,255,.01));
}
.skill-group:nth-child(1) .sg-tag:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 12px -2px var(--cyan-glow);
}
.skill-group:nth-child(2) .sg-tag:hover {
  border-color: var(--cyan-soft);
  color: var(--text);
}
.skill-group:nth-child(3) .sg-tag {
  color: var(--text-faint);
  border-style: dashed;
}
.skill-group:nth-child(3) .sg-tag:hover {
  color: var(--text-dim);
  border-color: var(--line-2);
  border-style: solid;
}

/* ------- PROJECTS ------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
  perspective: 1400px;
}
.project-card {
  position: relative;
  background: linear-gradient(180deg, #0c0c16, #08080f);
  border: 1px solid var(--line);
  padding: 28px;
  overflow: hidden;
  transition: border-color .4s, box-shadow .4s;
  transform-style: preserve-3d;
  isolation: isolate;
  cursor: none;
}
.project-card::before {
  /* neon edge accent (animated when hover) */
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  background: linear-gradient(135deg, var(--p-color, var(--cyan)), transparent 30%, transparent 70%, var(--p-color, var(--cyan)));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  transition: opacity .4s;
  pointer-events: none;
  z-index: 2;
}
.project-card::after {
  /* corner crosshair top-right */
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 28px; height: 28px;
  background:
    linear-gradient(to right, transparent calc(100% - 1px), var(--p-color, var(--cyan)) calc(100% - 1px)),
    linear-gradient(to bottom, var(--p-color, var(--cyan)) 1px, transparent 1px);
  opacity: .35;
  transition: opacity .4s;
}
.project-card:hover { border-color: transparent; box-shadow: 0 30px 60px -20px rgba(0,0,0,.6), 0 0 0 1px var(--p-color, var(--cyan)); }
.project-card:hover::before { opacity: 1; }
.project-card:hover::after  { opacity: 1; }

.project-card .pc-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .15em;
  color: var(--text-faint);
  text-transform: uppercase;
}
.project-card .pc-head .id { color: var(--p-color, var(--cyan)); }

.project-card .pc-visual {
  aspect-ratio: 16 / 10;
  position: relative;
  display: block;
  background: var(--p-bg, #1a0e15);
  border: 1px solid rgba(255,255,255,.05);
  overflow: hidden;
  margin-bottom: 22px;
  text-decoration: none;
  color: inherit;
}
.project-card .pc-shot {
  position: absolute;
  top: 24px; left: 0;
  width: 100%;
  height: calc(100% - 24px);
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform .8s var(--ease), filter .4s var(--ease);
  filter: saturate(.9) contrast(1.02);
}
.project-card:hover .pc-shot {
  transform: scale(1.04);
  filter: saturate(1) contrast(1.05);
}
.project-card .pc-visual .browser-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 24px;
  background: rgba(0,0,0,.4);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  z-index: 3;
}
.project-card .pc-visual .browser-bar i {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--p-color, var(--cyan));
  opacity: .35;
}
.project-card .pc-visual .browser-bar i:nth-child(2) { opacity: .55; }
.project-card .pc-visual .browser-bar i:nth-child(3) { opacity: .75; }
.project-card .pc-visual .browser-bar .url {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-faint);
  letter-spacing: .1em;
}

.project-card .mockup {
  position: absolute;
  inset: 24px 0 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px;
  text-align: center;
  gap: 12px;
  transition: transform .6s var(--ease);
  transform: translateZ(20px);
}
.project-card:hover .mockup { transform: translateZ(40px) scale(1.02); }

.mockup .m-logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 28px;
  letter-spacing: -.02em;
  color: var(--p-accent, #fff);
}
.mockup .m-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--p-mute, rgba(255,255,255,.55));
  margin-top: -8px;
}
.mockup .m-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  width: 100%;
  margin-top: 6px;
}
.mockup .m-row .cell {
  height: 36px;
  background: var(--p-cell, rgba(255,255,255,.04));
  border: 1px solid var(--p-cell-line, rgba(255,255,255,.07));
  position: relative;
}
.mockup .m-row .cell::after {
  content: "";
  position: absolute;
  left: 6px; right: 6px; bottom: 6px;
  height: 3px;
  background: var(--p-accent, rgba(255,255,255,.4));
  opacity: .6;
}
.mockup .m-btn {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .25em;
  text-transform: uppercase;
  padding: 7px 14px;
  border: 1px solid var(--p-accent, #fff);
  color: var(--p-accent, #fff);
}

/* project palettes */
.p1 { --p-color: #ff8db8; --p-bg: linear-gradient(160deg, #2a1320, #1a0a14); --p-accent: #ffd1a8; --p-mute: rgba(255,209,168,.6); --p-cell: rgba(255,141,184,.06); --p-cell-line: rgba(255,141,184,.18); }
.p2 { --p-color: #b8c4d4; --p-bg: linear-gradient(160deg, #1a1c22, #0d0e13); --p-accent: #e4e8f0; --p-mute: rgba(228,232,240,.5); --p-cell: rgba(184,196,212,.05); --p-cell-line: rgba(184,196,212,.15); }
.p3 { --p-color: #c89dff; --p-bg: linear-gradient(160deg, #1f1530, #0f0a1a); --p-accent: #e8d8ff; --p-mute: rgba(232,216,255,.55); --p-cell: rgba(200,157,255,.06); --p-cell-line: rgba(200,157,255,.2); }
.p4 { --p-color: #ff6b6b; --p-bg: linear-gradient(160deg, #2a1414, #1a0a0a); --p-accent: #ffe8e8; --p-mute: rgba(255,232,232,.55); --p-cell: rgba(255,107,107,.06); --p-cell-line: rgba(255,107,107,.2); }

.project-card .pc-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 26px;
  letter-spacing: -.01em;
  color: var(--text);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.project-card .pc-title > a:first-child {
  color: inherit;
  flex: 1;
  transition: color var(--t);
}
.project-card:hover .pc-title > a:first-child {
  color: var(--p-color, var(--cyan));
}
.project-card .pc-title .arrow-link {
  width: 32px; height: 32px;
  border: 1px solid var(--line-2);
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-size: 12px;
  color: var(--text-dim);
  transition: all var(--t);
  margin-left: auto;
}
.project-card:hover .pc-title .arrow-link {
  background: var(--p-color, var(--cyan));
  border-color: var(--p-color, var(--cyan));
  color: #050508;
  transform: rotate(-45deg);
}
.project-card .pc-desc {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.65;
  margin-bottom: 18px;
}
.project-card .pc-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.project-card .pc-stack .chip {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 5px 10px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--line-2);
  color: var(--text-dim);
  transition: all var(--t);
}
.project-card:hover .pc-stack .chip {
  border-color: var(--p-color, var(--cyan));
  color: var(--text);
}

/* ------- STACK ------- */
.stack {
  position: relative;
}
.stack::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='56' height='64' viewBox='0 0 56 64'><polygon points='28,1 55,16 55,48 28,63 1,48 1,16' fill='none' stroke='%231c1c2a' stroke-width='1'/></svg>");
  background-size: 56px 64px;
  opacity: .5;
  pointer-events: none;
  mask-image: radial-gradient(ellipse at center, #000, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000, transparent 70%);
}
.stack-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}
.stack-item {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  background: rgba(10,10,18,.6);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  transition: all var(--t);
  --c: var(--cyan);
}
.stack-item:hover {
  border-color: var(--c);
  box-shadow: 0 0 28px -4px var(--c), inset 0 0 24px -10px var(--c);
  transform: translateY(-3px);
}
.stack-item .ico {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 28px;
  color: var(--text);
  letter-spacing: -.04em;
  transition: color var(--t);
}
.stack-item:hover .ico { color: var(--c); text-shadow: 0 0 14px var(--c); }
.stack-item .label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-faint);
  letter-spacing: .12em;
  text-transform: uppercase;
  transition: color var(--t);
}
.stack-item:hover .label { color: var(--text); }
.stack-item .tooltip {
  position: absolute;
  top: -32px;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--bg);
  border: 1px solid var(--c);
  color: var(--c);
  padding: 4px 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t), transform var(--t);
}
.stack-item:hover .tooltip { opacity: 1; transform: translateX(-50%) translateY(0); }

/* tinted variants */
.stack-item.c-orange { --c: #ff8c42; }
.stack-item.c-blue   { --c: #4ea2ff; }
.stack-item.c-yellow { --c: #f5e36b; }
.stack-item.c-cyan   { --c: #00f5ff; }
.stack-item.c-green  { --c: #68d391; }
.stack-item.c-graygreen { --c: #9fc88e; }
.stack-item.c-leaf   { --c: #5cd47b; }
.stack-item.c-sql    { --c: #6aa9ff; }
.stack-item.c-red    { --c: #ff6b6b; }
.stack-item.c-pink   { --c: #ff7ab8; }
.stack-item.c-purple { --c: #b58cff; }
.stack-item.c-magenta{ --c: #ff0080; }

/* ------- CONTACT ------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 80px;
  align-items: start;
}
.contact-side .kicker { margin-bottom: 20px; }
.contact-side h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(36px, 4.6vw, 60px);
  line-height: 1;
  letter-spacing: -.02em;
}
.contact-side .lead {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-dim);
  margin-top: 24px;
  max-width: 46ch;
}
.contact-links {
  margin-top: 36px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-top: 1px solid var(--line);
}
.contact-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-dim);
  transition: color var(--t), padding var(--t);
}
.contact-links a:hover {
  color: var(--cyan);
  padding-left: 12px;
  text-shadow: 0 0 12px var(--cyan-glow);
}
.contact-links a .ic {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--text-faint);
  min-width: 90px;
}
.contact-links a:hover .ic { color: var(--cyan); }
.contact-links a .v { color: var(--text); flex: 1; text-align: left; padding-left: 16px; }
.contact-links a:hover .v { color: var(--cyan); }
.contact-links a .arrow { color: var(--text-faint); transition: transform var(--t), color var(--t); }
.contact-links a:hover .arrow { color: var(--cyan); transform: translate(4px, -4px); }

.contact-form {
  background: var(--bg-1);
  border: 1px solid var(--line);
  padding: 36px;
  position: relative;
}
.contact-form::before {
  content: "";
  position: absolute;
  top: -1px; left: -1px;
  width: 32px; height: 32px;
  border-top: 1px solid var(--cyan);
  border-left: 1px solid var(--cyan);
}
.contact-form::after {
  content: "";
  position: absolute;
  bottom: -1px; right: -1px;
  width: 32px; height: 32px;
  border-bottom: 1px solid var(--magenta);
  border-right: 1px solid var(--magenta);
}
.form-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 28px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.form-head .live { color: var(--green); display: inline-flex; align-items: center; gap: 8px; }
.form-head .live::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse 1.8s infinite;
}

.field {
  position: relative;
  margin-bottom: 32px;
  padding-top: 18px;
}
.field input,
.field textarea {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-2);
  color: var(--text);
  padding: 10px 0;
  font-family: var(--font-mono);
  font-size: 14px;
  outline: none;
  transition: border-color var(--t);
  resize: none;
}
.field textarea { min-height: 90px; }
.field label {
  position: absolute;
  left: 0;
  top: 28px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-faint);
  pointer-events: none;
  transition: top var(--t), font-size var(--t), color var(--t);
}
.field.focused label,
.field.filled label {
  top: 0;
  font-size: 10px;
  color: var(--cyan);
}
.field.focused input,
.field.focused textarea { border-bottom-color: var(--cyan); }
.field .field-meta {
  position: absolute;
  right: 0; top: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--text-faint);
}

.submit-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(90deg, var(--cyan-dim), var(--magenta-dim));
  border: 1px solid var(--cyan);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .25em;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
  transition: all var(--t);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: none;
}
.submit-btn:hover { box-shadow: 0 0 30px var(--cyan-glow); border-color: var(--magenta); }
.submit-btn[data-state="loading"] { color: var(--cyan); pointer-events: none; }
.submit-btn[data-state="loading"] .label-default,
.submit-btn[data-state="loading"] .label-done,
.submit-btn[data-state="loading"] .label-error { display: none; }
.submit-btn[data-state="default"] .label-loading,
.submit-btn[data-state="default"] .label-done,
.submit-btn[data-state="default"] .label-error { display: none; }
.submit-btn[data-state="done"] { color: var(--green); border-color: var(--green); background: rgba(74,222,128,.08); }
.submit-btn[data-state="done"] .label-default,
.submit-btn[data-state="done"] .label-loading,
.submit-btn[data-state="done"] .label-error { display: none; }
.submit-btn[data-state="error"] { color: var(--magenta); border-color: var(--magenta); background: rgba(255,0,128,.06); pointer-events: none; }
.submit-btn[data-state="error"] .label-default,
.submit-btn[data-state="error"] .label-loading,
.submit-btn[data-state="error"] .label-done { display: none; }
.submit-btn .progress {
  position: absolute;
  bottom: 0; left: 0;
  height: 1px;
  background: var(--cyan);
  width: 0%;
  box-shadow: 0 0 8px var(--cyan-glow);
}
.submit-btn[data-state="loading"] .progress { width: 100%; transition: width 1.4s linear; }

/* ------- FOOTER ------- */
footer {
  border-top: 1px solid var(--line);
  padding: 32px var(--pad-x);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--text-faint);
  text-transform: uppercase;
  flex-wrap: wrap;
  gap: 16px;
  position: relative;
  z-index: 2;
}
footer .name { color: var(--text); cursor: pointer; transition: color var(--t); }
footer .name:hover { color: var(--cyan); text-shadow: 0 0 12px var(--cyan-glow); }
footer .right { display: flex; gap: 24px; }
footer .uptime b { color: var(--green); }

/* matrix easter egg overlay */
#matrix-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s;
  background: rgba(0,0,0,.7);
}
#matrix-overlay.on { opacity: 1; }
#matrix-overlay canvas { width: 100%; height: 100%; display: block; }

/* ------- REVEAL ANIMATION ------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"] { transition-delay: .24s; }
.reveal[data-delay="4"] { transition-delay: .32s; }

/* ------- FOCUS ------- */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 1px solid var(--cyan);
  outline-offset: 4px;
}

/* ============================================
   RESPONSIVE / MOBILE ADAPTATION
   Breakpoints: 1020 (tablet) · 720 (mobile) · 480 (xs)
   ============================================ */

/* ---------- MOBILE MENU (drawer) ---------- */
.burger {
  position: relative;
  width: 22px; height: 14px;
  display: inline-block;
}
.burger span {
  position: absolute;
  left: 0; right: 0;
  height: 1.5px;
  background: var(--text);
  transition: transform .35s var(--ease), top .35s var(--ease), opacity .2s var(--ease), background .25s;
}
.burger span:nth-child(1) { top: 0; }
.burger span:nth-child(2) { top: 6px; }
.burger span:nth-child(3) { top: 12px; }
.nav-menu-btn[aria-expanded="true"] .burger span { background: var(--cyan); }
.nav-menu-btn[aria-expanded="true"] .burger span:nth-child(1) { top: 6px; transform: rotate(45deg); }
.nav-menu-btn[aria-expanded="true"] .burger span:nth-child(2) { opacity: 0; }
.nav-menu-btn[aria-expanded="true"] .burger span:nth-child(3) { top: 6px; transform: rotate(-45deg); }

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(5, 5, 8, 0.85);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s var(--ease);
  display: flex;
  flex-direction: column;
}
.mobile-menu.open {
  opacity: 1;
  pointer-events: auto;
}
.mobile-menu::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--cyan-dim) 1px, transparent 1px),
    linear-gradient(to bottom, var(--cyan-dim) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: .15;
  mask-image: radial-gradient(ellipse at top, #000, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at top, #000, transparent 70%);
  pointer-events: none;
}
.mm-inner {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 88px var(--pad-x) 32px;
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
}
.mm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 24px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--line);
}
.mm-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .2em;
  color: var(--cyan);
  text-transform: uppercase;
}
.mm-close {
  position: relative;
  width: 36px; height: 36px;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--t), background var(--t);
}
.mm-close:hover { border-color: var(--cyan); background: var(--cyan-dim); }
.mm-close span {
  position: absolute;
  width: 14px; height: 1px;
  background: var(--text);
}
.mm-close span:nth-child(1) { transform: rotate(45deg); }
.mm-close span:nth-child(2) { transform: rotate(-45deg); }

.mm-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
}
.mm-links li {
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.mobile-menu.open .mm-links li { opacity: 1; transform: translateX(0); }
.mobile-menu.open .mm-links li:nth-child(1) { transition-delay: .08s; }
.mobile-menu.open .mm-links li:nth-child(2) { transition-delay: .14s; }
.mobile-menu.open .mm-links li:nth-child(3) { transition-delay: .20s; }
.mobile-menu.open .mm-links li:nth-child(4) { transition-delay: .26s; }
.mobile-menu.open .mm-links li:nth-child(5) { transition-delay: .32s; }

.mm-links a {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 4px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(26px, 7vw, 36px);
  letter-spacing: -.01em;
  color: var(--text);
  transition: color var(--t), padding var(--t);
  min-height: 56px;
}
.mm-links a:hover,
.mm-links a:active { color: var(--cyan); padding-left: 16px; }
.mm-links .idx {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .15em;
  color: var(--text-faint);
  min-width: 28px;
}
.mm-links a:hover .idx { color: var(--cyan); }
.mm-links .lbl { flex: 1; }
.mm-links .arr {
  font-size: 16px;
  color: var(--text-faint);
  transition: transform var(--t), color var(--t);
}
.mm-links a:hover .arr { color: var(--cyan); transform: translate(4px, -4px); }

.mm-foot {
  margin-top: auto;
  padding-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-top: 1px solid var(--line);
}
.mm-status {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .15em;
  color: var(--text-dim);
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.mm-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: pulse 1.8s infinite;
}
.mm-cta {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .2em;
  text-transform: uppercase;
  padding: 16px 20px;
  border: 1px solid var(--cyan);
  color: var(--cyan);
  text-align: center;
  background: var(--cyan-dim);
  transition: all var(--t);
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mm-cta:active { background: var(--cyan); color: var(--bg); }

body.menu-open { overflow: hidden; }

/* ---------- TABLET (≤ 1020px) ---------- */
@media (max-width: 1020px) {
  :root { --pad-x: clamp(20px, 4vw, 40px); }

  .nav-links { display: none; }
  .nav-cta { display: none; }
  .nav-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px; height: 44px;
    border: 1px solid var(--line-2);
    border-radius: 4px;
    background: rgba(10,10,18,.4);
    transition: border-color var(--t), background var(--t);
  }
  .nav-menu-btn:hover,
  .nav-menu-btn[aria-expanded="true"] { border-color: var(--cyan); background: var(--cyan-dim); }

  .about-grid { grid-template-columns: 1fr; gap: 48px; justify-items: center; }
  .avatar-wrap { margin: 0 auto; }
  .about-text { padding-top: 0; width: 100%; }
  .projects-grid { grid-template-columns: 1fr; gap: 24px; }
  .stack-grid { grid-template-columns: repeat(4, 1fr); }
  .contact-grid { grid-template-columns: 1fr; gap: 56px; }
}

/* ---------- MOBILE (≤ 720px) ---------- */
@media (max-width: 720px) {
  :root {
    --pad-x: 20px;
  }
  body { font-size: 14px; }

  /* sections + section heads */
  section { padding: 72px 0; }
  .section-head { margin-bottom: 36px; gap: 16px; }
  .section-head .meta { font-size: 10px; letter-spacing: .12em; }
  h2.section-title { font-size: clamp(30px, 8vw, 44px); }
  .kicker { font-size: 10px; letter-spacing: .2em; }
  .kicker::before { width: 16px; }

  /* nav */
  .nav { padding: 12px var(--pad-x); }
  .nav.scrolled { padding-top: 10px; padding-bottom: 10px; }
  .nav-brand { font-size: 13px; }

  /* hero */
  .hero { min-height: auto; }
  .hero-name { font-size: clamp(64px, 18vw, 110px); }
  .hero-typer { font-size: 14px; margin-top: 12px; gap: 8px; }
  .hero-typer .role { min-width: auto; }
  .hero-bio { font-size: 13px; max-width: none; }
  .hero-bio-block { margin-top: 24px; }
  .hero-actions { gap: 12px; margin-top: 28px; }
  .btn { padding: 14px 18px; font-size: 12px; flex: 1; justify-content: center; min-height: 48px; }

  /* about */
  .avatar-wrap { width: 220px; height: 220px; }
  .avatar { font-size: 64px; }
  .skills { grid-template-columns: 1fr; gap: 18px; margin-top: 36px; }
  .about-meta { grid-template-columns: 1fr; gap: 12px 24px; }
  .about-text p { font-size: 14px; }

  /* projects */
  .project-card { padding: 20px; }
  .project-card .pc-head { font-size: 10px; margin-bottom: 18px; letter-spacing: .12em; }
  .project-card .pc-title { font-size: 22px; gap: 10px; }
  .project-card .pc-title .arrow-link { width: 32px; height: 32px; }
  .project-card .pc-desc { font-size: 13px; }
  /* disable tilt on touch — looks janky */
  .project-card:hover { transform: none !important; }
  .project-card .pc-shot { transition: none; }
  .project-card:hover .pc-shot { transform: none; }

  /* stack */
  .stack-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .stack-item .ico { font-size: 22px; }
  .stack-item .label { font-size: 9px; letter-spacing: .1em; }
  .stack-item .tooltip { display: none; } /* no hover on touch */

  /* contact */
  .contact-side h2 { font-size: clamp(34px, 9vw, 48px); }
  .contact-side .lead { font-size: 13px; max-width: none; }
  .contact-links a { padding: 16px 0; min-height: 56px; gap: 12px; flex-wrap: wrap; }
  .contact-links a:hover { padding-left: 0; } /* no slide on touch */
  .contact-links a .ic { font-size: 10px; min-width: 76px; }
  .contact-links a .v { font-size: 13px; padding-left: 12px; word-break: break-all; }
  .contact-form { padding: 24px 20px; }
  .contact-form::before, .contact-form::after { width: 24px; height: 24px; }
  .form-head { font-size: 10px; margin-bottom: 22px; }
  .field { margin-bottom: 26px; padding-top: 16px; }
  .field input, .field textarea { font-size: 16px; } /* prevents iOS zoom */
  .field label { font-size: 11px; top: 24px; }
  .field.focused label, .field.filled label { font-size: 9px; }
  .submit-btn { padding: 18px; min-height: 52px; font-size: 11px; }

  /* footer */
  footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 24px var(--pad-x);
    font-size: 10px;
  }
  footer .right { flex-wrap: wrap; gap: 16px; }

  /* scanlines lighter on small screens */
  body::after { opacity: .7; }
}

/* ---------- XS MOBILE (≤ 480px) ---------- */
@media (max-width: 480px) {
  .nav-brand { font-size: 12px; }
  .nav-brand .bracket { display: none; }

  .hero-actions { flex-direction: column; }
  .btn { width: 100%; }

  .stack-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stack-item .ico { font-size: 20px; }

  .avatar-wrap { width: 180px; height: 180px; }

  .pc-head span:last-child { display: none; } /* hide "E-COMMERCE" tag */

  .field-meta { display: none; } /* hide numeric indicators in form */
}

/* ---------- LANDSCAPE PHONE ---------- */
@media (max-height: 520px) and (orientation: landscape) {
  .hero { min-height: 100vh; }
  .hero-hud .hud-inner { grid-template-columns: repeat(4, 1fr); }
  .hud-cell { padding: 8px 12px; }
}

/* ---------- TOUCH DEVICES — strip hover-only effects ---------- */
@media (hover: none) {
  .project-card { transform: none !important; }
  .project-card .pc-shot { transition: none; }
  .stack-item .tooltip { display: none; }
  .contact-links a:hover { padding-left: 0; }
}

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001s !important;
  }
  .reveal { opacity: 1; transform: none; }
}
