/* ==========================================================================
   Aarathy S — Portfolio
   Ink / cream editorial theme with emerald accent
   ========================================================================== */

:root {
  --ink: #0A0F0D;
  --ink-2: #0F1613;
  --ink-3: #141D19;
  --ink-line: #1F2C26;
  --cream: #E2E8E4;
  --cream-2: #D7E0DA;
  --cream-line: #C3CEC7;
  --accent: #34D399;
  --accent-2: #6EE7B7;
  --accent-deep: #06734F; /* 4.7:1 on cream, readable at small sizes */
  --warm: #45524B;
  --muted: #94A39B;
  --light: #CAD4CE;

  --f-display: 'Space Grotesk', system-ui, sans-serif;
  --f-sans: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --f-serif: 'Instrument Serif', Georgia, serif;

  --t-hero: clamp(3.25rem, min(15.5vw, 30vh), 14rem);
  --t-section: clamp(2.5rem, 7vw, 5.75rem);
  --t-stat: clamp(2.5rem, 6vw, 4.75rem);
  --sp-section: clamp(5.5rem, 11vw, 10rem);
  --gutter: clamp(1rem, 4vw, 3rem);

  --ease: cubic-bezier(0.76, 0, 0.24, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--f-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.is-loading, body.menu-open { 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; padding: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p, figure { margin: 0; }
em { font-family: var(--f-serif); font-style: italic; font-weight: 400; letter-spacing: 0; text-transform: none; }
::selection { background: var(--accent); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.mono { font-family: var(--f-mono); text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.75rem; }
.container { width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 var(--gutter); }

.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 10000;
  background: var(--accent); color: var(--ink); padding: 0.6rem 1rem; border-radius: 999px; font-weight: 600;
}
.skip-link:focus { top: 1rem; }

.film-grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 9990; opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Preloader ---------- */
.preloader {
  position: fixed; inset: 0; z-index: 9995; background: var(--ink-2);
  display: grid; place-items: center; padding: var(--gutter);
  transition: transform 1s var(--ease);
}
.preloader.is-done { transform: translateY(calc(-100% - 22vh)); }
.preloader__word {
  display: flex; align-items: center; gap: 0.9rem;
  font-family: var(--f-display); font-weight: 500; font-size: clamp(2.25rem, 6vw, 4rem); letter-spacing: -0.02em; color: var(--cream);
}
.preloader__word [data-word] { display: inline-block; animation: wordIn 0.35s var(--ease-out); }
@keyframes wordIn { from { opacity: 0; transform: translateY(30%); } to { opacity: 1; transform: none; } }
.preloader__dot { width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--accent); }
.preloader__meta {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: calc(var(--gutter) + 1rem);
  display: flex; justify-content: space-between; color: var(--muted);
}
.preloader__meta [data-count] { color: var(--cream); font-variant-numeric: tabular-nums; }
.preloader__bar { position: absolute; left: var(--gutter); right: var(--gutter); bottom: var(--gutter); height: 2px; background: var(--ink-line); overflow: hidden; }
.preloader__bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.1s linear; }
/* Curved bottom edge: an ellipse hanging under the screen that flattens as it lifts */
.preloader__curve {
  position: absolute; left: -10%; top: 100%; width: 120%; height: 22vh; margin-top: -1px;
  background: var(--ink-2); border-radius: 0 0 50% 50%;
  transition: height 1s var(--ease);
}
.preloader.is-done .preloader__curve { height: 0; }

/* ---------- Scroll progress bar ---------- */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 1000; pointer-events: none; }
.progress span { display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; }

