/* =============================================================================
   Jibran Attar · portfolio styles
   Dark "liquid metal" theme. Sections appear in the same order as the page.
   ============================================================================= */

/* ------------------------------------------------------------------ tokens */
:root {
  --bg: #050506;
  --fg: #ededf0;
  --soft: #c3c8cf;
  --muted: #8b9099;
  --line: rgba(255, 255, 255, .08);
  --line2: rgba(255, 255, 255, .15);
  --ok: #5ee6a8;
  --warn: #f5c26b;
  --accent: #a9b8ff;

  /* polished-chrome gradient used for big type and the main buttons */
  --chrome: linear-gradient(100deg, #6d737c 0%, #f4f6f8 16%, #9aa1aa 30%, #ffffff 44%, #5c626b 58%, #dfe3e8 74%, #7d848d 88%, #f4f6f8 100%);

  --ease: cubic-bezier(.16, 1, .3, 1);       /* fast start, long soft landing */
  --ease-io: cubic-bezier(.76, 0, .24, 1);   /* slow-fast-slow, for curtains */

  --f-display: "Inter Tight", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --pad: clamp(20px, 5vw, 72px);
  --radius: 28px;
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--fg);
  font-family: var(--f-display);
  font-size: clamp(15px, 1.02vw, 17px);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
.js body.is-loading { overflow: hidden; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
button { font: inherit; }
::selection { background: #fff; color: #000; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 8px; }
.mono { font-family: var(--f-mono); font-size: 12px; letter-spacing: .06em; }
.muted { color: var(--muted); }
.serif, em.serif { font-family: var(--f-serif); font-style: italic; font-weight: 400; }

/* ------------------------------------------------------------------ background layers */
#liquid {
  position: fixed; inset: 0;
  width: 100%; height: 100vh; height: 100lvh;
  z-index: -3; display: block;
}
.bg-fallback {
  position: fixed; inset: -20%; z-index: -4; display: none;
  background:
    radial-gradient(40% 35% at 30% 30%, #343943 0%, transparent 70%),
    radial-gradient(35% 40% at 72% 68%, #23262e 0%, transparent 70%),
    radial-gradient(30% 30% at 60% 25%, #1c1f27 0%, transparent 70%),
    var(--bg);
}
.no-webgl .bg-fallback { display: block; animation: drift 18s ease-in-out infinite alternate; }
.no-webgl #liquid { display: none; }
@keyframes drift { to { transform: translate3d(6%, -4%, 0) rotate(8deg) scale(1.1); } }

/* darkens the background as you scroll, so text stays easy to read */
.bg-shade {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 50%, rgba(5, 5, 6, .66), rgba(5, 5, 6, .9));
  opacity: 0;
}
/* film grain on top of everything */
.grain {
  position: fixed; inset: -50%; z-index: 90; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-4%, 3%); } 40% { transform: translate(3%, -5%); }
  60% { transform: translate(-6%, -2%); } 80% { transform: translate(5%, 4%); } 100% { transform: translate(0, 0); }
}

/* ------------------------------------------------------------------ preloader */
.loader { display: none; }
.js .loader {
  position: fixed; inset: 0; z-index: 200;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: var(--pad);
  background: #060607;
  transition: transform 1.1s var(--ease-io), border-radius 1.1s var(--ease-io);
}
.loaded .loader {
  transform: translateY(-105%);
  border-bottom-left-radius: 50% 14vh;
  border-bottom-right-radius: 50% 14vh;
  pointer-events: none;
}
.loader__row { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.loader__name { font-size: clamp(1.2rem, 2vw, 1.6rem); font-weight: 600; letter-spacing: -.02em; display: grid; gap: 4px; }
.loader__name span { font: 12px var(--f-mono); color: var(--muted); letter-spacing: .1em; text-transform: uppercase; font-weight: 400; }
.loader__count {
  font-weight: 600; font-size: clamp(5rem, 16vw, 13rem); line-height: .8; letter-spacing: -.06em;
  font-variant-numeric: tabular-nums;
  background: var(--chrome); background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.loader__bar { height: 1px; background: var(--line); margin-top: 28px; overflow: hidden; }
.loader__bar i { display: block; height: 100%; background: #fff; transform-origin: left; transform: scaleX(0); }

/* ------------------------------------------------------------------ cursor */
.cursor { display: none; }
.has-cursor .cursor { display: block; }
.has-cursor, .has-cursor * { cursor: none !important; }
.cursor__dot, .cursor__ring {
  position: fixed; left: 0; top: 0; z-index: 300; pointer-events: none; border-radius: 50%;
  will-change: transform;
}
.cursor__dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: #fff; transition: opacity .3s; }
.cursor__ring {
  width: 40px; height: 40px; margin: -20px 0 0 -20px;
  border: 1px solid rgba(255, 255, 255, .5);
  transition: width .45s var(--ease), height .45s var(--ease), margin .45s var(--ease),
              background-color .35s, border-color .35s, opacity .3s;
}
.cursor.is-link .cursor__ring { width: 68px; height: 68px; margin: -34px 0 0 -34px; background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .2); }
.cursor.is-link .cursor__dot { opacity: 0; }
.cursor.is-card .cursor__ring { width: 56px; height: 56px; margin: -28px 0 0 -28px; border-color: rgba(255, 255, 255, .8); }
.cursor.is-hidden .cursor__dot, .cursor.is-hidden .cursor__ring { opacity: 0; }

/* ------------------------------------------------------------------ scroll progress */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 70; pointer-events: none; }
.progress i { display: block; height: 100%; background: var(--chrome); transform-origin: left; transform: scaleX(0); }

/* ------------------------------------------------------------------ navigation */
.nav {
  position: fixed; top: 16px; left: 50%; z-index: 60;
  display: flex; align-items: center; gap: 6px;
  padding: 7px; border-radius: 999px;
  background: rgba(12, 13, 16, .55);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  transform: translateX(-50%);
  transition: transform .7s var(--ease), opacity .5s;
}
.js .nav { opacity: 0; transform: translate(-50%, -30px); }
.js .loaded .nav { opacity: 1; transform: translateX(-50%); transition-delay: .5s; }
.js .loaded .nav.is-hidden { transform: translate(-50%, -140%); transition-delay: 0s; }
.nav__logo {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  font-weight: 700; font-size: 13px; letter-spacing: -.02em; color: #0a0a0b;
  background: var(--chrome); background-size: 200% 100%;
  animation: sheen 7s linear infinite;
  transition: transform .5s var(--ease);
}
.nav__links { display: flex; gap: 2px; }
.nav__links a {
  padding: 9px 15px; border-radius: 999px; font-size: 14px; color: var(--muted);
  transition: color .3s, background-color .3s;
}
.nav__links a:hover, .nav__links a[aria-current="true"] { color: var(--fg); background: rgba(255, 255, 255, .07); }

/* rolling text: the word slides up and a copy slides in from below */
.roll { display: inline-flex; overflow: hidden; vertical-align: top; }
.roll > span { position: relative; display: block; transition: transform .55s var(--ease); }
.roll > span::after { content: attr(data-text); position: absolute; left: 0; top: 100%; }
a:hover .roll > span { transform: translateY(-100%); }

.nav__menu {
  display: none; width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: rgba(255, 255, 255, .08); color: #fff; position: relative;
}
.nav__menu span { position: absolute; left: 12px; right: 12px; height: 1.5px; background: currentColor; transition: transform .4s var(--ease); }
.nav__menu span:first-child { top: 16px; }
.nav__menu span:last-child { top: 22px; }
.menu-open .nav__menu span:first-child { transform: translateY(3px) rotate(45deg); }
.menu-open .nav__menu span:last-child { transform: translateY(-3px) rotate(-45deg); }

.menu {
  position: fixed; inset: 0; z-index: 55;
  display: flex; flex-direction: column; justify-content: center; gap: 4px;
  padding: var(--pad);
  background: rgba(5, 5, 6, .9);
  -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px);
  opacity: 0; visibility: hidden; transition: opacity .5s var(--ease), visibility .5s;
}
.menu-open .menu { opacity: 1; visibility: visible; }
.menu a {
  font-size: clamp(2.4rem, 11vw, 4rem); font-weight: 600; letter-spacing: -.045em; line-height: 1.15;
  transform: translateY(24px); opacity: 0;
  transition: transform .7s var(--ease), opacity .7s var(--ease);
  transition-delay: calc(var(--i) * 55ms + 80ms);
}
.menu a.menu__resume { font-size: 1rem; letter-spacing: 0; font-weight: 500; margin-top: 24px; color: var(--soft); }
.menu-open .menu a { transform: none; opacity: 1; }

/* ------------------------------------------------------------------ buttons */
.btn {
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  height: 54px; padding: 0 26px; border-radius: 999px; border: 0;
  font-size: 15px; font-weight: 500; white-space: nowrap; cursor: pointer;
  transition: transform .6s var(--ease), color .35s, border-color .35s;
}
.btn__inner { display: inline-flex; align-items: center; gap: 10px; transition: transform .6s var(--ease); }
.btn--sm { height: 40px; padding: 0 16px; font-size: 13.5px; }
.btn--chrome {
  color: #0b0b0c;
  background: var(--chrome); background-size: 220% 100%;
  box-shadow: 0 12px 40px -12px rgba(255, 255, 255, .35), inset 0 1px 0 rgba(255, 255, 255, .85);
  animation: sheen 6s linear infinite;
}
.btn--chrome svg { transition: transform .5s var(--ease); }
.btn--chrome:hover svg { transform: translateX(3px); }
@keyframes sheen { to { background-position: -220% 0; } }

/* "liquid fill": a white circle grows from where the pointer entered */
.btn--ghost, .email {
  color: var(--fg);
  border: 1px solid var(--line2);
  background: rgba(255, 255, 255, .03);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.btn--ghost::before, .email::before {
  content: ""; position: absolute; z-index: -1;
  left: var(--fx, 50%); top: var(--fy, 50%);
  width: 0; height: 0; border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
  transition: width .7s var(--ease), height .7s var(--ease);
}
.btn--ghost:hover, .email:hover { color: #0b0b0c; border-color: #fff; }
.btn--ghost:hover::before, .email:hover::before { width: 900px; height: 900px; }

.link-arrow {
  display: inline-flex; align-items: center; gap: 8px; padding-bottom: 4px;
  font-size: 14px; color: var(--soft);
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size .6s var(--ease), color .3s;
}
.link-arrow:hover { color: #fff; background-size: 100% 1px; }
.link-arrow svg { transition: transform .5s var(--ease); }
.link-arrow:hover svg { transform: translate(2px, -2px); }

/* ------------------------------------------------------------------ reveal animations */
.js [data-reveal] {
  opacity: 0; transform: translateY(32px); filter: blur(8px);
  transition: opacity 1s var(--ease), transform 1.2s var(--ease), filter 1s var(--ease);
  transition-delay: calc(var(--d, 0) * 1ms);
}
.js [data-reveal].in { opacity: 1; transform: none; filter: none; }

/* headings split into letters (done by main.js) */
.word { display: inline-block; overflow: hidden; vertical-align: top; padding: .06em .04em .1em; margin: -.06em -.04em -.1em; }
.char { display: inline-block; }
.js [data-split] .char {
  transform: translateY(110%) rotate(8deg); opacity: 0;
  transition: transform 1.1s var(--ease), opacity .8s var(--ease);
  transition-delay: calc(var(--ci) * 22ms);
}
.js [data-split].in .char { transform: none; opacity: 1; }

/* failsafe: if scripts fail, show everything */
.failsafe [data-reveal], .failsafe [data-split] .char { opacity: 1 !important; transform: none !important; filter: none !important; }
.failsafe .loader { display: none !important; }

/* ------------------------------------------------------------------ shared section styles */
.section {
  position: relative; max-width: 1440px; margin: 0 auto;
  padding: clamp(96px, 15vh, 170px) var(--pad);
  scroll-margin-top: 20px;
}
.label {
  display: flex; align-items: center; gap: 14px; margin-bottom: 28px;
  font: 500 12px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.label::before { content: ""; width: 28px; height: 1px; background: currentColor; opacity: .6; }
.h2 {
  margin: 0 0 clamp(44px, 7vh, 84px);
  font-weight: 600; font-size: clamp(2.6rem, 6.6vw, 6.2rem); line-height: .95; letter-spacing: -.05em;
}
.h2 em, .contact__title em { font-family: var(--f-serif); font-style: italic; font-weight: 400; letter-spacing: -.015em; color: #c9cfd7; }
.h3 { margin: 0; font-weight: 600; font-size: clamp(1.8rem, 3.4vw, 3rem); letter-spacing: -.04em; line-height: 1; }

/* glass card with a spotlight that follows the pointer */
.card {
  position: relative; overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(22, 23, 28, .78), rgba(10, 11, 14, .82));
  box-shadow: 0 40px 120px -50px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .06);
}
.card::before {   /* soft light inside the card */
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(520px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, .075), transparent 45%);
  opacity: 0; transition: opacity .5s;
}
.card::after {    /* bright edge near the pointer */
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2;
  border-radius: inherit; padding: 1px;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, .55), transparent 45%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .5s;
}
.card:hover::before, .card:hover::after { opacity: 1; }
.card > * { position: relative; z-index: 1; }
[data-tilt] { transition: transform .6s var(--ease); transform-style: preserve-3d; will-change: transform; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center;
  padding: 8px 12px; border-radius: 999px;
  font: 12px/1 var(--f-mono); letter-spacing: .02em; color: #cdd2d8;
  border: 1px solid var(--line2); background: rgba(255, 255, 255, .03);
  transition: transform .4s var(--ease), border-color .3s, color .3s, background-color .3s;
}
.chip:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, .45); color: #fff; background: rgba(255, 255, 255, .07); }
.chip--chrome { color: #0b0b0c; border-color: transparent; background: var(--chrome); background-size: 200% 100%; animation: sheen 6s linear infinite; }
.ico {
  width: 44px; height: 44px; border-radius: 13px; flex: none;
  display: grid; place-items: center; color: #e6e9ed;
  border: 1px solid var(--line2);
  background: linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .02));
}

/* ------------------------------------------------------------------ hero */
.hero {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  display: grid; grid-template-rows: auto 1fr auto auto;
  padding: 104px var(--pad) 26px;
}
.hero::before {   /* a soft dark pool behind the name keeps it readable over bright metal */
  content: ""; position: absolute; inset: 20% 0 10%; z-index: -1; pointer-events: none;
  background: radial-gradient(60% 55% at 40% 60%, rgba(5, 5, 6, .55), transparent 70%);
}
.hero__top { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.status {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 15px 8px 12px; border-radius: 999px;
  font-size: 13px; color: var(--fg);
  border: 1px solid var(--line2);
  background: rgba(10, 11, 14, .5);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.status i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: ping 2.2s infinite; }
@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgba(94, 230, 168, .55); }
  70% { box-shadow: 0 0 0 10px rgba(94, 230, 168, 0); }
  100% { box-shadow: 0 0 0 0 rgba(94, 230, 168, 0); }
}
.hero__where { font: 12px var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--soft); }

