/* ==========================================================================
   Pellar landing page
   Palette, type and radii are lifted from the product itself:
   veles-studio/src/styles/tokens.ts + globals.css. See pellar-app-design.md.
   ========================================================================== */

:root {
  --surface-0: #050810;
  --surface-1: #0a0f1c;
  --surface-2: #111827;
  --surface-3: #1f2937;
  --text-1: #f9fafb;
  --text-2: #9ca3af;
  --text-3: #8792a5;
  --border: #1f2937;
  --blue: #4d65ff;
  --blue-hover: #4057ea;
  --crimson: #dc2626;

  --r-sm: .375rem;
  --r-md: .5rem;
  --r-lg: .75rem;
  --r-display: 2px;

  --sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;

  --wrap: 1140px;
  --gap: clamp(3.75rem, 8vw, 6.5rem);

  /* Backdrop the on-air graphics sit on. They are transparent PNG/WebP built
     to key over video, so they need their own surface in both themes. */
  --vis-glow: #16213c;
  --vis-base: var(--surface-2);
  --vis-grid: var(--border);
}

/* Light is a dimmed off-white with darkened brand colours — same rule the app uses. */
html.light {
  --surface-0: #eaecf0;
  --surface-1: #f2f3f6;
  --surface-2: #e2e4e9;
  --surface-3: #d4d7dd;
  --text-1: #111827;
  --text-2: #4b5563;
  --text-3: #586174;
  --border: #d1d5db;
  --blue: #3b52e6;
  --blue-hover: #2d42c8;
  --crimson: #b91c1c;

  /* The graphics stay dark in light mode — they are broadcast panels, and
     dropping them onto white would misrepresent how they look on air. */
  --vis-glow: #243357;
  --vis-base: #1b2436;
  --vis-grid: #313d55;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--surface-0);
  color: var(--text-1);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(1.15rem, 4vw, 2rem); }
.narrow { max-width: 780px; }
.center { text-align: center; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--blue); color: #fff; padding: .7rem 1.1rem; border-radius: 0 0 var(--r-md) 0;
}
.skip:focus { left: 0; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: var(--r-sm); }

/* ── Type ────────────────────────────────────────────────── */
h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .6em; font-weight: 600; }
h1 { font-size: clamp(2.4rem, 5.4vw, 4rem); letter-spacing: -.045em; }
h2 { font-size: clamp(1.6rem, 3.3vw, 2.4rem); }
h3 { font-size: 1.08rem; font-weight: 600; }
p  { margin: 0 0 1.1em; color: var(--text-2); }
.lede { font-size: clamp(1.03rem, 1.6vw, 1.2rem); color: var(--text-2); max-width: 46ch; }
.sub  { color: var(--text-2); max-width: 62ch; margin-bottom: 2.6rem; }
.center .sub { margin-inline: auto; }
.micro { font-size: .84rem; color: var(--text-3); }
.dim   { color: var(--text-3); }
.mono  { font-family: var(--mono); }
.eyebrow {
  font-family: var(--mono); font-size: .74rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 1.4rem;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-weight: 500; text-decoration: none; cursor: pointer;
  padding: .78rem 1.35rem; border-radius: var(--r-display); border: 1px solid transparent;
  transition: background-color .16s ease, border-color .16s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-hover); }
.btn-sm { min-height: 44px; padding: .55rem 1rem; font-size: .92rem; }

/* ── Nav ─────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface-0) 86%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-in { display: flex; align-items: center; gap: 1.5rem; min-height: 3.75rem; }
.brand { min-height: 44px; display: flex; align-items: center; gap: .6rem; font-weight: 600; text-decoration: none; letter-spacing: -.02em; }
.brand img { width: 28px; height: 28px; padding: 4px; object-fit: contain; background: #050810; border: 1px solid #1f2937; border-radius: var(--r-display); }
.nav-links { display: flex; gap: 1.5rem; margin-left: auto; font-size: .92rem; }
.nav-links a { min-height: 32px; display: inline-flex; align-items: center; color: var(--text-2); text-decoration: none; }
.nav-links a:hover { color: var(--text-1); }
.nav-right { display: flex; align-items: center; gap: .6rem; margin-left: auto; }
.nav-links + .nav-right { margin-left: 0; }
.theme-btn {
  background: transparent; border: 1px solid var(--border); color: var(--text-2);
  width: 44px; height: 44px; border-radius: var(--r-display); cursor: pointer; font-size: .9rem; line-height: 1;
}
.theme-btn:hover { color: var(--text-1); border-color: var(--blue); }

/* ── Hero ────────────────────────────────────────────────── */
.hero { padding: clamp(3.5rem, 7vw, 6rem) 0 clamp(3rem, 5vw, 4.5rem); }
.hero-in { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(2.5rem, 6vw, 5rem); align-items: center; }
@media (max-width: 960px) { .hero-in { grid-template-columns: 1fr; } }
.hero-copy h1 { max-width: 11ch; }

