/* ══════════════════════════════════════════════════════════
   Suresh Surkheti — Portfolio
   Design tokens → base → components → sections → responsive
   ══════════════════════════════════════════════════════════ */

/* ─────────────── TOKENS ─────────────── */
:root {
  /* accents (shared across themes) */
  --c1: #22d3ee;              /* cyan   */
  --c2: #818cf8;              /* indigo */
  --c3: #e879f9;              /* fuchsia*/
  --grad: linear-gradient(100deg, var(--c1), var(--c2) 55%, var(--c3));
  --grad-soft: linear-gradient(135deg, rgba(34,211,238,.18), rgba(232,121,249,.18));
  /* Foreground for text/icons sitting ON the gradient. The dark theme's accents are
     bright so near-black reads best; the light theme's are dark, so white does. */
  --on-accent: #04050a;

  /* Brand icon colours, themed: several are unreadable on a white surface. */
  --ic-html: #e2632f;
  --ic-css: #2f8ce2;
  --ic-js: #e8d44d;
  --ic-vue: #41b883;
  --ic-pyblue: #4b8bbe;
  --ic-py: #c32ec9;
  --ic-laravel: #f05340;
  --ic-ci: #ee4623;
  --ic-mysql: #4479a1;
  --ic-magento: #f26322;
  --ic-rest: #38bdf8;
  --ic-tailwind: #38bdf8;
  --ic-figma: #f24e1e;
  --ic-git: #f05033;
  --ic-ts: #3178c6;
  --ic-aws: #ff9900;
  --ic-terraform: #7b42bc;
  --ic-docker: #2496ed;
  --ic-node: #5fa04e;
  --ic-db: #00758f;
  --ic-test: #45ba4b;
  --ic-apple: #a2aaad;
  --ok: #34d399;              /* success / available */

  /* dark theme (default) */
  --bg: #05060a;
  --bg-2: #090b12;
  --surface: rgba(255, 255, 255, .045);
  --surface-2: rgba(255, 255, 255, .07);
  --stroke: rgba(255, 255, 255, .10);
  --stroke-str: rgba(255, 255, 255, .20);
  --text: #eef1f7;
  --text-dim: #a4adc0;
  --text-mute: #737d92;
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, .8);
  /* card-level elevation: what makes a surface read as a surface */
  --shadow-card: 0 16px 36px -22px rgba(0, 0, 0, .85);
  --shadow-card-hi: 0 30px 60px -28px rgba(0, 0, 0, .9);
  --glow: 0 0 40px -8px rgba(34, 211, 238, .45);
  --ink-accent: var(--c1);      /* accent tuned for small text */
  --track: rgba(255, 255, 255, .09);
  --field: rgba(255, 255, 255, .05);   /* recessed input fill */
  --band: rgba(255, 255, 255, .022);   /* alternating section ground */
  /* Ambient blobs are their own colours — the --c* accents are tuned for TEXT
     contrast, and washing a dark accent over a light ground gives grey. */
  --blob-1: #22d3ee;
  --blob-2: #e879f9;
  --blob-3: #818cf8;
  --blob-opacity: .5;

  /* metrics */
  --header-h: 76px;
  --header-h-scrolled: 64px;   /* header shrinks once the page scrolls */
  --pad-x: clamp(1.25rem, 6vw, 8rem);
  --r-sm: 12px;
  --r: 18px;
  --r-lg: 26px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);

  --font-head: "Sora", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

[data-theme="light"] {
  --bg: #eceff6;
  --bg-2: #e2e7f1;
  --surface: rgba(255, 255, 255, .9);
  --surface-2: #ffffff;
  --stroke: rgba(9, 14, 32, .13);
  --stroke-str: rgba(9, 14, 32, .26);
  --text: #0d1226;
  --text-dim: #45506b;
  --text-mute: #67718a;
  --shadow: 0 24px 60px -26px rgba(20, 30, 70, .28);
  --shadow-card: 0 10px 28px -14px rgba(19, 28, 64, .16), 0 2px 6px -2px rgba(19, 28, 64, .07);
  --shadow-card-hi: 0 26px 50px -20px rgba(19, 28, 64, .24), 0 4px 12px -4px rgba(19, 28, 64, .10);
  --glow: 0 0 40px -10px rgba(34, 145, 200, .35);
  --c1: #0e7490;
  --c2: #5b5bd6;
  --c3: #a21caf;
  --on-accent: #ffffff;

  --ic-html: #c25120;
  --ic-css: #2273bd;
  --ic-js: #8a6d0b;
  --ic-vue: #2b8560;
  --ic-pyblue: #37688d;
  --ic-py: #a8259e;
  --ic-laravel: #c23a2a;
  --ic-ci: #c03616;
  --ic-mysql: #31607f;
  --ic-magento: #c14a14;
  --ic-rest: #0e7490;
  --ic-tailwind: #0e7490;
  --ic-figma: #c23a12;
  --ic-git: #c23a22;
  --ic-ts: #2a5f9e;
  --ic-aws: #a35f00;
  --ic-terraform: #6535a0;
  --ic-docker: #1a6fae;
  --ic-node: #43752f;
  --ic-db: #00596b;
  --ic-test: #2f7d33;
  --ic-apple: #5f666a;
  --ok: #0f8a5f;
  --ink-accent: #0b6a80;
  --track: rgba(9, 14, 32, .12);
  --field: #f2f4fa;
  --band: rgba(255, 255, 255, .44);   /* light enough to still read as a band, sheer enough to let the aurora through */
  --blob-1: #7ee3f5;
  --blob-2: #f3b4fb;
  --blob-3: #b9b6fd;
  --blob-opacity: .62;
}

/* ─────────────── RESET / BASE ─────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* An author `display` value beats the UA sheet's [hidden] rule, so state it here. */
[hidden] { display: none !important; }

/* spam honeypot — hidden from people, visible to bots that fill everything in */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h-scrolled);
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  transition: background .5s var(--ease), color .5s var(--ease);
}

body.is-locked { overflow: hidden; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul { list-style: none; }

h1, h2, h3, h4, h5, .stat__num { font-family: var(--font-head); font-weight: 700; line-height: 1.12; letter-spacing: -.02em; }

::selection { background: var(--c1); color: var(--on-accent); }

/* scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: linear-gradient(var(--c1), var(--c3)); border-radius: 99px; }

:focus-visible { outline: 2px solid var(--c1); outline-offset: 3px; border-radius: 6px; }

.gradient-text {
  background: var(--grad);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: hueSlide 6s linear infinite;
}
@keyframes hueSlide { to { background-position: 220% 0; } }

/* ─────────────── PRELOADER ─────────────── */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: var(--bg);
  transition: opacity .7s var(--ease), visibility .7s;
}
.preloader.done { opacity: 0; visibility: hidden; }
.preloader__inner { text-align: center; width: min(320px, 70vw); }
.preloader__name { display: flex; justify-content: center; gap: .08em; font-family: var(--font-head); font-size: clamp(1.8rem, 7vw, 2.8rem); font-weight: 800; letter-spacing: .16em; }
.preloader__name span {
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: popIn .6s var(--ease) both, floatY 2.4s ease-in-out infinite;
  animation-delay: calc(.07s * var(--n, 0)), calc(.07s * var(--n, 0));
}
.preloader__name span:nth-child(1) { --n: 1 } .preloader__name span:nth-child(2) { --n: 2 }
.preloader__name span:nth-child(3) { --n: 3 } .preloader__name span:nth-child(4) { --n: 4 }
.preloader__name span:nth-child(5) { --n: 5 } .preloader__name span:nth-child(6) { --n: 6 }
.preloader__bar { margin: 1.4rem 0 .6rem; height: 3px; border-radius: 99px; background: var(--stroke); overflow: hidden; }
.preloader__bar i { display: block; height: 100%; width: 0; background: var(--grad); box-shadow: var(--glow); transition: width .25s linear; }
.preloader__pct { font-family: var(--font-mono); font-size: .78rem; color: var(--text-mute); letter-spacing: .1em; }
@keyframes popIn { from { opacity: 0; transform: translateY(18px) scale(.85) } to { opacity: 1; transform: none } }
@keyframes floatY { 50% { transform: translateY(-8px) } }

