/* ── Forecastle marketing site ─────────────────────────────────
   Sailcloth cream + deep navy + weathered emerald, with brass and
   terracotta as supporting accents. Warm, considered register —
   sits in the same buyer's tab group as Rillet / Campfire / Pilot.
   Single stylesheet, no framework, one breakpoint at 860px.
   --------------------------------------------------------------*/

:root {
  --bg:            #F2EBDC;   /* sailcloth cream */
  --bg-elev:       #FBF5E5;   /* lifted cream */
  --panel:         #FBF5E5;   /* card surface */
  --panel-alt:     #ECE2C5;   /* alt row / highlight background */
  --border:        #DDD0AE;
  --border-soft:   #ECE2C5;

  --text:          #1F2D44;   /* deep navy body */
  --text-strong:   #0E1A28;   /* navy-deep headings */
  --text-muted:    #6B5C44;   /* warm-tinted muted */
  --text-dim:      #9E8F72;

  --accent:        #2F6E55;   /* weathered emerald — primary */
  --accent-deep:   #1F4F3D;
  --accent-hover:  #245A45;
  --accent-soft:   rgba(47, 110, 85, 0.10);
  --accent-ring:   rgba(47, 110, 85, 0.30);
  --accent-rgb:    47, 110, 85;

  --on-accent:     #F2EBDC;   /* cream text on emerald */

  /* Brass — premium accent for dividers, brand mark, "moments" */
  --brass:         #C9A961;
  --brass-soft:    rgba(201, 169, 97, 0.18);

  /* Terracotta — warm secondary, used sparingly */
  --terracotta:    #C9603F;
  --terracotta-soft: rgba(201, 96, 63, 0.12);

  --positive:      #2F6E55;
  --negative:      #B43A2A;

  --radius:        14px;
  --radius-sm:     8px;
  --shadow-lg:     0 20px 48px -20px rgba(31, 45, 68, 0.18);
  --shadow-md:     0 10px 28px -14px rgba(31, 45, 68, 0.14);

  /* Palette-dependent colors pulled out so nav, hero h1, and
     hero::before glows all follow the palette (no hardcodes). */
  --nav-bg:        rgba(242, 235, 220, 0.82);
  --h1-grad-top:   #0E1A28;
  --h1-grad-bot:   #1F2D44;

  --font:          -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                   "Helvetica Neue", Arial, sans-serif;
  --font-mono:     ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  color: var(--text-strong);
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2.1rem, 4.6vw, 3.6rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); }
h3 { font-size: 1.15rem; }

p  { margin: 0 0 1em; color: var(--text); }

code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--panel-alt);
  color: var(--accent-hover);
  padding: 0.1em 0.4em;
  border-radius: 4px;
}

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-hover);
  margin-bottom: 0.8em;
}

.lede {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 36em;
  margin: 0 0 2em;
}
.lede-sm {
  color: var(--text-muted);
  max-width: 42em;
  margin: 0.4em auto 0;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.7em 1.2em;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease,
              border-color 120ms ease, box-shadow 120ms ease;
  white-space: nowrap;
}
.btn-lg { padding: 0.9em 1.55em; font-size: 1rem; }

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 6px 22px -8px var(--accent-ring);
}
.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

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

/* ── Nav ────────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  gap: 1.5rem;
  backdrop-filter: saturate(140%) blur(8px);
  background: var(--nav-bg);
  border-bottom: 1px solid transparent;
}
.nav::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border) 30%, var(--border) 70%, transparent);
  opacity: 0.6;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  color: var(--text-strong);
}
.brand-name {
  color: var(--text-strong);
  font-family: "Playfair Display", "Georgia", "Times New Roman", serif;
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: 0.2px;
}

/* Isometric cube logo mark — matches the webapp's header logo so the
   marketing site and the product read as one brand. SVG is inline so
   it scales crisply and the colors don't depend on a loaded image. */
