:root {
  --bg: #ffffff;
  --ink: #0a0a0a;
  --muted: #6b6b6b;
  --faint: #9a9a9a;
  --rule: #e8e8e8;
  --accent: #e0102f;
  --wrap: 1120px;
  --gutter: clamp(20px, 5vw, 48px);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ul, ol { margin: 0; }
main:focus { outline: none; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
em { font-style: italic; }

::selection { background: var(--ink); color: var(--bg); }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
  border-radius: 2px;
}

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 20;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--bg);
  font-size: 14px;
}
.skip:focus { top: 12px; }

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}
.header.is-scrolled { border-bottom-color: var(--rule); }

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.04em;
}
.wordmark img { display: block; width: 30px; height: 30px; }

.accent { color: var(--accent); }

.nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 36px);
  font-size: 14.5px;
}
.nav a {
  color: var(--muted);
  transition: color 0.2s var(--ease);
}
.nav a:hover { color: var(--ink); }
.nav .nav__cta {
  color: var(--ink);
  padding: 8px 16px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.nav .nav__cta:hover { background: var(--ink); color: var(--bg); }

/* Shared type */
.eyebrow {
  font-family: "Instrument Serif", Georgia, "Times New Roman", serif;
  font-size: clamp(20px, 2vw, 24px);
  line-height: 1.3;
  letter-spacing: 0;
  color: var(--muted);
}

/* Hero */
.hero {
  padding-top: clamp(88px, 16vh, 176px);
  padding-bottom: clamp(88px, 15vh, 168px);
}

.hero__title {
  margin-top: 28px;
  font-size: clamp(40px, 7.6vw, 100px);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.055em;
  text-wrap: balance;
}

.hero__lede {
  margin-top: clamp(28px, 4vw, 44px);
  max-width: 34em;
  font-size: clamp(17px, 1.8vw, 20px);
  line-height: 1.5;
  color: var(--muted);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 32px;
  margin-top: clamp(32px, 4vw, 48px);
}

.button {
  display: inline-block;
  padding: 15px 28px;
  background: var(--ink);
  color: var(--bg);
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 15.5px;
  font-weight: 500;
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}
.button:hover { background: transparent; color: var(--ink); }

.link {
  font-size: 15.5px;
  font-weight: 500;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.2s var(--ease);
}
.link:hover { border-bottom-color: var(--ink); }
.link span { display: inline-block; transition: transform 0.25s var(--ease); }
.link:hover span { transform: translateX(4px); }

/* Numbers */
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: clamp(48px, 6vw, 80px) 0 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.stat {
  padding: clamp(24px, 3vw, 36px) clamp(16px, 2.4vw, 32px) clamp(24px, 3vw, 36px) 0;
}
.stat + .stat {
  padding-left: clamp(16px, 2.4vw, 32px);
  border-left: 1px solid var(--rule);
}
.stat dt {
  font-size: clamp(30px, 3.6vw, 44px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.045em;
}
.stat dd {
  margin: 14px 0 0;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--muted);
}

/* Sections */
.section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 3fr);
  gap: 32px clamp(24px, 4vw, 64px);
  padding-top: clamp(56px, 9vw, 112px);
  padding-bottom: clamp(56px, 9vw, 112px);
  position: relative;
}
.section::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--gutter);
  right: var(--gutter);
  height: 1px;
  background: var(--rule);
}

.section__head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-size: 14.5px;
}
.section__label {
  font-size: inherit;
  font-weight: 500;
}

.statement {
  font-size: clamp(26px, 3.6vw, 44px);
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px clamp(24px, 4vw, 56px);
  margin-top: clamp(36px, 5vw, 64px);
  color: var(--muted);
}

/* Services */
.services {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(36px, 5vw, 64px) clamp(24px, 4vw, 56px);
}
.service {
  padding-top: 24px;
  border-top: 1px solid var(--ink);
}
.service__icon {
  display: block;
  width: 30px;
  height: 30px;
  margin-bottom: 20px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.3s var(--ease), transform 0.5s var(--ease);
}
.service:hover .service__icon {
  stroke: var(--accent);
  transform: translateY(-3px);
}
.service h3 {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.service p {
  margin-top: 12px;
  color: var(--muted);
}

/* Work */
.project {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: start;
  gap: clamp(18px, 3vw, 36px);
  padding: clamp(26px, 3.4vw, 40px) 0;
  border-bottom: 1px solid var(--rule);
}
.project:first-child { border-top: 1px solid var(--rule); }

.project__logo {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
}
.project__logo img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: grayscale(1);
  opacity: 0.75;
  transition: filter 0.4s var(--ease), opacity 0.4s var(--ease);
}
.project:hover .project__logo img { filter: none; opacity: 1; }

