/* ============================================================
   THiNGK TaNGK — flagship
   Palette derived from the logo: ochre/gold, obsidian, chalk.
   Dark default / cinematic. Light theme available.
   ============================================================ */

:root {
  /* Type scale (fluid) */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.8125rem);
  --text-sm: clamp(0.875rem, 0.82rem + 0.25vw, 0.9375rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.0625rem);
  --text-lg: clamp(1.125rem, 1rem + 0.6vw, 1.375rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.3rem + 2.6vw, 3.5rem);
  --text-3xl: clamp(2.5rem, 1rem + 5vw, 5.25rem);
  --text-hero: clamp(2.9rem, 1rem + 8.4vw, 8.5rem);

  /* Spacing */
  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem; --space-4: 1rem;
  --space-5: 1.25rem; --space-6: 1.5rem; --space-8: 2rem; --space-10: 2.5rem;
  --space-12: 3rem; --space-16: 4rem; --space-20: 5rem; --space-24: 6rem; --space-32: 8rem;

  --radius-sm: 0.375rem; --radius-md: 0.625rem; --radius-lg: 1rem; --radius-full: 9999px;

  --content-narrow: 720px;
  --content-default: 1020px;
  --content-wide: 1240px;

  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --font-display: 'Cabinet Grotesk', 'Arial Black', sans-serif;
  --font-body: 'Satoshi', 'Helvetica Neue', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

/* ---- DARK (default, cinematic) ---- */
:root, [data-theme="dark"] {
  --obsidian: #0B0A08;
  --ochre: #E8A93B;
  --ochre-deep: #C6862A;
  --chalk: #F4F1E8;

  --color-bg: #0B0A08;
  --color-bg-2: #100E0B;
  --color-surface: #16130E;
  --color-surface-2: #1D1913;
  --color-border: #2A251C;
  --color-border-strong: #3A3226;

  --color-text: #EDE9DE;
  --color-text-muted: #A39C8A;
  --color-text-faint: #6E6754;

  --accent: #E8A93B;
  --accent-hover: #F3BB55;
  --accent-soft: rgba(232, 169, 59, 0.14);

  --line: rgba(232, 169, 59, 0.28);
  --scrim-top: rgba(11, 10, 8, 0.72);
  --scrim-bottom: rgba(11, 10, 8, 0.96);

  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
  --on-accent: #120E06;
}

/* ---- LIGHT (chalk / stone) ---- */
[data-theme="light"] {
  --obsidian: #1A1710;
  --ochre: #B5811F;
  --ochre-deep: #93671A;
  --chalk: #FBF9F2;

  --color-bg: #F4F1E7;
  --color-bg-2: #EEEADD;
  --color-surface: #FBF9F2;
  --color-surface-2: #F2EEE1;
  --color-border: #DED8C6;
  --color-border-strong: #C9C1AB;

  --color-text: #211D14;
  --color-text-muted: #6A6350;
  --color-text-faint: #9B9480;

  --accent: #A9731A;
  --accent-hover: #8C5F13;
  --accent-soft: rgba(169, 115, 26, 0.12);

  --line: rgba(169, 115, 26, 0.32);
  --scrim-top: rgba(20, 18, 12, 0.35);
  --scrim-bottom: rgba(20, 18, 12, 0.72);

  --shadow-lg: 0 20px 48px rgba(60, 50, 25, 0.16);
  --on-accent: #FBF9F2;
}

/* ============ BASE ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.62;
  color: var(--color-text);
  background: var(--color-bg);
  overflow-x: hidden;
}

.scroll-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 220;
  height: 2px;
  pointer-events: none;
}
.scroll-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
}

img, svg, picture { display: block; max-width: 100%; height: auto; }
ul[role="list"], ol[role="list"] { list-style: none; }
button { cursor: pointer; background: none; border: none; color: inherit; font: inherit; }
a { color: inherit; text-decoration: none; }

h1, h2, h3 { line-height: 1.05; text-wrap: balance; font-family: var(--font-display); font-weight: 900; letter-spacing: -0.02em; }
p { text-wrap: pretty; }

::selection { background: var(--accent-soft); color: var(--color-text); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--accent); color: var(--on-accent);
  padding: var(--space-3) var(--space-5); border-radius: 0 0 var(--radius-md) 0;
  font-weight: 700;
}
.skip-link:focus { left: 0; }

.wrap { width: min(100% - 2.5rem, var(--content-wide)); margin-inline: auto; }

.mono { font-family: var(--font-mono); letter-spacing: 0.02em; }

.kicker {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-6);
}

.h-display {
  font-size: var(--text-2xl);
  line-height: 1.02;
  margin-bottom: var(--space-6);
}

.lede {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 60ch;
  line-height: 1.55;
}
.lede strong, .lede em { color: var(--color-text); font-style: normal; font-weight: 700; }

.section { padding-block: clamp(var(--space-20), 11vw, var(--space-32)); position: relative; }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex; align-items: center; gap: var(--space-2);
  min-height: 48px; padding: 0 var(--space-6);
  font-weight: 700; font-size: var(--text-sm);
  border-radius: var(--radius-full);
  transition: transform var(--transition-interactive),
              background var(--transition-interactive),
              color var(--transition-interactive),
              border-color var(--transition-interactive);
  border: 1px solid transparent;
}
.btn--lg { min-height: 56px; padding: 0 var(--space-8); font-size: var(--text-base); }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-hover); transform: translateY(-2px); }
.btn--primary:active { transform: translateY(0); }
.btn--ghost { color: var(--color-text); border-color: var(--color-border-strong); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.btn--ghost:active { transform: translateY(0); }

.icon-btn {
  width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: var(--radius-full); color: var(--color-text-muted);
  transition: color var(--transition-interactive), background var(--transition-interactive);
}
.icon-btn:hover { color: var(--accent); background: var(--accent-soft); }

/* ============ NAV ============ */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  transition: background var(--transition-interactive), border-color var(--transition-interactive), backdrop-filter var(--transition-interactive);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: color-mix(in oklab, var(--color-bg) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--color-border);
}
.nav__inner {
  width: min(100% - 2.5rem, var(--content-wide)); margin-inline: auto;
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  height: 72px;
}
.brand { display: inline-flex; align-items: center; gap: var(--space-3); color: var(--chalk); }
[data-theme="light"] .nav.is-scrolled .brand,
[data-theme="light"] .brand--footer { color: var(--obsidian); }
.brand__mark { width: 34px; height: 27px; }
.brand__word { font-family: var(--font-display); font-weight: 800; font-size: var(--text-base); letter-spacing: -0.01em; }