.signup { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.8rem 0 .8rem; max-width: 480px; }
.signup input[type=email], .signup select {
  flex: 1 1 15rem; min-width: 0;
  background: var(--surface-1); color: var(--text-1);
  border: 1px solid var(--border); border-radius: var(--r-md);
  padding: .78rem 1rem; font: inherit; font-size: .97rem;
}
.signup input::placeholder { color: var(--text-3); }
.signup input:focus, .signup select:focus { border-color: var(--blue); outline: 2px solid var(--blue); outline-offset: 2px; }
.signup-msg { flex: 1 0 100%; margin: .3rem 0 0; font-size: .88rem; color: var(--blue); min-height: 1.2em; }
.signup-msg.err { color: #f87171; }
.signup-lg { max-width: 620px; margin-inline: auto; }

.hero-proof {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  list-style: none; margin: 2rem 0 0; padding: 1rem 0 0; border-top: 1px solid var(--border);
}
.hero-proof li { padding-right: .8rem; }
.hero-proof strong { display: block; color: var(--text-1); font-family: var(--mono); font-size: .88rem; font-weight: 600; }
.hero-proof span { display: block; color: var(--text-3); font-size: .75rem; line-height: 1.35; margin-top: .25rem; }

/* Stream frame — the product shown where it actually lives */
.hero-vis .frame {
  position: relative; aspect-ratio: 16/9; border-radius: var(--r-display);
  border: 1px solid var(--border); overflow: hidden;
  background: var(--vis-base);
  box-shadow: 12px 12px 0 var(--surface-1);
  display: grid; place-items: center;
}
.hero-vis .frame::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--vis-grid) 1px, transparent 1px),
                    linear-gradient(90deg, var(--vis-grid) 1px, transparent 1px);
  background-size: 44px 44px; opacity: .16;
}
.frame-bar {
  position: absolute; top: .75rem; left: .85rem; z-index: 3;
  font-family: var(--mono); font-size: .66rem; letter-spacing: .1em;
  color: var(--text-2); display: flex; align-items: center; gap: .4rem;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--crimson); display: inline-block; }
.dot.live { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .25 } }
.g-center { position: relative; z-index: 2; width: 74%; transform: translateY(-7%); }
.g-lower  { position: absolute; z-index: 2; left: 5%; bottom: 5%; width: 44%; }
.caption { font-size: .8rem; color: var(--text-3); margin: .9rem 0 0; }

/* ── Compatibility roadmap ───────────────────────────────── */
.compat { border-block: 1px solid var(--border); background: var(--surface-1); padding-block: clamp(2.5rem, 5vw, 4rem); }
.compat-head { display: grid; grid-template-columns: minmax(0, .85fr) minmax(18rem, 1fr); gap: 2rem; align-items: end; margin-bottom: 1.8rem; }
.compat-head .eyebrow { margin-bottom: .7rem; }
.compat-head h2 { margin: 0; }
.compat-head > p { margin: 0; max-width: 56ch; font-size: .94rem; }
.compat-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); border-left: 1px solid var(--border);
}
.compat-app {
  min-width: 0; display: flex; align-items: center; gap: .9rem; padding: 1rem;
  border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.compat-app img { width: 30px; height: 30px; flex: 0 0 30px; object-fit: contain; }
.compat-app > span:last-child { min-width: 0; }
.compat-app strong { display: block; color: var(--text-1); font-size: .9rem; line-height: 1.25; }
.compat-app small { display: block; color: var(--text-3); font-family: var(--mono); font-size: .7rem; line-height: 1.35; margin-top: .22rem; text-transform: uppercase; letter-spacing: .04em; }
.compat-app.muted { opacity: .66; }
.compat-wordmark {
  width: 42px; height: 30px; flex: 0 0 42px; display: grid; place-items: center;
  color: var(--text-1); font-weight: 700; font-style: italic; letter-spacing: -.08em; font-size: .98rem;
  border: 1px solid var(--text-3); border-radius: 50%;
}
.compat-note { max-width: 100ch; margin: 1rem 0 0; color: var(--text-3); font-size: .74rem; line-height: 1.55; }

/* ── Bands ───────────────────────────────────────────────── */
.band { padding-block: var(--gap); }
.band + .band { border-top: 1px solid var(--border); }
.statement { font-size: clamp(1.35rem, 2.9vw, 2.05rem); font-weight: 500; letter-spacing: -.02em; line-height: 1.32; margin: 0; }

/* Steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; gap: 2.2rem; } }
.steps li { border-top: 2px solid var(--border); padding-top: 1.15rem; }
.steps .num { font-family: var(--mono); font-size: .78rem; color: var(--blue); display: block; margin-bottom: .7rem; }
.steps p { margin: 0; font-size: .96rem; }

/* Graphics grid */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 1.2rem; }
.card:nth-child(1), .card:nth-child(4), .card:nth-child(5) { grid-column: span 7; }
.card:nth-child(2), .card:nth-child(3), .card:nth-child(6) { grid-column: span 5; }
.card {
  margin: 0; border: 1px solid var(--border); border-radius: var(--r-display);
  background: var(--surface-1); overflow: hidden; transition: border-color .2s ease;
  display: flex; flex-direction: column;
}
.card:hover { border-color: var(--surface-3); }
/* Fixed ratio so a wide strip and a tall table still make an even grid. */
.card-vis {
  display: grid; place-items: center; padding: 1.5rem; min-height: 300px;
  background: var(--vis-base);
}
.card-vis img { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; }
.card figcaption {
  padding: 1.15rem 1.3rem 1.35rem; font-size: .93rem; color: var(--text-2);
  border-top: 1px solid var(--border); flex: 1;
}
.card figcaption strong { display: block; color: var(--text-1); font-weight: 600; margin: .35rem 0 .3rem; }
.tag {
  display: inline-block; font-family: var(--mono); font-size: .75rem; letter-spacing: .09em;
  text-transform: uppercase; color: var(--text-3);
}
.tag-accent { color: var(--blue); margin-bottom: 1rem; }

