/* ============================================================
 * ESP32 WebBuilder — Landing Page Styles
 * Copyright © 2026 G9Six, LLC. All rights reserved.
 *
 * The landing page reuses the app's color palette (kept here as
 * lp-* vars so the page is self-contained and doesn't pull in the
 * full app stylesheet) but lays the page out as a vertical document
 * rather than the app's three-pane grid.
 * ============================================================ */

:root {
  /* Mirror of the app's "light" palette (the user's default scheme).
     Duplicated here so landing.html is self-contained — pulling in
     the app's full styles.css would ship the entire grid editor's
     layout rules to a page that doesn't need them. */
  --lp-bg:        #f9fafc;
  --lp-panel:     #e7ecf3;
  --lp-panel-2:   #d6dee8;
  --lp-line:      #bac6d6;
  --lp-ink:       #23303d;
  --lp-dim:       #5d7186;
  --lp-accent:    #1f7fd6;
  --lp-accent-dim:#4a93d8;
  --lp-accent-text:#ffffff;
  --lp-grid-dot:  #aebccd;
  --lp-warn:      #b06d12;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--lp-bg);
  color: var(--lp-ink);
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  line-height: 1.55;
  display: flex; flex-direction: column;
  /* Dotted grid mirrors the app canvas, faintly, for visual continuity. */
  background-image: radial-gradient(circle, var(--lp-grid-dot) 1px, transparent 1.4px);
  background-size: 26px 26px;
  background-attachment: fixed;
}

a { color: var(--lp-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code {
  background: var(--lp-panel-2); color: var(--lp-ink);
  padding: 1px 6px; border-radius: 2px;
  font-family: 'JetBrains Mono', monospace; font-size: 0.92em;
}

/* ============================================================
 * Header
 * ============================================================ */
.lp-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 32px;
  background: rgba(231, 236, 243, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--lp-line);
}
.lp-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700; font-size: 14px;
  color: var(--lp-accent); letter-spacing: 0.04em;
  text-decoration: none;
}
.lp-logo::before { content: "▶ "; color: var(--lp-accent-dim); }
.lp-logo:hover { text-decoration: none; }
.lp-nav { display: flex; align-items: center; gap: 24px; }
.lp-nav-link {
  color: var(--lp-dim); font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.lp-nav-link:hover { color: var(--lp-ink); text-decoration: none; }

/* ============================================================
 * Buttons
 * ============================================================ */
.lp-btn {
  display: inline-block;
  padding: 8px 18px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.08em;
  border: 1px solid var(--lp-line);
  background: var(--lp-panel-2); color: var(--lp-ink);
  border-radius: 2px;
  cursor: pointer; user-select: none;
  transition: all 0.12s ease;
  text-decoration: none;
}
.lp-btn:hover {
  border-color: var(--lp-accent);
  color: var(--lp-accent);
  text-decoration: none;
}
.lp-btn-primary {
  background: var(--lp-accent);
  color: var(--lp-accent-text);
  border-color: var(--lp-accent);
}
.lp-btn-primary:hover {
  background: var(--lp-accent-dim);
  border-color: var(--lp-accent-dim);
  color: var(--lp-accent-text);
}
.lp-btn-ghost {
  background: transparent;
}
.lp-btn-lg {
  padding: 14px 28px; font-size: 14px;
}

/* ============================================================
 * Main / sections
 * ============================================================ */
.lp-main {
  flex: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 80px 32px 60px;
  width: 100%;
}
.lp-section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 28px; font-weight: 700;
  color: var(--lp-ink);
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}
.lp-section-lead {
  color: var(--lp-dim);
  font-size: 14px;
  margin: 0 0 32px;
  max-width: 640px;
}

/* Body prose under a section title — used for longer reading copy
   like the "What it doesn't" scope-setting paragraphs. Wider line
   height and ink color make it scan as substance rather than caption.
   Fills the full section width (bounded by the .lp-main wrapper). */
.lp-prose {
  color: var(--lp-ink);
  font-size: 14px;
  line-height: 1.75;
  margin: 0 0 18px;
}
.lp-prose:last-child { margin-bottom: 0; }

/* ============================================================
 * Hero
 * ============================================================ */