.nav__links { display: none; gap: var(--space-6); }
.nav__links a {
  font-size: var(--text-sm); color: var(--color-text-muted); font-weight: 500;
  position: relative; display: inline-flex; align-items: center; min-height: 44px;
  transition: color var(--transition-interactive);
}
.nav__links a:hover { color: var(--color-text); }
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: 8px; height: 1.5px; width: 0;
  background: var(--accent); transition: width var(--transition-interactive);
}
.nav__links a:hover::after { width: 100%; }

/* The transparent nav sits over a dark photograph in both themes. Keep its
   controls legible until the light-theme surface appears after scrolling. */
[data-theme="light"] .nav:not(.is-scrolled) .nav__links a,
[data-theme="light"] .nav:not(.is-scrolled) .icon-btn { color: rgba(244, 241, 232, 0.78); }
[data-theme="light"] .nav:not(.is-scrolled) .nav__links a:hover,
[data-theme="light"] .nav:not(.is-scrolled) .icon-btn:hover { color: var(--chalk); }

/* Hero controls always sit on cinematic media, independent of page theme. */
.hero .btn--ghost {
  color: var(--chalk);
  border-color: rgba(244, 241, 232, 0.62);
  background: rgba(11, 10, 8, 0.18);
}
.hero .btn--ghost:hover {
  color: var(--chalk);
  border-color: var(--chalk);
  background: rgba(11, 10, 8, 0.42);
}

.nav__actions { display: flex; align-items: center; gap: var(--space-2); }
.nav__cta { display: none; }
.nav__menu { display: grid; }

.mobile-menu[hidden] { display: none; }
.mobile-menu {
  display: flex; flex-direction: column; gap: var(--space-1);
  padding: var(--space-4) var(--space-5) var(--space-8);
  background: color-mix(in oklab, var(--color-bg) 94%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-border);
}
.mobile-menu a { padding: var(--space-3) 0; color: var(--color-text-muted); font-weight: 600; font-size: var(--text-lg); border-bottom: 1px solid var(--color-border); }
.mobile-menu a:hover { color: var(--accent); }
.mobile-menu .btn {
  margin-top: var(--space-4);
  justify-content: center;
  border-bottom: none;
  color: var(--on-accent);
}
.mobile-menu .btn:hover { color: var(--on-accent); }

/* ============ HERO ============ */
.hero {
  position: relative; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: var(--space-24) 0 var(--space-16);
  overflow: hidden; isolation: isolate;
  background: #090806;
}
.hero__media { position: absolute; inset: 0; z-index: 0; }
.hero__media img {
  width: 100%; height: 100%; object-fit: cover; object-position: center 42%;
  filter: saturate(0.76) contrast(1.08) brightness(0.84);
  transform: scale(var(--hero-scale, 1.085)) translate3d(var(--hero-x, 0), calc(var(--hero-y, 0px) + var(--hero-scroll-y, 0px)), 0);
  transition: transform 1000ms var(--ease-out), filter 1200ms var(--ease-out);
  will-change: transform;
}
.hero.is-ready .hero__media img {
  --hero-scale: 1.045;
  filter: saturate(0.9) contrast(1.04) brightness(0.94);
}
.hero__field {
  position: absolute; inset: 0; z-index: 1;
  width: 100%; height: 100%; max-width: none;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity 1800ms var(--ease-out);
}
.hero.is-ready .hero__field { opacity: 0.86; }
.hero__aperture {
  position: absolute; inset: -35% -20%; z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(104deg, transparent 38%, rgba(232,169,59,0.04) 45%, rgba(244,241,232,0.13) 49%, rgba(232,169,59,0.03) 54%, transparent 61%);
  transform: translateX(-45%);
  opacity: 0;
}
.hero.is-ready .hero__aperture {
  opacity: 1;
  animation: hero-aperture 9s 1.2s cubic-bezier(0.4,0,0.2,1) infinite;
}
.hero__scrim {
  position: absolute; inset: 0; z-index: 3;
  background:
    linear-gradient(to bottom, rgba(11,10,8,0.76) 0%, transparent 24%, transparent 43%, rgba(11,10,8,0.96) 96%),
    linear-gradient(90deg, rgba(11,10,8,0.96) 0%, rgba(11,10,8,0.65) 35%, transparent 72%),
    radial-gradient(circle at 68% 38%, transparent 0%, rgba(11,10,8,0.12) 42%, rgba(11,10,8,0.5) 100%);
}
.hero__grain {
  position: absolute; inset: 0; z-index: 4; opacity: 0.42; mix-blend-mode: overlay; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}
