/* ============================================================
   RbxDesk - core system (theme-agnostic)
   All color, depth and accent live in CSS variables and are
   overridden per palette in theme.css. Layout is shared.
   Radius rule (documented + enforced):
     interactive (buttons, inputs, small controls) -> --r-control
     containers (cards, panels, shells)            -> --r-card
     chips / pills / avatars                        -> --r-pill / 50%
   ============================================================ */

:root {
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-sans: "Space Grotesk", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  /* default palette = graphite + burnt orange (theme.css overrides) */
  color-scheme: dark;
  --bg: #14110d;
  --bg-2: #1b1712;
  --surface: #221d17;
  --surface-2: #2a241d;
  --line: rgba(245, 240, 232, 0.10);
  --line-strong: rgba(245, 240, 232, 0.18);
  --text: #f5f0e8;
  --text-dim: #a89f92;
  --text-soft: #d8d0c4;

  --accent: #f0641e;
  --accent-strong: #ff7a33;
  --accent-ink: #1a0d04;
  --accent-soft: rgba(240, 100, 30, 0.13);
  --accent-line: rgba(240, 100, 30, 0.34);

  --active: #5fd08a;
  --active-soft: rgba(95, 208, 138, 0.14);

  --aura: rgba(240, 100, 30, 0.22);

  --shadow-1: 0 18px 48px -16px rgba(0, 0, 0, 0.55);
  --shadow-2: 0 36px 90px -24px rgba(0, 0, 0, 0.62);

  --r-card: 16px;
  --r-control: 10px;
  --r-pill: 999px;

  --container: 1140px;
  --nav-h: 64px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; }
a, button, summary { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; }

.skip-link {
  position: fixed; top: 12px; left: 12px; z-index: 120;
  transform: translateY(-160%);
  border-radius: var(--r-control);
  background: var(--accent); color: var(--accent-ink);
  padding: 0.65rem 1rem; text-decoration: none; font-weight: 700;
  transition: transform 0.2s var(--ease);
}
.skip-link:focus { transform: translateY(0); }

.container { width: min(100% - 48px, var(--container)); margin-inline: auto; }

/* ---------- type ---------- */
h1, h2, h3 { line-height: 1.06; letter-spacing: -0.02em; text-wrap: balance; font-family: var(--font-display); }
h1 {
  max-width: 15ch;
  font-size: clamp(2.6rem, 5.6vw, 4.6rem);
  font-weight: 700; letter-spacing: -0.035em;
}
h1 em { font-style: normal; color: var(--accent); }
h2 { font-size: clamp(1.9rem, 3.6vw, 3rem); font-weight: 700; letter-spacing: -0.03em; }
h3 { font-size: 1.18rem; font-weight: 600; letter-spacing: -0.015em; }
p { text-wrap: pretty; }

section { position: relative; padding-block: clamp(64px, 9vw, 128px); }
section[id] { scroll-margin-top: calc(var(--nav-h) + 22px); }

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

.eyebrow {
  display: inline-block; color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.74rem; font-weight: 600; letter-spacing: 0.02em;
  margin-bottom: 1rem;
}

.section-head { max-width: 660px; margin-bottom: clamp(2.2rem, 4.5vw, 3.4rem); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-lead { margin-top: 1rem; max-width: 56ch; color: var(--text-soft); font-size: 1.06rem; }
.section-head--center .section-lead { margin-inline: auto; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  border: 1px solid transparent; border-radius: var(--r-control);
  padding: 0.7rem 1.15rem; font: 600 0.95rem var(--font-sans);
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform 0.18s var(--ease), background 0.18s var(--ease), border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.btn i { font-size: 1.05em; }
.btn:active { transform: translateY(1px) scale(0.99); }

.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-1); }
.btn-primary:hover { background: var(--accent-strong); transform: translateY(-2px); box-shadow: var(--shadow-2); }

.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--accent-line); background: var(--accent-soft); }

.btn-sm { padding: 0.5rem 0.9rem; font-size: 0.88rem; }
.btn-lg { padding: 0.82rem 1.4rem; font-size: 1.02rem; }

.text-link {
  display: inline-flex; align-items: center; gap: 0.4rem;
  color: var(--text-soft); font-weight: 600; text-decoration: none;
  transition: color 0.18s var(--ease), gap 0.18s var(--ease);
}
.text-link i { color: var(--accent); transition: transform 0.18s var(--ease); }
.text-link:hover { color: var(--text); gap: 0.55rem; }

