/* ============================================
   PORTFOLIO — Dark Terminal meets Spatial UI
   v5 — space + mobile tuning
   ============================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #050508;
  --bg-elev: #0a0a12;
  --bg-elev-2: #10101a;
  --line: rgba(0, 245, 255, 0.10);
  --line-strong: rgba(0, 245, 255, 0.24);
  --line-soft: rgba(230, 233, 239, 0.06);
  --cyan: #00f5ff;
  --cyan-dim: #00b8c4;
  --amber: #ffaa00;
  --amber-dim: #c48200;
  --text: #e6e9ef;
  --text-dim: #8a92a6;
  --text-faint: #4b5168;
  --danger: #ff4d6d;
  --green: #00ff9d;

  --mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  cursor: none;
  background-image:
    radial-gradient(ellipse 70% 50% at 50% -5%, rgba(0, 245, 255, 0.05), transparent 60%),
    radial-gradient(ellipse 50% 40% at 90% 100%, rgba(255, 170, 0, 0.04), transparent 60%);
  background-attachment: fixed;
}

::selection { background: var(--cyan); color: var(--bg); }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: none; }

/* subtle grid only inside hero */
#hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 96px 96px;
  opacity: 0.9;
  pointer-events: none;
  z-index: 2;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 20%, transparent 80%);
}

/* very subtle scanline everywhere */
body::after {
  content: '';
  position: fixed; inset: 0;
  background-image: repeating-linear-gradient(0deg, rgba(255,255,255,0.01) 0, rgba(255,255,255,0.01) 1px, transparent 1px, transparent 3px);
  pointer-events: none; z-index: 2; mix-blend-mode: overlay;
}

/* ---------- CURSOR ---------- */
.cursor-dot, .cursor-ring {
  position: fixed; top: 0; left: 0;
  pointer-events: none; z-index: 9999;
  mix-blend-mode: difference; will-change: transform;
}
.cursor-dot { width: 6px; height: 6px; background: var(--cyan); border-radius: 50%; transform: translate(-50%, -50%); }
.cursor-ring { width: 32px; height: 32px; border: 1.5px solid var(--cyan); border-radius: 50%; transform: translate(-50%, -50%); transition: width 0.25s var(--ease), height 0.25s var(--ease), border-color 0.25s; }
.cursor-ring.hover { width: 56px; height: 56px; border-color: var(--amber); background: rgba(255, 170, 0, 0.08); }

/* ---------- THREE ---------- */
#three-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.7; }
#three-hero { position: absolute; inset: 0; z-index: 1; pointer-events: none; }

.mobile-bg {
  display: none;
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(0, 245, 255, 0.18), transparent 45%),
    radial-gradient(circle at 80% 70%, rgba(255, 170, 0, 0.12), transparent 50%),
    radial-gradient(circle at 50% 90%, rgba(0, 245, 255, 0.10), transparent 55%),
    var(--bg);
  animation: meshDrift 18s ease-in-out infinite alternate;
}
@keyframes meshDrift {
  0% { background-position: 0% 0%; filter: hue-rotate(0deg); }
  100% { background-position: 10% 20%; filter: hue-rotate(30deg); }
}

/* ---------- BOOT LOADER ---------- */
.boot {
  position: fixed; inset: 0; z-index: 999;
  background: var(--bg);
  display: grid; place-items: center;
  transition: opacity 0.8s var(--ease), visibility 0.8s;
}
.boot.done { opacity: 0; visibility: hidden; }
.boot-inner { text-align: center; }
.boot-line { color: var(--cyan); font-size: 14px; letter-spacing: 0.15em; margin-bottom: 24px; }
.boot-line .cur { animation: blink 1s steps(1) infinite; }
.boot-bar { width: 240px; height: 2px; background: rgba(0,245,255,0.15); position: relative; overflow: hidden; margin: 0 auto; }
.boot-bar span { position: absolute; top: 0; left: 0; height: 100%; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); width: 0; animation: bootfill 1.4s ease-out forwards; }
@keyframes bootfill { to { width: 100%; } }
@keyframes blink { 0%,50%{opacity:1} 51%,100%{opacity:0} }

