/*
  Color tokens sourced from the Pillarmetrics app's own Material 3 theme
  (lib/src/core/theme/app_theme.dart) — relayed by "Data" (app repo instance).

  Surface/text tokens (bg/bg-alt/card-bg/text/text-muted/border) are the app's general
  ColorScheme.fromSeed(Colors.deepPurple) (2026-08-25). Website-specific layer mapping
  (bg → bg-alt → card-bg as an ascending elevation ladder using surface →
  surfaceContainerLow → surfaceContainerHigh) is our own choice since the app itself
  doesn't have an "alternating section" concept — dark mode maps 1:1 to the app's actual
  container roles, light mode fills the one missing step (no app-side surfaceContainerHigh
  for light) by reusing surfaceContainerLow.

  --accent/--accent-on/--pill-bg use the Finance PillarColors accent (2026-09-10 update),
  not the app-wide purple `primary` — Griseo's call: purple is app/logo identity, while each
  pillar (Finance/Fitness/Health/Skills) has its own PillarColors accent, and Finance is the
  only shipped pillar so its teal/cyan is the website's current dominant color. Purple stays
  reserved for logo/brand-identity use only (not currently used as a website UI color).
  Important nuance from Data: the green seen in app screenshots (net worth card, positive
  numbers) is `gain` — a generic pillar-agnostic "positive value" color, NOT the Finance
  pillar's actual accent. Finance's real accent is teal/cyan (#4FD8DB dark / #00696D light).
  --pillar-*/-container pairs below are used for the roadmap timeline (see below) — dark-mode
  --accent-on reuses --pillar-finance-container (a real Data-provided value from the same
  color family) since the app didn't give us an explicit "text-on-finance-accent" token; not
  a fabricated hex, just our own pairing choice — same principle as --accent-hover using a
  brightness filter instead of guessing a hex.
*/
:root {
  --bg: #fef7ff;
  --bg-alt: #f8f1fa;
  --text: #1d1b20;
  --text-muted: #7a757f;
  --border: #7a757f;
  --accent: #00696d;
  --accent-on: #ffffff;
  --card-bg: #f8f1fa;
  --pill-bg: #9cf1f2;
  --radius-card: 12px;
  --radius-input: 12px;
  --max-width: 1080px;

  --pillar-finance: #00696d;
  --pillar-finance-container: #9cf1f2;
  --pillar-fitness: #8b5000;
  --pillar-fitness-container: #ffdcc2;
  --pillar-health: #8c4a60;
  --pillar-health-container: #ffd9e2;
  --pillar-skills: #4a57a9;
  --pillar-skills-container: #dee0ff;

  font-size: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151218;
    --bg-alt: #1d1b20;
    --text: #e7e0e8;
    --text-muted: #cbc4cf;
    --border: #49454e;
    --accent: #4fd8db;
    --accent-on: #004f53;
    --card-bg: #2c292f;
    --pill-bg: #004f53;

    --pillar-finance: #4fd8db;
    --pillar-finance-container: #004f53;
    --pillar-fitness: #ffb877;
    --pillar-fitness-container: #6b3b00;
    --pillar-health: #ffb1c4;
    --pillar-health-container: #703348;
    --pillar-skills: #b9c3ff;
    --pillar-skills-container: #313f90;
  }
}

* {
  box-sizing: border-box;
}

/* No elements use inline style="" attributes — keeps style-src 'self' viable in the CSP
   without 'unsafe-inline'. The honeypot field below is the one thing that needed hiding. */
.honeypot-field {
  display: none;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

a {
  color: var(--accent);
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

header.site-header {
  border-bottom: 1px solid var(--border);
  position: relative;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
}

.nav-panel {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.nav-toggle-bar {
  display: block;
  width: 18px;
  height: 2px;
  margin: 0 auto;
  background: var(--text);
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.nav-toggle.open .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.open .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
  color: var(--text);
  letter-spacing: -0.01em;
}

.logo span {
  color: var(--accent);
}

.logo-mark {
  width: 56px;
  height: 56px;
  display: block;
}

.nav-links {
  display: flex;
  gap: 24px;
  font-size: 0.95rem;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--text);
}

.lang-switch {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
}

.lang-switch button {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
}

.lang-switch button:hover {
  color: var(--text);
}

.lang-switch button.active {
  background: var(--accent);
  color: var(--accent-on);
}

.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-on);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: filter 0.15s ease;
}

.btn:hover {
  /* No app-provided hover hex for primary — darken slightly instead of guessing a color */
  filter: brightness(0.92);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--bg-alt);
}

/* Hero */
.hero {
  padding: 88px 0 72px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2.1rem, 4.5vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
}

.hero .accent {
  color: var(--accent);
}

