/* ============================================================
   ActiScale — Design System
   "The Refinery Instrument Panel"
   Source of truth: DESIGN.md. Agents: use these tokens/classes only.
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* color */
  --bg: #07090C;
  --bg-soft: #0D1117;
  --panel: #11161D;
  --line: #1E262F;
  --ink: #E8EDF3;
  --muted: #8C9AA8;
  --accent: #4ADE80;
  --accent-dark: #22A561;
  --accent-2: #38BDF8;
  --danger: #F87171;

  /* radius */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-pill: 999px;

  /* spacing */
  --s-xs: 4px;
  --s-sm: 8px;
  --s-md: 16px;
  --s-lg: 32px;
  --s-xl: 64px;

  /* layout */
  --maxw: 1160px;
  --nav-h: 64px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: clamp(15px, 1.1vw, 19px);
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "tnum" 1, "cv05" 1;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }

/* ---------- Typography ---------- */
.display {
  font-size: clamp(34px, 5.2vw, 60px);
  font-weight: 700; line-height: 1.05; letter-spacing: -0.02em;
  text-wrap: balance;
}
.headline {
  font-size: clamp(26px, 3.4vw, 40px);
  font-weight: 700; line-height: 1.15; letter-spacing: -0.02em;
  text-wrap: balance; margin: 0;
}
.title {
  font-size: clamp(18px, 1.6vw, 21px);
  font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; margin: 0;
}
.body { font-size: clamp(15px, 1.1vw, 19px); line-height: 1.65; }
.lead { font-size: clamp(17px, 1.35vw, 21px); line-height: 1.6; color: var(--muted); text-wrap: pretty; }
.prose { max-width: 68ch; text-wrap: pretty; }
.prose p { color: var(--muted); }
.label {
  font-size: 13px; font-weight: 600; line-height: 1.2; letter-spacing: 0.02em;
}
.eyebrow {
  font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 var(--s-md);
}
.stat {
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 700; line-height: 1; letter-spacing: -0.02em;
  color: var(--accent); font-feature-settings: "tnum" 1;
}
.muted { color: var(--muted); }
.ink { color: var(--ink); }
.accent { color: var(--accent); }
.balance { text-wrap: balance; }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(20px, 5vw, 40px); }
.section { padding-block: clamp(56px, 9vw, 112px); }
.section--soft { background: var(--bg-soft); }
.section-head { max-width: 62ch; margin-bottom: var(--s-lg); }
.section-head .headline + .lead { margin-top: var(--s-md); }
.stack > * + * { margin-top: var(--s-md); }
.grid { display: grid; gap: var(--s-md); }
@media (min-width: 720px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.wrap--wide { max-width: 1360px; }
.hidden { display: none !important; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 13px; font-weight: 600; letter-spacing: 0.02em;
  padding: 13px 22px; border-radius: var(--r-md); border: 1px solid transparent;
  transition: background .18s var(--ease), color .18s var(--ease),
              transform .18s var(--ease), box-shadow .18s var(--ease);
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(74,222,128,0.35), 0 8px 30px rgba(74,222,128,0.12);
}
.btn-ghost { background: var(--panel); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--line); transform: translateY(-1px); }
.btn-lg { padding: 16px 28px; font-size: 14px; }
.btn-block { width: 100%; }

