/* CLS Industries — base + components */

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

html { -webkit-text-size-adjust: 100%; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  font-feature-settings: "ss01", "cv11";
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body { overflow-x: hidden; min-height: 100vh; }

/* Lenis */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }
.lenis.lenis-smooth iframe { pointer-events: none; }

/* Selection */
::selection { background: var(--ink); color: var(--paper); }

/* Defaults */
h1, h2, h3, h4, h5, h6 { margin: 0; font-family: var(--serif); font-weight: 400; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* ---------- Layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

section { position: relative; }

.section-pad { padding-top: clamp(96px, 14vw, 200px); padding-bottom: clamp(96px, 14vw, 200px); }
.section-pad-sm { padding-top: clamp(72px, 9vw, 128px); padding-bottom: clamp(72px, 9vw, 128px); }

.rule { width: 100%; height: 1px; background: var(--rule); }
.rule-stage { background: var(--rule-stage); }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0;
  z-index: 100;
  height: 72px;
  display: flex; align-items: center;
  transition: background-color 400ms var(--ease-out), border-color 400ms var(--ease-out), color 400ms var(--ease-out);
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: color-mix(in oklab, var(--paper) 92%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom-color: var(--rule);
}
.site-header.is-stage {
  color: var(--stage-fg);
}
.site-header.is-stage.is-scrolled {
  background: color-mix(in oklab, var(--stage) 80%, transparent);
  border-bottom-color: var(--rule-stage);
}
.header-inner {
  width: 100%; max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex; align-items: center; justify-content: space-between;
  gap: 32px;
}
.brand-mark {
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: -0.005em;
  line-height: 1;
  font-weight: 420;
  display: inline-flex; align-items: center; gap: 0;
  user-select: none;
  height: 22px;
}
.brand-mark .cls {
  font-feature-settings: "smcp", "c2sc";
  letter-spacing: 0.04em;
}
.brand-mark .ind {
  margin-left: 0.4em;
  font-style: italic;
  font-weight: 380;
}
.nav-links {
  display: flex; gap: 36px; align-items: center;
}
.nav-links {
  display: flex; gap: 36px; align-items: center;
  height: 22px;
}
.nav-links a {
  font-size: 14px;
  line-height: 22px;
  letter-spacing: 0.005em;
  position: relative;
  padding: 0 2px;
  color: inherit;
  opacity: 0.78;
  transition: opacity 200ms var(--ease-out);
  display: inline-flex; align-items: center;
  height: 22px;
}
.nav-links a:hover { opacity: 1; }
.nav-links a.is-current { opacity: 1; }
.nav-links a.is-current::after {
  content: ""; position: absolute; left: 2px; right: 2px; bottom: -2px;
  height: 1px; background: currentColor; opacity: 0.5;
}

/* ---------- Buttons ---------- */
.btn {
  --bg: var(--accent);
  --fg: var(--paper);
  --bd: var(--accent);
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 28px;
  border-radius: 9999px;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--bd);
  font-family: var(--sans);
  font-size: 15px;
  letter-spacing: 0.005em;
  font-weight: 480;
  line-height: 1;
  cursor: pointer;
  transition: background-color 220ms var(--ease-out), color 220ms var(--ease-out), transform 120ms var(--ease-out), border-color 220ms var(--ease-out);
}
.btn:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn:active { transform: scale(0.985); }
.btn .arrow { transition: transform 220ms var(--ease-out); display: inline-block; }
.btn:hover .arrow { transform: translateX(3px); }

.btn-ghost {
  --bg: transparent;
  --fg: var(--ink);
  --bd: var(--ink);
}
.btn-ghost:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.btn-on-stage {
  --bg: var(--paper);
  --fg: var(--ink);
  --bd: var(--paper);
}
.btn-on-stage:hover { background: var(--stage-fg); border-color: var(--stage-fg); }

.btn-large { padding: 18px 32px; font-size: 16px; }

/* Inline link */
.link-i {
  position: relative;
  color: var(--accent);
  display: inline-block;
  padding-bottom: 4px;
  transition: color 200ms var(--ease-out);
}
.link-i::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px; background: currentColor; opacity: 0;
  transform: translateY(2px);
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
}
.link-i:hover::after { opacity: 0.7; transform: translateY(0); }

/* Text link on stage */
.link-stage {
  color: var(--stage-fg);
  display: inline-flex; align-items: baseline; gap: 8px;
  font-size: 15px;
  position: relative;
}
.link-stage::after {
  content: ""; position: absolute; left: 0; right: 1.4em; bottom: -4px;
  height: 1px; background: currentColor; opacity: 0.3;
  transition: opacity 200ms var(--ease-out);
}
.link-stage:hover::after { opacity: 0.9; }
.link-stage .arrow { transition: transform 220ms var(--ease-out); }
.link-stage:hover .arrow { transform: translateX(3px); }

/* ---------- Type styles ---------- */
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--accent);
}
.eyebrow.on-stage { color: var(--accent); opacity: 0.95; }

.h-display {
  font-family: var(--serif);
  font-size: clamp(56px, 9vw, 144px);
  line-height: 1.02;
  letter-spacing: -0.022em;
  font-weight: 380;
  font-variation-settings: "opsz" 36;
}
.h-display em { font-style: italic; font-weight: 380; }

