/* ─── Sunpatch landing pages (garden-sun-planner, houseplant-light-meter) ──
   Shared layout + components for the SEO landing pages. Loaded after
   site.css, which supplies the design tokens and @font-face rules. ──────── */

/* page-specific tokens */
:root {
  --gold-soft: #fff0b8;
  --shadow: 0 18px 50px rgba(47, 39, 25, 0.12);
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --gold-soft: #4a3c18; --shadow: 0 18px 50px rgba(0, 0, 0, 0.34); }
}
[data-theme="dark"]  { --gold-soft: #4a3c18; --shadow: 0 18px 50px rgba(0, 0, 0, 0.34); }
[data-theme="light"] { --gold-soft: #fff0b8; --shadow: 0 18px 50px rgba(47, 39, 25, 0.12); }

body { padding: 0; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ─── Top bar ────────────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 0 18px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}
.brand img { width: 38px; height: 38px; }
.brand strong {
  display: block;
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1;
}
.brand span {
  display: block;
  margin-top: 2px;
  color: var(--ink-3);
  font-size: 12px;
  letter-spacing: 0.04em;
}
.nav {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
}
.nav a:not(.button) {
  color: var(--ink-2);
  text-decoration: none;
}
.nav a:not(.button):hover { color: var(--ink); }

/* ─── Buttons ────────────────────────────────────────────────────────── */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 8px;
  background: var(--sage-deep);
  color: #f7f3ec;
  text-decoration: none;
  font-weight: 700;
  line-height: 1.2;
  transition: box-shadow 0.18s ease, transform 0.18s var(--ease-out-quint);
}
/* Lift only on hover-capable devices, so the transform can't stick after a tap. */
@media (hover: hover) {
  .button:hover { box-shadow: 0 6px 16px rgba(58,90,63,0.4); transform: translateY(-1px); }
}
.button:active { transform: translateY(0) scale(0.985); transition-duration: 0.08s; }
.button.secondary {
  background: var(--sage-bg);
  color: var(--sage-deep);
  border: 1px solid var(--border);
}
/* dark mode: sage-deep on dark bg is borderline contrast — use a slightly deeper value */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .button:not(.secondary) { background: #3a6840; }
}
[data-theme="dark"] .button:not(.secondary) { background: #3a6840; }

/* ─── Hero — full-bleed media, atmospheric light wash, signature band ─── */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.04fr);
  gap: clamp(28px, 4vw, 60px);
  align-items: center;
  position: relative;
  overflow: hidden;
}
.hero-copy {
  /* left edge aligns to the centered content gutter; right edge meets the gap */
  padding: clamp(40px, 5vw, 72px) 0 clamp(40px, 5vw, 72px)
           max(24px, calc((100% - 1120px) / 2 + 24px));
}
.hero-media {
  position: relative;
  align-self: stretch;
  display: flex;
  align-items: center;
}
/* soft wash in the page's own data palette — atmosphere, not decoration */
.hero-media::before {
  content: "";
  position: absolute;
  inset: -24% -8% -24% 6%;
  background: var(--hero-glow);
  filter: blur(50px);
  z-index: 0;
}
.hero .preview {
  position: relative;
  z-index: 1;
  width: 100%;
  border-right: none;
  border-radius: 14px 0 0 14px;
}
/* the product's ramp in miniature — the hero's opening mark */
.lightbar {
  display: block;
  width: clamp(88px, 24%, 140px);
  height: 7px;
  border-radius: 999px;
  margin-bottom: 22px;
  background: var(--hero-band);
}
.hero--sun {
  --hero-band: linear-gradient(90deg,#68529f,#cd6056,#e6783a,#f0a842,#f6d678);
  --hero-glow: radial-gradient(58% 68% at 68% 46%, rgba(240,168,66,0.34), transparent 72%);
}
.hero--dli {
  --hero-band: linear-gradient(90deg,#3a3470,#5e5eaa,#7ba38a,#d6c069,#e88c4a);
  --hero-glow: radial-gradient(58% 68% at 68% 46%, rgba(123,163,138,0.36), transparent 72%);
}
h1 {
  font-family: var(--font-display);
  font-size: clamp(40px, 7vw, 72px);
  line-height: 0.98;
  font-weight: 700;
  letter-spacing: -0.01em;
  max-width: 760px;
  margin-bottom: 22px; /* override site.css 8px */
  text-wrap: balance;
}
.lede {
  color: var(--ink-2);
  font-size: 20px;
  line-height: 1.55;
  max-width: 670px;
  margin-bottom: 28px;
}
.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.value-props {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -10px 0 22px;
  padding: 0;
  list-style: none;
}
.value-props li {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  padding: 7px 11px;
}
.preview {
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.preview img { width: 100%; display: block; }
.preview .preview-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .preview .preview-light { display: none; }
  :root:not([data-theme="light"]) .preview .preview-dark  { display: block; }
}
[data-theme="dark"] .preview .preview-light { display: none; }
[data-theme="dark"] .preview .preview-dark  { display: block; }

/* ─── Hero entrance — the one orchestrated page-load moment ───────────── */
/* Animates an already-visible default: the keyframe momentarily starts from
   opacity 0 (fill: both holds the start during the delay), so content never
   ships blank — reduced motion and headless renders land on the final state. */
@keyframes hero-rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
@keyframes hero-settle {
  from { opacity: 0; transform: scale(0.985); }
  to   { opacity: 1; transform: none; }
}
.hero-copy > * {
  animation: hero-rise 0.62s var(--ease-out-quint) both;
}
.hero-copy > :nth-child(1) { animation-delay: 0.04s; }
.hero-copy > :nth-child(2) { animation-delay: 0.11s; }
.hero-copy > :nth-child(3) { animation-delay: 0.18s; }
.hero-copy > :nth-child(4) { animation-delay: 0.25s; }
.hero-copy > :nth-child(5) { animation-delay: 0.32s; }
.hero-media { animation: hero-settle 0.72s var(--ease-out-quint) 0.16s both; }

/* ─── Sections ───────────────────────────────────────────────────────── */
.section {
  padding: 64px 0;
  border-top: 1px solid var(--border);
}
.section.alt { background: var(--panel); }
.section-head {
  max-width: 720px;
  margin-bottom: 36px;
}
h2 {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.4vw, 34px);
  line-height: 1.18;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
  padding-bottom: 0;
  border-bottom: none;
  text-wrap: balance;
}
.section-head p,
.faq p {
  color: var(--ink-2);
  font-size: 17px;
}

/* ─── Feature list ("why") — borderless, icon-led ────────────────────── */
.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 36px 40px;
}
.feature-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: var(--sage-bg);
  color: var(--sage-deep);
  margin-bottom: 16px;
}
.feature-mark svg { width: 22px; height: 22px; }
.feature h3 {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: 0;
  margin-bottom: 8px;
}
.feature p {
  color: var(--ink-2);
  line-height: 1.6;
}