/* ---------- Smooth scroll (Lenis) ---------- */
html.lenis, html.lenis body { height: auto; }
html.lenis.lenis-smooth { scroll-behavior: auto; }
html.lenis.lenis-stopped { overflow: hidden; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 900;
  display: flex; align-items: center; justify-content: space-between;
  min-height: 5rem; padding: 1.25rem var(--gutter);
  transition: transform 0.5s var(--ease), background 0.4s, padding 0.4s;
}
.nav.is-scrolled {
  background: rgba(10, 15, 13, 0.72);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  padding-top: 0.85rem; padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.nav.is-hidden { transform: translateY(-110%); }
.nav__brand { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 500; font-size: 1.05rem; color: var(--light); }
.nav__mark { display: inline-block; font-size: 1.15rem; transition: transform 0.6s var(--ease); }
.nav__brand:hover .nav__mark { transform: rotate(360deg); }
.nav__brand-tail { color: var(--accent); }
.nav__links { display: flex; gap: 2rem; }
.nav__links a {
  position: relative; font-size: 0.9rem; color: var(--light);
  padding: 0.25rem 0; transition: color 0.3s;
}
.nav__links a::after {
  content: ''; position: absolute; left: 0; bottom: -2px; height: 1px; width: 100%;
  background: var(--accent); transform: scaleX(0); transform-origin: right; transition: transform 0.45s var(--ease);
}
.nav__links a:hover, .nav__links a.is-active { color: #fff; }
.nav__links a:hover::after, .nav__links a.is-active::after { transform: scaleX(1); transform-origin: left; }

/* Menu button lives outside the header (fixed), so it stays when the header slides away.
   Mobile: always visible. Desktop: scales in once the visitor scrolls past the hero. */
.nav__burger {
  position: fixed; z-index: 950; top: 1rem; right: var(--gutter);
  width: 48px; height: 48px; border-radius: 50%; overflow: hidden; isolation: isolate;
  background: var(--ink-3); border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
  transform: scale(0); opacity: 0; pointer-events: none;
  transition: transform 0.5s var(--ease), opacity 0.3s;
}
.nav__burger::before {
  content: ''; position: absolute; inset: 0; z-index: -1; border-radius: 50%; background: var(--accent);
  transform: scale(0); transition: transform 0.45s var(--ease);
}
.nav__burger:hover::before { transform: scale(1); }
.nav__burger:hover span { background: var(--ink); }
.nav-compact .nav__burger, .menu-open .nav__burger { transform: scale(1); opacity: 1; pointer-events: auto; }
.nav__burger span {
  position: absolute; left: 50%; width: 20px; height: 2px; margin-left: -10px; border-radius: 2px;
  background: var(--cream); transition: transform 0.35s var(--ease), top 0.35s var(--ease), background 0.3s;
}
.nav__burger span:first-child { top: 18px; }
.nav__burger span:last-child { top: 26px; }
.nav__burger[aria-expanded="true"] span:first-child { top: 22px; transform: rotate(45deg); }
.nav__burger[aria-expanded="true"] span:last-child { top: 22px; transform: rotate(-45deg); }

/* Fullscreen menu links stagger in */
.menu.is-open nav a { opacity: 1; transform: none; }
.menu.is-open nav a:nth-child(1) { transition-delay: 0.15s; }
.menu.is-open nav a:nth-child(2) { transition-delay: 0.21s; }
.menu.is-open nav a:nth-child(3) { transition-delay: 0.27s; }
.menu.is-open nav a:nth-child(4) { transition-delay: 0.33s; }
.menu.is-open nav a:nth-child(5) { transition-delay: 0.39s; }
.menu nav a:hover { color: var(--accent); }

.menu {
  position: fixed; inset: 0; z-index: 800; background: var(--ink-2);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 7rem var(--gutter) 2rem;
  /* Opens as a circle growing out of the menu button */
  clip-path: circle(0% at calc(100% - var(--gutter) - 24px) 40px);
  transition: clip-path 0.7s var(--ease);
}
/* `display: flex` above would override the HTML hidden attribute and leave invisible,
   keyboard-focusable links; make sure a closed menu is really gone. */
.menu[hidden] { display: none; }
.menu.is-open { clip-path: circle(150% at calc(100% - var(--gutter) - 24px) 40px); }
.menu nav { display: flex; flex-direction: column; gap: 0.5rem; }
.menu nav a {
  display: flex; align-items: baseline; gap: 1rem;
  font-family: var(--f-display); font-size: clamp(2.5rem, 7vw, 5.5rem); font-weight: 600; line-height: 1.05;
  letter-spacing: -0.03em; color: var(--cream);
  opacity: 0; transform: translateY(40px);
  transition: opacity 0.5s var(--ease-out), transform 0.7s var(--ease-out), color 0.3s;
}
.menu nav a .mono { color: var(--accent); font-size: 0.75rem; }
.menu__foot { display: flex; flex-direction: column; gap: 0.6rem; color: var(--muted); text-transform: none; letter-spacing: 0.04em; }

/* ---------- Buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  height: 3.25rem; padding: 0 1.75rem; border-radius: 999px; overflow: hidden;
  font-weight: 500; font-size: 0.95rem; isolation: isolate;
  transition: color 0.45s var(--ease), border-color 0.45s;
}
/* Fill spreads from wherever the cursor entered (JS sets --x/--y; centre by default) */
.btn::before {
  content: ''; position: absolute; z-index: -1; left: var(--x, 50%); top: var(--y, 50%);
  width: 260%; aspect-ratio: 1; border-radius: 50%;
  transform: translate(-50%, -50%) scale(0); transition: transform 0.6s var(--ease);
}
.btn:hover::before, .btn:focus-visible::before { transform: translate(-50%, -50%) scale(1); }
.btn--accent { background: var(--accent); color: var(--ink); }
.btn--accent::before { background: var(--cream); }
.btn--ghost { border: 1px solid rgba(226, 232, 228, 0.28); color: var(--cream); }
.btn--ghost::before { background: var(--cream); }
.btn--ghost:hover { color: var(--ink); border-color: var(--cream); }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100svh; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center;
  padding: 7rem var(--gutter) 6rem; background: var(--ink);
}
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.55; }
.hero__spot {
  position: absolute; width: 60vmax; height: 60vmax; left: 50%; top: 50%; pointer-events: none;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(52, 211, 153, 0.14) 0%, rgba(52, 211, 153, 0) 60%);
  transition: left 0.6s var(--ease-out), top 0.6s var(--ease-out);
}
.hero__inner { position: relative; z-index: 2; text-align: center; max-width: 1200px; margin: 0 auto; }

