/* ==========================================================================
   Pitch Charter — styles.css
   Structure:
     1. Design tokens — light theme, dark theme, and "chrome" (always-navy)
     2. Reset & base
     3. Layout helpers & buttons
     4. Header / nav / theme toggle
     5. Hero
     6. Features grid
     7. Screenshots (placeholders)
     8. About
     9. CTA band
    10. Footer
    11. Motion
    12. Desktop media queries (mobile-first: these ADD desktop layout)

   THEMING: every color below is a variable. <html data-theme="light|dark">
   (set by js/theme-init.js, toggled in js/main.js) decides which set
   applies. The header, hero, and footer use the --chrome-* tokens, which
   stay the brand navy in BOTH themes — that's the app's own theme-color
   (#1a3a5c), so the site reads as the same product in any light setting.
   ========================================================================== */

/* 1. DESIGN TOKENS -------------------------------------------------------- */
:root {
  /* Chrome: identical in both themes (header / hero / footer / CTA band).
     Matches the app's manifest.json theme-color exactly. */
  --chrome-bg:      #1a3a5c;
  --chrome-bg-soft: #142d47;
  --chrome-text:    #eef4fa;
  --chrome-muted:   #a9c2d9;

  --color-brand:      #1a3a5c; /* deep navy — same as the app icon wordmark */
  --color-brand-blue: #3a8fd6; /* speedometer-needle blue from the app logo */
  --color-on-brand:   #ffffff;

  --font-head: "Poppins", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;

  --radius: 10px;
  --container-max: 1100px;
  --section-pad: 4.5rem;
}

/* Light theme (default) */
[data-theme="light"] {
  --color-bg:      #f7fafd;
  --color-bg-alt:  #eef4fa;
  --color-surface: #ffffff;
  --color-text:    #263340;
  --color-heading: #14232f;
  --color-muted:   #5b7185;
  --color-border:  #d7e3ee;
  --color-accent:  #1a5fa8;   /* darkened brand blue — readable on light bg */
  --color-success: #1a7f37;
  --shadow: 0 4px 18px rgba(20, 35, 47, 0.09);
}

/* Dark theme */
[data-theme="dark"] {
  --color-bg:      #0f1720;
  --color-bg-alt:  #131e29;
  --color-surface: #1a2733;
  --color-text:    #d8e2ea;
  --color-heading: #f2f6f9;
  --color-muted:   #8fa3b3;
  --color-border:  #263644;
  --color-accent:  #5fa8e8;   /* lighter blue reads fine on dark */
  --color-success: #4ec97a;
  --shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

/* 2. RESET & BASE --------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 4.5rem; /* stop sections hiding under the sticky header */
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  transition: background-color 0.25s ease, color 0.25s ease;
}

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

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

h1, h2, h3 {
  font-family: var(--font-head);
  color: var(--color-heading);
  font-weight: 700;
}

/* 3. LAYOUT HELPERS & BUTTONS --------------------------------------------- */
.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.section { padding-block: var(--section-pad); }
.section-alt { background: var(--color-bg-alt); }

.section-title {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 800;
  text-align: center;
}
.section-title::after {
  content: "";
  display: block;
  width: 3.5rem;
  height: 4px;
  background: var(--color-brand-blue);
  margin: 0.6rem auto 0;
  border-radius: 2px;
}

.section-sub {
  text-align: center;
  color: var(--color-muted);
  max-width: 42rem;
  margin: 0.75rem auto 2.5rem;
}

.btn {
  display: inline-block;
  padding: 0.8rem 1.7rem;
  border-radius: var(--radius);
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  font-size: 1rem;
  font-family: var(--font-body);
  transition: background-color 0.15s ease, color 0.15s ease,
              transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--color-brand-blue);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(58, 143, 214, 0.35);
}
.btn-primary:hover { background: #2f7bc0; }
.btn-outline { border-color: currentColor; color: inherit; }
.btn-outline:hover { background: rgba(128, 128, 128, 0.12); }

/* Pill badge — used for the "iOS coming soon" note in the hero */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--chrome-text);
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

/* 4. HEADER / NAV / THEME TOGGLE ------------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--chrome-bg);
  color: var(--chrome-text);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4rem;
  gap: 0.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: inherit;
  text-decoration: none;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.15rem;
}
.logo img {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 6px; /* the source PNG already has its own rounded corners baked in */
}

.header-controls { display: flex; align-items: center; gap: 0.25rem; }

.theme-toggle {
  background: none;
  border: 0;
  padding: 0.6rem;
  cursor: pointer;
  color: var(--chrome-text);
  display: grid;
  place-items: center;
  border-radius: 50%;
  transition: background-color 0.15s ease, transform 0.3s ease;
}
.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: rotate(20deg);
}
[data-theme="light"] .icon-sun  { display: none; }
[data-theme="dark"]  .icon-moon { display: none; }

.nav-toggle { background: none; border: 0; padding: 0.75rem; cursor: pointer; }
.hamburger,
.hamburger::before,
.hamburger::after {
  content: "";
  display: block;
  width: 24px;
  height: 2px;
  background: var(--chrome-text);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.hamburger { position: relative; }
.hamburger::before { position: absolute; top: -7px; }
.hamburger::after  { position: absolute; top:  7px; }

.nav-open .hamburger { transform: rotate(45deg); }
.nav-open .hamburger::before { opacity: 0; }
.nav-open .hamburger::after { transform: rotate(-90deg); top: 0; }

.site-nav {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--chrome-bg-soft);
  display: none;
}
.nav-open .site-nav { display: block; }

