:root {
  --bg: #0b0b0a;
  --bg-alt: #121210;
  --line: #24231f;
  --line-alt: #2e2d28;
  --text: #ece7dc;
  --text-soft: #c9c3b7;
  --text-muted: #9a958b;
  --accent: #d9a35b;
  --sans: 'Inter Tight', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --wrap: 1240px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--text); }
a:hover { color: #fff; }

h1, h2, h3, p { margin: 0; }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-left: 32px;
  padding-right: 32px;
}

.section { border-top: 1px solid var(--line); }
/* Translucent so the side light shows through the alternate sections. */
.section--alt { background: rgba(255, 250, 240, 0.025); }
.section > .wrap { padding-top: 128px; padding-bottom: 128px; }

.label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--accent);
}

.mono-muted {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--text-muted);
}

.h2 {
  font-size: clamp(32px, 4.2vw, 56px);
  line-height: 1.2;
  font-weight: 300;
}

.lede { font-size: 18px; color: var(--text-soft); }

.stack { display: flex; flex-direction: column; gap: 16px; }
.stack--lg { gap: 28px; }
.stack--xl { gap: 64px; }
.narrow { max-width: 720px; }

.button {
  display: inline-block;
  text-decoration: none;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.14em;
  color: var(--bg);
  background: var(--text);
  padding: 16px 28px;
  border-radius: 999px;
  transition: background 0.2s ease;
}
.button:hover { color: var(--bg); background: #fff; }

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

/* Header: transparent over the hero, frosted glass once the page scrolls. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid transparent;
  transition: background-color 0.35s ease, border-color 0.35s ease, backdrop-filter 0.35s ease;
}
.site-header.is-stuck {
  background: rgba(14, 14, 13, 0.55);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border-bottom-color: rgba(236, 231, 220, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.site-header .wrap {
  padding-top: 22px;
  padding-bottom: 22px;
  transition: padding 0.35s ease;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.brand { text-decoration: none; display: flex; flex-direction: column; gap: 2px; }
.brand__name { font-size: 18px; letter-spacing: 0.08em; font-weight: 400; }
.brand__tag { font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; color: var(--text-muted); }
.nav { display: flex; flex-wrap: wrap; gap: 4px 28px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; }
.site-header.is-stuck .wrap { padding-top: 14px; padding-bottom: 14px; }
.nav a {
  position: relative;
  text-decoration: none;
  padding: 12px 0;
  color: var(--text-soft);
  transition: color 0.25s ease;
}
.nav a:hover { color: #fff; }
.nav a::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  transform: scale(0);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.nav a[aria-current] { color: var(--accent); }
.nav a[aria-current]::after { opacity: 1; transform: scale(1); }

section[id] { scroll-margin-top: 72px; }

/* Hero */
body { position: relative; }
main, .site-footer { position: relative; z-index: 1; }

/* Fixed behind the whole page: the shader moves the light from the top
   of the hero to the side gutters as you scroll. */
.hero-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
/* CSS fallback light only belongs at the top of the page. */
.is-scrolled .hero__light { opacity: 0; }
.hero__light {
  --mx: 0;
  --my: 0;
  position: absolute;
  inset: 0;
  transform: translate3d(calc(var(--mx) * 9%), calc(var(--my) * 3%), 0);
  transition: opacity 1.6s ease;
}
/* Once the WebGL water light is running, the CSS version steps aside. */
.has-water .hero__light { opacity: 0; }
.has-water .hero__light::before,
.has-water .hero__light::after { animation-play-state: paused; }
/* A soft pool of light that follows the cursor. */
.hero__light > span {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle 28vw at calc(50% + var(--mx) * 38%) calc(18% + var(--my) * 22%), rgba(255, 168, 92, 0.12), transparent 70%);
}
.hero__light::before,
.hero__light::after {
  content: '';
  position: absolute;
  inset: -10% -20% 0;
  will-change: transform, opacity;
}
/* Warm spotlight from the top, drifting side to side and breathing. */
.hero__light::before {
  background: radial-gradient(ellipse 45% 38% at 50% -4%, rgba(255, 176, 102, 0.42), rgba(255, 150, 70, 0.12) 55%, transparent 80%);
  animation: light-drift 8s ease-in-out infinite alternate;
}
/* Wider haze, moving against the spotlight on a longer cycle. */
.hero__light::after {
  background: radial-gradient(ellipse 100% 60% at 50% -18%, rgba(217, 163, 91, 0.18), transparent 70%);
  animation: haze-drift 13s ease-in-out infinite alternate;
}
@keyframes light-drift {
  0%   { transform: translate3d(-7%, 0, 0) scale(1);    opacity: 0.8; }
  50%  { transform: translate3d(2%, 1.5%, 0) scale(1.08); opacity: 1; }
  100% { transform: translate3d(8%, -1%, 0) scale(0.96); opacity: 0.7; }
}
@keyframes haze-drift {
  0%   { transform: translate3d(6%, 0, 0);   opacity: 1; }
  100% { transform: translate3d(-6%, 2%, 0); opacity: 0.6; }
}
.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.6s ease;
}
.hero__canvas.is-ready { opacity: 1; }