.hero__name {
  align-self: end; margin: 0;
  font-weight: 600; font-size: clamp(4.4rem, 19vw, 19rem); line-height: .84; letter-spacing: -.065em;
  filter: drop-shadow(0 30px 60px rgba(0, 0, 0, .55));
}
.hero__name .line { display: block; overflow: hidden; padding: .04em .03em .07em; margin-bottom: -.07em; }
.hero__name .line--right { text-align: right; }
.chrome {
  display: inline-block;
  background: var(--chrome); background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: sheen-slow 10s linear infinite;
}
@keyframes sheen-slow { to { background-position: -250% 0; } }
.js .hero__name .chrome {
  transform: translateY(112%) rotate(5deg); transform-origin: 0 100%;
  transition: transform 1.6s var(--ease);
}
.js .loaded .hero__name .chrome { transform: none; }
.js .loaded .hero__name .line--right .chrome { transition-delay: .1s; }

.hero__bottom {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 28px;
  margin-top: clamp(22px, 4vh, 44px);
}
.hero__lede { margin: 0; max-width: 33ch; font-size: clamp(1.1rem, 1.55vw, 1.42rem); line-height: 1.45; color: var(--soft); }
.hero__lede em { font-style: normal; color: var(--fg); }
.hero__lede .serif { color: var(--fg); font-size: 1.12em; }
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; }

