/* ForestMail marketing — app layout.
   Consumes the shared design system (tokens.css + base.css); everything here is
   marketing-specific layout. All colors reference --fm-* tokens so light and
   dark themes stay correct. No external resources. */

#app { outline: none; }
#app:focus-visible { outline: none; }

.lede { font-size: var(--fm-fs-4); line-height: 1.5; max-width: 60ch; }
.center { text-align: center; }
.center .hero-cta, .center .chips { justify-content: center; }
.center .lede, .center .section-sub { margin-left: auto; margin-right: auto; }

/* ---- Header --------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--fm-surface) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--fm-line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--fm-s-4); min-height: var(--fm-header-h); }
.site-header .header-inner { max-width: none; } /* brand at the page gutter, as in every app */
.nav-panel { display: flex; align-items: center; gap: var(--fm-s-5); flex: 1; justify-content: flex-end; }
.site-nav { display: flex; align-items: center; gap: var(--fm-s-2); flex-wrap: wrap; }
.nav-link {
  color: var(--fm-text-soft); padding: 7px 10px; border-radius: var(--fm-r-2);
  font-size: var(--fm-fs-2); font-weight: 550;
}
.nav-link:hover { background: var(--fm-surface-2); text-decoration: none; }
.nav-link.is-active { color: var(--fm-green); background: var(--fm-green-soft); }
.header-actions { gap: var(--fm-s-2); }
.nav-toggle { display: none; }
.burger, .burger::before, .burger::after {
  display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; position: relative;
}
.burger::before, .burger::after { content: ""; position: absolute; left: 0; }
.burger::before { top: -6px; } .burger::after { top: 6px; }

/* ---- Sections ------------------------------------------------------------- */
.section { padding: var(--fm-s-9) 0; }
.section-alt { background: var(--fm-surface-2); border-top: 1px solid var(--fm-line-soft); border-bottom: 1px solid var(--fm-line-soft); }
.section-head { max-width: 62ch; margin-bottom: var(--fm-s-7); }
.section-head.center, .section.center .section-head { margin-left: auto; margin-right: auto; }
.section-sub { font-size: var(--fm-fs-3); max-width: 60ch; }

/* ---- Hero ----------------------------------------------------------------- */
.hero { padding: var(--fm-s-9) 0; overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: 1.05fr 1fr; gap: var(--fm-s-8); align-items: center; }
.hero h1 { font-size: var(--fm-fs-8); }
.hero-cta { gap: var(--fm-s-3); margin: var(--fm-s-6) 0 var(--fm-s-3); }
.hero-note { font-size: var(--fm-fs-2); }
.hero-art { min-width: 0; }
.product-hero { padding: var(--fm-s-9) 0 var(--fm-s-7); }
.product-hero h1 { font-size: var(--fm-fs-7); max-width: 18ch; }
.product-hero .lede { margin-top: var(--fm-s-4); }
.product-hero .hero-cta { margin-top: var(--fm-s-6); }

/* ---- Grids + cards -------------------------------------------------------- */
.grid { display: grid; gap: var(--fm-s-5); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.feat { display: flex; flex-direction: column; gap: 6px; }
.feat h3 { margin: 0; }
.feat p { margin: 0; }
.feat-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: var(--fm-r-2);
  background: var(--fm-brand-grad); color: #fff; margin-bottom: 8px;
  box-shadow: 0 4px 12px rgba(20,120,92,.28);
}
.feat-ico svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.trust-band { gap: var(--fm-s-5); }
.trust-item h3 { margin: 0 0 4px; color: var(--fm-green); }
.trust-item p { margin: 0; font-size: var(--fm-fs-2); }

/* ---- Chips / related ------------------------------------------------------ */
.chips { gap: var(--fm-s-2); }
.chip {
  display: inline-flex; align-items: center; padding: 8px 14px; border-radius: var(--fm-r-pill);
  border: 1px solid var(--fm-line); background: var(--fm-surface); color: var(--fm-text-soft);
  font-size: var(--fm-fs-2); font-weight: 550;
}
.chip:hover { background: var(--fm-surface-2); text-decoration: none; }

/* ---- Mockups -------------------------------------------------------------- */
.mk { margin: 0; }
.mk-frame {
  border: 1px solid var(--fm-line); border-radius: var(--fm-r-3);
  box-shadow: var(--fm-shadow-2); overflow: hidden; background: var(--fm-surface);
}
.hero-art .mk-frame { box-shadow: var(--fm-shadow-3); }
.mk-frame svg { display: block; width: 100%; height: auto; }
.mk-cap { margin-top: var(--fm-s-2); font-size: var(--fm-fs-1); text-align: center; }
.mk-wrap { max-width: 760px; margin: 0 auto; }
.mk-grid-wrap { align-items: start; }

