/* =========================================================================
   hasnats.com — portfolio
   Palette is drawn from the HS logo: deep ink navy + signature teal.
   ========================================================================= */

@font-face {
  font-family: "Space Grotesk";
  src: url("/static/fonts/SpaceGrotesk-Variable.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/static/fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #050b12;
  --bg-2: #081420;
  --ink: #091b2b;
  --surface: rgba(255, 255, 255, 0.028);
  --surface-2: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.075);
  --border-2: rgba(255, 255, 255, 0.14);
  --text: #e9f1f4;
  --text-2: #b4c2cc;
  --muted: #7d8f9d;

  --teal: #3aa0a5;
  --teal-bright: #5ee6dc;
  --blue: #5b8cff;
  --violet: #9b87f5;
  --accent: var(--teal-bright);
  --grad: linear-gradient(115deg, #5ee6dc 0%, #3aa0a5 35%, #5b8cff 70%, #9b87f5 100%);

  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --radius: 20px;
  --radius-sm: 12px;
  --container: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --nav-h: 72px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.7);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.08; letter-spacing: -0.03em; margin: 0; font-weight: 600; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
::selection { background: rgba(94, 230, 220, 0.3); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.icon { width: 1.1em; height: 1.1em; flex: none; }
.muted { color: var(--muted); }
em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
kbd {
  font-family: var(--font-mono); font-size: 11px; line-height: 1;
  padding: 4px 6px; border-radius: 6px;
  border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text-2);
}

/* Grid children may shrink below their content (long code lines, emails). */
.hero-grid > *, .about-grid > *, .contact-card > *, .xp > *, .work > *, .services > *, .stack > * { min-width: 0; }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; padding: 8px 14px; border-radius: 8px; background: var(--accent); color: var(--bg); }
.skip:focus { left: 8px; }

/* ---------- Ambient background ---------- */
.bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.bg-aurora span {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.55;
  animation: drift 26s var(--ease) infinite alternate;
}
.bg-aurora span:nth-child(1) { width: 55vw; height: 55vw; left: -12vw; top: -18vw; background: radial-gradient(circle, rgba(58, 160, 165, 0.55), transparent 65%); }
.bg-aurora span:nth-child(2) { width: 45vw; height: 45vw; right: -10vw; top: 10vh; background: radial-gradient(circle, rgba(91, 140, 255, 0.35), transparent 65%); animation-duration: 32s; animation-delay: -8s; }
.bg-aurora span:nth-child(3) { width: 40vw; height: 40vw; left: 30vw; top: 60vh; background: radial-gradient(circle, rgba(155, 135, 245, 0.22), transparent 65%); animation-duration: 38s; animation-delay: -16s; }
@keyframes drift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(6vw, 4vh, 0) scale(1.12); }
  100% { transform: translate3d(-4vw, 8vh, 0) scale(0.95); }
}
.bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
}
.bg-noise {
  position: absolute; inset: -50%; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.cursor-glow {
  position: fixed; left: 0; top: 0; z-index: -1; pointer-events: none;
  width: 600px; height: 600px; margin: -300px 0 0 -300px; border-radius: 50%;
  background: radial-gradient(circle, rgba(94, 230, 220, 0.07), transparent 60%);
  transform: translate3d(var(--cx, -1000px), var(--cy, -1000px), 0);
  transition: opacity 0.4s;
}
.progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60;
  background: var(--grad); transform-origin: 0 50%; transform: scaleX(var(--p, 0));
}

