/* ============================================================
   4CastMachine — newsite (Cloud build)
   Site-only styles. Depends on tokens.css + components.css.
   Reusable across all pages. English / LTR.
   ============================================================ */

/* ---------- THEME + LANG SWITCHER ---------- */
.switcher {
  display: inline-flex; align-items: center; gap: var(--space-1);
  padding: 3px; border-radius: var(--radius-md);
  border: 1px solid var(--border-default); background: var(--surface-canvas);
  font-size: var(--fs-xs); font-weight: var(--fw-semibold);
}
.switcher button {
  all: unset; cursor: pointer; padding: 6px 8px; border-radius: var(--radius-sm);
  color: var(--text-tertiary); transition: all var(--dur-fast) var(--ease-out);
  display: inline-flex; align-items: center; justify-content: center;
}
.switcher button:hover { color: var(--text-secondary); }
.switcher button[aria-pressed="true"] { background: var(--brand-primary-soft); color: var(--brand-primary); }
.switcher button svg { display: block; }

/* ---------- NAV (extends components.css .nav) ---------- */
.nav-brand-logo { display: inline-flex; align-items: center; }
.nav-brand-logo svg { height: 26px; width: auto; display: block; }
/* Toggle: explicit border-box reset (no `all:unset`, which dropped to content-box
   and left the icon visually off-centre). inline-flex + center = glyph dead-centre. */
.nav-toggle {
  display: none; box-sizing: border-box; cursor: pointer;
  width: 40px; height: 40px; padding: 0; margin: 0;
  -webkit-appearance: none; appearance: none;
  background: var(--surface-canvas);
  border-radius: var(--radius-md); border: 1px solid var(--border-default);
  align-items: center; justify-content: center; color: var(--text-primary);
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.nav-toggle:hover { background: var(--surface-2); }
.nav-toggle svg { display: block; }

/* Mobile menu: a compact dropdown anchored under the toggle (top-right),
   sized to its content — not a full-width block. */
.nav-mobile {
  display: none; position: absolute;
  top: calc(var(--nav-height) + var(--space-2));
  inset-inline-end: var(--space-4);
  width: max-content; min-width: 196px;
  max-width: min(280px, calc(100vw - var(--space-7)));
  background: var(--surface-canvas);
  border: 1px solid var(--border-default); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: var(--space-3); z-index: 60;
}
.nav-mobile.open { display: block; animation: fm-fade-up 200ms var(--ease-out) both; }
.nav-mobile .container {
  display: flex; flex-direction: column; gap: var(--space-1);
  width: auto; max-width: none; margin: 0; padding-inline: 0;
}
/* :not(.btn) so the Launch Web App button keeps its own white-on-brand text
   instead of being greyed out by this link rule. */
.nav-mobile a:not(.btn) {
  color: var(--text-secondary); font-weight: var(--fw-medium); font-size: var(--fs-base);
  padding: var(--space-3); border-radius: var(--radius-md);
}
.nav-mobile a:not(.btn):hover { background: var(--surface-1); color: var(--text-primary); }
.nav-mobile .btn { width: 100%; }
.nav-links { gap: var(--space-5); }
@media (max-width: 1080px) { .nav-actions .desktop-only { display: none; } }
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .nav-links { display: none; }
}

/* ---------- PAGE HERO (sub-pages) ---------- */
.page-hero {
  position: relative; overflow: hidden;
  padding-block: clamp(var(--space-10), 8vw, var(--space-12)) clamp(var(--space-9), 6vw, var(--space-11));
  background: var(--grad-hero), var(--surface-canvas);
  border-bottom: 1px solid var(--border-subtle);
}
.page-hero .eyebrow { margin-bottom: var(--space-4); }
.page-hero h1 {
  font-size: var(--fs-5xl); font-weight: var(--fw-black);
  letter-spacing: var(--tracking-display); line-height: 1.06;
  max-width: 18ch; text-wrap: balance; text-shadow: var(--text-shadow-display);
}
.page-hero .lead {
  margin-top: var(--space-5); font-size: var(--fs-lg);
  color: var(--text-secondary); max-width: 62ch; line-height: var(--lh-normal);
}

