:root {
  --bg: #070b16;
  --bg-2: #0d1324;
  --card: #0f172a;
  --line: #1e293b;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --accent: #34d399;
  --accent-2: #60a5fa;
  --warn: #f59e0b;
  --radius: 16px;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(96,165,250,.12), transparent 60%),
    radial-gradient(700px 400px at -10% 20%, rgba(52,211,153,.08), transparent 60%),
    var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; display: block; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

/* NAV */
.nav {
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(12px);
  background: rgba(7,11,22,.72);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; text-decoration: none; }
.logo-mark {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px;
  background: var(--card); border: 1px solid var(--line); color: var(--accent); font-size: 13px;
}
.nav-links { display: flex; gap: 24px; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 500; transition: color .2s; }
.nav-links a:hover { color: var(--text); }

/* HERO */
.hero { padding: 96px 0 72px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 13px; color: var(--muted);
  border: 1px solid var(--line); padding: 6px 14px; border-radius: 999px; background: var(--bg-2);
}
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(52,211,153,.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(52,211,153,0); } 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); } }

h1 { font-size: clamp(2.3rem, 6vw, 4.2rem); line-height: 1.08; letter-spacing: -.03em; font-weight: 800; margin: 24px 0 20px; max-width: 16ch; }
.grad { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { color: var(--muted); font-size: 1.125rem; max-width: 62ch; }

.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.btn {
  display: inline-flex; align-items: center; padding: 12px 22px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg-2); text-decoration: none; font-weight: 600;
  transition: transform .15s, border-color .2s, background .2s;
}
.btn:hover { transform: translateY(-2px); border-color: #334155; }
.btn-primary { background: var(--accent); color: #052e1f; border-color: var(--accent); }
.btn-primary:hover { background: #6ee7b7; border-color: #6ee7b7; }

.stats { display: flex; flex-wrap: wrap; gap: 40px; margin-top: 56px; }
.stats dt { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; }
.stats dd { color: var(--muted); font-size: 14px; }

/* SECTIONS */
.section { padding: 72px 0; border-top: 1px solid var(--line); }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.3rem); letter-spacing: -.02em; }
.section-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; margin-bottom: 32px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--muted); transition: all .2s;
}
.chip:hover { color: var(--text); }
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }

/* PROJECT GRID */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.card { position: relative; transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--ty, 0)); }
.card:hover { --ty: -6px; border-color: #334155; box-shadow: 0 30px 60px -25px rgba(0,0,0,.8), 0 0 0 1px rgba(52,211,153,.15); }
/* cursor spotlight on cards */
.card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(52,211,153,.12), transparent 45%);
}
.card:hover::after { opacity: 1; }
.card.hidden { display: none; }

