/* ---------- reset ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
ul, li { list-style: none; }
a { color: inherit; text-decoration: none; display: block; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
img, svg { display: block; }

/* ---------- base ---------- */
html, body {
  height: 100%;
  overflow: hidden;            /* the engine owns scrolling */
  overscroll-behavior: none;
}
body {
  font-family: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.3;
  letter-spacing: -0.005em;
  background: #f2f2f2;
  color: #1a1a1a;
  -webkit-font-smoothing: antialiased;
}
body.is-dragging { user-select: none; cursor: grabbing; }

/* ---------- fixed layers ---------- */
#gl {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 1;
  pointer-events: none;
}
#main-w { position: relative; z-index: 2; }
#shield { position: fixed; inset: 0; z-index: 5; pointer-events: none; }
#veil {
  position: fixed; inset: 0; z-index: 9998;
  background: #141414;
  transform: translate3d(0, 101%, 0);
  pointer-events: none;
}
#loader {
  position: fixed; inset: 0; z-index: 9999;
  background: #f2f2f2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
}
#loader-logo { font-weight: 600; font-size: 20px; letter-spacing: -0.02em; }
#loader-counter { font-size: 13px; font-variant-numeric: tabular-nums; letter-spacing: 0.08em; opacity: 0.6; }

/* ---------- nav ---------- */
#nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 28px 40px;
  opacity: 0;
}
#nav-logo { font-weight: 600; font-size: 18px; letter-spacing: -0.02em; }
#nav-list { display: flex; gap: 32px; }
#nav-list a { font-size: 13px; display: flex; gap: 8px; opacity: 0.75; transition: opacity 0.3s; }
#nav-list a:hover, #nav-list a.is-active { opacity: 1; }
#nav-list a span { opacity: 0.4; font-variant-numeric: tabular-nums; }

/* ---------- page / sections (culler targets are .page children) ---------- */
.page { will-change: auto; }
.page > * { will-change: transform; }

/* ---------- split text ---------- */
.split-mask { display: block; overflow: hidden; }
.split-line { display: block; will-change: transform; }
[data-split="chars"] { overflow: hidden; } /* the title itself is the clip mask */
.split-char { display: inline-block; }

/* ---------- hero ---------- */
.hero {
  min-height: 88vh;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 0 40px 6vh;
}
.hero-title {
  font-size: clamp(64px, 11vw, 168px);
  line-height: 0.94;
  font-weight: 600;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  perspective: 1000px;
}
.hero-sub {
  margin-top: 32px;
  display: flex; align-items: flex-start; gap: 16px;
  font-size: 15px;
  max-width: 420px;
}
.hero-ring { width: 36px; height: 36px; flex: none; }
.hero-ring circle { stroke: currentColor; stroke-width: 1; }

/* ---------- cards ---------- */
.card-section { padding: 8vh 40px 4vh; }
.card-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 24px;
}
.card-media {
  width: 100%;
  /* transparent — pixels are painted by the WebGL canvas behind the page */
}
.card-info { margin-top: 14px; font-size: 13px; }
.card-info a { display: inline; }
.card-info span { display: block; opacity: 0.5; margin-top: 2px; }

.card--1 { grid-column: 1 / 8; }
.card--1 .card-media { aspect-ratio: 4 / 3; }
.card--2 { grid-column: 9 / 13; margin-top: 22vh; }
.card--2 .card-media { aspect-ratio: 3 / 4; }
.card--3 { grid-column: 2 / 7; margin-top: 18vh; }
.card--3 .card-media { aspect-ratio: 4 / 5; }
.card--4 { grid-column: 8 / 13; margin-top: 8vh; }
.card--4 .card-media { aspect-ratio: 16 / 10; }
.card--5 { grid-column: 1 / 6; margin-top: 16vh; }
.card--5 .card-media { aspect-ratio: 4 / 3; }
.card--6 { grid-column: 7 / 12; margin-top: 10vh; }
.card--6 .card-media { aspect-ratio: 4 / 3; }