/* ---------- Buttons & small parts ---------- */
.btn {
  --bx: 0px; --by: 0px;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 50px; padding: 0 24px; border-radius: 999px;
  font-weight: 600; font-size: 15px; letter-spacing: -0.01em; white-space: nowrap;
  transform: translate3d(var(--bx), var(--by), 0);
  transition: transform 0.35s var(--ease), background 0.3s, border-color 0.3s, box-shadow 0.3s, color 0.3s;
}
.btn .icon { transition: transform 0.3s var(--ease); }
.btn:hover .icon:last-child { transform: translateX(3px); }
.btn-primary {
  color: #03161a;
  background: linear-gradient(135deg, #7ff3ea, #3fc3bb 55%, #3aa0a5);
  box-shadow: 0 10px 40px -10px rgba(94, 230, 220, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.btn-primary:hover { box-shadow: 0 16px 50px -8px rgba(94, 230, 220, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.6); }
.btn-ghost { border: 1px solid var(--border-2); background: rgba(255, 255, 255, 0.03); backdrop-filter: blur(10px); }
.btn-ghost:hover { border-color: rgba(94, 230, 220, 0.5); background: rgba(94, 230, 220, 0.06); }
.btn-sm { height: 40px; padding: 0 18px; font-size: 14px; }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--border); }
.icon-btn .icon { width: 20px; height: 20px; }

.pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 14px 7px 12px; border-radius: 999px;
  font-size: 13.5px; color: var(--text-2);
  border: 1px solid var(--border-2); background: rgba(8, 20, 32, 0.6); backdrop-filter: blur(8px);
  transition: border-color 0.3s, color 0.3s;
}
.pill:hover { border-color: rgba(94, 230, 220, 0.5); color: var(--text); }
.pill .icon { width: 14px; height: 14px; }
.dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: #34d399; }
.dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; background: #34d399; opacity: 0.4; animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite; }
@keyframes ping { 75%, 100% { transform: scale(2.2); opacity: 0; } }

.chips { display: flex; flex-wrap: wrap; align-items: flex-start; align-content: flex-start; gap: 6px; }
.chips li {
  font-family: var(--font-mono); font-size: 12px; line-height: 1;
  padding: 7px 10px; border-radius: 8px;
  color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border);
}
.chips-lg li { font-family: var(--font-body); font-size: 13.5px; padding: 9px 13px; border-radius: 10px; transition: border-color 0.25s, color 0.25s, background 0.25s; }
.chips-lg li:hover { color: var(--text); border-color: rgba(94, 230, 220, 0.45); background: rgba(94, 230, 220, 0.07); }

.ticks { display: grid; gap: 10px; }
.ticks li { position: relative; padding-left: 26px; color: var(--text-2); font-size: 15px; line-height: 1.55; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: 0.5em; width: 14px; height: 8px;
  border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg) scale(0.8); transform-origin: center; opacity: 0.85;
}

/* ---------- Cards with cursor spotlight ---------- */
.card {
  position: relative; isolation: isolate;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.card::before {
  content: ""; position: absolute; inset: -1px; z-index: -1; border-radius: inherit; padding: 1px;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, -100%), rgba(94, 230, 220, 0.55), transparent 45%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity 0.4s;
}
.card::after {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: radial-gradient(600px circle at var(--mx, 50%) var(--my, -100%), rgba(94, 230, 220, 0.06), transparent 40%);
  opacity: 0; transition: opacity 0.4s;
}
.card:hover::before, .card:hover::after { opacity: 1; }

