/* Brain aOS: Inside the Brain */

:root {
  --ink: #000;
  --carbon: #181818;
  --ash: #6d6d6d;
  --smoke: #9a9a9a;
  --paper: #fff;
  --amber: #ffac2e;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
/* Lenis drives scroll smoothing itself once JS is up: native smooth-scroll fighting
   its own RAF loop every frame is what causes stutter. Auto once Lenis can take over. */
html.js { scroll-behavior: auto; }
body {
  background: var(--ink);
  color: var(--paper);
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 200;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: var(--amber); color: var(--ink); }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 1px solid var(--amber); outline-offset: 4px; }
img { display: block; max-width: 100%; height: auto; }

.mono-label {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--amber);
}

/* ---------- preloader ---------- */
#preloader {
  position: fixed; inset: 0; z-index: 60;
  background: var(--ink);
  display: none;
  flex-direction: column; align-items: center; justify-content: center; gap: 22px;
}
html.js #preloader { display: flex; }
#preloader-count { font-family: var(--mono); font-weight: 500; font-size: 11px; letter-spacing: 0.3em; color: var(--smoke); }

/* ---------- persistent 3D scene ---------- */
#scene { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
#brain-canvas { width: 100%; height: 100%; display: block; }
html.no3d #brain-canvas { display: none; }
html.no3d #scene::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(42% 45% at 68% 38%, rgba(255, 172, 46, 0.16), transparent 70%),
    radial-gradient(30% 34% at 30% 62%, rgba(160, 224, 171, 0.10), transparent 70%),
    radial-gradient(24% 28% at 74% 72%, rgba(165, 45, 37, 0.12), transparent 70%);
}

.silo-label {
  position: absolute; transform: translate(-50%, -50%);
  font-family: var(--mono); font-weight: 500; font-size: 10px; letter-spacing: 0.25em; text-transform: uppercase;
  color: var(--smoke); opacity: 0; transition: opacity 0.4s;
  white-space: nowrap;
}
html.no3d .silo-label { display: none; }

#node-tip {
  position: fixed; z-index: 5;
  transform: translate(16px, -120%);
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid var(--carbon);
  border-radius: 6px;
  padding: 7px 11px;
  display: flex; flex-direction: column; gap: 3px;
  pointer-events: none;
  white-space: nowrap;
}
#node-tip[hidden] { display: none; }
#node-tip .tip-type { font-family: var(--mono); font-weight: 500; font-size: 9px; letter-spacing: 0.25em; text-transform: uppercase; color: var(--amber); }
#node-tip .tip-name { font-size: 13px; font-weight: 300; color: var(--paper); }

#hud {
  position: fixed; left: 32px; bottom: 34px; z-index: 5;
  font-family: var(--mono); font-weight: 500; font-size: 10px; letter-spacing: 0.2em; color: var(--ash);
  pointer-events: none;
  opacity: 1; transition: opacity 0.5s ease;
}
#hud.hidden { opacity: 0; }
#hud #hud-state { color: var(--amber); }
html.no3d #hud { display: none; }
html:not(.js) #hud { display: none; }

/* ---------- nav ---------- */
#site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 36px;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  background: linear-gradient(rgba(0, 0, 0, 0.65), transparent);
}
#site-nav.hidden { transform: translateY(-110%); }
#site-nav nav { display: flex; gap: 30px; }
#site-nav nav a { font-size: 13px; font-weight: 300; color: var(--smoke); transition: color 0.25s; }
#site-nav nav a:hover { color: var(--paper); }
.nav-ctas { display: flex; align-items: center; gap: 12px; }
.logo-lockup { display: flex; align-items: center; gap: 10px; }
.wordmark { font-size: 13px; font-weight: 400; letter-spacing: 0.24em; }
.wordmark em { font-style: normal; font-weight: 200; }

.pill {
  display: inline-block;
  background: var(--paper); color: var(--ink);
  font-size: 12px; font-weight: 400; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 12px 26px; border-radius: 999px;
  transition: background 0.25s;
  will-change: transform;
}
.pill:hover { background: var(--amber); }
.pill-outline {
  display: inline-block;
  background: transparent; color: var(--paper);
  border: 1px solid var(--carbon);
  font-size: 12px; font-weight: 400; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 11px 25px; border-radius: 999px;
  transition: border-color 0.25s, color 0.25s;
  will-change: transform;
}
.pill-outline:hover { border-color: var(--amber); color: var(--amber); }
.ghost { font-size: 13px; font-weight: 300; color: var(--smoke); transition: color 0.25s; }
.ghost:hover { color: var(--amber); }

/* ---------- layout ---------- */
main { position: relative; z-index: 1; }
main section { padding-left: clamp(24px, 6vw, 90px); padding-right: clamp(24px, 6vw, 90px); }

