/* ============ tokens ============ */
:root {
  --bg: #0e0d0b;
  --ink: #e8e4da;
  --ink-dim: #8d897e;
  --accent: #4f7fff;
  --line: rgba(232, 228, 218, 0.14);
  --font-display: "Syne", sans-serif;
  --font-serif: "Instrument Serif", serif;
  --font-body: "Space Grotesk", sans-serif;
  --pad: clamp(1.25rem, 4vw, 4rem);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: var(--bg); }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
em { font-family: var(--font-serif); font-style: italic; font-size: 1.12em; color: var(--accent); }

/* ============ preloader ============ */
.preloader {
  position: fixed; inset: 0; z-index: 60;
  background: var(--bg);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: var(--pad); gap: 1rem;
}
.preloader__row {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(1rem, 2.5vw, 1.5rem); letter-spacing: 0.04em;
}
.preloader__count { font-variant-numeric: tabular-nums; color: var(--accent); }
.preloader__bar { height: 1px; background: var(--line); }
.preloader__bar span { display: block; height: 100%; width: 0; background: var(--accent); }

/* ============ cursor ============ */
.cursor, .cursor-dot { display: none; }
@media (hover: hover) and (pointer: fine) {
  .cursor {
    display: block; position: fixed; z-index: 55; top: 0; left: 0;
    width: 36px; height: 36px; border: 1px solid var(--ink-dim);
    border-radius: 50%; pointer-events: none;
    transform: translate(-50%, -50%);
    transition: width .3s ease, height .3s ease, background-color .3s ease, opacity .3s ease;
    mix-blend-mode: difference;
  }
  .cursor-dot {
    display: block; position: fixed; z-index: 55; top: 0; left: 0;
    width: 5px; height: 5px; background: var(--accent); border-radius: 50%;
    pointer-events: none; transform: translate(-50%, -50%);
  }
  .cursor.is-active { width: 72px; height: 72px; background: rgba(79, 127, 255, .2); }
  body, a, button { cursor: none; }
}

/* ============ webgl + grain ============ */
#webgl {
  position: fixed; inset: 0; z-index: 0;
  width: 100%; height: 100lvh; pointer-events: none;
}
@media (max-width: 700px) { #webgl { opacity: .55; } }
.grain {
  position: fixed; inset: -100%; z-index: 50; pointer-events: none;
  opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 8s steps(10) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-6%, 4%); }
  40% { transform: translate(4%, -7%); }
  60% { transform: translate(-3%, 6%); }
  80% { transform: translate(6%, -3%); }
}

/* ============ nav ============ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.1rem var(--pad);
  mix-blend-mode: difference;
}
.nav__logo { font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; }
.nav__logo sup { font-size: .55em; }
.nav__meta { font-size: .78rem; color: var(--ink-dim); letter-spacing: .08em; text-transform: uppercase; }
.nav__links { display: flex; gap: 1.6rem; font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; }
.nav__links a { position: relative; padding: .2rem 0; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px; background: var(--ink);
  transform: scaleX(0); transform-origin: right; transition: transform .35s ease;
}
.nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }

main { position: relative; z-index: 1; }

/* ============ hero ============ */
.hero {
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 var(--pad);
}
.hero__kicker {
  font-size: clamp(.75rem, 1.2vw, .9rem);
  text-transform: uppercase; letter-spacing: .35em; color: var(--ink-dim);
  margin-bottom: clamp(1rem, 3vh, 2rem);
}
.hero__title {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2.2rem, 9.6vw, 9rem);
  line-height: .92; letter-spacing: -0.02em;
  white-space: nowrap;
}
.hero__line { display: block; overflow: hidden; }
.hero__line--indent { padding-left: clamp(1.2rem, 6vw, 6rem); color: transparent; -webkit-text-stroke: 1.5px var(--ink); }
.hero__foot {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem;
  margin-top: clamp(2rem, 6vh, 4rem);
}
.hero__blurb { max-width: 26rem; font-size: clamp(1rem, 1.6vw, 1.25rem); color: var(--ink); }
.hero__scroll { font-size: .8rem; text-transform: uppercase; letter-spacing: .2em; color: var(--ink-dim); white-space: nowrap; }
.hero__arrow { display: inline-block; animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(5px); } }

/* split chars */
.char { display: inline-block; will-change: transform; }

/* ============ marquee ============ */
.marquee {
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  overflow: hidden; padding: 1rem 0; background: var(--bg);
  position: relative; z-index: 1;
}
.marquee__track {
  display: flex; width: max-content;
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.1rem, 2.6vw, 1.9rem); text-transform: uppercase;
  animation: marquee 22s linear infinite;
}
.marquee__track span { white-space: nowrap; padding-right: 1rem; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ============ sections shared ============ */
section, .contact { padding: clamp(4rem, 12vh, 9rem) var(--pad); background: var(--bg); position: relative; }
.hero { background: transparent; }
.section-head {
  display: flex; align-items: baseline; gap: 1rem;
  margin-bottom: clamp(2.5rem, 6vh, 5rem);
}
.section-head h2 {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2.2rem, 6vw, 4.5rem); letter-spacing: -0.02em; line-height: 1;
}
.section-head__count { color: var(--accent); font-size: clamp(1rem, 2vw, 1.4rem); }
.word { display: inline-block; overflow: hidden; vertical-align: top; }
.word > span { display: inline-block; will-change: transform; }