/* ---------- HERO CHART MOCK (the brand's signature visual) ---------- */
.hero-grid { display: grid; grid-template-columns: minmax(0,1.05fr) minmax(0,0.95fr); gap: var(--space-10); align-items: center; }
@media (max-width: 1024px) { .hero-grid { grid-template-columns: 1fr; gap: var(--space-9); } }
.hero-visual {
  position: relative; aspect-ratio: 16/11; min-height: 320px;
  border-radius: var(--radius-2xl); background: var(--surface-canvas);
  border: 1px solid var(--border-default); box-shadow: var(--shadow-xl); overflow: hidden;
}
.hero-visual-header {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-subtle); background: var(--surface-1);
}
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--border-strong); }
.hero-visual-tabs { display: flex; gap: var(--space-2); margin-inline-start: var(--space-4); font-size: var(--fs-xs); flex-wrap: wrap; }
.hero-visual-tab { padding: 4px 10px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text-secondary); font-weight: var(--fw-medium); font-family: var(--font-mono); }
.hero-visual-tab.active { background: var(--brand-primary-soft); color: var(--brand-primary); }
.hero-visual-body { padding: var(--space-6); height: calc(100% - 53px); display: flex; flex-direction: column; gap: var(--space-4); }
.hero-visual-meta { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; font-size: var(--fs-sm); }
.hero-visual-sym { font-family: var(--font-mono); font-weight: var(--fw-bold); color: var(--text-primary); }
.hero-visual-price { font-family: var(--font-mono); font-weight: var(--fw-bold); color: var(--text-primary); font-variant-numeric: tabular-nums; }
.chart-svg { flex: 1; width: 100%; }

/* ---------- HERO: tabbed live-chart window (home only) ---------- */
.hero-visual-live { display: flex; flex-direction: column; }
.hero-visual-live .hero-visual-header { flex: 0 0 auto; }
.hero-visual-live .hero-visual-tab { border: 0; cursor: pointer; font-size: var(--fs-xs); font-family: var(--font-mono); line-height: 1.5; transition: color 150ms ease; }
.hero-visual-live .hero-visual-tab:not(.active):hover { color: var(--text-primary); }
.hero-visual-live .hero-visual-body { padding: 0; height: auto; flex: 1 1 auto; min-height: 0; position: relative; display: block; }
.hero-chart { position: absolute; inset: 0; display: none; }
.hero-chart.is-active { display: block; }
.hero-chart img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.hero-chart-soon { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2); background: var(--surface-1); text-align: center; padding: var(--space-5); }
.hero-chart-soon-sym { font-family: var(--font-mono); font-weight: var(--fw-bold); color: var(--text-secondary); font-size: var(--fs-sm); }
.hero-chart-soon-note { font-size: var(--fs-xs); color: var(--text-tertiary); }

/* ---------- HERO: centered layout + natural-size chart (home only) ---------- */
.hero-centered .container { text-align: center; }
.hero-centered .hero-title { margin-inline: auto; max-width: none; }
.hero-centered .hero-subtitle { margin-inline: auto; text-align: center; }
.hero-centered .hero-actions { justify-content: center; }
.hero-centered .hero-meta { justify-content: center; }
.hero-natural-wrap { display: flex; justify-content: center; margin-block: clamp(var(--space-7), 5vw, var(--space-10)); padding-inline: var(--space-5); }
.hero-visual-natural { width: 1436px; max-width: 100%; aspect-ratio: auto; min-height: 0; }
.hero-visual-natural .hero-visual-tabs { margin-inline-start: 0; }
.hero-visual-natural .hero-visual-body { flex: 0 0 auto; height: auto; aspect-ratio: 1436 / 961; }

/* ---------- TRUST / LOGO STRIP BAND ---------- */
.trust { padding-block: var(--space-7); border-block: 1px solid var(--border-subtle); background: var(--surface-1); }
.trust-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-7); flex-wrap: wrap; }
.trust-label { font-size: var(--fs-xs); letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--text-tertiary); font-weight: var(--fw-semibold); }

/* ---------- BENTO RESPONSIVE ---------- */
@media (max-width: 900px) { .bento > * { grid-column: span 12 !important; } }

/* ---------- STEPS ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
@media (max-width: 900px) { .steps { grid-template-columns: 1fr; } }
.step-num {
  width: 36px; height: 36px; border-radius: var(--radius-full);
  background: var(--brand-primary-soft); color: var(--brand-primary);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: var(--fw-bold); font-size: var(--fs-sm); font-variant-numeric: tabular-nums;
  margin-bottom: var(--space-4);
}

/* ---------- METRIC / STAT GRID ---------- */
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-5); }

