:root {
  --ink: #051f20;
  --deep: #0b2b26;
  --forest: #163832;
  --moss: #235347;
  --sage: #8eb69b;
  --mist: #daf1de;
  --white: #fff;
  --pad: clamp(20px, 4vw, 64px);
  --sans: "Archivo", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --page: var(--ink);
  --nav: #fff;
  --nav-flip: var(--ink);
  --nav-bg: rgba(5, 31, 32, .42);
  --nav-bg-flip: rgba(228, 245, 232, .6);
  --acc: var(--sage);
  color-scheme: dark;
}
[data-theme="light"] {
  --page: #e4f5e8;
  --nav: var(--ink);
  --nav-flip: #fff;
  --nav-bg: rgba(228, 245, 232, .6);
  --nav-bg-flip: rgba(5, 31, 32, .42);
  --acc: var(--moss);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--page); }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  font-family: var(--sans);
  font-variation-settings: "wdth" 100;
  color: var(--fg, var(--white));
  background: var(--page);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
img { display: block; max-width: 100%; }
.mono { font-family: var(--mono); font-size: .78rem; letter-spacing: .01em; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 4px; }
[tabindex="-1"]:focus { outline: none; }
.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; }
.skip {
  position: fixed; top: 12px; left: 12px; z-index: 100; padding: 12px 18px; border-radius: 8px;
  background: #fff; color: var(--ink); font-weight: 600; transform: translateY(-200%);
}
.skip:focus { transform: none; outline: 3px solid var(--moss); }

/* NAV */
.nav {
  position: fixed; inset: 12px 12px auto 12px; z-index: 50; border-radius: 16px;
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px max(16px, calc(var(--pad) - 12px));
  color: var(--nav);
  font-size: .95rem; font-weight: 500;
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(18px) saturate(180%); backdrop-filter: blur(18px) saturate(180%);
  transition: color .35s, background-color .35s;
}
.nav.flip { color: var(--nav-flip); background: var(--nav-bg-flip); }
.nav__links { display: flex; align-items: center; gap: clamp(14px, 2.2vw, 34px); }
.nav a { position: relative; padding: 10px 2px; }
.nav__brand { font-size: 1.25rem; letter-spacing: -0.03em; }
.nav__brand b { font-weight: 800; }
.nav__brand i { font-style: normal; font-weight: 800; color: #000; }
.nav__brand span { font-weight: 400; }
.theme {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0;
  font: inherit; color: inherit; background: none; border: 1px solid currentColor; border-radius: 999px; cursor: pointer;
}
.theme:hover { opacity: .7; }
.theme__icon { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; background: linear-gradient(90deg, currentColor 50%, transparent 50%); }
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 5px; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform .45s cubic-bezier(.2, .8, .2, 1);
}
.nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }

