/* ═══════════════════════════════════════════════════════
   Kaustubh Ajgaonkar — portfolio
   ═══════════════════════════════════════════════════════ */

/* Fonts are self-hosted (SIL Open Font License) so text renders without a trip to Google. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('fonts/jetbrains-mono-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url('fonts/space-grotesk-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@property --angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

/* ─── Tokens ─────────────────────────────────────────── */
:root {
  --bg:         #07090d;
  --bg-2:       #0b0f15;
  --surface:    rgba(22, 27, 34, .55);
  --surface-2:  rgba(33, 38, 45, .6);
  --border:     rgba(var(--ink-rgb), .08);
  --border-2:   rgba(var(--ink-rgb), .16);
  --text:       #c9d1d9;
  --muted:      #8b949e;
  --white:      #f0f6fc;

  --green:      #3fb950;
  --cyan:       #22d3ee;
  --violet:     #a78bfa;
  --grad:       linear-gradient(120deg, var(--green) 0%, var(--cyan) 50%, var(--violet) 100%);

  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Space Grotesk', var(--font-body);
  --font-mono:    'JetBrains Mono', ui-monospace, 'SFMono-Regular', monospace;

  --radius:     20px;
  --ease-out:   cubic-bezier(.16, 1, .3, 1);
  --ease-io:    cubic-bezier(.77, 0, .18, 1);
  --nav-h:      76px;

  /* theme-dependent tokens */
  --ink-rgb:       240, 246, 252;   /* foreground used for hairlines & tints */
  --base-rgb:      7, 9, 13;        /* background used for glass & fades */
  --on-accent:     #07090d;         /* text on the gradient */
  --scroll-thumb:  #21262d;
  --scroll-hover:  #30363d;
  --cover-bg:      #0a0e16;
  --shadow-soft:   rgba(0, 0, 0, .35);
  --shadow-strong: rgba(0, 0, 0, .65);
  --net-line:      34, 211, 238;
  --net-node:      240, 246, 252;
  --net-hot:       63, 185, 80;
  --curtain:
    radial-gradient(120% 80% at 80% 0%, rgba(20, 184, 166, .30), transparent 60%),
    linear-gradient(160deg, #062a2e 0%, #081c21 55%, #07161a 100%);
  color-scheme: dark;
}

/* ─── Light theme ────────────────────────────────────── */
:root[data-theme="light"] {
  --bg:         #f6f8fb;
  --bg-2:       #edf1f6;
  --surface:    rgba(255, 255, 255, .72);
  --surface-2:  rgba(255, 255, 255, .88);
  --border:     rgba(15, 23, 42, .09);
  --border-2:   rgba(15, 23, 42, .17);
  --text:       #334155;
  --muted:      #5b6b80;
  --white:      #0f172a;

  --green:      #15803d;
  --cyan:       #0e7490;
  --violet:     #6d28d9;

  --ink-rgb:       15, 23, 42;
  --base-rgb:      255, 255, 255;
  --on-accent:     #ffffff;
  --scroll-thumb:  #cbd5e1;
  --scroll-hover:  #94a3b8;
  --cover-bg:      #eef3f8;
  --shadow-soft:   rgba(15, 23, 42, .08);
  --shadow-strong: rgba(15, 23, 42, .18);
  --net-line:      14, 116, 144;
  --net-node:      15, 23, 42;
  --net-hot:       21, 128, 61;
  --curtain:
    radial-gradient(120% 80% at 80% 0%, rgba(20, 184, 166, .28), transparent 60%),
    linear-gradient(160deg, #e3f5f2 0%, #d6eeea 55%, #cfe7e4 100%);
  color-scheme: light;
}

/* ─── Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(34, 211, 238, .07), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(63, 185, 80, .06), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 400 16px/1.7 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

main { flex: 1 0 auto; }

h1, h2, h3 {
  margin: 0;
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.1;
}

p { margin: 0 0 1em; }
a { color: var(--cyan); text-decoration: none; transition: color .2s; }
a:hover { color: var(--white); }
img { max-width: 100%; display: block; }
ul { list-style: none; margin: 0; padding: 0; }
figure { margin: 0; }

:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }
::selection { background: rgba(34, 211, 238, .25); color: var(--white); }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--scroll-hover); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container--narrow { max-width: 820px; }
.mono { font-family: var(--font-mono); }
.accent { color: var(--green); }

.gradient-text {
  background: var(--grad);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradient-pan 6s linear infinite;
}

@keyframes gradient-pan { to { background-position: 200% center; } }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  font: 500 12px/1 var(--font-mono);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--green);
}

.lead { font-size: clamp(16px, 1.6vw, 19px); color: var(--muted); max-width: 62ch; }

.icon { width: 1.1em; height: 1.1em; flex-shrink: 0; }

.pulse-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}
.pulse-dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s var(--ease-out) infinite;
}
@keyframes pulse { to { transform: scale(3.2); opacity: 0; } }

/* ─── Page chrome: curtain, progress, cursor ─────────── */
.page-curtain {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  background: var(--curtain);
  transform: scaleY(0);
  transform-origin: top;
}
.js .page-curtain { animation: curtain-out .9s var(--ease-io) forwards; transform: scaleY(1); }
.js.is-leaving .page-curtain {
  animation: curtain-in .5s var(--ease-io) forwards;
  transform-origin: bottom;
}
@keyframes curtain-out { to { transform: scaleY(0); } }
@keyframes curtain-in { from { transform: scaleY(0); } to { transform: scaleY(1); } }

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 60;
  background: var(--grad);
  transform: scaleX(var(--progress, 0));
  transform-origin: left;
}

.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 0;
  width: 560px;
  height: 560px;
  margin: -280px 0 0 -280px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(34, 211, 238, .09), rgba(167, 139, 250, .05) 40%, transparent 70%);
  transform: translate3d(var(--cx, -1000px), var(--cy, -1000px), 0);
  opacity: 0;
  transition: opacity .4s;
}
.has-pointer .cursor-glow { opacity: 1; }