/* ---------- hero ---------- */
#hero {
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
  padding-top: 132px; padding-bottom: 100px;
  position: relative;
}
.hero-copy {
  max-width: 680px; display: flex; flex-direction: column; gap: 26px;
  text-shadow: 0 0 34px rgba(0, 0, 0, 0.9), 0 0 10px rgba(0, 0, 0, 0.85);
}
#hero h1 {
  font-size: clamp(3.2rem, 8vw, 7.5rem);
  font-weight: 300; line-height: 0.98; letter-spacing: -0.04em;
}
#hero p { font-size: 18px; font-weight: 200; line-height: 1.55; color: var(--smoke); max-width: 32em; }
.hero-ctas { display: flex; align-items: center; flex-wrap: wrap; gap: 20px 28px; margin-top: 6px; }
.hero-hint { position: absolute; bottom: 28px; right: clamp(24px, 6vw, 90px); color: var(--ash); }
html.no3d .hero-hint { display: none; }

[data-drag] { cursor: grab; }
html.dragging, html.dragging [data-drag] { cursor: grabbing; }
html.dragging, html.dragging * { user-select: none !important; -webkit-user-select: none !important; }

/* ---------- story chapters ---------- */
.chapter { min-height: 175vh; }
.chapter-inner {
  position: sticky; top: 0; min-height: 100vh;
  display: flex; align-items: center;
}
.chapter-copy {
  max-width: 760px;
  display: flex; flex-direction: column; gap: 24px;
  padding: 48px 0;
  text-shadow: 0 0 40px rgba(0, 0, 0, 0.9), 0 0 12px rgba(0, 0, 0, 0.9);
}
.chapter-copy h2 {
  font-size: clamp(2.6rem, 6.5vw, 5.6rem);
  font-weight: 200; line-height: 1.02; letter-spacing: -0.035em;
}
.chapter-copy p { font-size: clamp(1.15rem, 2vw, 1.5rem); font-weight: 200; line-height: 1.5; color: var(--smoke); max-width: 30em; }
.chapter-copy em { font-style: normal; color: var(--paper); }

/* ---------- ask the brain ---------- */
#ask {
  min-height: 110vh;
  display: flex; flex-direction: column; justify-content: center; gap: 44px;
  padding-top: 12vh; padding-bottom: 12vh;
}
.ask-head { display: flex; flex-direction: column; gap: 18px; max-width: 640px; }
.ask-head h2 { font-size: clamp(2.4rem, 5vw, 4.2rem); font-weight: 300; letter-spacing: -0.03em; }
.ask-head p { font-size: 17px; color: var(--smoke); line-height: 1.55; }
.ask-panel { max-width: 820px; display: flex; flex-direction: column; gap: 30px; }
.ask-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  font-family: var(--mono); font-weight: 500; font-size: 11px; letter-spacing: 0.06em;
  color: var(--smoke);
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--carbon); border-radius: 999px;
  padding: 10px 18px; cursor: pointer;
  transition: border-color 0.25s, color 0.25s;
}
.chip:hover:not(:disabled) { border-color: var(--amber); color: var(--paper); }
.chip.active { border-color: var(--amber); color: var(--amber); }
.chip:disabled { opacity: 0.45; cursor: default; }
.ask-thread {
  background: rgba(0, 0, 0, 0.62);
  border: 1px solid var(--carbon); border-radius: 12px;
  padding: 30px 32px;
  display: flex; flex-direction: column; gap: 18px;
  backdrop-filter: blur(3px);
}
.ask-q { font-family: var(--mono); font-weight: 500; font-size: 14px; color: var(--paper); line-height: 1.5; }
.ask-prompt { color: var(--amber); margin-right: 6px; }
.ask-cursor {
  display: inline-block; width: 8px; height: 15px; margin-left: 3px;
  background: var(--amber); vertical-align: -2px;
  animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.ask-a { font-size: 16px; font-weight: 200; line-height: 1.65; color: #d9d9d9; min-height: 3.2em; }
.ask-cites { display: flex; flex-wrap: wrap; gap: 8px; }
.cite {
  font-family: var(--mono); font-weight: 500; font-size: 10px; letter-spacing: 0.04em;
  color: var(--ash); border: 1px solid var(--carbon); border-radius: 5px;
  padding: 4px 9px;
}

/* ---------- product tour ---------- */
#product, #agents, #pricing, #architecture, #cairo, #contact { background: var(--ink); }
#product { padding-top: 16vh; padding-bottom: 10vh; }
.product-head { display: flex; flex-direction: column; gap: 18px; max-width: 640px; margin-bottom: 12vh; }
.product-head h2 { font-size: clamp(2.6rem, 6vw, 5rem); font-weight: 300; letter-spacing: -0.035em; }
.product-head p { font-size: 17px; color: var(--smoke); }

.tour-block {
  display: grid; grid-template-columns: minmax(280px, 5fr) 7fr;
  gap: clamp(30px, 5vw, 80px);
  align-items: center;
  margin-bottom: 15vh;
  perspective: 1400px;
}
.tour-block > * { min-width: 0; }
.tour-block:nth-of-type(odd) .tour-copy { order: 2; }
.tour-copy { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.tour-copy h3 { font-size: clamp(1.6rem, 2.8vw, 2.4rem); font-weight: 300; letter-spacing: -0.02em; line-height: 1.15; }
.tour-copy p { font-size: 16px; font-weight: 200; line-height: 1.55; color: var(--smoke); max-width: 26em; }
.tour-copy em { font-style: normal; color: var(--amber); }

.marquee {
  margin-top: 24px;
  min-width: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track { display: flex; width: max-content; animation: marquee-scroll 24s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-group { display: flex; gap: 32px; padding-right: 32px; }
.conn {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-weight: 500; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--smoke); white-space: nowrap;
}
.conn svg { width: 15px; height: 15px; flex: none; fill: none; stroke: var(--ash); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
@keyframes marquee-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; } }

.shot-frame {
  border: 1px solid var(--carbon); border-radius: 10px;
  overflow: hidden;
  background: #050505;
  will-change: transform;
}
.shot-bar { display: flex; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--carbon); }
.shot-bar span { width: 8px; height: 8px; border-radius: 50%; background: var(--carbon); }
.shot-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; perspective: 1400px; }
.shot-duo > * { min-width: 0; }

.mode-tabs { display: flex; gap: 8px; margin-top: 8px; }
.mode-tab {
  font-family: var(--mono); font-weight: 500; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--smoke); background: none;
  border: 1px solid var(--carbon); border-radius: 999px;
  padding: 8px 18px; cursor: pointer;
  transition: border-color 0.25s, color 0.25s;
}
.mode-tab:hover { color: var(--paper); }
.mode-tab.active { border-color: var(--amber); color: var(--amber); }
.mode-shots { position: relative; perspective: 1400px; }
.mode-shots .shot-frame { display: none; }
.mode-shots .shot-frame.active { display: block; }