.lp-hero {
  text-align: center;
  padding: 40px 0 80px;
}
.lp-eyebrow {
  display: inline-block;
  color: var(--lp-accent);
  font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.18em;
  padding: 4px 12px;
  border: 1px solid var(--lp-accent-dim);
  border-radius: 2px;
  margin-bottom: 24px;
}
.lp-headline {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--lp-ink);
  margin: 0 0 24px;
}
.lp-subhead {
  font-family: 'JetBrains Mono', monospace;
  font-size: 15px; line-height: 1.65;
  color: var(--lp-dim);
  max-width: 640px;
  margin: 0 auto 36px;
}
.lp-cta {
  display: flex; gap: 12px; justify-content: center;
  flex-wrap: wrap; margin-bottom: 16px;
}
.lp-hero-meta {
  font-size: 11px; color: var(--lp-dim);
  text-transform: uppercase; letter-spacing: 0.12em;
}

/* ============================================================
 * Features
 * ============================================================ */
.lp-features {
  padding: 60px 0;
  border-top: 1px dashed var(--lp-line);
}
.lp-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-top: 28px;
}
.lp-feature {
  background: var(--lp-panel);
  border: 1px solid var(--lp-line);
  border-left: 3px solid var(--lp-accent);
  border-radius: 2px;
  padding: 22px;
  transition: border-color 0.12s, transform 0.12s;
}
.lp-feature:hover {
  border-color: var(--lp-accent-dim);
  border-left-color: var(--lp-accent);
  transform: translateY(-2px);
}
.lp-feature-icon {
  font-size: 22px;
  color: var(--lp-accent);
  margin-bottom: 10px;
  font-family: 'JetBrains Mono', monospace;
}
.lp-feature-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px; font-weight: 700;
  color: var(--lp-ink);
  margin: 0 0 8px;
}
.lp-feature-body {
  font-size: 13px;
  color: var(--lp-dim);
  line-height: 1.6;
}

/* ============================================================
 * Preview / mockup
 * ============================================================ */
.lp-preview {
  padding: 60px 0 40px;
  border-top: 1px dashed var(--lp-line);
}
.lp-mockup {
  background: var(--lp-panel);
  border: 1px solid var(--lp-line);
  border-radius: 4px;
  padding: 6px;
  /* Subtle shadow gives the mockup some depth without going skeuomorphic. */
  box-shadow: 0 8px 32px rgba(35, 48, 61, 0.08);
  overflow: hidden;
}
.lp-mockup-svg {
  display: block;
  width: 100%; height: auto;
  border-radius: 2px;
}

/* ----------------------------------------------------------------------------
 * Mockup build-up animation
 *
 * When the .lp-mockup div scrolls into the viewport, an IntersectionObserver
 * adds the `.lp-animate` class. From there the SVG plays a build-up sequence:
 * each node pops in, the wires draw themselves, the GENERATE chip pulses, and
 * the inspector code populates stanza by stanza — mirroring how a user builds
 * up a real diagram in the editor.
 *
 * The animation uses `animation-fill-mode: both` so each element honors its
 * "from" keyframe (opacity 0) during the staggered delay, and its "to"
 * keyframe (visible) after the run. Without `.lp-animate` the rules don't
 * apply at all, so the mockup just renders in its final state — no flash of
 * hidden content for visitors who skip the JS or scroll past too fast.
 * ---------------------------------------------------------------------------- */