.ticker { display: inline-flex; align-items: center; gap: 0.7rem; color: var(--accent); margin-bottom: 1.75rem; }
.ticker__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: ping 2s infinite; }
.ticker__window { height: 1.4em; overflow: hidden; }
.ticker__track { display: flex; flex-direction: column; transition: transform 0.55s var(--ease); }
.ticker__track span { height: 1.4em; line-height: 1.4em; white-space: nowrap; text-align: left; }

@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
  80%, 100% { box-shadow: 0 0 0 10px rgba(52, 211, 153, 0); }
}

.hero__title {
  font-family: var(--f-display); font-weight: 700; font-size: var(--t-hero);
  line-height: 0.82; letter-spacing: -0.055em; color: var(--cream);
  display: flex; flex-direction: column; align-items: center;
}
.hero__title .line { display: block; overflow: hidden; padding: 0.04em 0.04em 0.08em; white-space: nowrap; }
.hero__title em { color: var(--accent); font-size: 0.9em; letter-spacing: -0.02em; margin-left: 0.12em; }
.char { display: inline-block; }
.hero__title .word { display: inline-block; }
.is-ready .hero__title .char { animation: charUp 1.05s var(--ease-out) both; animation-delay: calc(var(--i) * 0.035s + 0.1s); }
@keyframes charUp {
  from { transform: translateY(115%) rotateX(-70deg); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.hero__lead {
  max-width: 40rem; margin: 2.25rem auto 0; color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.15rem);
}
.hero__lead strong { color: var(--cream); font-weight: 500; }
.hero__cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; margin-top: 2.25rem; }

.stamp {
  position: absolute; z-index: 3; right: var(--gutter); bottom: 5.5rem;
  width: 8.5rem; height: 8.5rem; display: grid; place-items: center;
}
.stamp__disc { position: absolute; inset: 0; width: 100%; height: 100%; animation: spin 16s linear infinite; }
.stamp__disc text { fill: var(--light); font-family: var(--f-mono); font-size: 15.5px; letter-spacing: 0.29em; }
.stamp__core {
  width: 3.25rem; height: 3.25rem; border-radius: 50%; background: var(--accent); color: var(--ink);
  display: grid; place-items: center; transition: transform 0.4s var(--ease);
}
.stamp:hover .stamp__core { transform: scale(1.12) rotate(-45deg); }
@keyframes spin { to { transform: rotate(360deg); } }

.hero__meta {
  position: absolute; z-index: 2; left: var(--gutter); right: var(--gutter); bottom: 1.75rem;
  display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: 0.68rem;
}
.hero__scroll { animation: bob 2.2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(4px); } }

/* ---------- Sections ---------- */
.section { position: relative; padding: var(--sp-section) 0; }
.section--ink { background: var(--ink); color: var(--cream); }
.section--cream { background: var(--cream); color: var(--ink); }
.section--cream + .section--cream { padding-top: 0; }
.section--ink + .section--ink { padding-top: calc(var(--sp-section) * 0.4); }

.eyebrow { display: flex; align-items: center; gap: 0.75rem; color: var(--muted); margin-bottom: 2rem; }
.eyebrow span { color: var(--accent); }
.section--cream .eyebrow { color: var(--warm); }
.section--cream .eyebrow span { color: var(--accent-deep); }
.eyebrow::after { content: ''; flex: 1; height: 1px; background: currentColor; opacity: 0.25; }
.eyebrow--spaced { margin-top: 4rem; }