/* ---------- Panels / Cards ---------- */
.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 24px;
}
.panel--inset { background: var(--bg-soft); }
.card-hover { transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease); }
.card-hover:hover { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(0,0,0,0.45); border-color: #2a3542; }

/* link card */
a.panel { display: block; color: inherit; }
a.panel .arrow { color: var(--accent); transition: transform .18s var(--ease); display: inline-block; }
a.panel:hover .arrow { transform: translateX(4px); }

/* ---------- Chips / pills ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 500; color: var(--muted);
  padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--bg-soft);
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.badge {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--bg); background: var(--accent);
  padding: 3px 9px; border-radius: var(--r-pill);
}

/* ---------- Divider ---------- */
.hr { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ============================================================
   Navigation
   ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  display: flex; align-items: center;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background .25s var(--ease), border-color .25s var(--ease);
}
.nav.is-scrolled { background: rgba(13,17,23,0.85); backdrop-filter: saturate(140%) blur(12px); border-bottom-color: var(--line); }
.nav .wrap { display: flex; align-items: center; gap: var(--s-lg); width: 100%; }
.nav-brand { display: flex; align-items: center; gap: 10px; }
.nav-brand svg { height: 26px; width: auto; }
.nav-brand .motto { font-size: 11px; color: var(--muted); font-weight: 500; max-width: 120px; line-height: 1.15; }
.nav-links { display: flex; align-items: center; gap: var(--s-lg); margin-left: auto; }
.nav-links a { font-size: 13px; font-weight: 600; color: var(--muted); transition: color .15s var(--ease); position: relative; padding-block: 6px; }
.nav-links a:hover { color: var(--ink); }
.nav-links a.is-active { color: var(--ink); }
.nav-links a.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--accent); }
.nav-actions { display: flex; align-items: center; gap: var(--s-md); }
.lang-switch { background: transparent; border: 1px solid var(--line); border-radius: var(--r-md); color: var(--muted); padding: 8px 10px; font-size: 12px; font-weight: 600; }
.lang-switch:hover { color: var(--ink); border-color: #2a3542; }
.nav-toggle { display: none; background: transparent; border: 1px solid var(--line); border-radius: var(--r-md); padding: 8px; color: var(--ink); }
.nav-toggle svg { width: 20px; height: 20px; }

@media (max-width: 860px) {
  .nav .motto { display: none; }
  .nav-links { position: fixed; inset: var(--nav-h) 0 auto 0; flex-direction: column; align-items: stretch;
    gap: 0; background: var(--bg-soft); border-bottom: 1px solid var(--line); padding: var(--s-sm) 0;
    margin: 0; transform: translateY(-8px); opacity: 0; pointer-events: none; transition: .2s var(--ease); }
  .nav-links.is-open { transform: none; opacity: 1; pointer-events: auto; }
  .nav-links a { padding: 14px clamp(20px,5vw,40px); }
  .nav-links a.is-active::after { display: none; }
  .nav-links .btn { margin: var(--s-sm) clamp(20px,5vw,40px); }
  .nav-toggle { display: inline-flex; }
  .nav-actions .btn:not(.lang-switch) { display: none; }
}

/* ============================================================
   Hero
   ============================================================ */
.hero { position: relative; overflow: hidden; padding-block: clamp(72px, 12vw, 150px); }
.hero-video, .hero-poster {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  z-index: 0;
}
.hero-video { opacity: 0.42; }
.hero-veil {
  position: absolute; inset: 0; z-index: 1;
  background:
    radial-gradient(120% 90% at 20% 10%, rgba(7,9,12,0.35), rgba(7,9,12,0.92) 70%),
    linear-gradient(180deg, rgba(7,9,12,0.55) 0%, rgba(7,9,12,0.85) 100%);
}
.hero .wrap { position: relative; z-index: 2; }
.hero-inner { max-width: 46rem; }
.hero .display { margin: 0 0 var(--s-md); }
.hero .lead { max-width: 40rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: var(--s-md); margin-top: var(--s-lg); }
.trust-bar { display: flex; flex-wrap: wrap; gap: var(--s-md) var(--s-lg); margin-top: var(--s-xl); }
.trust-bar .chip { background: rgba(13,17,23,0.6); }

/* ============================================================
   Stat readouts
   ============================================================ */
.stat-row { display: grid; gap: var(--s-lg); }
@media (min-width: 720px) { .stat-row-3 { grid-template-columns: repeat(3, 1fr); } }
.stat-block .stat { margin-bottom: var(--s-sm); }
.stat-block .label { color: var(--muted); font-weight: 500; letter-spacing: 0; line-height: 1.5; }
.note { font-size: 12px; color: var(--muted); margin-top: var(--s-lg); }

/* ============================================================
   "See the data" — tri-clip (signature)
   ============================================================ */
.tri { display: grid; gap: var(--s-md); }
@media (min-width: 860px) { .tri { grid-template-columns: repeat(3, 1fr); } }
.clip {
  border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
  background: var(--panel);
}
.clip-media { position: relative; aspect-ratio: 4 / 3; background: var(--bg-soft); overflow: hidden; }
.clip-media video, .clip-media .poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* annotation overlay layered on top of the video (Structured / VLA-ready tiers).
   object-fit:fill is safe: the overlay SVG is 4:3, same as the media, so no distortion. */
.clip-ov { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; z-index: 2; pointer-events: none; }
.clip-media .tier-tag {
  position: absolute; left: 10px; top: 10px; z-index: 3;
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  padding: 4px 10px; border-radius: var(--r-pill);
  background: rgba(7,9,12,0.72); color: var(--ink); border: 1px solid var(--line);
}
.clip-media .tier-tag.is-vla { color: var(--accent); border-color: rgba(74,222,128,0.4); }
.clip-body { padding: 18px 20px; }
.clip-body .title { margin-bottom: 6px; }
.clip-body p { margin: 0; color: var(--muted); font-size: 15px; }

/* placeholder poster look (until real footage lands) */
.poster {
  display: grid; place-items: center;
  background:
    linear-gradient(135deg, #0b0f14 0%, #10161e 100%);
}
.poster::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.03) 0 1px, transparent 1px 46px),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.03) 0 1px, transparent 1px 46px);
  opacity: 0.6;
}
.poster .poster-label { position: relative; z-index: 1; font-size: 12px; color: var(--muted); letter-spacing: 0.04em; }
.poster.is-structured::after, .poster.is-vla::after {
  content: ""; position: absolute; z-index: 1;
}