.hero__meta {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-top: clamp(28px, 6vh, 64px); padding-top: 18px;
  border-top: 1px solid var(--line);
  font: 12px/1.2 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.scroll-cue { display: inline-flex; align-items: center; gap: 10px; }
.scroll-cue i { width: 1px; height: 26px; background: rgba(255, 255, 255, .2); position: relative; overflow: hidden; }
.scroll-cue i::after { content: ""; position: absolute; left: 0; top: -40%; width: 1px; height: 40%; background: #fff; animation: cue 1.8s var(--ease-io) infinite; }
@keyframes cue { to { top: 100%; } }
.hero__focus { display: inline-flex; gap: 8px; align-items: center; color: var(--soft); }

.rotator { display: inline-grid; overflow: hidden; height: 1.3em; color: var(--fg); }
.rotator > span {
  grid-area: 1 / 1; white-space: nowrap;
  transform: translateY(110%); opacity: 0;
  transition: transform .75s var(--ease), opacity .75s var(--ease);
}
.rotator > span.on { transform: none; opacity: 1; }
.rotator > span.out { transform: translateY(-110%); opacity: 0; }

/* ------------------------------------------------------------------ stats */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 0 var(--pad);
  border-block: 1px solid var(--line);
  background: rgba(5, 5, 6, .35);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.stat { padding: clamp(28px, 5vh, 44px) 24px; border-right: 1px solid var(--line); }
.stat:first-child { padding-left: 0; }
.stat:last-child { border-right: 0; }
.stat b {
  display: block; font-weight: 600; font-size: clamp(2.4rem, 4.6vw, 4.6rem); line-height: 1; letter-spacing: -.055em;
  font-variant-numeric: tabular-nums;
}
.chrome-text {
  background: var(--chrome); background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: sheen-slow 12s linear infinite;
}
.stat span { display: block; margin-top: 12px; max-width: 24ch; font-size: 14px; color: var(--muted); line-height: 1.45; }

/* ------------------------------------------------------------------ marquee */
.marquee { padding: clamp(40px, 8vh, 80px) 0; overflow: hidden; }
.marquee__row {
  white-space: nowrap;
  font-weight: 600; font-size: clamp(2.6rem, 7.5vw, 7rem); line-height: 1.12; letter-spacing: -.045em;
}
.marquee__track { display: inline-flex; align-items: center; gap: .45em; padding-right: .45em; will-change: transform; }
.marquee__row--outline { color: transparent; -webkit-text-stroke: 1px rgba(255, 255, 255, .38); }
.marquee__row--outline .sep { -webkit-text-stroke: 0; }
.sep {
  font-style: normal; font-size: .38em;
  background: var(--chrome); background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ------------------------------------------------------------------ about */
.about__text {
  margin: 0; max-width: 21em;
  font-size: clamp(1.75rem, 3.7vw, 3.5rem); font-weight: 500; line-height: 1.17; letter-spacing: -.035em;
}
.js .about__text .w { opacity: .14; transition: opacity .25s linear; }
.about__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: clamp(56px, 9vh, 104px); }
.about__grid > div { display: flex; }
.pillar { padding: 30px; width: 100%; }
.pillar h3 { margin: 22px 0 8px; font-size: 1.2rem; font-weight: 600; letter-spacing: -.02em; }
.pillar p { margin: 0; color: var(--muted); font-size: .97rem; }

/* ------------------------------------------------------------------ work / projects */
.work__head { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 28px; }
.work__head .label { margin-bottom: 0; }

.projects { display: grid; gap: 28px; }
.project { position: sticky; top: calc(92px + var(--i) * 22px); }
.project__inner {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(24px, 4vw, 56px);
  padding: clamp(24px, 3.2vw, 46px);
  min-height: min(640px, calc(100vh - 130px));
  background: linear-gradient(180deg, #15161b, #0a0b0e);   /* solid: cards stack on top of each other */
  transform-origin: 50% 0;
  transform: scale(var(--s, 1));
  will-change: transform;
}
.project__inner .dim {   /* darkens cards that are stacked underneath */
  position: absolute; inset: 0; z-index: 4; pointer-events: none;
  background: #030304; opacity: var(--dim, 0); border-radius: inherit;
}
.project__info { display: flex; flex-direction: column; }
.project__head {
  display: flex; justify-content: space-between; gap: 12px;
  font: 12px var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.project__title { margin: 20px 0 6px; font-weight: 600; font-size: clamp(2.6rem, 5vw, 4.8rem); line-height: .95; letter-spacing: -.055em; }
.project__sub { margin: 0 0 22px; font-family: var(--f-serif); font-style: italic; font-size: clamp(1.25rem, 1.9vw, 1.65rem); color: #c2c8d0; }
.project__points { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 11px; color: #aeb4bd; font-size: .96rem; line-height: 1.55; }
.project__points li { position: relative; padding-left: 22px; }
.project__points li::before { content: ""; position: absolute; left: 0; top: .78em; width: 10px; height: 1px; background: #fff; opacity: .55; }
.project__points strong { color: var(--fg); font-weight: 600; }
.metrics {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
  margin-top: auto; padding-top: 22px;
  border-top: 1px solid var(--line);
}
.project__info .chips { margin-bottom: 26px; }
.metrics b { display: block; font-size: clamp(1.5rem, 2.4vw, 2.3rem); font-weight: 600; letter-spacing: -.045em; line-height: 1.1; }
.metrics span { font-size: 12px; color: var(--muted); line-height: 1.35; display: block; margin-top: 4px; }

.project__visual {
  position: relative; overflow: hidden;
  display: grid; place-items: center; padding: 24px; min-height: 380px;
  border-radius: 20px; border: 1px solid var(--line);
  background: radial-gradient(120% 80% at 50% 0%, rgba(255, 255, 255, .07), transparent 60%), rgba(0, 0, 0, .38);
}
.project__visual::before {  /* faint grid */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(80% 70% at 50% 40%, #000, transparent);
  mask-image: radial-gradient(80% 70% at 50% 40%, #000, transparent);
}
.visual__caption { position: absolute; left: 18px; bottom: 14px; font: 11px var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* --- PMS-AI pipeline diagram --- */
.pipe { width: 100%; max-width: 380px; height: auto; overflow: visible; }
.pipe__wires path { fill: none; stroke: rgba(255, 255, 255, .12); stroke-width: 1; }
.pipe__pulses path {
  fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round;
  stroke-dasharray: 9 200; stroke-dashoffset: 9;
  animation: pulse 3.4s var(--ease-io) infinite; animation-delay: var(--d);
}
@keyframes pulse { 0% { stroke-dashoffset: 9; } 30% { stroke-dashoffset: -100; } 100% { stroke-dashoffset: -100; } }
.pipe__dots circle { fill: #0c0d10; stroke: rgba(255, 255, 255, .5); animation: dot 3.4s infinite; animation-delay: .9s; }
@keyframes dot { 0%, 100% { fill: #0c0d10; } 8% { fill: #fff; } 25% { fill: #0c0d10; } }
.pipe__nodes rect { fill: rgba(14, 15, 19, .92); stroke: rgba(255, 255, 255, .2); }
.pipe__nodes rect.pill { fill: #0a0b0e; stroke: rgba(255, 255, 255, .35); }
.pipe__nodes rect.final { fill: url(#gChrome); stroke: none; animation: glow 3.4s infinite; animation-delay: 2.1s; }
@keyframes glow { 0%, 100% { filter: none; } 10% { filter: drop-shadow(0 0 14px rgba(255, 255, 255, .7)); } 40% { filter: none; } }
.pipe__nodes text { fill: #d4d8dd; font: 12px var(--f-mono); text-anchor: middle; letter-spacing: .02em; }
.pipe__nodes text.small { font-size: 10.5px; fill: #fff; }
.pipe__nodes text.final-t { fill: #0b0b0c; font-weight: 500; font-size: 12.5px; }

/* --- FreightFlow mock --- */
.ff { width: 100%; max-width: 420px; display: grid; gap: 18px; }
.ff__files { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.file {
  padding: 9px 11px 9px 12px; border-radius: 10px;
  font: 500 11px var(--f-mono); letter-spacing: .06em; color: #e7eaee;
  border: 1px solid var(--line2); background: rgba(255, 255, 255, .05);
  animation: bob 3s ease-in-out infinite; animation-delay: calc(var(--i) * -.6s);
}
@keyframes bob { 50% { transform: translateY(-6px); } }
.ff__flow { display: flex; align-items: center; gap: 10px; font: 11px var(--f-mono); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.ff__flow i { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .5), transparent); background-size: 50% 100%; background-repeat: no-repeat; animation: flow 1.8s linear infinite; }
@keyframes flow { from { background-position: -100% 0; } to { background-position: 200% 0; } }
.ff__table { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: rgba(0, 0, 0, .3); }
.ff__row { display: grid; grid-template-columns: 1fr 1.4fr .8fr 72px; gap: 12px; align-items: center; padding: 11px 14px; border-top: 1px solid var(--line); }
.ff__row--head { border-top: 0; font: 10.5px var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.ff__row:not(.ff__row--head) { animation: row 6s var(--ease) infinite; animation-delay: calc(var(--r) * .35s); opacity: 0; }
@keyframes row {
  0% { opacity: 0; transform: translateX(-14px); }
  8%, 82% { opacity: 1; transform: none; }
  92%, 100% { opacity: 0; transform: none; }
}
.sk { height: 7px; border-radius: 4px; background: rgba(255, 255, 255, .16); }
.sk--w { width: 90%; } .sk--s { width: 70%; }
.tag { justify-self: start; font: 500 10.5px/1 var(--f-mono); padding: 5px 8px; border-radius: 999px; }
.tag--ok { color: var(--ok); background: rgba(94, 230, 168, .1); border: 1px solid rgba(94, 230, 168, .3); }
.tag--warn { color: var(--warn); background: rgba(245, 194, 107, .1); border: 1px solid rgba(245, 194, 107, .3); }
.ff__chat { display: grid; gap: 8px; min-height: 92px; align-content: start; }
.msg { max-width: 82%; padding: 10px 14px; border-radius: 16px; font-size: 13.5px; line-height: 1.4; }
.msg--me { justify-self: end; background: #f1f3f5; color: #0b0b0c; border-bottom-right-radius: 4px; }
.msg--bot { justify-self: start; background: rgba(255, 255, 255, .07); border: 1px solid var(--line); border-bottom-left-radius: 4px; min-height: 40px; }
.js .ff__chat .msg { opacity: 0; transform: translateY(8px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.js .ff__chat .msg.show { opacity: 1; transform: none; }
.typing { display: none; gap: 4px; padding: 4px 0; }
.typing.show { display: inline-flex; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: type 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes type { 0%, 100% { opacity: .3; transform: none; } 50% { opacity: 1; transform: translateY(-3px); } }

/* --- FitTrack pose demo --- */
.ft { width: 100%; max-width: 400px; display: grid; gap: 16px; }
.ft__cam {
  position: relative; aspect-ratio: 1 / 1; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--line);
  background: radial-gradient(70% 60% at 50% 45%, rgba(255, 255, 255, .06), transparent 70%), #07080a;
}
.ft__pose { position: absolute; inset: 6% 6% 4%; width: 88%; height: 90%; }
.ft__pose line { stroke-linecap: round; }
.ft__pose .ground { stroke: rgba(255, 255, 255, .12); stroke-width: 1; stroke-dasharray: 3 5; }
.ft__pose .near line { stroke: #e9ecef; stroke-width: 3.2; }
.ft__pose .far line { stroke: rgba(233, 236, 239, .28); stroke-width: 3; }
.ft__pose circle { fill: #07080a; stroke: #fff; stroke-width: 1.6; }
.ft__pose circle.key { fill: var(--ok); stroke: var(--ok); }
.ft__pose [data-j="head"] { fill: rgba(255, 255, 255, .06); stroke: #e9ecef; stroke-width: 2.2; }
.ft__pose [data-arc] { fill: none; stroke: var(--ok); stroke-width: 1.5; stroke-dasharray: 3 3; }
.hud { position: absolute; width: 18px; height: 18px; border-color: rgba(255, 255, 255, .45); border-style: solid; border-width: 0; }
.hud--tl { top: 12px; left: 12px; border-top-width: 1px; border-left-width: 1px; }
.hud--tr { top: 12px; right: 12px; border-top-width: 1px; border-right-width: 1px; }
.hud--bl { bottom: 12px; left: 12px; border-bottom-width: 1px; border-left-width: 1px; }
.hud--br { bottom: 12px; right: 12px; border-bottom-width: 1px; border-right-width: 1px; }
.ft__rec { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 7px; font: 10.5px var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--soft); white-space: nowrap; }
.ft__rec i { width: 6px; height: 6px; border-radius: 50%; background: #ff5d5d; animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.ft__readout { position: absolute; right: 16px; bottom: 16px; text-align: right; font: 10.5px var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ft__readout b { display: block; margin-top: 4px; font: 600 2rem/1 var(--f-display); letter-spacing: -.04em; color: #fff; font-variant-numeric: tabular-nums; text-transform: none; }
.ft__state { position: absolute; left: 16px; bottom: 16px; display: inline-flex; align-items: center; gap: 8px; padding: 7px 11px; border-radius: 999px; font: 11px var(--f-mono); color: var(--soft); border: 1px solid var(--line2); background: rgba(0, 0, 0, .45); transition: color .3s, border-color .3s; }
.ft__state i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); transition: background-color .3s; }
.ft__state.good { color: var(--ok); border-color: rgba(94, 230, 168, .4); }
.ft__state.good i { background: var(--ok); }
.ft__llm { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; color: var(--muted); font-family: var(--f-mono); font-size: 13px; }

/* --- more projects --- */
.more { margin-top: clamp(90px, 14vh, 150px); }
.more__head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 30px; }
.more__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.more__grid > div { display: flex; }
.mini { width: 100%; padding: 30px; display: flex; flex-direction: column; gap: 14px; min-height: 270px; }
.mini__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.mini h3 { margin: 0; font-size: clamp(1.35rem, 2vw, 1.7rem); font-weight: 600; letter-spacing: -.035em; line-height: 1.15; }
.mini p { margin: 0; color: var(--muted); }
.mini .chips { margin-top: auto; }
.mini__metric { font: 12px var(--f-mono); color: var(--soft); letter-spacing: .04em; }
.mini__metric b { font: 600 1.25rem var(--f-display); color: #fff; letter-spacing: -.03em; margin-right: 6px; }

/* ------------------------------------------------------------------ experience */
.timeline { position: relative; padding-left: clamp(28px, 4vw, 48px); display: grid; gap: clamp(48px, 8vh, 80px); }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 0; width: 1px; background: var(--line2); }
.timeline__fill {
  position: absolute; left: 6px; top: 6px; bottom: 0; width: 1px;
  background: linear-gradient(#fff, #8b9099);
  transform-origin: top; transform: scaleY(var(--p, 0));
}
.role { position: relative; display: grid; grid-template-columns: 220px 1fr; gap: 28px; }
.role::before {
  content: ""; position: absolute; left: calc(-1 * clamp(28px, 4vw, 48px) + 1px); top: 4px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--bg); border: 1px solid rgba(255, 255, 255, .5);
  transition: background-color .5s, box-shadow .5s, border-color .5s;
}
.role.lit::before { background: #fff; border-color: #fff; box-shadow: 0 0 0 6px rgba(255, 255, 255, .08), 0 0 24px rgba(255, 255, 255, .5); }
.role__when { color: var(--muted); padding-top: 2px; text-transform: uppercase; }
.role h3 { margin: 0; font-size: clamp(1.5rem, 2.6vw, 2.2rem); font-weight: 600; letter-spacing: -.035em; line-height: 1.15; }
.role h3 span { color: var(--muted); font-weight: 500; }
.role__where { margin: 8px 0 18px; color: var(--muted); text-transform: uppercase; }
.role ul { margin: 0 0 22px; padding: 0; list-style: none; display: grid; gap: 10px; color: #b1b7bf; max-width: 64ch; }
.role li { position: relative; padding-left: 22px; }
.role li::before { content: ""; position: absolute; left: 0; top: .78em; width: 10px; height: 1px; background: #fff; opacity: .5; }

.edu { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: clamp(72px, 12vh, 120px); }
.edu > div { display: flex; }
.edu__card { width: 100%; padding: 30px; }
.edu__card h3 { margin: 16px 0 8px; font-size: clamp(1.25rem, 2vw, 1.6rem); font-weight: 600; letter-spacing: -.03em; line-height: 1.2; }
.edu__card p { margin: 0; color: var(--muted); }

/* ------------------------------------------------------------------ skills */
.skills__grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
/* row 1: LLMs (wide) + Languages · row 2: three equal cards */
.skills__grid > div { grid-column: span 2; display: flex; }
.skills__grid > div:nth-child(1) { grid-column: span 4; }
.skill-group { width: 100%; padding: 28px; }
.skill-group h3 { margin: 0 0 20px; font-size: 1.3rem; font-weight: 600; letter-spacing: -.025em; display: flex; align-items: baseline; gap: 12px; }

/* ------------------------------------------------------------------ contact */
.contact { padding-bottom: clamp(60px, 10vh, 110px); }
.contact__title {
  margin: 0 0 30px; max-width: 12em;
  font-weight: 600; font-size: clamp(3rem, 9.5vw, 9.6rem); line-height: .92; letter-spacing: -.06em;
}
.contact__lede { margin: 0 0 36px; font-size: clamp(1.05rem, 1.5vw, 1.3rem); color: var(--soft); }
.email {
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center;
  padding: 18px 20px 18px 30px; border-radius: 999px; cursor: pointer;
  font-size: clamp(1.05rem, 2.4vw, 2rem); font-weight: 500; letter-spacing: -.02em;
  transition: transform .6s var(--ease), color .35s, border-color .35s;
}
.email .btn__inner { gap: 18px; }
.email__copy {
  font: 500 12px/1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase;
  padding: 10px 14px; border-radius: 999px; background: #fff; color: #000;
  transition: background-color .35s, color .35s;
}
.email:hover .email__copy { background: #0b0b0c; color: #fff; }
.socials { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }

.footer {
  max-width: 1440px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 26px var(--pad) 34px;
  border-top: 1px solid var(--line);
  font: 12px var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.footer__top {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line2); color: var(--fg);
  transition: transform .6s var(--ease), background-color .3s, color .3s;
}
.footer__top:hover { background: #fff; color: #000; }

.toast {
  position: fixed; left: 50%; bottom: 26px; z-index: 120;
  padding: 12px 18px; border-radius: 999px;
  font-size: 14px; color: #0b0b0c; background: #fff;
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, .8);
  transform: translate(-50%, 160%); opacity: 0;
  transition: transform .6s var(--ease), opacity .4s;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1100px) {
  .project__inner { grid-template-columns: 1fr; min-height: 0; }
  .project__visual { min-height: 340px; }
}
/* stacking cards only where the screen is big enough to show a whole card */
@media (max-width: 1100px), (max-height: 720px) {
  .project { position: relative; top: auto; }
}
@media (max-width: 900px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat { padding-left: 0; }
  .stat:nth-child(2) { border-right: 0; padding-left: 20px; }
  .stat:nth-child(4) { padding-left: 20px; }
  .stat:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .about__grid, .more__grid, .edu { grid-template-columns: 1fr; }
  .skills__grid > div, .skills__grid > div:nth-child(n) { grid-column: span 6; }
  .role { grid-template-columns: 1fr; gap: 10px; }
}
@media (max-width: 820px) {
  .nav { left: 12px; right: 12px; justify-content: space-between; transform: none; }
  .js .nav { transform: translateY(-30px); }
  .js .loaded .nav { transform: none; }
  .js .loaded .nav.is-hidden { transform: translateY(-140%); }
  .nav__links { display: none; }
  .nav__menu { display: block; }
  .nav .btn--sm { margin-left: auto; }
  .hero { padding-top: 96px; }
  .hero__bottom { grid-template-columns: 1fr; }
  .hero__where { display: none; }
  .hero__meta .hero__focus { order: -1; width: 100%; }
}
@media (max-width: 520px) {
  .hero__name { font-size: 23vw; }
  .btn { height: 50px; padding: 0 20px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .ff__row { grid-template-columns: 1fr 1.2fr .7fr 64px; gap: 8px; padding: 10px; }
  .email { padding: 14px 14px 14px 20px; font-size: 1rem; }
  .email .btn__inner { gap: 10px; }
  .footer { flex-wrap: wrap; }
  .footer__mid { order: 3; width: 100%; }
}

/* ------------------------------------------------------------------ reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .js [data-reveal], .js [data-split] .char, .js .hero__name .chrome { opacity: 1; transform: none; filter: none; }
  .js .about__text .w { opacity: 1; }
  .ff__row:not(.ff__row--head) { opacity: 1; }
  .grain { display: none; }
}
