/* Solar Setup Calculator — marketing site
   Shared stylesheet. Palette mirrors the app's SundialPalette.light
   (lib/theme/tokens.dart). All colours are CSS custom properties on
   :root; nothing references a raw hex outside this block. */

:root {
  --bg:        #FBF7F0;
  --surface:   #FFFCF6;
  --surface-2: #F4ECDD;
  --surface-3: #EADFCB;
  --text:      #1A1410;
  --text-2:    #4A3F32;
  --muted:     #8B7E6E;
  --border:    #E2D6C0;
  --hairline:  rgba(26, 20, 16, 0.08);
  --accent:        #4FA371;                   /* sun / leaf — primary green */
  --accent-hover:  #3F8359;                   /* ~10% darker, for :hover */
  --accent-soft:   rgba(79, 163, 113, 0.16);  /* sunSoft */
}

/* ---- reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img, svg { display: block; max-width: 100%; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

@media (min-width: 768px) {
  body { font-size: 17px; }
}

/* ---- typography ---- */
h1, h2, h3 {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: 0.01em;
  font-weight: 600;
  margin: 0 0 0.5em;
}
h1 { font-size: 2.15rem; font-weight: 600; }
h2 { font-size: 1.55rem; font-weight: 600; margin-top: 2em; }
h3 { font-size: 1.2rem;  font-weight: 500; margin-top: 1.5em; }

@media (min-width: 768px) {
  h1 { font-size: 2.7rem; }
  h2 { font-size: 1.85rem; }
}

p { margin: 0 0 1rem; color: var(--text); }
ul, ol { margin: 0 0 1rem; padding-left: 1.4rem; }
li { margin: 0.3rem 0; }
strong { font-weight: 600; }

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { color: var(--accent-hover); text-decoration: underline; }

code {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo,
               Consolas, monospace;
  font-size: 0.85em;
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 4px;
}

.mono {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo,
               Consolas, monospace;
}

/* Visible keyboard focus everywhere. */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---- layout containers ---- */
.wrap {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

main { display: block; }

section { padding: 56px 0; }
@media (min-width: 768px) { section { padding: 80px 0; } }

.section-alt { background: var(--surface); border-block: 1px solid var(--hairline); }

.eyebrow {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.75rem;
}

.lead {
  font-size: 1.1rem;
  color: var(--text-2);
  max-width: 42ch;
}

/* ---- top nav ---- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--hairline);
}
.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  border: 1px solid var(--border);
}
.brand-word {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}
.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin-left: auto;
}
.nav-links a {
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
}
.nav-links a:hover { color: var(--text); text-decoration: underline; }
.nav-links a.is-active {
  color: var(--accent);
  font-weight: 600;
}
/* Persistent "Open web app" pill — sits after .nav-links (which has
   margin-left:auto), so it trails the links at the far right. */
.nav-cta {
  align-self: center;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 8px 16px;
  border-radius: 999px;
  white-space: nowrap;
}
.nav-cta:hover {
  background: var(--accent-hover);
  color: #fff;
  text-decoration: none;
}

/* ---- mobile hamburger (CSS checkbox-hack, no JS) ----
   The checkbox sits between .brand and .nav-links / .nav-cta in DOM
   order, so :checked ~ .nav-links / ~ .nav-cta reveals them on mobile.
   It is NOT hidden via display:none / visibility:hidden because that
   would drop it out of the tab order — instead it's collapsed to a
   1×1 transparent absolute box that still accepts focus. */
.nav-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.nav-burger {
  display: none;             /* shown only inside the mobile block */
  flex-direction: column;
  justify-content: center;
  padding: 8px;              /* with three 2px bars + 5px gaps = ~40×40 tap */
  cursor: pointer;
}
.nav-burger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
.nav-burger span + span { margin-top: 5px; }
/* Keyboard focus ring — the (hidden) checkbox is the focus target;
   render the ring on its visible sibling, the burger label. */
.nav-toggle:focus-visible + .nav-burger {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 4px;
}

@media (max-width: 599px) {
  /* Bar stays a row on mobile: brand on the left, burger on the right.
     Menu items wrap to full-width rows BELOW only when expanded. */
  .nav-inner { flex-wrap: wrap; align-items: center; gap: 10px; }
  .nav-burger {
    display: inline-flex;
    margin-left: auto;        /* push burger to the far right of the bar */
  }
  /* Collapsed by default — full-width so they stack as rows when shown. */
  .nav-links, .nav-cta { display: none; width: 100%; }
  .nav-links { margin-left: 0; gap: 14px; }
  /* Revealed by :checked. The checkbox is a previous sibling of both
     .nav-links and .nav-cta, so the ~ general-sibling selector works. */
  .nav-toggle:checked ~ .nav-links {
    display: flex;
    flex-direction: column;
  }
  .nav-toggle:checked ~ .nav-cta {
    display: inline-flex;
    align-self: flex-start;
  }
  /* Three bars morph into an X when the menu is open. */
  .nav-toggle:checked + .nav-burger span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .nav-toggle:checked + .nav-burger span:nth-child(2) { opacity: 0; }
  .nav-toggle:checked + .nav-burger span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}

/* ---- buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: 999px;
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  border: 1.5px solid var(--accent);
  transition: background-color 0.15s ease, color 0.15s ease;
}
.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }

.btn-store {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-store:hover { background: var(--surface-2); color: var(--text); }
.btn-store svg { width: 20px; height: 20px; fill: currentColor; }
/* The web-app badge is line-art (globe), unlike the filled store
   glyphs — override the fill so it draws as a stroked outline. */
.btn-store .ico-web { fill: none; stroke: currentColor; stroke-width: 2; }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}
.cta-note {
  margin-top: 14px;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---- hero ---- */
.hero { text-align: center; padding: 72px 0 64px; }
.hero h1 { max-width: 16ch; margin-inline: auto; }
.hero .lead { margin: 16px auto 28px; max-width: 52ch; text-align: center; }

.pill {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 20px;
}
.pill-solid {
  background: var(--accent);
  color: #fff;
}

/* ---- generic two-column ---- */
.two-col {
  display: grid;
  gap: 32px;
}
@media (min-width: 768px) {
  .two-col { grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
}

/* ---- card grids ---- */
.grid {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr;
}
@media (min-width: 600px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 600px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
}
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--surface-3);
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
  font-weight: 500;
  font-size: 1rem;
  margin-bottom: 12px;
}