/* ---------- Navigation ---------- */
.nav { position: fixed; inset: 0 0 auto; z-index: 50; height: var(--nav-h); transition: background 0.4s, border-color 0.4s, backdrop-filter 0.4s; border-bottom: 1px solid transparent; }
.nav.scrolled { background: rgba(5, 11, 18, 0.72); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); border-bottom-color: var(--border); }
.nav-inner { height: 100%; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-weight: 600; font-size: 17px; letter-spacing: -0.02em; margin-right: auto; }
/* The logo artwork is dark-on-white, so it sits on its own light tile like an app icon. */
.logo { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: #fefdfe; overflow: hidden; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 8px 24px -8px rgba(58, 160, 165, 0.6); flex: none; }
.logo img { width: 34px; height: auto; }
.nav-links { display: flex; gap: 4px; padding: 5px; border-radius: 999px; border: 1px solid var(--border); background: rgba(8, 20, 32, 0.5); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.nav-links a { position: relative; padding: 7px 14px; border-radius: 999px; font-size: 14px; color: var(--text-2); transition: color 0.25s, background 0.25s; }
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--text); background: rgba(255, 255, 255, 0.07); }
.nav-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.kbd-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 8px 0 12px;
  border-radius: 12px; border: 1px solid var(--border); color: var(--muted); font-size: 14px;
  transition: border-color 0.25s, color 0.25s;
}
.kbd-btn:hover { border-color: var(--border-2); color: var(--text); }
.kbd-btn .icon { width: 16px; height: 16px; }
.menu-btn { display: none; }
.mobile-menu { display: none; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: min(100vh, 1000px); min-height: min(100svh, 1000px); display: flex; align-items: center; padding: calc(var(--nav-h) + 48px) 0 96px; }
.hero-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero-copy { display: grid; gap: 26px; justify-items: start; }
.hero-title { display: grid; gap: 10px; }
.hero-hi { font-size: clamp(18px, 2vw, 22px); font-weight: 500; letter-spacing: -0.01em; color: var(--accent); font-family: var(--font-mono); }
.hero-headline {
  font-size: clamp(44px, 6.6vw, 88px); font-weight: 600; letter-spacing: -0.045em; line-height: 0.98;
  background: linear-gradient(180deg, #ffffff 30%, rgba(233, 241, 244, 0.55)); -webkit-background-clip: text; background-clip: text; color: transparent;
  text-wrap: balance;
}
.hero-rotator { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; font-family: var(--font-display); font-size: clamp(20px, 2.4vw, 28px); font-weight: 500; letter-spacing: -0.02em; }
.rotator { position: relative; display: inline-block; min-height: 1.3em; }
.rotator span { display: inline-block; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rotator::after { content: ""; display: inline-block; width: 3px; height: 1em; margin-left: 4px; vertical-align: -0.12em; background: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero-intro { max-width: 560px; font-size: clamp(16px, 1.4vw, 18px); color: var(--text-2); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 14px; color: var(--muted); }
.hero-meta li, .hero-meta a { display: inline-flex; align-items: center; gap: 8px; }
.hero-meta a { transition: color 0.25s; }
.hero-meta a:hover { color: var(--text); }

.hero-visual { position: relative; display: grid; place-items: center; min-height: 460px; perspective: 1200px; }
.orbit { position: absolute; inset: 50% auto auto 50%; width: 0; height: 0; }
.orbit-ring { position: absolute; left: 50%; top: 50%; border: 1px dashed rgba(255, 255, 255, 0.08); border-radius: 50%; animation: spin linear infinite; }
.orbit-ring.r1 { width: 340px; height: 340px; margin: -170px; animation-duration: var(--dur); }
.orbit-ring.r2 { width: 460px; height: 460px; margin: -230px; animation-duration: var(--dur); animation-direction: reverse; }
.orbit-ring.r3 { width: 580px; height: 580px; margin: -290px; animation-duration: var(--dur); border-color: rgba(255, 255, 255, 0.05); }
/* Each label is a zero-size anchor pivoting around the ring's centre; the inner
   <i> counter-rotates so the text stays upright while the ring spins. */
.orbit-ring span { position: absolute; left: 50%; top: 0; width: 0; height: 0; transform-origin: 0 var(--r); rotate: var(--a); }
.orbit-ring i {
  position: absolute; translate: -50% -50%; rotate: calc(var(--a) * -1);
  animation: spin var(--dur) linear infinite; animation-direction: var(--counter);
  font-style: normal; font-family: var(--font-mono); font-size: 11.5px; color: var(--text-2);
  padding: 5px 10px; border-radius: 999px; background: rgba(8, 20, 32, 0.85); border: 1px solid var(--border-2);
  white-space: nowrap;
}
.orbit-ring.r1 { --r: 170px; --dur: 40s; --counter: reverse; }
.orbit-ring.r2 { --r: 230px; --dur: 60s; --counter: normal; }
.orbit-ring.r3 { --r: 290px; --dur: 90s; --counter: reverse; }
@keyframes spin { to { transform: rotate(360deg); } }

.code-card {
  position: relative; z-index: 1; margin: 0; width: min(100%, 470px);
  border-radius: 18px; overflow: hidden;
  background: linear-gradient(180deg, rgba(12, 26, 40, 0.92), rgba(6, 14, 22, 0.94));
  border: 1px solid var(--border-2);
  box-shadow: 0 50px 120px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(94, 230, 220, 0.05), 0 0 80px -20px rgba(58, 160, 165, 0.45);
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.5s var(--ease);
  backdrop-filter: blur(20px);
}
.code-head { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--border); background: rgba(255, 255, 255, 0.02); }
.lights { display: flex; gap: 7px; }
.lights i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.lights i:nth-child(2) { background: #febc2e; } .lights i:nth-child(3) { background: #28c840; }
.code-file { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-2); }
.code-badge { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--accent); padding: 3px 8px; border-radius: 6px; background: rgba(94, 230, 220, 0.1); }
.code-body { margin: 0; padding: 20px 20px 18px; font-family: var(--font-mono); font-size: 13.5px; line-height: 1.8; color: #d6e2ea; overflow-x: auto; }
.code-body .c { color: #5f7384; font-style: italic; }
.code-body .k { color: #c792ea; }
.code-body .t { color: #5ee6dc; }
.code-body .s { color: #c3e88d; }
.code-body .n { color: #f78c6c; }
.code-body .f { color: #82aaff; }
.caret { display: inline-block; width: 8px; height: 1.1em; vertical-align: -0.2em; margin-left: 2px; background: var(--accent); animation: blink 1s steps(1) infinite; }
.code-foot { padding: 11px 20px; border-top: 1px solid var(--border); font-family: var(--font-mono); font-size: 12px; color: var(--text-2); }
.code-foot .ok { color: #34d399; }

.scroll-cue { position: absolute; left: 50%; bottom: 28px; translate: -50% 0; width: 26px; height: 42px; border-radius: 999px; border: 1.5px solid var(--border-2); }
.scroll-cue span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 4px; background: var(--accent); animation: cue 2s var(--ease) infinite; }
@keyframes cue { 0% { transform: translateY(0); opacity: 1; } 80% { transform: translateY(14px); opacity: 0; } 100% { opacity: 0; } }

/* ---------- Companies marquee ---------- */
.companies { padding: 20px 0 40px; }
.companies-label { padding: 0 var(--gutter); text-align: center; font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 26px; }
.marquee { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent); }
.marquee-track { display: flex; align-items: center; gap: 24px; padding: 8px 0; width: max-content; animation: marquee 32s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
/* Logos keep their real artwork on soft light tiles; greyscale until hovered. */
.marquee-track a {
  flex: none; display: grid; place-items: center; height: 72px; padding: 0 26px; border-radius: 16px;
  background: rgba(240, 246, 248, 0.9); box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.7);
  transition: background 0.3s, transform 0.4s var(--ease);
}
.marquee-track img { height: 34px; width: auto; filter: grayscale(1) contrast(1.1); opacity: 0.75; transition: filter 0.3s, opacity 0.3s; }
.marquee-track img[src*="everylisting"] { height: 68px; margin: -8px 0; }
.marquee-track a:hover { background: #fff; transform: translateY(-3px); }
.marquee-track a:hover img { filter: none; opacity: 1; }
@keyframes marquee { to { transform: translateX(calc(-50% - 12px)); } }

/* ---------- Sections ---------- */
.section { padding: clamp(80px, 11vw, 140px) 0; position: relative; }
.section-head { display: grid; gap: 18px; max-width: 780px; margin-bottom: clamp(40px, 6vw, 64px); }
.section-head h2 { font-size: clamp(34px, 4.8vw, 60px); text-wrap: balance; }
.section-head p { font-size: 18px; color: var(--text-2); max-width: 560px; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; opacity: 0.7; }

/* About */
.about-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: start; }
.about-copy { display: grid; gap: 20px; font-size: 17.5px; color: var(--text-2); }
.about-copy p:first-child { font-size: 21px; color: var(--text); line-height: 1.55; }
.edu { display: flex; align-items: center; gap: 14px; margin-top: 10px; padding: 16px 18px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); }
.edu-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: rgba(94, 230, 220, 0.1); color: var(--accent); }
.edu-icon .icon { width: 22px; height: 22px; }
.edu strong { display: block; color: var(--text); font-size: 15.5px; }
.edu span { font-size: 14px; color: var(--muted); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stat { padding: 28px 24px; display: grid; gap: 6px; }
.stat-value { font-family: var(--font-display); font-size: clamp(44px, 5vw, 64px); font-weight: 600; letter-spacing: -0.05em; line-height: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-label { font-size: 14px; color: var(--muted); }

/* Services */
.services { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.service { padding: 28px 24px 30px; display: grid; gap: 16px; align-content: start; transition: transform 0.5s var(--ease); }
.service:hover { transform: translateY(-4px); }
.service-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.service-icon { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 14px; color: var(--accent); background: linear-gradient(135deg, rgba(94, 230, 220, 0.16), rgba(91, 140, 255, 0.08)); border: 1px solid rgba(94, 230, 220, 0.2); }
.service-icon .icon { width: 24px; height: 24px; }
.service-num { font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.service h3 { font-size: 21px; letter-spacing: -0.02em; }
.service p { color: var(--text-2); font-size: 15px; }
.service .ticks li { font-size: 14px; }

/* Work */
.work { display: grid; grid-template-columns: repeat(6, 1fr); gap: 18px; }
.project { grid-column: span 2; display: flex; flex-direction: column; overflow: hidden; transition: transform 0.5s var(--ease); }
.project.featured { grid-column: span 3; }
.project:hover { transform: translateY(-5px); }
.project-art {
  position: relative; height: 170px; overflow: hidden; border-bottom: 1px solid var(--border);
  background:
    radial-gradient(circle at 20% 110%, color-mix(in srgb, var(--accent) 55%, transparent), transparent 55%),
    radial-gradient(circle at 90% -10%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 50%),
    linear-gradient(135deg, #0b1b2a, #07111b);
}
.project.featured .project-art { height: 220px; }
.project-art::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 28px 28px; mask-image: linear-gradient(180deg, #000, transparent); -webkit-mask-image: linear-gradient(180deg, #000, transparent);
}
.project-mono {
  position: absolute; right: 22px; bottom: -34px;
  font-family: var(--font-display); font-weight: 700; font-size: 190px; line-height: 1; letter-spacing: -0.06em;
  color: transparent; -webkit-text-stroke: 1.5px color-mix(in srgb, var(--accent) 70%, white);
  opacity: 0.6; transition: transform 0.7s var(--ease), opacity 0.4s;
}
.project.featured .project-mono { font-size: 250px; }
.project:hover .project-mono { transform: translateY(-10px) rotate(-4deg); opacity: 0.9; }
.project-index { position: absolute; left: 22px; top: 18px; font-family: var(--font-mono); font-size: 12px; color: rgba(255, 255, 255, 0.6); padding: 4px 9px; border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 999px; background: rgba(0, 0, 0, 0.25); }
.project-body { display: grid; gap: 14px; padding: 24px 24px 22px; flex: 1; align-content: start; }
.project-kind { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em; color: var(--accent); color: color-mix(in srgb, var(--accent) 85%, white); }
.project h3 { font-size: 26px; }
.project-body > p { color: var(--text-2); font-size: 15px; }
.project .ticks li { font-size: 14px; }
.project .ticks li::before { border-color: var(--accent); }
.project-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-top: auto; padding-top: 8px; }
.project-link { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border-2); transition: background 0.3s, color 0.3s, transform 0.4s var(--ease), border-color 0.3s; }
.project-link:hover { background: var(--accent); color: #03161a; border-color: transparent; transform: rotate(45deg); }

/* Experience */
.xp { display: grid; grid-template-columns: 260px 1fr; gap: 28px; align-items: start; }
.xp-tabs { position: relative; display: grid; border-left: 1px solid var(--border); }
.xp-tabs button { display: grid; gap: 2px; text-align: left; padding: 14px 18px 14px 22px; border-radius: 0 12px 12px 0; transition: background 0.25s, color 0.25s; color: var(--muted); }
.xp-tabs button:hover { background: var(--surface); color: var(--text-2); }
.xp-tabs button[aria-selected="true"] { color: var(--text); background: linear-gradient(90deg, rgba(94, 230, 220, 0.08), transparent); }
.xp-tab-company { font-family: var(--font-display); font-size: 16.5px; font-weight: 500; }
.xp-tab-date { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); }
.xp-indicator { position: absolute; left: -1px; top: 0; width: 2px; height: var(--h, 60px); background: var(--accent); box-shadow: 0 0 12px var(--accent); transform: translateY(var(--y, 0)); transition: transform 0.45s var(--ease), height 0.45s var(--ease); }
.xp-panel { padding: clamp(24px, 3.5vw, 40px); display: grid; gap: 20px; }
.js .xp-panel[data-inactive] { display: none; }
.xp-panel.enter { animation: fadeUp 0.5s var(--ease); }
.xp-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 16px; }
.xp-head h3 { font-size: clamp(22px, 2.4vw, 28px); }
.xp-head h3 .at { color: var(--muted); font-weight: 400; }
.xp-head h3 a { color: var(--accent); background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size 0.35s var(--ease); }
.xp-head h3 a:hover { background-size: 100% 1px; }
.xp-date { margin-top: 8px; font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.live { color: #34d399; margin-left: 6px; }
.xp-summary { font-size: 17px; color: var(--text); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* Stack */
.stack { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.stack-group { grid-column: span 4; padding: 26px 24px; display: grid; gap: 18px; align-content: start; }
/* Rows repeat as 2 wide + 3 narrow, so any number of groups tiles cleanly. */
.stack-group:nth-child(5n + 1), .stack-group:nth-child(5n + 2) { grid-column: span 6; }
.stack-group h3 { display: flex; align-items: center; gap: 12px; font-size: 18px; }
.stack-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: var(--accent); background: rgba(94, 230, 220, 0.1); }
.stack-icon .icon { width: 18px; height: 18px; }

/* Contact */
.contact-card { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 64px); padding: clamp(28px, 5vw, 64px); overflow: hidden; }
.contact-glow { position: absolute; z-index: -1; width: 600px; height: 600px; left: -200px; top: -300px; border-radius: 50%; background: radial-gradient(circle, rgba(58, 160, 165, 0.35), transparent 60%); filter: blur(20px); pointer-events: none; }
.contact-copy { display: grid; gap: 22px; align-content: start; }
.contact-copy h2 { font-size: clamp(32px, 4vw, 50px); text-wrap: balance; }
.contact-copy > p { color: var(--text-2); font-size: 17px; }
.email-copy {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 12px 12px 14px; border-radius: 16px; text-align: left;
  border: 1px solid var(--border-2); background: rgba(5, 11, 18, 0.5); transition: border-color 0.3s, background 0.3s;
}
.email-copy:hover { border-color: rgba(94, 230, 220, 0.5); background: rgba(94, 230, 220, 0.05); }
.email-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: rgba(94, 230, 220, 0.12); color: var(--accent); flex: none; }
.email-text { font-family: var(--font-display); font-size: clamp(15px, 1.7vw, 19px); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.email-action { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; font-size: 13px; color: var(--text-2); background: var(--surface-2); flex: none; }
.email-action .icon { width: 15px; height: 15px; }
.contact-links { display: grid; gap: 4px; }
.contact-links a { display: flex; align-items: center; gap: 14px; padding: 12px 6px; border-bottom: 1px solid var(--border); color: var(--text-2); transition: color 0.25s, padding 0.35s var(--ease); }
.contact-links a:hover { color: var(--text); padding-left: 12px; }
.contact-links small { margin-left: auto; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.contact-links .icon:last-child { width: 16px; height: 16px; opacity: 0.6; }

.contact-form { display: grid; gap: 16px; align-content: start; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 8px; font-size: 13.5px; color: var(--text-2); }
.field input, .field select, .field textarea {
  width: 100%; padding: 13px 15px; border-radius: 12px; font-size: 15px;
  background: rgba(5, 11, 18, 0.6); border: 1px solid var(--border-2); color: var(--text);
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s; resize: vertical;
}
.field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%237d8f9d' stroke-width='2'%3E%3Cpath d='m2 4 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 15px center; padding-right: 40px; }
.field ::placeholder { color: #53636f; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: rgba(94, 230, 220, 0.6); box-shadow: 0 0 0 4px rgba(94, 230, 220, 0.12); background: rgba(5, 11, 18, 0.85); }
.field [aria-invalid="true"] { border-color: #f87171; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { min-height: 1.4em; font-size: 14px; color: var(--text-2); }
.form-status.ok { color: #34d399; }
.form-status.err { color: #fca5a5; }
.form-status a { text-decoration: underline; }
.btn[disabled] { opacity: 0.7; pointer-events: none; }

/* ---------- Footer ---------- */
.footer { padding: 40px 0 48px; border-top: 1px solid var(--border); }
.footer-inner { display: grid; grid-template-columns: 1fr auto; gap: 20px 32px; align-items: center; }
.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-brand strong { display: block; font-family: var(--font-display); font-weight: 600; }
.footer-brand span { font-size: 13.5px; color: var(--muted); }
.footer-links { display: flex; gap: 8px; }
.footer-links a { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--border); color: var(--text-2); transition: color 0.25s, border-color 0.25s, transform 0.35s var(--ease); }
.footer-links a:hover { color: var(--accent); border-color: rgba(94, 230, 220, 0.4); transform: translateY(-3px); }
.footer-note { font-size: 13.5px; color: var(--muted); }
.to-top { justify-self: end; font-size: 13.5px; color: var(--muted); transition: color 0.25s; }
.to-top:hover { color: var(--text); }

/* ---------- Command palette ---------- */
.palette { position: fixed; inset: 0; z-index: 80; display: grid; place-items: start center; padding: 14vh 16px 16px; }
.palette[hidden] { display: none; }
.palette-backdrop { position: absolute; inset: 0; background: rgba(2, 6, 10, 0.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade 0.25s; }
.palette-panel { position: relative; width: min(600px, 100%); border-radius: 18px; overflow: hidden; border: 1px solid var(--border-2); background: rgba(9, 20, 31, 0.96); box-shadow: 0 40px 120px -20px rgba(0, 0, 0, 0.9), 0 0 60px -20px rgba(58, 160, 165, 0.4); animation: pop 0.3s var(--ease); }
.palette-search { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); color: var(--muted); }
.palette-search input { flex: 1; min-width: 0; background: none; border: 0; outline: none; font-size: 16px; color: var(--text); }
.palette-list { max-height: min(52vh, 420px); overflow-y: auto; padding: 8px; }
.palette-group { padding: 10px 12px 6px; font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.palette-list [data-palette-item] { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border-radius: 10px; font-size: 15px; color: var(--text-2); text-align: left; }
.palette-list [data-palette-item] small { margin-left: auto; font-size: 12px; color: var(--muted); font-family: var(--font-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-list [data-palette-item].active { background: rgba(94, 230, 220, 0.1); color: var(--text); }
.palette-list [data-palette-item].active .icon { color: var(--accent); }
.palette-foot { display: flex; gap: 18px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.palette-foot kbd { margin-right: 3px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(-10px) scale(0.98); } }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 90; translate: -50% 20px; padding: 12px 18px; border-radius: 12px; font-size: 14px; background: rgba(12, 28, 40, 0.95); border: 1px solid rgba(94, 230, 220, 0.35); box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.8); opacity: 0; pointer-events: none; transition: opacity 0.3s, translate 0.4s var(--ease); }
.toast.show { opacity: 1; translate: -50% 0; }

/* ---------- Reveal on scroll ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); transition-delay: calc(var(--d, 0) * 70ms); }
.js [data-reveal].in { opacity: 1; transform: none; }
.js .hero [data-reveal] { transition-delay: calc(var(--i, 0) * 90ms + 100ms); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .services { grid-template-columns: repeat(2, 1fr); }
  .kbd-btn span, .kbd-btn kbd { display: none; }
  .kbd-btn { padding: 0; width: 40px; justify-content: center; }
}
@media (max-width: 960px) {
  .nav-links, .nav-cta { display: none; }
  .menu-btn { display: inline-grid; }
  .mobile-menu {
    position: absolute; left: 12px; right: 12px; top: calc(var(--nav-h) - 4px);
    display: grid; gap: 2px; padding: 10px; border-radius: 18px;
    background: rgba(8, 18, 28, 0.97); border: 1px solid var(--border-2); box-shadow: var(--shadow);
    opacity: 0; transform: translateY(-8px); pointer-events: none; transition: opacity 0.25s, transform 0.35s var(--ease);
  }
  .mobile-menu a { padding: 13px 14px; border-radius: 10px; font-size: 16px; color: var(--text-2); }
  .mobile-menu a:hover { background: var(--surface-2); color: var(--text); }
  .nav.open .mobile-menu { opacity: 1; transform: none; pointer-events: auto; }
  .nav.open { background: rgba(5, 11, 18, 0.9); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }

  .hero-grid, .about-grid, .contact-card { grid-template-columns: 1fr; }
  .hero-visual { min-height: 400px; }
  .work { grid-template-columns: 1fr 1fr; }
  .project, .project.featured { grid-column: span 1; }
  .project.featured:first-child { grid-column: span 2; }
  .xp { grid-template-columns: 1fr; }
  .xp-tabs { display: flex; overflow-x: auto; border-left: 0; border-bottom: 1px solid var(--border); scrollbar-width: none; margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter); }
  .xp-tabs::-webkit-scrollbar { display: none; }
  .xp-tabs button { flex: none; border-radius: 12px 12px 0 0; padding: 12px 16px; }
  .xp-tabs button[aria-selected="true"] { background: linear-gradient(0deg, rgba(94, 230, 220, 0.1), transparent); }
  .xp-indicator { display: none; }
  .xp-tabs button[aria-selected="true"] { box-shadow: inset 0 -2px 0 var(--accent); }
  .stack-group, .stack-group:nth-child(5n + 1), .stack-group:nth-child(5n + 2) { grid-column: span 6; }
}
@media (max-width: 640px) {
  :root { --nav-h: 64px; }
  .brand-name { display: none; }
  .hero { padding-bottom: 72px; }
  .hero-headline { font-size: clamp(40px, 12vw, 56px); }
  .hero-actions .btn { flex: 1; }
  .hero-visual { min-height: 0; margin: 12px calc(var(--gutter) * -0.5) 0; }
  .orbit { display: none; }
  .code-body { font-size: 12px; padding: 16px; }
  .scroll-cue { display: none; }
  .services, .work, .field-row { grid-template-columns: 1fr; }
  .stats { gap: 12px; }
  .project.featured:first-child { grid-column: span 1; }
  .stack-group, .stack-group:nth-child(5n + 1), .stack-group:nth-child(5n + 2) { grid-column: span 12; }
  .stat { padding: 22px 20px; }
  .marquee-track a { height: 60px; padding: 0 20px; }
  .marquee-track img { height: 28px; }
  .footer-inner { grid-template-columns: 1fr; }
  .to-top { justify-self: start; }
  .email-action span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .marquee-track { animation: none; flex-wrap: wrap; justify-content: center; width: auto; }
  .marquee-track a[aria-hidden] { display: none; }
  .js [data-reveal] { opacity: 1; transform: none; }
}
