/* ==========================================================================
   Recursive Chaos Labs L.L.C. — design system
   Zero dependencies. Self-hosted type. No framework.
   ========================================================================== */

@font-face {
  font-family: 'Geist';
  src: url('/fonts/Geist-Variable.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-display: swap;
  font-style: normal;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('/fonts/GeistMono-Variable.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-display: swap;
  font-style: normal;
}

:root {
  /* --- the mark's own colour DNA ------------------------------------- */
  --void: #05060a;
  --deep: #090c13;
  --panel: #0e1220;
  --chrome: #c9cfd8;
  --chrome-hi: #f2f4f7;
  --chrome-dim: #7c8494;
  --blue: #2b5ce6;
  --blue-hi: #5c8bff;
  --violet: #7a3fe4;
  --violet-hi: #a77bff;

  /* --- clarity ------------------------------------------------------- */
  --paper: #f5f6f3;
  --paper-2: #ebece7;
  --ink: #0b0e14;
  --ink-2: #333a47;
  --ink-3: #5d6675;
  --rule-light: #d7d9d2;

  /* --- type ---------------------------------------------------------- */
  --font: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --t-xs: 0.78rem;
  --t-sm: 0.9rem;
  --t-base: 1.0625rem;
  --t-lg: 1.22rem;
  --t-xl: 1.5rem;
  --t-2xl: 2rem;
  --t-3xl: 2.75rem;

  /* --- space / motion ------------------------------------------------ */
  --maxw: 1180px;
  --prose: 64ch;
  --pad: clamp(1.25rem, 5vw, 2.5rem);
  --sect: clamp(5rem, 11vw, 9rem);
  --header-h: 74px;
  --radius: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--t-base);
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }

a { color: inherit; }

h1, h2, h3, h4 {
  font-weight: 560;
  letter-spacing: -0.032em;
  line-height: 1.06;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }

::selection { background: var(--blue); color: #fff; }

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

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--chrome-hi); color: var(--void);
  padding: 0.75rem 1.25rem; border-radius: 0 0 8px 0; font-weight: 600;
}
.skip:focus { left: 0; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad); }
.prose { max-width: var(--prose); }

/* ---------------------------------------------------------------- eyebrow */
.eyebrow {
  font-family: var(--mono);
  font-size: var(--t-xs);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);          /* light sections are the common case */
  margin: 0 0 1.1rem;
}
.hero .eyebrow, .dark .eyebrow, .footer .eyebrow { color: #9aa3b1; }

/* ------------------------------------------------------------- chrome rule */
.rule {
  height: 1px; border: 0; margin: 0;
  background: linear-gradient(90deg, transparent, var(--rule-light) 18%, var(--rule-light) 82%, transparent);
}
.dark .rule {
  background: linear-gradient(90deg, transparent, rgba(201,207,216,0.28) 18%, rgba(201,207,216,0.28) 82%, transparent);
}

/* =========================================================== HEADER / NAV */
.masthead {
  position: relative; z-index: 100;
  background: var(--void);
}
.masthead-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  height: var(--header-h);
}
.brandmark { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; }
.brandmark img { width: 30px; height: auto; }
.brandmark span {
  font-family: var(--mono); font-size: 0.74rem; font-weight: 500;
  letter-spacing: 0.19em; text-transform: uppercase; color: var(--chrome);
  transition: color 0.35s var(--ease);
  white-space: nowrap;
}
.nav { display: flex; align-items: center; gap: clamp(1rem, 2.5vw, 2rem); }
.nav a {
  text-decoration: none; font-size: var(--t-sm); font-weight: 460;
  color: rgba(201, 207, 216, 0.82);
  transition: color 0.2s var(--ease);
  position: relative; padding-block: 0.3rem;
}
.nav a:hover { color: var(--chrome-hi); }
.nav a[aria-current='page']::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg, var(--blue-hi), var(--violet-hi));
}

/* narrow viewports: the mark alone carries the brand, nav gets the room */
@media (max-width: 640px) {
  :root { --header-h: 62px; }
  .masthead-inner { height: 62px; }
  .brandmark span { display: none; }
  .brandmark img { width: 27px; }
  .nav { gap: 1.15rem; }
  .nav a { font-size: 0.86rem; }
}