/* ---------- LAYOUT ---------- */
.wrap { position: relative; z-index: 3; max-width: 1400px; margin: 0 auto; padding: 0 48px; }
section { position: relative; padding: 140px 0; z-index: 3; }
#about { padding-bottom: 50px; }
#skills { padding-top: 50px; }

/* ---------- TYPOGRAPHY ---------- */
h1, h2, h3, h4, .mono { font-family: var(--mono); font-weight: 500; letter-spacing: -0.01em; }

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.25em;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.eyebrow::before { content: ''; width: 28px; height: 1px; background: var(--cyan); display: inline-block; }

.section-title { font-size: clamp(2rem, 4vw, 3rem); margin: 16px 0 12px; color: var(--text); }
.section-title .num { color: var(--amber); font-size: 0.6em; margin-right: 16px; vertical-align: top; letter-spacing: 0.1em; }
.section-sub { color: var(--text-dim); font-family: var(--mono); font-size: 14px; max-width: 540px; margin-bottom: 56px; }

/* ---------- NAV ---------- */
nav.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 20px 48px;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(5, 5, 8, 0.65);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 13px;
}
nav.topbar .logo { color: var(--cyan); font-weight: 600; letter-spacing: 0.05em; display: flex; align-items: center; gap: 10px; }
nav.topbar .logo .dot { width: 8px; height: 8px; background: var(--cyan); border-radius: 50%; box-shadow: 0 0 12px var(--cyan); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.4;transform:scale(0.85)} }

nav.topbar ul { list-style: none; display: flex; gap: 4px; position: relative; }
nav.topbar ul li a { padding: 8px 14px; color: var(--text-dim); transition: color 0.25s var(--ease); display: block; position: relative; }
nav.topbar ul li a:hover, nav.topbar ul li a.active { color: var(--cyan); }
nav.topbar ul li a .n { color: var(--amber); margin-right: 6px; font-size: 11px; }

nav.topbar .nav-indicator { position: absolute; bottom: -2px; left: 0; height: 2px; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); transition: all 0.4s var(--ease); pointer-events: none; }

nav.topbar .status { display: flex; align-items: center; gap: 10px; color: var(--text-dim); }

.nav-resume {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em;
  padding: 7px 14px;
  border: 1px solid var(--cyan);
  color: var(--cyan);
  display: flex; align-items: center; gap: 6px;
  transition: all 0.25s var(--ease);
  white-space: nowrap;
}
.nav-resume:hover { background: rgba(0,245,255,0.1); box-shadow: 0 0 16px rgba(0,245,255,0.3); }
nav.topbar .status .led { width: 8px; height: 8px; background: var(--green); border-radius: 50%; box-shadow: 0 0 8px var(--green); animation: pulse 2s ease-in-out infinite; }

.hamburger { display: none; width: 32px; height: 24px; position: relative; }
.hamburger span { position: absolute; left: 0; right: 0; height: 2px; background: var(--cyan); transition: all 0.3s var(--ease); }
.hamburger span:nth-child(1) { top: 0; }
.hamburger span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.hamburger span:nth-child(3) { bottom: 0; }
.hamburger.open span:nth-child(1) { top: 50%; transform: translateY(-50%) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { bottom: 50%; transform: translateY(50%) rotate(-45deg); }

.mobile-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(320px, 85%);
  background: var(--bg-elev); border-left: 1px solid var(--line-strong);
  z-index: 99; padding: 100px 32px 32px;
  transform: translateX(100%); transition: transform 0.4s var(--ease);
  display: flex; flex-direction: column; gap: 8px;
}
.mobile-drawer.open { transform: translateX(0); }
.mobile-drawer a { padding: 16px 0; border-bottom: 1px solid var(--line); font-family: var(--mono); color: var(--text-dim); font-size: 18px; display: flex; align-items: center; gap: 12px; }
.mobile-drawer a .n { color: var(--amber); font-size: 12px; }