.h2 {
  font-family: var(--serif);
  font-size: clamp(40px, 5.5vw, 80px);
  line-height: 1.05;
  letter-spacing: -0.018em;
  font-weight: 400;
  font-variation-settings: "opsz" 28;
}

.h3 {
  font-family: var(--serif);
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.12;
  letter-spacing: -0.012em;
  font-weight: 420;
  font-variation-settings: "opsz" 18;
}

.h4 {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.005em;
  font-weight: 460;
  font-variation-settings: "opsz" 14;
}

.lead {
  font-family: var(--serif);
  font-size: clamp(20px, 2.1vw, 26px);
  line-height: 1.4;
  font-weight: 380;
  font-variation-settings: "opsz" 16;
  letter-spacing: -0.005em;
  color: var(--ink-muted);
}

.body { font-size: 17px; line-height: 1.65; color: var(--ink-muted); }
.body-lg { font-size: 19px; line-height: 1.6; color: var(--ink-muted); }

.meta {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---------- Stage sections ---------- */
.stage {
  background: var(--stage);
  color: var(--stage-fg);
}
.stage .body, .stage .lead, .stage .meta { color: rgba(244, 239, 230, 0.7); }
.stage .rule { background: var(--rule-stage); }

/* ---------- Reveal animations ---------- */
.reveal-mask {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}
.reveal-mask > .inner {
  display: inline-block;
  transform: translateY(105%);
  will-change: transform;
}
.reveal-mask.is-visible > .inner {
  transform: translateY(0);
  transition: transform 1100ms var(--ease-out);
}

.reveal-line { display: block; }
.reveal-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(10px);
  filter: blur(4px);
  font-variation-settings: "wght" 240, "opsz" 36;
  will-change: transform, opacity, filter, font-variation-settings;
}
.reveal-word.is-set {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
  font-variation-settings: "wght" 380, "opsz" 36;
  transition:
    opacity 900ms var(--ease-out),
    transform 1100ms var(--ease-out),
    filter 900ms var(--ease-out),
    font-variation-settings 1400ms var(--ease-out);
}

/* Generic fade-up (sections after hero) */
.fx { opacity: 0; transform: translateY(14px); will-change: transform, opacity; }
.fx.is-in { opacity: 1; transform: translateY(0); transition: opacity 900ms var(--ease-out), transform 1100ms var(--ease-out); }
.fx.d1 { transition-delay: 80ms; }
.fx.d2 { transition-delay: 160ms; }
.fx.d3 { transition-delay: 240ms; }
.fx.d4 { transition-delay: 320ms; }
.fx.d5 { transition-delay: 400ms; }

/* ---------- Page transition ---------- */
.page-curtain {
  position: fixed; inset: 0;
  background: var(--paper);
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 360ms var(--ease-io);
}
.page-curtain.is-on { opacity: 1; pointer-events: all; }

.page-intro {
  position: fixed; inset: 0;
  background: var(--paper);
  z-index: 9998;
  pointer-events: none;
  animation: pageIntro 700ms var(--ease-out) forwards;
}
@keyframes pageIntro { 0% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--paper);
  border-top: 1px solid var(--rule);
  padding: 80px 0 56px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  align-items: start;
}
.footer-brand { display: grid; gap: 14px; }
.footer-brand .brand-mark { font-size: 22px; }
.footer-brand .tag { font-size: 14px; color: var(--ink-muted); letter-spacing: -0.005em; }
.footer-col h6 {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 18px;
}
.footer-col a {
  display: block;
  font-size: 15px;
  padding: 4px 0;
  color: var(--ink);
  transition: color 200ms var(--ease-out);
}
.footer-col a:hover { color: var(--accent); }
.footer-legal { font-size: 14px; color: var(--ink-muted); }
.footer-legal .built { display: block; margin-top: 4px; font-style: italic; color: var(--ink-soft); }
.footer-bottom {
  margin-top: 80px;
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12px;
  font-family: var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr; gap: 40px; }
  .footer-bottom { flex-direction: column; gap: 12px; align-items: flex-start; }
}

/* ---------- Mockup chrome ---------- */
.mock-shadow {
  filter: drop-shadow(0 40px 80px rgba(0,0,0,0.45)) drop-shadow(0 8px 24px rgba(0,0,0,0.3));
}

/* ---------- Easter egg colophon ---------- */
.colophon {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 90;
  padding: 18px var(--gutter);
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  font-weight: 380;
  color: var(--ink-muted);
  background: linear-gradient(to top, color-mix(in oklab, var(--paper) 96%, transparent), transparent);
  pointer-events: none;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 600ms var(--ease-out), transform 800ms var(--ease-out);
  letter-spacing: -0.005em;
}
.colophon.is-on { opacity: 1; transform: translateY(0); }
.colophon .dot { display: inline-block; padding: 0 0.5em; opacity: 0.5; }

/* ---------- Misc ---------- */
.split-1, .split-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  align-items: start;
}
@media (min-width: 900px) {
  .split-2 { grid-template-columns: 1fr 1fr; gap: 96px; }
}

.eyebrow-mono {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 500;
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 220ms !important;
    scroll-behavior: auto !important;
  }
  .reveal-word { filter: none; transform: none; }
  .reveal-mask > .inner { transform: none; }
  .fx { transform: none; }
}
