:root {
  --paper: #f6f4ef;
  --surface: #ffffff;
  --ink: #141414;
  --muted: #5f5c56;
  --line: rgba(20, 20, 20, 0.12);
  --dark: #121211;
  --serif: "Libre Baskerville", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --hex: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='42' height='72' viewBox='0 0 42 72'%3E%3Cpath d='M0 -24L21 -12V12L0 24L-21 12V-12ZM42 -24L63 -12V12L42 24L21 12V-12ZM0 48L21 60V84L0 96L-21 84V60ZM42 48L63 60V84L42 96L21 84V60ZM21 12L42 24V48L21 60L0 48V24Z' fill='none' stroke='%23141414' stroke-opacity='.08'/%3E%3C/svg%3E");
  --hex-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='42' height='72' viewBox='0 0 42 72'%3E%3Cpath d='M0 -24L21 -12V12L0 24L-21 12V-12ZM42 -24L63 -12V12L42 24L21 12V-12ZM0 48L21 60V84L0 96L-21 84V60ZM42 48L63 60V84L42 96L21 84V60ZM21 12L42 24V48L21 60L0 48V24Z' fill='none' stroke='%23ffffff' stroke-opacity='.09'/%3E%3C/svg%3E");
  color-scheme: light;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 400; line-height: 1.15; letter-spacing: -0.01em; }
em { font-style: italic; }
::selection { background: var(--ink); color: #fff; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; border-radius: 4px; }

.container { width: min(1200px, 100%); margin-inline: auto; padding-inline: clamp(20px, 5vw, 48px); }

.skip-link {
  position: fixed; left: 16px; top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: 8px; background: var(--ink); color: #fff; text-decoration: none;
}
.skip-link:focus { top: 16px; }

/* ---------- Splash (only when JS can dismiss it) ---------- */
.splash { display: none; }
.js .splash {
  position: fixed; inset: 0; z-index: 200; display: grid; place-content: center; justify-items: center; gap: 40px;
  background: var(--paper);
  transition: opacity 0.7s var(--ease), visibility 0s 0.7s;
}
.is-loaded .splash { opacity: 0; visibility: hidden; }
.splash-mark { position: relative; display: grid; place-items: center; width: 132px; aspect-ratio: 1; transition: transform 0.7s var(--ease); }
.is-loaded .splash-mark { transform: scale(0.9); }
.splash-mark svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; animation: spin 9s linear infinite; }
.splash-mark polygon { fill: var(--surface); stroke: rgba(20, 20, 20, 0.14); stroke-width: 1; vector-effect: non-scaling-stroke; }
.splash-mark img { position: relative; width: 46%; animation: float 3s ease-in-out infinite; }
.splash-logos { display: flex; gap: 18px; }
.splash-logos img { width: 30px; height: 30px; object-fit: contain; animation: splash-wave 1.6s var(--ease) infinite; animation-delay: calc(var(--i) * 0.16s); }

/* ---------- Header ---------- */
.header {
  position: fixed; inset: 0 0 auto; z-index: 50;
  transition: background-color 0.4s, box-shadow 0.4s, backdrop-filter 0.4s;
}
.header.is-scrolled {
  background: rgba(246, 244, 239, 0.82);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  box-shadow: 0 1px 0 var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 84px; transition: height 0.4s var(--ease); }
.is-scrolled .header-inner { height: 66px; }

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 34px; }
.brand-text { display: flex; flex-direction: column; font-family: var(--serif); line-height: 1; }
.brand-text b { font-weight: 700; font-size: 0.95rem; letter-spacing: 0.02em; text-transform: uppercase; }
.brand-text span { margin-top: 4px; font-size: 0.85rem; }