/* ─────────────── AMBIENT BACKGROUND ─────────────── */
.bg-fx { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: var(--blob-opacity); will-change: transform; }
.blob--1 { width: 48vw; height: 48vw; background: radial-gradient(circle, var(--blob-1), transparent 68%); top: -14%; left: -10%; animation: drift1 22s ease-in-out infinite; }
.blob--2 { width: 44vw; height: 44vw; background: radial-gradient(circle, var(--blob-2), transparent 68%); bottom: -16%; right: -10%; animation: drift2 26s ease-in-out infinite; }
.blob--3 { width: 40vw; height: 40vw; background: radial-gradient(circle, var(--blob-3), transparent 68%); top: 38%; left: 42%; animation: drift3 30s ease-in-out infinite; }

@keyframes drift1 { 50% { transform: translate3d(12vw, 8vh, 0) scale(1.15) } }
@keyframes drift2 { 50% { transform: translate3d(-14vw, -10vh, 0) scale(1.2) } }
@keyframes drift3 { 33% { transform: translate3d(-10vw, 10vh, 0) } 66% { transform: translate3d(8vw, -8vh, 0) } }

.grid-lines {
  position: absolute; inset: -1px;
  background-image:
    linear-gradient(to right, var(--stroke) 1px, transparent 1px),
    linear-gradient(to bottom, var(--stroke) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 20%, transparent 75%);
  opacity: .55;
}
.noise {
  position: absolute; inset: 0; opacity: .035; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ─────────────── CURSOR ─────────────── */
.cursor-dot, .cursor-ring { position: fixed; top: 0; left: 0; z-index: 9998; pointer-events: none; border-radius: 50%; opacity: 0; transition: opacity .3s; }
.cursor-dot { width: 6px; height: 6px; background: var(--c1); box-shadow: 0 0 12px var(--c1); }
.cursor-ring { width: 34px; height: 34px; border: 1.5px solid var(--stroke-str); transition: opacity .3s, width .3s var(--ease), height .3s var(--ease), border-color .3s, background .3s; }
body.cursor-on .cursor-dot, body.cursor-on .cursor-ring { opacity: 1; }
.cursor-ring.grow { width: 62px; height: 62px; border-color: var(--c1); background: rgba(34, 211, 238, .08); }

/* ─────────────── SCROLL PROGRESS ─────────────── */
.scroll-progress { position: fixed; top: 0; left: 0; width: 100%; height: 3px; z-index: 200; background: transparent; }
.scroll-progress i { display: block; height: 100%; width: 0; background: var(--grad); box-shadow: 0 0 14px rgba(34, 211, 238, .8); }

/* ─────────────── HEADER ─────────────── */
.header {
  position: fixed; top: 0; left: 0; width: 100%; height: var(--header-h);
  z-index: 150;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--pad-x);
  transition: border-color .4s, height .4s var(--ease);
  border-bottom: 1px solid transparent;
}
/* The blurred bar lives on a pseudo-element: putting backdrop-filter on .header
   itself would make it the containing block for the fixed mobile nav overlay. */
.header::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  /* Tint is opaque enough to stay legible on its own — backdrop-filter is a
     progressive enhancement and is unsupported in some browsers. */
  background: rgba(5, 6, 10, .88);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  opacity: 0; transition: opacity .4s var(--ease);
}
[data-theme="light"] .header::before { background: rgba(246, 247, 251, .9); }
@supports (backdrop-filter: blur(4px)) or (-webkit-backdrop-filter: blur(4px)) {
  .header::before { background: rgba(5, 6, 10, .74); }
  [data-theme="light"] .header::before { background: rgba(246, 247, 251, .76); }
}
.header.scrolled { height: var(--header-h-scrolled); border-bottom-color: var(--stroke); }
.header.scrolled::before { opacity: 1; }

.logo { position: relative; z-index: 3; display: inline-flex; align-items: center; gap: .6rem; font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; animation: fadeDown .8s var(--ease) both; }
.logo__mark {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px;
  background: var(--grad); color: var(--on-accent); font-weight: 800; font-size: 1.05rem;
  box-shadow: var(--glow); transition: transform .4s var(--ease);
}
.logo:hover .logo__mark { transform: rotate(-12deg) scale(1.08); }
.logo__text em { color: var(--c1); font-style: normal; }

.navbar { display: flex; align-items: center; gap: .3rem; }
.navbar a {
  position: relative; padding: .5rem .85rem; font-size: .95rem; font-weight: 500;
  color: var(--text-dim); border-radius: 99px; transition: color .3s;
  animation: fadeDown .6s var(--ease) both; animation-delay: calc(.06s * var(--i));
}
.navbar a::before {
  content: ""; position: absolute; inset: 0; border-radius: 99px;
  background: var(--surface-2); border: 1px solid var(--stroke);
  opacity: 0; transform: scale(.8); transition: opacity .3s, transform .3s var(--ease);
  z-index: -1;
}
.navbar a:hover { color: var(--text); }
.navbar a:hover::before { opacity: 1; transform: scale(1); }
.navbar a.active { color: var(--text); }
.navbar a.active::before { opacity: 1; transform: scale(1); background: var(--grad-soft); border-color: var(--stroke-str); }

.header__actions { position: relative; z-index: 3; display: flex; align-items: center; gap: .6rem; }
.theme-toggle {
  position: relative; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--stroke); background: var(--surface);
  display: grid; place-items: center; overflow: hidden; transition: border-color .3s, transform .3s var(--ease);
}
.theme-toggle:hover { border-color: var(--c1); transform: rotate(18deg); }
.theme-toggle i { position: absolute; font-size: 1.2rem; transition: transform .5s var(--ease), opacity .4s; }
.theme-toggle .bx-moon { opacity: 1; transform: none; }
.theme-toggle .bx-sun { opacity: 0; transform: translateY(120%) rotate(90deg); }
[data-theme="light"] .theme-toggle .bx-moon { opacity: 0; transform: translateY(-120%) rotate(-90deg); }
[data-theme="light"] .theme-toggle .bx-sun { opacity: 1; transform: none; }