/* ---------- COMPARISON TABLE (competitive positioning) ---------- */
.compare-wrap { overflow-x: auto; border: 1px solid var(--border-subtle); border-radius: var(--radius-xl); }
.compare {
  width: 100%; border-collapse: collapse; min-width: 640px;
  font-size: var(--fs-sm);
}
.compare th, .compare td { padding: var(--space-4) var(--space-5); text-align: start; border-bottom: 1px solid var(--border-subtle); }
.compare thead th { font-size: var(--fs-xs); letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--text-tertiary); background: var(--surface-1); font-weight: var(--fw-semibold); }
.compare tbody th { font-weight: var(--fw-semibold); color: var(--text-primary); }
.compare td { color: var(--text-secondary); }
.compare col.col-4cm, .compare th.col-4cm { background: var(--brand-primary-soft); }
.compare td.col-4cm { background: var(--brand-primary-soft); color: var(--text-primary); font-weight: var(--fw-medium); }
.compare .yes { color: var(--bullish); font-weight: var(--fw-bold); }
.compare .no { color: var(--text-disabled); }
.compare tr:last-child td, .compare tr:last-child th { border-bottom: none; }

/* ---------- TIMELINE (heritage / roadmap) ---------- */
.timeline { display: flex; flex-direction: column; gap: 0; position: relative; }
.timeline-item { display: grid; grid-template-columns: 120px 1fr; gap: var(--space-6); padding-block: var(--space-6); border-bottom: 1px solid var(--border-subtle); }
.timeline-item:last-child { border-bottom: none; }
.timeline-year { font-family: var(--font-mono); font-weight: var(--fw-bold); font-size: var(--fs-2xl); color: var(--brand-primary); }
.timeline-body h3 { font-size: var(--fs-lg); margin-bottom: var(--space-2); }
@media (max-width: 640px) { .timeline-item { grid-template-columns: 1fr; gap: var(--space-2); } }

/* ---------- CTA BAND ---------- */
.cta-band {
  position: relative; overflow: hidden;
  padding: clamp(var(--space-9), 6vw, var(--space-11)) clamp(var(--space-7), 5vw, var(--space-9));
  border-radius: var(--radius-2xl);
  background: var(--grad-brand); color: var(--text-on-brand);
  display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--space-9); align-items: center;
}
@media (max-width: 900px) { .cta-band { grid-template-columns: 1fr; } }
.cta-band h2 { color: inherit; font-size: var(--fs-4xl); margin-bottom: var(--space-3); }
.cta-band p { color: rgba(255,255,255,0.86); font-size: var(--fs-lg); }
.cta-band-visual { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.cta-band-card {
  padding: var(--space-4); border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.10); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.15);
  display: flex; flex-direction: column; gap: var(--space-2);
}
.cta-band-card strong { font-size: var(--fs-2xl); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; color: #fff; }
.cta-band-card span { font-size: var(--fs-xs); color: rgba(255,255,255,0.78); }

/* ---------- QUOTE / PULL BAND ---------- */
.pull-quote {
  font-size: var(--fs-3xl); font-weight: var(--fw-bold); line-height: var(--lh-snug);
  letter-spacing: var(--tracking-tight); max-width: 24ch; text-wrap: balance;
}

/* ---------- WALL OF TESTIMONIALS ---------- */
.wall { columns: 3 280px; column-gap: var(--space-5); }
.wall > .testimonial { break-inside: avoid; margin-bottom: var(--space-5); }

/* ---------- FOOTER (extends components.css .footer) ---------- */
.footer-grid { grid-template-columns: 2fr repeat(3, 1fr); }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }

/* Social row: horizontal icon buttons under the brand blurb (replaces the old
   "Connect" text column). Hover adopts the Green-Arrow forecast colour. */
.footer-social {
  list-style: none; padding: 0; margin: var(--space-5) 0 0;
  display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap;
}
.footer-social a {
  width: 34px; height: 34px; border-radius: var(--radius-md);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-tertiary); background: var(--surface-canvas);
  border: 1px solid var(--border-subtle);
  transition: all var(--dur-fast) var(--ease-out);
}
.footer-social a:hover {
  color: var(--fm-navy-900); background: var(--forecast);
  border-color: var(--forecast); transform: translateY(-1px);
}
.footer-social svg { display: block; width: 18px; height: 18px; }