.brand-mark {
  width: 40px;
  height: 40px;
  display: inline-block;
  flex-shrink: 0;
}
.brand-mark-foot {
  width: 32px;
  height: 32px;
}

.nav-links {
  display: flex;
  gap: 1.6rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}
.nav-links a:hover { color: var(--text-strong); }
.nav-cta { display: flex; gap: 0.5rem; align-items: center; }
.nav-cta .btn { padding: 0.55em 1em; }

/* ── Hero ────────────────────────────────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  padding: 6rem 1.5rem 5rem;
  text-align: center;
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1000px 500px at 50% -10%, rgba(var(--accent-rgb), 0.18), transparent 60%),
    radial-gradient(800px 500px at 80% 120%, rgba(var(--accent-rgb), 0.10), transparent 60%);
  z-index: -2;
}
#hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.32;
}

.hero-inner {
  max-width: 820px;
  margin: 0 auto;
}
.hero h1 {
  background: linear-gradient(180deg, var(--h1-grad-top) 20%, var(--h1-grad-bot) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .lede { margin-left: auto; margin-right: auto; }

.hero-cta {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 1.2em 0 2em;
}

.hero-badges {
  display: inline-flex;
  gap: 0.6em;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-dim);
  flex-wrap: wrap;
  justify-content: center;
}

/* ── 5-minute setup callout (replaced the placeholder logo wall) — */
.setup-callout {
  padding: 2.5rem 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
}
.setup-callout-inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1rem, 4vw, 3rem);
  align-items: start;
  text-align: center;
}
.setup-stat {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: center;
}
.setup-stat-num {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent);
  line-height: 1;
}
.setup-stat-vs {
  color: var(--text-dim);
  font-weight: 600;
}
.setup-stat-label {
  font-size: 0.94rem;
  color: var(--text-muted);
  max-width: 22em;
  line-height: 1.4;
}
@media (max-width: 760px) {
  .setup-callout-inner { grid-template-columns: 1fr; gap: 1.6rem; }
}

/* ── Split (problem / solution) ──────────────────────────────── */
.split {
  max-width: 1100px;
  margin: 0 auto;
  padding: 5rem 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; gap: 2rem; padding: 3rem 1.25rem; }
}
.split-col { }
.pain-list, .gain-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.pain-list li, .gain-list li {
  position: relative;
  padding: 0.6em 0 0.6em 1.8em;
  color: var(--text);
  border-bottom: 1px solid var(--border-soft);
}
.pain-list li::before,
.gain-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1em;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}
.pain-list li::before { background: var(--negative); opacity: 0.75; }
.gain-list li::before { background: var(--accent); }

/* ── Section head ────────────────────────────────────────────── */
.section-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 2.5rem;
}

/* ── Features ────────────────────────────────────────────────── */
.features {
  max-width: 1200px;
  margin: 0 auto;
  padding: 5rem 1.5rem;
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
@media (max-width: 860px) {
  .feature-grid { grid-template-columns: 1fr; }
}
.feature {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}
.feature:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  background: var(--panel-alt);
}
/* Cards for the three headline features get a subtle emerald glow so the
   eye lands on predictive forecasts, cash flow, and Excel first.       */
.feature-hero {
  background: linear-gradient(180deg, var(--accent-soft), transparent 60%), var(--panel);
  border-color: var(--accent-ring);
}
.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}
.feature-icon svg { width: 26px; height: 26px; }
.feature p { color: var(--text-muted); margin: 0; }

/* ── Showcase ────────────────────────────────────────────────── */
.showcase {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 1.5rem 6rem;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 3rem;
  align-items: center;
}
@media (max-width: 860px) {
  .showcase { grid-template-columns: 1fr; gap: 2rem; padding: 2rem 1.25rem 4rem; }
}

.check-list {
  list-style: none;
  padding: 0;
  margin: 1em 0 0;
}
.check-list li {
  position: relative;
  padding: 0.35em 0 0.35em 1.6em;
  color: var(--text);
}
.check-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0.35em;
  color: var(--accent-hover);
  font-weight: 700;
}