.menu-toggle { display: none; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--stroke); background: var(--surface); position: relative; }
.menu-toggle span {
  position: absolute; left: 50%; width: 18px; height: 2px; border-radius: 2px; background: var(--text);
  transform: translateX(-50%); transition: transform .4s var(--ease), opacity .3s, width .3s;
}
.menu-toggle span:nth-child(1) { top: 14px; }
.menu-toggle span:nth-child(2) { top: 20px; width: 13px; }
.menu-toggle span:nth-child(3) { top: 26px; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { top: 20px; transform: translateX(-50%) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; width: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { top: 20px; transform: translateX(-50%) rotate(-45deg); }

@keyframes fadeDown { from { opacity: 0; transform: translateY(-14px) } to { opacity: 1; transform: none } }

/* ─────────────── BUTTONS ─────────────── */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  padding: .95rem 1.7rem; border-radius: 99px; font-weight: 600; font-size: .95rem;
  letter-spacing: .01em; overflow: hidden; isolation: isolate;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), color .3s, border-color .3s;
  will-change: transform;
}
.btn i { font-size: 1.15rem; transition: transform .35s var(--ease); }
.btn:hover i { transform: translateX(4px); }
.btn--sm { padding: .55rem 1.15rem; font-size: .85rem; }
.btn--full { width: 100%; }

.btn--primary { background: var(--grad); color: var(--on-accent); box-shadow: 0 10px 30px -10px rgba(34, 211, 238, .6); }
.btn--primary::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(100deg, var(--c3), var(--c2) 45%, var(--c1));
  opacity: 0; transition: opacity .45s var(--ease);
}
.btn--primary:hover { transform: translateY(-3px); box-shadow: 0 18px 44px -12px rgba(232, 121, 249, .65); }
.btn--primary:hover::after { opacity: 1; }

.btn--outline, .btn--ghost {
  border: 1px solid var(--stroke-str); color: var(--text); background: var(--surface);
  backdrop-filter: blur(8px);
}
.btn--outline::after, .btn--ghost::after {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--grad);
  transform: translateY(101%); transition: transform .45s var(--ease);
}
.btn--outline:hover, .btn--ghost:hover { color: var(--on-accent); border-color: transparent; transform: translateY(-3px); }
.btn--outline:hover::after, .btn--ghost:hover::after { transform: translateY(0); }

/* ─────────────── SECTION SHELL ─────────────── */
.section {
  padding: clamp(3.5rem, 6.5vw, 5.5rem) var(--pad-x);
  position: relative;
  /* Land a nav jump just above the heading instead of on the section's top
     padding: cancel that padding, then add back a consistent 2rem of breathing room. */
  scroll-margin-top: calc(2rem - clamp(3.5rem, 6.5vw, 5.5rem));
}
.section__head { max-width: 820px; margin: 0 auto clamp(2.2rem, 4.5vw, 3.4rem); text-align: center; }
.section__sub { max-width: 620px; margin-inline: auto; }

/* Alternating bands: without them every section floats on the same ground and
   the page reads as disconnected islands rather than one composed document. */
.section--band {
  background: var(--band);
  border-block: 1px solid var(--stroke);
}
.eyebrow {
  display: inline-block; font-family: var(--font-mono); font-size: .78rem; letter-spacing: .22em;
  text-transform: uppercase; color: var(--ink-accent); margin-bottom: .85rem;
  padding: .4rem .95rem; border: 1px solid var(--stroke); border-radius: 99px;
  background: var(--surface-2); box-shadow: var(--shadow-card);
}
.section__title { font-size: clamp(2.15rem, 5.8vw, 3.9rem); letter-spacing: -.03em; }
.section__sub { margin-top: .85rem; color: var(--text-dim); font-size: 1.03rem; }

/* ─────────────── HERO ─────────────── */
.home {
  position: relative; min-height: 100svh;
  display: flex; align-items: center;
  padding: calc(var(--header-h) + 3rem) var(--pad-x) 6rem;
}
.particles { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; opacity: .75; }
.home__inner {
  position: relative; z-index: 1; width: 100%;
  display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: clamp(2rem, 5vw, 4.5rem);
}

.badge {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .4rem 1rem .4rem .7rem; border-radius: 99px;
  border: 1px solid var(--stroke); background: var(--surface); backdrop-filter: blur(10px);
  font-size: .84rem; color: var(--text-dim); margin-bottom: 1.5rem;
  animation: fadeUp .8s var(--ease) both .2s;
}
.badge i { color: var(--ok); font-size: 1.1rem; animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; transform: scale(.8) } }

.home__hi { font-size: clamp(1.05rem, 2.4vw, 1.35rem); font-weight: 500; color: var(--text-dim); font-family: var(--font-body); animation: fadeUp .8s var(--ease) both .3s; }
.home__name { font-size: clamp(2.15rem, 9vw, 5.4rem); font-weight: 800; margin: .2rem 0 .4rem; display: flex; flex-wrap: wrap; gap: 0 .35em; }
.reveal-word { display: inline-block; animation: wordUp 1s var(--ease) both; }
.reveal-word:nth-child(1) { animation-delay: .4s; }
.reveal-word:nth-child(2) { animation-delay: .55s; }
@keyframes wordUp { from { opacity: 0; transform: translateY(60%) rotate(4deg) } to { opacity: 1; transform: none } }

.home__role {
  font-size: clamp(1.25rem, 3.6vw, 2rem); font-weight: 600; color: var(--text);
  min-height: 1.4em; animation: fadeUp .8s var(--ease) both .7s;
}
.typed-text { color: var(--c1); }
.caret { color: var(--c3); font-weight: 300; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0 } }

.home__desc { max-width: 54ch; margin-top: 1.2rem; color: var(--text-dim); font-size: 1.05rem; animation: fadeUp .8s var(--ease) both .85s; }
.home__desc strong { color: var(--text); }

.home__cta { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: 2.1rem; animation: fadeUp .8s var(--ease) both 1s; }

.home__sci { display: flex; gap: .7rem; margin-top: 2.2rem; }
.home__sci a {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px;
  border: 1px solid var(--stroke); background: var(--surface); backdrop-filter: blur(8px);
  font-size: 1.3rem; color: var(--text-dim); position: relative; overflow: hidden;
  transition: color .3s, transform .4s var(--ease), border-color .3s, box-shadow .4s;
  animation: fadeUp .6s var(--ease) both; animation-delay: calc(1.1s + .08s * var(--i, 1));
}
/* Stagger derived from position, so adding or removing a link renumbers itself
   instead of leaving gaps in a hand-written --i sequence. */
.home__sci a:nth-child(1) { --i: 1 }
.home__sci a:nth-child(2) { --i: 2 }
.home__sci a:nth-child(3) { --i: 3 }
.home__sci a:nth-child(4) { --i: 4 }
.home__sci a:nth-child(5) { --i: 5 }
.home__sci a:nth-child(6) { --i: 6 }
.home__sci a::before { content: ""; position: absolute; inset: 0; background: var(--grad); opacity: 0; transition: opacity .35s; z-index: -1; }
.home__sci a:hover { color: var(--on-accent); transform: translateY(-6px) rotate(-6deg); border-color: transparent; box-shadow: 0 14px 30px -10px rgba(34, 211, 238, .6); }
.home__sci a:hover::before { opacity: 1; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(26px) } to { opacity: 1; transform: none } }

