/* ============================================================
   Py-Stack EDA — design tokens & base
   Dark, minimal, editorial. Electric cyan accent.
   ============================================================ */

:root {
  /* surfaces — cool near-black */
  --bg:        oklch(0.165 0.012 250);
  --bg-1:      oklch(0.195 0.013 250);
  --bg-2:      oklch(0.225 0.015 250);
  --bg-3:      oklch(0.265 0.016 250);

  /* lines */
  --line:      oklch(0.32 0.014 250);
  --line-soft: oklch(0.27 0.012 250);
  --grid-dot:  oklch(0.30 0.012 250 / 0.6);

  /* ink */
  --ink:   oklch(0.965 0.004 250);
  --ink-2: oklch(0.82 0.008 250);
  --ink-3: oklch(0.635 0.012 250);
  --ink-4: oklch(0.50 0.012 250);

  /* accent — electric cyan (overridable by tweaks) */
  --accent:      oklch(0.82 0.13 213);
  --accent-2:    oklch(0.72 0.14 233);
  --accent-dim:  oklch(0.82 0.13 213 / 0.14);
  --accent-line: oklch(0.82 0.13 213 / 0.32);
  --accent-ink:  oklch(0.19 0.04 233);

  /* data-viz secondary (thermal warm) — fixed */
  --warm:  oklch(0.78 0.15 55);
  --warm-2: oklch(0.70 0.17 35);

  /* type */
  --serif: "Newsreader", Georgia, serif;
  --sans:  "IBM Plex Sans", system-ui, sans-serif;
  --mono:  "IBM Plex Mono", ui-monospace, monospace;

  --maxw: 1200px;
  --pad: clamp(20px, 5vw, 64px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* subtle page-wide vignette / radial wash behind hero */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(1100px 620px at 78% -8%, var(--accent-dim), transparent 60%),
    radial-gradient(900px 700px at 0% 4%, oklch(0.72 0.14 233 / 0.08), transparent 55%);
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
::selection { background: var(--accent); color: var(--accent-ink); }

/* ---------- layout ---------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding-inline: var(--pad); position: relative; z-index: 1; }
.section { padding-block: clamp(72px, 11vw, 144px); position: relative; z-index: 1; }
.section--tight { padding-block: clamp(56px, 8vw, 104px); }

/* ---------- type helpers ---------- */
.eyebrow {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  margin: 0 0 22px;
  font-weight: 500;
  white-space: nowrap;
}
.eyebrow::before {
  content: "";
  width: 26px; height: 1px;
  background: var(--accent-line);
}
.eyebrow--plain { color: var(--ink-3); }
.eyebrow--plain::before { background: var(--line); }

h1, h2, h3 { font-weight: 400; margin: 0; text-wrap: balance; }

.display {
  font-family: var(--serif);
  font-size: clamp(46px, 7.4vw, 104px);
  line-height: 0.99;
  letter-spacing: -0.018em;
  font-weight: 420;
}
.display em { font-style: italic; color: var(--accent); font-weight: 440; }

.h2 {
  font-family: var(--serif);
  font-size: clamp(30px, 4.4vw, 54px);
  line-height: 1.05;
  letter-spacing: -0.015em;
  font-weight: 430;
}
.h2 em { font-style: italic; color: var(--accent); }

.h3 {
  font-family: var(--sans);
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  font-weight: 600;
}

.lead {
  font-size: clamp(17px, 1.7vw, 20px);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 56ch;
}
.muted { color: var(--ink-3); }
.mono { font-family: var(--mono); }

/* ---------- buttons ---------- */
.btn {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 540;
  letter-spacing: -0.005em;
  padding: 12px 20px;
  border-radius: 9px;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  transition: transform .18s cubic-bezier(.2,.7,.3,1), background .18s, border-color .18s, color .18s, box-shadow .18s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 0 0 0 var(--accent-line);
}
.btn-primary:hover { box-shadow: 0 10px 34px -12px var(--accent); transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--accent-line); color: var(--accent); background: var(--accent-dim); }
.btn .arr { transition: transform .2s; }
.btn:hover .arr { transform: translateX(3px); }

/* ---------- chips / tags ---------- */
.chip {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 11px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--bg-1);
  white-space: nowrap;
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }

/* ---------- window / panel chrome (the signature device) ---------- */
.window {
  background: linear-gradient(180deg, var(--bg-1), var(--bg));
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 40px 90px -50px rgba(0,0,0,0.8), 0 2px 0 0 oklch(1 0 0 / 0.02) inset;
}
.window__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg-1);
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-3);
}
.window__dots { display: flex; gap: 6px; }
.window__dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--bg-3); display: block; }
.window__title { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.window__bar .spacer { flex: 1; }

.status-chip {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--accent-line);
  border-radius: 7px;
  padding: 3px 9px;
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
}

/* dotted grid canvas (schematic backdrop) */
.dotgrid {
  background-image: radial-gradient(var(--grid-dot) 1px, transparent 1.4px);
  background-size: 19px 19px;
  background-position: -1px -1px;
}

/* ---------- generic card ---------- */
.card {
  background: var(--bg-1);
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  padding: 26px;
  transition: border-color .25s, transform .25s, background .25s;
}
.card:hover { border-color: var(--line); transform: translateY(-2px); }

/* ---------- scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s cubic-bezier(.2,.7,.3,1), transform .7s cubic-bezier(.2,.7,.3,1); }
.reveal.is-in { opacity: 1; transform: none; }
.reveal[data-d="1"] { transition-delay: .08s; }
.reveal[data-d="2"] { transition-delay: .16s; }
.reveal[data-d="3"] { transition-delay: .24s; }
.reveal[data-d="4"] { transition-delay: .32s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- divider ---------- */
.rule { height: 1px; background: var(--line-soft); border: 0; margin: 0; }

/* blinking caret */
@keyframes caretBlink { 0%,49%{opacity:1} 50%,100%{opacity:0} }
.caret { display:inline-block; width:8px; height:1.05em; transform:translateY(2px); background: var(--accent); margin-left:2px; animation: caretBlink 1s steps(1) infinite; }

/* schematic draw-in */
@keyframes dash { to { stroke-dashoffset: 0; } }

#root { position: relative; z-index: 1; }

/* ============================================================
   Schematic panel (signature device)
   ============================================================ */