/* ============================================================
   Refinement pipeline (signature)
   ============================================================ */
.pipe { counter-reset: step; display: grid; gap: 2px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
@media (min-width: 720px) { .pipe { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .pipe { grid-template-columns: repeat(6, 1fr); } }
.pipe-step {
  counter-increment: step;
  background: var(--panel); padding: 22px 20px; position: relative;
  display: flex; flex-direction: column; gap: 8px;
  transition: background .18s var(--ease);
}
.pipe-step:hover { background: #141b23; }
.pipe-step .num {
  font-size: 12px; font-weight: 700; color: var(--accent);
  font-feature-settings: "tnum" 1;
}
.pipe-step .num::before { content: counter(step, decimal-leading-zero); }
.pipe-step .title { font-size: 16px; }
.pipe-step p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.5; }
.pipe-step .glyph { width: 22px; height: 22px; color: var(--accent); opacity: 0.9; margin-bottom: 2px; }
.pipe-kicker { max-width: 40ch; }

/* ============================================================
   How it works — 3 columns, weight on middle
   ============================================================ */
.flow { display: grid; gap: var(--s-md); align-items: stretch; }
@media (min-width: 900px) { .flow { grid-template-columns: 1fr 1.3fr 1fr; align-items: center; } }
.flow-col-head { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--s-md); }
.flow-core { border-color: rgba(74,222,128,0.35); box-shadow: 0 0 0 1px rgba(74,222,128,0.12); }
.flow-core .flow-col-head { color: var(--accent); }
.flow-item + .flow-item { margin-top: var(--s-md); padding-top: var(--s-md); border-top: 1px solid var(--line); }
.flow-item .title { font-size: 16px; margin-bottom: 4px; }
.flow-item p { margin: 0; font-size: 14px; color: var(--muted); }
.pillars { margin-top: var(--s-lg); }
.pillar .title { font-size: 16px; margin-bottom: 4px; }
.pillar p { margin: 0; color: var(--muted); font-size: 14px; }

/* ============================================================
   Pricing
   ============================================================ */
.tiers { display: grid; gap: var(--s-md); align-items: stretch; }
@media (min-width: 860px) { .tiers { grid-template-columns: repeat(3, 1fr); } }
.tier { display: flex; flex-direction: column; position: relative; }
.tier.is-featured { border-color: rgba(74,222,128,0.5); box-shadow: 0 0 0 1px rgba(74,222,128,0.35), 0 8px 30px rgba(74,222,128,0.08); }
.tier .badge { position: absolute; top: -11px; left: 24px; }
.tier .tier-name { font-size: 14px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.tier .tier-price { font-size: clamp(26px, 3vw, 36px); font-weight: 700; letter-spacing: -0.02em; margin: 8px 0 12px; color: var(--ink); }
.tier .tier-price .accent { color: var(--accent); }
.tier .tier-desc { color: var(--muted); font-size: 15px; flex: 1; }
.tier .btn { margin-top: var(--s-lg); }
.anchor-note { margin-top: var(--s-lg); border-left: 1px solid var(--accent); padding-left: var(--s-md); color: var(--muted); max-width: 70ch; }

/* comparison table */
.cmp { width: 100%; border-collapse: collapse; font-size: 14px; }
.cmp th, .cmp td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.cmp thead th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.cmp td.center, .cmp th.center { text-align: center; }
.cmp .yes { color: var(--accent); }
.cmp .no { color: var(--line); }
.cmp-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); }

/* ============================================================
   Feature grid (rights, quality, etc.)
   ============================================================ */
.feat .glyph { width: 24px; height: 24px; color: var(--accent); margin-bottom: var(--s-md); }
.feat .title { margin-bottom: 6px; }
.feat p { margin: 0; color: var(--muted); font-size: 15px; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--muted); }
.checklist li:last-child { border-bottom: 0; }
.checklist .tick { color: var(--accent); flex-shrink: 0; margin-top: 3px; }