/* ---------- nav ---------- */
#nav-sentinel { position: absolute; top: 0; width: 1px; height: 1px; }
.nav {
  position: sticky; top: 0; z-index: 100;
  border-bottom: 1px solid transparent;
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  transition: border-color 0.26s var(--ease), background 0.26s var(--ease);
}
.nav.scrolled { border-color: var(--line); background: color-mix(in oklab, var(--bg) 90%, transparent); }
.nav-inner {
  width: min(100% - 48px, var(--container)); margin-inline: auto;
  height: var(--nav-h); display: flex; align-items: center; gap: 2rem;
}
.brand { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--text); text-decoration: none; font-weight: 700; font-family: var(--font-display); letter-spacing: -0.02em; font-size: 1.14rem; }
.brand b { color: var(--accent); font-weight: 700; }
.brand-mark { width: 28px; height: 28px; flex: 0 0 auto; }
.mark-shell { fill: var(--accent); }
.mark-key { fill: var(--bg); }
.mark-key-1 { opacity: 0.55; }
.mark-key-2 { opacity: 1; }

.nav-links { display: flex; gap: clamp(1rem, 2.4vw, 1.8rem); margin-left: auto; }
.nav-links a { color: var(--text-dim); text-decoration: none; font-size: 0.92rem; font-weight: 500; transition: color 0.18s var(--ease); }
.nav-links a:hover { color: var(--text); }
.nav-actions { display: flex; align-items: center; }

/* ---------- hero ---------- */
.hero { padding-top: clamp(40px, 6vw, 72px); padding-bottom: clamp(56px, 8vw, 104px); overflow: hidden; }
.hero-aura {
  position: absolute; top: -14%; right: -6%; width: 44rem; height: 44rem; z-index: 0;
  pointer-events: none; border-radius: 50%;
  background: radial-gradient(circle, var(--aura), transparent 66%);
  filter: blur(20px);
}
.hero-grid {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 430px);
  gap: clamp(2.4rem, 5vw, 4.5rem); align-items: center;
  min-height: calc(82dvh - var(--nav-h));
}
.hero-copy { min-width: 0; }
.hero-chip {
  display: inline-flex; align-items: center; gap: 0.5rem; width: fit-content;
  margin-bottom: 1.5rem; padding: 0.4rem 0.85rem;
  border: 1px solid var(--line-strong); border-radius: var(--r-pill);
  background: color-mix(in oklab, var(--surface) 70%, transparent); color: var(--text-soft);
  font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.01em;
}
.chip-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

.hero-sub { max-width: 36rem; margin-top: 1.4rem; color: var(--text-soft); font-size: clamp(1.05rem, 1.4vw, 1.2rem); }
.hero-ctas { display: flex; align-items: center; flex-wrap: wrap; gap: 1.2rem; margin-top: 2.2rem; }

.hero-console { position: relative; z-index: 2; min-width: 0; }
.panel-shell {
  position: relative; padding: 8px; border-radius: calc(var(--r-card) + 6px);
  border: 1px solid var(--line-strong);
  background: linear-gradient(160deg, color-mix(in oklab, var(--accent) 8%, var(--surface)), var(--bg-2));
  box-shadow: var(--shadow-2);
}
.panel-hint { display: flex; align-items: center; gap: 0.4rem; justify-content: flex-end; margin-top: 0.85rem; color: var(--text-dim); font-size: 0.8rem; }
.panel-hint i { color: var(--accent); }

/* ---------- proof strip ---------- */
.proof { padding-block: clamp(28px, 4vw, 44px); }
.proof-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 2rem;
  border-block: 1px solid var(--line); padding-block: 1.3rem;
}
.proof-inner p { color: var(--text-dim); font-size: 0.82rem; }
.logo-wall { list-style: none; display: flex; align-items: center; flex-wrap: wrap; gap: clamp(1.2rem, 3vw, 2.2rem); }
.logo-wall img { opacity: 0.55; filter: grayscale(1); transition: opacity 0.2s var(--ease), filter 0.2s var(--ease); }
.logo-wall li:hover img { opacity: 1; filter: grayscale(0); }