.hero {
  padding-top: 96px;
  padding-bottom: 48px;
  min-height: calc(max(100svh, 760px) - 96px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 28px;
}
.hero h1 {
  font-size: clamp(48px, 8vw, 116px);
  line-height: 1;
  letter-spacing: -0.01em;
  font-weight: 300;
}
.hero__sub { font-size: 20px; color: var(--text-soft); max-width: 520px; }
.hero .button { margin-top: 16px; }
.hero__meta {
  width: 100%;
  margin-top: auto;
  padding-top: 64px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--text-muted);
}

/* Philosophy */
.split { display: flex; flex-wrap: wrap; gap: 48px 96px; }
.split > .label { flex: 0 1 200px; }
.split__body { flex: 1 1 560px; }
.split__body .lede { max-width: 680px; }

/* Problems */
.problems {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  border-top: 1px solid var(--line);
}
.problem {
  padding: 32px 28px 32px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.problem h3 { font-size: 22px; line-height: 1.35; font-weight: 400; }
.problem p { font-size: 16px; color: var(--text-muted); }

/* Services */
.service {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 48px;
  padding: 40px 0;
  border-top: 1px solid var(--line-alt);
}
.service .mono-muted { flex: 0 0 180px; }
.service h3 { flex: 1 1 320px; font-size: 28px; line-height: 1.3; font-weight: 300; }
.service p { flex: 1 1 380px; font-size: 17px; color: var(--text-soft); }

/* Profile */
.profile { display: flex; flex-wrap: wrap; gap: 64px 96px; }
.profile__intro { flex: 1 1 420px; }
.profile__name { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.profile__name span:first-child { font-size: 22px; font-weight: 400; }
.timeline {
  flex: 1 1 460px;
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.timeline li {
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.timeline__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.timeline__company { font-size: 19px; font-weight: 400; }
.timeline__note { font-size: 15px; color: var(--text-muted); }

/* Process */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 40px;
}
.steps li {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid var(--accent);
  padding-top: 24px;
}
.steps h3 { font-size: 24px; font-weight: 400; }
.steps p { font-size: 16px; color: var(--text-soft); }

/* Contact */
.contact {
  padding-top: 160px !important;
  padding-bottom: 160px !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 28px;
}
.contact h2 { font-size: clamp(36px, 5.5vw, 72px); line-height: 1.15; font-weight: 300; }
.contact .lede { max-width: 560px; }
.contact .button { margin-top: 12px; }
.contact__link { font-size: 11px; }

/* Footer */
.site-footer .wrap {
  padding-top: 32px;
  padding-bottom: 32px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--text-muted);
}
.site-footer nav { display: flex; gap: 24px; }
.site-footer a { color: var(--text-soft); padding: 10px 0; }

/* 404 */
.not-found {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 24px;
}

@media (max-width: 640px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .section > .wrap { padding-top: 88px; padding-bottom: 88px; }
  .hero { padding-top: 72px; }
  .contact { padding-top: 104px !important; padding-bottom: 104px !important; }
  /* On phones the light sits right behind the nav, so keep the glass on from the start. */
  .site-header {
    background: rgba(14, 14, 13, 0.55);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    backdrop-filter: blur(18px) saturate(160%);
    border-bottom-color: rgba(236, 231, 220, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  }
  .site-header .wrap,
  .site-header.is-stuck .wrap { padding-top: 10px; padding-bottom: 2px; gap: 4px; }
  .nav {
    width: 100%;
    flex-wrap: nowrap;
    gap: 0 20px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero__canvas { transition: none; }
  .hero__light::before, .hero__light::after { animation: none; }
}