.hero__frame {
  position: absolute; z-index: 1; inset: 82px var(--space-5) var(--space-5);
  pointer-events: none; opacity: 0;
  transition: opacity 1400ms 600ms var(--ease-out);
}
.hero.is-ready .hero__frame { opacity: 0.62; }
.hero__corner {
  position: absolute; width: 34px; height: 34px;
  border-color: rgba(244,241,232,0.52); border-style: solid;
}
.hero__corner--tl { top: 0; left: 0; border-width: 1px 0 0 1px; }
.hero__corner--tr { top: 0; right: 0; border-width: 1px 1px 0 0; }
.hero__corner--bl { bottom: 0; left: 0; border-width: 0 0 1px 1px; }
.hero__corner--br { bottom: 0; right: 0; border-width: 0 1px 1px 0; }
.hero__content {
  position: relative; z-index: 2;
  width: min(100% - 2.5rem, var(--content-wide)); margin-inline: auto;
  will-change: transform, opacity;
}
.hero__signal {
  display: none; align-items: center; gap: var(--space-3);
  position: absolute; left: 0; top: calc(var(--space-10) * -1);
  width: min(440px, 38vw);
  color: rgba(244,241,232,0.45);
  font-size: var(--text-xs); letter-spacing: 0.11em;
  opacity: 0; clip-path: inset(0 100% 0 0);
  transition: opacity 700ms 150ms var(--ease-out), clip-path 1200ms 150ms var(--ease-out);
}
.hero.is-ready .hero__signal { opacity: 1; clip-path: inset(0); }
.hero__signal-line {
  height: 1px; flex: 1; position: relative;
  background: rgba(244,241,232,0.22);
}
.hero__signal-line::after {
  content: ""; position: absolute; top: -2px; left: 0;
  width: 5px; height: 5px; border-radius: 50%; background: var(--ochre);
  box-shadow: 0 0 16px rgba(232,169,59,0.9);
  animation: signal-travel 4s 2s linear infinite;
}
.hero__eyebrow {
  display: flex; align-items: center; gap: var(--space-2);
  font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ochre); margin-bottom: var(--space-6);
  opacity: 0; clip-path: inset(0 100% 0 0);
  transition: opacity 700ms 350ms var(--ease-out), clip-path 1000ms 350ms var(--ease-out);
}
.hero.is-ready .hero__eyebrow { opacity: 1; clip-path: inset(0); }
.hero__eyebrow .tick { color: var(--chalk); margin-right: var(--space-1); }
[data-theme="light"] .hero__eyebrow .tick { color: var(--chalk); }
.hero__title {
  color: var(--chalk);
  font-size: var(--text-hero);
  letter-spacing: -0.045em;
  margin-bottom: var(--space-8);
  text-shadow: 0 2px 40px rgba(0,0,0,0.5);
}
.hero__line {
  display: block; overflow: hidden; line-height: 0.87;
  padding-bottom: 0.075em; margin-bottom: -0.015em;
}
.hero__line > span {
  display: block;
  transform: translateY(112%) skewY(3deg);
  transform-origin: left bottom;
  filter: blur(8px);
  transition: transform 1100ms var(--line-delay, 500ms) var(--ease-out), filter 900ms var(--line-delay, 500ms) var(--ease-out);
}
.hero__line:nth-child(2) > span { --line-delay: 590ms; }
.hero__line:nth-child(3) > span { --line-delay: 680ms; }
.hero__line:nth-child(4) > span { --line-delay: 770ms; }
.hero.is-ready .hero__line > span { transform: translateY(0) skewY(0); filter: blur(0); }
.hero__title-accent { color: var(--ochre); }
.hero__lede {
  color: rgba(244, 241, 232, 0.86); font-size: var(--text-lg);
  max-width: 46ch; margin-bottom: var(--space-10); line-height: 1.5;
  opacity: 0; clip-path: inset(0 0 100%);
  transition: opacity 800ms 1050ms var(--ease-out), clip-path 1000ms 1050ms var(--ease-out);
}
.hero.is-ready .hero__lede { opacity: 1; clip-path: inset(0); }
[data-theme="light"] .hero__lede { color: rgba(244,241,232,0.94); }
.hero__actions {
  display: flex; flex-wrap: wrap; gap: var(--space-4);
  opacity: 0; clip-path: inset(0 100% 0 0);
  transition: opacity 700ms 1220ms var(--ease-out), clip-path 900ms 1220ms var(--ease-out);
}
.hero.is-ready .hero__actions { opacity: 1; clip-path: inset(0); }