.section-title {
  font-family: var(--f-display); font-weight: 600; font-size: var(--t-section);
  line-height: 0.95; letter-spacing: -0.045em; margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
}
.section-title em { color: var(--accent); }
.section--cream .section-title em { color: var(--accent-deep); }

/* ---------- Reveal (only hidden when JS is running) ---------- */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out); transition-delay: var(--d, 0s); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- Curved divider ---------- */
/* The box keeps a fixed height so nothing below it moves while scrolling (anchor links stay
   accurate); only the curve inside is squashed with a transform as it passes. */
.curve { position: relative; height: clamp(72px, 10vw, 150px); background: var(--bottom); overflow: hidden; z-index: 5; margin-top: -1px; }
.curve > div {
  position: absolute; top: 0; left: -10%; width: 120%; height: 100%;
  background: var(--top); border-radius: 0 0 50% 50%;
  transform: scaleY(var(--s, 1)); transform-origin: 50% 0; will-change: transform;
}

/* ---------- About ---------- */
.about__grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: clamp(2rem, 5vw, 5rem); align-items: end; }
.about__statement {
  font-family: var(--f-display); font-weight: 500;
  font-size: clamp(1.75rem, 3.8vw, 3.25rem); line-height: 1.12; letter-spacing: -0.03em;
}
.about__statement .w { color: rgba(226, 232, 228, 0.4); transition: color 0.35s; }
.about__statement .w.is-lit { color: var(--cream); }
.about__photo { position: relative; border-radius: 1.25rem; overflow: hidden; background: var(--ink-3); }
.about__photo img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; filter: grayscale(0.35) contrast(1.05); transition: filter 0.6s; will-change: transform; }
.about__photo:hover img { filter: none; }
.about__photo figcaption {
  position: absolute; left: 0.75rem; right: 0.75rem; bottom: 0.75rem;
  background: rgba(10, 15, 13, 0.7); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  padding: 0.6rem 0.85rem; border-radius: 0.6rem; font-size: 0.64rem; color: var(--light);
}

.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); margin-top: clamp(3.5rem, 7vw, 6rem);
  border-top: 1px solid var(--ink-line);
}
.stat { padding: 2rem 1.5rem 0 0; border-right: 1px solid var(--ink-line); }
.stat + .stat { padding-left: 1.5rem; }
.stat:last-child { border-right: 0; }
.stat__num {
  display: block; font-family: var(--f-display); font-weight: 600; font-size: var(--t-stat);
  line-height: 1; letter-spacing: -0.04em; color: var(--cream); font-variant-numeric: tabular-nums;
}
.stat__label { display: block; margin-top: 0.85rem; color: var(--muted); font-size: 0.68rem; line-height: 1.5; max-width: 16rem; }

/* ---------- Impact ---------- */
/* Stacked cards: each one sticks below the nav while the next slides over it */
.impact__stack { display: flex; flex-direction: column; gap: 1.5rem; counter-reset: impact; }
.impact__card {
  counter-increment: impact;
  position: sticky; top: calc(6rem + var(--i, 0) * 1.25rem);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); grid-template-rows: auto 1fr; column-gap: 3rem;
  min-height: clamp(18rem, 42vh, 24rem); padding: clamp(1.75rem, 3.5vw, 3rem);
  border-radius: 1.5rem; overflow: hidden;
  background: var(--ink-2); border: 1px solid var(--ink-line);
  box-shadow: 0 -24px 48px -24px rgba(0, 0, 0, 0.7);
  transform-origin: 50% 0; will-change: transform;
  transition: border-color 0.4s;
}
.impact__card::after {
  content: counter(impact, decimal-leading-zero);
  grid-column: 1; grid-row: 2; align-self: end;
  font-family: var(--f-display); font-weight: 600; font-size: clamp(4rem, 9vw, 7.5rem); line-height: 0.8;
  letter-spacing: -0.05em; color: transparent; -webkit-text-stroke: 1px rgba(52, 211, 153, 0.5);
}
.impact__card::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.4s;
  background: radial-gradient(500px circle at var(--mx, 50%) var(--my, 50%), rgba(52, 211, 153, 0.12), transparent 60%);
}
.impact__card:hover { border-color: rgba(52, 211, 153, 0.4); }
.impact__card:hover::before { opacity: 1; }
.impact__tag {
  grid-column: 1; grid-row: 1; justify-self: start; align-self: start;
  display: inline-block; font-size: 0.62rem; color: var(--accent);
  border: 1px solid rgba(52, 211, 153, 0.35); padding: 0.3rem 0.65rem; border-radius: 999px;
}
.impact__card h3 {
  grid-column: 2; grid-row: 1; margin: 0 0 1rem;
  font-family: var(--f-display); font-weight: 600; font-size: clamp(1.6rem, 3.2vw, 2.75rem); line-height: 1.05;
  letter-spacing: -0.035em;
}
.impact__card p { grid-column: 2; grid-row: 2; align-self: start; max-width: 36rem; color: var(--muted); font-size: clamp(0.95rem, 1.3vw, 1.1rem); }