/* SVG element theming (token-driven, so mockups follow light/dark). */
.mk-bg { fill: var(--fm-surface); }
.mk-chrome { fill: var(--fm-surface-3); }
.mk-dot { fill: var(--fm-line); }
.mk-omnibox { fill: var(--fm-surface); stroke: var(--fm-line); stroke-width: 1; }
.mk-chrome-t { fill: var(--fm-text-muted); font: 500 10px var(--fm-font); }
.mk-side { fill: var(--fm-surface-2); }
.mk-cta { fill: var(--fm-green); }
.mk-cta-t { fill: var(--fm-text-invert); font: 600 10px var(--fm-font); text-anchor: middle; }
.mk-nav { fill: transparent; }
.mk-nav-active { fill: var(--fm-green-soft); }
.mk-nav-t { fill: var(--fm-text-soft); font: 500 10px var(--fm-font); }
.mk-ico { fill: var(--fm-line); }
.mk-row { fill: var(--fm-surface-2); }
.mk-row-unread { fill: var(--fm-green-soft); }
.mk-ava { fill: var(--fm-green); }
.mk-ava-t { fill: var(--fm-text-invert); font: 600 9px var(--fm-font); text-anchor: middle; }
.mk-line { fill: var(--fm-line); }
.mk-line-soft { fill: var(--fm-line-soft); }
.mk-line-strong { fill: var(--fm-text-muted); }
.mk-unread { fill: var(--fm-green); }
.mk-grid { stroke: var(--fm-line-soft); stroke-width: 1; }
.mk-col-h { fill: var(--fm-text-muted); font: 600 10px var(--fm-font); text-anchor: middle; }
.mk-mini { fill: var(--fm-surface-3); }
.mk-mini-on { fill: var(--fm-green); }
.mk-ev-a { fill: var(--fm-green); opacity: .85; }
.mk-ev-b { fill: var(--fm-info); opacity: .8; }
.mk-ev-c { fill: var(--fm-accent); }
.mk-stat { fill: var(--fm-surface-2); stroke: var(--fm-line); stroke-width: 1; }
.mk-stat-v { fill: var(--fm-text); font: 650 16px var(--fm-font); }
.mk-stat-k { fill: var(--fm-text-muted); font: 500 9px var(--fm-font); }
.mk-pill-ok { fill: var(--fm-ok-bg); }
.mk-pill-warn { fill: var(--fm-warn-bg); }
.mk-pill-info { fill: var(--fm-info-bg); }
.mk-pill-t { fill: var(--fm-text-soft); font: 600 9px var(--fm-font); text-anchor: middle; }

/* ---- Pricing -------------------------------------------------------------- */
.plans { align-items: stretch; }
.plan { display: flex; flex-direction: column; gap: var(--fm-s-3); position: relative; transition: transform var(--fm-dur) var(--fm-ease), box-shadow var(--fm-dur) var(--fm-ease); }
.plan:hover { box-shadow: var(--fm-shadow-2); }
.plan-featured { border-color: transparent; box-shadow: var(--fm-shadow-2); overflow: hidden; }
.plan-featured::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--fm-brand-grad); }
@media (min-width: 901px) { .plan-featured { transform: translateY(-8px); } }
.plan-top { justify-content: space-between; align-items: center; }
.plan-top h3 { margin: 0; font-size: var(--fm-fs-4); }
.plan-tag { margin: 0; font-size: var(--fm-fs-2); }
.plan-price { margin: 0; }
.plan-price strong { font-size: var(--fm-fs-7); letter-spacing: -1px; }
.plan-cta { width: 100%; }
.plan-feats { list-style: none; margin: var(--fm-s-2) 0 0; padding: 0; display: grid; gap: 10px; }
.plan-feats li { display: flex; gap: 10px; align-items: flex-start; font-size: var(--fm-fs-2); color: var(--fm-text-soft); }
.tick { flex: none; width: 16px; height: 16px; margin-top: 2px; border-radius: 50%; background: var(--fm-green-soft); position: relative; }
.tick::after { content: ""; position: absolute; left: 5px; top: 3px; width: 4px; height: 7px; border: solid var(--fm-green); border-width: 0 2px 2px 0; transform: rotate(45deg); }

.price-teaser { display: flex; align-items: center; justify-content: space-between; gap: var(--fm-s-5); flex-wrap: wrap; }
.teaser-note { margin: 8px 0 0; font-size: var(--fm-fs-3); font-weight: 600; }

/* ---- FAQ / details -------------------------------------------------------- */
.faq { display: grid; gap: var(--fm-s-3); max-width: 760px; }
.faq-item { padding: var(--fm-s-4) var(--fm-s-5); }
.faq-item summary { cursor: pointer; font-weight: 600; list-style-position: inside; }
.faq-item summary::-webkit-details-marker { color: var(--fm-text-muted); }
.faq-item p { margin: 10px 0 0; }

