/* landing.css — the foglab.ai landing page theme.
 *
 * Owned end-to-end by the frontend agent alongside view-landing/src/lib.rs;
 * every class the SPA emits is defined here (see the css_class_contract test).
 *
 * Theming model (per the build contract):
 *   - Colors come from CSS custom properties on :root.
 *   - Default palette = LIGHT (pearl/off-white background, dark-blue ink).
 *   - System dark via @media (prefers-color-scheme: dark) when no manual choice.
 *   - Manual override via html[data-theme="light"] / html[data-theme="dark"];
 *     because these are id-qualified element+attr selectors they out-specify the
 *     bare :root inside the @media block, so a manual choice always wins.
 *   - Logo swap: .brand-light/.hammer-light show in LIGHT mode (dark-ink art),
 *     .brand-dark/.hammer-dark show in DARK mode (pearl/white art).
 */

/* ── palette tokens ─────────────────────────────────────────────────────── */
:root {
  /* Light (default): pearl background, dark-blue ink/accents. */
  --bg:        #f6f4ef;  /* pearl / off-white */
  --bg-soft:   #ffffff;  /* card surface */
  --bg-sunk:   #efece4;  /* sunk inputs / subtle fills */
  --ink:       #131b2e;  /* near dark-blue text */
  --ink-soft:  #4a5269;  /* muted text */
  --ink-faint: #7a8094;  /* very muted */
  --accent:    #1d3a8a;  /* dark blue */
  --accent-2:  #2b50b8;  /* lighter blue (hover) */
  --line:      #e3ddd1;  /* hairline borders */
  --on-accent: #f6f4ef;  /* text on the accent fill */
  --ok:        #1f7a3d;
  --err:       #b3261e;
  --shadow:    0 1px 2px rgba(19, 27, 46, 0.06), 0 8px 24px rgba(19, 27, 46, 0.05);
  --radius:    0.75rem;
  --radius-sm: 0.45rem;
  --maxw:      64rem;

  /* Logo visibility flags flipped by theme (1 = shown). */
  --logo-light: inline-block;
  --logo-dark:  none;
}

/* System dark (only when no manual data-theme attribute is present). */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #0c1322;  /* near-black dark-blue */
    --bg-soft:   #131c30;
    --bg-sunk:   #0a0f1c;
    --ink:       #f1efe8;  /* pearl text */
    --ink-soft:  #b7bdcc;
    --ink-faint: #828aa0;
    --accent:    #6f8fe8;  /* lighter blue reads on dark */
    --accent-2:  #8aa4ef;
    --line:      #243049;
    --on-accent: #0c1322;
    --ok:        #5fd089;
    --err:       #ff8a80;
    --shadow:    0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.45);
    --logo-light: none;
    --logo-dark:  inline-block;
  }
}

/* Manual LIGHT override (beats the @media block via higher specificity). */
html[data-theme="light"] {
  --bg:        #f6f4ef;
  --bg-soft:   #ffffff;
  --bg-sunk:   #efece4;
  --ink:       #131b2e;
  --ink-soft:  #4a5269;
  --ink-faint: #7a8094;
  --accent:    #1d3a8a;
  --accent-2:  #2b50b8;
  --line:      #e3ddd1;
  --on-accent: #f6f4ef;
  --ok:        #1f7a3d;
  --err:       #b3261e;
  --shadow:    0 1px 2px rgba(19, 27, 46, 0.06), 0 8px 24px rgba(19, 27, 46, 0.05);
  --logo-light: inline-block;
  --logo-dark:  none;
}

/* Manual DARK override (beats the @media block via higher specificity). */
html[data-theme="dark"] {
  --bg:        #0c1322;
  --bg-soft:   #131c30;
  --bg-sunk:   #0a0f1c;
  --ink:       #f1efe8;
  --ink-soft:  #b7bdcc;
  --ink-faint: #828aa0;
  --accent:    #6f8fe8;
  --accent-2:  #8aa4ef;
  --line:      #243049;
  --on-accent: #0c1322;
  --ok:        #5fd089;
  --err:       #ff8a80;
  --shadow:    0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.45);
  --logo-light: none;
  --logo-dark:  inline-block;
}

/* ── base ───────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

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

img { max-width: 100%; display: block; }

/* The SPA mount; before-hydration loading text. */
#app .note { padding: 2rem; color: var(--ink-faint); }