/* ---------- agents / mcp ---------- */
#agents {
  min-height: 80vh;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(30px, 5vw, 80px);
  align-items: center;
  padding-top: 10vh; padding-bottom: 10vh;
}
#agents > * { min-width: 0; }
.mcp-copy { display: flex; flex-direction: column; gap: 20px; max-width: 540px; }
.mcp-copy h2 { font-size: clamp(2.2rem, 4.5vw, 3.6rem); font-weight: 300; letter-spacing: -0.03em; line-height: 1.05; }
.mcp-copy p { font-size: 16px; line-height: 1.6; color: var(--smoke); }
.terminal {
  border: 1px solid var(--carbon); border-radius: 10px;
  padding: 26px 28px;
  font-family: var(--mono); font-weight: 500; font-size: 13px; line-height: 1.7;
  min-height: 130px;
}
.term-prompt { color: var(--amber); }
.term-cursor {
  display: inline-block; width: 8px; height: 14px; margin-left: 2px;
  background: var(--amber); vertical-align: -2px;
  animation: blink 1.05s steps(1) infinite;
}
#term-out { color: var(--smoke); margin-top: 10px; }

/* ---------- architecture ---------- */
/* ---------- pricing ---------- */
#pricing { padding-top: 12vh; padding-bottom: 12vh; }
.pricing-head { display: flex; flex-direction: column; gap: 18px; max-width: 640px; margin-bottom: 7vh; }
.pricing-head h2 { font-size: clamp(2.6rem, 6vw, 5rem); font-weight: 300; letter-spacing: -0.035em; }
.pricing-head p { font-size: 17px; color: var(--smoke); }
.price-panel {
  border: 1px solid var(--carbon); border-radius: 10px;
  padding: clamp(28px, 4vw, 48px);
  display: flex; flex-direction: column; gap: 34px;
  max-width: 880px;
}
.price-readout { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.price-stat { display: flex; flex-direction: column; gap: 10px; }
.price-num { font-size: clamp(1.9rem, 4.5vw, 3.4rem); font-weight: 300; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.price-num.amber { color: var(--amber); }
.price-cap { font-family: var(--mono); font-weight: 500; font-size: 10px; letter-spacing: 0.25em; text-transform: uppercase; color: var(--ash); }
#price-range {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 2px; border-radius: 999px;
  background: linear-gradient(to right, var(--amber) var(--fill, 5%), var(--carbon) var(--fill, 5%));
  cursor: ew-resize; outline-offset: 10px;
}
#price-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--ink); border: 2px solid var(--amber);
  cursor: ew-resize;
}
#price-range::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--ink); border: 2px solid var(--amber);
  cursor: ew-resize;
}
.price-tiers { display: flex; flex-wrap: wrap; gap: 10px; }
.price-tier {
  font-family: var(--mono); font-weight: 500; font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ash); border: 1px solid var(--carbon); border-radius: 999px;
  padding: 8px 14px;
  transition: color 0.25s, border-color 0.25s;
}
.price-tier.active { color: var(--amber); border-color: var(--amber); }
.price-foot { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.price-note { font-size: 14px; line-height: 1.6; color: var(--smoke); max-width: 480px; }

#architecture { padding-top: 12vh; padding-bottom: 14vh; }
.arch-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: clamp(24px, 4vw, 60px);
  margin-top: 52px;
}
.arch-col { border-top: 1px solid var(--carbon); padding-top: 22px; display: flex; flex-direction: column; gap: 12px; }
.arch-num { font-family: var(--mono); font-weight: 500; font-size: 10px; letter-spacing: 0.25em; color: var(--ash); }
.arch-col h3 { font-size: 19px; font-weight: 400; }
.arch-col p { font-size: 14.5px; line-height: 1.6; color: var(--smoke); }