/* Mock pivot — approximates the product's P&L grid.                    */
.showcase-mock {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.mock-chrome {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.8rem;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
}
.mock-chrome span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--panel-alt);
}
.mock-chrome span:nth-child(1) { background: #f87171; }
.mock-chrome span:nth-child(2) { background: #fbbf24; }
.mock-chrome span:nth-child(3) { background: var(--accent); }
.mock-chrome em {
  margin-left: auto;
  font-style: normal;
  font-size: 0.78rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}
.mock-pivot {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}
.mock-pivot th, .mock-pivot td {
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid var(--border-soft);
  text-align: right;
}
.mock-pivot th:first-child, .mock-pivot td:first-child {
  text-align: left;
  color: var(--text-strong);
}
.mock-pivot thead th {
  background: var(--bg-elev);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.mock-pivot td.indent { padding-left: 2rem; color: var(--text-muted); }
.mock-pivot .row-total td {
  background: var(--panel-alt);
  font-weight: 600;
}
.mock-pivot .row-hi td { color: var(--text-strong); }
.mock-pivot .row-accent td {
  background: var(--accent-soft);
  color: var(--accent-hover);
  font-weight: 700;
}

/* ── Compare ─────────────────────────────────────────────────── */
.compare {
  max-width: 1100px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
}
.compare-table {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;            /* 6-column table scrolls horizontally on phones */
}
.compare-table table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
}
.compare-table th, .compare-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.95rem;
}
.compare-table thead th {
  background: var(--bg-elev);
  color: var(--text-muted);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
}
.compare-table th.col-us, .compare-table td.col-us {
  background: var(--accent-soft);
  color: var(--text-strong);
}
.compare-table td.col-us b { color: var(--accent-hover); }
.compare-table tr:last-child td { border-bottom: 0; }
/* The two implementation rows that demolish the incumbents get a
   subtle accent background so the eye lands there first. */
.compare-table tr.row-highlight {
  background: var(--accent-soft);
}
.compare-table tr.row-highlight td { font-weight: 600; }

/* ── Percival AI feature tile gets a small "AI" pill badge so it reads
   as the AI feature even at a glance. ───────────────────────── */
.feature-hero-ai {
  position: relative;
}
.feature-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-block;
  padding: 3px 10px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  border-radius: 999px;
  text-transform: uppercase;
}

/* ── Pricing ─────────────────────────────────────────────────── */
.pricing {
  max-width: 1150px;
  margin: 0 auto;
  padding: 5rem 1.5rem;
}
.price-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
@media (max-width: 860px) {
  .price-grid { grid-template-columns: 1fr; }
}
.price-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
}
.price-card-featured {
  border-color: var(--accent);
  background: linear-gradient(180deg, var(--accent-soft), transparent 60%), var(--panel);
  box-shadow: 0 20px 50px -20px var(--accent-ring);
  transform: translateY(-6px);
}
@media (max-width: 860px) {
  .price-card-featured { transform: none; }
}
.price-card .badge {
  position: absolute;
  top: -12px;
  right: 1.5rem;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.35em 0.7em;
  border-radius: 999px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.price-card h3 { margin-bottom: 0.3em; }
.price {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--text-strong);
  margin: 0.2em 0 0.2em;
  letter-spacing: -0.02em;
}
.price span {
  font-size: 1.3rem;
  vertical-align: top;
  margin-right: 0.15em;
  color: var(--text-muted);
}
.price em {
  font-size: 0.85rem;
  font-style: normal;
  color: var(--text-muted);
  font-weight: 500;
}
.price-note { color: var(--text-muted); font-size: 0.9rem; margin: 0 0 1.2em; }
.price-card ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1.6em;
  flex: 1;
}
.price-card li {
  position: relative;
  padding: 0.3em 0 0.3em 1.5em;
  color: var(--text);
  font-size: 0.95rem;
}
.price-card li::before {
  content: "✓";
  position: absolute; left: 0; top: 0.3em;
  color: var(--accent-hover);
  font-weight: 700;
}