main, .footer { position: relative; z-index: 1; }

/* ─── Navigation ─────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 16px 24px;
  transition: padding .4s var(--ease-out);
}

.nav__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  transition: background .4s, border-color .4s, box-shadow .4s, max-width .5s var(--ease-out);
}

.nav.is-scrolled { padding-top: 10px; }
.nav.is-scrolled .nav__inner {
  max-width: 900px;
  background: rgba(var(--base-rgb), .72);
  border-color: var(--border);
  box-shadow: 0 10px 40px var(--shadow-soft);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
}

.nav__brand { display: flex; align-items: center; gap: 10px; color: var(--white); }
.nav__brand:hover { color: var(--white); }

.nav__logo {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--grad);
  color: var(--on-accent);
  font: 700 13px/1 var(--font-display);
  transition: transform .5s var(--ease-out);
}
.nav__brand:hover .nav__logo { transform: rotate(-12deg) scale(1.08); }
.nav__name { font: 600 17px/1 var(--font-display); letter-spacing: -.01em; }

.nav__links { position: relative; display: flex; gap: 4px; margin-left: auto; }

.nav__links a {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}
.nav__links a span { font: 400 10px/1 var(--font-mono); color: var(--green); opacity: .7; }
.nav__links a:hover,
.nav__links a.is-active { color: var(--white); }

.nav__indicator {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: var(--ind-w, 0);
  transform: translateX(var(--ind-x, 0));
  border-radius: 999px;
  background: rgba(var(--ink-rgb), .07);
  border: 1px solid var(--border);
  opacity: var(--ind-o, 0);
  transition: transform .5s var(--ease-out), width .5s var(--ease-out), opacity .3s;
}

.nav__toggle {
  display: none;
  position: relative;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border-2);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.nav__toggle span {
  position: absolute;
  left: 13px;
  right: 13px;
  height: 2px;
  border-radius: 2px;
  background: var(--white);
  transition: transform .4s var(--ease-out), top .4s var(--ease-out);
}
.nav__toggle span:first-child { top: 17px; }
.nav__toggle span:last-child { top: 25px; }
.nav-open .nav__toggle span:first-child { top: 21px; transform: rotate(45deg); }
.nav-open .nav__toggle span:last-child { top: 21px; transform: rotate(-45deg); }

/* ─── Resume button in the nav ─────────────────────────── */
.nav__resume {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  background:
    linear-gradient(var(--bg), var(--bg)) padding-box,
    var(--grad) border-box;
  color: var(--white);
  font-size: 14px;
  font-weight: 600;
  transition: transform .4s var(--ease-out), box-shadow .4s var(--ease-out), color .3s;
}
.nav__resume .icon { width: 16px; height: 16px; transition: transform .4s var(--ease-out); }
.nav__resume:hover { color: var(--white); box-shadow: 0 8px 28px -10px rgba(34, 211, 238, .6); }
.nav__resume:hover .icon { transform: translateY(2px); }

/* ─── Theme switch ───────────────────────────────────── */
.theme-toggle {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border-2);
  border-radius: 50%;
  background: rgba(var(--ink-rgb), .04);
  color: var(--white);
  cursor: pointer;
  overflow: hidden;
  transition: border-color .3s, background .3s, color .3s;
}
.theme-toggle:hover { border-color: var(--cyan); color: var(--cyan); background: rgba(var(--ink-rgb), .07); }
.theme-toggle svg {
  position: absolute;
  width: 19px;
  height: 19px;
  transition: transform .6s var(--ease-out), opacity .4s;
}
/* show the icon of the theme you would switch to */
.theme-toggle__sun  { transform: translateY(0) rotate(0); }
.theme-toggle__moon { transform: translateY(150%) rotate(-90deg); opacity: 0; }
[data-theme="light"] .theme-toggle__sun  { transform: translateY(-150%) rotate(90deg); opacity: 0; }
[data-theme="light"] .theme-toggle__moon { transform: translateY(0) rotate(0); opacity: 1; }

/* circular reveal between themes (View Transitions API) */
::view-transition-old(root),
::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* ─── Buttons & links ────────────────────────────────── */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border: 0;
  border-radius: 999px;
  font: 600 15px/1 var(--font-body);
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: transform .4s var(--ease-out), box-shadow .4s var(--ease-out), color .3s;
}
.btn .icon { transition: transform .4s var(--ease-out); }
.btn:hover .icon:last-child { transform: translateX(4px); }
.btn:hover .icon:first-child:not(:last-child) { transform: translateX(-4px); }

.btn--primary { color: var(--on-accent); background: var(--grad); background-size: 200% auto; }
.btn--primary::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .55) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform .8s var(--ease-out);
}
.btn--primary:hover { color: var(--on-accent); box-shadow: 0 12px 40px -8px rgba(34, 211, 238, .55); }
.btn--primary:hover::after { transform: translateX(120%); }

.btn--ghost {
  color: var(--white);
  background: rgba(var(--ink-rgb), .04);
  border: 1px solid var(--border-2);
}
.btn--ghost::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--grad);
  transform: translateY(101%);
  transition: transform .5s var(--ease-out);
}
.btn--ghost:hover { color: var(--on-accent); border-color: transparent; }
.btn--ghost:hover::before { transform: translateY(0); }

.btn--block { width: 100%; }

.link-underline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--white);
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size .5s var(--ease-out), color .3s;
  padding-bottom: 2px;
}
.link-underline:hover { color: var(--cyan); background-size: 100% 1px; }

.socials { display: flex; gap: 10px; }
.socials a {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--border-2);
  background: rgba(var(--ink-rgb), .03);
  color: var(--muted);
  transition: color .3s, border-color .3s, background .3s, box-shadow .3s, transform .4s var(--ease-out);
}
.socials a .icon { width: 19px; height: 19px; }
.socials a:hover {
  color: var(--white);
  border-color: var(--cyan);
  background: rgba(34, 211, 238, .08);
  box-shadow: 0 0 24px rgba(34, 211, 238, .25);
}