/* ============================================================
   Collector band (different color register)
   ============================================================ */
.band {
  background: linear-gradient(180deg, #0c1218, var(--bg-soft));
  border-block: 1px solid var(--line);
}
.band .headline { margin-bottom: var(--s-md); }
.steps { counter-reset: n; display: grid; gap: var(--s-md); }
@media (min-width: 720px) { .steps-3 { grid-template-columns: repeat(3,1fr); } }
.step { counter-increment: n; }
.step .n { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line); color: var(--accent); font-weight: 700; font-size: 15px; margin-bottom: var(--s-md); }
.step .n::before { content: counter(n); }
.step .title { margin-bottom: 6px; }
.step p { margin: 0; color: var(--muted); font-size: 15px; }

/* transparency notice (anti-MLM, required on collector surfaces) */
.notice {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(74,222,128,0.05), rgba(74,222,128,0.02));
  border-radius: var(--r-md);
  padding: 16px 20px 16px 44px; color: var(--ink); font-size: 15px;
  position: relative;
}
.notice::before {
  content: ""; position: absolute; left: 20px; top: 22px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 3px rgba(74,222,128,0.18);
}
.notice strong { color: var(--accent); font-weight: 600; }

/* ============================================================
   FAQ
   ============================================================ */
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--r-pill); margin-bottom: var(--s-lg); }
.tab { border: 0; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; padding: 8px 16px; border-radius: var(--r-pill); }
.tab.is-active { background: var(--panel); color: var(--ink); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 18px 0; display: flex; justify-content: space-between; gap: 16px; font-weight: 600; font-size: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-weight: 400; font-size: 22px; line-height: 1; transition: transform .2s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 18px; color: var(--muted); max-width: 68ch; }

/* ============================================================
   Split CTA
   ============================================================ */
.split { display: grid; gap: var(--s-md); }
@media (min-width: 780px) { .split { grid-template-columns: 1fr 1fr; } }
.split .panel { display: flex; flex-direction: column; }
.split .panel .title { margin-bottom: 8px; }
.split .panel p { color: var(--muted); flex: 1; margin: 0 0 var(--s-lg); }

/* ============================================================
   Forms
   ============================================================ */
.form { max-width: 560px; }
.field { margin-bottom: var(--s-md); }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field .req { color: var(--accent); }
.input, .select, .textarea {
  width: 100%; background: var(--bg-soft); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 12px 14px; font: inherit; font-size: 15px;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(74,222,128,0.14); }
.textarea { min-height: 110px; resize: vertical; }
.field-error .input, .field-error .select, .field-error .textarea { border-color: var(--danger); }
.error-msg { color: var(--danger); font-size: 13px; margin-top: 6px; }
.form-note { color: var(--muted); font-size: 13px; margin-top: var(--s-md); }
.form-row { display: grid; gap: var(--s-md); }
@media (min-width: 620px) { .form-row-2 { grid-template-columns: 1fr 1fr; } }

/* ============================================================
   Footer
   ============================================================ */
.footer { border-top: 1px solid var(--line); background: var(--bg-soft); padding-block: var(--s-xl) var(--s-lg); }
.footer-top { display: grid; gap: var(--s-lg); grid-template-columns: 1fr; }
@media (min-width: 780px) { .footer-top { grid-template-columns: 1.4fr repeat(4, 1fr); } }
.footer-brand svg { height: 26px; margin-bottom: var(--s-md); }
.footer-brand .motto { color: var(--muted); font-size: 14px; max-width: 30ch; }
.footer-col h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 var(--s-md); font-weight: 600; }
.footer-col a { display: block; color: var(--muted); font-size: 14px; padding: 5px 0; transition: color .15s var(--ease); }
.footer-col a:hover { color: var(--ink); }
.footer-bottom { display: flex; flex-wrap: wrap; gap: var(--s-md); justify-content: space-between; align-items: center;
  margin-top: var(--s-xl); padding-top: var(--s-lg); border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

/* ============================================================
   Utility: page hero (interior pages, no video)
   ============================================================ */
.page-hero { padding-block: clamp(56px, 9vw, 104px) clamp(32px, 5vw, 56px); border-bottom: 1px solid var(--line); }
.page-hero .display { font-size: clamp(30px, 4.4vw, 50px); }
.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: var(--s-md); }
.breadcrumb a:hover { color: var(--ink); }

/* reduced motion: swap video for poster */
@media (prefers-reduced-motion: reduce) {
  .hero-video { display: none; }
  .clip-media video { display: none; }
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