/* ---------- HERO ---------- */
#hero {
  min-height: 100vh;
  padding: 0;
  display: flex;
  align-items: center;
  overflow: hidden;
  position: relative;
}

.hud { position: absolute; inset: 92px 48px 48px 48px; pointer-events: none; z-index: 4; }
.hud-corner { position: absolute; width: 22px; height: 22px; border: 1px solid var(--cyan); opacity: 0.5; }
.hud-corner.tl { top: 0; left: 0; border-right: none; border-bottom: none; }
.hud-corner.tr { top: 0; right: 0; border-left: none; border-bottom: none; }
.hud-corner.bl { bottom: 0; left: 0; border-right: none; border-top: none; }
.hud-corner.br { bottom: 0; right: 0; border-left: none; border-top: none; }
.hud-tick { position: absolute; top: 0; left: 50%; transform: translateX(-50%); display: flex; gap: 14px; }
.hud-tick span { width: 1px; height: 8px; background: var(--cyan); opacity: 0.5; }
.hud-tick span:nth-child(3) { height: 14px; background: var(--amber); opacity: 0.9; }

.hero-grid {
  width: 100%;
  display: block;
  padding: 160px 48px 80px;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
  z-index: 5;
}

.hero-meta {
  display: flex; gap: 32px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 24px;
  letter-spacing: 0.05em;
}
.hero-meta span b { color: var(--cyan); font-weight: 500; }

.hero-name {
  font-family: var(--mono);
  font-size: clamp(3rem, 10vw, 8.5rem);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  overflow: hidden;
  padding: 8px 0;
}
.hero-name .letter { display: inline-block; will-change: transform, opacity; }
.hero-name .break { flex-basis: 100%; height: 0; }
.hero-name .letter.accent { color: var(--cyan); }

