/* Palette carried over from the SolarOps app, so the marketing site and the
   product read as one thing. The values are the app's validated set: every
   text-on-background pair here was measured to 4.5:1 or better. */

:root {
  color-scheme: light;

  --plane: #f9f9f7;
  --surface: #fcfcfb;
  --tint: #f2f4f7;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #6b6963;
  --grid: #e1e0d9;
  --rule: #c3c2b7;
  --border: rgb(11 11 11 / 10%);

  --accent: #2a78d6;
  --accent-text: #1c5cab;
  --accent-solid: #256abf;
  --accent-ink: #ffffff;
  --accent-wash: #eaf2fd;

  --warning: #fab219;
  --critical: #d03b3b;
  --critical-ink: #a3202b;
  --critical-wash: #fbe9e9;

  /* Sequential blue ramp, lightest to darkest. */
  --v1: #cde2fb;
  --v2: #9ec5f4;
  --v3: #6da7ec;
  --v4: #3987e5;
  --v5: #256abf;
  --v6: #184f95;
  --ink-on-light: #08121d;

  --ink-dark-panel: #eaf1fa;
  --deep-1: #0f2742;
  --deep-2: #0a1626;

  --radius: 12px;
  --wrap: 68rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;

    --plane: #0d0d0d;
    --surface: #1a1a19;
    --tint: #141414;
    --ink: #ffffff;
    --ink-2: #c3c2b7;
    --muted: #a5a39c;
    --grid: #2c2c2a;
    --rule: #383835;
    --border: rgb(255 255 255 / 10%);

    --accent: #3987e5;
    --accent-text: #6da7ec;
    --accent-solid: #3987e5;
    --accent-ink: #08121d;
    --accent-wash: #14243a;

    --critical-ink: #e07070;
    --critical-wash: #331419;

    /* Reversed for a dark surface: the step that recedes is the darkest. */
    --v1: #184f95;
    --v2: #256abf;
    --v3: #3987e5;
    --v4: #6da7ec;
    --v5: #9ec5f4;
    --v6: #cde2fb;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--plane);
  color: var(--ink);
  font: 16px/1.65 system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.18; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: clamp(2.1rem, 5.5vw, 3.5rem); font-weight: 640; }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); font-weight: 640; margin-bottom: 0.6rem; }
h3 { font-size: 1.02rem; font-weight: 650; letter-spacing: -0.01em; }
p  { margin: 0; }

a { color: var(--accent-text); text-underline-offset: 3px; }

.wrap { width: min(var(--wrap), 100% - 2.5rem); margin-inline: auto; }

.skip { position: absolute; left: -9999px; }
.skip:focus {
  left: 1rem; top: 1rem; z-index: 100;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--rule); border-radius: 8px; padding: 0.6rem 0.9rem;
}

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

.eyebrow {
  font-size: 0.76rem; font-weight: 680; text-transform: uppercase;
  letter-spacing: 0.09em; color: var(--accent-text); margin-bottom: 0.7rem;
}

/* --- nav ---------------------------------------------------------------- */

.nav {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--plane) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.nav.is-stuck { border-bottom-color: var(--border); }

.nav__inner { display: flex; align-items: center; gap: 1rem; height: 62px; }

.brand {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-weight: 660; letter-spacing: -0.015em; color: var(--ink);
  text-decoration: none; margin-right: auto;
}
.brand__mark {
  display: grid; place-items: center; width: 28px; height: 28px;
  border-radius: 8px; flex: none; color: #fff;
  background: linear-gradient(140deg, var(--warning), var(--accent-solid));
}
.brand__mark svg { width: 16px; height: 16px; }
.brand--sm { font-size: 0.95rem; margin-right: 0; }

.nav__links { display: flex; align-items: center; gap: 1.35rem; }
.nav__links a {
  color: var(--ink-2); text-decoration: none; font-size: 0.92rem; font-weight: 520;
}
.nav__links a:hover { color: var(--ink); }
.nav__links .btn { color: var(--accent-ink); }