/* ---------- Experience ---------- */
.job { border-top: 1px solid var(--ink); }
.job__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.5rem; flex-wrap: wrap; padding: 2rem 0 2.5rem; }
.job__company { font-family: var(--f-display); font-weight: 600; font-size: clamp(2rem, 4.5vw, 3.5rem); letter-spacing: -0.04em; line-height: 1; }
.job__role { margin-top: 0.6rem; font-family: var(--f-serif); font-style: italic; font-size: clamp(1.35rem, 2.4vw, 1.85rem); color: var(--warm); }
.job__date {
  display: inline-flex; align-items: center; gap: 0.6rem; padding: 0.55rem 1rem; border-radius: 999px;
  background: var(--ink); color: var(--cream); font-size: 0.68rem;
}
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: ping 2s infinite; }
.job__groups { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.job__group { background: var(--cream-2); border: 1px solid var(--cream-line); border-radius: 1.25rem; padding: 1.75rem; }
.job__group h4 { font-size: 0.7rem; color: var(--accent-deep); margin-bottom: 1.1rem; }
.job__group li { position: relative; padding-left: 1.35rem; color: #26302B; font-size: 0.95rem; }
.job__group li + li { margin-top: 0.85rem; }
.job__group li::before { content: '↳'; position: absolute; left: 0; color: var(--accent-deep); }

/* ---------- Projects ---------- */
.plist { border-top: 1px solid var(--ink); }
.pitem { position: relative; isolation: isolate; border-bottom: 1px solid var(--cream-line); }
.pitem__head {
  width: 100%; display: grid; grid-template-columns: 3.5rem 1fr auto 2.5rem; align-items: center; gap: 1.5rem;
  padding: clamp(1.5rem, 3vw, 2.25rem) 0; text-align: left; position: relative;
}
.pitem__head::before {
  content: ''; position: absolute; inset: 0 -1rem; z-index: -1; border-radius: 1rem; background: var(--ink);
  transform: scaleY(0); transform-origin: bottom; transition: transform 0.5s var(--ease);
}
.pitem__num { color: var(--warm); transition: color 0.4s; }
.pitem__title {
  font-family: var(--f-display); font-weight: 600; font-size: clamp(1.5rem, 3.6vw, 3rem);
  letter-spacing: -0.035em; line-height: 1.05; transition: transform 0.5s var(--ease), color 0.4s;
}
.pitem__stack { color: var(--warm); font-size: 0.66rem; text-align: right; transition: color 0.4s; }
.pitem__icon { position: relative; width: 2.5rem; height: 2.5rem; border-radius: 50%; border: 1px solid currentColor; transition: background 0.4s, border-color 0.4s, transform 0.5s var(--ease); }
.pitem__icon::before, .pitem__icon::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 12px; height: 1.5px; margin: -0.75px 0 0 -6px; background: currentColor;
  transition: transform 0.4s var(--ease);
}
.pitem__icon::after { transform: rotate(90deg); }
.pitem__head[aria-expanded="true"] .pitem__icon { transform: rotate(180deg); }
.pitem__head[aria-expanded="true"] .pitem__icon::after { transform: rotate(0deg); }

@media (hover: hover) {
  .pitem__head:hover::before { transform: scaleY(1); transform-origin: top; }
  .pitem__head:hover { color: var(--cream); }
  .pitem__head:hover .pitem__title { transform: translateX(0.75rem); }
  .pitem__head:hover .pitem__num, .pitem__head:hover .pitem__stack { color: var(--accent); }
  .pitem__head:hover .pitem__icon { background: var(--accent); border-color: var(--accent); color: var(--ink); }
}

.pitem__body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.55s var(--ease); }
.pitem__body > div { overflow: hidden; }
.pitem.is-open .pitem__body { grid-template-rows: 1fr; }
.pitem__body ul { padding: 0 0 2rem 5rem; max-width: 52rem; }
.pitem__body li { position: relative; padding-left: 1.35rem; color: #26302B; font-size: 1.02rem; }
.pitem__body li + li { margin-top: 0.6rem; }
.pitem__body li::before { content: '↳'; position: absolute; left: 0; color: var(--accent-deep); }

/* ---------- Marquee ---------- */
.marquee { background: var(--cream); overflow: hidden; }
.marquee__row { --row-bg: var(--cream); position: relative; overflow: hidden; padding: 1rem 0; background: var(--row-bg); }
/* Edge fades drawn in the row's own colour, so dark and light rows both fade cleanly */
.marquee__row::before, .marquee__row::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 10%; z-index: 1; pointer-events: none;
}
.marquee__row::before { left: 0; background: linear-gradient(90deg, var(--row-bg), transparent); }
.marquee__row::after { right: 0; background: linear-gradient(-90deg, var(--row-bg), transparent); }
.marquee__row--dark { --row-bg: var(--ink); padding: 0.85rem 0; }
.marquee__row--dark .marquee__track span { font-family: var(--f-serif); font-style: italic; font-weight: 400; letter-spacing: 0; color: var(--cream); }
.marquee__row--dark .marquee__track i { color: var(--accent); }
.marquee__track { display: inline-flex; align-items: center; gap: 1.75rem; padding-right: 1.75rem; white-space: nowrap; will-change: transform; }
.marquee__track span { font-family: var(--f-display); font-weight: 600; font-size: clamp(1.75rem, 4vw, 3rem); letter-spacing: -0.03em; color: var(--ink); }
.marquee__track i { font-style: normal; color: var(--accent-deep); font-size: 0.9rem; }