/* ---------- FOUNDER FEATURE (letter beside tall portrait) ---------- */
.founder { display: grid; grid-template-columns: minmax(0, 270px) minmax(0, 1fr); gap: var(--space-9); align-items: start; }
.founder-letter { max-width: 64ch; }
@media (max-width: 860px) { .founder { grid-template-columns: 1fr; gap: var(--space-7); } }
.founder-portrait {
  position: relative; border-radius: var(--radius-xl); overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--border-subtle);
  aspect-ratio: 3 / 4; box-shadow: var(--shadow-md);
}
.founder-portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; }
.founder-portrait .portrait-ph {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: var(--space-3);
  color: var(--text-tertiary); text-align: center; padding: var(--space-5);
}
.founder-letter p { color: var(--text-secondary); line-height: var(--lh-relaxed); margin-bottom: var(--space-4); }
.founder-letter p.lead-line { font-size: var(--fs-lg); color: var(--text-primary); }
.founder-sign { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; margin-top: var(--space-5); padding-top: var(--space-5); border-top: 1px solid var(--border-subtle); }
.founder-social { display: inline-flex; gap: var(--space-2); }
.founder-social a {
  width: 38px; height: 38px; border-radius: var(--radius-md); border: 1px solid var(--border-default);
  display: inline-flex; align-items: center; justify-content: center; color: var(--text-secondary);
  transition: all var(--dur-fast) var(--ease-out);
}
.founder-social a:hover { background: var(--surface-2); color: var(--brand-primary); border-color: var(--border-strong); }

/* ---------- TEAM HEADSHOTS ---------- */
.headshot {
  width: 96px; height: 96px; border-radius: var(--radius-full); object-fit: cover; object-position: center top;
  margin-inline: auto; display: block; border: 1px solid var(--border-subtle); box-shadow: var(--shadow-sm);
}
/* Co-founder portraits: rectangular, official ID-photo proportions (3:4), not circular */
.team-photo {
  width: 165px; aspect-ratio: 3 / 4; margin-inline: auto; display: block;
  border-radius: var(--radius-md); object-fit: cover; object-position: center top;
  border: 1px solid var(--border-subtle); box-shadow: var(--shadow-sm); background: var(--surface-2);
}
.team-photo-ph { display: flex; align-items: center; justify-content: center; color: var(--text-tertiary); }
.team-link {
  display: inline-flex; align-items: center; gap: var(--space-2); margin-top: var(--space-3);
  font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-secondary);
}
.team-link:hover { color: var(--brand-primary); }

/* ---------- DISCLAIMER NOTE ---------- */
.note {
  font-size: var(--fs-xs); color: var(--text-tertiary);
  border: 1px dashed var(--border-default); border-radius: var(--radius-md);
  padding: var(--space-4); line-height: var(--lh-normal);
}

/* ---------- SCROLL REVEAL ---------- */
/* Content is visible by default; only hidden when JS is active (html.has-js),
   so a JS failure never leaves sections blank. */
.reveal { transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out); }
html.has-js .reveal { opacity: 0; transform: translateY(16px); }
html.has-js .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { html.has-js .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------- BRAND NAME (never case-transform "4CastMachine AI") ---------- */
.brand { text-transform: none !important; letter-spacing: 0 !important; }

/* ---------- UTILITIES ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-6); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
@media (max-width: 900px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.lead { font-size: var(--fs-lg); color: var(--text-secondary); line-height: var(--lh-normal); }
.muted { color: var(--text-secondary); }
.center { text-align: center; }
.mt-3 { margin-top: var(--space-3); } .mt-4 { margin-top: var(--space-4); } .mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); } .mt-7 { margin-top: var(--space-7); } .mt-8 { margin-top: var(--space-8); }
.mb-3 { margin-bottom: var(--space-3); } .mb-4 { margin-bottom: var(--space-4); } .mb-5 { margin-bottom: var(--space-5); }
.flex-cta { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.icon-tile {
  width: 48px; height: 48px; border-radius: var(--radius-md);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-primary-soft); color: var(--brand-primary); margin-bottom: var(--space-4);
}
.icon-tile.forecast { background: var(--forecast-soft); color: var(--forecast-strong); }