.nav { display: flex; align-items: center; gap: 32px; }
.nav a:not(.btn) { position: relative; color: var(--muted); font-size: 0.925rem; text-decoration: none; transition: color 0.3s; }
.nav a:not(.btn)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right; transition: transform 0.4s var(--ease);
}
.nav a:not(.btn):hover { color: var(--ink); }
.nav a:not(.btn):hover::after { transform: scaleX(1); transform-origin: left; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 26px; border: 1px solid var(--ink); border-radius: 999px;
  background: var(--ink); color: #fff; font-size: 0.95rem; font-weight: 500; text-decoration: none;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), background-color 0.3s, border-color 0.3s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 28px -12px rgba(20, 20, 20, 0.55); }
.btn .arrow { transition: transform 0.35s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }
.btn-small { padding: 10px 18px; font-size: 0.875rem; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); box-shadow: none; }
.btn-light { background: #fff; color: var(--ink); border-color: #fff; font-size: 1.05rem; padding: 18px 32px; }
.btn-light:hover { box-shadow: 0 16px 40px -16px rgba(255, 255, 255, 0.45); }

/* ---------- Shared type ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 12px; margin: 0 0 20px;
  color: var(--muted); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; }
h2 { margin-bottom: 20px; font-size: clamp(2.1rem, 4.4vw, 3.6rem); line-height: 1.1; letter-spacing: -0.02em; }
.section-lead { max-width: 36rem; margin: 0; color: var(--muted); font-size: 1.1rem; }

/* ---------- Hero ---------- */
.hero { position: relative; display: flex; align-items: center; min-height: 100svh; padding: 132px 0 104px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: var(--hex) 0 0 / 42px 72px;
  -webkit-mask-image: radial-gradient(ellipse 55% 70% at 76% 46%, #000 10%, transparent 72%);
  mask-image: radial-gradient(ellipse 55% 70% at 76% 46%, #000 10%, transparent 72%);
  animation: drift 24s linear infinite;
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle at 70% 30%, rgba(248, 111, 23, 0.09), transparent 32%),
    radial-gradient(circle at 88% 72%, rgba(70, 14, 105, 0.08), transparent 34%),
    radial-gradient(circle at 60% 80%, rgba(37, 66, 1, 0.06), transparent 30%);
}
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(40px, 6vw, 96px); align-items: center; }

.hero-eyebrow::before { display: none; }
.pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }
.pulse::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: inherit; animation: pulse 2.4s ease-out infinite; }