/* avatar */
.home__visual { display: grid; place-items: center; }
.avatar {
  position: relative; width: clamp(230px, 34vw, 470px); aspect-ratio: 1;
  display: grid; place-items: center;
  animation: fadeIn 1.2s var(--ease) both .5s;
  transform-style: preserve-3d;

  /* Chip orbit, in polar terms. --chip-r is the radius as a share of the avatar
     box: 50% would be exactly on the dashed ring, but a 54px chip's inner corner
     would then bite into the portrait, so it orbits just outside and the ring
     grazes it instead. The four sit at 45deg diagonals; .7071 is cos/sin 45deg.
     Derived rather than eyeballed, so all four stay equidistant at every width. */
  --chip-r: 56%;
  --chip-size: 54px;
  --chip-x: calc(var(--chip-r) * 0.7071);
  --chip-near: calc(50% - var(--chip-x) - var(--chip-size) / 2);
  --chip-far:  calc(50% + var(--chip-x) - var(--chip-size) / 2);
}
@keyframes fadeIn { from { opacity: 0; transform: scale(.9) } to { opacity: 1; transform: none } }

.avatar__img {
  width: 85%; height: 85%; object-fit: cover; object-position: 50% 0; border-radius: 50%;
  border: 3px solid var(--stroke-str);
  box-shadow: 0 30px 70px -25px rgba(0, 0, 0, .75);
  animation: bob 6s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(-14px) } }

.avatar__ring { position: absolute; border-radius: 50%; }
.avatar__ring--1 { inset: 0; border: 1px dashed var(--stroke-str); animation: spin 26s linear infinite; }
.avatar__ring--2 {
  inset: 6%;
  background: conic-gradient(from 0deg, transparent 0 52%, var(--c1) 74%, var(--c3) 91%, transparent 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
  animation: spin 8s linear infinite reverse;
}
.avatar__glow { position: absolute; inset: 12%; border-radius: 50%; background: var(--grad); filter: blur(48px); opacity: .38; animation: breathe 5s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg) } }
@keyframes breathe { 50% { opacity: .62; transform: scale(1.08) } }

.avatar__chip {
  position: absolute; display: grid; place-items: center;
  width: var(--chip-size); height: var(--chip-size); border-radius: 16px; font-size: 1.6rem;
  background: var(--surface-2); border: 1px solid var(--stroke);
  backdrop-filter: blur(12px); box-shadow: var(--shadow);
  animation: floatChip 5s ease-in-out infinite;
}
.avatar__chip--1 { left: var(--chip-near); top: var(--chip-near); color: var(--ic-js); animation-delay: 0s; }
.avatar__chip--2 { left: var(--chip-far);  top: var(--chip-near); color: var(--ic-vue); animation-delay: .8s; }
.avatar__chip--3 { left: var(--chip-near); top: var(--chip-far);  color: var(--ic-pyblue); animation-delay: 1.6s; }
.avatar__chip--4 { left: var(--chip-far);  top: var(--chip-far);  color: var(--ic-aws); animation-delay: 2.4s; }
@keyframes floatChip { 50% { transform: translateY(-16px) rotate(6deg) } }

/* scroll hint */
.scroll-hint {
  position: absolute; left: 50%; bottom: 1.8rem; transform: translateX(-50%);
  display: grid; justify-items: center; gap: .5rem; color: var(--text-mute);
  font-family: var(--font-mono); font-size: .7rem; letter-spacing: .2em; text-transform: uppercase;
  animation: fadeUp 1s var(--ease) both 1.6s; z-index: 2;
}
.scroll-hint__mouse { width: 24px; height: 38px; border: 1.5px solid var(--stroke-str); border-radius: 14px; position: relative; }
.scroll-hint__mouse i { position: absolute; left: 50%; top: 7px; width: 3px; height: 7px; border-radius: 2px; background: var(--c1); transform: translateX(-50%); animation: wheel 1.6s ease-in-out infinite; }
@keyframes wheel { 0% { opacity: 0; transform: translate(-50%, 0) } 40% { opacity: 1 } 100% { opacity: 0; transform: translate(-50%, 14px) } }
.scroll-hint:hover { color: var(--c1); }

/* ─────────────── MARQUEE ─────────────── */
.marquee {
  border-block: 1px solid var(--stroke); background: var(--surface);
  padding: 1.1rem 0; overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee__track { display: flex; width: max-content; animation: slide 32s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__group { display: flex; align-items: center; gap: 1.6rem; padding-right: 1.6rem; }
.marquee__group span { font-family: var(--font-head); font-size: clamp(1rem, 2.2vw, 1.5rem); font-weight: 600; color: var(--text-dim); white-space: nowrap; transition: color .3s; }
.marquee__group span:hover { color: var(--c1); }
.marquee__group i { color: var(--c3); font-size: .8rem; font-style: normal; }
@keyframes slide { to { transform: translateX(-50%) } }

/* ─────────────── ABOUT ─────────────── */
.about__grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(2rem, 6vw, 5rem); align-items: center; }

.about__frame { position: relative; border-radius: var(--r-lg); }
.about__frame img {
  /* height:auto is required — the img's height attribute is a presentational
     hint that otherwise wins over the aspect-ratio-derived height. */
  width: 100%; height: auto; aspect-ratio: 3/2;
  object-fit: cover; object-position: 50% 0; border-radius: var(--r-lg);
  border: 1px solid var(--stroke); box-shadow: var(--shadow);
}
.about__frame::before, .about__frame::after {
  content: ""; position: absolute; width: 42%; height: 42%;
  border-radius: var(--r-lg); pointer-events: none; opacity: .75;
}
.about__frame::before {
  inset: -.7rem -.7rem auto auto;
  border-top: 2.5px solid var(--c1); border-right: 2.5px solid var(--c1);
  border-radius: 0 var(--r-lg) 0 0;
}
.about__frame::after {
  inset: auto auto -.7rem -.7rem;
  border-bottom: 2.5px solid var(--c3); border-left: 2.5px solid var(--c3);
  border-radius: 0 0 0 var(--r-lg);
}
.about__badge {
  position: absolute; right: -1rem; bottom: 2rem;
  display: flex; align-items: center; gap: .7rem;
  padding: .9rem 1.15rem; border-radius: var(--r);
  background: var(--surface-2); border: 1px solid var(--stroke);
  backdrop-filter: blur(14px); box-shadow: var(--shadow);
  animation: floatChip 5s ease-in-out infinite;
}
.about__badge strong { font-family: var(--font-head); font-size: 2rem; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.about__badge span { font-size: .78rem; color: var(--text-dim); line-height: 1.3; }

.about__text h3 { font-size: clamp(1.35rem, 3vw, 1.8rem); margin-bottom: 1rem; }
.about__text p { color: var(--text-dim); margin-bottom: 1rem; }
.about__text strong { color: var(--text); font-weight: 600; }
.about__list { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: .6rem 1.2rem; margin: 1.6rem 0 2rem; }
.about__list li { display: flex; align-items: center; gap: .6rem; font-size: .95rem; color: var(--text-dim); }
.about__list i { color: var(--c1); font-size: 1.25rem; flex-shrink: 0; }
.about__actions { display: flex; flex-wrap: wrap; gap: .9rem; }

.stats {
  margin-top: clamp(3rem, 8vw, 5rem);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem;
  padding: 2rem clamp(1rem, 3vw, 2.5rem);
  border-radius: var(--r-lg); border: 1px solid var(--stroke);
  background: var(--surface); backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
}
.stat { text-align: center; position: relative; }
.stat + .stat::before { content: ""; position: absolute; left: 0; top: 15%; height: 70%; width: 1px; background: var(--stroke); }
.stat__num { font-size: clamp(1.9rem, 5vw, 2.9rem); background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat p { font-size: .85rem; color: var(--text-dim); letter-spacing: .02em; }

/* ─────────────── CARDS (services) ─────────────── */
.services__grid, .personal__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 1.4rem; }
@media (min-width: 1080px) { .services__grid, .personal__grid { grid-template-columns: repeat(3, 1fr); } }
.card {
  position: relative; padding: 2rem 1.8rem; border-radius: var(--r-lg);
  border: 1px solid var(--stroke); background: var(--surface); backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
  display: flex; flex-direction: column;
  overflow: hidden; transition: transform .5s var(--ease), border-color .4s, box-shadow .5s var(--ease);
}
.card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 0%), rgba(34, 211, 238, .14), transparent 60%);
  opacity: 0; transition: opacity .4s; pointer-events: none;
}
.card:hover { transform: translateY(-10px); border-color: var(--stroke-str); box-shadow: var(--shadow-card-hi), var(--glow); }
.card:hover::before { opacity: 1; }
.card__icon {
  display: grid; place-items: center; width: 58px; height: 58px; border-radius: 18px;
  font-size: 1.75rem; color: var(--c1);
  background: var(--grad-soft); border: 1px solid var(--stroke);
  margin-bottom: 1.3rem; transition: transform .5s var(--ease), color .3s;
}
.card:hover .card__icon { transform: rotate(-8deg) scale(1.08); color: var(--c3); }
.card h3 { font-size: 1.25rem; margin-bottom: .6rem; }
.card p { color: var(--text-dim); font-size: .95rem; }
.card__tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: var(--tags-mt, auto); padding-top: 1.3rem; }
.card:has(.card__links) .card__tags { --tags-mt: auto; }
.card__links { display: flex; flex-wrap: wrap; gap: 1rem; padding-top: 1rem; }
.card__links a {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .82rem; font-weight: 600; color: var(--ink-accent);
  transition: gap .3s var(--ease), opacity .3s;
}
.card__links a i { font-size: 1rem; }
.card__links a:hover { gap: .55rem; }
.card__links a.is-muted { color: var(--text-mute); }
.card__tags i {
  font-style: normal; font-family: var(--font-mono); font-size: .72rem;
  padding: .25rem .6rem; border-radius: 99px; border: 1px solid var(--stroke);
  color: var(--text-mute); background: var(--field);
}