/* ─── Split text & reveal ────────────────────────────── */
.split { display: block; }
.split .word { display: inline-block; white-space: nowrap; }
.split .char {
  display: inline-block;
  transform: translateY(110%) rotate(8deg);
  opacity: 0;
  transition: transform 1s var(--ease-out), opacity .8s var(--ease-out);
  transition-delay: calc(var(--base-delay, .35s) + var(--ci) * 28ms);
}
.split .char-mask { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .22em; margin-bottom: -.22em; }
.is-ready .split .char { transform: none; opacity: 1; }

.gradient-text.split.is-split { animation: none; background: none; color: inherit; }
.gradient-text.split.is-split .char {
  background: var(--grad);
  background-size: 1200% auto;
  background-position: calc(var(--ci) * 6%) center;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.js [data-reveal] {
  opacity: 0;
  transform: translateY(40px);
  filter: blur(8px);
  transition:
    opacity .9s var(--ease-out),
    transform 1.1s var(--ease-out),
    filter .9s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 90ms);
}
/* wipe: a panel slides off the element. The element itself is never clipped,
   because a fully clipped target never reports as intersecting. */
.js [data-reveal="wipe"] {
  opacity: 1;
  filter: none;
  transform: none;
}
.js [data-reveal="wipe"]::after {
  content: '';
  position: absolute;
  inset: -1px;
  z-index: 5;
  background: var(--bg);
  transform-origin: bottom;
  transition: transform 1.3s var(--ease-io);
  transition-delay: calc(var(--i, 0) * 120ms);
  pointer-events: none;
}
.js [data-reveal="wipe"] .detail-hero__art { transform: scale(1.25); transition: transform 1.8s var(--ease-out); }
.js [data-reveal].is-visible { opacity: 1; transform: none; filter: none; }
.js [data-reveal="wipe"].is-visible::after { transform: scaleY(0); }
.js [data-reveal="wipe"].is-visible .detail-hero__art { transform: scale(1); }
/* once revealed, hover/tilt transitions must not inherit the stagger delay */
.js [data-reveal].reveal-done { transition-delay: 0s; }

/* ─── Hero ───────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: calc(var(--nav-h) + 40px) 0 100px;
  overflow: hidden;
}

.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.hero__aurora { position: absolute; inset: 0; pointer-events: none; filter: blur(80px); opacity: .55; }
.hero__aurora span {
  position: absolute;
  width: 46vmax;
  height: 46vmax;
  border-radius: 50%;
  mix-blend-mode: screen;
  animation: drift 18s ease-in-out infinite alternate;
}
.hero__aurora span:nth-child(1) { top: -18%; left: -10%; background: rgba(63, 185, 80, .35); }
.hero__aurora span:nth-child(2) { bottom: -30%; right: -12%; background: rgba(34, 211, 238, .3); animation-duration: 22s; animation-delay: -6s; }
.hero__aurora span:nth-child(3) { top: 20%; left: 40%; width: 30vmax; height: 30vmax; background: rgba(167, 139, 250, .28); animation-duration: 26s; animation-delay: -12s; }

@keyframes drift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(8vw, 6vh) scale(1.15); }
  100% { transform: translate(-6vw, 10vh) scale(.9); }
}

.hero::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 200px;
  background: linear-gradient(transparent, var(--bg));
  pointer-events: none;
}

.hero__content { position: relative; z-index: 2; will-change: transform, opacity; }

.hero__eyebrow { color: var(--text); }
.js .hero__eyebrow,
.js .hero__role,
.js .hero__actions,
.js .hero__socials {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1s var(--ease-out), transform 1.2s var(--ease-out);
}
.js .hero__eyebrow { transition-delay: .3s; }
.js .hero__role    { transition-delay: 1.1s; }
.js .hero__actions { transition-delay: 1.3s; }
.js .hero__socials { transition-delay: 1.5s; }
.is-ready .hero__eyebrow,
.is-ready .hero__role,
.is-ready .hero__actions,
.is-ready .hero__socials { opacity: 1; transform: none; }

.hero__title {
  font-size: clamp(44px, 9vw, 120px);
  font-weight: 700;
  letter-spacing: -.045em;
  line-height: .98;
  margin-bottom: 28px;
}
.hero__title .split:first-child { font-size: .42em; letter-spacing: -.02em; color: var(--muted); margin-bottom: .2em; }

.hero__role {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 1.6em;
  margin-bottom: 40px;
  font: 400 clamp(16px, 2vw, 22px)/1.4 var(--font-mono);
  color: var(--white);
}

.caret {
  display: inline-block;
  width: .55em;
  height: 1.1em;
  margin-left: -6px;
  background: var(--green);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 44px; }

.scroll-cue {
  position: absolute;
  bottom: 36px;
  left: 50%;
  z-index: 2;
  width: 26px;
  height: 42px;
  margin-left: -13px;
  border: 2px solid var(--border-2);
  border-radius: 20px;
}
.scroll-cue span {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--green);
  animation: scroll-cue 1.8s var(--ease-out) infinite;
}
@keyframes scroll-cue {
  0%   { transform: translateY(0); opacity: 0; }
  30%  { opacity: 1; }
  100% { transform: translateY(14px); opacity: 0; }
}

/* ─── Hero playground (home page only) ────────────────── */
.playground {
  position: absolute;
  right: max(24px, calc((100vw - 1200px) / 2 + 24px));
  bottom: 32px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}