.hero-title { margin-bottom: 28px; font-size: clamp(2.8rem, 6.4vw, 5.6rem); line-height: 1.04; letter-spacing: -0.03em; }
.line { display: block; overflow: hidden; padding-bottom: 0.1em; margin-bottom: -0.1em; }
.line > span { display: inline-block; }
.hero-lead { max-width: 34rem; margin: 0 0 36px; color: var(--muted); font-size: clamp(1.05rem, 1.4vw, 1.2rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-visual { position: relative; justify-self: end; width: min(520px, 100%); container-type: inline-size; }
.hero-visual-inner {
  position: relative; aspect-ratio: 1;
  transform: translate3d(calc(var(--mx, 0) * -22px), calc(var(--my, 0) * -22px), 0);
  transition: transform 0.9s var(--ease);
}
.hex { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.hex polygon { fill: none; stroke: rgba(20, 20, 20, 0.14); stroke-width: 1; vector-effect: non-scaling-stroke; }
.hex-outer { animation: spin 140s linear infinite; }
.hex-inner { inset: 19%; width: 62%; height: 62%; animation: spin 100s linear infinite reverse; }
.hex-inner polygon { fill: rgba(255, 255, 255, 0.45); }
.orbit-ring { position: absolute; inset: 10%; border: 1px dashed rgba(20, 20, 20, 0.2); border-radius: 50%; }
.orbit { position: absolute; inset: 0; animation: spin 60s linear infinite; }
.orbit-item {
  --size: 16cqw;
  position: absolute; top: 50%; left: 50%; width: var(--size); height: var(--size); margin: calc(var(--size) / -2);
  transform: rotate(calc(var(--i) * 90deg - 45deg)) translateX(40cqw) rotate(calc(var(--i) * -90deg + 45deg));
}
.orbit-item img {
  width: 100%; height: 100%; padding: 24%; object-fit: contain;
  border-radius: 50%; background: var(--surface);
  box-shadow: 0 14px 30px -14px rgba(20, 20, 20, 0.3), 0 0 0 1px rgba(20, 20, 20, 0.06);
  animation: spin 60s linear infinite reverse;
}
.hero-disc {
  position: absolute; inset: 27%; display: grid; place-items: center; border-radius: 50%; background: var(--surface);
  box-shadow: 0 34px 70px -34px rgba(20, 20, 20, 0.4), 0 0 0 1px rgba(20, 20, 20, 0.05);
}
.hero-disc img { width: 50%; animation: float 6s ease-in-out infinite; }

.scroll-cue { position: absolute; left: 50%; bottom: 32px; width: 24px; height: 40px; margin-left: -12px; border: 1.5px solid rgba(20, 20, 20, 0.25); border-radius: 12px; }
.scroll-cue span { position: absolute; left: 50%; top: 8px; width: 3px; height: 8px; margin-left: -1.5px; border-radius: 2px; background: var(--ink); animation: cue 2.2s var(--ease) infinite; }

/* Hero entrance (only when JS is running) */
.js .line > span { transform: translateY(110%); }
.js .hero-eyebrow, .js .hero-lead, .js .hero-actions, .js .hero-visual { opacity: 0; }
.is-loaded .line > span { transform: none; transition: transform 1.2s var(--ease); }
.is-loaded .line:nth-child(1) > span { transition-delay: 0.15s; }
.is-loaded .line:nth-child(2) > span { transition-delay: 0.25s; }
.is-loaded .line:nth-child(3) > span { transition-delay: 0.35s; }
.is-loaded .hero-eyebrow, .is-loaded .hero-lead, .is-loaded .hero-actions { opacity: 1; animation: reveal 1s var(--ease) backwards; }
.is-loaded .hero-lead { animation-delay: 0.55s; }
.is-loaded .hero-actions { animation-delay: 0.7s; }
.is-loaded .hero-visual { opacity: 1; animation: pop 1.4s var(--ease) 0.3s backwards; }

/* ---------- Marquee ---------- */
.marquee { overflow: hidden; padding: 30px 0; border-block: 1px solid var(--line); }
.marquee-track { display: flex; width: max-content; animation: marquee 40s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee span { display: inline-flex; align-items: center; gap: 20px; padding-right: 64px; font-family: var(--serif); font-size: clamp(1.5rem, 3vw, 2.5rem); white-space: nowrap; }
.marquee img { width: auto; height: 0.95em; }

/* ---------- Sections ---------- */
.section { padding: clamp(88px, 12vw, 160px) 0; }
.section-alt { background: var(--surface); }
.section-head { max-width: 720px; margin-bottom: clamp(48px, 7vw, 80px); }

/* ---------- Company cards ---------- */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.card {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; min-height: 420px; padding: clamp(28px, 4vw, 44px);
  border: 1px solid var(--line); border-radius: 24px; background: var(--surface);
  transition: color 0.5s var(--ease), border-color 0.5s, transform 0.6s var(--ease), box-shadow 0.6s var(--ease);
}
.card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--brand);
  clip-path: circle(0% at 76px 80px); transition: clip-path 0.8s var(--ease);
}
.card-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: auto; padding-bottom: 56px; }
.card-mark { width: 64px; transition: filter 0.5s, transform 0.7s var(--ease); }
.card-index { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-family: var(--serif); font-size: 0.95rem; transition: color 0.5s; }
.card-index::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); transition: background-color 0.5s; }
.card-title { margin-bottom: 14px; font-size: clamp(1.6rem, 2.4vw, 2.1rem); }
.card-title span {
  display: block; margin-bottom: 10px; color: var(--muted);
  font: 600 0.75rem/1 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; transition: color 0.5s;
}
.card p { max-width: 30rem; margin: 0 0 24px; color: var(--muted); transition: color 0.5s; }
.card-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.card-tags li { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 0.8rem; transition: border-color 0.5s; }
.card-email {
  display: flex; align-items: center; gap: 10px; margin-top: 24px; padding-top: 18px;
  border-top: 1px solid var(--line); font-size: 0.95rem; font-weight: 500; text-decoration: none;
  overflow-wrap: anywhere; transition: border-color 0.5s;
}
.card-email .arrow { transition: transform 0.35s var(--ease); }
.card-email:hover .arrow { transform: translateX(4px); }