/* ─────────────── SKILLS ─────────────── */
/* Three full-width bands rather than two side-by-side columns. Tech Stack and
   AWS hold very different amounts of content, so any two-column split leaves a
   hole beside the shorter one. Stacking them and letting each panel column its
   own groups internally uses the full width and removes the balancing act. */
.skills__grid { display: grid; grid-template-columns: 1fr; gap: 1.6rem; }
.skills__panel {
  padding: clamp(1.6rem, 4vw, 2.4rem); border-radius: var(--r-lg);
  border: 1px solid var(--stroke); background: var(--surface); backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
  display: flex; flex-direction: column;
}
.skills__heading { display: flex; align-items: center; gap: .6rem; font-size: 1.2rem; margin-bottom: 1.8rem; }
.skills__heading i { color: var(--c1); font-size: 1.4rem; }

/* ── Tech stack: grouped, honest, no invented percentages ── */
/* Full-width rows of chips read far better than four narrow list columns,
   and the tinted icon tile makes a generic fallback glyph look deliberate. */
/* Multi-column, not grid: five groups of unequal height leave empty cells in a
   fixed grid, whereas columns balance the flow and fill every one. */
.stack { columns: 300px 3; column-gap: 2.2rem; }
.stack__group { break-inside: avoid; margin-bottom: 1.5rem; }
.stack__group:last-child { margin-bottom: 0; }
.stack__group h4 {
  font-family: var(--font-mono); font-size: .7rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink-accent); margin-bottom: .7rem;
  display: flex; align-items: center; gap: .7rem;
}
.stack__group h4::after {
  content: ""; flex: 1; height: 1px; background: var(--stroke);
}
.stack__group ul { display: flex; flex-wrap: wrap; gap: .5rem; }
.stack__group li {
  --tc: var(--ink-accent);
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .4rem .85rem .4rem .4rem;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: var(--surface-2);
  box-shadow: var(--shadow-card);
  font-size: .875rem; font-weight: 500; color: var(--text);
  transition: transform .28s var(--ease), border-color .28s, box-shadow .28s var(--ease);
}
.stack__group li:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--tc) 45%, var(--stroke));
  box-shadow: var(--shadow-card-hi);
}
.stack__group li i {
  flex-shrink: 0; display: grid; place-items: center;
  width: 28px; height: 28px; border-radius: 9px;
  font-size: 1.15rem; color: var(--tc);
  background: color-mix(in srgb, var(--tc) 14%, transparent);
}
@supports not (background: color-mix(in srgb, red, blue)) {
  .stack__group li i { background: var(--field); }
  .stack__group li:hover { border-color: var(--stroke-str); }
}

/* ── AWS services ── */
.skills__note { font-size: .86rem; color: var(--text-mute); margin: -.9rem 0 1.4rem; }
.aws-grid { columns: 225px 4; column-gap: 2.2rem; }
.aws-group { break-inside: avoid; margin-bottom: 1.35rem; }
.aws-group:last-child { margin-bottom: 0; }
.aws-group h4 {
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink-accent); margin-bottom: .55rem;
  display: flex; align-items: center; gap: .7rem;
}
.aws-group h4::after { content: ""; flex: 1; height: 1px; background: var(--stroke); }
.aws-group ul { display: flex; flex-wrap: wrap; gap: .4rem; }
.aws-group li {
  font-family: var(--font-mono); font-size: .76rem;
  padding: .3rem .6rem; border-radius: 8px;
  border: 1px solid var(--stroke); background: var(--field); color: var(--text-dim);
  transition: color .25s, border-color .25s, transform .25s var(--ease);
}
.aws-group li:hover {
  color: var(--text); border-color: var(--ic-aws); transform: translateY(-2px);
}

/* ── AI tooling: grouped by what the tool is actually for, because "I use AI"
      says nothing — which tool for which job is the part worth showing ── */
.ai-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.2rem; }
.ai-card {
  padding: 1.15rem 1.2rem; border-radius: var(--r);
  border: 1px solid var(--stroke); background: var(--field);
}
.ai-card__head {
  display: flex; align-items: center; gap: .5rem;
  font-family: var(--font-head); font-weight: 700; font-size: .95rem;
  margin-bottom: .9rem;
}
.ai-card__head i {
  display: grid; place-items: center; width: 30px; height: 30px;
  border-radius: 9px; font-size: 1.05rem;
  color: var(--ink-accent); background: var(--grad-soft);
}
.ai-card ul { display: flex; flex-direction: column; gap: .75rem; }
.ai-card li { display: flex; flex-direction: column; gap: .12rem; }
.ai-card strong { font-size: .88rem; font-weight: 600; }
.ai-card span { font-size: .8rem; color: var(--text-dim); line-height: 1.45; }