.feat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 14px;
}
.feat-icon svg { width: 22px; height: 22px; stroke: currentColor; fill: none; }

.tag {
  display: inline-block;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-left: 6px;
}

/* ---- pricing ---- */
.price-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}
@media (min-width: 768px) { .price-grid { grid-template-columns: 1fr 1fr; } }

.price-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
}
.price-card.pro { border: 1.5px solid var(--accent); }
.price-card h3 { margin-top: 0; }
.price-card .amount {
  font-family: "Fraunces", serif;
  font-size: 1.6rem;
  font-weight: 600;
  margin: 4px 0 16px;
}
.price-card ul { list-style: none; padding: 0; margin: 0; }
.price-card li {
  padding-left: 22px;
  position: relative;
  color: var(--text-2);
}
.price-card li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

/* ---- CTA strip ---- */
.cta-strip {
  background: var(--surface-3);
  text-align: center;
}
.cta-strip h2 { margin-top: 0; }

/* ---- prose pages (privacy, delete, terms, imprint, contact, faq) ---- */
.prose {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 20px 88px;
}
.prose h1 { margin-bottom: 0.25em; }
.prose h2 { font-size: 1.4rem; }
.prose h3 { font-size: 1.1rem; }
.prose .updated,
.prose .meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 28px;
}
.prose table {
  border-collapse: collapse;
  width: 100%;
  margin: 14px 0;
  font-size: 0.92rem;
}
.prose th, .prose td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.prose th { background: var(--surface-2); font-weight: 600; }

/* ---- definition list (imprint) ---- */
.legal-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 24px;
  margin: 20px 0;
}
.legal-block .line { margin: 0 0 4px; }
.dl-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  padding: 12px 0;
  border-bottom: 1px solid var(--hairline);
}
.dl-row:last-child { border-bottom: 0; }
@media (min-width: 600px) {
  .dl-row { grid-template-columns: 260px 1fr; gap: 16px; align-items: baseline; }
}
.dl-row .k { color: var(--muted); font-weight: 500; }
.dl-row .v { color: var(--text); }
.dl-row .gloss { color: var(--muted); font-size: 0.85rem; font-style: italic; }

/* ---- FAQ ---- */
.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin: 0 0 12px;
  overflow: hidden;
}
.faq summary {
  cursor: pointer;
  padding: 16px 20px;
  font-weight: 600;
  font-family: "Fraunces", serif;
  font-size: 1.05rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
  font-size: 1.2rem;
  flex: none;
}
.faq details[open] summary { background: var(--surface-3); }
.faq details[open] summary::after { content: "–"; }
.faq .answer { padding: 4px 20px 18px; color: var(--text-2); }
.faq .answer p:last-child { margin-bottom: 0; }

/* ---- contact ---- */
.contact-center { text-align: center; }
.contact-center .btn { margin: 22px 0 18px; }
.address-note {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.7;
}
.address-note a { color: var(--accent); }