/* Role cycler */
.hero-roles {
  font-size: clamp(1.05rem, 1.6vw, 1.4rem);
  color: var(--text);
  margin-top: 24px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.hero-roles .prompt { color: var(--cyan); }
.role-flip {
  display: inline-block;
  position: relative;
  height: 1.4em;
  min-width: 320px;
  vertical-align: middle;
  overflow: hidden;
}
.role-item {
  position: absolute; left: 0; top: 0;
  display: inline-block;
  color: var(--cyan);
  opacity: 0;
  transform: translateY(100%);
  transition: transform 0.6s var(--ease), opacity 0.6s var(--ease);
  white-space: nowrap;
}
.role-item.active {
  opacity: 1;
  transform: translateY(0);
}
.role-item.leaving {
  opacity: 0;
  transform: translateY(-100%);
}

.hero-sub {
  color: var(--text-dim); font-size: clamp(0.85rem, 1.1vw, 1rem);
  margin-top: 16px; max-width: 640px;
}

.hero-ctas { margin-top: 48px; display: flex; gap: 16px; flex-wrap: wrap; }

.btn {
  font-family: var(--mono); font-size: 13px;
  padding: 16px 28px;
  border: 1px solid var(--line-strong);
  color: var(--text);
  display: inline-flex; align-items: center; gap: 12px;
  letter-spacing: 0.08em; text-transform: uppercase;
  transition: all 0.3s var(--ease);
  position: relative; overflow: hidden;
  background: rgba(10, 10, 18, 0.55);
  backdrop-filter: blur(6px);
  will-change: transform;
}
.btn.primary { background: var(--cyan); color: var(--bg); border-color: var(--cyan); font-weight: 600; }
.btn.primary:hover { box-shadow: 0 0 24px rgba(0, 245, 255, 0.5); }
.btn:hover { border-color: var(--cyan); color: var(--cyan); }
.btn.primary:hover { color: var(--bg); }
.btn .arrow { transition: transform 0.3s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

.hero-sidestats {
  position: absolute; right: 48px; bottom: 60px;
  display: flex; flex-direction: column; gap: 18px; align-items: flex-end;
  font-family: var(--mono); font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase; letter-spacing: 0.2em;
  z-index: 5;
}
.hero-sidestats .line { width: 40px; height: 1px; background: var(--cyan); opacity: 0.5; }

.scroll-cue {
  position: absolute; left: 48px; bottom: 32px;
  font-family: var(--mono); font-size: 11px; color: var(--text-dim);
  letter-spacing: 0.25em; text-transform: uppercase;
  display: flex; align-items: center; gap: 12px;
  z-index: 5;
}
.scroll-cue::after {
  content: ''; width: 60px; height: 1px;
  background: linear-gradient(90deg, var(--cyan), transparent);
  animation: slideRight 2s ease-in-out infinite;
}
@keyframes slideRight { 0%{transform:translateX(-10px);opacity:0} 50%{opacity:1} 100%{transform:translateX(20px);opacity:0} }

/* ---------- ABOUT ---------- */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: start; }
.ascii-frame { border: 1px solid var(--line-strong); background: rgba(10, 10, 18, 0.6); backdrop-filter: blur(8px); padding: 20px; position: relative; }
.ascii-frame::before { content: 'SYS://avatar.renderbuffer'; position: absolute; top: -1px; left: 16px; transform: translateY(-50%); background: var(--bg); padding: 0 10px; font-family: var(--mono); font-size: 10px; color: var(--cyan); letter-spacing: 0.15em; }
.ascii-frame .bar { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10px; color: var(--text-faint); margin-bottom: 12px; letter-spacing: 0.15em; }
.ascii-frame .bar .dots { display: flex; gap: 6px; }
.ascii-frame .bar .dots span { width: 8px; height: 8px; border-radius: 50%; }
.ascii-art {
  font-family: var(--mono); font-size: clamp(6px, 0.75vw, 9px); line-height: 1.05;
  color: var(--cyan); white-space: pre; letter-spacing: 0;
  text-shadow: 0 0 8px rgba(0, 245, 255, 0.4);
  position: relative; overflow: hidden;
}
.ascii-art.glitch::before, .ascii-art.glitch::after {
  content: attr(data-text); position: absolute; inset: 0; white-space: pre;
}
.ascii-art.glitch::before { color: var(--amber); transform: translate(2px, 0); opacity: 0.35; mix-blend-mode: screen; clip-path: polygon(0 10%, 100% 10%, 100% 35%, 0 35%); animation: glitch1 3s steps(2) infinite; }
.ascii-art.glitch::after { color: #ff4d6d; transform: translate(-2px, 0); opacity: 0.3; mix-blend-mode: screen; clip-path: polygon(0 60%, 100% 60%, 100% 82%, 0 82%); animation: glitch2 2.7s steps(2) infinite; }
@keyframes glitch1 { 0%,92%,100% { clip-path: polygon(0 10%, 100% 10%, 100% 35%, 0 35%); transform: translate(2px, 0); } 93% { clip-path: polygon(0 65%, 100% 65%, 100% 80%, 0 80%); transform: translate(-3px, 0); } 95% { clip-path: polygon(0 20%, 100% 20%, 100% 28%, 0 28%); transform: translate(4px, 0); } }
@keyframes glitch2 { 0%,88%,100% { clip-path: polygon(0 60%, 100% 60%, 100% 82%, 0 82%); } 90% { clip-path: polygon(0 5%, 100% 5%, 100% 18%, 0 18%); } 93% { clip-path: polygon(0 40%, 100% 40%, 100% 55%, 0 55%); } }
.ascii-frame .footer { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10px; color: var(--text-faint); margin-top: 12px; letter-spacing: 0.15em; }
.ascii-frame .footer .live { color: var(--green); }

.about-copy h3 { font-size: 1.6rem; margin-bottom: 20px; color: var(--text); }
.about-copy p { color: var(--text-dim); margin-bottom: 20px; font-size: 16px; line-height: 1.7; }
.about-copy p b { color: var(--cyan); font-weight: 500; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 40px; border-top: 1px solid var(--line); padding-top: 32px; }
.stat { position: relative; }
.stat .num { font-family: var(--mono); font-size: clamp(2rem, 3.5vw, 2.75rem); font-weight: 600; color: var(--cyan); line-height: 1; display: block; margin-bottom: 8px; letter-spacing: -0.02em; }
.stat .num .suffix { color: var(--amber); font-size: 0.6em; vertical-align: super; }
.stat .label { font-family: var(--mono); font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.15em; }

/* ---------- SKILLS ---------- */
.skills-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 24px; margin-bottom: 48px; }
.skills-head .legend { font-family: var(--mono); font-size: 11px; color: var(--text-faint); display: flex; gap: 20px; letter-spacing: 0.1em; }
.skills-head .legend span { display: flex; align-items: center; gap: 8px; }
.skills-head .legend i { width: 8px; height: 8px; display: inline-block; }
.skill-cat { border-top: 1px solid var(--line); padding: 28px 0; display: grid; grid-template-columns: 280px 1fr; gap: 40px; align-items: start; transition: background 0.4s var(--ease); }
.skill-cat:last-child { border-bottom: 1px solid var(--line); }
.skill-cat:hover { background: rgba(0, 245, 255, 0.025); }
.skill-cat .head { display: flex; align-items: center; gap: 14px; }
.skill-cat .head .icon { width: 36px; height: 36px; border: 1px solid var(--line-strong); display: grid; place-items: center; color: var(--cyan); flex-shrink: 0; }
.skill-cat .head .icon svg { width: 18px; height: 18px; }
.skill-cat .head .name { font-family: var(--mono); font-size: 15px; color: var(--text); letter-spacing: 0.02em; }
.skill-cat .head .num { font-family: var(--mono); font-size: 10px; color: var(--text-faint); margin-top: 4px; letter-spacing: 0.2em; }
.skill-cat .tags { display: flex; flex-wrap: wrap; gap: 8px; }

.pill {
  font-family: var(--mono); font-size: 12px; padding: 8px 14px;
  border: 1px solid var(--line-strong); color: var(--text-dim);
  background: rgba(10, 10, 18, 0.5);
  transition: all 0.25s var(--ease);
  position: relative; cursor: none; will-change: transform;
}
.pill:hover { border-color: var(--cyan); color: var(--cyan); background: rgba(0, 245, 255, 0.08); box-shadow: 0 0 16px rgba(0, 245, 255, 0.3); transform: translateY(-2px); }
.pill.amber:hover { border-color: var(--amber); color: var(--amber); background: rgba(255, 170, 0, 0.08); box-shadow: 0 0 16px rgba(255, 170, 0, 0.3); }

/* ---------- PROJECTS ---------- */
.projects-track { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; padding-bottom: 20px; }
.projects-track::-webkit-scrollbar { height: 4px; }
.projects-track::-webkit-scrollbar-track { background: var(--line); }
.projects-track::-webkit-scrollbar-thumb { background: var(--cyan-dim); }

.proj-card {
  position: relative;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(15, 15, 25, 0.9), rgba(10, 10, 18, 0.95));
  backdrop-filter: blur(10px);
  padding: 28px 24px;
  min-height: 440px;
  display: flex; flex-direction: column;
  scroll-snap-align: start;
  transform-style: preserve-3d;
  transition: transform 0.4s var(--ease), border-color 0.3s;
  will-change: transform; overflow: hidden;
}
.proj-card::before {
  content: ''; position: absolute; inset: -1px;
  border: 1px solid transparent;
  background: linear-gradient(var(--angle, 0deg), var(--cyan), transparent 30%, transparent 70%, var(--amber)) border-box;
  -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity 0.4s; pointer-events: none;
}
.proj-card:hover::before { opacity: 1; animation: rotate-angle 3s linear infinite; }
@property --angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@keyframes rotate-angle { to { --angle: 360deg; } }
.proj-card:hover { transform: perspective(1000px) rotateX(4deg) rotateY(-4deg) translateZ(20px); }