.playground__toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border-2);
  background: rgba(var(--base-rgb), .6);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--white);
  font: 600 14px/1 var(--font-body);
  cursor: pointer;
  transition: border-color .3s, box-shadow .4s var(--ease-out), transform .4s var(--ease-out);
}
.playground__toggle:hover { border-color: var(--cyan); box-shadow: 0 0 28px -6px rgba(34, 211, 238, .45); }
.playground__toggle-icon { display: grid; color: var(--cyan); animation: spin-slow 8s linear infinite; }
.playground__toggle-icon .icon { width: 18px; height: 18px; }
.playground.is-open .playground__toggle-icon { animation-duration: 2s; }
@keyframes spin-slow { to { transform: rotate(360deg); } }

.playground__panel {
  width: 280px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--border-2);
  background: rgba(var(--base-rgb), .78);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  box-shadow: 0 24px 60px -20px var(--shadow-strong);
  transform-origin: bottom right;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(.94);
  transition: opacity .3s, transform .5s var(--ease-out), visibility 0s linear .5s;
}
.playground.is-open .playground__panel {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity .3s, transform .5s var(--ease-out), visibility 0s;
}
.playground__row { display: grid; gap: 8px; margin-bottom: 14px; }
.playground__label { font: 500 11px/1 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.playground__options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.playground__options--text { grid-template-columns: repeat(3, 1fr); }
.playground__options button {
  display: grid;
  place-items: center;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(var(--ink-rgb), .04);
  color: var(--muted);
  font: 500 13px/1 var(--font-body);
  cursor: pointer;
  transition: color .2s, border-color .2s, background .2s, transform .3s var(--ease-out);
}
.playground__options button svg { width: 18px; height: 18px; }
.playground__options button:hover { color: var(--white); transform: translateY(-2px); }
.playground__options button[aria-pressed="true"] {
  color: var(--white);
  border-color: transparent;
  background:
    linear-gradient(rgba(var(--base-rgb), .55), rgba(var(--base-rgb), .55)) padding-box,
    var(--grad) border-box;
  border: 1px solid transparent;
  box-shadow: 0 0 18px -6px rgba(34, 211, 238, .55);
}
[data-theme="light"] .playground__options button[aria-pressed="true"] {
  background: linear-gradient(#fff, #fff) padding-box, var(--grad) border-box;
  color: var(--white);
}
.playground__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.playground__shuffle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border-2);
  background: transparent;
  color: var(--white);
  font: 500 13px/1 var(--font-body);
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
.playground__shuffle:hover { border-color: var(--cyan); color: var(--cyan); }
.playground__shuffle .icon { width: 14px; height: 14px; }
.playground__hint { font: 400 11.5px/1.3 var(--font-mono); color: var(--muted); text-align: right; }

/* ─── Marquee ────────────────────────────────────────── */
.marquee {
  position: relative;
  z-index: 1;
  padding: 26px 0;
  border-block: 1px solid var(--border);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee__track { display: flex; width: max-content; animation: marquee 36s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee ul { display: flex; }
.marquee li {
  display: flex;
  align-items: center;
  gap: 48px;
  padding-right: 48px;
  font: 600 clamp(22px, 3vw, 34px)/1 var(--font-display);
  color: transparent;
  -webkit-text-stroke: 1px rgba(var(--ink-rgb), .35);
  white-space: nowrap;
  transition: color .3s;
}
.marquee li:hover { color: var(--white); }
.marquee li::after { content: '✦'; font-size: .5em; color: var(--green); -webkit-text-stroke: 0; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ─── Sections ───────────────────────────────────────── */
.section { padding: 120px 0; }
.page-head { padding-top: calc(var(--nav-h) + 80px); }

.section__head { margin-bottom: 56px; }
.section__title { font-size: clamp(34px, 5vw, 60px); letter-spacing: -.035em; }
.section__title--xl { font-size: clamp(44px, 7.5vw, 96px); letter-spacing: -.045em; margin-bottom: 24px; }
.section__foot { margin-top: 56px; text-align: center; }

/* ─── Work cards ─────────────────────────────────────── */
.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
  perspective: 1200px;
}

.work-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  overflow: hidden;
  transform-style: preserve-3d;
  transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateZ(0);
  transition: transform .6s var(--ease-out), border-color .4s, box-shadow .6s var(--ease-out);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.work-card.is-tilting { transition: transform .12s linear, border-color .4s, box-shadow .6s var(--ease-out); }
.js .work-card[data-reveal].is-visible { transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
.js .work-card.reveal-done { transition: transform .6s var(--ease-out), border-color .4s, box-shadow .6s var(--ease-out); }
.js .work-card.reveal-done.is-tilting { transition: transform .12s linear, border-color .4s, box-shadow .6s var(--ease-out); }

.work-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  padding: 1px;
  border-radius: inherit;
  background: conic-gradient(from var(--angle), var(--green), var(--cyan), var(--violet), var(--green));
  -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 .4s;
  animation: spin-angle 4s linear infinite;
  pointer-events: none;
}
@keyframes spin-angle { to { --angle: 360deg; } }

.work-card:hover { color: var(--text); box-shadow: 0 30px 60px -20px var(--shadow-strong), 0 0 60px -20px rgba(34, 211, 238, .35); }
.work-card:hover::before { opacity: 1; }

.work-card__media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; }
.work-card__media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(var(--base-rgb), .85));
}
.work-card__media .cover__art { transition: transform 1s var(--ease-out); }
.work-card:hover .work-card__media .cover__art { transform: scale(1.08); }

.work-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 22px 26px 26px;
  transform: translateZ(40px);
}
.work-card__num { font: 500 11px/1 var(--font-mono); letter-spacing: .14em; color: var(--green); margin-bottom: 12px; }
.work-card h3 { font-size: 24px; margin-bottom: 8px; }
.work-card p { flex: 1; color: var(--muted); font-size: 15px; line-height: 1.55; margin-bottom: 20px; }

.work-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 500 13px/1 var(--font-mono);
  color: var(--white);
}
.work-card__cta .icon { transition: transform .5s var(--ease-out); }
.work-card:hover .work-card__cta { color: var(--cyan); }
.work-card:hover .work-card__cta .icon { transform: translateX(6px); }