.nav__toggle {
  display: none; width: 40px; height: 40px; border: 1px solid var(--border);
  border-radius: 9px; background: var(--surface); cursor: pointer;
  padding: 0; flex-direction: column; gap: 4px; align-items: center; justify-content: center;
}
.nav__toggle span { display: block; width: 17px; height: 1.8px; background: var(--ink); border-radius: 2px; }

/* --- buttons ------------------------------------------------------------ */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-size: 0.94rem; font-weight: 570;
  padding: 0.62rem 1.15rem; border-radius: 9px;
  border: 1px solid var(--rule); background: var(--surface); color: var(--ink);
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform 0.12s ease, background 0.12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--accent-solid); border-color: var(--accent-solid); color: var(--accent-ink); }
.btn--sm { font-size: 0.87rem; padding: 0.42rem 0.85rem; }
.btn--lg { font-size: 1rem; padding: 0.78rem 1.5rem; }

@media (prefers-reduced-motion: reduce) { .btn:hover { transform: none; } }

/* --- hero --------------------------------------------------------------- */

.hero { padding: clamp(3rem, 8vw, 6rem) 0 clamp(3rem, 7vw, 5rem); }
.hero__grid {
  display: grid; grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 5vw, 4rem); align-items: center;
}
.lede {
  font-size: clamp(1rem, 1.6vw, 1.12rem); color: var(--ink-2);
  margin-top: 1.1rem; max-width: 34rem;
}
.hero__cta { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.8rem; }
.hero__note {
  margin-top: 1.1rem; font-size: 0.85rem; color: var(--muted); max-width: 28rem;
}

/* --- hero visual -------------------------------------------------------- */

.hero__viz { margin: 0; }
.viz-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.1rem 1.2rem 1.2rem;
  box-shadow: 0 1px 2px rgb(16 24 32 / 5%), 0 12px 32px rgb(16 24 32 / 7%);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .viz-card { box-shadow: none; }
}
.viz-card__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem; margin-bottom: 0.9rem;
}
.viz-card__title { font-size: 0.85rem; font-weight: 640; }
.viz-card__foot { margin-top: 0.9rem; font-size: 0.79rem; color: var(--muted); }

.tag {
  display: inline-flex; align-items: center; gap: 0.32rem;
  font-size: 0.72rem; font-weight: 650; padding: 0.2rem 0.5rem 0.2rem 0.38rem;
  border-radius: 999px; white-space: nowrap;
}
.tag svg { width: 13px; height: 13px; }
.tag--bad { color: var(--critical-ink); background: var(--critical-wash); }

.viz-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; }

.cell {
  aspect-ratio: 1; display: grid; place-items: center;
  border-radius: 4px; font-size: 0.68rem; font-weight: 620;
  font-variant-numeric: tabular-nums;
}
/* Ink follows each step's own lightness so the digits stay legible on both
   ends of the ramp. */