.proj-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; font-family: var(--mono); font-size: 11px; color: var(--text-faint); letter-spacing: 0.2em; }
.proj-head .idx { color: var(--amber); }
.proj-head .tag-small { color: var(--cyan); letter-spacing: 0.15em; text-transform: uppercase; }

.proj-card h3 { font-size: 1.5rem; margin-bottom: 12px; color: var(--text); letter-spacing: -0.02em; font-weight: 600; }
.proj-card .one-liner { font-family: var(--mono); font-size: 13px; color: var(--cyan); margin-bottom: 18px; line-height: 1.5; }
.proj-card .desc { color: var(--text-dim); font-size: 14px; margin-bottom: 20px; flex: 1; }
.proj-card .stack { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.proj-card .stack .chip { font-family: var(--mono); font-size: 10px; padding: 4px 8px; border: 1px solid var(--line); color: var(--text-dim); letter-spacing: 0.05em; }
.proj-card .metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 11px; color: var(--text-faint); }
.proj-card .metrics .m b { color: var(--cyan); font-weight: 600; font-size: 14px; display: block; }
.proj-card .viz { position: absolute; top: 60px; right: 20px; width: 80px; height: 80px; opacity: 0.4; transition: opacity 0.4s; }
.proj-card:hover .viz { opacity: 1; }