.work-card__glare {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(500px circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, .12), transparent 45%);
  opacity: 0;
  transition: opacity .4s;
}
[data-tilt]:hover .work-card__glare { opacity: 1; }

/* ─── Generated covers ───────────────────────────────── */
.cover { --hue: 190; background: var(--cover-bg); }
.cover__art { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.cover__mono {
  font: 700 230px/1 var(--font-display);
  letter-spacing: -10px;
  fill: none;
  stroke-width: 1.5;
  stroke-opacity: .3;
}
.cover__ring {
  transform-box: fill-box;
  transform-origin: center;
  animation: ring 3s var(--ease-out) infinite;
}
@keyframes ring { from { transform: scale(.4); opacity: 1; } to { transform: scale(2.2); opacity: 0; } }
.cover__packet { filter: drop-shadow(0 0 6px hsl(var(--hue) 90% 70%)); }
.cover__path {
  position: absolute;
  left: 18px;
  bottom: 16px;
  z-index: 1;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(var(--ink-rgb), .12);
  background: rgba(var(--base-rgb), .6);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font: 400 12px/1 var(--font-mono);
  color: hsl(var(--hue) 85% 75%);
}

/* covers: colours live here so the light theme can restyle the SVG */
.cover__bg { fill: var(--cover-bg); }
[data-theme="light"] .cover__dot   { fill: hsl(var(--hue) 40% 30%); }
[data-theme="light"] .cover__edges { stroke: hsl(var(--hue) 55% 42%); stroke-opacity: .35; }
[data-theme="light"] .cover__node  { fill: hsl(var(--hue) 45% 32%); fill-opacity: .65; }
[data-theme="light"] .cover__hub   { fill: hsl(var(--hue) 75% 40%); }
[data-theme="light"] .cover__ring  { stroke: hsl(var(--hue) 75% 40%); }
[data-theme="light"] .cover__mono  { stroke: hsl(var(--hue) 50% 38%); stroke-opacity: .25; }
[data-theme="light"] .cover__packet { fill: hsl(var(--hue) 85% 42%); filter: drop-shadow(0 0 4px hsl(var(--hue) 90% 55%)); }
[data-theme="light"] .cover__path  { color: hsl(var(--hue) 70% 28%); }
[data-theme="light"] .term { background: rgba(10, 14, 22, .92); }
[data-theme="light"] .hero__aurora { opacity: .4; }
[data-theme="light"] .hero__aurora span { mix-blend-mode: multiply; }
[data-theme="light"] .marquee li { -webkit-text-stroke-color: rgba(var(--ink-rgb), .3); }

/* ─── CTA band ───────────────────────────────────────── */
.cta-band {
  position: relative;
  padding: clamp(48px, 8vw, 96px) clamp(24px, 6vw, 80px);
  border-radius: 32px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}
.cta-band__glow {
  position: absolute;
  inset: -50%;
  z-index: -1;
  background: conic-gradient(from var(--angle), transparent 0 60%, rgba(34, 211, 238, .22), rgba(63, 185, 80, .22), transparent 90%);
  animation: spin-angle 8s linear infinite;
  filter: blur(40px);
}
.cta-band h2 { font-size: clamp(32px, 5vw, 56px); letter-spacing: -.035em; margin-bottom: 18px; }
.cta-band p:not(.eyebrow) { color: var(--muted); max-width: 52ch; margin: 0 auto 36px; font-size: 17px; }

/* ─── Work detail ────────────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 36px;
  font: 500 13px/1 var(--font-mono);
  color: var(--muted);
}
.back-link .icon { transition: transform .4s var(--ease-out); }
.back-link:hover { color: var(--white); }
.back-link:hover .icon { transform: translateX(-4px); }

.detail-hero {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 21 / 9;
  min-height: 380px;
  margin-bottom: 72px;
  padding: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  isolation: isolate;
}
.detail-hero__art {
  position: absolute;
  inset: 0 0 auto;
  z-index: -1;
  height: 120%;
  translate: 0 var(--parallax, 0);
}

/* terminal window on the project cover */
.term {
  --ink-rgb: 240, 246, 252;
  --base-rgb: 7, 9, 13;
  --white: #f0f6fc;
  --muted: #8b949e;
  --green: #3fb950;
  width: min(640px, 100%);
  border-radius: 14px;
  border: 1px solid rgba(var(--ink-rgb), .14);
  background: rgba(var(--base-rgb), .78);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8), 0 0 0 1px hsl(var(--hue) 80% 60% / .08);
  font: 400 14px/1.7 var(--font-mono);
  text-align: left;
  overflow: hidden;
}
.term__bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 14px;
  border-bottom: 1px solid rgba(var(--ink-rgb), .08);
  background: rgba(var(--ink-rgb), .03);
}
.term__bar i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.term__bar i:nth-child(2) { background: #febc2e; }
.term__bar i:nth-child(3) { background: #28c840; }
.term__bar span { flex: 1; margin-right: 40px; text-align: center; font-size: 12px; color: var(--muted); }
.term__body { padding: 18px 22px 20px; }
.term__line { margin: 0; color: var(--white); overflow-wrap: anywhere; }
.term__line--title { margin-top: 6px; font-weight: 500; color: hsl(var(--hue) 85% 72%); }
.term__line--muted { color: var(--muted); }
.term__prompt { color: var(--green); }
.term .caret { vertical-align: -2px; margin-left: 0; }

.js .term__line {
  clip-path: inset(0 100% 0 0);
  transition: clip-path .7s steps(28);
  transition-delay: calc(.9s + var(--l) * .75s);
}
.js .is-visible .term__line { clip-path: inset(0 0 0 0); }

.detail-body p { font-size: 18px; line-height: 1.8; color: var(--text); margin-bottom: 1.4em; }
.detail-body strong { color: var(--white); }

.detail-links { display: grid; gap: 14px; margin-top: 44px; }

.link-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 20px 24px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--white);
  overflow: hidden;
  transition: border-color .4s, background .4s;
}
.link-card:hover { color: var(--white); border-color: var(--cyan); background: rgba(34, 211, 238, .06); }
.link-card__label { font: 500 12px/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--green); }
.link-card__url { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 15px; }
.link-card__icon { width: 20px; height: 20px; transition: transform .5s var(--ease-out); }
.link-card:hover .link-card__icon { transform: translate(4px, -4px); color: var(--cyan); }

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 100px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}
.pager__link { display: flex; flex-direction: column; gap: 10px; padding: 8px 0; color: var(--white); }
.pager__link--next { text-align: right; align-items: flex-end; }
.pager__dir {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 500 12px/1 var(--font-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.pager__title {
  font: 600 clamp(22px, 3.5vw, 40px)/1.1 var(--font-display);
  letter-spacing: -.03em;
  background: linear-gradient(var(--white), var(--white)) 0 100% / 0 2px no-repeat;
  transition: background-size .6s var(--ease-out), color .3s;
  padding-bottom: 6px;
}
.pager__link--next .pager__title { background-position: 100% 100%; }
.pager__link:hover { color: var(--white); }
.pager__link:hover .pager__title { background-size: 100% 2px; }
.pager__link:hover .pager__dir { color: var(--green); }

/* ─── About ──────────────────────────────────────────── */
.about {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(40px, 7vw, 100px);
  align-items: center;
}
.about__text .lead { margin-bottom: 36px; }

.about__visual { position: relative; max-width: 420px; justify-self: center; width: 100%; }

.portrait {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 28px;
  padding: 3px;
  transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .6s var(--ease-out);
}
.portrait.is-tilting { transition: transform .12s linear; }
.portrait__ring {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: conic-gradient(from var(--angle), var(--green), var(--cyan), var(--violet), var(--green));
  animation: spin-angle 5s linear infinite;
}
.portrait__ring::after {
  content: '';
  position: absolute;
  inset: 10%;
  z-index: -1;
  border-radius: inherit;
  background: inherit;
  filter: blur(50px);
  opacity: .6;
}
.portrait img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 25px;
}

.float-badge {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 14px;
  border: 1px solid var(--border-2);
  background: rgba(var(--base-rgb), .8);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--white);
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 20px 40px -12px var(--shadow-strong);
  animation: bob 6s ease-in-out infinite;
}
.float-badge--a { bottom: 10%; left: -12%; }
@keyframes bob { 50% { transform: translateY(-14px); } }

