/* Sunplug marketing site.
   Darker than the app but far more saturated — the app is something you glance
   at while cooking, this is something you look at once and decide from. The
   flow colours carry the energy: solar amber, grid blue, battery teal, cars
   violet. */

:root {
  --bg: #0e0c08;
  --bg-lift: #17140e;
  --card: #1c1913;
  --text: #f6efdd;
  --muted: #a5987a;
  --border: #332d20;

  --solar: #f0b258;
  --solar-deep: #e8892d;
  --grid: #5f97dd;
  --battery: #2fbb8d;
  --cars: #9b91ea;
  --home: #e0796a;

  --ink: #1a1205;
  --max: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* A slow warm glow behind the top of the page, so the first screen reads as
   sunlight rather than a dark dashboard. */
body::before {
  content: "";
  position: fixed;
  inset: -20% -20% auto -20%;
  height: 70vh;
  background:
    radial-gradient(60% 60% at 20% 0%, rgb(240 178 88 / 0.16), transparent 70%),
    radial-gradient(50% 50% at 85% 10%, rgb(155 145 234 / 0.10), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

main, .nav, footer { position: relative; z-index: 1; }

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.2rem, 5.5vw, 3.6rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); font-weight: 650; }
h3 { font-size: 1.15rem; font-weight: 600; }
p { margin: 0 0 1rem; }
em { font-style: normal; color: var(--solar); }
a { color: var(--solar); }

/* ── Nav ─────────────────────────────────────────────────────────────── */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.1rem 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-weight: 650;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
}

.brand img { border-radius: 8px; }

.nav nav { display: flex; align-items: center; gap: 1.5rem; }
.nav nav a { color: var(--muted); text-decoration: none; font-size: .95rem; }
.nav nav a:hover { color: var(--text); }

.nav .cta {
  color: var(--ink);
  background: var(--solar);
  padding: .45rem 1rem;
  border-radius: 999px;
  font-weight: 600;
}

@media (max-width: 720px) {
  .nav nav a:not(.cta) { display: none; }
}

/* ── Buttons ─────────────────────────────────────────────────────────── */

.button {
  display: inline-block;
  padding: .8rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
}

.button.primary {
  color: var(--ink);
  background: linear-gradient(135deg, var(--solar), var(--solar-deep));
  box-shadow: 0 8px 24px rgb(232 137 45 / 0.25);
}

.button.ghost {
  color: var(--text);
  border: 1px solid var(--border);
}

/* ── Hero ────────────────────────────────────────────────────────────── */