/* ── FAQ ─────────────────────────────────────────────────────── */
.faq {
  max-width: 820px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
}
.faq-list details {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.2rem;
  margin-bottom: 0.6rem;
  transition: border-color 120ms ease;
}
.faq-list details[open] { border-color: var(--accent); }
.faq-list summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-strong);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+";
  color: var(--accent-hover);
  font-weight: 400;
  font-size: 1.3em;
  line-height: 1;
  margin-left: 1em;
  transition: transform 160ms ease;
}
.faq-list details[open] summary::after { content: "−"; }
.faq-list p { color: var(--text-muted); margin: 0.8em 0 0; }

/* ── Demo form ───────────────────────────────────────────────── */
.demo {
  max-width: 1100px;
  margin: 0 auto;
  padding: 5rem 1.5rem 6rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}
@media (max-width: 860px) {
  .demo { grid-template-columns: 1fr; gap: 2rem; padding: 3rem 1.25rem 4rem; }
}

.demo-form {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
  box-shadow: var(--shadow-md);
}
.demo-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35em;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.demo-form label.full { grid-column: 1 / -1; }
.demo-form input,
.demo-form select,
.demo-form textarea {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.7em 0.85em;
  border-radius: var(--radius-sm);
  font: inherit;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.demo-form input:focus,
.demo-form select:focus,
.demo-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.demo-form button { grid-column: 1 / -1; margin-top: 0.3em; }
.demo-form .form-hint {
  grid-column: 1 / -1;
  color: var(--text-dim);
  font-size: 0.82rem;
  margin: 0;
  text-align: center;
}

/* ── Footer ──────────────────────────────────────────────────── */
.foot {
  border-top: 1px solid var(--border);
  background: var(--panel-alt);
  color: var(--text-muted);
}
.foot-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 1rem;
  display: grid;
  grid-template-columns: 1.2fr 2fr;
  gap: 3rem;
}
@media (max-width: 860px) {
  .foot-inner { grid-template-columns: 1fr; gap: 2rem; }
}
.foot-brand {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.foot-brand .brand-name { color: var(--text-strong); font-weight: 700; font-size: 1.1rem; }
.foot-tag {
  width: 100%;
  color: var(--text-dim);
  font-size: 0.9rem;
  margin: 0.5em 0 0;
}
.foot-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.foot-cols h4 {
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 0.8em;
}
.foot-cols a {
  display: block;
  color: var(--text-muted);
  font-size: 0.92rem;
  padding: 0.25em 0;
}
.foot-cols a:hover { color: var(--accent-hover); }
.foot-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-dim);
  border-top: 1px solid var(--border-soft);
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ── Password gate ───────────────────────────────────────────── */
#gate {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 320ms ease, visibility 320ms ease;
}
#gate.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
#gate-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  width: min(320px, 80vw);
}
.gate-label {
  color: var(--accent);
  font-size: 1rem;
  letter-spacing: 0.3em;
  opacity: 0.7;
  font-family: var(--font-mono, ui-monospace, monospace);
}
#gate-input {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  padding: 0.6em 0.2em;
  text-align: center;
  font-size: 1.1rem;
  letter-spacing: 0.4em;
  font-family: var(--font-mono, ui-monospace, monospace);
  outline: none;
  transition: border-color 160ms ease;
  caret-color: var(--accent);
}
#gate-input:focus {
  border-bottom-color: var(--accent);
}
#gate-error {
  min-height: 1.2em;
  margin: 0;
  font-size: 0.82rem;
  color: var(--negative);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 160ms ease;
}
#gate-error.show { opacity: 1; }
@keyframes gate-shake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}
#gate-form.shake { animation: gate-shake 280ms ease; }