/* ---------- capabilities : bento ---------- */
.bento {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem;
  grid-template-areas:
    "feature small1 small2"
    "feature wide   wide";
}
.bento-cell {
  position: relative; display: flex; flex-direction: column; gap: 0.7rem;
  border: 1px solid var(--line); border-radius: var(--r-card);
  background: var(--surface); padding: clamp(1.3rem, 2.2vw, 1.7rem);
  transition: transform 0.26s var(--ease), border-color 0.26s var(--ease), background 0.26s var(--ease);
}
.bento-cell:hover { transform: translateY(-3px); border-color: var(--accent-line); }
.cell-top { display: flex; flex-direction: column; gap: 0.55rem; }
.cell-feature { grid-area: feature; justify-content: space-between; gap: 1rem; background: linear-gradient(165deg, var(--accent-soft), transparent 60%), var(--surface); }
.cell-wide { grid-area: wide; flex-direction: row; align-items: center; gap: 1.2rem; }
.cell-wide-copy { display: flex; flex-direction: column; gap: 0.5rem; }
.cell-kicker { color: var(--accent); font-family: var(--font-mono); font-size: 0.72rem; font-weight: 600; }
.cell-icon { color: var(--accent); font-size: 1.7rem; }
.cell-wide .cell-icon { font-size: 2.4rem; flex: 0 0 auto; }
.bento-cell h3 { max-width: 22ch; }
.bento-cell p { color: var(--text-dim); font-size: 0.95rem; max-width: 38ch; }
.cell-feature h3 { font-size: 1.45rem; }

.mini-roster { display: flex; align-items: center; margin-top: 1.6rem; }
.mini-roster .rbx-avatar { width: 46px; height: 46px; margin-left: -10px; border: 2px solid var(--surface); }
.mini-roster .rbx-avatar:first-child { margin-left: 0; }
.rbx-avatar--more {
  display: grid; place-items: center; background: var(--surface-2); color: var(--text-soft);
  font-family: var(--font-mono); font-size: 0.78rem; font-weight: 600;
}

/* ---------- how : steps ---------- */
.steps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; counter-reset: step; }
.step {
  position: relative; display: flex; flex-direction: column; gap: 0.6rem;
  border: 1px solid var(--line); border-radius: var(--r-card);
  background: var(--surface); padding: clamp(1.4rem, 2.4vw, 1.9rem);
  transition: border-color 0.26s var(--ease), transform 0.26s var(--ease);
}
.step:hover { border-color: var(--accent-line); transform: translateY(-3px); }
.step-n { font-family: var(--font-mono); font-size: 2rem; font-weight: 600; color: var(--accent); opacity: 0.5; line-height: 1; }
.step-icon { color: var(--accent); font-size: 1.6rem; margin-top: 0.3rem; }
.step h3 { margin-top: 0.5rem; }
.step p { color: var(--text-dim); font-size: 0.95rem; }

/* ---------- use cases : split ---------- */
.usecases-grid { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: clamp(2.4rem, 5vw, 4.5rem); align-items: start; }
.usecases-copy { position: sticky; top: calc(var(--nav-h) + 28px); }
.usecases-list { list-style: none; display: grid; gap: 0.85rem; }
.usecases-list li {
  display: grid; grid-template-columns: auto 1fr; gap: 1.1rem; align-items: start;
  border: 1px solid var(--line); border-left: 2px solid var(--accent-line); border-radius: var(--r-card);
  background: var(--surface); padding: 1.3rem 1.5rem;
  transition: border-color 0.24s var(--ease), transform 0.24s var(--ease);
}
.usecases-list li:hover { transform: translateX(3px); border-left-color: var(--accent); }
.usecases-list i { color: var(--accent); font-size: 1.6rem; }
.usecases-list h3 { margin-bottom: 0.3rem; }
.usecases-list p { color: var(--text-dim); font-size: 0.95rem; max-width: 48ch; }