.skills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
  margin-top: 120px;
}
.skill-panel {
  padding: 36px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}
.skill-panel h2 { font-size: 26px; margin-bottom: 26px; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--border-2);
  background: rgba(var(--ink-rgb), .03);
  font: 500 14px/1 var(--font-mono);
  color: var(--white);
  cursor: default;
  transition: transform .4s var(--ease-out), border-color .3s, background .3s, color .3s;
}
.js .chip[data-reveal] { transition-property: opacity, transform, filter, border-color, background, color; }
.chip:hover { transform: translateY(-4px) !important; border-color: var(--green); background: rgba(63, 185, 80, .1); color: var(--green); }

.checklist li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); color: var(--text); }
.checklist li:last-child { border-bottom: 0; }
.checklist .icon {
  width: 26px;
  height: 26px;
  padding: 5px;
  border-radius: 50%;
  background: rgba(63, 185, 80, .14);
  color: var(--green);
}

/* ─── Contact ────────────────────────────────────────── */
.contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 90px);
  align-items: start;
}

.info-list { display: grid; gap: 12px; margin-bottom: 44px; }
.info-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--white);
  transition: border-color .3s, transform .5s var(--ease-out), background .3s;
  word-break: break-word;
}
a.info-card:hover { color: var(--white); border-color: var(--cyan); transform: translateX(8px); background: rgba(34, 211, 238, .05); }
.info-card small { display: block; font: 500 11px/1.6 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.info-card__icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(63, 185, 80, .12);
  color: var(--green);
}

.form-card {
  position: relative;
  padding: clamp(28px, 4vw, 44px);
  border-radius: 28px;
  border: 1px solid var(--border);
  background: var(--surface);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  overflow: hidden;
  isolation: isolate;
}
.form-card__glow {
  position: absolute;
  top: -40%;
  right: -40%;
  z-index: -1;
  width: 80%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 211, 238, .22), transparent 70%);
  animation: drift 14s ease-in-out infinite alternate;
}

.field { position: relative; margin-bottom: 20px; }
.field input,
.field textarea {
  width: 100%;
  padding: 26px 18px 10px;
  border-radius: 14px;
  border: 1px solid var(--border-2);
  background: rgba(var(--base-rgb), .5);
  color: var(--white);
  font: 400 16px/1.5 var(--font-body);
  resize: vertical;
  transition: border-color .3s, box-shadow .3s, background .3s;
}
.field textarea { min-height: 160px; }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--cyan);
  background: rgba(var(--base-rgb), .75);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, .12);
}
.field label {
  position: absolute;
  top: 18px;
  left: 19px;
  color: var(--muted);
  font-size: 16px;
  pointer-events: none;
  transform-origin: left top;
  transition: transform .4s var(--ease-out), color .3s;
}
.field input:focus + label,
.field input:not(:placeholder-shown) + label,
.field textarea:focus + label,
.field textarea:not(:placeholder-shown) + label {
  transform: translateY(-10px) scale(.75);
  color: var(--cyan);
}

/* ─── Thank you ──────────────────────────────────────── */
.thanks { text-align: center; }
.thanks .lead { margin: 0 auto 40px; }
.thanks__actions { justify-content: center; }
.thanks__check { width: 96px; height: 96px; margin: 0 auto 36px; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.thanks__check circle { stroke: var(--green); stroke-width: 3; stroke-dasharray: 227; stroke-dashoffset: 227; animation: draw 1s var(--ease-out) .3s forwards; }
.thanks__check path { stroke: var(--white); stroke-width: 5; stroke-dasharray: 50; stroke-dashoffset: 50; animation: draw .7s var(--ease-out) 1.1s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ─── Skip link ──────────────────────────────────────── */
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--white);
  color: var(--bg);
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform .3s var(--ease-out);
}
.skip-link:focus { transform: none; color: var(--bg); }
main:focus { outline: none; }