@media (hover: hover) {
  .card:hover { color: #fff; border-color: transparent; transform: translateY(-6px); box-shadow: 0 36px 70px -36px var(--brand); }
  .card:hover::before { clip-path: circle(150% at 76px 80px); }
  .card:hover .card-mark { filter: brightness(0) invert(1); transform: scale(1.08); }
  .card:hover .card-index, .card:hover .card-title span { color: rgba(255, 255, 255, 0.7); }
  .card:hover .card-index::before { background: #fff; }
  .card:hover p { color: rgba(255, 255, 255, 0.85); }
  .card:hover .card-tags li, .card:hover .card-email { border-color: rgba(255, 255, 255, 0.35); }
  /* Light brand colors (Spaces orange) need dark text to stay readable. */
  .card-dark-text:hover { color: var(--ink); }
  .card-dark-text:hover .card-mark { filter: brightness(0); }
  .card-dark-text:hover .card-index, .card-dark-text:hover .card-title span, .card-dark-text:hover p { color: rgba(20, 20, 20, 0.85); }
  .card-dark-text:hover .card-index::before { background: var(--ink); }
  .card-dark-text:hover .card-tags li, .card-dark-text:hover .card-email { border-color: rgba(20, 20, 20, 0.35); }
}

/* ---------- Approach ---------- */
.approach { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(40px, 8vw, 120px); align-items: start; }
.approach-head { position: sticky; top: 120px; }
.principles { margin: 0; padding: 0; list-style: none; border-bottom: 1px solid var(--line); }
.principles li { position: relative; display: grid; grid-template-columns: 72px 1fr; gap: 16px; padding: 36px 0; }
.principles li::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--line);
  transform-origin: left; transition: transform 1.2s var(--ease) 0.1s;
}
.js .principles li:not(.is-visible)::before { transform: scaleX(0); }
.principle-num { padding-top: 6px; color: var(--muted); font-family: var(--serif); font-size: 0.95rem; }
.principles h3 { margin-bottom: 8px; font-size: clamp(1.4rem, 2vw, 1.75rem); }
.principles p { margin: 0; color: var(--muted); }

/* ---------- Contact ---------- */
.contact { position: relative; overflow: hidden; padding: clamp(104px, 14vw, 180px) 0; background: var(--dark); color: #fff; text-align: center; }
.contact::before {
  content: ""; position: absolute; inset: 0; background: var(--hex-light) 0 0 / 42px 72px;
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 50% 50%, #000 0%, transparent 70%);
  mask-image: radial-gradient(ellipse 60% 70% at 50% 50%, #000 0%, transparent 70%);
  animation: drift 24s linear infinite reverse;
}
.contact-inner { position: relative; }
.contact .eyebrow { color: rgba(255, 255, 255, 0.6); }
.contact .eyebrow::after { content: ""; width: 28px; height: 1px; background: currentColor; }
.contact h2 { max-width: 15ch; margin-inline: auto; font-size: clamp(2.4rem, 5.6vw, 4.6rem); }
.contact .section-lead { margin: 0 auto 40px; color: rgba(255, 255, 255, 0.7); }

/* ---------- Footer ---------- */
.footer { padding: 40px 0; border-top: 1px solid rgba(255, 255, 255, 0.1); background: var(--dark); color: rgba(255, 255, 255, 0.6); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }
.brand-light { color: #fff; }
.brand-light img { filter: brightness(0) invert(1); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0; padding: 0; list-style: none; font-size: 0.875rem; }
.footer-copy { margin: 0; font-size: 0.8rem; }

/* ---------- Scroll reveal ---------- */
.js [data-reveal] { opacity: 0; }
.js [data-reveal].is-visible { opacity: 1; animation: reveal 0.9s var(--ease) backwards; animation-delay: calc(var(--d, 0) * 110ms); }

/* ---------- Keyframes ---------- */
@keyframes reveal { from { opacity: 0; transform: translateY(28px); } }
@keyframes pop { from { opacity: 0; transform: scale(0.92) rotate(-6deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float { 50% { transform: translateY(-7px); } }
@keyframes pulse { to { transform: scale(3); opacity: 0; } }
@keyframes drift { to { background-position: 42px 72px; } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes splash-wave { 0%, 60%, 100% { opacity: 0.25; transform: none; } 25% { opacity: 1; transform: translateY(-6px); } }
@keyframes cue {
  0% { opacity: 0; transform: translateY(-4px); }
  40% { opacity: 1; }
  80%, 100% { opacity: 0; transform: translateY(12px); }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero { min-height: auto; padding-top: 120px; }
  .hero-inner, .approach { grid-template-columns: 1fr; }
  .hero-visual { justify-self: center; width: min(420px, 88%); }
  .approach-head { position: static; }
  .scroll-cue { display: none; }
}
@media (max-width: 720px) {
  .nav a:not(.btn) { display: none; }
  .cards { grid-template-columns: 1fr; }
  .card { min-height: 0; }
  .principles li { grid-template-columns: 48px 1fr; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 380px) {
  .brand { gap: 10px; }
  .brand img { width: 28px; }
  .brand-text b { font-size: 0.85rem; white-space: nowrap; }
  .btn-small { padding: 9px 14px; white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js [data-reveal], .js .hero-eyebrow, .js .hero-lead, .js .hero-actions, .js .hero-visual { opacity: 1; }
  .js .line > span { transform: none; }
}