/* ---------- EXPERIENCE TIMELINE v2 ---------- */
.timeline { position: relative; padding-left: 48px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 12px; top: 20px; bottom: 20px;
  width: 1px;
  background: linear-gradient(180deg, var(--cyan), var(--amber) 60%, transparent);
  transform-origin: top;
  transform: scaleY(1);
  opacity: 0.25;
}
.timeline::after {
  content: '';
  position: absolute;
  left: 12px; top: 20px;
  width: 1px;
  height: calc((100% - 40px) * var(--tl-progress, 0));
  background: linear-gradient(180deg, var(--cyan), var(--amber));
  box-shadow: 0 0 8px var(--cyan);
  transition: height 0.15s linear;
}
.timeline-item { position: relative; margin-bottom: 32px; }
.tl-marker {
  position: absolute; left: -42px; top: 24px;
  width: 14px; height: 14px;
  border: 1px solid var(--cyan);
  background: var(--bg);
  transform: rotate(45deg);
  display: grid; place-items: center;
}
.tl-marker span {
  width: 4px; height: 4px; background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}

.tl-card {
  position: relative;
  padding: 22px 26px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(135deg, rgba(15,15,25,0.7), rgba(10,10,18,0.85));
  backdrop-filter: blur(8px);
  transition: all 0.4s var(--ease);
}
.tl-card:hover {
  border-color: var(--cyan);
  transform: translateX(6px);
  box-shadow: 0 0 24px rgba(0,245,255,0.12);
}
.tl-card::before {
  content: '';
  position: absolute;
  left: -26px; top: 30px;
  width: 26px; height: 1px;
  background: var(--cyan);
  opacity: 0.4;
}

.timeline-item .when { font-family: var(--mono); font-size: 11px; color: var(--amber); letter-spacing: 0.2em; margin-bottom: 8px; }
.timeline-item h3 { font-size: 1.35rem; color: var(--text); margin-bottom: 6px; font-weight: 600; }
.timeline-item .co { font-family: var(--mono); font-size: 13px; color: var(--cyan); margin-bottom: 16px; }
.timeline-item ul { list-style: none; color: var(--text-dim); font-size: 14px; }
.timeline-item ul li { position: relative; padding-left: 22px; margin-bottom: 10px; line-height: 1.6; }
.timeline-item ul li::before { content: '▸'; position: absolute; left: 0; top: 0; color: var(--cyan); font-family: var(--mono); }