/* ============ work ============ */
.work__list { display: grid; gap: clamp(3rem, 8vh, 6rem); }
.project__link { display: block; }
.project__media {
  position: relative; overflow: hidden; border-radius: 6px;
  aspect-ratio: 16 / 9; clip-path: inset(0 0 100% 0);
}
.project__art { position: absolute; inset: -10% -2%; transform: scale(1.05); transition: transform .9s cubic-bezier(.16, 1, .3, 1); }
.project__link:hover .project__art { transform: scale(1); }
.project__media--smoothbrain .project__art { background: linear-gradient(135deg, #101418 10%, #18324e 45%, #4f7fff 130%); }
.project__media--coach .project__art { background: radial-gradient(120% 160% at 80% 15%, #f0e9ff 0%, #7a5cff 35%, #14101e 78%); }
.project__media--garage .project__art { background: linear-gradient(160deg, #0c1210 0%, #1d4a38 55%, #ffb35c 125%); }
.project__media--atm .project__art { background: radial-gradient(130% 130% at 18% 85%, #ff5c79 0%, #581c30 45%, #120c0e 85%); }
.project__art::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 25%,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 25% 100%;
  mix-blend-mode: overlay;
}
.project__index {
  position: absolute; top: 1.2rem; right: 1.4rem;
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1rem, 2vw, 1.4rem); color: rgba(232, 228, 218, .85);
}
.project__info {
  display: grid; grid-template-columns: 1fr auto; align-items: baseline;
  column-gap: 1rem; padding-top: 1.1rem;
}
.project__title {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(1.8rem, 4.5vw, 3.2rem); letter-spacing: -0.01em;
  transition: color .3s ease;
}
.project__link:hover .project__title { color: var(--accent); }
.project__tags { grid-column: 1; color: var(--ink-dim); font-size: .9rem; }
.project__year { grid-row: 1 / span 2; align-self: center; color: var(--ink-dim); font-size: .9rem; }

@media (min-width: 900px) {
  .work__list { grid-template-columns: 1fr 1fr; }
  .project:nth-child(odd) { transform: translateY(-6vh); }
  .work__list { align-items: start; }
}

/* ============ services ============ */
.services__list { border-top: 1px solid var(--line); }
.service {
  display: grid; grid-template-columns: auto 1fr; column-gap: clamp(1rem, 4vw, 3rem);
  align-items: baseline; padding: clamp(1.4rem, 3.5vh, 2.4rem) 0;
  border-bottom: 1px solid var(--line); position: relative;
}
.service__num { color: var(--accent); font-size: .9rem; }
.service__name {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.5rem, 4vw, 3rem); letter-spacing: -0.01em;
  transition: transform .45s cubic-bezier(.16, 1, .3, 1);
}
.service__role {
  color: var(--ink); font-size: .92rem; margin-top: .35rem;
  text-transform: uppercase; letter-spacing: .08em;
}
.service__desc {
  max-width: 38rem; color: var(--ink-dim);
  font-size: .95rem; margin-top: .5rem;
}
@media (hover: hover) {
  .service:hover .service__name { transform: translateX(1.2rem); color: var(--accent); }
}

/* ============ about ============ */
.about__statement {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.5rem, 4.2vw, 3.4rem); line-height: 1.18; letter-spacing: -0.01em;
  max-width: 60rem;
}
.about__stats {
  display: flex; flex-wrap: wrap; gap: clamp(2rem, 6vw, 6rem);
  margin-top: clamp(3rem, 8vh, 5rem);
}
.about__stats strong {
  display: block; font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2.4rem, 6vw, 4.5rem); color: var(--accent); line-height: 1;
}
.about__stats span { color: var(--ink-dim); font-size: .9rem; text-transform: uppercase; letter-spacing: .12em; }

/* ============ contact ============ */
.contact { padding-bottom: 2rem; }
.contact__kicker { font-family: var(--font-serif); font-style: italic; font-size: clamp(1.3rem, 3vw, 2.2rem); color: var(--ink-dim); }
.contact__cta {
  display: inline-block; margin-top: 1rem; white-space: nowrap;
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2.4rem, 9vw, 8.5rem); line-height: 1; letter-spacing: -0.02em;
  color: transparent; -webkit-text-stroke: 1.5px var(--ink);
  transition: color .4s ease;
}
.contact__cta:hover { color: var(--accent); -webkit-text-stroke-color: var(--accent); }
.contact__cta .hero__line { display: block; overflow: hidden; }
.contact__grid {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem;
  margin-top: clamp(3rem, 10vh, 6rem); padding-top: 1.4rem;
  border-top: 1px solid var(--line);
  font-size: .85rem; color: var(--ink-dim);
}
.contact__socials { display: flex; gap: 1.4rem; }
.contact__grid a { transition: color .3s ease; }
.contact__grid a:hover { color: var(--accent); }

/* ============ mobile ============ */
@media (max-width: 700px) {
  .nav__meta { display: none; }
  .hero__foot { flex-direction: column; align-items: flex-start; }
  .project__info { grid-template-columns: 1fr; }
  .project__year { grid-row: auto; }
}

/* ============ reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .project__media { clip-path: none; }
}

/* ============ project screenshots ============ */
.project__art img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: top center;
  mix-blend-mode: luminosity; opacity: .9;
  filter: contrast(1.05);
}