.site-nav ul { list-style: none; padding: 0.5rem 1.25rem 1rem; }
.site-nav a {
  display: block;
  padding: 0.75rem 0;
  color: var(--chrome-text);
  text-decoration: none;
  font-weight: 600;
}
.site-nav a:hover { color: var(--color-brand-blue); }
.nav-cta { color: #7fc0f2 !important; }

/* 5. HERO ------------------------------------------------------------------ */
.hero {
  background:
    radial-gradient(60rem 30rem at 85% -10%, rgba(58, 143, 214, 0.22), transparent 60%),
    repeating-linear-gradient(-55deg,
      rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 9px),
    linear-gradient(165deg, var(--chrome-bg) 30%, var(--chrome-bg-soft) 100%);
  color: var(--chrome-text);
  text-align: center;
  padding-block: 3rem;
  overflow: hidden;
}

.hero-logo {
  width: clamp(96px, 16vw, 132px);
  height: auto;
  margin-inline: auto;
  margin-bottom: 0.5rem;
  border-radius: 22%; /* echoes the app-icon rounding baked into the PNG */
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.hero-eyebrow {
  color: #7fc0f2;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.hero h1 {
  color: var(--chrome-text);
  font-size: clamp(2.25rem, 6.5vw, 3.75rem);
  font-weight: 800;
  line-height: 1.08;
}

.hero-sub {
  max-width: 36rem;
  margin: 0.9rem auto 1.5rem;
  color: var(--chrome-muted);
  font-size: 1.15rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}
.hero .btn-outline { color: var(--chrome-text); }
.hero .btn-outline:hover { background: rgba(255, 255, 255, 0.1); }

/* 6. FEATURES GRID ---------------------------------------------------------- */
.card-grid {
  display: grid;
  gap: 1.25rem;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease,
              background-color 0.25s ease, border-color 0.25s ease;
}
.card:hover { transform: translateY(-4px); }

.feature-card .feature-icon {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
}
.feature-card h3 { font-size: 1.2rem; margin-bottom: 0.4rem; }
.feature-card p { color: var(--color-muted); font-size: 0.98rem; }

/* 7. SCREENSHOTS -------------------------------------------------------------- */
.screenshot-grid {
  display: grid;
  gap: 1.5rem;
  align-items: start; /* cards have different image aspect ratios; don't stretch to match */
}

.screenshot-card {
  max-width: 320px;
  margin-inline: auto;
  width: 100%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.75rem;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease,
              background-color 0.25s ease, border-color 0.25s ease;
}
.screenshot-card:hover { transform: translateY(-4px); }
.screenshot-card img {
  width: 100%;
  height: auto;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid var(--color-border);
  margin-bottom: 0.85rem;
}
.screenshot-card figcaption p { font-weight: 700; color: var(--color-heading); margin-bottom: 0.25rem; }
.screenshot-card figcaption span { font-size: 0.85rem; color: var(--color-muted); }

/* 8. ABOUT -------------------------------------------------------------------- */
.about-inner {
  max-width: 42rem;
  margin-inline: auto;
  text-align: center;
}
.about-inner p + p { margin-top: 1rem; }

/* 9. CTA BAND ------------------------------------------------------------------ */
.cta-band {
  background: var(--chrome-bg);
  color: var(--chrome-text);
  text-align: center;
}
.cta-band h2 { color: var(--chrome-text); }
.cta-band .section-sub { color: var(--chrome-muted); }
.cta-band .hero-actions { margin-bottom: 0; }

/* 10. FOOTER -------------------------------------------------------------------- */
.site-footer {
  background: var(--chrome-bg-soft);
  color: var(--chrome-text);
  text-align: center;
  padding-block: 2.5rem;
  border-top: 3px solid var(--color-brand-blue);
}
.footer-inner { display: grid; gap: 0.6rem; }
.footer-logo { width: 56px; height: auto; margin-inline: auto; border-radius: 22%; }
.site-footer a { color: var(--chrome-text); }
.footer-links { display: flex; justify-content: center; gap: 1.25rem; flex-wrap: wrap; }
.footer-fine { color: var(--chrome-muted); font-size: 0.85rem; margin-top: 0.5rem; }

/* 11. MOTION -------------------------------------------------------------------- */
@keyframes rise-in {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero-logo,
.hero-eyebrow,
.hero h1,
.hero-sub,
.hero-actions {
  animation: rise-in 0.6s ease-out both;
}
.hero-eyebrow     { animation-delay: 0.1s; }
.hero h1          { animation-delay: 0.2s; }
.hero-sub         { animation-delay: 0.32s; }
.hero-actions     { animation-delay: 0.44s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  html { scroll-behavior: auto; }
}

/* 12. DESKTOP LAYOUT (mobile-first: these rules ADD columns) -------------------- */
@media (min-width: 700px) {
  .nav-toggle { display: none; }
  .site-nav { display: block; position: static; background: none; }
  .site-nav ul { display: flex; align-items: center; gap: 1.75rem; padding: 0; }
  .site-nav a { padding: 0.25rem 0; }

  .header-controls { order: 3; }
}

@media (min-width: 900px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); }
  .screenshot-grid { grid-template-columns: repeat(2, 1fr); max-width: 700px; margin-inline: auto; }
  .hero { padding-block: 4.5rem; }
}