.tl-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.tl-tags .chip { font-family: var(--mono); font-size: 10px; padding: 4px 10px; border: 1px solid var(--line); color: var(--text-dim); letter-spacing: 0.08em; }

/* ---------- ACHIEVEMENTS v2 — win cards with images ---------- */
.wins-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.win-card {
  position: relative;
  border: 1px solid var(--line-strong);
  background: rgba(10, 10, 18, 0.7);
  backdrop-filter: blur(8px);
  overflow: hidden;
  transition: all 0.4s var(--ease);
  display: flex;
  flex-direction: column;
}
.win-card::before {
  content: '';
  position: absolute; inset: -1px;
  border: 1px solid transparent;
  background: linear-gradient(var(--angle, 0deg), var(--amber), transparent 30%, transparent 70%, var(--cyan)) border-box;
  -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity 0.4s; pointer-events: none;
}
.win-card:hover {
  transform: translateY(-6px);
  border-color: var(--amber);
  box-shadow: 0 12px 40px rgba(255,170,0,0.18), 0 0 0 1px rgba(255,170,0,0.3);
}
.win-card:hover::before { opacity: 1; animation: rotate-angle 4s linear infinite; }

.win-img {
  position: relative;
  height: 220px;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-elev);
  overflow: hidden;
}
.win-img img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
}
.win-img::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(10,10,18,0.85) 100%);
  z-index: 2;
}
.win-shade {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent 60%, rgba(0,245,255,0.05));
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 1;
}
.win-rank {
  position: absolute;
  top: 16px; left: 16px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--amber);
  letter-spacing: 0.2em;
  padding: 6px 10px;
  border: 1px solid var(--amber);
  background: rgba(5,5,8,0.7);
  backdrop-filter: blur(4px);
  z-index: 2;
}
.win-year {
  position: absolute;
  top: 16px; right: 16px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text);
  letter-spacing: 0.2em;
  z-index: 2;
}

.win-body {
  padding: 24px 26px 26px;
  position: relative;
  z-index: 2;
}
.win-domain {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--cyan);
  letter-spacing: 0.25em;
  margin-bottom: 10px;
}
.win-card h4 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}
.win-body p {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 16px;
}
.win-meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-faint);
  letter-spacing: 0.15em;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

/* Certifications row */
.certs-row {
  margin-top: 48px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
}
.certs-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.certs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.cert {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  background: rgba(10,10,18,0.5);
  transition: all 0.3s var(--ease);
}
.cert:hover {
  border-color: var(--cyan);
  background: rgba(0,245,255,0.04);
}
.cert svg {
  width: 20px; height: 20px;
  color: var(--cyan);
  flex-shrink: 0;
}
.cert > div { display: flex; flex-direction: column; gap: 2px; font-family: var(--mono); font-size: 12px; }
.cert b { color: var(--text); font-size: 13px; font-weight: 500; }
.cert span { color: var(--text-faint); font-size: 10px; letter-spacing: 0.15em; }

/* ---------- CONTACT ---------- */
#contact { padding: 160px 0 100px; text-align: center; position: relative; }
.contact-huge { font-family: var(--mono); font-size: clamp(2.5rem, 7vw, 5.5rem); font-weight: 500; line-height: 1; letter-spacing: -0.03em; margin: 24px 0 48px; }
.contact-huge a { color: var(--cyan); border-bottom: 2px solid transparent; transition: border-color 0.3s; }
.contact-huge a:hover { border-color: var(--cyan); }