/* Centered column. */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

/* ── logo swap ──────────────────────────────────────────────────────────── */
.brand-light { display: var(--logo-light); }
.brand-dark  { display: var(--logo-dark); }
.hammer-light { display: var(--logo-light); }
.hammer-dark  { display: var(--logo-dark); }
/* per-feature marketing glyphs (foglab-<feature>-{ink,white}.svg): ink art in
   light mode, white art in dark mode — same theme-swap mechanism as the logo,
   and byte-identical to the register survey's glyph-ink/glyph-white icons. */
.glyph-ink   { display: var(--logo-light); }
.glyph-white { display: var(--logo-dark); }

/* ── nav ────────────────────────────────────────────────────────────────── */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 0;
  flex-wrap: wrap;
}

.nav-brand { display: inline-flex; align-items: center; }
.nav-brand img { height: 2.25rem; width: auto; border-radius: 0.4rem; }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* ── buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease,
    transform 0.05s ease;
}
.btn:active { transform: translateY(1px); }

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

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ── theme toggle ───────────────────────────────────────────────────────── */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* ── hero ───────────────────────────────────────────────────────────────── */
.hero {
  padding: 3.5rem 0 2.5rem;
  text-align: left;
  max-width: 46rem;
}
.hero-title {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 800;
  color: var(--ink);
}
.hero-sub {
  margin: 0 0 1.75rem;
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  color: var(--ink-soft);
  max-width: 38rem;
}

/* ── generic section ────────────────────────────────────────────────────── */
.section {
  padding: 2.5rem 0;
  border-top: 1px solid var(--line);
}
.section-title {
  margin: 0 0 1.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}

/* ── value cards ────────────────────────────────────────────────────────── */
.values {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.25rem;
}
.value-card {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  box-shadow: var(--shadow);
}
.value-h {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
}
.value-p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.98rem;
}

/* ── feature table ──────────────────────────────────────────────────────── */
.feature-table {
  display: grid;
  gap: 0.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-soft);
}
.feature-row {
  display: grid;
  grid-template-columns: 2rem 12rem 1fr;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--line);
}
.feature-row:first-child { border-top: none; }
.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
}
.feature-icon img { width: 1.5rem; height: 1.5rem; }
.feature-name {
  font-weight: 700;
  color: var(--ink);
}
.feature-desc {
  color: var(--ink-soft);
  font-size: 0.98rem;
}

/* ── how it works / steps ───────────────────────────────────────────────── */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1.25rem;
  counter-reset: step;
}
.step {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.85rem;
}
.step-h {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}

/* ── pricing ────────────────────────────────────────────────────────────── */
.pricing { text-align: center; }
.price-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin: 0 auto;
  max-width: 26rem;
  padding: 2.25rem 2.5rem;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.price-amount {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.price-period {
  color: var(--ink-soft);
  font-size: 1rem;
  margin-left: 0.35rem;
}

/* ── editions (FOG-36): three price cards side by side ─────────────────── */
.editions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.25rem;
  text-align: left;
}
.edition-card {
  display: flex;
  align-items: stretch;
  max-width: none;
  margin: 0;
  padding: 1.75rem 1.6rem;
  gap: 0.75rem;
}
.edition-name {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
}
.edition-card .price-amount { font-size: 2.2rem; }
.edition-card .price-period { display: block; margin: 0.15rem 0 0; }
.edition-includes {
  margin: 0.25rem 0 0.5rem;
  padding: 0 0 0 1.1rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.55;
  flex: 1;
}
.edition-includes li { margin: 0.15rem 0; }
.edition-card .btn { align-self: flex-start; }
.pricing-note { margin-top: 1.25rem; text-align: center; }

/* ── packs (FOG-36): the feature table, two columns when there is room ── */
.section-lead { margin: -0.75rem 0 1.25rem; max-width: 40rem; }
.section-lead.partners { margin: 1rem 0 0; }
.packs { grid-template-columns: repeat(auto-fit, minmax(24rem, 1fr)); gap: 0; }
.packs .feature-row { grid-template-columns: 2rem 10rem 1fr; border-top: 1px solid var(--line); }
.packs .feature-row:first-child { border-top: 1px solid var(--line); }
.packs .feature-row:nth-child(-n+2) { border-top: none; }
.feature-row.soon .feature-name, .feature-row.soon .feature-desc { color: var(--ink-faint); }
.feature-row.soon .pack-dot::before { opacity: 0.35; }
.tag {
  display: inline-block;
  margin-left: 0.45rem;
  padding: 0.05rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-faint);
  vertical-align: middle;
}
.pack-dot::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.75;
}