/* ==================================================================== HERO */
.hero {
  position: relative;
  background: var(--void);
  color: var(--chrome);
  isolation: isolate;
  overflow: hidden;
}
.hero-field {
  position: absolute; inset: 0; z-index: -3; pointer-events: none;
  background:
    radial-gradient(70% 55% at 50% 34%, rgba(43, 92, 230, 0.20), transparent 68%),
    radial-gradient(48% 42% at 72% 66%, rgba(122, 63, 228, 0.17), transparent 70%),
    radial-gradient(90% 70% at 50% 100%, rgba(5, 6, 10, 0.9), transparent 60%),
    var(--void);
}
.hero-grain {
  position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0.5;
  background-image: radial-gradient(rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 3px 3px;
  mask-image: radial-gradient(75% 60% at 50% 40%, #000, transparent 78%);
}

/* --- home hero: mark occupies the upper field, type sits below it --- */
.hero-home {
  min-height: calc(100svh - var(--header-h));
  display: grid; align-items: end;
  padding-block: 3rem 6.5rem;
}
.hero-stage { position: absolute; inset: 0; z-index: -2; }
#mark-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-fallback {
  position: absolute; left: 50%; top: 31%; transform: translate(-50%, -50%);
  width: min(46vw, 330px); height: auto;
  filter: drop-shadow(0 24px 70px rgba(43, 92, 230, 0.42));
}
.hero-stage[data-webgl='on'] .hero-fallback { display: none; }

/* keeps the headline legible over a live particle field */
.hero-scrim {
  position: absolute; inset: auto 0 0 0; height: 66%; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(5, 6, 10, 0.55) 34%, rgba(5, 6, 10, 0.88) 62%, var(--void) 92%);
}
.hero-cap {
  position: absolute; inset: 0 0 auto 0; height: 150px; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgba(5, 6, 10, 0.72), transparent);
}

.hero-home .container { position: relative; text-align: center; }
.hero-title {
  font-size: clamp(2.9rem, 9.2vw, 6.4rem);
  font-weight: 540;
  letter-spacing: -0.045em;
  line-height: 0.96;
  color: var(--chrome-hi);
}
.hero-title .lo { color: var(--chrome-dim); }
.hero-sub {
  margin: 1.75rem auto 0; max-width: 44ch;
  font-size: clamp(1.02rem, 1.9vw, var(--t-lg));
  color: rgba(201, 207, 216, 0.78);
  line-height: 1.6;
}
.hero-cta { display: flex; gap: 0.85rem; justify-content: center; flex-wrap: wrap; margin-top: 2.5rem; }

/* --- inner page hero band --- */
.hero-band { padding-block: 5rem 4.5rem; }
.hero-band h1 { font-size: clamp(2.3rem, 6.4vw, 4rem); color: var(--chrome-hi); }
.hero-band .lede {
  margin-top: 1.4rem; max-width: 56ch;
  font-size: clamp(1rem, 1.6vw, var(--t-lg));
  color: rgba(201, 207, 216, 0.76);
}

/* The seam where dark meets light: a single lit edge, not a fade.
   The mark's own blue/violet runs along it. */
.seam, .seam-tint {
  position: relative; height: 0;
  border-top: 1px solid transparent;
  background-image: linear-gradient(90deg, transparent, var(--blue) 22%, var(--violet) 78%, transparent);
  background-repeat: no-repeat;
  background-size: 100% 1px;
  background-position: 0 0;
}
/* the light spills upward into the dark, never down onto the paper */
.seam::after, .seam-tint::after {
  content: ''; position: absolute; left: 0; right: 0; top: -170px; height: 170px;
  background: radial-gradient(58% 100% at 50% 100%, rgba(76, 124, 255, 0.15), transparent 70%);
  pointer-events: none;
}