/* ---- footer ---- */
.site-footer {
  border-top: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.9rem;
}
.footer-cols {
  max-width: 1080px;
  margin: 0 auto;
  padding: 48px 20px 28px;
  display: grid;
  gap: 28px;
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .footer-cols { grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
}
.footer-col .footer-title {
  font-family: "Fraunces", serif;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 6px;
}
.footer-col .footer-tag { margin: 0 0 10px; }
.footer-col .footer-head {
  color: var(--text);
  font-weight: 600;
  margin: 0 0 10px;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin: 0 0 8px; }
.footer-col a { color: var(--muted); }
.footer-col a:hover { color: var(--accent); }
.footer-rule {
  max-width: 1080px;
  margin: 0 auto;
  border-top: 1px solid var(--hairline);
}
.footer-copy {
  text-align: center;
  padding: 20px;
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---- utilities ---- */
.center { text-align: center; }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.mt-0 { margin-top: 0; }
.skip-link {
  position: absolute;
  left: -9999px;
}
.skip-link:focus {
  left: 12px;
  top: 12px;
  background: var(--accent);
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  z-index: 50;
}

/* ---- media split: text / step cards beside a phone screenshot ---- */
/* Stacks on mobile; two columns at >=900px. (.two-col is not reused
   here because it breaks at 768px — these sections want 900px so a
   phone screenshot never gets squeezed next to text on a tablet.) */
.media-split {
  display: grid;
  gap: 32px;
  align-items: center;
}
@media (min-width: 900px) {
  .media-split { grid-template-columns: 1fr 1fr; gap: 56px; }
}

.steps-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---- static screenshot ("What it does" results shot) ---- */
/* No box-shadow / border-radius — the PNG already has a device bezel
   with rounded corners and a baked-in shadow. */
.shot { display: flex; justify-content: center; }
.shot img {
  width: 100%;
  max-width: 300px;
  height: auto;
}
@media (max-width: 899px) {
  .shot img { max-width: 260px; }
}

/* ---- pure-CSS phone card deck ("How it works") ---- */
/* Three screenshots stacked in a fanned deck — the front one full
   size, the other two peeking out behind it. Each runs the same 9s
   loop on a 3s stagger, so at any moment one is front, one is
   back-right, one is back-left, and they rotate through. The stage
   box is the size of the FRONT card; the back cards extend past it
   via transforms, so the stage must not clip. */
.phone-stage {
  position: relative;
  aspect-ratio: 1131 / 2318;
  width: 100%;
  max-width: 260px;
  margin-inline: auto;
  overflow: visible;
}
@media (max-width: 899px) {
  /* 200px (not 220) so the +/-24% back cards clear a 360px viewport
     without horizontal scroll once their rotation is accounted for. */
  .phone-stage { max-width: 200px; }
}
.phone-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: center bottom;
  animation: deck 9s infinite ease-in-out;
}
/* Delays set the front-card cycle order to location -> power ->
   battery. A card is "front" during 0-28% of its own timeline; a
   negative delay of -6s / -3s shifts power / battery so they reach
   the front in the 2nd / 3rd third of the loop. */
.phone-slide:nth-child(1) { animation-delay: 0s; }   /* location / Where  */
.phone-slide:nth-child(2) { animation-delay: -6s; }  /* power / Power     */
.phone-slide:nth-child(3) { animation-delay: -3s; }  /* battery / Backup  */

@keyframes deck {
  0%,   28%  { transform: translate(0, 0)     scale(1)   rotate(0);      opacity: 1;   z-index: 3; }
  33%,  61%  { transform: translate(24%, 5%)  scale(.85) rotate(7deg);   opacity: .8;  z-index: 2; }
  66%,  94%  { transform: translate(-24%, 5%) scale(.85) rotate(-7deg);  opacity: .8;  z-index: 1; }
  100%       { transform: translate(0, 0)     scale(1)   rotate(0);      opacity: 1;   z-index: 3; }
}

/* Reduced motion: no flipping — freeze the deck fanned, with each
   slide held in a distinct resting position (front / back-left /
   back-right) so "three screens" still reads without movement. */
@media (prefers-reduced-motion: reduce) {
  .phone-slide { animation: none; }
  .phone-slide:nth-child(1) {
    transform: translate(0, 0) scale(1) rotate(0);
    opacity: 1; z-index: 3;
  }
  .phone-slide:nth-child(2) {
    transform: translate(-24%, 5%) scale(.85) rotate(-7deg);
    opacity: .8; z-index: 1;
  }
  .phone-slide:nth-child(3) {
    transform: translate(24%, 5%) scale(.85) rotate(7deg);
    opacity: .8; z-index: 2;
  }
}