.socials { display: flex; justify-content: center; gap: 16px; margin-top: 32px; flex-wrap: wrap; }
.social-btn { width: 64px; height: 64px; border: 1px solid var(--line-strong); display: grid; place-items: center; color: var(--text-dim); transition: all 0.3s var(--ease); will-change: transform; background: rgba(10, 10, 18, 0.5); }
.social-btn:hover { border-color: var(--cyan); color: var(--cyan); box-shadow: 0 0 20px rgba(0, 245, 255, 0.3); }
.social-btn svg { width: 22px; height: 22px; }

footer { border-top: 1px solid var(--line); padding: 32px 48px; display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; color: var(--text-faint); letter-spacing: 0.15em; position: relative; z-index: 3; flex-wrap: wrap; gap: 12px; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1024px) {
  .about-grid { grid-template-columns: 1fr; gap: 48px; }
  .wins-grid { grid-template-columns: 1fr; }
  .skill-cat { grid-template-columns: 1fr; gap: 20px; }
  .projects-track { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  body { cursor: auto; font-size: 14px; }
  .cursor-dot, .cursor-ring { display: none; }
  button, a { cursor: pointer; }
  #three-bg, #three-hero { display: none !important; }
  .hud { display: none; }
  .mobile-bg { display: block; }
  .wrap { padding: 0 20px; }
  section { padding: 72px 0; }
  #about { padding-bottom: 32px; }
  #skills { padding-top: 32px; }
  .hero-grid { padding: 110px 20px 60px; }
  nav.topbar { padding: 14px 20px; }
  nav.topbar ul, nav.topbar .status { display: none; }
  .nav-resume { display: none; }
  .hamburger { display: block; }
  .hero-sidestats { display: none; }
  .scroll-cue { left: 20px; bottom: 20px; }
  .hero-name { font-size: clamp(2.4rem, 13vw, 4rem); padding: 4px 0; }
  .hero-ctas { margin-top: 36px; gap: 12px; }
  .btn { padding: 14px 22px; font-size: 12px; min-height: 48px; }
  .stats { grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
  .stat .num { font-size: 1.6rem; }
  .section-title { font-size: clamp(1.7rem, 7vw, 2.4rem); }
  .section-sub { margin-bottom: 36px; }
  .projects-track { grid-template-columns: 1fr; overflow-x: visible; gap: 16px; }
  .proj-card { min-height: auto; padding: 24px 20px; }
  .proj-card:hover { transform: none; }
  .proj-card .viz { width: 56px; height: 56px; top: 40px; right: 14px; }
  .timeline { padding-left: 28px; }
  .tl-marker { left: -22px; }
  .tl-card { padding: 18px 20px; }
  .tl-card::before { left: -12px; width: 12px; }
  .role-flip { min-width: 220px; }
  .wins-grid { gap: 16px; }
  .win-img { height: 180px; }
  .win-body { padding: 20px; }
  .certs-grid { grid-template-columns: 1fr; }
  .contact-huge { font-size: clamp(2rem, 9vw, 3.2rem); margin: 16px 0 32px; }
  .social-btn { width: 56px; height: 56px; min-width: 48px; min-height: 48px; }
  .skill-cat { padding: 20px 0; }
  .skill-cat .tags { gap: 6px; }
  .pill { padding: 7px 12px; font-size: 11px; }
  footer { padding: 24px 20px; flex-direction: column; align-items: flex-start; }
  .ascii-frame { padding: 14px; }
  .about-copy h3 { font-size: 1.3rem; }
  .about-copy p { font-size: 14px; }
}
@media (max-width: 420px) {
  .hero-meta { gap: 16px; font-size: 10px; }
  .hero-meta span { flex: 1 1 40%; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats .stat:last-child { grid-column: span 2; }
  .win-meta { flex-direction: column; gap: 4px; }
}
@media (hover: none) {
  .proj-card.touched { border-color: var(--cyan); }
  .proj-card.touched::before { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