@keyframes lp-node-pop {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes lp-wire-draw {
  to { stroke-dashoffset: 0; }
}
@keyframes lp-text-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes lp-pulse {
  0%, 100% { filter: none; }
  40%, 60% { filter: brightness(1.35) drop-shadow(0 0 6px var(--lp-accent)); }
}

/* Nodes pop in one at a time. transform-box: fill-box keeps the translate
   anchored to the element's own bbox inside the SVG coordinate system. */
.lp-mockup.lp-animate .lp-mockup-node {
  transform-box: fill-box;
  transform-origin: center;
  animation: lp-node-pop 0.45s cubic-bezier(0.2, 0.8, 0.2, 1.05) both;
}
.lp-mockup.lp-animate .lp-mockup-node-header  { animation-delay: 0.30s; }
.lp-mockup.lp-animate .lp-mockup-node-page    { animation-delay: 0.70s; }
.lp-mockup.lp-animate .lp-mockup-node-card    { animation-delay: 1.10s; }
.lp-mockup.lp-animate .lp-mockup-node-gauge   { animation-delay: 1.90s; }
.lp-mockup.lp-animate .lp-mockup-node-form    { animation-delay: 2.50s; }
.lp-mockup.lp-animate .lp-mockup-node-storage { animation-delay: 2.90s; }

/* Wires "draw" by animating stroke-dashoffset from a large value down to 0.
   200 comfortably exceeds either path length (~80 and ~120 units), so the
   stroke is fully hidden at the start of each animation. */
.lp-mockup.lp-animate .lp-mockup-wire {
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
  animation: lp-wire-draw 0.5s ease-out both;
}
.lp-mockup.lp-animate .lp-mockup-wire-1 { animation-delay: 1.55s; }
.lp-mockup.lp-animate .lp-mockup-wire-2 { animation-delay: 2.35s; }

/* GENERATE button gives a brief glow once the diagram is built, just before
   the inspector code populates — sells the cause/effect of pressing it. */
.lp-mockup.lp-animate .lp-mockup-generate {
  animation: lp-pulse 0.7s ease-in-out 3.20s both;
}

/* Inspector stanzas fade in after the GENERATE pulse. */
.lp-mockup.lp-animate .lp-mockup-stanza {
  animation: lp-text-fade 0.4s ease-out both;
}
.lp-mockup.lp-animate .lp-mockup-stanza-1 { animation-delay: 3.70s; }
.lp-mockup.lp-animate .lp-mockup-stanza-2 { animation-delay: 4.00s; }
.lp-mockup.lp-animate .lp-mockup-stanza-3 { animation-delay: 4.30s; }

/* Honor the user's reduced-motion preference: skip the animation entirely
   and just show the final state. */
@media (prefers-reduced-motion: reduce) {
  .lp-mockup.lp-animate .lp-mockup-node,
  .lp-mockup.lp-animate .lp-mockup-wire,
  .lp-mockup.lp-animate .lp-mockup-generate,
  .lp-mockup.lp-animate .lp-mockup-stanza {
    animation: none;
  }
  .lp-mockup.lp-animate .lp-mockup-wire {
    stroke-dashoffset: 0;
  }
}
.lp-preview-cta {
  text-align: center;
  margin-top: 32px;
}

/* ============================================================
 * Pricing
 * ============================================================ */
.lp-pricing {
  padding: 60px 0;
  border-top: 1px dashed var(--lp-line);
}
/* Grid is centered and ready to hold more tiers later; with a single
   plan it renders as one centered card rather than stretching full width. */
.lp-plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 320px));
  justify-content: center;
  gap: 18px;
  margin-top: 28px;
}
.lp-plan {
  background: var(--lp-panel);
  border: 1px solid var(--lp-line);
  border-top: 3px solid var(--lp-accent);
  border-radius: 2px;
  padding: 28px 24px;
  text-align: center;
  transition: border-color 0.12s, transform 0.12s;
}
.lp-plan:hover {
  border-color: var(--lp-accent-dim);
  border-top-color: var(--lp-accent);
  transform: translateY(-2px);
}
.lp-plan-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--lp-accent);
  margin-bottom: 12px;
}
.lp-plan-price {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 44px; font-weight: 700;
  color: var(--lp-ink);
  line-height: 1;
  margin-bottom: 24px;
}
.lp-plan-price-note {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; font-weight: 400;
  color: var(--lp-dim);
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-left: 6px;
}
.lp-plan-features {
  list-style: none;
  text-align: left;
  margin: 0 0 28px;
  padding: 0;
  border-top: 1px dashed var(--lp-line);
}
.lp-plan-features li {
  padding: 12px 0;
  font-size: 13px;
  color: var(--lp-ink);
  border-bottom: 1px dashed var(--lp-line);
}
.lp-plan-features li::before {
  content: "✓";
  color: var(--lp-accent);
  font-weight: 700;
  margin-right: 10px;
}
.lp-plan-cta {
  display: block;
  text-align: center;
}

/* ============================================================
 * Footer
 * ============================================================ */
.lp-footer {
  border-top: 1px solid var(--lp-line);
  background: var(--lp-panel);
  padding: 18px 32px;
  font-size: 11px;
  color: var(--lp-dim);
}
.lp-footer-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; justify-content: space-between;
  align-items: center; flex-wrap: wrap; gap: 10px;
}
.lp-footer-links a {
  color: var(--lp-dim);
}
.lp-footer-links a:hover {
  color: var(--lp-accent);
}

/* ============================================================
 * Small screens
 * ============================================================ */
@media (max-width: 640px) {
  .lp-header { padding: 12px 18px; }
  .lp-nav { gap: 14px; }
  .lp-nav-link[href="#features"], .lp-nav-link[href="#preview"],
  .lp-nav-link[href="#pricing"] {
    display: none;  /* keep just the logo + Launch button visible */
  }
  .lp-main { padding: 40px 18px; }
  .lp-hero { padding: 20px 0 40px; }
  .lp-features, .lp-preview { padding: 40px 0; }
}