.v1 { background: var(--v1); color: var(--ink-on-light); }
.v2 { background: var(--v2); color: var(--ink-on-light); }
.v3 { background: var(--v3); color: var(--ink-on-light); }
.v4 { background: var(--v4); color: var(--ink-on-light); }
.v5 { background: var(--v5); color: #fff; }
.v6 { background: var(--v6); color: #fff; }

/* The ramp reverses in dark mode, so the ink assignment reverses with it.
   #3987e5 is the awkward middle step: white on it measures only 3.64:1, so it
   takes dark ink in BOTH modes -- v4 in light, v3 in dark. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .v1,
  :root:not([data-theme='light']) .v2 { color: #fff; }
  :root:not([data-theme='light']) .v3,
  :root:not([data-theme='light']) .v4,
  :root:not([data-theme='light']) .v5,
  :root:not([data-theme='light']) .v6 { color: var(--ink-on-light); }
}

.cell--bad { box-shadow: inset 0 0 0 2px var(--critical); }

/* Spare channels are hatched, not shaded: they are absent, not zero. */
.cell.sp, .swatch.sp {
  color: var(--muted);
  background: repeating-linear-gradient(45deg, transparent, transparent 3px, var(--grid) 3px, var(--grid) 5px);
  box-shadow: inset 0 0 0 1px var(--border);
}

.viz-legend {
  display: flex; align-items: center; gap: 0.35rem;
  margin-top: 0.85rem; font-size: 0.73rem; color: var(--muted);
}
.swatch { width: 15px; height: 10px; border-radius: 2px; flex: none; }
.sep { width: 1px; height: 13px; background: var(--border); margin-inline: 0.35rem; }

/* --- sections ----------------------------------------------------------- */

.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section--tint { background: var(--tint); border-block: 1px solid var(--border); }
.section__lede {
  color: var(--ink-2); max-width: 44rem; margin-top: 0.8rem; font-size: 1.02rem;
}

.cards { display: grid; gap: 1rem; margin-top: 2.2rem; }
.cards--3 { grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.cards--2 { grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); }

.card, .feature {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.35rem 1.4rem 1.5rem;
}
.card__num {
  display: block; font-size: 0.75rem; font-weight: 700;
  color: var(--accent-text); letter-spacing: 0.06em; margin-bottom: 0.55rem;
}
.card p, .feature p { color: var(--ink-2); font-size: 0.93rem; margin-top: 0.5rem; }

.feature__icon {
  display: grid; place-items: center; width: 38px; height: 38px;
  border-radius: 10px; background: var(--accent-wash); color: var(--accent-text);
  margin-bottom: 0.85rem;
}
.feature__icon svg { width: 21px; height: 21px; }

/* --- steps -------------------------------------------------------------- */

.steps {
  list-style: none; padding: 0; margin: 2.2rem 0 0;
  display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
}
.step {
  display: flex; gap: 0.9rem; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.3rem 1.35rem 1.4rem;
}
.step__n {
  display: grid; place-items: center; flex: none;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent-solid); color: var(--accent-ink);
  font-size: 0.85rem; font-weight: 700;
}
.step p { color: var(--ink-2); font-size: 0.92rem; margin-top: 0.4rem; }

/* --- limits ------------------------------------------------------------- */

.limits { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(2rem, 5vw, 3.5rem); align-items: start; }
.faq { margin: 0; display: grid; gap: 1.1rem; }
.faq dt { font-weight: 650; font-size: 1rem; }
.faq dd {
  margin: 0.35rem 0 0; color: var(--ink-2); font-size: 0.93rem;
  padding-left: 0.9rem; border-left: 2px solid var(--border);
}

/* --- spec --------------------------------------------------------------- */

.spec {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1px; background: var(--border); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; margin-top: 2.2rem;
}
.spec__item { background: var(--surface); padding: 1.1rem 1.25rem 1.2rem; }
.spec dt {
  font-size: 0.73rem; font-weight: 680; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--muted); margin-bottom: 0.35rem;
}
.spec dd { margin: 0; font-size: 0.92rem; }

/* --- cta ---------------------------------------------------------------- */