/* ─── Tags ───────────────────────────────────────────── */
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: -6px 0 20px; }
.tags li {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(var(--ink-rgb), .03);
  font: 500 11.5px/1 var(--font-mono);
  color: var(--muted);
}
.tags .tags__more { color: var(--green); }
.tags--lg { gap: 8px; margin: 0 0 36px; }
.tags--lg li { padding: 8px 14px; font-size: 13px; color: var(--white); border-color: var(--border-2); }

/* ─── Project highlights ─────────────────────────────── */
.highlights {
  margin: 0 0 44px;
  padding: 26px 28px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(34, 211, 238, .08), transparent 60%),
    var(--surface);
}
.highlights .eyebrow { margin-bottom: 18px; font-size: 12px; line-height: 1; color: var(--green); }
.highlights ul { display: grid; gap: 14px; }
.highlights li { display: flex; gap: 14px; align-items: flex-start; color: var(--white); font-size: 16px; line-height: 1.6; }
.highlights .icon {
  width: 24px;
  height: 24px;
  margin-top: 1px;
  padding: 5px;
  border-radius: 50%;
  background: rgba(63, 185, 80, .14);
  color: var(--green);
}

/* ─── Experience timeline ────────────────────────────── */
.timeline-wrap { margin-top: 140px; }
.timeline { position: relative; list-style: none; margin: 0; padding: 0 0 0 36px; }
.timeline::before {
  content: '';
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 7px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(var(--green), var(--cyan), var(--violet));
  opacity: .5;
}
.timeline__item { position: relative; padding-bottom: 48px; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__dot {
  position: absolute;
  top: 6px;
  left: -36px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--green);
  box-shadow: 0 0 0 6px rgba(63, 185, 80, .12);
}
.timeline__item:first-child .timeline__dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid var(--green);
  animation: pulse 2.4s var(--ease-out) infinite;
}
.timeline__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 20px; }
.timeline__head h3 { font-size: clamp(20px, 2.4vw, 26px); }
.timeline__period { font: 500 12px/1.4 var(--font-mono); letter-spacing: .08em; color: var(--muted); white-space: nowrap; }
.timeline__company { margin: 6px 0 16px; color: var(--green); font-weight: 500; }
.timeline__points { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.timeline__points li { position: relative; padding-left: 20px; color: var(--text); font-size: 15.5px; line-height: 1.65; }
.timeline__points li::before {
  content: '';
  position: absolute;
  top: .7em;
  left: 0;
  width: 8px;
  height: 2px;
  border-radius: 2px;
  background: var(--cyan);
}

.education { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 56px; }
.edu-card { padding: 24px 26px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.edu-card h3 { margin: 10px 0 6px; font-size: 19px; }
.edu-card p { margin: 0; color: var(--muted); }

/* ─── Medium articles ────────────────────────────────── */
.section--flush { padding-top: 0; }
.section__head--row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 32px; }
.article-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.article-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  overflow: hidden;
  transition: transform .5s var(--ease-out), border-color .3s, box-shadow .5s var(--ease-out);
}
.article-card:hover { color: var(--text); transform: translateY(-6px); border-color: var(--border-2); box-shadow: 0 24px 50px -24px var(--shadow-strong); }
.article-card__media { aspect-ratio: 16 / 9; overflow: hidden; background: var(--cover-bg); }
.article-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease-out); }
.article-card:hover .article-card__media img { transform: scale(1.05); }
.article-card__body { display: flex; flex-direction: column; flex: 1; padding: 22px 24px 24px; }
.article-card__date { font: 500 11px/1 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--green); margin-bottom: 12px; }
.article-card h3 { font-size: 20px; line-height: 1.25; margin-bottom: 10px; }
.article-card p { flex: 1; margin-bottom: 16px; color: var(--muted); font-size: 14.5px; line-height: 1.6; }
.article-card .tags { margin: 0; }