/* ---------- Skills ---------- */
.skills__grid { display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--ink-line); }
.skill { padding: 2rem 2rem 2rem 0; border-bottom: 1px solid var(--ink-line); }
.skill:nth-child(even) { padding-left: 2rem; padding-right: 0; border-left: 1px solid var(--ink-line); }
.skill h3 { color: var(--accent); font-size: 0.7rem; font-weight: 500; margin-bottom: 1.1rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chips li {
  padding: 0.45rem 0.95rem; border-radius: 999px; font-size: 0.88rem;
  background: var(--ink-3); border: 1px solid var(--ink-line); color: var(--light);
  transition: background 0.3s, color 0.3s, border-color 0.3s, transform 0.3s var(--ease-out);
}
.chips li:hover { background: var(--accent); border-color: var(--accent); color: var(--ink); transform: translateY(-2px); }

/* ---------- Credentials ---------- */
.creds__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(3rem, 7vw, 7rem); }
.cert { display: flex; align-items: center; gap: 1.25rem; padding: 1.35rem 0; border-bottom: 1px solid var(--ink-line); }
.cert__code {
  flex: 0 0 auto; min-width: 5.5rem; text-align: center; padding: 0.55rem 0.6rem; border-radius: 0.6rem;
  background: rgba(52, 211, 153, 0.1); color: var(--accent); font-size: 0.7rem; letter-spacing: 0.08em;
}
.cert__name { font-family: var(--f-display); font-size: clamp(1.05rem, 1.8vw, 1.3rem); font-weight: 500; letter-spacing: -0.015em; }
.edu { display: flex; flex-direction: column; gap: 0.35rem; }
.edu__deg { font-family: var(--f-serif); font-style: italic; font-size: clamp(2rem, 4vw, 3rem); line-height: 1; }
.edu__school { color: var(--muted); }
.lead-list li {
  position: relative; padding: 1.35rem 0 1.35rem 2.25rem; border-bottom: 1px solid var(--ink-line);
  font-size: clamp(1.05rem, 1.7vw, 1.25rem); color: var(--light);
}
.lead-list li::before { content: ''; position: absolute; left: 0; top: 2.1rem; width: 0.9rem; height: 1px; background: var(--accent); }