/* ── pack previews (FOG-36 phase 2): clickable rows + the panel ────────── */
.pack-row { cursor: pointer; }
.pack-row:hover { background: color-mix(in srgb, var(--accent) 5%, var(--bg-soft)); }
.pack-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.preview-cta {
  margin-left: 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}
.feature-row.soon .preview-cta { color: var(--ink-faint); }
body.panel-open { overflow: hidden; }
.panel-backdrop {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 3rem 1rem;
  background: rgba(10, 14, 22, 0.55);
  overflow-y: auto;
}
.panel {
  width: 100%; max-width: 56rem;
  background: var(--bg-soft);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem 1.6rem 1.6rem;
}
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.panel-title { margin: 0; font-size: 1.35rem; font-weight: 800; letter-spacing: -0.01em; }
.panel-close {
  flex: none;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg-soft); color: var(--ink-soft);
  font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.panel-close:hover { border-color: var(--accent); color: var(--ink); }
.panel-promise { margin: 0.5rem 0 1rem; font-size: 1.05rem; color: var(--ink-soft); }
.panel-figure { margin: 0; }
.panel-figure img, .panel-figure video {
  display: block; width: 100%; max-width: 100%; height: auto;
  border: 1px solid var(--line); border-radius: var(--radius-sm, 0.5rem);
  background: var(--bg-sunk, var(--bg));
}
.panel-figure figcaption { margin-top: 0.4rem; font-size: 0.85rem; color: var(--ink-faint); }
.panel-thumbs { display: flex; gap: 0.5rem; margin: 0.6rem 0 0; flex-wrap: wrap; }
.panel-thumb {
  padding: 0; border: 2px solid var(--line); border-radius: 0.4rem; background: none; cursor: pointer;
  width: 7.5rem; overflow: hidden;
}
.panel-thumb img { display: block; width: 100%; height: auto; }
.panel-thumb.on { border-color: var(--accent); }
.panel-soon {
  margin: 0 0 1rem; padding: 1rem 1.1rem;
  border: 1px dashed var(--line); border-radius: var(--radius-sm, 0.5rem);
  color: var(--ink-soft);
}
.panel-desc { margin: 1rem 0 0; padding-left: 1.2rem; color: var(--ink-soft); line-height: 1.55; }
.panel-desc li { margin: 0.25rem 0; }
.panel-apps { margin: 1rem 0 0; display: grid; grid-template-columns: 9rem 1fr; gap: 0.3rem 1rem; }
.panel-apps dt { font-weight: 700; color: var(--ink); }
.panel-apps dd { margin: 0; color: var(--ink-soft); }
@media (max-width: 38rem) {
  .panel-backdrop { padding: 0; align-items: stretch; }
  .panel { max-width: none; min-height: 100%; border-radius: 0; border-left: 0; border-right: 0; }
  .panel-apps { grid-template-columns: 1fr; gap: 0 1rem; }
  .panel-apps dd { margin-bottom: 0.5rem; }
  .preview-cta { display: none; }
}

/* ── tokens (FOG-36): one paragraph, kept readable ─────────────────────── */
.tokens-p { max-width: 44rem; font-size: 1.05rem; line-height: 1.65; }

/* ── legal link in the footer ───────────────────────────────────────────── */
.legal-link { color: var(--ink-soft); text-decoration: underline; margin-left: 0.5rem; }
.legal-link:hover { color: var(--ink); }

/* ── muted notes (footer) ───────────────────────────────────────────────── */
.note {
  color: var(--ink-faint);
  font-size: 0.9rem;
}

/* ── footer ─────────────────────────────────────────────────────────────── */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.9rem;
  flex-wrap: wrap;
}

/* ── responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 38rem) {
  .feature-row, .packs .feature-row { grid-template-columns: 1.6rem 1fr; }
  .feature-desc { grid-column: 1 / -1; }
  .packs { grid-template-columns: 1fr; }
  .packs .feature-row:nth-child(-n+2) { border-top: 1px solid var(--line); }
  .packs .feature-row:first-child { border-top: none; }
}