/* ─── Contact form states ────────────────────────────── */
.info-card--whatsapp .info-card__icon { background: rgba(37, 211, 102, .14); color: #25d366; }
[data-theme="light"] .info-card--whatsapp .info-card__icon { color: #128c4b; }
.info-card__go { margin-left: auto; color: var(--muted); transition: transform .5s var(--ease-out), color .3s; }
a.info-card:hover .info-card__go { color: var(--cyan); transform: translate(3px, -3px); }

.field--trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-status { margin: -4px 0 18px; font-size: 14.5px; line-height: 1.5; }
.form-status--error {
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(248, 81, 73, .35);
  background: rgba(248, 81, 73, .08);
  color: #ff7b72;
}
[data-theme="light"] .form-status--error { color: #b42318; }

.btn[aria-busy="true"] { pointer-events: none; opacity: .75; }
.btn[aria-busy="true"] .icon { animation: nudge 1s var(--ease-out) infinite; }
@keyframes nudge { 50% { transform: translateX(6px); } }

.form-success { text-align: center; padding: 24px 0 8px; }
.form-success h2 { font-size: 30px; margin-bottom: 10px; }
.form-success p { color: var(--muted); margin-bottom: 28px; }
.form-success .thanks__check { width: 80px; height: 80px; margin-bottom: 24px; }
[hidden] { display: none !important; }

/* ─── 404 ────────────────────────────────────────────── */
.not-found { text-align: center; }
.not-found .lead { margin: 0 auto 40px; }
.not-found__term { margin: 0 auto 48px; text-align: left; }

/* ─── One-screen pages (contact, thank you, 404) ─────────
   Content is centred between the nav and a footer that stays in view. */
.page-fit main { display: flex; align-items: center; }
.page-fit main > .section { width: 100%; }
.page-fit .page-head { padding: calc(var(--nav-h) + 28px) 0 40px; }
.page-fit .section__head { margin-bottom: 28px; }
.page-fit .section__title--xl { font-size: clamp(40px, 5.6vw, 76px); margin-bottom: 16px; }
.page-fit .lead { margin-bottom: 0; }
.page-fit .info-list { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 0; }
/* email and location span the row; phone and WhatsApp sit side by side */
.page-fit .info-list li:first-child,
.page-fit .info-list li:last-child { grid-column: 1 / -1; }
.page-fit .info-card { padding: 12px 16px; gap: 14px; }
.page-fit .info-card__icon { width: 38px; height: 38px; border-radius: 10px; }
.page-fit .form-card { padding: clamp(24px, 3vw, 32px); }
.page-fit .field { margin-bottom: 14px; }
.page-fit .field textarea { min-height: 120px; }
.page-fit .thanks__check { width: 80px; height: 80px; margin-bottom: 24px; }
.page-fit .not-found__term { margin-bottom: 32px; }

@media (min-width: 861px) and (max-height: 720px) {
  .page-fit .page-head { padding: calc(var(--nav-h) + 8px) 0 24px; }
  .page-fit .section__title--xl { font-size: clamp(36px, 4.6vw, 60px); margin-bottom: 12px; }
  .page-fit .section__head { margin-bottom: 20px; }
  .page-fit .field textarea { min-height: 96px; }
  .page-fit .form-card { padding: 22px 24px; }
  .page-fit .not-found__term { margin-bottom: 20px; }
  .page-fit .not-found .lead { margin-bottom: 24px; }
  .page-fit .footer { padding: 18px 0; }
}

/* ─── Footer ─────────────────────────────────────────── */
.footer { border-top: 1px solid var(--border); padding: 28px 0; }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 28px; }
.footer__title { font: 600 clamp(19px, 2.2vw, 24px)/1.2 var(--font-display); letter-spacing: -.02em; color: var(--white); margin-bottom: 6px; }
.footer__meta { font: 400 13px/1 var(--font-mono); color: var(--muted); margin: 0; }
.footer__actions { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.footer .socials a { width: 40px; height: 40px; }
.footer .socials a .icon { width: 17px; height: 17px; }

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 860px) {
  .nav__toggle { display: block; }
  .nav__resume { margin-left: auto; width: 44px; padding: 0; justify-content: center; }
  .nav__resume-label { display: none; }
  .nav__resume .icon { width: 18px; height: 18px; }
  .page-fit .info-list { grid-template-columns: 1fr; }
  .nav__links {
    position: fixed;
    inset: 0;
    z-index: 1;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    padding: 0 32px;
    background: rgba(var(--base-rgb), .96);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    clip-path: circle(0 at calc(100% - 46px) 42px);
    transition: clip-path .7s var(--ease-io), visibility 0s linear .7s;
    visibility: hidden;
  }
  .nav-open .nav__links {
    clip-path: circle(150% at calc(100% - 46px) 42px);
    visibility: visible;
    transition: clip-path .7s var(--ease-io), visibility 0s;
  }
  .nav__links a {
    font: 600 clamp(36px, 10vw, 56px)/1.1 var(--font-display);
    letter-spacing: -.03em;
    padding: 8px 0;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity .5s var(--ease-out), transform .7s var(--ease-out), color .3s;
  }
  .nav__links a span { font-size: 13px; }
  .nav-open .nav__links a { opacity: 1; transform: none; }
  .nav-open .nav__links a:nth-child(1) { transition-delay: .25s; }
  .nav-open .nav__links a:nth-child(2) { transition-delay: .32s; }
  .nav-open .nav__links a:nth-child(3) { transition-delay: .39s; }
  .nav-open .nav__links a:nth-child(4) { transition-delay: .46s; }
  .nav__indicator { display: none; }
  .nav-open { overflow: hidden; }
  .nav-open .nav__inner { background: transparent !important; border-color: transparent !important; box-shadow: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }

  .about, .contact, .skills { grid-template-columns: 1fr; }
  .about__visual { max-width: 340px; }
  .skills { margin-top: 80px; }
  .float-badge--a { left: -4%; }
}

@media (max-width: 560px) {
  .container { padding: 0 16px; }
  .nav { padding: 10px 12px; }
  .section { padding: 80px 0; }
  .page-head { padding-top: calc(var(--nav-h) + 40px); }
  .work-grid { grid-template-columns: 1fr; }
  .detail-hero { aspect-ratio: auto; min-height: 0; padding: 56px 14px 24px; margin-bottom: 48px; }
  .term { font-size: 12.5px; }
  .detail-body p { font-size: 16px; }
  .link-card { grid-template-columns: 1fr auto; }
  .link-card__url { grid-column: 1; grid-row: 2; }
  .link-card__icon { grid-row: 1 / span 2; grid-column: 2; }
  .pager { grid-template-columns: 1fr; }
  .pager__link--next { text-align: left; align-items: flex-start; }
  .skill-panel { padding: 26px; }
  .nav__inner { gap: 8px; }
  .timeline-wrap { margin-top: 100px; }
  .timeline { padding-left: 28px; }
  .timeline__dot { left: -28px; }
  .timeline::before { left: 7px; }
  .highlights { padding: 22px 20px; }
  .hero__actions .btn { flex: 1 1 auto; }
  .scroll-cue { display: none; }
  .playground { right: 16px; bottom: 20px; }
  .playground__panel { width: min(280px, calc(100vw - 32px)); }
}

/* ─── Reduced motion ─────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
  .js .page-curtain { display: none; }
  .cursor-glow { display: none; }
  .playground { display: none; }
  .marquee__track { animation: none; }
}

@media (max-width: 400px) {
  .nav__name { display: none; }
}