.hero__telemetry {
  position: absolute; z-index: 2; right: max(var(--space-5), calc((100vw - var(--content-wide)) / 2));
  top: 50%; display: none; flex-direction: column; align-items: flex-end; gap: var(--space-3);
  color: rgba(244,241,232,0.46); font-size: var(--text-xs); letter-spacing: 0.13em;
  opacity: 0; transform: translateY(-45%);
  transition: opacity 1000ms 1200ms var(--ease-out), transform 1000ms 1200ms var(--ease-out);
}
.hero.is-ready .hero__telemetry { opacity: 1; transform: translateY(-50%); }
.hero__telemetry span { display: flex; align-items: center; gap: var(--space-3); }
.hero__telemetry span::after {
  content: ""; width: 24px; height: 1px; background: rgba(244,241,232,0.22);
}
.hero__telemetry b { color: var(--ochre); font-weight: 500; }
.hero__telemetry span:nth-child(2) { color: rgba(244,241,232,0.78); }
.hero__telemetry span:nth-child(2)::after { width: 52px; background: var(--ochre); }

.hero__scroll {
  position: absolute; right: max(1.25rem, calc((100vw - var(--content-wide)) / 2)); bottom: var(--space-8);
  z-index: 2; display: none; align-items: center; gap: var(--space-2);
  font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.2em;
  text-transform: uppercase; color: rgba(244,241,232,0.7);
}
.hero__scroll span {
  width: 1px; height: 40px; background: linear-gradient(var(--ochre), transparent);
  display: inline-block; transform-origin: top;
  animation: scrollpulse 2.4s var(--ease-out) infinite;
}
@keyframes scrollpulse { 0%,100% { transform: scaleY(0.4); opacity: 0.4; } 50% { transform: scaleY(1); opacity: 1; } }
@keyframes signal-travel { from { transform: translateX(0); } to { transform: translateX(min(180px, 16vw)); } }
@keyframes hero-aperture {
  0%, 14% { transform: translateX(-45%); opacity: 0; }
  26%, 58% { opacity: 0.82; }
  72%, 100% { transform: translateX(48%); opacity: 0; }
}

/* ============ MARQUEE ============ */
.marquee {
  border-block: 1px solid var(--color-border);
  background: var(--color-bg-2);
  overflow: hidden; padding-block: var(--space-4);
}
.marquee__track {
  display: flex; align-items: center; gap: var(--space-8); width: max-content;
  animation: marquee 34s linear infinite;
  font-family: var(--font-display); font-weight: 800; font-size: var(--text-lg);
  letter-spacing: -0.01em; color: var(--color-text-muted); white-space: nowrap;
}
.marquee__dot { color: var(--accent); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ============ DEFINITION ============ */
.definition { text-align: center; background: var(--color-bg); }
.definition .wrap { max-width: var(--content-default); }
.definition__word {
  font-size: var(--text-3xl); letter-spacing: -0.03em; color: var(--color-text);
  margin-bottom: var(--space-4);
}
.definition__word .slash { color: var(--accent); }
.definition__pos { color: var(--color-text-muted); font-size: var(--text-sm); margin-bottom: var(--space-8); }
.definition__body {
  font-family: var(--font-display); font-weight: 700; letter-spacing: -0.015em;
  font-size: var(--text-xl); line-height: 1.28; color: var(--color-text);
  max-width: 24ch; margin: 0 auto var(--space-8); text-wrap: balance;
}
.definition__body em { color: var(--accent); font-style: normal; }
.definition__foot { color: var(--color-text-muted); max-width: 56ch; margin: 0 auto; font-size: var(--text-base); }

/* ============ OBSERVE ============ */
.observe { background: var(--color-bg-2); border-block: 1px solid var(--color-border); }
.observe__head { max-width: var(--content-default); margin-bottom: var(--space-16); }
.observe__head .h-display { color: var(--color-text); }
.errors { display: grid; gap: var(--space-5); grid-template-columns: 1fr; }
.error-card {
  padding: var(--space-8);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  position: relative; overflow: hidden;
}
.error-card__idx { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--accent); display: block; margin-bottom: var(--space-4); }
.error-card h3 { font-size: var(--text-lg); font-family: var(--font-display); font-weight: 800; margin-bottom: var(--space-3); color: var(--color-text); }
.error-card p { color: var(--color-text-muted); font-size: var(--text-base); max-width: 46ch; }

/* ============ HUMANOS ============ */
.humanos { background: var(--color-bg); }
.humanos__grid {
  display: grid; grid-template-columns: 1fr; gap: var(--space-12);
  align-items: center; margin-bottom: var(--space-16);
}
.humanos__intro .h-display { font-size: var(--text-3xl); color: var(--color-text); }
.humanos__note { color: var(--accent); font-size: var(--text-sm); margin-top: var(--space-6); }
.humanos__figure {
  margin: 0; border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--color-border); background: var(--color-surface);
  transform-style: preserve-3d;
  transition: transform 500ms var(--ease-out), border-color var(--transition-interactive);
}
.humanos__figure img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.humanos__figure figcaption { padding: var(--space-4) var(--space-5); font-size: var(--text-sm); color: var(--color-text-muted); font-style: italic; }