.project__title {
  font-size: clamp(21px, 2.6vw, 30px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.03em;
}
.project__client {
  margin-top: 6px;
  font-size: 14.5px;
  font-weight: 500;
}
.project__desc {
  margin-top: 12px;
  max-width: 62ch;
  font-size: 15.5px;
  color: var(--muted);
}

/* Contact */
.contact {
  position: relative;
  padding-top: clamp(80px, 13vw, 168px);
  padding-bottom: clamp(80px, 13vw, 168px);
}
.contact::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--gutter);
  right: var(--gutter);
  height: 1px;
  background: var(--rule);
}

.contact__title {
  margin-top: 28px;
  font-size: clamp(40px, 7.6vw, 96px);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.05em;
}

.contact__email {
  display: inline-block;
  margin-top: clamp(32px, 5vw, 56px);
  font-size: clamp(22px, 3.4vw, 40px);
  font-weight: 500;
  letter-spacing: -0.03em;
  background: linear-gradient(var(--ink), var(--ink)) no-repeat 0 100% / 100% 1px;
  padding-bottom: 6px;
  transition: background-size 0.4s var(--ease);
}
.contact__email:hover { background-size: 0 1px; background-position: 100% 100%; }

.contact__details {
  display: flex;
  flex-wrap: wrap;
  gap: 24px clamp(40px, 8vw, 96px);
  margin: clamp(40px, 6vw, 72px) 0 0;
  font-size: 15.5px;
}
.contact__details dt {
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.contact__details dd { margin: 8px 0 0; }
.contact__details a {
  padding-bottom: 2px;
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.2s var(--ease);
}
.contact__details a:hover { border-bottom-color: var(--ink); }

/* Footer */
.footer { border-top: 1px solid var(--rule); }
.footer__inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 28px;
  padding-bottom: 28px;
  font-size: 14px;
  color: var(--muted);
}
.footer a { transition: color 0.2s var(--ease); }
.footer a:hover { color: var(--ink); }

/* Reveal on scroll (only when JS enables it) */
.js-reveal .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.9s var(--ease) var(--d, 0ms), transform 0.9s var(--ease) var(--d, 0ms);
}
.js-reveal .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Headings rise word by word from behind a mask */
.js-reveal .reveal.split {
  opacity: 1;
  transform: none;
}
.js-reveal .split .word {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding: 0.08em 0.06em 0.16em;
  margin: -0.08em -0.06em -0.16em;
}
.js-reveal .split .word__in {
  display: inline-block;
  transform: translateY(115%);
  transition: transform 1.1s var(--ease);
  transition-delay: calc(var(--d, 0ms) + var(--i) * 55ms);
}
.js-reveal .split.is-visible .word__in { transform: none; }

/* Section rules draw in from the left */
.js-reveal .section::before,
.js-reveal .contact::before {
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.4s var(--ease);
}
.js-reveal .section.is-visible::before,
.js-reveal .contact.is-visible::before { transform: none; }

/* 3D scene: fixed behind the whole page */
.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 2s var(--ease) 0.2s;
  -webkit-mask-image: linear-gradient(to right, transparent 38%, #000 66%);
  mask-image: linear-gradient(to right, transparent 38%, #000 66%);
}
.scene.is-ready { opacity: 1; }
.scene canvas {
  display: block;
  width: 100%;
  height: 100%;
}
main, .footer {
  position: relative;
  z-index: 1;
}

/* Reading progress */
.progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
}

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

/* Responsive */
main { overflow-x: clip; }

@media (max-width: 820px) {
  .scene {
    -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 55%);
    mask-image: linear-gradient(to right, transparent 0%, #000 55%);
  }
  .scene.is-ready { opacity: 0.6; }
  .section { grid-template-columns: minmax(0, 1fr); }
  .columns, .services { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  .header__inner { height: 64px; }
  .nav a:not(.nav__cta) { display: none; }
  .project { grid-template-columns: 48px minmax(0, 1fr); }
  .project__logo { width: 48px; height: 48px; }
  .stats { grid-template-columns: minmax(0, 1fr); }
  .stat + .stat {
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--rule);
  }
}

/* Wide screens: text keeps to the left, the 3D scene has the right side to itself */
@media (min-width: 1100px) {
  .scene {
    -webkit-mask-image: linear-gradient(to right, transparent 50%, #000 58%);
    mask-image: linear-gradient(to right, transparent 50%, #000 58%);
  }
  .hero > *,
  .contact > * { max-width: 56%; }
  .hero__title { font-size: clamp(56px, 5.4vw, 76px); }
  .contact__title { font-size: clamp(44px, 4.4vw, 62px); }
  .section {
    grid-template-columns: minmax(0, 56%);
    row-gap: 28px;
  }
  .stat dt { font-size: clamp(22px, 1.8vw, 28px); white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