/* ---------- Contact ---------- */
.contact { padding-bottom: 0; overflow: hidden; }
.contact__title {
  font-family: var(--f-display); font-weight: 700; font-size: clamp(4rem, 15vw, 12rem);
  line-height: 0.85; letter-spacing: -0.055em; margin-bottom: 1.5rem;
}
.contact__title em { color: var(--accent); }
.contact__intro { max-width: 34rem; color: var(--muted); font-size: 1.05rem; margin-bottom: clamp(2.5rem, 5vw, 3.5rem); }
.contact__grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 1rem; }
.contact__cta { font-size: 0.9rem; color: var(--accent); }
.contact__mail, .contact__card {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 2rem;
  min-height: 9rem; padding: 1.6rem; border-radius: 1.25rem; text-align: left;
  background: var(--ink-2); border: 1px solid var(--ink-line); overflow: hidden;
  transition: border-color 0.4s, background 0.4s, color 0.4s;
}
.contact__card:hover { border-color: var(--accent); }
.contact__mail { background: var(--accent); color: var(--ink); border-color: var(--accent); }
.contact__mail:hover { background: var(--accent-2); }
.contact__label { color: var(--muted); font-size: 0.66rem; }
.contact__mail .contact__label { color: rgba(10, 15, 13, 0.7); }
.contact__value { font-family: var(--f-display); font-weight: 500; font-size: clamp(1.1rem, 2vw, 1.45rem); letter-spacing: -0.02em; overflow-wrap: anywhere; }
.contact__mail .contact__value { font-size: clamp(1.5rem, 3.6vw, 3rem); font-weight: 600; letter-spacing: -0.035em; }
.contact__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.contact__actions a, .contact__actions button {
  display: inline-flex; align-items: center; height: 2.5rem; padding: 0 1.1rem; border-radius: 999px;
  border: 1px solid rgba(10, 15, 13, 0.35); font-size: 0.85rem; font-weight: 500;
  transition: background 0.3s, color 0.3s;
}
.contact__actions a:hover, .contact__actions button:hover { background: var(--ink); color: var(--cream); }
.contact__toast { font-size: 0.62rem; align-self: center; margin-left: 0.25rem; opacity: 0; transition: opacity 0.3s; }
.contact__toast.is-shown { opacity: 1; }

.footer { margin-top: var(--sp-section); border-top: 1px solid var(--ink-line); }
.footer__cols {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 2rem; align-items: start;
  padding: clamp(2.5rem, 5vw, 4rem) 0;
}
.footer__col h3 { color: var(--muted); font-size: 0.66rem; font-weight: 500; margin-bottom: 1.1rem; }
.footer__col ul { display: flex; flex-direction: column; gap: 0.15rem; }
.footer__col a { position: relative; display: inline-block; padding: 0.3rem 0; color: var(--light); font-size: 1rem; transition: color 0.3s; }
.footer__col a::after {
  content: ''; position: absolute; left: 0; bottom: 0.15rem; width: 100%; height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: right; transition: transform 0.45s var(--ease);
}
.footer__col a:hover { color: var(--cream); }
.footer__col a:hover::after { transform: scaleX(1); transform-origin: left; }
.footer__time { font-family: var(--f-display); font-size: 1.5rem; font-weight: 500; letter-spacing: -0.02em; color: var(--cream); font-variant-numeric: tabular-nums; }
.footer__time .mono { font-size: 0.66rem; color: var(--accent); margin-left: 0.3rem; }
.footer__top {
  display: grid; place-items: center; width: 3.25rem; height: 3.25rem; border-radius: 50%;
  background: var(--ink-3); border: 1px solid var(--ink-line); color: var(--cream);
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}
.footer__top svg { transition: transform 0.4s var(--ease); }
.footer__top:hover { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.footer__top:hover svg { animation: nudgeUp 0.9s var(--ease) infinite; }
@keyframes nudgeUp { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.footer__inner { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1.5rem 0; border-top: 1px solid var(--ink-line); color: var(--muted); font-size: 0.66rem; }
.footer__giant {
  font-family: var(--f-display); font-weight: 700; font-size: 23vw; line-height: 0.75; letter-spacing: -0.06em;
  text-align: center; color: transparent; -webkit-text-stroke: 1px #2A3B33; margin-bottom: -0.1em; user-select: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(3) { padding-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--ink-line); margin-top: 2rem; }
}

@media (max-width: 820px) {
  .nav__links { display: none; }
  .nav__burger { transform: scale(1); opacity: 1; pointer-events: auto; }
  .footer__cols { grid-template-columns: 1fr 1fr; }
  .footer__top { justify-self: end; align-self: end; }
  .about__grid, .creds__grid, .job__groups, .skills__grid, .contact__grid { grid-template-columns: 1fr; }
  .about__photo { max-width: 22rem; }
  .skill, .skill:nth-child(even) { padding: 1.75rem 0; border-left: 0; }
  .pitem__head { grid-template-columns: 2.5rem 1fr 2.5rem; gap: 1rem; }
  .pitem__stack { grid-column: 2; grid-row: 2; text-align: left; margin-top: -0.5rem; }
  .pitem__icon { grid-column: 3; grid-row: 1; }
  .pitem__body ul { padding-left: 3.5rem; }
  .stamp { width: 6.5rem; height: 6.5rem; bottom: 4.5rem; }
  .stamp__core { width: 2.6rem; height: 2.6rem; }
  .hero__meta span:nth-child(2) { display: none; }
}

@media (max-width: 560px) {
  .impact__card { grid-template-columns: 1fr; grid-template-rows: auto auto auto 1fr; top: calc(5rem + var(--i, 0) * 0.75rem); min-height: 0; }
  .impact__card h3 { grid-column: 1; grid-row: 2; margin-top: 1.25rem; }
  .impact__card p { grid-column: 1; grid-row: 3; }
  .impact__card::after { grid-column: 1; grid-row: 4; justify-self: end; margin-top: 1rem; font-size: 3.5rem; }
  .stats { grid-template-columns: 1fr; }
  .stat, .stat + .stat, .stat:nth-child(3) { padding: 1.5rem 0; border-right: 0; margin-top: 0; }
  .stat + .stat { border-top: 1px solid var(--ink-line); }
  .hero { padding-bottom: 9rem; }
  .stamp { right: calc(50% - 2.75rem); bottom: 3.25rem; width: 5.5rem; height: 5.5rem; }
  .hero__meta { justify-content: center; }
  .hero__meta span:first-child { display: none; }
  .pitem__body ul { padding-left: 0; }
  .cert { align-items: flex-start; flex-direction: column; gap: 0.6rem; }
  .cert__code { min-width: 0; }
}

/* ---------- Custom cursor (fine pointers only, added by JS) ---------- */
.has-cursor, .has-cursor a, .has-cursor button { cursor: none; }
.cursor-dot, .cursor-ring {
  position: fixed; top: 0; left: 0; z-index: 9999; pointer-events: none; border-radius: 50%;
  transform: translate3d(-100px, -100px, 0);
}
.cursor-dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: var(--accent); transition: opacity 0.3s; }
.cursor-ring {
  width: 38px; height: 38px; margin: -19px 0 0 -19px; border: 1px solid rgba(52, 211, 153, 0.7);
  display: grid; place-items: center;
  transition: width 0.35s var(--ease-out), height 0.35s var(--ease-out), margin 0.35s var(--ease-out), border-color 0.3s, background 0.3s, opacity 0.3s;
}
.cursor-ring__label {
  position: relative; font-family: var(--f-mono); font-size: 0.6rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink); opacity: 0; transition: opacity 0.2s;
}
.cursor-ring.is-hover { width: 64px; height: 64px; margin: -32px 0 0 -32px; background: rgba(52, 211, 153, 0.12); }
.cursor-ring.is-label { width: 84px; height: 84px; margin: -42px 0 0 -42px; background: var(--accent); border-color: var(--accent); }
.cursor-ring.is-label .cursor-ring__label { opacity: 1; }
.cursor-ring.is-hidden, .cursor-dot.is-hidden { opacity: 0; }