.hero {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 3rem;
  align-items: center;
  max-width: var(--max);
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

.eyebrow {
  color: var(--solar);
  font-weight: 600;
  font-size: .85rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: .8rem;
}

.lede { color: var(--muted); font-size: 1.12rem; max-width: 34rem; }
.hero-actions { display: flex; gap: .8rem; flex-wrap: wrap; margin: 1.8rem 0 1rem; }
.micro { color: var(--muted); font-size: .88rem; margin: 0; }

/* ── Phone frame ─────────────────────────────────────────────────────── */

.phone {
  border: 1px solid var(--border);
  border-radius: 2rem;
  padding: .5rem;
  background: linear-gradient(160deg, #241f16, #14110c);
  box-shadow: 0 30px 70px rgb(0 0 0 / 0.5);
  max-width: 320px;
  margin: 0 auto;
}

.phone img {
  display: block;
  width: 100%;
  border-radius: 1.6rem;
}

.hero-shot { display: grid; place-items: center; }

/* ── Strip ───────────────────────────────────────────────────────────── */

.strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border-block: 1px solid var(--border);
}

.strip-item {
  background: var(--bg-lift);
  padding: 1.4rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.strip-item b { font-size: 1rem; }
.strip-item span { color: var(--muted); font-size: .9rem; }

/* Each pillar takes one flow colour, so the palette means something. */
.strip-item:nth-child(1) b { color: var(--cars); }
.strip-item:nth-child(2) b { color: var(--battery); }
.strip-item:nth-child(3) b { color: var(--solar); }
.strip-item:nth-child(4) b { color: var(--grid); }

/* ── Sections ────────────────────────────────────────────────────────── */

section { padding: 4.5rem 1.5rem; }
section > h2 { max-width: var(--max); margin-inline: auto; }

.pitch {
  background:
    linear-gradient(180deg, rgb(240 178 88 / 0.06), transparent),
    var(--bg-lift);
  border-block: 1px solid var(--border);
}

.pitch-body { max-width: 46rem; margin: 0 auto; }
.pitch-body h2 { color: var(--solar); }

.checks { list-style: none; padding: 0; margin: 1.5rem 0; }

.checks li {
  position: relative;
  padding-left: 1.9rem;
  margin-bottom: .7rem;
  color: var(--muted);
}

.checks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .55em;
  width: .95rem;
  height: .5rem;
  border-left: 2px solid var(--battery);
  border-bottom: 2px solid var(--battery);
  transform: rotate(-45deg);
}

.checks li strong { color: var(--text); }
.note { color: var(--muted); font-size: .95rem; }

/* ── Steps ───────────────────────────────────────────────────────────── */

.how { max-width: var(--max); margin: 0 auto; }

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

.step {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.6rem;
}

.step p { color: var(--muted); font-size: .96rem; margin: 0; }

.num {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  font-weight: 700;
  color: var(--ink);
  background: var(--solar);
  margin-bottom: .9rem;
}

.step:nth-child(2) .num { background: var(--cars); }
.step:nth-child(3) .num { background: var(--battery); }

/* ── Split feature rows ──────────────────────────────────────────────── */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3.5rem;
  align-items: center;
  max-width: var(--max);
  margin: 0 auto;
}

.split-text p { color: var(--muted); }
.split.reverse .split-text { order: 2; }

/* ── Kit ─────────────────────────────────────────────────────────────── */

.kit {
  background: var(--bg-lift);
  border-block: 1px solid var(--border);
}

.kit > * { max-width: var(--max); margin-inline: auto; }

.kit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  margin-top: 2rem;
}

.kit-col h3 { color: var(--solar); }
.kit-col:last-child h3 { color: var(--cars); }
.kit-note { color: var(--muted); font-size: .92rem; }

.kit-col ul { list-style: none; padding: 0; margin: 1rem 0; }

.kit-col li {
  padding: .5rem 0;
  border-bottom: 1px solid var(--border);
}

.kit-col li em { color: var(--muted); font-size: .88rem; }
.kit-foot { margin-top: 2rem; color: var(--muted); }

/* ── Early access ────────────────────────────────────────────────────── */

.early { max-width: 40rem; margin: 0 auto; text-align: center; }
.early p { color: var(--muted); }

.early-priority {
  background: rgb(155 145 234 / 0.10);
  border: 1px solid rgb(155 145 234 / 0.3);
  border-radius: .8rem;
  padding: 1rem 1.2rem;
  color: var(--text);
}

.early-contact {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .8rem;
  margin: 1.8rem 0 1rem;
}

/* ── Footer ──────────────────────────────────────────────────────────── */

footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  color: var(--muted);
  font-size: .9rem;
}

.foot-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.foot-links { display: flex; gap: 1.2rem; }

/* ── Narrow ──────────────────────────────────────────────────────────── */

@media (max-width: 880px) {
  .hero, .split, .kit-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .split.reverse .split-text { order: 0; }
  .steps { grid-template-columns: 1fr; }
  .strip { grid-template-columns: repeat(2, 1fr); }
  section { padding: 3rem 1.25rem; }
  .hero { padding-top: 1.5rem; }
}

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

/* ── Tesla ───────────────────────────────────────────────────────────── */

.tesla {
  background:
    linear-gradient(180deg, rgb(155 145 234 / 0.09), transparent 60%),
    var(--bg-lift);
  border-block: 1px solid var(--border);
}

.tesla-inner { max-width: var(--max); margin: 0 auto; }
.tesla-inner .eyebrow { color: var(--cars); }
.tesla-inner h2 { max-width: 20ch; }