/* ================================================================= BUTTONS */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.78rem 1.4rem; border-radius: 999px;
  font-size: var(--t-sm); font-weight: 520; letter-spacing: -0.005em;
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
  transition: transform 0.2s var(--ease), background-color 0.2s var(--ease),
              border-color 0.2s var(--ease), color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background-color: #e5e9ee;
  background-image: linear-gradient(180deg, var(--chrome-hi), #d8dde4);
  color: var(--void);
  box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset, 0 10px 30px rgba(0,0,0,0.35);
}
.btn-primary:hover { background-color: #fff; background-image: none; }
.btn-ghost {
  border-color: rgba(201, 207, 216, 0.3); color: var(--chrome);
}
.btn-ghost:hover { border-color: rgba(201,207,216,0.65); background: rgba(201,207,216,0.06); }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: #1d2230; }
.btn-outline-ink { border-color: var(--rule-light); color: var(--ink); }
.btn-outline-ink:hover { border-color: var(--ink-3); background: #fff; }

.arrow { transition: transform 0.2s var(--ease); }
.btn:hover .arrow, .card:hover .arrow { transform: translateX(3px); }

/* ================================================================ SECTIONS */
.section { padding-block: var(--sect); }
.section.dark { background: var(--void); color: var(--chrome); }
/* a dark section running straight into the dark footer needs no second gap */
.section.flush-bottom { padding-bottom: clamp(2.5rem, 5vw, 4rem); }
.section.tint { background: var(--paper-2); }
.section h2 { font-size: clamp(1.9rem, 5vw, var(--t-3xl)); }
.section .lede { font-size: var(--t-lg); color: var(--ink-2); margin-top: 1.25rem; line-height: 1.6; }
.section.dark .lede { color: rgba(201,207,216,0.78); }

/* statement block */
.statement { max-width: 22ch; font-size: clamp(2rem, 6vw, 3.4rem); letter-spacing: -0.04em; line-height: 1.04; }
.statement em { font-style: normal; color: var(--blue); }
.dark .statement em { color: var(--blue-hi); }

/* two column split */
.split { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

/* ============================================================== PRINCIPLES */
.principles { list-style: none; margin: 3.5rem 0 0; padding: 0; display: grid; gap: 0; }
.principle {
  display: grid; grid-template-columns: 5.5rem minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(1rem, 3vw, 2.5rem);
  padding-block: 2.25rem;
  border-top: 1px solid var(--rule-light);
  align-items: start;
}
.principle:last-child { border-bottom: 1px solid var(--rule-light); }
.principle .n {
  font-family: var(--mono); font-size: var(--t-xs); letter-spacing: 0.14em;
  color: var(--blue); padding-top: 0.42rem;
}
.principle h3 { font-size: clamp(1.15rem, 2.2vw, 1.45rem); letter-spacing: -0.025em; }
.principle p { color: var(--ink-3); font-size: var(--t-sm); line-height: 1.68; }
@media (max-width: 800px) {
  .principle { grid-template-columns: 3rem minmax(0,1fr); }
  .principle p { grid-column: 2; }
}

/* ==================================================================== CARDS */
.cards { list-style: none; margin: 3.25rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1.1rem; }
@media (max-width: 820px) { .cards { grid-template-columns: 1fr; } }

.card {
  position: relative; display: flex; flex-direction: column; gap: 0.9rem;
  background: #fff; border: 1px solid var(--rule-light); border-radius: var(--radius);
  padding: clamp(1.4rem, 3vw, 2rem); text-decoration: none;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
  overflow: hidden;
}
.card::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, var(--blue), var(--violet));
  opacity: 0; transition: opacity 0.25s var(--ease);
}
.card:hover { border-color: #c2c6be; transform: translateY(-3px); box-shadow: 0 18px 40px -24px rgba(11,14,20,0.4); }
.card:hover::before { opacity: 1; }
.card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.card h3 { font-size: var(--t-xl); letter-spacing: -0.03em; }
.card p { color: var(--ink-3); font-size: var(--t-sm); line-height: 1.66; }
.card-foot {
  margin-top: auto; padding-top: 0.4rem;
  font-family: var(--mono); font-size: var(--t-xs); letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--blue);
  display: inline-flex; align-items: center; gap: 0.4rem;
}

.tag {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.11em; text-transform: uppercase;
  color: var(--ink-3); white-space: nowrap;
  border: 1px solid var(--rule-light); border-radius: 999px; padding: 0.22rem 0.6rem;
  background: var(--paper-2);
}
.tag-licensed { color: var(--violet); border-color: color-mix(in srgb, var(--violet) 30%, var(--rule-light)); }

/* =============================================================== FACT LIST */
.facts { margin: 2.5rem 0 0; padding: 0; }
.facts div {
  display: grid; grid-template-columns: minmax(9rem, 14rem) minmax(0, 1fr); gap: 1rem;
  padding-block: 0.85rem; border-top: 1px solid var(--rule-light);
}
.facts div:last-child { border-bottom: 1px solid var(--rule-light); }
.facts dt { font-family: var(--mono); font-size: var(--t-xs); letter-spacing: 0.11em; text-transform: uppercase; color: var(--ink-3); padding-top: 0.15rem; }
.facts dd { margin: 0; font-size: var(--t-sm); color: var(--ink); }
@media (max-width: 620px) { .facts div { grid-template-columns: 1fr; gap: 0.2rem; } }

/* ================================================================= CONTACT */
.contact-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1.1rem; margin-top: 3rem; }
@media (max-width: 760px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-card {
  background: #fff; border: 1px solid var(--rule-light); border-radius: var(--radius);
  padding: clamp(1.4rem, 3vw, 2rem);
}
.contact-card h3 { font-size: var(--t-lg); margin-bottom: 0.5rem; }
.contact-card p { color: var(--ink-3); font-size: var(--t-sm); margin-bottom: 1rem; }
.contact-card a.mail {
  font-family: var(--mono); font-size: var(--t-sm); letter-spacing: -0.01em;
  color: var(--blue); text-decoration: none; word-break: break-all;
  border-bottom: 1px solid color-mix(in srgb, var(--blue) 35%, transparent);
}
.contact-card a.mail:hover { border-bottom-color: var(--blue); }

address { font-style: normal; }

/* ============================================================= LEGAL PAGES */
.legal { padding-block: var(--sect); }
.legal h2 { font-size: var(--t-xl); margin-top: 3rem; letter-spacing: -0.025em; }
.legal h2:first-of-type { margin-top: 0; }
.legal p, .legal li { color: var(--ink-2); font-size: var(--t-base); margin-top: 1rem; }
.legal ul { padding-left: 1.15rem; }
.legal .meta { font-family: var(--mono); font-size: var(--t-xs); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }

/* ================================================================== FOOTER */
.footer { background: var(--void); color: var(--chrome-dim); padding-block: clamp(2.5rem, 5vw, 3.5rem) 2.5rem; }
.footer-top { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)); gap: 2.5rem; }
@media (max-width: 780px) { .footer-top { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
.footer-brand img { width: 34px; margin-bottom: 1rem; }
.footer-brand p { font-size: var(--t-sm); color: rgba(201,207,216,0.62); max-width: 34ch; line-height: 1.6; }
.footer h4 {
  font-family: var(--mono); font-size: var(--t-xs); letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(201,207,216,0.68); font-weight: 500; margin-bottom: 1rem;
}
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; }
.footer a { color: rgba(201,207,216,0.78); text-decoration: none; font-size: var(--t-sm); }
.footer a:hover { color: var(--chrome-hi); }
.footer-legal {
  margin-top: clamp(2.5rem, 6vw, 4rem); padding-top: 1.75rem;
  border-top: 1px solid rgba(201,207,216,0.14);
  display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
  font-size: var(--t-xs); color: rgba(201,207,216,0.72); line-height: 1.7;
}
.footer-legal .entity { color: rgba(201,207,216,0.9); }

/* ============================================================ SCROLL REVEAL */
/* Reveals are opt-in and JS-gated: with no JS, or if the script fails, the
   content is simply visible. Never hide content behind a script. */
.reveal-ready [data-reveal] {
  opacity: 0; transform: translateY(18px);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
}
.reveal-ready [data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}

/* ================================================================ SCROLL CUE */
.cue { position: absolute; left: 50%; bottom: 2rem; transform: translateX(-50%); }
.cue span {
  display: block; width: 22px; height: 36px; border-radius: 12px;
  border: 1px solid rgba(201,207,216,0.4); position: relative;
}
.cue span::after {
  content: ''; position: absolute; top: 7px; left: 50%; width: 3px; height: 7px;
  border-radius: 2px; background: var(--chrome); transform: translateX(-50%);
  animation: cue 2s var(--ease) infinite;
}
@keyframes cue {
  0% { opacity: 0; transform: translate(-50%, 0); }
  35% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, 13px); }
}