/* ─────────────── WORK ─────────────── */
.filters { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-bottom: 2.5rem; }
.filter {
  padding: .55rem 1.25rem; border-radius: 99px; font-size: .9rem; font-weight: 500;
  border: 1px solid var(--stroke); background: var(--surface-2); color: var(--text-dim);
  box-shadow: var(--shadow-card);
  transition: color .3s, background .3s, border-color .3s, transform .3s var(--ease);
}
.filter:hover { color: var(--text); transform: translateY(-2px); border-color: var(--stroke-str); }
.filter.active { background: var(--grad); color: var(--on-accent); border-color: transparent; box-shadow: 0 8px 24px -10px rgba(34, 211, 238, .7); }

.work__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.4rem; }
@media (min-width: 1080px) { .work__grid { grid-template-columns: repeat(3, 1fr); } }
.project {
  position: relative; display: flex; flex-direction: column;
  border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid var(--stroke); background: var(--surface-2);
  box-shadow: var(--shadow-card);
  transition: transform .5s var(--ease), box-shadow .5s var(--ease), opacity .4s, border-color .4s;
}
.project.hide { display: none; }
.project.filtering { opacity: 0; transform: scale(.94); }
.project:hover { transform: translateY(-8px); border-color: var(--stroke-str); box-shadow: var(--shadow-card-hi); }

.project__media { position: relative; aspect-ratio: 16/10; overflow: hidden; flex-shrink: 0; }
.project__media img {
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 0;
  transition: transform .8s var(--ease), filter .5s;
}
.project:hover .project__media img { transform: scale(1.07); filter: saturate(1.1); }

.project__cat {
  position: absolute; top: .8rem; left: .8rem;
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .1em;
  text-transform: uppercase; color: #fff;
  padding: .28rem .65rem; border-radius: 99px;
  background: rgba(6, 10, 25, .72); border: 1px solid rgba(255, 255, 255, .22);
  backdrop-filter: blur(6px);
}

/* Text sits on a solid surface, not over the photo: readable at any image brightness. */
.project__body {
  display: flex; flex-direction: column; gap: .5rem;
  padding: 1.25rem 1.3rem 1.35rem; flex: 1;
}
.project__body :is(h2, h3) { font-size: 1.12rem; }   /* h2 on projects.html, h3 on index */
.project__desc { font-size: .89rem; color: var(--text-dim); }

.project__tech { display: flex; flex-wrap: wrap; gap: .35rem; }
.project__tech i {
  font-style: normal; font-family: var(--font-mono); font-size: .68rem;
  padding: .18rem .5rem; border-radius: 99px;
  border: 1px solid var(--stroke); background: var(--field); color: var(--text-mute);
}

.project__result {
  display: flex; align-items: flex-start; gap: .4rem;
  font-size: .84rem; color: var(--text-dim); font-weight: 500;
}
.project__result i { color: var(--ok); font-size: 1rem; flex-shrink: 0; }

.project__links { display: flex; gap: .5rem; margin-top: auto; padding-top: .9rem; }
.project__link {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .48rem .95rem; border-radius: 99px;
  font-size: .8rem; font-weight: 600;
  background: var(--grad); color: var(--on-accent);
  transition: transform .3s var(--ease), filter .3s, background .3s;
  box-shadow: 0 6px 16px -8px rgba(34, 211, 238, .7);
}
.project__link i { font-size: 1rem; }
.project__link--alt {
  background: var(--field); color: var(--text);
  border: 1px solid var(--stroke-str); box-shadow: none;
}
.project__link:hover { transform: translateY(-2px); filter: brightness(1.1); }
.project__link--alt:hover { background: var(--surface); filter: none; }

/* Eight cards is a lot to scroll past before the rest of the page. Show a first
   screenful and let the visitor ask for the remainder. */
.project.capped { display: none; }
.work__more, .page-back { display: flex; justify-content: center; margin-top: 1.6rem; }
.page-back { margin-top: 2.4rem; }
.back-link {
  /* block-level so it takes its own line above the eyebrow rather than
     sitting beside it on the centred head */
  display: flex; justify-content: center; align-items: center; gap: .4rem; margin-bottom: 1.1rem;
  font-size: .86rem; font-weight: 600; color: var(--text-dim);
  transition: color .3s, gap .3s var(--ease);
}
.back-link:hover { color: var(--ink-accent); gap: .65rem; }
.back-link i { font-size: 1.1rem; }
.work__more .btn { width: 100%; max-width: 320px; }
.work__more[hidden] { display: none; }

/* client + role line, AWS row and confidentiality note on project cards */
.project__meta { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .9rem; }
.project__meta > * { display: flex; align-items: center; gap: .4rem; font-size: .82rem; font-weight: 500; }
.project__meta i { font-size: 1rem; }
/* client carries the accent; the role sits a step back so the two read as a pair
   rather than competing for the same emphasis */
.project__client { color: var(--ink-accent); }
.project__role {
  color: var(--text); background: var(--grad-soft);
  border: 1px solid var(--stroke); border-radius: 99px;
  padding: .16rem .6rem .16rem .5rem; font-size: .76rem; font-weight: 600;
}
.project__role i { font-size: .95rem; color: var(--ink-accent); }
.project__aws { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.project__aws span {
  font-family: var(--font-mono); font-size: .62rem; letter-spacing: .1em;
  color: var(--on-accent); background: var(--ic-aws);
  padding: .16rem .42rem; border-radius: 5px; font-weight: 700;
}
.project__aws i {
  font-style: normal; font-family: var(--font-mono); font-size: .66rem;
  padding: .16rem .45rem; border-radius: 5px;
  border: 1px solid var(--stroke); background: var(--field); color: var(--text-mute);
}
.project__note {
  display: flex; align-items: center; gap: .4rem;
  font-size: .76rem; color: var(--text-mute); margin-top: auto; padding-top: .8rem;
}
.project__note i { font-size: .95rem; }

/* ── earlier work strip ── */
.early {
  margin-top: 2.2rem; padding: 1.6rem clamp(1.2rem, 3vw, 2rem);
  border-radius: var(--r-lg); border: 1px dashed var(--stroke-str);
  background: var(--surface);
}
.early__title { font-size: 1.02rem; margin-bottom: 1.1rem; }
.early__title span { font-weight: 400; font-size: .82rem; color: var(--text-mute); font-family: var(--font-body); }
.early__list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: .7rem 1.4rem; margin-bottom: 1.2rem;
}
.early__list li { display: flex; flex-direction: column; gap: .1rem; }
.early__list strong { font-size: .9rem; font-family: var(--font-mono); font-weight: 500; }
.early__list span { font-size: .76rem; color: var(--text-mute); }
.early__link {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .88rem; font-weight: 500; color: var(--ink-accent);
  transition: opacity .25s;
}
.early__link:hover { opacity: .7; }
.early__link i { font-size: 1.15rem; }