.cta {
  padding: clamp(3.5rem, 8vw, 6rem) 0;
  background:
    radial-gradient(110% 90% at 15% 10%, #1d4f8f 0%, transparent 58%),
    linear-gradient(160deg, var(--deep-1) 0%, var(--deep-2) 100%);
  color: var(--ink-dark-panel);
  text-align: center;
}
.cta__inner { display: grid; justify-items: center; gap: 1rem; }
.cta h2 { color: #fff; }
.cta p { color: #b9cbe0; max-width: 38rem; }
.cta .btn--primary {
  margin-top: 0.6rem; background: var(--warning);
  border-color: var(--warning); color: #2b1f00;
}

/* --- footer ------------------------------------------------------------- */

.footer { padding: 2.5rem 0; background: var(--surface); border-top: 1px solid var(--border); }
.footer__inner { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.footer__note { color: var(--muted); font-size: 0.87rem; margin-right: auto; }
.footer__links { display: flex; gap: 1.1rem; flex-wrap: wrap; }
.footer__links a { color: var(--ink-2); text-decoration: none; font-size: 0.87rem; }
.footer__links a:hover { color: var(--ink); }

/* --- responsive --------------------------------------------------------- */

@media (max-width: 900px) {
  .hero__grid, .limits { grid-template-columns: 1fr; }
  .hero__viz { order: -1; max-width: 26rem; }
}

@media (max-width: 720px) {
  .nav__toggle { display: flex; }
  .nav__links {
    display: none; position: absolute; left: 0; right: 0; top: 62px;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 0.5rem 1.25rem 1rem;
  }
  .nav__links.is-open { display: flex; }
  .nav__links a { padding: 0.7rem 0; border-bottom: 1px solid var(--border); }
  .nav__links .btn { margin-top: 0.7rem; border-bottom: none; justify-content: center; }
  .footer__note { margin-right: 0; flex-basis: 100%; }
}

/* --- deploy ------------------------------------------------------------- */

.deploy {
  list-style: none; padding: 0; margin: 2.2rem 0 0;
  display: grid; gap: 1.1rem;
}

.deploy__step {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.3rem 1.35rem 1.35rem;
}

.deploy__head { display: flex; gap: 0.9rem; align-items: flex-start; margin-bottom: 1rem; }
.deploy__head p { color: var(--ink-2); font-size: 0.92rem; margin-top: 0.35rem; }

/* Code blocks keep a fixed dark surface in both themes: a terminal reads as a
   terminal, and the syntax stays put when the page theme flips. */
.code {
  position: relative;
  background: #10161f;
  border: 1px solid #223047;
  border-radius: 9px;
  overflow: hidden;
}

.code::before {
  content: attr(data-lang);
  position: absolute; top: 0; left: 0;
  font-size: 0.68rem; font-weight: 640; letter-spacing: 0.05em;
  color: #7f93ad; background: #182231;
  padding: 0.25rem 0.6rem; border-bottom-right-radius: 7px;
}

.code pre {
  margin: 0;
  padding: 2.1rem 1rem 1rem;
  /* Long commands scroll inside the block; the page itself never scrolls
     sideways. */
  overflow-x: auto;
}

.code code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.815rem;
  line-height: 1.62;
  color: #d7e2f0;
  white-space: pre;
}

.code__copy {
  position: absolute; top: 0.45rem; right: 0.5rem; z-index: 1;
  font: inherit; font-size: 0.72rem; font-weight: 600;
  padding: 0.22rem 0.55rem; border-radius: 6px;
  border: 1px solid #2f4059;
  background: #1c2839; color: #cbd8e8; cursor: pointer;
}
.code__copy:hover { background: #26364b; }
.code__copy.is-done { color: #7ee0a4; border-color: #2f5a44; }

.inline {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.87em;
  background: var(--accent-wash);
  color: var(--accent-text);
  padding: 0.08em 0.36em;
  border-radius: 4px;
}

.deploy__after {
  margin-top: 1.4rem; display: grid; gap: 0.9rem;
  font-size: 0.94rem;
}
.deploy__after p { color: var(--ink-2); }

.deploy__warn {
  border-left: 3px solid var(--warning);
  background: var(--surface);
  border-radius: 0 9px 9px 0;
  padding: 0.9rem 1.1rem;
}

@media (max-width: 720px) {
  .code code { font-size: 0.76rem; }
}

/* --- 404 ---------------------------------------------------------------- */

.notfound {
  min-height: 62vh;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 0.15rem;
  max-width: 34rem;
}
.notfound .brand__mark { width: 40px; height: 40px; border-radius: 11px; margin-bottom: 1.2rem; }
.notfound .brand__mark svg { width: 23px; height: 23px; }
.notfound .eyebrow { margin-bottom: 0.35rem; }
.notfound .lede { margin-top: 0.7rem; }

/* --- collapsible file preview ------------------------------------------- */

.peek { margin-top: 0.75rem; }

.peek summary {
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-text);
  padding: 0.35rem 0;
  list-style: none;
}
.peek summary::-webkit-details-marker { display: none; }

.peek summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 0.4rem;
  transition: transform 0.15s ease;
}
.peek[open] summary::before { transform: rotate(90deg); }

.peek .code { margin-top: 0.5rem; }

@media (prefers-reduced-motion: reduce) {
  .peek summary::before { transition: none; }
}