/* HERO */
.hero {
  position: sticky; top: 0; z-index: 0;
  height: 100svh; min-height: 560px;
  --fg: #fff; --mut: var(--sage);
  color: var(--fg);
  background:
    radial-gradient(60% 75% at 6% 0%, rgba(142, 182, 155, .55), transparent 62%),
    linear-gradient(165deg, var(--moss) 0%, var(--forest) 45%, var(--deep) 100%);
  overflow: hidden;
}
[data-theme="light"] .hero {
  --fg: var(--ink); --mut: var(--moss);
  background:
    radial-gradient(60% 75% at 6% 0%, rgba(255, 255, 255, .75), transparent 62%),
    linear-gradient(165deg, #b4d8bf 0%, #cde8d4 45%, #e6f6ea 100%);
}
.hero__inner {
  height: 100%; padding: 92px var(--pad) 28px;
  display: flex; flex-direction: column; justify-content: space-between;
  will-change: transform;
}
.hero__top, .hero__bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.hero__top p { font-size: 1rem; font-weight: 500; line-height: 1.25; }
.hero__clock { text-align: right; }
.hero__bottom p { max-width: 34ch; font-size: 1.05rem; }
.hero__cue { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border: 1px solid currentColor; border-radius: 50%; transition: background-color .3s, color .3s; }
.hero__cue svg { width: 22px; height: 22px; transition: transform .4s cubic-bezier(.2, .8, .2, 1); }
.hero__cue:hover svg, .hero__cue:focus-visible svg { transform: translateY(4px); }

.name {
  font-size: clamp(3rem, 16vw, 18rem);
  line-height: .84; letter-spacing: -.03em;
  font-weight: 900; text-transform: uppercase;
  margin-left: -.04em;
}
.name .line { display: block; overflow: hidden; padding: .12em 0 .02em; white-space: nowrap; }
.ch {
  display: inline-block; will-change: font-variation-settings;
  font-variation-settings: "wght" 900, "wdth" 62;
}
.js .name { visibility: hidden; }
.js .hero__top, .js .hero__bottom { opacity: 0; }

/* SHEETS (slide over the pinned hero). Each sheet sets its own tokens, light theme overrides them. */
.sheet {
  --bg: radial-gradient(50% 40% at 92% 0%, rgba(35, 83, 71, .6), transparent 70%), linear-gradient(180deg, var(--deep), var(--ink));
  --fg: #fff; --mut: var(--sage); --acc: var(--sage);
  --line: rgba(218, 241, 222, .3); --chip: rgba(218, 241, 222, .08); --grid: rgba(142, 182, 155, .09);
  position: relative; z-index: 2;
  padding: clamp(80px, 12vw, 180px) var(--pad);
  --r: 40px; border-radius: var(--r) var(--r) 0 0;
  background: var(--bg); color: var(--fg);
}
.sheet--chalk {
  --bg: linear-gradient(180deg, var(--mist), #c2e0c9);
  --fg: var(--ink); --mut: var(--moss); --acc: var(--moss);
  --line: rgba(5, 31, 32, .7); --chip: rgba(5, 31, 32, .06);
}
.skills { padding-bottom: calc(clamp(80px, 12vw, 180px) + 100px); }
.sheet--forest {
  --bg: radial-gradient(45% 35% at 8% 100%, rgba(142, 182, 155, .22), transparent 70%), linear-gradient(180deg, var(--forest), var(--deep));
}
.sheet--moss {
  --bg: radial-gradient(50% 45% at 95% 100%, rgba(142, 182, 155, .3), transparent 70%), linear-gradient(160deg, var(--moss), var(--forest) 60%, var(--deep));
  --acc: var(--mist); --line: rgba(255, 255, 255, .35);
}

[data-theme="light"] .sheet {
  --bg: radial-gradient(50% 40% at 92% 0%, rgba(255, 255, 255, .8), transparent 70%), linear-gradient(180deg, #eef9f0, #dff1e3);
  --fg: var(--ink); --mut: var(--moss); --acc: var(--moss);
  --line: rgba(5, 31, 32, .28); --chip: rgba(5, 31, 32, .06); --grid: rgba(35, 83, 71, .1);
}
[data-theme="light"] .sheet--chalk {
  --bg: linear-gradient(180deg, var(--forest), var(--deep));
  --fg: #fff; --mut: var(--sage); --acc: var(--sage);
  --line: rgba(218, 241, 222, .4); --chip: rgba(218, 241, 222, .08);
}
[data-theme="light"] .sheet--forest {
  --bg: radial-gradient(45% 35% at 8% 100%, rgba(255, 255, 255, .55), transparent 70%), linear-gradient(180deg, #cfe8d6, #bddcc6);
}
[data-theme="light"] .sheet--moss {
  --bg: linear-gradient(160deg, var(--sage), #b3d5be 55%, var(--mist));
  --acc: var(--ink); --mut: var(--forest); --line: rgba(5, 31, 32, .35);
}

.title {
  font-size: clamp(2.6rem, 8.4vw, 9rem);
  line-height: .95; letter-spacing: -.04em; font-weight: 800;
  font-variation-settings: "wdth" 125;
  margin-bottom: clamp(40px, 6vw, 90px);
}
.w { display: inline-block; }

/* ABOUT: pinned scroll story */
.about {
  display: block; height: 100svh; min-height: 560px; padding: 0; overflow: hidden;
}
.about__grid {
  position: absolute; inset: 0; pointer-events: none;
  background:
    repeating-linear-gradient(90deg, var(--grid) 0 1px, transparent 1px 8.333%),
    repeating-linear-gradient(0deg, var(--grid) 0 1px, transparent 1px 12.5%);
  -webkit-mask-image: radial-gradient(70% 60% at 30% 55%, #000, transparent 85%);
  mask-image: radial-gradient(70% 60% at 30% 55%, #000, transparent 85%);
}
.about__years {
  position: absolute; top: 92px; left: var(--pad);
  display: flex; align-items: flex-end; gap: 6px; opacity: 0;
}
.about__years b { font-size: clamp(3.4rem, 8vw, 8rem); line-height: .8; letter-spacing: -.05em; font-weight: 900; font-variation-settings: "wdth" 100; min-width: .62em; }
.about__years sup { font-size: clamp(1.6rem, 3.4vw, 3.4rem); line-height: .8; font-weight: 800; color: var(--mut); }
.about__years span { margin-left: 10px; font-size: .95rem; line-height: 1.2; color: var(--mut); padding-bottom: 4px; }
.about__word {
  position: absolute; left: var(--pad); right: var(--pad); top: 50%; transform: translateY(-54%);
  font-size: clamp(2.8rem, 13.4vw, 15rem); line-height: .85; letter-spacing: -.035em;
  font-weight: 900; font-variation-settings: "wght" 900, "wdth" 100; text-transform: uppercase;
  white-space: nowrap; margin: 0;
}
.about__word .s { display: inline-block; }
.about__copy {
  position: absolute; left: var(--pad); bottom: 56px;
  width: min(36rem, calc(100% - var(--pad) * 2 - 40px)); height: 9.5em;
  font-size: clamp(1.15rem, 1.9vw, 1.8rem); line-height: 1.25; letter-spacing: -.01em; font-weight: 500;
}
.about__copy .phase { position: absolute; inset: auto 0 0 0; margin: 0; opacity: 0; will-change: transform, opacity; }
.about__copy .phase:first-child { opacity: 1; }
.about__steps { position: absolute; right: var(--pad); top: 50%; transform: translateY(-50%); display: grid; gap: 10px; }
.about__steps li { width: 3px; height: 44px; background: var(--line); border-radius: 2px; overflow: hidden; }
.about__steps i { display: block; width: 100%; height: 100%; background: linear-gradient(var(--mut), var(--fg)); transform: scaleY(0); transform-origin: top; }
.about--static { height: auto; padding: 120px var(--pad) 80px; }
.about--static .about__word, .about--static .about__copy { position: static; transform: none; height: auto; width: auto; margin-bottom: 28px; }
.about--static .about__copy .phase { position: static; opacity: 1 !important; transform: none !important; margin-bottom: 1em; }
.about--static .about__years { position: static; opacity: 1 !important; margin-bottom: 28px; }
.about--static .about__steps, .about--static .about__grid { display: none; }

/* EXPERTISE */
.rows { border-top: 1px solid var(--line); }
.row {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  align-items: center; gap: 16px 40px;
  padding: clamp(22px, 3vw, 40px) 0;
  border-bottom: 1px solid var(--line);
  transition: color .4s, padding .5s cubic-bezier(.2, .8, .2, 1);
}
.row::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(100deg, var(--moss), var(--forest));
  transform: scaleY(0); transform-origin: bottom;
  transition: transform .5s cubic-bezier(.2, .8, .2, 1);
}
.row:hover { color: var(--white); padding-left: 20px; padding-right: 20px; }
.row:hover::before { transform: scaleY(1); }
.row__name { font-size: clamp(1.6rem, 4.2vw, 4.4rem); line-height: 1; letter-spacing: -.035em; font-weight: 800; font-variation-settings: "wdth" 112; overflow-wrap: anywhere; }
.row__desc { font-size: 1.1rem; line-height: 1.35; max-width: 34ch; }

/* SKILLS */
.stack { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 var(--pad); margin-bottom: clamp(50px, 7vw, 100px); }
.field {
  padding: 18px 0 22px; border: 0; border-top: 1px solid var(--line); background: none; color: var(--mut); text-align: left; cursor: pointer;
  font-size: clamp(1.4rem, 2.6vw, 2.6rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; font-variation-settings: "wdth" 108;
  transition: color .3s, padding-left .4s cubic-bezier(.2, .8, .2, 1);
}
.field:hover, .field:focus-visible, .field[aria-pressed="true"] { color: var(--fg); padding-left: 12px; }

.marquees { margin: 0 calc(var(--pad) * -1); display: grid; gap: 14px; }
.marquee { overflow: hidden; }
.track { display: flex; width: max-content; gap: 14px; padding-right: 14px; }
.track li {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 26px 14px 14px; border-radius: 999px;
  background: var(--chip);
  font-size: 1.15rem; font-weight: 500; white-space: nowrap;
}
.track img { width: 36px; height: 36px; padding: 6px; border-radius: 50%; background: var(--mist); object-fit: contain; }

/* AI */
.track li { transition: opacity .35s, filter .35s; }
.marquees[data-focus] li:not([data-cat~="x"]) { opacity: .22; filter: grayscale(1); }
.marquees[data-focus="dev"] li[data-cat="dev"] { opacity: 1; filter: none; }
.marquees[data-focus="design"] li[data-cat="design"] { opacity: 1; filter: none; }
.marquees[data-focus="motion"] li[data-cat="motion"] { opacity: 1; filter: none; }
.marquees[data-focus="ai"] li[data-cat="ai"] { opacity: 1; filter: none; }

/* CLIENTS */
.client-list { border-top: 1px solid var(--line); }
.client {
  padding: clamp(14px, 2vw, 28px) 0; border-bottom: 1px solid var(--line);
  font-size: clamp(2rem, 6vw, 6rem); line-height: .95; letter-spacing: -.045em; font-weight: 800;
  font-variation-settings: "wdth" 112; text-wrap: balance;
  transition: opacity .35s, padding-left .5s cubic-bezier(.2, .8, .2, 1);
  cursor: default;
}
.client-list:hover .client { opacity: .35; }
.client-list .client:hover { opacity: 1; padding-left: clamp(12px, 3vw, 48px); }
.more { display: inline-block; margin-top: 40px; font-size: 1.1rem; font-weight: 500; border-bottom: 1px solid currentColor; padding-bottom: 2px; }
.more:hover { color: var(--acc); }

.float {
  position: fixed; top: 0; left: 0; z-index: 40; pointer-events: none;
  width: 200px; height: 200px; opacity: 0;
  border-radius: 6px; overflow: hidden;
}
.float img { width: 100%; height: 100%; object-fit: cover; }

/* CONTACT */
.contact { padding-bottom: clamp(40px, 5vw, 64px); }
.mail {
  display: inline-block; max-width: 100%;
  font-size: clamp(1.3rem, 5.2vw, 6rem); line-height: 1; letter-spacing: -.04em; font-weight: 800;
  font-variation-settings: "wdth" 110; overflow-wrap: anywhere;
}
.mail span { display: inline-block; background: linear-gradient(var(--acc), var(--acc)) 0 100% / 0 .06em no-repeat; transition: background-size .6s cubic-bezier(.2, .8, .2, 1), color .3s; }
.mail:hover span { background-size: 100% .06em; color: var(--acc); }
.contact__links { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 40px; margin-top: clamp(40px, 6vw, 80px); font-size: 1.15rem; font-weight: 500; }
.contact__links a { display: inline-block; padding: 8px 0; }
.contact__links a:hover { color: var(--acc); }
.foot__col { display: flex; flex-direction: column; gap: 8px; }
.foot__col--end { align-items: flex-end; text-align: right; }
.music { display: inline-flex; align-items: center; gap: 12px; }
.ico { display: inline-flex; width: 18px; height: 18px; opacity: .6; transition: opacity .3s, transform .4s cubic-bezier(.2, .8, .2, 1), color .3s; }
.ico svg { width: 100%; height: 100%; }
.ico:hover, .ico:focus-visible { opacity: 1; color: var(--fg); transform: translateY(-3px) scale(1.15); }
.foot { display: flex; align-items: flex-end; align-items: last baseline; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: clamp(80px, 12vw, 180px); padding-top: 20px; border-top: 1px solid var(--line); color: var(--mut); }
.motion { font: inherit; color: inherit; background: none; border: 0; padding: 0 0 3px; border-bottom: 1px solid currentColor; cursor: pointer; }
.motion:hover { color: var(--acc); }

/* RESPONSIVE */
@media (max-width: 820px) {
  .nav__links a:not([href="#contact"]) { display: none; }
  .hero__inner { padding-top: 84px; }
  .name { font-size: 17vw; }
  .about__word { font-size: 13.2vw; }
  .about__copy { bottom: 40px; }
  .about__steps li { height: 30px; }
  .row { grid-template-columns: 1fr; row-gap: 8px; }
  .stack { grid-template-columns: repeat(2, 1fr); }
  .sheet { --r: 28px; }
}
@media (max-width: 480px) {
  .hero__top { flex-direction: column; align-items: flex-start; }
  .hero__clock { text-align: left; }
  .stack { grid-template-columns: 1fr; }
}
@media (hover: none) { .float { display: none; } .client-list:hover .client { opacity: 1; } }
html[data-motion="off"] .name { visibility: visible; }
html[data-motion="off"] .hero__top, html[data-motion="off"] .hero__bottom { opacity: 1; }
html[data-motion="off"] .row, html[data-motion="off"] .row::before, html[data-motion="off"] .client,
html[data-motion="off"] .mail span, html[data-motion="off"] .track li, html[data-motion="off"] .field, html[data-motion="off"] .nav { transition: none; }

/* CUSTOM CURSOR (mouse only, hidden for touch and reduced motion) */
.has-cursor, .has-cursor * { cursor: none; }
.cur { position: fixed; inset: 0; z-index: 200; pointer-events: none; mix-blend-mode: difference; opacity: 0; transition: opacity .3s; }
.cur.on { opacity: 1; }
.cur.on.hide { opacity: 0; }
.cur i { position: absolute; top: 0; left: 0; display: block; border-radius: 50%; }
.cur__dot { width: 8px; height: 8px; background: #fff; transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
.cur__ring { width: 38px; height: 38px; border: 1.5px solid #fff; transition: width .35s cubic-bezier(.2, .8, .2, 1), height .35s cubic-bezier(.2, .8, .2, 1), background-color .3s; }
.cur.hot .cur__ring { width: 68px; height: 68px; background: rgba(255, 255, 255, .18); }
.cur.hot .cur__dot { transform: scale(0); }
.cur.down .cur__ring { width: 28px; height: 28px; }
@media (hover: none), (pointer: coarse) { .cur { display: none; } }
