/* ==========================================================================
   THEBE AI - shared design system (company pages + chrome for product pages)
   ========================================================================== */
@font-face { font-family: "Space Grotesk"; src: url("/assets/fonts/space-grotesk-variable.woff2?v=69bb1e73a6") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/assets/fonts/inter-variable.woff2?v=23a62ce6e8") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg-deep: #05060f;
  --bg: #080b1d;
  --bg-mid: #0b1026;
  --bg-glow: #14204a;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-strong: rgba(255, 255, 255, 0.07);
  --line: rgba(143, 184, 255, 0.16);
  --text: #eef1ff;
  --text-dim: #a6aed0;
  --text-faint: #7d86ab;
  --accent: #8fb8ff;
  --accent-2: #c4a8ff;
  --positive: #6ee7a8;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --font-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --container: 1160px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 85% -10%, var(--bg-glow) 0%, transparent 60%),
    radial-gradient(900px 700px at -10% 110%, #1a1240 0%, transparent 60%),
    linear-gradient(175deg, var(--bg-mid) 0%, var(--bg-deep) 60%);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 .6em; }
h1 { font-size: clamp(2.3rem, 6vw, 4.2rem); font-weight: 600; }
h2 { font-size: clamp(1.75rem, 4vw, 2.7rem); font-weight: 600; }
h3 { font-size: clamp(1.2rem, 2.2vw, 1.45rem); font-weight: 600; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.2em; }

.container { width: min(var(--container), 100% - 2.5rem); margin-inline: auto; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 100; padding: .6rem 1rem; background: var(--text); color: var(--bg-deep); border-radius: 8px; font-weight: 600; }
.skip-link:focus { top: 1rem; }

/* ---------- Header ---------- */
.site-header, .site-footer { font-family: var(--font-body); }
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(6, 8, 20, 0.72);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid rgba(143, 184, 255, 0.09);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 68px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--text); text-decoration: none; }
.brand:hover { color: var(--text); }
.brand__mark { width: 34px; height: 34px; }
.brand__word { font-family: var(--font-display); font-weight: 700; font-size: 1.12rem; letter-spacing: .14em; }
.site-nav ul { display: flex; gap: .3rem; list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: block; padding: .5rem .9rem; border-radius: 999px;
  color: var(--text-dim); text-decoration: none; font-weight: 500; font-size: .98rem;
  transition: color .2s, background-color .2s;
}
.site-nav a:hover { color: var(--text); background: var(--surface-strong); }
.site-nav a[aria-current="page"] { color: var(--text); background: rgba(143, 184, 255, .14); }
@media (max-width: 560px) {
  .site-header__inner { padding-block: .5rem; }
  .site-nav { width: 100%; overflow-x: auto; }
  .site-nav ul { gap: .1rem; }
  .site-nav a { padding: .4rem .7rem; font-size: .92rem; }
}