.tesla-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin: 2rem 0 1.5rem;
}

.tesla-grid > div {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--cars);
  border-radius: .8rem;
  padding: 1.2rem 1.4rem;
}

.tesla-grid h3 { color: var(--text); margin-bottom: .35rem; }
.tesla-grid p { color: var(--muted); font-size: .95rem; margin: 0; }

/* ── Agent ───────────────────────────────────────────────────────────── */

.agent-inner { max-width: var(--max); margin: 0 auto; }
.agent-inner .eyebrow { color: var(--battery); }
.agent-inner h2 { max-width: 22ch; }

.agent-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: .9rem;
  overflow: hidden;
  margin: 2rem 0 1.5rem;
}

.agent-card {
  background: var(--card);
  padding: 1.3rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}

.agent-card b { color: var(--battery); }
.agent-card span { color: var(--muted); font-size: .95rem; }

/* ── Form ────────────────────────────────────────────────────────────── */

.form {
  text-align: left;
  margin: 2rem 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.form label {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  font-size: .92rem;
  color: var(--muted);
}

.form input,
.form textarea {
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: .6rem;
  padding: .7rem .85rem;
  width: 100%;
}

.form input::placeholder,
.form textarea::placeholder { color: color-mix(in srgb, var(--muted) 60%, transparent); }

.form input:focus,
.form textarea:focus {
  outline: 2px solid var(--solar);
  outline-offset: 1px;
  border-color: transparent;
}

.form small { color: color-mix(in srgb, var(--muted) 80%, transparent); font-size: .82rem; }
.form textarea { resize: vertical; }

.button.wide { width: 100%; border: none; cursor: pointer; }
.button.wide:disabled { opacity: .5; cursor: default; }

.form-status { margin: 0; font-size: .95rem; min-height: 1.4em; color: var(--muted); }
.form-status.good { color: var(--battery); }
.form-status.bad { color: var(--home); }

@media (max-width: 880px) {
  .tesla-grid, .agent-grid, .field-row { grid-template-columns: 1fr; }
}

/* Tesla section: cards beside the screenshot, so the controls being described
   are visible while you read about them. */
.tesla-layout {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 2.5rem;
  align-items: start;
  margin: 2rem 0 1.5rem;
}

.tesla-layout .tesla-grid { margin: 0; grid-template-columns: 1fr; }
.tesla-shot { position: sticky; top: 2rem; }

/* The car cards on their own. This section is about the slider, and a
   portrait phone bezel around two cards is four-fifths empty screen. */
.cards-shot {
  border: 1px solid var(--border);
  border-radius: 1rem;
  overflow: hidden;
  background: #14110c;
  box-shadow: 0 20px 50px rgb(0 0 0 / 0.4);
  /* The same width the phone frames use. Without it the shot stretched to
     the full grid column and dwarfed the paragraph beside it — the frame was
     what had been constraining it, not anything about the image. */
  max-width: 320px;
  margin: 0 auto;
}

.cards-shot img { display: block; width: 100%; }

.shot-caption {
  color: var(--muted);
  font-size: .88rem;
  text-align: center;
  margin: 1rem auto 0;
  max-width: 32ch;
}

.models {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--solar);
  border-radius: .8rem;
  padding: 1.1rem 1.3rem;
  color: var(--muted);
  font-size: .96rem;
}

.models strong { color: var(--text); }

@media (max-width: 880px) {
  .tesla-layout { grid-template-columns: 1fr; }
  .tesla-shot { position: static; }
}

/* ── Knowledge base ──────────────────────────────────────────────────── */

.kb-head, .kb-body { max-width: var(--max); margin: 0 auto; padding: 3rem 1.5rem; }
.kb-head h1 { font-size: clamp(2rem, 4.5vw, 3rem); }
.kb-body h2 { margin-top: 3rem; }
.kb-body h2:first-child { margin-top: 0; }
.kb-intro { color: var(--muted); max-width: 52ch; }