.principles { display: grid; grid-template-columns: 1fr; gap: 0; border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden; }
.principle { padding: var(--space-8); border-bottom: 1px solid var(--color-border); background: var(--color-surface); transition: background var(--transition-interactive); }
.principle:last-child { border-bottom: none; }
.principle:hover { background: var(--color-surface-2); }
.principle h3 { font-size: var(--text-lg); font-family: var(--font-display); font-weight: 800; margin-bottom: var(--space-3); color: var(--color-text); }
.principle h3::before { content: "/ "; color: var(--accent); }
.principle p { color: var(--color-text-muted); font-size: var(--text-base); max-width: 52ch; }

/* ============ LATTICE ============ */
.lattice { background: var(--color-bg-2); border-block: 1px solid var(--color-border); }
.lattice__head { max-width: var(--content-default); margin-bottom: var(--space-12); }
.lattice__head .h-display { color: var(--color-text); }
.lattice__stage { display: grid; grid-template-columns: 1fr; gap: var(--space-8); align-items: center; }
.lattice__canvas-wrap {
  border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 90% at 50% 10%, var(--accent-soft), transparent 60%),
    var(--color-surface);
  padding: var(--space-4);
  overflow: hidden;
}
.lattice__svg { width: 100%; height: auto; touch-action: manipulation; }

/* nodes & links styling controlled here; JS toggles .is-active */
.lattice__nodes .node-hit { fill: transparent; cursor: pointer; }
.lattice__nodes .node-dot {
  fill: var(--color-surface-2); stroke: var(--color-border-strong); stroke-width: 1.4;
  transition: fill var(--transition-interactive), stroke var(--transition-interactive), r var(--transition-interactive);
}
.lattice__nodes .node-label {
  font-family: var(--font-mono); font-size: 11px; fill: var(--color-text-faint);
  transition: fill var(--transition-interactive);
}
.lattice__links line { transition: stroke var(--transition-interactive), stroke-opacity var(--transition-interactive); stroke-opacity: 0.25; }

.lattice__svg .node.is-active .node-dot { fill: var(--accent); stroke: var(--accent); r: 9; }
.lattice__svg .node.is-active .node-label { fill: var(--color-text); }
.lattice__svg .node.is-dim .node-dot { stroke: var(--color-border); }
.lattice__svg line.is-active { stroke: var(--accent); stroke-opacity: 0.9; }

.lattice__phases { display: grid; gap: var(--space-3); }
.phase {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto;
  column-gap: var(--space-4); align-items: baseline; text-align: left;
  padding: var(--space-5) var(--space-6);
  border: 1px solid var(--color-border); border-radius: var(--radius-md);
  background: var(--color-surface);
  transition: border-color var(--transition-interactive), background var(--transition-interactive);
}
.phase:hover { border-color: var(--color-border-strong); }
.phase[aria-selected="true"] { border-color: var(--accent); background: var(--accent-soft); }
.phase__num { grid-row: 1 / 3; font-family: var(--font-mono); font-size: var(--text-lg); color: var(--accent); font-weight: 500; }
.phase__name { font-family: var(--font-display); font-weight: 800; font-size: var(--text-lg); color: var(--color-text); }
.phase__desc { grid-column: 2; font-size: var(--text-sm); color: var(--color-text-muted); }
.lattice__live { margin-top: var(--space-8); font-size: var(--text-base); color: var(--color-text-muted); max-width: 64ch; }
.lattice__live .mono { color: var(--accent); }

/* ============ OUTCOMES ============ */
.outcomes { background: var(--color-bg); text-align: center; }
.outcomes .h-display { color: var(--color-text); }
.outcomes__lede { margin: 0 auto var(--space-16); text-align: center; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--color-border); border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden; }
.stat { background: var(--color-surface); padding: var(--space-10) var(--space-6); }
.stat__num { display: block; font-family: var(--font-display); font-weight: 900; font-size: var(--text-3xl); color: var(--accent); letter-spacing: -0.03em; line-height: 1; }
.stat__label { display: block; margin-top: var(--space-4); font-size: var(--text-sm); color: var(--color-text-muted); }
.stats__foot { margin-top: var(--space-6); font-size: var(--text-sm); color: var(--color-text-faint); max-width: 60ch; margin-inline: auto; }

/* ============ ATOM ============ */
.atom { background: var(--color-bg-2); border-block: 1px solid var(--color-border); }
.atom__grid { display: grid; grid-template-columns: 1fr; gap: var(--space-12); align-items: start; }
.atom__body .h-display { color: var(--color-text); }
.atom__list { display: grid; gap: var(--space-5); margin-top: var(--space-8); }
.atom__list li { padding-left: var(--space-6); position: relative; color: var(--color-text-muted); max-width: 52ch; }
.atom__list li::before { content: "/"; position: absolute; left: 0; color: var(--accent); font-family: var(--font-mono); font-weight: 500; }
.atom__key { display: block; color: var(--color-text); font-weight: 700; margin-bottom: 2px; font-family: var(--font-display); }