/* ---------- Text roll on hover ---------- */
.roll { position: relative; display: inline-flex; overflow: hidden; vertical-align: top; }
.roll > span { display: block; transition: transform 0.45s var(--ease); }
.roll > span + span { position: absolute; top: 100%; left: 0; }
a:hover > .roll > span, button:hover > .roll > span, .btn:hover .roll > span,
a:focus-visible > .roll > span, button:focus-visible > .roll > span { transform: translateY(-100%); }

/* ---------- Split headings (letters rise in on scroll) ---------- */
.split .word { display: inline-block; overflow: hidden; vertical-align: top; padding: 0.06em 0.02em 0.12em; margin: -0.06em -0.02em -0.12em; white-space: nowrap; }
.js .split .char { opacity: 0; transform: translateY(110%) rotateX(-60deg); transform-origin: 50% 100%; }
.js .split.is-in .char { animation: charUp 0.9s var(--ease-out) both; animation-delay: calc(var(--i) * 0.025s); }

/* ---------- Eyebrow rule draws in ---------- */
.js .eyebrow::after { transform: scaleX(0); transform-origin: left; transition: transform 1.2s var(--ease) 0.2s; }
.js .eyebrow.is-in::after { transform: scaleX(1); }

/* ---------- Reduced motion: keep the page alive, but swap big movement for fades ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { transform: none; }
  .is-ready .char, .js .split.is-in .char { animation-name: charFade; animation-duration: 0.8s; }
  .js .split .char { transform: none; }
  .stamp__disc { animation-duration: 40s; }
  @keyframes charFade { from { opacity: 0; } to { opacity: 1; } }
}