/* ---------- Sections ---------- */
.section { padding: clamp(3.5rem, 8vw, 6.5rem) 0; position: relative; }
.section--tight { padding: clamp(2.5rem, 5vw, 4rem) 0; }
.section__head { max-width: 46rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section__head--center { margin-inline: auto; text-align: center; }
.eyebrow {
  display: inline-block; margin: 0 0 1rem;
  font-family: var(--font-display); font-size: .8rem; font-weight: 600;
  letter-spacing: .26em; text-transform: uppercase; color: var(--accent);
}
.lede { font-size: clamp(1.08rem, 2vw, 1.25rem); color: var(--text-dim); max-width: 40rem; }
.gradient-text {
  background: linear-gradient(100deg, #ffffff 5%, var(--accent) 55%, var(--accent-2) 95%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- Buttons ---------- */
.btn-row { display: flex; flex-wrap: wrap; gap: .8rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 48px; padding: .75rem 1.4rem; border-radius: 999px;
  font-family: var(--font-display); font-weight: 600; font-size: 1rem; text-decoration: none;
  border: 1px solid transparent; cursor: pointer; transition: transform .2s var(--ease), background-color .2s, border-color .2s, color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--text); color: var(--bg-deep); }
.btn--primary:hover { color: var(--bg-deep); background: #fff; }
.btn--ghost { color: var(--text); border-color: rgba(238, 241, 255, .28); background: transparent; }
.btn--ghost:hover { color: var(--text); border-color: var(--text); }

/* Store buttons: shown without a link until store listings exist */
.store-row { display: flex; flex-wrap: wrap; gap: .8rem; }
.store-btn {
  display: inline-flex; align-items: center; gap: .7rem; min-height: 56px; padding: .55rem 1.2rem .55rem 1rem;
  border-radius: 14px; border: 1px solid rgba(238, 241, 255, .32); background: rgba(0, 0, 0, .55); color: #fff;
  font: inherit; text-align: left; cursor: not-allowed;
}
.store-btn svg { width: 26px; height: 26px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.store-btn__small { display: block; font-size: .72rem; letter-spacing: .04em; opacity: .8; line-height: 1.2; }
.store-btn__big { display: block; font-family: var(--font-display); font-size: 1.12rem; font-weight: 600; line-height: 1.2; }
.store-note { margin-top: .8rem; font-size: .9rem; color: var(--text-faint); }

/* ---------- Cards ---------- */
.grid { display: grid; gap: clamp(1rem, 2.5vw, 1.6rem); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.card {
  position: relative; display: flex; flex-direction: column;
  padding: clamp(1.4rem, 3vw, 2rem); border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02));
  border: 1px solid var(--line);
}
.card p:last-child { margin-bottom: 0; }
.card__icon { width: 46px; height: 46px; margin-bottom: 1.1rem; border-radius: 12px; display: grid; place-items: center; background: rgba(143, 184, 255, .12); color: var(--accent); }
.card__icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.card__text { color: var(--text-dim); }
.card--link { text-decoration: none; color: var(--text); transition: transform .25s var(--ease), border-color .25s; }
.card--link:hover { color: var(--text); transform: translateY(-4px); border-color: rgba(143, 184, 255, .45); }
.card__more { margin-top: auto; padding-top: 1.2rem; font-family: var(--font-display); font-weight: 600; color: var(--accent); }
.badge {
  display: inline-flex; align-items: center; gap: .45rem; align-self: flex-start;
  padding: .3rem .75rem; border-radius: 999px; margin-bottom: 1rem;
  font-size: .75rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-dim); background: rgba(143, 184, 255, .08); border: 1px solid var(--line);
}
.badge__pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--positive); box-shadow: 0 0 10px 2px rgba(110, 231, 168, .55); }

/* ---------- Product cards (art panels drawn in CSS / small images) ---------- */
.product-card { padding: 0; overflow: hidden; }
.product-card__art { position: relative; aspect-ratio: 16 / 10; display: grid; place-items: center; overflow: hidden; }
.product-card__body { padding: clamp(1.3rem, 3vw, 1.8rem); display: flex; flex-direction: column; flex: 1; }
.product-card__kicker { font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; color: var(--text-faint); margin-bottom: .4rem; }