/* ---------- cairo ---------- */
#cairo { min-height: 90vh; display: flex; align-items: center; justify-content: center; }
.cairo-line {
  font-size: clamp(2.6rem, 7vw, 6.5rem);
  font-weight: 200; letter-spacing: -0.035em; line-height: 1.12;
  text-align: center;
}
.grad-word {
  background: linear-gradient(135deg, #a0e0ab, #ffac2e, #a52d25);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* ---------- contact ---------- */
#contact {
  min-height: 85vh;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 22px;
}
.contact-link {
  font-size: clamp(3rem, 10vw, 9rem);
  font-weight: 300; letter-spacing: -0.045em; line-height: 1;
  transition: color 0.3s;
}
.contact-link:hover { color: var(--amber); }
.contact-sub { font-size: 15px; color: var(--ash); }
.contact-book { margin-top: 6px; }

/* ---------- footer ---------- */
footer {
  position: relative; z-index: 1;
  background: var(--ink);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px;
  padding: 34px clamp(24px, 6vw, 90px) 42px;
  border-top: 1px solid var(--carbon);
}
footer nav { display: flex; gap: 24px; }
footer nav a { font-size: 13px; font-weight: 300; color: var(--smoke); transition: color 0.25s; }
footer nav a:hover { color: var(--paper); }
footer .mono-label { color: var(--ash); }

/* ---------- cursor ---------- */
.cursor-dot {
  position: fixed; z-index: 70; left: 0; top: 0;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--amber);
  pointer-events: none; opacity: 0;
  transition: width 0.2s, height 0.2s, opacity 0.3s;
}
.cursor-dot.on { opacity: 0.9; }
.cursor-dot.grow { width: 26px; height: 26px; opacity: 0.35; }

/* ---------- lightbox ---------- */
.shot-frame img { cursor: zoom-in; }
html.lightbox-open { overflow: hidden; }
.lightbox {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(0, 0, 0, 0.92);
  display: flex; align-items: center; justify-content: center;
  padding: 48px;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 92vw; max-height: 92vh; object-fit: contain; border-radius: 10px; border: 1px solid var(--carbon); cursor: default; }
.lightbox-close {
  position: absolute; top: 26px; right: 30px;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--carbon); color: var(--paper);
  font-size: 15px; cursor: pointer;
  transition: background 0.2s;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.14); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  #site-nav { padding: 16px 20px; }
  #site-nav nav { display: none; }
  .nav-ctas .pill-outline { display: none; }
  #hud, .hero-hint, .cursor-dot { display: none; }
  .chapter { min-height: 145vh; }
  .tour-block { grid-template-columns: 1fr; gap: 26px; margin-bottom: 11vh; }
  .tour-block:nth-of-type(odd) .tour-copy { order: 0; }
  .shot-duo { grid-template-columns: 1fr; }
  #agents { grid-template-columns: 1fr; min-height: 0; }
  .price-readout { grid-template-columns: 1fr; gap: 18px; }
  .price-foot { flex-direction: column; align-items: flex-start; }
  .arch-grid { grid-template-columns: 1fr; }
  #contact .contact-link { word-break: break-word; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .ask-cursor, .term-cursor { animation: none; }
  #site-nav { transition: none; }
}