/* ─────────────── TIMELINE ─────────────── */
.timeline {
  position: relative; max-width: 940px; margin: 0 auto;
  --tl-gap: 2.6rem;    /* space between card edge and the centre rail */
  --tl-dot: 15px;
}
.timeline::before {
  content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(to bottom, transparent, var(--c1), var(--c3), transparent);
  opacity: .55;
}
.tl-item {
  position: relative; width: calc(50% - var(--tl-gap)); padding: 1.6rem 1.8rem;
  border-radius: var(--r-lg); border: 1px solid var(--stroke);
  background: var(--surface); backdrop-filter: blur(12px);
  margin-bottom: 1.6rem; box-shadow: var(--shadow-card);
  transition: transform .45s var(--ease), border-color .4s, box-shadow .45s;
}
.tl-item:nth-child(odd) { margin-right: auto; text-align: right; }
.tl-item:nth-child(even) { margin-left: auto; margin-top: -3.5rem; }
.tl-item:hover { transform: translateY(-6px); border-color: var(--stroke-str); box-shadow: var(--shadow-card-hi); }
.tl-dot {
  position: absolute; top: 2rem; width: var(--tl-dot); height: var(--tl-dot); border-radius: 50%;
  background: var(--grad); border: 3px solid var(--bg); box-shadow: 0 0 0 4px rgba(34, 211, 238, .18);
}
.tl-item:nth-child(odd)  .tl-dot { right: calc(-1 * (var(--tl-gap) + var(--tl-dot) / 2)); }
.tl-item:nth-child(even) .tl-dot { left:  calc(-1 * (var(--tl-gap) + var(--tl-dot) / 2)); }
.tl-loc { font-weight: 400; font-size: .82em; color: var(--text-mute); }
.tl-org a { border-bottom: 1px solid currentColor; transition: opacity .25s; }
.tl-org a:hover { opacity: .7; }
.tl-todo { color: #d97706; font-family: var(--font-mono); font-size: .8rem; }
.tl-year { font-family: var(--font-mono); font-size: .76rem; letter-spacing: .12em; color: var(--ink-accent); text-transform: uppercase; }
.tl-item h3 { font-size: 1.18rem; margin: .45rem 0 .2rem; }
.tl-org { font-size: .88rem; color: var(--c3); margin-bottom: .6rem; font-weight: 500; }
.tl-item > p:last-child { font-size: .93rem; color: var(--text-dim); }

/* ─────────────── CONTACT ─────────────── */
.contact__grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(1.6rem, 5vw, 3.5rem); align-items: start; }
.contact__info h3 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin-bottom: .8rem; }
.contact__info > p { color: var(--text-dim); margin-bottom: 2rem; }
.contact__list { display: grid; gap: 1rem; margin-bottom: 2rem; }
.contact__list li { display: flex; align-items: center; gap: 1rem; }
.contact__ico {
  display: grid; place-items: center; flex-shrink: 0; width: 48px; height: 48px; border-radius: 14px;
  font-size: 1.4rem; color: var(--c1); background: var(--grad-soft); border: 1px solid var(--stroke);
  transition: transform .4s var(--ease);
}
.contact__list li:hover .contact__ico { transform: rotate(-8deg) scale(1.07); }
.contact__list small { display: block; font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-mute); }
.contact__list a, .contact__list div > span { font-weight: 500; transition: color .3s; word-break: break-word; }
.contact__list a:hover { color: var(--ink-accent); }
.contact__sci { display: flex; gap: .6rem; }
.contact__sci a {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  border: 1px solid var(--stroke); background: var(--surface); font-size: 1.25rem; color: var(--text-dim);
  transition: color .3s, transform .4s var(--ease), border-color .3s;
}
.contact__sci a:hover { color: var(--c1); border-color: var(--c1); transform: translateY(-5px); }

.form {
  padding: clamp(1.5rem, 4vw, 2.4rem); border-radius: var(--r-lg);
  border: 1px solid var(--stroke); background: var(--surface); backdrop-filter: blur(14px);
  display: grid; gap: 1.1rem; box-shadow: var(--shadow);
}
.field { position: relative; }
.field input, .field textarea {
  width: 100%; padding: 1.35rem 1.1rem .6rem; font: inherit; font-size: .98rem;
  color: var(--text); background: var(--field);
  border: 1px solid var(--stroke); border-radius: var(--r-sm);
  transition: border-color .3s, box-shadow .3s, background .3s;
  resize: vertical;
}
.field textarea { min-height: 130px; }
.field label {
  position: absolute; left: 1.1rem; top: 1rem; font-size: .98rem; color: var(--text-mute);
  pointer-events: none; transition: transform .28s var(--ease), font-size .28s var(--ease), color .28s;
  transform-origin: left top;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--c1); box-shadow: 0 0 0 4px rgba(34, 211, 238, .13); }