.art-grouplet { background: radial-gradient(circle at 30% 20%, #ffd36b 0%, #f2a12b 45%, #c46a10 100%); }
.art-grouplet__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 74%; }
.art-grouplet__grid span { aspect-ratio: 1; border-radius: 12px; background: rgba(255, 255, 255, .88); display: grid; place-items: center; box-shadow: 0 6px 14px rgba(120, 60, 0, .25); }
.art-grouplet__grid span.is-group { background: #7ed1a2; }
.art-grouplet__grid img { width: 72%; height: 72%; }

.art-tilelet { background: radial-gradient(circle at 50% 30%, #1d2458 0%, #080b22 75%); }
.art-tilelet__board { display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; width: 48%; padding: 6px; background: #ddd3bf; border-radius: 3px; box-shadow: 0 0 0 7px #b8925a, 0 18px 40px rgba(0, 0, 0, .5); }
.art-tilelet__board i { aspect-ratio: 1; background: #fbf7ee; border-radius: 1px; }
.art-tilelet__board i.a { background: #da7756; }
.art-tilelet__board i.b { background: #3f7d5c; }
.art-tilelet__board i.c { background: #2b2823; }

.art-ladderlet { background: radial-gradient(circle at 50% 0%, #4a3a1c 0%, #1c160c 55%, #0d0b07 100%); }
.art-ladderlet__ladder { display: grid; gap: 7px; font-family: "Georgia", serif; }
.art-ladderlet__rung { display: flex; gap: 6px; }
.art-ladderlet__rung b { width: 34px; height: 38px; display: grid; place-items: center; border-radius: 6px; font-weight: 600; font-size: 1.15rem; color: #f2ece0; background: linear-gradient(#2a251b, #1a1610); border: 1px solid #8a6a1f; }
.art-ladderlet__rung b.lit { color: #0d0b07; background: linear-gradient(#e9c77d, #c79a42); }
.art-ladderlet__rung b.hole { background: #0f0d09; border-style: dashed; color: transparent; }

.art-exactfps { background: radial-gradient(circle at 70% 10%, #13314a 0%, #070b14 60%); }
.art-exactfps svg { width: 82%; height: auto; }
.art-exactfps .grid-line { stroke: rgba(120, 200, 255, .14); stroke-width: 1; }
.art-exactfps .trace { fill: none; stroke: #22d3ee; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.art-exactfps .trace-fill { fill: url(#fpsFill); }
.art-exactfps text { font-family: var(--font-display); fill: #e6f6ff; }

/* ---------- Studios ---------- */
.studio-card__list { list-style: none; padding: 0; margin: 0 0 .5rem; display: flex; flex-wrap: wrap; gap: .45rem; }
.studio-card__list li { padding: .25rem .7rem; border-radius: 999px; font-size: .85rem; background: var(--surface-strong); color: var(--text-dim); }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-top: clamp(2rem, 4vw, 3rem); }
.stat { padding: 1.4rem 1.2rem; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); text-align: center; }
.stat__num { display: block; font-family: var(--font-display); font-weight: 700; font-size: clamp(1.8rem, 4vw, 2.5rem); letter-spacing: -0.02em; }
.stat__label { color: var(--text-dim); font-size: .95rem; }

/* ---------- Promise list ---------- */
.promises { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; }
.promises li { display: flex; gap: .8rem; align-items: flex-start; padding: 1.1rem 1.2rem; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); }
.promises svg { width: 22px; height: 22px; flex: none; margin-top: 3px; fill: none; stroke: var(--positive); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Spotlight ---------- */
.spotlight { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: center; }
.spotlight__art { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); }
@media (max-width: 820px) { .spotlight { grid-template-columns: 1fr; } }

/* ---------- Page hero (company pages) ---------- */
.hero { position: relative; padding: clamp(4.5rem, 12vw, 9rem) 0 clamp(3.5rem, 9vw, 6.5rem); overflow: hidden; isolation: isolate; }
.hero h1 { max-width: 15ch; }
.hero .lede { margin-bottom: 2rem; }
.hero__sky { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero__sky canvas { width: 100%; height: 100%; }
/* Large hero moon = the official logo moon (thebe-ai-logo.svg): same gradient, same three craters, same orbit ring */
.hero__moon {
  position: absolute; z-index: -1; right: clamp(-6rem, -4vw, 2rem); top: clamp(1rem, 4vw, 3rem);
  width: clamp(180px, 30vw, 400px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #f7f3e9 0%, #ddd5c4 60%, #a99e8a 100%);
  box-shadow: 0 0 60px 12px rgba(200, 214, 255, .16), 0 0 160px 50px rgba(120, 150, 255, .1), inset -22px -18px 50px rgba(20, 22, 45, .45);
  animation: moon-drift 26s ease-in-out infinite alternate;
}
.hero__moon::before { content: ""; position: absolute; inset: -26%; border-radius: 50%; border: 2px solid rgba(143, 184, 255, .35); }
.hero__moon::after { content: ""; position: absolute; width: 8%; height: 8%; border-radius: 50%; left: 103%; top: -3%; background: #8fb8ff; box-shadow: 0 0 14px 3px rgba(143, 184, 255, .7); }
.hero__moon i { position: absolute; border-radius: 50%; background: #968d7a; box-shadow: inset 2px 3px 6px rgba(75, 70, 60, .35); }
.hero__moon i:nth-child(1) { width: 20%; height: 20%; top: 19%; left: 20%; opacity: .5; }
.hero__moon i:nth-child(2) { width: 14%; height: 14%; top: 56%; left: 61%; opacity: .45; }
.hero__moon i:nth-child(3) { width: 10%; height: 10%; top: 69%; left: 31%; opacity: .4; }
.hero__moon i:nth-child(4) { display: none; }
.hero--compact { padding: clamp(3.5rem, 8vw, 6rem) 0 clamp(2rem, 5vw, 3.5rem); }
.hero--compact h1 { max-width: 20ch; }
@media (max-width: 700px) { .hero__moon { opacity: .45; } }
@keyframes moon-drift { from { transform: translateY(0) rotate(0); } to { transform: translateY(18px) rotate(4deg); } }

/* ---------- CTA band ---------- */
.cta-band {
  text-align: center; padding: clamp(2.5rem, 6vw, 4rem) clamp(1.5rem, 4vw, 3rem); border-radius: 28px;
  background: radial-gradient(600px 300px at 50% 0%, rgba(143, 184, 255, .2), transparent 70%), rgba(255, 255, 255, .03);
  border: 1px solid var(--line);
}
.cta-band .store-row { justify-content: center; }
.cta-band .lede { margin-inline: auto; }

/* ---------- Prose (legal + about) ---------- */
.prose { max-width: 46rem; }
.prose h2 { font-size: clamp(1.35rem, 3vw, 1.75rem); margin-top: 2.4rem; }
.prose h3 { font-size: 1.15rem; margin-top: 1.8rem; }
.prose p, .prose li { color: #d3d8ee; }
.prose li { margin-bottom: .4em; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 1.4em; font-size: .97rem; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: .65rem .75rem; border-bottom: 1px solid var(--line); }
.prose th { color: var(--text); font-family: var(--font-display); font-weight: 600; }
.prose td { color: #cfd5ec; }
.prose .meta { color: var(--text-faint); font-size: .95rem; }
.toc { padding: 1.2rem 1.4rem; margin: 0 0 2rem; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); }
.toc ol { margin: 0; }
.email-image { display: inline-block; padding: .55rem .85rem; border-radius: 10px; background: var(--surface-strong); border: 1px solid var(--line); vertical-align: middle; }
.email-image img { height: 24px; width: auto; }

/* ---------- FAQ ---------- */
.faq details { border-bottom: 1px solid var(--line); padding: 1.1rem 0; }
.faq summary { cursor: pointer; font-family: var(--font-display); font-weight: 600; font-size: 1.12rem; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 1.4rem; line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin: .8rem 0 0; color: var(--text-dim); }

/* ---------- Footer ---------- */
.site-footer { margin-top: clamp(3rem, 8vw, 6rem); padding: clamp(2.5rem, 6vw, 4rem) 0 1.5rem; border-top: 1px solid rgba(143, 184, 255, .1); background: rgba(3, 4, 10, .55); }
.site-footer__grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 2rem; }
.site-footer__brand p { color: var(--text-dim); margin: 1rem 0 0; max-width: 22rem; }
.site-footer__contact img { height: 22px; width: auto; }
.site-footer__heading { font-size: .82rem; letter-spacing: .18em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 1rem; font-weight: 600; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.site-footer nav a { color: var(--text-dim); text-decoration: none; }
.site-footer nav a:hover { color: var(--text); }
.site-footer__legal { margin-top: 2.5rem; padding-top: 1.3rem; border-top: 1px solid rgba(143, 184, 255, .08); color: var(--text-faint); font-size: .88rem; }
.site-footer__legal p { margin: 0; }
@media (max-width: 820px) { .site-footer__grid { grid-template-columns: 1fr 1fr; } .site-footer__brand { grid-column: 1 / -1; } }

/* ---------- Reveal on scroll (progressive enhancement; content visible without JS) ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
}