/* ---- Docs list / dev ------------------------------------------------------ */
.doc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--fm-s-3); max-width: 640px; }
.doc-item { display: flex; align-items: center; justify-content: space-between; padding: var(--fm-s-4) var(--fm-s-5); }
.callout-note { max-width: 70ch; font-size: var(--fm-fs-2); }
.code-sample {
  background: var(--fm-surface-3); border: 1px solid var(--fm-line); border-radius: var(--fm-r-2);
  padding: var(--fm-s-5); overflow-x: auto; font-size: var(--fm-fs-2); line-height: 1.6; margin: 0 0 var(--fm-s-4);
}

/* ---- Final CTA — a bold branded panel that converts ---------------------- */
.final-cta { text-align: center; }
.final-cta .fm-container {
  background: var(--fm-brand-grad); color: #fff;
  border-radius: var(--fm-r-4); padding: var(--fm-s-9) var(--fm-s-6);
  box-shadow: var(--fm-shadow-3); max-width: 960px;
}
.final-cta h2 { color: #fff; }
.final-cta .section-sub, .final-cta .section-sub.fm-muted { color: rgba(255,255,255,.88); }
.final-cta .hero-cta { justify-content: center; margin-top: var(--fm-s-5); }
.final-cta .fm-btn-primary { background: #fff; color: var(--fm-green-strong); box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.final-cta .fm-btn-primary:hover { filter: none; background: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.24); }
.final-cta .fm-btn:not(.fm-btn-primary) { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.55); }
.final-cta .fm-btn:not(.fm-btn-primary):hover { background: rgba(255,255,255,.18); }

/* ---- Footer --------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--fm-line); background: var(--fm-surface); padding: var(--fm-s-9) 0 var(--fm-s-6); }
.foot-top { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: var(--fm-s-6); }
.foot-tagline { max-width: 34ch; font-size: var(--fm-fs-2); margin-top: var(--fm-s-3); }
.foot-col h4 { color: var(--fm-text-muted); font-size: var(--fm-fs-1); text-transform: uppercase; letter-spacing: 1px; margin-bottom: var(--fm-s-3); }
.foot-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.foot-col a { color: var(--fm-text-soft); font-size: var(--fm-fs-2); }
.foot-col .foot-soon { color: var(--fm-text-muted); font-size: var(--fm-fs-2); }
.foot-col .soon { font-size: var(--fm-fs-0); }
.foot-rights { margin: var(--fm-s-7) 0 0; padding-top: var(--fm-s-5); border-top: 1px solid var(--fm-line-soft); font-size: var(--fm-fs-1); }

/* ---- Responsive ----------------------------------------------------------- */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: var(--fm-s-6); }
  .hero-art { order: -1; max-width: 560px; }
  .hero h1 { font-size: var(--fm-fs-7); }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .foot-top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }
  .nav-panel {
    position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch;
    gap: var(--fm-s-4); padding: var(--fm-s-5) var(--fm-gutter); background: var(--fm-surface);
    border-bottom: 1px solid var(--fm-line); box-shadow: var(--fm-shadow-2);
    display: none;
  }
  .site-header.nav-open .nav-panel { display: flex; }
  .site-nav { flex-direction: column; align-items: stretch; gap: 2px; }
  .nav-link { padding: 10px 12px; }
  .header-actions { flex-direction: column; align-items: stretch; }
  .header-actions .fm-btn { width: 100%; }
}
@media (max-width: 560px) {
  .section { padding: var(--fm-s-8) 0; }
  .hero { padding: var(--fm-s-7) 0; }
  .hero h1 { font-size: var(--fm-fs-6); }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .foot-top { grid-template-columns: 1fr 1fr; gap: var(--fm-s-5); }
  .price-teaser { flex-direction: column; align-items: flex-start; }
}

/* Legal pages */
.legal-body { max-width: 760px; }
.legal-body h1 { margin-bottom: var(--fm-s-2); }
.legal-body h2 { margin-top: var(--fm-s-7, 40px); font-size: var(--fm-fs-4); scroll-margin-top: 90px; }
.legal-body p, .legal-body li { line-height: 1.7; color: var(--fm-text-soft); }
.legal-body ul { padding-left: 1.2em; }
.legal-draft { margin: var(--fm-s-4) 0 var(--fm-s-5); padding: var(--fm-s-3) var(--fm-s-4); border: 1px solid var(--fm-line);
  border-left: 4px solid var(--fm-warn, #c98a12); border-radius: var(--fm-r-2); background: var(--fm-surface-2); font-size: var(--fm-fs-2); }
.legal-toc ol { columns: 2; gap: var(--fm-s-6); padding-left: 1.2em; font-size: var(--fm-fs-2); }
@media (max-width: 600px) { .legal-toc ol { columns: 1; } }