.atom__card { border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface); padding: var(--space-8); }
.atom__card-title { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.14em; color: var(--color-text-faint); margin-bottom: var(--space-6); }
.hierarchy { display: grid; gap: 0; }
.hierarchy__row { display: grid; gap: 2px; padding: var(--space-4) 0; border-bottom: 1px solid var(--color-border); }
.hierarchy__row:last-child { border-bottom: none; }
.hierarchy__tier { font-family: var(--font-mono); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.1em; color: var(--color-text-faint); }
.hierarchy__val { font-family: var(--font-display); font-weight: 700; font-size: var(--text-base); color: var(--color-text); }
.hierarchy__row--active { padding-inline: var(--space-4); margin-inline: calc(var(--space-4) * -1); background: var(--accent-soft); border-radius: var(--radius-md); border-bottom-color: transparent; }
.hierarchy__row--active .hierarchy__val { color: var(--accent); }

/* ============ GENERATIVE UI / SYNTHESIS ============ */
.genui {
  background: var(--color-bg);
  padding-block: clamp(var(--space-24), 12vw, calc(var(--space-32) + var(--space-8)));
}
.genui__intro { max-width: var(--content-default); margin-bottom: var(--space-16); }
.genui-console {
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #0d0c09;
  color: #ede9de;
  box-shadow: var(--shadow-lg);
}
.genui-console__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 64px;
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid #2a251c;
  background: #12100c;
}
.genui-console__bar > div { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-4); }
.genui-console__brand,
.genui-console__gate,
.genui-console__status { font-size: var(--text-xs); letter-spacing: 0.1em; }
.genui-console__brand { color: #ede9de; }
.genui-console__gate { color: #e8a93b; }
.genui-console__status { color: #a39c8a; }
.genui-console__status i {
  display: inline-block; width: 7px; height: 7px; margin-right: var(--space-2);
  border-radius: 50%; background: #e8a93b; box-shadow: 0 0 0 5px rgba(232,169,59,0.1);
}
.genui-console__body { display: grid; grid-template-columns: 1fr; }
.genui-controls { padding: var(--space-8); border-bottom: 1px solid #2a251c; }
.objective-set { border: 0; display: grid; gap: var(--space-3); }
.objective-set legend {
  width: 100%; margin-bottom: var(--space-5); color: #a39c8a;
  font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.12em;
}
.objective {
  min-height: 84px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-4);
  align-items: start;
  text-align: left;
  padding: var(--space-4);
  border: 1px solid #2a251c;
  border-radius: var(--radius-md);
  color: #a39c8a;
  transition: color var(--transition-interactive), border-color var(--transition-interactive), background var(--transition-interactive);
}
.objective:hover { color: #ede9de; border-color: #4a402f; }
.objective.is-active { color: #ede9de; border-color: #e8a93b; background: rgba(232,169,59,0.08); }
.objective__index { color: #e8a93b; font-size: var(--text-xs); padding-top: 2px; }
.objective strong { display: block; font-family: var(--font-display); font-size: var(--text-base); line-height: 1.2; }
.objective small { display: block; margin-top: var(--space-2); color: #8c8575; font-size: var(--text-sm); line-height: 1.4; }
.genui-run { width: 100%; justify-content: space-between; margin-top: var(--space-6); }
.genui-run:disabled { opacity: 0.72; cursor: wait; }
.genui-controls__note {
  margin-top: var(--space-4); color: #6e6754; font-size: var(--text-xs);
  letter-spacing: 0.04em; text-align: center;
}
.synthesis {
  position: relative; overflow: hidden; isolation: isolate;
  min-height: 620px; padding: var(--space-8);
  background:
    linear-gradient(rgba(232,169,59,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232,169,59,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
}
.synthesis::after {
  content: "";
  position: absolute;
  inset: auto -20% -45% 20%;
  z-index: -1;
  height: 68%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(232,169,59,0.1), transparent 66%);
  opacity: 0.3;
  transform: scale(0.7);
  transition: opacity 700ms var(--ease-out), transform 1000ms var(--ease-out);
}
.synthesis.is-running::after,
.synthesis.is-resolved::after { opacity: 1; transform: scale(1); }
.synthesis__field {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  opacity: 0.5;
  pointer-events: none;
}
.synthesis__scan {
  position: absolute; inset: 0 0 auto; z-index: 3; height: 1px; opacity: 0;
  background: #e8a93b; box-shadow: 0 0 18px rgba(232,169,59,0.65);
}
.synthesis.is-running .synthesis__scan { opacity: 1; animation: synthesis-scan 1.8s linear infinite; }
@keyframes synthesis-scan { from { transform: translateY(0); } to { transform: translateY(560px); } }
.synthesis__head { display: flex; justify-content: space-between; gap: var(--space-4); color: #6e6754; font-size: var(--text-xs); letter-spacing: 0.11em; }
.synthesis__state { color: #e8a93b; }
.synthesis__telemetry {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: var(--space-5);
  border-block: 1px solid #2a251c;
  background: rgba(13,12,9,0.76);
}
.synthesis__telemetry > span { padding: var(--space-3); border-right: 1px solid #2a251c; }
.synthesis__telemetry > span:last-child { border-right: 0; }
.synthesis__telemetry small {
  display: block; color: #6e6754; font-size: 10px; letter-spacing: 0.1em;
}
.synthesis__telemetry strong {
  display: block; margin-top: 2px; color: #a39c8a;
  font-size: var(--text-xs); font-weight: 500; letter-spacing: 0.06em;
}
.synthesis.is-running .telemetry-phase { color: #e8a93b; }
.synthesis__objective {
  margin: var(--space-8) 0 var(--space-6); color: #f4f1e8;
  font-family: var(--font-display); font-size: var(--text-xl); font-weight: 800; line-height: 1.1;
}
.synthesis__steps { display: grid; gap: var(--space-3); }
.synthesis__steps li {
  display: grid; gap: var(--space-2); padding: var(--space-5) 0;
  border-top: 1px solid #2a251c; opacity: 0.62;
  transition: opacity 400ms var(--ease-out), border-color 400ms var(--ease-out);
}
.synthesis__steps li.is-active { opacity: 1; border-top-color: #e8a93b; }
.synthesis__step { color: #e8a93b; font-size: var(--text-xs); letter-spacing: 0.1em; }
.synthesis__steps strong { color: #ede9de; font-size: var(--text-base); }
.synthesis__steps small { color: #8c8575; font-size: var(--text-sm); }
.architecture-route {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
  height: 34px;
  margin-top: var(--space-5);
  align-items: center;
}
.architecture-route span {
  height: 2px;
  background: #2a251c;
  transform: scaleX(0.12);
  transform-origin: left;
  transition: background 500ms var(--ease-out), transform 700ms var(--ease-out);
}
.architecture-route span.is-active { background: #e8a93b; transform: scaleX(1); }
.architecture-route i {
  position: absolute;
  left: 0;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e8a93b;
  box-shadow: 0 0 14px rgba(232,169,59,0.8);
  opacity: 0;
  transform: translate(-50%, -50%);
}
.synthesis.is-running .architecture-route i {
  opacity: 1;
  animation: route-pulse 1.8s linear infinite;
}
@keyframes route-pulse {
  from { left: 0; }
  to { left: 100%; }
}
.approval {
  margin-top: var(--space-6); padding-top: var(--space-6); border-top: 1px solid #4a402f;
  display: grid; gap: var(--space-5);
}
.approval[hidden] { display: none; }
.approval__label { display: block; color: #e8a93b; font-size: var(--text-xs); letter-spacing: 0.1em; margin-bottom: var(--space-2); }
.approval strong { color: #f4f1e8; font-size: var(--text-base); }
.approval__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.genui-console .btn--ghost { border-color: #4a402f; color: #ede9de; }
.synthesis__result {
  margin-top: var(--space-6); padding: var(--space-4);
  border: 1px solid #4a402f; border-radius: var(--radius-md);
  color: #e8a93b; font-size: var(--text-xs); letter-spacing: 0.06em;
}
.synthesis__result[hidden] { display: none; }
.synthesis.is-resolved .synthesis__result { animation: result-arrive 500ms var(--ease-out) both; }
@keyframes result-arrive {
  from { opacity: 0; clip-path: inset(0 100% 0 0); }
  to { opacity: 1; clip-path: inset(0); }
}

/* ============ ENGAGEMENT ============ */
.engagement { background: var(--color-bg); }
.engagement .h-display { color: var(--color-text); margin-bottom: var(--space-12); }
.tiers { display: grid; grid-template-columns: 1fr; gap: var(--space-5); }
.tier {
  padding: var(--space-8); border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  background: var(--color-surface);
  transition: border-color var(--transition-interactive), transform var(--transition-interactive);
}
.tier:hover { border-color: var(--color-border-strong); transform: translateY(-3px); }
.tier--feature { border-color: var(--accent); background: linear-gradient(180deg, var(--accent-soft), transparent 70%), var(--color-surface); }
.tier__num { color: var(--accent); font-size: var(--text-sm); margin-bottom: var(--space-5); }
.tier h3 { font-size: var(--text-lg); font-family: var(--font-display); font-weight: 800; margin-bottom: var(--space-4); color: var(--color-text); }
.tier p { color: var(--color-text-muted); font-size: var(--text-base); }

/* ============ ENGAGE / FOUNDER ============ */
.engage { background: var(--color-bg-2); border-top: 1px solid var(--color-border); }
.engage__grid { display: grid; grid-template-columns: 1fr; gap: var(--space-12); align-items: start; }
.engage__title { font-size: var(--text-3xl); color: var(--color-text); letter-spacing: -0.03em; margin-bottom: var(--space-6); }
.engage__actions { display: flex; flex-wrap: wrap; gap: var(--space-4); margin-top: var(--space-10); }

.founder { border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface); padding: var(--space-8); }
.founder__mark { width: 48px; color: var(--color-text); margin-bottom: var(--space-6); }
.founder__mark svg { width: 48px; height: auto; }
.founder__name { font-family: var(--font-display); font-weight: 900; font-size: var(--text-xl); color: var(--color-text); letter-spacing: -0.02em; }
.founder__role { color: var(--accent); font-size: var(--text-sm); margin-top: 2px; margin-bottom: var(--space-6); font-family: var(--font-mono); }
.founder__contact { display: grid; gap: var(--space-4); margin-bottom: var(--space-6); }
.founder__contact dt { font-family: var(--font-mono); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.12em; color: var(--color-text-faint); margin-bottom: 2px; }
.founder__contact dd a { color: var(--color-text); font-weight: 600; border-bottom: 1px solid var(--color-border-strong); transition: color var(--transition-interactive), border-color var(--transition-interactive); }
.founder__contact dd a:hover { color: var(--accent); border-color: var(--accent); }
.founder__quote { border-top: 1px solid var(--color-border); padding-top: var(--space-6); font-family: var(--font-display); font-weight: 500; font-size: var(--text-lg); line-height: 1.35; color: var(--color-text); font-style: italic; }

/* ============ FOOTER ============ */
.footer { background: var(--color-bg); border-top: 1px solid var(--color-border); padding-block: var(--space-16); }
.footer__inner { display: grid; grid-template-columns: 1fr; gap: var(--space-10); }
.brand--footer { color: var(--color-text); }
.footer__tag { color: var(--color-text-muted); font-size: var(--text-sm); margin-top: var(--space-4); }
.footer__nav { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); }
.footer__nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--color-text-muted); font-size: var(--text-sm); transition: color var(--transition-interactive); }
.footer__nav a:hover { color: var(--accent); }
.footer__legal { color: var(--color-text-faint); font-size: var(--text-xs); line-height: 1.7; font-family: var(--font-mono); }

/* ============ SCROLL REVEAL (CLS-safe, opacity only) ============ */
.reveal { opacity: 1; }
@supports (animation-timeline: view()) {
  .reveal {
    opacity: 0;
    animation: reveal-fade linear both;
    animation-timeline: view();
    animation-range: entry 5% cover 22%;
  }
}
@keyframes reveal-fade { to { opacity: 1; } }

/* ============ RESPONSIVE ============ */
@media (min-width: 640px) {
  .errors { grid-template-columns: repeat(3, 1fr); }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .tiers { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 639px) {
  .hero { padding-bottom: var(--space-10); }
  .hero__title { font-size: clamp(2.3rem, 11.4vw, 3rem); }
  .hero__lede { font-size: var(--text-base); margin-bottom: var(--space-8); }
  .hero__frame { inset-inline: var(--space-3); bottom: var(--space-3); }
  .genui-console__bar { align-items: flex-start; flex-direction: column; }
  .genui-console__bar > div { align-items: flex-start; flex-direction: column; gap: var(--space-2); }
  .synthesis { min-height: 600px; padding: var(--space-6) var(--space-5); }
  .synthesis__telemetry { grid-template-columns: repeat(2, 1fr); }
  .synthesis__telemetry > span:nth-child(2) { border-right: 0; }
  .synthesis__telemetry > span:nth-child(-n+2) { border-bottom: 1px solid #2a251c; }
}
@media (max-width: 359px) {
  .definition__word { font-size: 2.25rem; }
}
@media (min-width: 900px) {
  .nav__links { display: flex; }
  .nav__cta { display: inline-flex; }
  .nav__menu { display: none; }
  .mobile-menu { display: none !important; }
  .hero__title { font-size: clamp(4.8rem, 8vw, 7.25rem); }
  .hero__signal { display: flex; }
  .hero__scroll { display: flex; }
  .humanos__grid { grid-template-columns: 1.05fr 0.95fr; }
  .principles { grid-template-columns: repeat(2, 1fr); }
  .principle { border-bottom: none; border-right: 1px solid var(--color-border); }
  .principle:nth-child(2n) { border-right: none; }
  .principle:nth-child(1), .principle:nth-child(2) { border-bottom: 1px solid var(--color-border); }
  .lattice__stage { grid-template-columns: 1.2fr 1fr; gap: var(--space-12); }
  .atom__grid { grid-template-columns: 1.3fr 0.7fr; gap: var(--space-16); }
  .genui-console__body { grid-template-columns: 0.84fr 1.16fr; }
  .genui-controls { border-bottom: 0; border-right: 1px solid #2a251c; }
  .engage__grid { grid-template-columns: 1.2fr 0.8fr; gap: var(--space-16); }
  .footer__inner { grid-template-columns: 1.3fr 1fr auto; align-items: start; }
}
@media (min-width: 1180px) {
  .hero__telemetry { display: flex; }
  .hero__content { padding-right: 9rem; }
}

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .marquee__track { animation: none; }
  .hero__scroll span { animation: none; }
  .reveal { opacity: 1 !important; }
  .hero__media img { transform: scale(1.02); }
  .hero__field, .hero__aperture { display: none; }
  .hero__line > span { transform: none; filter: none; }
  .hero__eyebrow, .hero__lede, .hero__actions, .hero__signal, .hero__telemetry, .hero__frame {
    opacity: 1; clip-path: none; transform: none;
  }
  .humanos__figure { transform: none !important; }
  .synthesis__field { display: none; }
  .architecture-route i { animation: none !important; }
}