.field input:focus + label, .field textarea:focus + label,
.field input:not(:placeholder-shown) + label, .field textarea:not(:placeholder-shown) + label {
  transform: translateY(-.62rem) scale(.78); color: var(--ink-accent);
}
.field.invalid input, .field.invalid textarea { border-color: #f87171; box-shadow: 0 0 0 4px rgba(248, 113, 113, .12); }

.form__status { font-size: .92rem; text-align: center; min-height: 1.4em; }
.form__status.ok { color: var(--ok); }
.form__status.err { color: #f87171; }
#submitBtn.loading { pointer-events: none; opacity: .75; }
#submitBtn.loading i { animation: spin 1s linear infinite; }

/* ─────────────── FOOTER ─────────────── */
.footer { border-top: 1px solid var(--stroke); background: var(--surface); padding: 2.5rem var(--pad-x); }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.2rem; }
.footer__nav { display: flex; flex-wrap: wrap; gap: 1.3rem; }
.footer__nav a { font-size: .93rem; color: var(--text-dim); position: relative; transition: color .3s; }
.footer__nav a::after { content: ""; position: absolute; left: 0; bottom: -3px; width: 0; height: 1.5px; background: var(--grad); transition: width .35s var(--ease); }
.footer__nav a:hover { color: var(--text); }
.footer__nav a:hover::after { width: 100%; }
.footer__copy { font-size: .85rem; color: var(--text-mute); }

.to-top {
  position: fixed; right: 1.35rem; bottom: 1.35rem; z-index: 140;
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
  background: var(--grad); color: var(--on-accent); font-size: 1.7rem;
  box-shadow: 0 14px 34px -12px rgba(34, 211, 238, .8);
  opacity: 0; visibility: hidden; transform: translateY(20px) scale(.8);
  transition: opacity .4s, visibility .4s, transform .45s var(--ease);
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { transform: translateY(-4px) scale(1.06); }


/* ─────────────── SKIP LINK ─────────────── */
.skip-link {
  position: fixed; top: 0; left: 50%; transform: translate(-50%, -120%);
  z-index: 300; padding: .8rem 1.5rem; border-radius: 0 0 var(--r-sm) var(--r-sm);
  background: var(--grad); color: var(--on-accent); font-weight: 600; font-size: .92rem;
  transition: transform .3s var(--ease);
}
.skip-link:focus-visible { transform: translate(-50%, 0); }

/* ─────────────── COPY BUTTON ─────────────── */
.copy-btn {
  display: grid; place-items: center; flex-shrink: 0;
  width: 34px; height: 34px; margin-left: -.35rem; border-radius: 10px;
  border: 1px solid var(--stroke); background: var(--field);
  font-size: 1.05rem; color: var(--text-mute);
  transition: color .3s, border-color .3s, transform .3s var(--ease), background .3s;
}
.copy-btn:hover { color: var(--ink-accent); border-color: var(--c1); transform: translateY(-2px); }
.copy-btn.copied { color: var(--ok); border-color: var(--ok); background: rgba(16, 185, 129, .12); }

/* ─────────────── SCROLL REVEAL ─────────────── */
.reveal { opacity: 0; transform: translateY(38px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0ms); will-change: opacity, transform; }
.reveal[data-reveal="left"] { transform: translateX(-46px); }
.reveal[data-reveal="right"] { transform: translateX(46px); }
.reveal[data-reveal="zoom"] { transform: scale(.92); }
.reveal.in { opacity: 1; transform: none; }

/* ─────────────── RESPONSIVE ─────────────── */
/* Eight nav items need more room than seven: between the mobile-menu
   breakpoint and ~1080px the row would otherwise sit flush against the
   theme toggle, so tighten the pills rather than drop a link. */
/* The desktop nav row switches to the hamburger earlier than the rest of the
   mobile layout: eight items need ~980px of header before they crowd the
   theme toggle. */
@media (max-width: 980px) {
  .header__cta { display: none; }
  .menu-toggle { display: block; }

  .navbar {
    position: fixed; inset: 0; width: 100%; height: 100svh; z-index: 1;
    flex-direction: column; justify-content: center; gap: .4rem;
    background: color-mix(in srgb, var(--bg) 94%, transparent);
    backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
    padding: 5rem 2rem 3rem;
    clip-path: circle(0% at calc(100% - 3.5rem) 2.2rem);
    transition: clip-path .65s var(--ease-io);
    pointer-events: none;
  }
  @supports not (background: color-mix(in srgb, red, blue)) {
    .navbar { background: rgba(5, 6, 10, .96); }
    [data-theme="light"] .navbar { background: rgba(246, 247, 251, .97); }
  }
  .navbar.open { clip-path: circle(150% at calc(100% - 3.5rem) 2.2rem); pointer-events: auto; }
  .navbar a { font-size: clamp(1.35rem, 6vw, 1.7rem); font-family: var(--font-head); font-weight: 600; padding: .55rem 1.5rem; animation: none; opacity: 0; transform: translateY(24px); transition: opacity .5s var(--ease), transform .5s var(--ease), color .3s; }
  .navbar.open a { opacity: 1; transform: none; transition-delay: calc(.06s * var(--i) + .18s); }
  .navbar a::before { display: none; }
  .navbar a.active { color: var(--c1); }

}

@media (min-width: 981px) and (max-width: 1160px) {
  .navbar a { padding: .5rem .58rem; font-size: .9rem; }
  .navbar { gap: .15rem; }
}

@media (max-width: 1100px) {
  .home__inner { grid-template-columns: 1fr; text-align: center; justify-items: center; gap: 2.5rem; }
  .home__visual { order: -1; }
  .home__name, .home__cta, .home__sci { justify-content: center; }
  .home__desc { margin-inline: auto; }
  .avatar { width: clamp(210px, 46vw, 300px); --chip-r: 58%; --chip-size: 42px; }
  .about__grid { grid-template-columns: 1fr; }
  .about__visual { max-width: 380px; margin: 0 auto; }
  .contact__grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); gap: 1.5rem 0; }
  .stat:nth-child(3)::before { display: none; }

  .timeline { --tl-rail: 10px; }
  .timeline::before { left: calc(var(--tl-rail) - 1px); }
  .tl-item { width: 100%; text-align: left !important; padding-left: 2.4rem; margin-top: 0 !important; }
  .tl-item:nth-child(odd) .tl-dot,
  .tl-item:nth-child(even) .tl-dot {
    left: calc(var(--tl-rail) - var(--tl-dot) / 2); right: auto;
  }

  .cursor-dot, .cursor-ring { display: none; }

  /* Sideways reveals would push past the viewport edge on narrow screens.
     :not(.in) matters — without it this ties with `.reveal.in { transform: none }`
     on specificity, wins on source order, and pins the element 34px down forever
     once it has revealed, overlapping whatever follows it. */
  .reveal[data-reveal="left"]:not(.in),
  .reveal[data-reveal="right"]:not(.in) { transform: translateY(34px); }
}

@media (max-width: 560px) {
  :root { --header-h: 66px; }
  .home { padding-top: calc(var(--header-h) + 2rem); padding-bottom: 5rem; }

  /* Primary action gets the full width; the two secondaries share a row.
     Three stacked full-width buttons ate ~230px of the first screen. */
  .home__cta { flex-direction: row; flex-wrap: wrap; width: 100%; gap: .6rem; }
  .home__cta .btn--primary { flex: 1 0 100%; }
  .home__cta .btn--outline { flex: 1 1 0; min-width: 0; padding-inline: 1rem; }
  .home__cta .btn--outline span { white-space: nowrap; }

  /* Service cards: put the icon beside the heading instead of on its own line. */
  .card {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas: "icon title" "body body" "tags tags" "links links";
    align-items: center;
    column-gap: .9rem;
    padding: 1.5rem 1.35rem;
  }
  .card__links { grid-area: links; }
  .card__icon {
    grid-area: icon; width: 48px; height: 48px;
    font-size: 1.4rem; border-radius: 14px; margin-bottom: 0;
  }
  .card h3 { grid-area: title; font-size: 1.15rem; }
  .card p { grid-area: body; margin-top: .85rem; }
  .card__tags { grid-area: tags; margin-top: 0; padding-top: .9rem; }

  /* Wrapped and centred, not a swipeable strip. Five filters is few enough to
     show at once, and a row that clips at the screen edge hides options the
     visitor then never uses. */
  .filters { flex-wrap: wrap; justify-content: center; gap: .45rem; margin-bottom: 2rem; }
  .filter { flex: 0 0 auto; }


  .project__body { padding: 1.15rem 1.15rem 1.25rem; gap: .5rem; }

  .skills__panel { padding: 1.4rem 1.25rem; }
  .home__sci a { width: 42px; height: 42px; font-size: 1.15rem; }
  .avatar__chip { font-size: 1.25rem; border-radius: 13px; }
  .logo { gap: .5rem; font-size: 1.05rem; }
  .logo__mark { width: 34px; height: 34px; border-radius: 10px; font-size: 1rem; }
  .about__badge { right: -.4rem; bottom: 1rem; padding: .7rem .9rem; }
  .about__badge strong { font-size: 1.5rem; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .footer__inner { flex-direction: column; text-align: center; }
  .scroll-hint { display: none; }
  .to-top { right: 1rem; bottom: 1rem; width: 44px; height: 44px; }
}

@media (max-width: 380px) {
  /* The longest roles wrap to two lines here, and the typewriter would jog the
     whole hero by ~17px on every rotation. Reserve the taller box up front. */
  .home__role { min-height: 2.3em; }
  .logo { gap: .45rem; font-size: .98rem; }
  .stats { grid-template-columns: 1fr; }
  .stat + .stat::before { display: none; }
  .filters { gap: .35rem; }
  /* horizontal padding only — the pill keeps its height, so the tap target
     does not shrink, but three filters now fit on the first line */
  .filter { padding: .45rem .78rem; font-size: .82rem; }
}

/* short landscape phones */
@media (max-height: 520px) and (orientation: landscape) {
  .home { min-height: auto; padding-block: calc(var(--header-h) + 2rem) 3rem; }
  .scroll-hint { display: none; }
  .navbar { overflow-y: auto; justify-content: flex-start; }
}

/* ─────────────── ACCESSIBILITY ─────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
  .particles, .bg-fx .blob { display: none; }
}

@media print {
  .header, .to-top, .preloader, .bg-fx, .particles, .scroll-hint, .marquee, .cursor-dot, .cursor-ring { display: none !important; }
  body { background: #fff; color: #000; }
}