/* Voice */
.voice .big { font-size: clamp(1.1rem, 2.1vw, 1.4rem); color: var(--text-1); line-height: 1.45; max-width: 44ch; }
.vquote {
  margin: 2.2rem 0 0; padding: 1.15rem 1.4rem;
  border-left: 2px solid var(--blue); background: var(--surface-1);
  border-radius: 0 var(--r-md) var(--r-md) 0;
}
.vquote .mono { font-size: 1.02rem; color: var(--text-1); }

/* Proof */
.proof-hero { border: 1px solid var(--border); border-radius: var(--r-display); overflow: hidden; background: #000; }
.proof-hero img { width: 100%; display: block; }
.proof-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-top: 1rem; }
@media (max-width: 860px) { .proof-grid { grid-template-columns: repeat(2, 1fr); } }
.proof-grid figure { margin: 0; border: 1px solid var(--border); border-radius: var(--r-display); overflow: hidden; background: var(--surface-1); }
.proof-grid img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.proof-grid figcaption { padding: .7rem .85rem; font-size: .8rem; color: var(--text-3); }
.proof .micro.center { margin-top: 2.2rem; }

/* Early access */
.early-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--border); }
.early-grid > div { padding: 1.35rem 2rem 0 0; }
.early-grid .num { display: block; margin-bottom: 1.5rem; color: var(--blue); font-family: var(--mono); font-size: .76rem; }
.early-grid h3 { max-width: 18ch; }
.early-grid p { max-width: 30ch; margin: 0; font-size: .94rem; }

/* Questions */
details { border-bottom: 1px solid var(--border); }
details summary {
  cursor: pointer; padding: 1.1rem 2rem 1.1rem 0; position: relative;
  font-weight: 500; color: var(--text-1); list-style: none;
}
details summary::-webkit-details-marker { display: none; }
details summary::after {
  content: '+'; position: absolute; right: .25rem; top: 50%; transform: translateY(-50%);
  font-family: var(--mono); color: var(--text-3);
}
details[open] summary::after { content: '–'; color: var(--blue); }
details p { margin: 0 0 1.2rem; font-size: .96rem; max-width: 68ch; }

/* CTA + footer */
.cta { background: var(--surface-1); }
.foot { border-top: 1px solid var(--border); padding-block: 2.2rem; }
.foot-in p { margin: 0 0 .3rem; font-size: .9rem; color: var(--text-2); }

@media (max-width: 860px) {
  .nav-in { flex-wrap: wrap; gap: .35rem .8rem; padding-block: .35rem; }
  .brand { margin-right: auto; }
  .nav-right { margin-left: 0; }
  .nav-links {
    order: 3; width: 100%; margin: 0; padding: .1rem 0 .35rem;
    overflow-x: auto; gap: 1.15rem; white-space: nowrap; scrollbar-width: none;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .compat-head { grid-template-columns: 1fr; gap: .6rem; }
  .compat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid {
    display: flex; overflow-x: auto; gap: .9rem; padding-bottom: .75rem;
    scroll-snap-type: x mandatory; overscroll-behavior-inline: contain; scrollbar-width: thin;
  }
  .card:nth-child(n) { grid-column: auto; flex: 0 0 86%; scroll-snap-align: start; }
  .card-vis { min-height: 0; aspect-ratio: 16/10; }
  .early-grid { grid-template-columns: 1fr; }
  .early-grid > div { padding-top: 1.25rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--border); }
  .early-grid .num { margin-bottom: .8rem; }
}

@media (max-width: 560px) {
  .hero-proof { grid-template-columns: 1fr; gap: .8rem; }
  .hero-proof li { display: grid; grid-template-columns: 4rem 1fr; gap: .7rem; align-items: baseline; }
  .compat-grid { grid-template-columns: 1fr; }
  .compat-note { font-size: .7rem; }
  .nav-right .btn { padding-inline: .72rem; font-size: .78rem; }
}