.hero p.lead {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto 36px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Bundle section */
section {
  padding: 64px 0;
}

section.alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-header {
  text-align: center;
  max-width: 620px;
  margin: 0 auto 44px;
}

.section-header h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}

.section-header p {
  color: var(--text-muted);
  margin: 0;
}

.bundle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 26px 22px;
}

.card .icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--pill-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 16px;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.94rem;
}

.bundle-note {
  text-align: center;
  margin-top: 32px;
  color: var(--text-muted);
  font-size: 0.92rem;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

/* Roadmap */
.timeline {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  padding-left: 28px;
  border-left: 2px solid var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 40px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -34px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--border);
  border: 2px solid var(--bg-alt);
}

/*
  Each roadmap entry is tinted in its own PillarColors accent (2026-09-10) — Finance is the
  only shipped pillar, so it gets full-opacity emphasis; the other three still show their real
  brand color (foreshadowing what's coming) but at reduced opacity to read as "not live yet".
*/
.timeline-item.pillar-finance::before {
  background: var(--pillar-finance);
}

.timeline-item.pillar-fitness::before {
  background: var(--pillar-fitness);
  opacity: 0.6;
}

.timeline-item.pillar-health::before {
  background: var(--pillar-health);
  opacity: 0.6;
}

.timeline-item.pillar-skills::before {
  background: var(--pillar-skills);
  opacity: 0.6;
}

.timeline-status {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.pillar-finance .timeline-status {
  background: var(--pillar-finance-container);
  color: var(--pillar-finance);
}

.pillar-fitness .timeline-status {
  background: var(--pillar-fitness-container);
  color: var(--pillar-fitness);
}

.pillar-health .timeline-status {
  background: var(--pillar-health-container);
  color: var(--pillar-health);
}

.pillar-skills .timeline-status {
  background: var(--pillar-skills-container);
  color: var(--pillar-skills);
}

.timeline-item h3 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}

.timeline-item p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Waitlist form */
.waitlist-box {
  max-width: 480px;
  margin: 0 auto;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 36px 32px;
}

.form-row {
  margin-bottom: 16px;
}

.form-row label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.form-row input {
  width: 100%;
  padding: 11px 13px;
  border-radius: var(--radius-input);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
}

.form-row input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.form-submit {
  width: 100%;
  margin-top: 4px;
}

.form-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 14px;
  text-align: center;
}

.form-status {
  margin-top: 14px;
  font-size: 0.9rem;
  text-align: center;
  display: none;
}

.form-status.success {
  display: block;
  color: var(--accent);
}

.form-status.error {
  display: block;
  color: #c74545;
}

/* Footer */
footer.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 18px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text);
}

/* Legal pages */
.legal-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 56px 0 80px;
}

.legal-content h1 {
  margin-bottom: 8px;
}

.legal-content .updated {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 32px;
}

.legal-content h2 {
  font-size: 1.2rem;
  margin-top: 36px;
}

.legal-content p, .legal-content li {
  color: var(--text-muted);
}

.legal-content.not-found {
  text-align: center;
  padding-top: 96px;
  padding-bottom: 96px;
}

.legal-content.not-found p {
  margin: 0 auto 28px;
  max-width: 420px;
}

.placeholder {
  background: var(--pill-bg);
  color: var(--accent);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
}

/* Global overflow safety net — nothing here is expected to need horizontal scroll, this just
   guarantees a runaway element (long unbroken string, a future addition) can't create one. */
html,
body {
  overflow-x: hidden;
  max-width: 100%;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

/*
  Mobile nav (added 2026-09-10). Below 900px the nav-links/lang-switch/[waitlist button] group
  (".nav-panel") collapses behind a hamburger toggle instead of squeezing into one row — at
  full width that group plus the logo is comfortably 700px+, which doesn't fit next to the logo
  on anything phone- or small-tablet-sized. 900px is a starting point, not verified against a
  real device — see TESTING.md section 1 for what to check and adjust if it feels off.
*/
@media (max-width: 900px) {
  .nav-toggle {
    display: flex;
  }

  .nav-panel {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 16px 24px 24px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
  }

  .nav-panel.open {
    display: flex;
  }

  .nav-panel .nav-links {
    flex-direction: column;
    gap: 4px;
  }

  .nav-panel .nav-links a {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
  }

  .nav-panel .lang-switch {
    align-self: flex-start;
    margin: 8px 0;
  }

  .nav-panel .btn {
    text-align: center;
  }
}

/* Trim the generous desktop section padding on small screens so content doesn't feel like
   it's mostly whitespace on a phone. */
@media (max-width: 640px) {
  .hero {
    padding: 56px 0 48px;
  }

  section {
    padding: 44px 0;
  }

  .section-header {
    margin-bottom: 32px;
  }

  .waitlist-box {
    padding: 28px 20px;
  }
}