/* ─── Numbered flow ("how it works") — connected nodes, no boxes ──────── */
.flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
  list-style: none;
}
.flow-step {
  position: relative;
  padding-top: 4px;
}
/* connecting line between node centers */
.flow-step::after {
  content: "";
  position: absolute;
  top: 21px;
  left: calc(50% + 24px);
  right: calc(-50% + 24px);
  height: 2px;
  background: var(--border);
}
.flow-step:last-child::after { display: none; }
.flow-num {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--sage-deep);
  color: #f7f3ec;
  font-weight: 800;
  font-size: 15px;
  margin-bottom: 18px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .flow-num { background: #3a6840; }
}
[data-theme="dark"] .flow-num { background: #3a6840; }
.flow-step h3 {
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: 0;
  margin-bottom: 7px;
}
.flow-step p {
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.55;
}

/* ─── Data ramp ("what is full sun / DLI") — the signature motif ──────── */
.ramp { max-width: 940px; }
.ramp-bar {
  height: 26px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12);
}
.ramp-bar--sun {
  background: linear-gradient(90deg,
    #261c46 0%, #364496 16%, #68529f 32%, #a85a8a 46%,
    #cd6056 58%, #e6783a 70%, #f0a842 82%, #f6d678 100%);
}
.ramp-bar--dli {
  background: linear-gradient(90deg,
    #1c1830 0%, #3a3470 8%, #5e5eaa 21%, #7ba38a 38%,
    #d6c069 58%, #e88c4a 78%, #cc3535 100%);
}
.ramp-ends {
  display: flex;
  justify-content: space-between;
  margin: 9px 2px 30px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--ink-3);
}
/* Aligned rows (swatch · label · description) — resolves cleanly for any
   item count, where an auto-fit grid left a ragged trailing cell. */
.ramp-legend {
  display: grid;
  gap: 15px;
  margin: 0;
  max-width: 860px;
}
.ramp-row {
  display: grid;
  grid-template-columns: auto minmax(150px, 190px) 1fr;
  column-gap: 16px;
  align-items: baseline;
}
.ramp-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  align-self: start;
  margin-top: 4px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08) inset;
}
.ramp-row dt {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--ink);
  font-weight: 700;
  font-size: 15px;
}
.ramp-val {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  color: var(--terra-deep);
}
.ramp-row dd {
  margin: 0;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.5;
}