/* ── Toast ───────────────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--accent);
  color: var(--on-accent);
  padding: 0.75em 1.2em;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
  z-index: 50;
}
#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Signup modal ────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.modal.open { display: flex; }
body.modal-open { overflow: hidden; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 16, 8, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-card {
  position: relative;
  width: min(520px, 100%);
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.2rem 2rem 1.8rem;
  box-shadow: var(--shadow-lg);
  animation: modal-in 200ms ease;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.modal-close {
  position: absolute;
  top: 0.6rem;
  right: 0.8rem;
  background: transparent;
  border: 0;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  transition: background 140ms ease, color 140ms ease;
}
.modal-close:hover {
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.signup-view[hidden] { display: none; }
.signup-view h2 { margin-top: 0.2em; }

/* Plan badge inside the signup modal — shows the user which tier
   they came in on. Hidden when no plan was passed (nav / hero CTA). */
.signup-plan {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  margin: 14px 0 4px;
  padding: 10px 14px;
  background: var(--accent-soft, rgba(47, 125, 90, 0.10));
  border: 1px solid var(--accent-ring, rgba(47, 125, 90, 0.25));
  border-radius: 10px;
}
.signup-plan[hidden] { display: none; }
.signup-plan-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-hover, #256648);
}
.signup-plan-name {
  font-size: 0.98rem;
  font-weight: 650;
  color: var(--text-strong, #1a150c);
}
.signup-plan-price {
  font-size: 0.84rem;
  color: var(--text-muted, #6b5c44);
  flex: 1 1 auto;
}
.signup-plan-change {
  background: transparent;
  border: 0;
  color: var(--accent-hover, #256648);
  font: inherit;
  font-size: 0.82rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 0;
}
.signup-plan-change:hover {
  color: var(--accent, #2F7D5A);
}

.signup-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem 1rem;
  margin-top: 1rem;
}
.signup-form label {
  display: flex;
  flex-direction: column;
  gap: 0.3em;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}
.signup-form label:nth-of-type(1),
.signup-form label:nth-of-type(3) { grid-column: 1 / -1; }
.signup-form input {
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65em 0.8em;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.signup-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.signup-form .form-sub {
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--text-dim);
}
.signup-form button[type="submit"] {
  grid-column: 1 / -1;
  margin-top: 0.3rem;
}
.signup-form .form-hint {
  grid-column: 1 / -1;
  font-size: 0.82rem;
  color: var(--text-dim);
  margin: 0.2rem 0 0;
  text-align: center;
}
.form-error {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.88rem;
  color: var(--negative);
  min-height: 0;
  opacity: 0;
  transition: opacity 140ms ease;
}
.form-error.show { opacity: 1; min-height: 1.2em; }

/* Success view credentials list */
.creds {
  margin: 1.2rem 0 1.4rem;
  padding: 1rem 1.1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 0.75rem;
}
.creds > div {
  display: grid;
  grid-template-columns: 110px 1fr;
  align-items: center;
  gap: 0.8rem;
}
.creds dt {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0;
}
.creds dd {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}
.creds code {
  flex: 1 1 auto;
  overflow-x: auto;
  white-space: nowrap;
  background: var(--panel-alt);
  color: var(--text-strong);
  padding: 0.35em 0.6em;
  border-radius: 6px;
  font-size: 0.9rem;
}
.copy-btn {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35em 0.7em;
  border-radius: 999px;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.copy-btn:hover {
  background: var(--accent-soft);
  color: var(--accent-hover);
  border-color: var(--accent-ring);
}
.copy-btn.copied {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}

@media (max-width: 560px) {
  .modal-card { padding: 1.8rem 1.2rem 1.4rem; }
  .signup-form { grid-template-columns: 1fr; }
  .signup-form label:nth-of-type(n) { grid-column: 1 / -1; }
  .creds > div { grid-template-columns: 1fr; gap: 0.3rem; }
  .nav-cta .btn + .btn { display: none; } /* keep nav from wrapping */
}

/* ── Mobile pass ────────────────────────────────────────────────
   Fills the gaps above: nav needed to collapse or it overflowed,
   hero padding was too heavy, demo-form was stuck 2-col, footer
   was 3-col no matter the width. One pass with two breakpoints —
   760px for tablets / large phones, 480px for small phones. */
@media (max-width: 760px) {
  /* Nav: drop the section links on mobile (the page is a single
     scroll, CTAs are what matter). Shrink padding so brand + the
     primary CTA fit comfortably on any phone. */
  .nav { padding: 0.7rem 1rem; gap: 0.8rem; }
  .nav-links { display: none; }

  /* Hero: halve the top padding so the headline shows above the fold
     without user scrolling on a 667px-tall device. */
  .hero { padding: 3.5rem 1.25rem 3rem; }

  /* Demo form: stack fields instead of squashing two columns into
     a 340px viewport. */
  .demo-form { grid-template-columns: 1fr; padding: 1.25rem; }

  /* Footer columns: 3 columns of link groups don't fit next to the
     brand block on phones. Put them in a 2x2 on tablets. */
  .foot-cols { grid-template-columns: repeat(2, 1fr); }

  /* Side padding on section heads + setup callout so content doesn't
     kiss the viewport edge. */
  .section-head { padding: 0 1rem; }
  .setup-callout { padding: 2rem 1.25rem; }

  /* Comparison table already scrolls horizontally; nudge the table
     padding so the horizontal-scroll affordance is visible. */
  .compare-table { margin: 0 1rem; }
}

@media (max-width: 480px) {
  /* Smaller phones: stack the footer link columns too, and ease up
     the brand + hero type so they don't blow past the viewport. */
  .foot-cols { grid-template-columns: 1fr; }
  .brand { font-size: 1.15rem; gap: 0.5rem; }
  .brand-mark { width: 32px; height: 32px; }
  .hero-badges { font-size: 0.78rem; gap: 0.4em 0.5em; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { justify-content: center; }
  .setup-stat-num { font-size: 2rem; }
}

/* ── Real product screenshots ────────────────────────────────────
 *  Three slots: the hero shot directly under the headline, a gallery
 *  of three product shots between features and showcase, and the
 *  showcase shot that replaced the fake CSS pivot. All three share
 *  the same chrome — rounded card, soft border, big shadow — so they
 *  read as a coherent product family rather than three different
 *  treatments. -------------------------------------------------- */

.hero-shot {
  margin: 2.4rem auto 0;
  max-width: 1080px;
  width: 100%;
  border-radius: var(--radius-lg, 14px);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.45),
              0 12px 24px -12px rgba(0, 0, 0, 0.35);
  background: var(--panel);
}
.hero-shot img {
  display: block;
  width: 100%;
  height: auto;
}

.gallery {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 1.5rem 2rem;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
  margin-top: 2rem;
}
.gallery-card {
  margin: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius, 12px);
  overflow: hidden;
  box-shadow: var(--shadow-md, 0 10px 25px -10px rgba(0, 0, 0, 0.3));
  display: flex;
  flex-direction: column;
}
.gallery-card img {
  display: block;
  width: 100%;
  height: auto;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev, var(--panel));
}
.gallery-card figcaption {
  padding: 1rem 1.1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.gallery-card figcaption strong {
  font-size: 1rem;
  color: var(--text);
}
.gallery-card figcaption span {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.45;
}
@media (max-width: 960px) {
  .gallery-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .gallery-grid { grid-template-columns: 1fr; }
  .gallery { padding: 2.5rem 1.25rem 1rem; }
}

.showcase-shot {
  margin: 0;
  border-radius: var(--radius, 12px);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  background: var(--panel);
}
.showcase-shot img {
  display: block;
  width: 100%;
  height: auto;
}

/* ── Percival-led tour modal ────────────────────────────────────────
 *  Lightbox over the marketing-site palette. The image fills the
 *  upper portion (max ~60vh on desktop), hotspot dots are absolute-
 *  positioned over it as percentages so they scale with the image,
 *  and a step card sits below with Percival's avatar + copy + nav.
 *  -------------------------------------------------------------- */

.tour-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 2rem 1rem;
}
.tour-modal.open { display: flex; }
.tour-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 14, 24, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.tour-card-wrap {
  position: relative;
  width: min(1100px, 96vw);
  max-height: 92vh;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 14px);
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.tour-close {
  position: absolute;
  top: 0.6rem; right: 0.8rem;
  width: 36px; height: 36px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border: 0;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.tour-close:hover { background: rgba(0, 0, 0, 0.85); }

.tour-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  background: var(--bg-elev, var(--panel));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.tour-img {
  display: block;
  max-width: 100%;
  max-height: 60vh;
  width: auto;
  height: auto;
  object-fit: contain;
}
.tour-dots {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.tour-dot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent, #2F7D5A);
  color: #fff;
  border: 2px solid #fff;
  font: 600 13px/1 var(--font-sans, system-ui);
  cursor: pointer;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 4px rgba(47, 125, 90, 0.35), 0 6px 14px rgba(0, 0, 0, 0.35);
  animation: tour-pulse 2.2s ease-out infinite;
  transition: transform 0.18s ease, background 0.18s ease;
}
.tour-dot:hover    { transform: translate(-50%, -50%) scale(1.15); }
.tour-dot.is-active {
  background: var(--accent-hover, #235c43);
  transform: translate(-50%, -50%) scale(1.25);
  animation-play-state: paused;
  box-shadow: 0 0 0 6px rgba(47, 125, 90, 0.55), 0 8px 18px rgba(0, 0, 0, 0.45);
}
.tour-dot.is-done {
  background: var(--text-muted, #6b7280);
  animation: none;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
}
@keyframes tour-pulse {
  0%   { box-shadow: 0 0 0 4px rgba(47, 125, 90, 0.35), 0 6px 14px rgba(0, 0, 0, 0.35); }
  60%  { box-shadow: 0 0 0 12px rgba(47, 125, 90, 0),    0 6px 14px rgba(0, 0, 0, 0.35); }
  100% { box-shadow: 0 0 0 4px rgba(47, 125, 90, 0.35), 0 6px 14px rgba(0, 0, 0, 0.35); }
}

.tour-step {
  flex: 0 0 auto;
  border-top: 1px solid var(--border);
  background: var(--panel);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1.1rem 1.4rem;
}
.tour-step-avatar {
  width: 44px; height: 44px;
  flex-shrink: 0;
}
.tour-step-avatar svg { width: 100%; height: 100%; }
.tour-step-body {
  min-width: 0;
}
.tour-step-eyebrow {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--accent, #2F7D5A);
  display: block;
  margin-bottom: 0.15rem;
}
.tour-step-body h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--text);
}
.tour-step-body p {
  margin: 0.2rem 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}
.tour-step-nav {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}
.tour-step-nav .btn {
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
}
.tour-step-nav .btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.tour-step-pos {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  min-width: 5em;
  text-align: center;
}

/* The clickable screenshots get a subtle 'I'm interactive' treatment
   so users know to click. */
[data-tour] {
  cursor: zoom-in;
  position: relative;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
[data-tour]:hover,
[data-tour]:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px -12px rgba(0, 0, 0, 0.45);
  outline: none;
}
[data-tour]::after {
  content: "Click for guided tour";
  position: absolute;
  bottom: 0.6rem;
  right: 0.6rem;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.32rem 0.65rem;
  border-radius: 999px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}
[data-tour]:hover::after,
[data-tour]:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

/* Mobile: stack the step card content so it doesn't wrap awkwardly. */
@media (max-width: 640px) {
  .tour-card-wrap { width: 100%; max-height: 96vh; border-radius: 10px; }
  .tour-img { max-height: 48vh; }
  .tour-step {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
  }
  .tour-step-nav { justify-content: space-between; }
  .tour-dot { width: 26px; height: 26px; font-size: 11px; }
}