/* ---------- privacy : wide panel ---------- */
.privacy-panel {
  border: 1px solid var(--line-strong); border-radius: calc(var(--r-card) + 6px);
  background: linear-gradient(160deg, var(--accent-soft), transparent 42%), var(--bg-2);
  padding: clamp(1.8rem, 4vw, 3.2rem);
}
.privacy-head { max-width: 60ch; margin-bottom: 2.2rem; }
.privacy-facts { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.privacy-facts li {
  display: grid; gap: 0.35rem; align-content: start;
  border: 1px solid var(--line); border-radius: var(--r-card);
  background: color-mix(in oklab, var(--surface) 70%, transparent); padding: 1.3rem;
}
.privacy-facts i { color: var(--accent); font-size: 1.5rem; margin-bottom: 0.4rem; }
.privacy-facts strong { font-size: 1rem; }
.privacy-facts span { color: var(--text-dim); font-size: 0.9rem; }

/* ---------- faq ---------- */
.faq-inner { max-width: 760px; }
.faq-list { display: grid; gap: 0.7rem; }
.faq-list details { border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); transition: border-color 0.22s var(--ease); }
.faq-list details[open] { border-color: var(--accent-line); }
.faq-list summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 1rem; cursor: pointer; padding: 1.1rem 1.3rem; font-weight: 600; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary i { color: var(--accent); transition: transform 0.22s var(--ease); flex: 0 0 auto; }
.faq-list details[open] summary i { transform: rotate(45deg); }
.faq-list details p { max-width: 64ch; padding: 0 1.3rem 1.2rem; color: var(--text-dim); }

/* ---------- final cta ---------- */
.final-panel {
  position: relative; overflow: hidden; display: grid; justify-items: center; text-align: center;
  max-width: 720px; margin-inline: auto;
  border: 1px solid var(--accent-line); border-radius: calc(var(--r-card) + 6px);
  background: linear-gradient(160deg, var(--accent-soft), transparent 55%), var(--surface);
  padding: clamp(2rem, 5vw, 3.6rem);
}
.final-panel p { max-width: 46ch; margin: 0.9rem 0 1.8rem; color: var(--text-soft); font-size: 1.06rem; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); background: var(--bg-2); padding-block: 48px 28px; }
.footer-grid { display: flex; justify-content: space-between; gap: 3rem; flex-wrap: wrap; margin-bottom: 2.2rem; }
.footer-brand { max-width: 22rem; }
.footer-brand p { margin-top: 0.85rem; color: var(--text-dim); font-size: 0.92rem; }
.footer-links { display: flex; flex-direction: column; gap: 0.6rem; }
.footer-links a { color: var(--text-dim); text-decoration: none; font-size: 0.92rem; transition: color 0.18s var(--ease); }
.footer-links a:hover { color: var(--text); }
.footer-legal { border-top: 1px solid var(--line); padding-top: 1.4rem; }
.footer-legal p { color: var(--text-dim); font-size: 0.82rem; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 26px; z-index: 110; translate: -50% 18px;
  max-width: min(420px, calc(100vw - 32px));
  border: 1px solid var(--accent-line); border-radius: var(--r-control);
  background: color-mix(in oklab, var(--surface) 94%, transparent); box-shadow: var(--shadow-2);
  color: var(--text); padding: 0.78rem 1.16rem; font-weight: 600; font-size: 0.9rem;
  opacity: 0; pointer-events: none; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transition: opacity 0.24s var(--ease), translate 0.24s var(--ease);
}
.toast.show { opacity: 1; translate: -50% 0; }

/* ---------- motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  html.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
  html.js .reveal.in { opacity: 1; transform: none; }
  .hero-copy { animation: rise 0.7s var(--ease) both; }
  .hero-console { animation: rise 0.7s 0.1s var(--ease) both; }
  @keyframes rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .hero-grid { grid-template-columns: 1fr; min-height: auto; gap: 2.6rem; }
  .hero-console { max-width: 460px; }
  .bento { grid-template-columns: 1fr 1fr; grid-template-areas: "feature feature" "small1 small2" "wide wide"; }
  .usecases-grid { grid-template-columns: 1fr; gap: 2rem; }
  .usecases-copy { position: static; }
}
@media (max-width: 720px) {
  .container { width: min(100% - 32px, var(--container)); }
  section { padding-block: 60px; }
  .nav-links { display: none; }
  .nav-inner { gap: 1rem; }
  .proof-inner { flex-direction: column; align-items: flex-start; gap: 1.1rem; }
  .bento { grid-template-columns: 1fr; grid-template-areas: "feature" "small1" "small2" "wide"; }
  .cell-wide { flex-direction: column; align-items: flex-start; }
  .steps { grid-template-columns: 1fr; }
  .privacy-facts { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .hero-ctas { flex-direction: column; align-items: stretch; }
  .hero-ctas .btn { justify-content: center; }
  .acc-footer-bar { flex-wrap: wrap; }
}