.kb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.kb-card {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: .9rem;
  padding: 1.2rem 1.3rem;
  text-decoration: none;
  color: var(--muted);
  font-size: .93rem;
}

.kb-card:hover { border-color: var(--solar); }
.kb-card b { color: var(--text); font-size: 1.05rem; }

.kb-tag {
  align-self: flex-start;
  font-size: .75rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .15rem .6rem;
  color: var(--muted);
}

.kb-tag.good { color: var(--battery); border-color: color-mix(in srgb, var(--battery) 40%, transparent); }
.kb-tag.warn { color: var(--solar); border-color: color-mix(in srgb, var(--solar) 40%, transparent); }

/* ── A single guide ──────────────────────────────────────────────────── */

.doc { max-width: 44rem; margin: 0 auto; padding: 2.5rem 1.5rem 4rem; }
.doc h1 { font-size: clamp(2rem, 4.5vw, 2.8rem); }
.doc h2 { margin-top: 2.5rem; font-size: 1.5rem; }
.doc h3 { margin-top: 1.8rem; color: var(--solar); }
.doc p { color: var(--muted); }
.doc .lede { color: var(--text); }

.crumb { font-size: .9rem; color: var(--muted); margin-bottom: 1.5rem; }
.crumb a { color: var(--muted); }

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: .8rem;
  overflow: hidden;
  margin: 1.8rem 0;
}

.facts > div {
  background: var(--card);
  padding: .9rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: .1rem;
}

.facts b { font-size: .78rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.facts span { color: var(--text); font-size: .95rem; }

/* How far an integration has actually been proven. Sits directly under the
   lede because it changes how everything below it should be read, and a
   customer deciding whether to trust a savings figure deserves it before the
   instructions rather than after. Generated by tools/kb_status.py. */
.tested {
  border: 1px solid var(--border);
  border-left: 3px solid var(--muted);
  border-radius: .8rem;
  padding: .9rem 1.1rem;
  margin: 1.8rem 0;
  background: var(--card);
}

.tested b {
  display: block;
  font-size: .78rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: .35rem;
}

.tested p { margin: 0; color: var(--muted); font-size: .95rem; }

.tested.good { border-left-color: #2f9e6a; }
.tested.good b { color: #2f9e6a; }
.tested.warn { border-left-color: #c98a2e; }
.tested.warn b { color: #c98a2e; }

/* A screenshot of a manufacturer's portal, cropped to the panel that matters.
   See kb/SCREENSHOTS.md for what still needs capturing and how. */
.shot {
  margin: 1.5rem 0;
  border: 1px solid var(--border);
  border-radius: .8rem;
  overflow: hidden;
  background: var(--card);
}

.shot img { display: block; width: 100%; height: auto; }

.shot figcaption {
  padding: .7rem 1.1rem;
  font-size: .9rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

.steps-list { color: var(--muted); padding-left: 1.3rem; }
.steps-list li { margin-bottom: .5rem; }

.doc pre {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: .7rem;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  font-size: .88rem;
  line-height: 1.6;
}

.doc code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .9em;
}

.doc p > code, .doc li > code {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: .35rem;
  padding: .1rem .35rem;
}

.aside {
  border-left: 3px solid var(--grid);
  background: rgb(95 151 221 / 0.07);
  border-radius: 0 .6rem .6rem 0;
  padding: .9rem 1.1rem;
  font-size: .95rem;
}

.doc-foot {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

/* A guide that does not exist yet is shown, not linked — a 404 from a setup
   page is worse than an honest "not written". */
.kb-card.pending { opacity: .55; }
.kb-tag.soon { color: var(--muted); border-style: dashed; }

/* Language switch. Deliberately quiet — it matters to the half of visitors
   who need it and should not compete with the call to action. */
.nav .lang {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .2rem .55rem;
  font-size: .78rem;
  letter-spacing: .05em;
}

.nav .lang:hover { border-color: var(--solar); color: var(--solar); }

@media (max-width: 720px) {
  .nav nav a.lang { display: inline-block; }
}