/* ---------- detail page ---------- */
.detail-hero { position: relative; height: 100vh; }
.detail-hero-media { position: absolute; inset: 0; }
.detail-hero-content {
  position: absolute; left: 40px; right: 40px; bottom: 6vh;
  color: #f5f4f2; z-index: 2;
}
.detail-hero-meta { margin-top: 18px; font-size: 14px; opacity: 0.9; }
.detail-body { padding: 12vh 40px; display: flex; justify-content: center; }
.detail-body p { font-size: clamp(22px, 2.6vw, 34px); line-height: 1.25; max-width: 900px; letter-spacing: -0.015em; }
.detail-next { padding: 10vh 40px 14vh; }
.detail-next-label { display: block; font-size: 13px; opacity: 0.5; margin-bottom: 12px; }
.detail-next-link {
  font-size: clamp(40px, 7vw, 110px);
  font-weight: 600;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  line-height: 0.96;
}
.detail-next-link:hover { opacity: 0.6; }

/* ---------- case: images repeater ---------- */
.case-images {
  padding: 14vh 40px 4vh;
  display: grid; grid-template-columns: repeat(12, 1fr);
  column-gap: 24px; row-gap: 12vh;
}
.case-image {
  width: 100%; /* transparent — pixels painted by the GL canvas */
  /* Real image proportion from the CMS (--ratio, set per element in the
     build) — layout reserves the exact box before any texture loads. */
  aspect-ratio: var(--ratio, 4 / 3);
}
.case-image:nth-child(3n + 1) { grid-column: 2 / 12; }
.case-image:nth-child(3n + 2) { grid-column: 1 / 7; }
.case-image:nth-child(3n) { grid-column: 8 / 13; align-self: center; }

/* ---------- case: scope of work ---------- */
.scope { padding: 12vh 40px 6vh; }
.scope-title {
  font-size: clamp(28px, 3.4vw, 48px);
  font-weight: 600; letter-spacing: -0.02em;
  margin-bottom: 6vh;
}
.scope-list li {
  display: grid; grid-template-columns: 60px 1fr 1.4fr; column-gap: 24px;
  align-items: baseline;
  padding: 26px 0; border-top: 1px solid rgba(0, 0, 0, 0.12);
}
.scope-index { font-size: 13px; opacity: 0.4; font-variant-numeric: tabular-nums; }
.scope-list h3 { font-size: clamp(20px, 2.4vw, 32px); font-weight: 500; letter-spacing: -0.02em; }
.scope-list p { font-size: 15px; line-height: 1.45; opacity: 0.75; max-width: 560px; }

/* ---------- footer ---------- */
.footer { padding: 14vh 40px 40px; }
.footer-claim {
  font-size: clamp(36px, 5.5vw, 84px);
  font-weight: 600; letter-spacing: -0.03em; line-height: 1;
  margin-bottom: 10vh;
}
.footer-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; opacity: 0.75;
  border-top: 1px solid rgba(0, 0, 0, 0.12);
  padding-top: 24px;
}
.footer-top:hover { opacity: 0.5; }

/* ---------- ease tuner (dev) ---------- */
#ease-tuner {
  position: fixed; bottom: 12px; right: 12px; z-index: 10001;
  display: flex; gap: 12px; align-items: center;
  font-family: ui-monospace, Menlo, monospace; font-size: 11px;
  background: rgba(20, 20, 20, 0.88); color: #eee;
  padding: 8px 12px; border-radius: 6px;
}
#ease-tuner label { display: flex; gap: 6px; align-items: center; opacity: 0.9; }
#ease-tuner select, #ease-tuner input {
  font: inherit; color: inherit;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 4px;
  padding: 3px 6px;
}
#ease-tuner input[type="number"] { width: 60px; }

/* ---------- perf hud (?perf) ---------- */
#perf-hud {
  position: fixed; bottom: 12px; left: 12px; z-index: 10001;
  font-family: ui-monospace, Menlo, monospace; font-size: 11px; line-height: 1.4;
  background: rgba(20, 20, 20, 0.85); color: #9f9;
  padding: 6px 10px; border-radius: 4px;
  pointer-events: none; white-space: nowrap;
}

/* ---------- misc ---------- */
.noscript {
  position: fixed; inset: 0; z-index: 10000;
  background: #fff; display: grid; place-items: center;
}