.thumb { aspect-ratio: 400 / 220; background: var(--bg-2); border-bottom: 1px solid var(--line); overflow: hidden; }
.thumb svg { width: 100%; height: 100%; display: block; }
.thumb-img img { width: 100%; height: 100%; object-fit: cover; object-position: top left; transition: transform .5s; }
.card:hover .thumb-img img { transform: scale(1.03); }
.thumb-globe { background: radial-gradient(circle at 50% 50%, #111c3a, #070b16); }
.thumb-hand { background: linear-gradient(135deg, #111827, #0b1020); }
.thumb-aqi { background: linear-gradient(180deg, #0f172a, #1c1410); }
.thumb-jarvis { background: radial-gradient(circle at 50% 50%, #0c2a33, #070b16 70%); }

.card-body { padding: 24px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card h3 { font-size: 1.25rem; letter-spacing: -.01em; }
.card p { color: var(--muted); font-size: 15px; }

.badge { font-family: var(--mono); font-size: 11px; white-space: nowrap; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.badge.live { color: var(--accent); border-color: rgba(52,211,153,.4); background: rgba(52,211,153,.08); }
.badge.wip { color: var(--warn); border-color: rgba(245,158,11,.4); background: rgba(245,158,11,.08); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; }
.tags li { font-family: var(--mono); font-size: 12px; padding: 3px 9px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--line); color: #cbd5e1; }

.links { display: flex; gap: 20px; margin-top: auto; padding-top: 6px; }
.links a { color: var(--accent); text-decoration: none; font-weight: 600; font-size: 15px; }
.links a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* SVG animations */
.spin { transform-origin: 200px 110px; animation: spin 14s linear infinite; }
.spin-rev { transform-origin: 200px 110px; animation: spin 22s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
.ping { transform-box: fill-box; transform-origin: center; animation: ping 1.8s ease-out infinite; }
@keyframes ping { 0% { transform: scale(.6); opacity: 1; } 100% { transform: scale(1.8); opacity: 0; } }
.orbit-dot { animation: blink 2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .3; } }

/* SKILLS */
.skills { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 32px; }
.skill-col { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.skill-col h3 { font-size: 13px; font-family: var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin-bottom: 12px; }
.skill-col ul { list-style: none; display: grid; gap: 8px; color: var(--muted); font-size: 15px; }
.skill-wide { grid-column: span 2; }
.skill-col .tech-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tech-list li { font-family: var(--mono); font-size: 12px; padding: 3px 9px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--line); color: #cbd5e1; }
.section-lead { margin-top: 12px; }

/* CONTACT / FOOTER */
.contact { text-align: center; }
.contact .lead { margin: 16px auto 0; }
.contact .hero-cta { justify-content: center; }
.footer { padding: 32px 0 48px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; text-align: center; }

/* RESPONSIVE */
@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
  .skills { grid-template-columns: repeat(2, 1fr); }
  .skill-wide { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .hero { padding: 64px 0 48px; }
  .nav-links { gap: 16px; }
  .nav-links a { font-size: 14px; }
  .logo-text { display: none; }
  .skills { grid-template-columns: 1fr; }
  .skill-wide { grid-column: auto; }
  .stats { gap: 28px; }
}

/* ===== Motion & engagement ===== */
.progress { position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%; transform-origin: 0 50%; transform: scaleX(var(--p, 0));
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.nav-links a.active { color: var(--text); }
.nav-links a { position: relative; }
.nav-links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; border-radius: 2px; background: var(--accent);
  transform: scaleX(0); transition: transform .25s; }
.nav-links a.active::after, .nav-links a:hover::after { transform: scaleX(1); }
.logo-mark { transition: transform .3s, box-shadow .3s; }
.logo:hover .logo-mark { transform: rotate(-8deg) scale(1.08); box-shadow: 0 0 20px rgba(52,211,153,.4); }

.cursor-glow { position: fixed; left: 0; top: 0; width: 520px; height: 520px; margin: -260px 0 0 -260px; border-radius: 50%; pointer-events: none; z-index: 0;
  background: radial-gradient(circle, rgba(96,165,250,.09), transparent 60%); transform: translate(var(--gx, -999px), var(--gy, -999px)); transition: opacity .4s; }
main, .footer { position: relative; z-index: 1; }

.hero-shell { position: relative; overflow: hidden; }
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .9;
  -webkit-mask-image: radial-gradient(ellipse at 70% 40%, #000 30%, transparent 75%), radial-gradient(ellipse 30% 70% at 0% 50%, #000 35%, transparent 100%); mask-image: radial-gradient(ellipse at 70% 40%, #000 30%, transparent 75%), radial-gradient(ellipse 30% 70% at 0% 50%, #000 35%, transparent 100%); }
.hero { position: relative; min-height: calc(100vh - 64px - 58px); display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.hero-text > * { animation: rise .8s cubic-bezier(.2,.7,.2,1) both; }
.hero-text > :nth-child(2) { animation-delay: .08s; } .hero-text > :nth-child(3) { animation-delay: .16s; }
.hero-text > :nth-child(4) { animation-delay: .24s; } .hero-text > :nth-child(5) { animation-delay: .32s; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } }

h1 { max-width: 22ch; }
.rotator { display: block; min-height: 1.1em; white-space: nowrap; }
@media (max-width: 760px) { .rotator { white-space: normal; min-height: 2.2em; } }
.rotator .grad { display: inline-block; background-size: 200% 100%; background-image: linear-gradient(90deg, var(--accent), var(--accent-2), #a78bfa, var(--accent));
  animation: shimmer 6s linear infinite; transition: opacity .35s, transform .35s, filter .35s; }
.rotator .grad.out { opacity: 0; transform: translateY(14px); filter: blur(6px); }
@keyframes shimmer { to { background-position: -200% 0; } }

.btn-primary { box-shadow: 0 10px 30px -10px rgba(52,211,153,.6); }
.btn-primary:hover { box-shadow: 0 14px 40px -8px rgba(52,211,153,.8); }

.stats > div { padding-left: 16px; border-left: 2px solid var(--line); transition: border-color .3s; }
.stats > div:hover { border-color: var(--accent); }
.stats dt { background: linear-gradient(180deg, #fff, #94a3b8); -webkit-background-clip: text; background-clip: text; color: transparent; font-variant-numeric: tabular-nums; }

.scroll-hint { position: absolute; bottom: 24px; left: 50%; width: 26px; height: 42px; margin-left: -13px; border: 2px solid #334155; border-radius: 14px; }
.scroll-hint span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--accent); animation: wheel 1.8s ease-in-out infinite; }
@keyframes wheel { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

.marquee { border-block: 1px solid var(--line); background: rgba(13,19,36,.6); overflow: hidden; padding: 16px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-track { display: flex; width: max-content; gap: 48px; animation: marquee 32s linear infinite; }
.marquee-track span { font-family: var(--mono); font-size: 14px; color: #64748b; white-space: nowrap; }
.marquee-track span::before { content: "◆"; color: var(--accent); margin-right: 48px; font-size: 9px; vertical-align: middle; opacity: .6; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

.num { font-family: var(--mono); font-size: .45em; color: var(--accent); vertical-align: middle; margin-right: 8px; letter-spacing: 0; }

.reveal { opacity: 0; translate: 0 28px; transition: opacity .7s cubic-bezier(.2,.7,.2,1), translate .7s cubic-bezier(.2,.7,.2,1), transform .25s, border-color .25s, box-shadow .25s; }
.reveal.in { opacity: 1; translate: 0 0; }
.no-js .reveal { opacity: 1; translate: none; }

.skill-col { transition: border-color .3s, transform .3s; }
.skill-col:hover { border-color: rgba(52,211,153,.35); transform: translateY(-3px); }
.tech-list li, .tags li { transition: border-color .2s, color .2s; }
.tech-list li:hover, .tags li:hover { border-color: var(--accent); color: var(--accent); }

.contact-box { position: relative; overflow: hidden; padding: 64px 24px; border-radius: 24px; border: 1px solid var(--line);
  background: radial-gradient(600px 300px at 50% 0%, rgba(52,211,153,.15), transparent 70%), var(--card); }
.contact-box::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--a, 0deg), transparent 70%, var(--accent), var(--accent-2), transparent);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: orbit 6s linear infinite; }
@property --a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes orbit { to { --a: 360deg; } }

@media (max-width: 560px) {
  .hero { min-height: auto; }
  .scroll-hint, .cursor-glow { display: none; }
}
@media (hover: none) { .cursor-glow { display: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; translate: none; }
}

/* ===== Hero v2: display type, aurora, floating project stack ===== */
h1, h2, .stats dt { font-family: "Bricolage Grotesque", Inter, system-ui, sans-serif; }
h1 { font-size: clamp(2.6rem, 4.4vw, 4.4rem); letter-spacing: -.045em; line-height: 1.02; max-width: none; }
.rotator { white-space: normal !important; min-height: 2.04em !important; }
.hero-text { position: relative; z-index: 6; }
.rot-wrap::after { content: ""; }
#rot::after { content: ""; display: inline-block; width: .08em; height: .85em; margin-left: .08em; vertical-align: -.05em;
  background: var(--accent); animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }

.aurora { position: absolute; inset: 0; pointer-events: none; filter: blur(70px); opacity: .55; }
.aurora i { position: absolute; border-radius: 50%; mix-blend-mode: screen; animation: drift 18s ease-in-out infinite alternate; }
.aurora i:nth-child(1) { width: 520px; height: 520px; right: 4%; top: 6%; background: #10b981; }
.aurora i:nth-child(2) { width: 460px; height: 460px; right: 22%; top: 30%; background: #3b82f6; animation-duration: 22s; animation-delay: -6s; }
.aurora i:nth-child(3) { width: 380px; height: 380px; right: -4%; top: 44%; background: #8b5cf6; animation-duration: 26s; animation-delay: -12s; }
@keyframes drift { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-60px, 40px) scale(1.15); } 100% { transform: translate(40px, -30px) scale(.95); } }
.aurora i { opacity: .35; }

.hero { display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 48px; }
.hero-text { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }

.hero-visual { position: relative; height: 520px; perspective: 1400px; animation: rise 1s .3s cubic-bezier(.2,.7,.2,1) both; }
.hero-visual > * { transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.shot { position: absolute; width: 78%; border-radius: 14px; overflow: hidden; background: #0b1222;
  border: 1px solid rgba(255,255,255,.08); box-shadow: 0 40px 80px -30px rgba(0,0,0,.9), 0 0 0 1px rgba(255,255,255,.03); }
.shot img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; display: block; }
.shot-bar { display: flex; align-items: center; gap: 6px; padding: 9px 12px; background: #0f172a; border-bottom: 1px solid var(--line); }
.shot-bar i { width: 9px; height: 9px; border-radius: 50%; background: #334155; }
.shot-bar i:nth-child(1) { background: #f87171; } .shot-bar i:nth-child(2) { background: #fbbf24; } .shot-bar i:nth-child(3) { background: #34d399; }
.shot-bar span { margin-left: 8px; font-family: var(--mono); font-size: 11px; color: #64748b; }
.shot-1 { left: 0; top: 0; transform: rotateY(-18deg) rotateX(8deg) translateZ(-80px); animation: bob 7s ease-in-out infinite; }
.shot-2 { right: 0; top: 110px; transform: rotateY(-18deg) rotateX(8deg) translateZ(0); animation: bob 8s -2s ease-in-out infinite; z-index: 2; }
.shot-3 { left: 8%; top: 250px; transform: rotateY(-18deg) rotateX(8deg) translateZ(60px); animation: bob 9s -4s ease-in-out infinite; z-index: 3; }
@keyframes bob { 50% { translate: 0 -14px; } }
.hero-visual:hover .shot-1 { transform: rotateY(-8deg) rotateX(4deg) translate(-30px, -20px); }
.hero-visual:hover .shot-2 { transform: rotateY(-8deg) rotateX(4deg) translate(30px, 0); }
.hero-visual:hover .shot-3 { transform: rotateY(-8deg) rotateX(4deg) translate(-10px, 30px); }

.float-chip { position: absolute; z-index: 5; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  font-family: var(--mono); font-size: 12px; color: #e2e8f0; white-space: nowrap;
  background: rgba(15,23,42,.75); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.1); box-shadow: 0 10px 30px -10px rgba(0,0,0,.8);
  animation: bob 6s ease-in-out infinite; }
.float-chip b { color: var(--accent); }
.float-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 10px #ef4444; animation: blink 1.4s infinite; }
.chip-a { left: 6%; top: -22px; }
.chip-b { right: -2%; top: 46px; animation-delay: -2s; } .chip-b b { color: #facc15; }
.chip-c { right: 4%; bottom: 20px; animation-delay: -4s; }

@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; }
  .hero-visual { height: 420px; max-width: 560px; width: 100%; margin-inline: auto; }
  .scroll-hint { display: none; }
}
@media (max-width: 560px) {
  .hero-visual { height: 300px; }
  .shot-2 { top: 70px; } .shot-3 { top: 150px; }
  .chip-a { left: 0; top: 20px; } .chip-b { display: none; } .chip-c { right: 0; bottom: 0; }
  .aurora { opacity: .35; }
}
@media (prefers-reduced-motion: reduce) { .aurora i, .shot, .float-chip { animation: none !important; } }