.schempanel { width: 100%; }
.schempanel__caret { color: var(--accent); font-weight: 600; }
.schempanel__prompt { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.schempanel__body { padding: 8px; background: var(--bg); }
.schem { width: 100%; height: auto; display: block; }

.schem__rail { font-family: var(--mono); font-size: 11px; fill: var(--ink-4); letter-spacing: 0.04em; }
.schem__lbl { font-family: var(--mono); font-size: 11px; fill: var(--ink-2); }
.schem__lbl--dim { fill: var(--ink-4); }
.schem__lbl--out { fill: var(--accent); }

.wire {
  fill: none;
  stroke: var(--ink-3);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
.schem.is-in .wire { animation: dash 0.7s cubic-bezier(.4,.6,.3,1) forwards; }
@media (prefers-reduced-motion: reduce) { .wire { stroke-dashoffset: 0; animation: none !important; } }

.dev rect { fill: var(--bg-2); stroke: var(--ink-3); stroke-width: 1.3; }
.dev { opacity: 0; }
.schem.is-in .dev { animation: devIn 0.4s ease forwards; }
@keyframes devIn { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

.schem__node circle { fill: var(--bg); stroke: var(--ink-3); stroke-width: 1.3; opacity: 0; }
.schem.is-in .schem__node circle { animation: devIn 0.4s ease forwards; }

.schem__out circle { fill: var(--ink-4); transition: fill .4s, filter .4s; }
.schem__out.live circle { fill: var(--accent); filter: drop-shadow(0 0 5px var(--accent)); }

.spin { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }

/* ============================================================
   Nav
   ============================================================ */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 50; transition: background .3s, border-color .3s, backdrop-filter .3s; border-bottom: 1px solid transparent; }
.nav.is-scrolled { background: oklch(0.165 0.012 250 / 0.72); backdrop-filter: blur(14px) saturate(1.2); border-bottom-color: var(--line-soft); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 70px; }
.nav__links { display: flex; gap: 30px; }
.nav__links a { font-size: 14.5px; color: var(--ink-3); transition: color .2s; font-weight: 480; }
.nav__links a:hover { color: var(--ink); }
.nav__actions .btn { padding: 9px 16px; font-size: 14px; }

.logo { display: inline-flex; align-items: center; gap: 11px; }
.logo__mark { display: block; }
.logo__word { font-family: var(--sans); font-weight: 620; font-size: 17px; letter-spacing: -0.01em; color: var(--ink); white-space: nowrap; }
.logo__dash { color: var(--ink-3); }
.logo__eda { color: var(--ink-3); font-weight: 540; letter-spacing: 0.02em; }

@media (max-width: 720px) { .nav__links { display: none; } }

/* ============================================================
   Hero
   ============================================================ */
.hero { padding-top: clamp(118px, 16vh, 188px); padding-bottom: clamp(40px, 7vw, 80px); position: relative; z-index: 1; }
.hero__title { margin-bottom: 26px; }
.hero__title--sm { font-size: clamp(40px, 5.6vw, 76px); }
.hero__sub { margin-bottom: 34px; }
.hero__ctas, .hero__ctas--center { display: flex; gap: 13px; flex-wrap: wrap; }
.hero__ctas--center { justify-content: center; margin-top: 30px; }

/* split */
.hero__split { display: grid; grid-template-columns: 1.02fr 1.1fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero__copy { max-width: 560px; }
@media (max-width: 940px) {
  .hero__split { grid-template-columns: 1fr; gap: 44px; }
  .hero__panel { max-width: 620px; }
}

/* centered */
.hero--centered .hero__title { margin-inline: auto; max-width: 16ch; }
.hero__sub--wrap { display: flex; justify-content: center; }
.hero--centered .hero__sub { text-align: center; }
.hero--centered .hero__panel { max-width: 880px; margin-inline: auto; }

/* console */
.hero--console .hero__console-head { max-width: 760px; margin-bottom: 40px; }
.hero__console-grid { display: grid; grid-template-columns: 0.92fr 1.18fr; gap: clamp(32px, 5vw, 64px); align-items: center; }
@media (max-width: 940px) { .hero__console-grid { grid-template-columns: 1fr; gap: 40px; } }

/* prompt bar */
.promptbar { display: flex; align-items: center; gap: 12px; background: var(--bg-1); border: 1px solid var(--line); border-radius: 12px; padding: 10px 10px 10px 16px; box-shadow: 0 18px 50px -36px #000; }
.promptbar__chev { color: var(--accent); font-family: var(--mono); font-weight: 600; }
.promptbar__text { flex: 1; font-family: var(--mono); font-size: 13.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.promptbar__send { padding: 9px 15px; font-size: 13.5px; }

/* trust strip */
.trust { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; margin-top: clamp(48px, 7vw, 84px); padding-top: 26px; border-top: 1px solid var(--line-soft); }
.hero--centered .trust { justify-content: center; }
.trust__label { font-size: 11px; letter-spacing: 0.22em; color: var(--ink-4); }
.trust__logo { height: 26px; width: auto; opacity: 0.95; }
.trust__sep { width: 1px; height: 22px; background: var(--line); }
.trust__facts { display: flex; gap: 0; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.trust__facts li { font-size: 12px; color: var(--ink-3); padding: 0 16px; position: relative; }
.trust__facts li + li::before { content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 3px; height: 3px; border-radius: 50%; background: var(--ink-4); }
@media (max-width: 560px) { .trust__facts li::before { display: none; } .trust__facts { gap: 4px 0; } }