/* ─── FAQ — the one place cards remain ───────────────────────────────── */
.faq {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
}
.card h3 {
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.25;
  margin-bottom: 8px;
  letter-spacing: 0;
}
.card p { color: var(--ink-2); }

/* ─── CTA + footer ───────────────────────────────────────────────────── */
.cta {
  text-align: center;
  padding: 64px 24px 72px;
  background: var(--sage-bg);
  border-top: 1px solid var(--border);
}
.cta h2 {
  max-width: 680px;
  margin: 0 auto 12px;
}
.cta p {
  max-width: 640px;
  margin: 0 auto 24px;
  color: var(--ink-2);
  font-size: 18px;
}
footer {
  padding: 24px 0 38px;
  color: var(--ink-3);
  font-size: 13px;
  text-align: center;
}
footer a {
  color: var(--ink-3);
  text-decoration: none;
  margin: 0 8px;
}
footer a:hover { color: var(--ink); }

/* ─── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 4px; }
  .hero-copy { padding: 24px 24px 4px; max-width: 760px; }
  .hero-media { padding: 12px 24px 8px; }
  .hero-media::before { display: none; }
  .hero .preview { border-right: 1px solid var(--border); border-radius: 12px; }
  .features { grid-template-columns: 1fr 1fr; }
  .flow { grid-template-columns: 1fr 1fr; row-gap: 36px; }
  .flow-step:nth-child(2)::after { display: none; }
  .faq { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 18px; }
  .hero-copy { padding: 8px 18px 0; }
  .hero-media { padding: 14px 18px 0; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .nav { width: 100%; justify-content: space-between; gap: 10px; }
  .nav .button { min-height: 38px; padding: 0 12px; }
  .lede { font-size: 18px; }
  .features { grid-template-columns: 1fr; gap: 28px; }
  .faq { grid-template-columns: 1fr; }
  .ramp-row { grid-template-columns: auto 1fr; column-gap: 12px; }
  .ramp-row dt, .ramp-row dd { grid-column: 2; }
  .ramp-row dd { margin-top: 4px; }
  .section { padding: 48px 0; }
  .card { padding: 22px; }
  footer a { display: inline-block; margin: 4px 8px; }

  /* flow becomes a vertical timeline with a left rail */
  .flow { grid-template-columns: 1fr; gap: 0; }
  .flow-step { padding: 0 0 26px 54px; }
  .flow-step:last-child { padding-bottom: 0; }
  .flow-num { position: absolute; top: 0; left: 0; margin-bottom: 0; }
  .flow-step::after {
    display: block;
    top: 38px;
    bottom: 0;
    left: 18px;
    right: auto;
    width: 2px;
    height: auto;
  }
  .flow-step:last-child::after { display: none; }
  .flow-step:nth-child(2)::after { display: block; }
}

/* ─── Touch input — roomier tap targets ──────────────────────────────── */
@media (pointer: coarse) {
  .nav a:not(.button) { padding: 10px 2px; }
  footer a { padding: 8px 8px; }
}

/* ─── Honor reduced motion ───────────────────────────────────────────── */
/* Collapse every animation/transition to ~instant so the hero reveal lands
   on its final (visible) frame and nothing moves for motion-sensitive users. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ─── Image zoom modal ───────────────────────────────────────────────── */
#preview-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(23, 21, 18, 0.82);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 32px;
  cursor: zoom-out;
  opacity: 0;
  /* allow-discrete keeps `display` through the fade; @starting-style gives the
     enter frame. Both degrade to an instant show on browsers without support. */
  transition: opacity 0.2s ease, display 0.2s allow-discrete;
}
#preview-modal.open { display: flex; opacity: 1; }
@starting-style { #preview-modal.open { opacity: 0; } }
#preview-modal img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
  cursor: default;
  transform: scale(0.965);
  transition: transform 0.26s var(--ease-out-quint);
}
#preview-modal.open img { transform: scale(1); }
@starting-style { #preview-modal.open img { transform: scale(0.965); } }
#preview-modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: #fff;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
  padding: 4px 8px;
}
#preview-modal-close:hover { opacity: 1; }
