/* ==========================================================================
   WakePlan — promotional website design system.
   Tokens below are copied from DESIGN.md — keep them in sync if design changes.
   ========================================================================== */

:root {
  /* Brand colors (from DESIGN.md `colors`) */
  --color-primary: #2E7A70;
  --color-secondary: #8A8580;
  --color-tertiary: #3D9B8F;
  --color-neutral: #F7F5F2;
  --color-surface: #FFFFFF;
  --color-ink: #0B0B0F;
  --color-ink-soft: #55555F;

  /* Type (from DESIGN.md `typography`) */
  --font-heading: "SF Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "SF Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Shape + spacing (from DESIGN.md `rounded` / `spacing`) */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --space-sm: 10px;
  --space-md: 22px;
  --space-lg: 32px;

  --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.10);
  --shadow-card: 0 2px 10px rgba(0, 0, 0, 0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  color: var(--color-ink);
  background: var(--color-neutral);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
}

.wrap { width: min(1120px, 92vw); margin-inline: auto; }
.section { padding: clamp(3rem, 8vw, 6rem) 0; }
.section-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  text-align: center;
  margin-bottom: var(--space-sm);
}
.section-sub {
  text-align: center;
  color: var(--color-ink-soft);
  max-width: 46ch;
  margin: 0 auto var(--space-lg);
}
.section-sub a { color: var(--color-primary); font-weight: 600; text-decoration: none; }
.section-sub a:hover { text-decoration: underline; }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-surface);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding-top: env(safe-area-inset-top);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
}
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--color-ink); }
.brand img { width: 36px; height: 36px; border-radius: var(--radius-sm); box-shadow: var(--shadow-card); }
.brand-name { font-family: var(--font-heading); font-weight: 700; font-size: 1.15rem; }
.nav-links { display: flex; align-items: center; gap: 1.6rem; }
.nav-links a { color: var(--color-ink-soft); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.nav-links a:hover { color: var(--color-primary); }

/* Mobile nav menu (details/summary — no JS) */
.nav-menu { display: none; position: relative; }
.nav-menu summary {
  list-style: none;
  cursor: pointer;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-ink-soft);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  min-height: 44px;
  display: flex;
  align-items: center;
}
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu summary::after {
  content: "▾";
  margin-left: 0.35rem;
  font-size: 0.75rem;
  transition: transform 0.15s ease;
}
.nav-menu[open] summary::after { transform: rotate(180deg); }
.nav-menu[open] summary { color: var(--color-primary); }
.nav-menu-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 11rem;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(0, 0, 0, 0.06);
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  z-index: 60;
}
.nav-menu-dropdown a {
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--color-ink-soft);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.nav-menu-dropdown a:hover { background: var(--color-neutral); color: var(--color-primary); }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  padding: 0.85rem 1.6rem;
  color: #fff;
  background: var(--color-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16); }
.btn:active { transform: translateY(0); }
.btn--ghost { background: transparent; color: var(--color-primary); box-shadow: none; border: 1.5px solid var(--color-primary); }
.btn--lg { font-size: 1.1rem; padding: 1rem 2.1rem; }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero { padding: clamp(3rem, 9vw, 6rem) 0 clamp(2rem, 6vw, 4rem); }
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
}
.pill-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.1rem; }
.pill {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  background: var(--color-surface);
  color: var(--color-ink-soft);
  border-radius: 999px;
  box-shadow: var(--shadow-card);
}
.hero h1 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  line-height: 1.05;
  margin-bottom: 1rem;
}
.hero .lede {
  color: var(--color-ink-soft);
  font-size: 1.1rem;
  max-width: 42ch;
  margin-bottom: 1.8rem;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin-bottom: 0.9rem; }
.hero-note { color: var(--color-ink-soft); font-size: 0.85rem; opacity: 0.85; }
.hero-art { display: flex; justify-content: center; align-items: flex-end; gap: 1.2rem; }

/* --------------------------------------------------------------------------
   Phone frame — pure CSS, no image assets required for the bezel
   -------------------------------------------------------------------------- */
.phone-frame {
  position: relative;
  width: 220px;
  background: linear-gradient(155deg, #4a4a4d, #232325 55%, #17171a);
  border-radius: 46px;
  padding: 6px;
  box-shadow: var(--shadow-soft), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.phone-frame:nth-child(2) { transform: translateY(-18px); z-index: 2; width: 240px; }
.phone-frame:nth-child(1) { transform: rotate(-4deg); }
.phone-frame:nth-child(3) { transform: rotate(4deg); }
/* No CSS-drawn notch/Dynamic Island: real device screenshots already include it,
   so the bezel only needs a thin frame around the raw screenshot. */
.phone-frame__screen {
  /* Aspect ratio lives on the content box (not the padded .phone-frame border-box),
     so it matches the real iPhone 17 Pro screenshot ratio (1206x2622) exactly —
     otherwise object-fit: cover crops the screenshot's left/right edges. */
  width: 100%;
  aspect-ratio: 1206 / 2622;
  border-radius: 40px;
  overflow: hidden;
  background: var(--color-surface);
}
.phone-frame__screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.phone-frame__home {
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 30%;
  height: 3px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  z-index: 2;
  pointer-events: none;
}

.screens-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 2rem 0;
}

/* --------------------------------------------------------------------------
   Feature cards
   -------------------------------------------------------------------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-md);
}
.card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-card);
}
.card .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--color-neutral);
  font-size: 1.4rem;
  margin-bottom: 0.9rem;
}
.card h3 { font-family: var(--font-heading); font-size: 1.1rem; margin-bottom: 0.4rem; }
.card p { color: var(--color-ink-soft); font-size: 0.95rem; }

/* --------------------------------------------------------------------------
   FAQ accordion
   -------------------------------------------------------------------------- */
.faq-list { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 0.7rem; }
.faq-item {
  background: var(--color-neutral);
  border-radius: var(--radius-md);
  padding: 0 var(--space-md);
}
.faq-item summary {
  cursor: pointer;
  list-style: none;
  font-family: var(--font-heading);
  font-weight: 600;
  padding: var(--space-sm) 0;
  position: relative;
  padding-right: 1.6rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: var(--space-sm);
  color: var(--color-primary);
  font-weight: 700;
}
.faq-item[open] summary::after { content: "−"; }
.faq-item p { color: var(--color-ink-soft); font-size: 0.95rem; padding-bottom: var(--space-sm); }

/* --------------------------------------------------------------------------
   CTA band + footer
   -------------------------------------------------------------------------- */
.cta-band {
  background: var(--color-primary);
  color: #fff;
  text-align: center;
  padding: clamp(3rem, 8vw, 5rem) 0;
}
.cta-band h2 { font-family: var(--font-heading); font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 1.4rem; }
.cta-band .btn { background: #fff; color: var(--color-primary); }
.cta-band .hero-note { color: rgba(255, 255, 255, 0.85); margin-top: 1rem; }

/* --------------------------------------------------------------------------
   App Store badge (official Apple artwork — do not restyle the badge itself,
   only its display size and surrounding link)
   -------------------------------------------------------------------------- */
.app-store-badge-link { display: inline-block; line-height: 0; }
.app-store-badge { height: 44px; width: auto; display: block; }
.cta-band .app-store-badge { height: 64px; }

.site-footer { padding: var(--space-lg) 0; background: var(--color-surface); }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; }
.footer-grid small { color: var(--color-ink-soft); display: block; margin-top: 0.3rem; }
.footer-links { display: flex; gap: 1.2rem; }
.footer-links a { color: var(--color-ink-soft); text-decoration: none; font-size: 0.9rem; }
.footer-links a:hover { color: var(--color-primary); }

/* --------------------------------------------------------------------------
   Legal pages (privacy.html / terms.html)
   -------------------------------------------------------------------------- */
.legal { padding: clamp(2.5rem, 6vw, 4rem) 0; }
.legal .wrap { max-width: 760px; }
.legal h1 { font-family: var(--font-heading); font-size: clamp(2rem, 4vw, 2.6rem); margin-bottom: 0.4rem; }
.legal .updated { color: var(--color-ink-soft); font-size: 0.9rem; margin-bottom: 2rem; }
.legal h2 { font-family: var(--font-heading); font-size: 1.3rem; margin: 2rem 0 0.7rem; }
.legal h3 { font-family: var(--font-heading); font-size: 1.05rem; margin: 1.4rem 0 0.5rem; }
.legal p, .legal li { color: var(--color-ink-soft); margin-bottom: 0.8rem; }
.legal ul { padding-left: 1.3rem; }
.legal a, .legal code {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.placeholder { background: #FFF3CD; padding: 0.05rem 0.3rem; border-radius: 4px; }

/* --------------------------------------------------------------------------
   Help page (help.html)
   -------------------------------------------------------------------------- */
.help-hero {
  padding: clamp(2.5rem, 6vw, 4rem) 0 clamp(1.5rem, 4vw, 2.5rem);
  text-align: center;
}
.help-hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4.5vw, 2.8rem);
  margin-bottom: 0.75rem;
}
.help-hero .lede {
  color: var(--color-ink-soft);
  font-size: 1.1rem;
  max-width: 52ch;
  margin: 0 auto;
}
.help-toc {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
  box-shadow: var(--shadow-card);
  margin-bottom: var(--space-lg);
}
.help-toc h2 {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-ink-soft);
  margin-bottom: 0.75rem;
}
.help-toc ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.2rem;
  padding: 0;
}
.help-toc a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}
.help-toc a:hover { text-decoration: underline; }

.help-section { padding: clamp(2rem, 5vw, 3.5rem) 0; }
.help-section:nth-child(even) { background: var(--color-surface); }
.help-section .wrap { max-width: 820px; }
.help-section h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  margin-bottom: 0.6rem;
}
.help-section .section-intro {
  color: var(--color-ink-soft);
  margin-bottom: var(--space-lg);
  max-width: 62ch;
}

.big-idea {
  background: linear-gradient(135deg, var(--color-primary), var(--color-tertiary));
  color: #fff;
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow-soft);
}
.big-idea p { color: rgba(255, 255, 255, 0.92); margin-bottom: 0.6rem; }
.big-idea p:last-child { margin-bottom: 0; }
.big-idea strong { color: #fff; }

.concept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-md);
}
.concept-card {
  background: var(--color-neutral);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  border: 1px solid rgba(0, 0, 0, 0.05);
}
.help-section:nth-child(even) .concept-card { background: var(--color-neutral); }
.concept-card .label {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-primary);
  margin-bottom: 0.4rem;
}
.concept-card h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}
.concept-card p { color: var(--color-ink-soft); font-size: 0.95rem; margin-bottom: 0; }
.concept-card .where {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 0.85rem;
  color: var(--color-ink-soft);
}
.concept-card .where strong { color: var(--color-ink); }

.priority-list {
  list-style: none;
  counter-reset: priority;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0;
}
.priority-list li {
  counter-increment: priority;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  background: var(--color-neutral);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  color: var(--color-ink-soft);
  font-size: 0.95rem;
}
.help-section:nth-child(even) .priority-list li { background: var(--color-neutral); }
.priority-list li::before {
  content: counter(priority);
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 50%;
}
.priority-list li strong { color: var(--color-ink); display: block; margin-bottom: 0.15rem; }
.priority-note {
  margin-top: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: rgba(46, 122, 112, 0.08);
  border-left: 3px solid var(--color-primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--color-ink-soft);
  font-size: 0.9rem;
}

.use-case {
  background: var(--color-neutral);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
  border: 1px solid rgba(0, 0, 0, 0.05);
}
.help-section:nth-child(even) .use-case { background: var(--color-neutral); }
.use-case:last-child { margin-bottom: 0; }
.use-case h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  margin-bottom: 0.35rem;
}
.use-case .tagline {
  color: var(--color-ink-soft);
  font-size: 0.9rem;
  margin-bottom: var(--space-md);
}
.step-list {
  list-style: none;
  counter-reset: steps;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.step-list li {
  counter-increment: steps;
  position: relative;
  padding-left: 2.2rem;
  color: var(--color-ink-soft);
  font-size: 0.95rem;
}
.step-list li::before {
  content: counter(steps);
  position: absolute;
  left: 0;
  top: 0.1rem;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  border: 1.5px solid var(--color-primary);
  color: var(--color-primary);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.75rem;
  border-radius: 50%;
}
.step-list li strong { color: var(--color-ink); }

.help-cta {
  text-align: center;
  padding: clamp(2rem, 5vw, 3rem) 0;
}
.help-cta p { color: var(--color-ink-soft); margin-bottom: 0.75rem; }
.help-cta a { color: var(--color-primary); font-weight: 600; }

/* --------------------------------------------------------------------------
   Responsive — tablet
   -------------------------------------------------------------------------- */
@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-copy { display: flex; flex-direction: column; align-items: center; }
  .hero .lede { margin-inline: auto; }
  .hero-cta { justify-content: center; }
  .hero-art { order: -1; margin-bottom: 0.5rem; }
  .hero-art .phone-frame { width: 150px; }
  .hero-art .phone-frame:nth-child(2) { width: 170px; transform: translateY(-12px); }
  .hero-art .phone-frame:nth-child(1) { transform: rotate(-3deg); }
  .hero-art .phone-frame:nth-child(3) { transform: rotate(3deg); }
  .nav-links > a:not(.btn) { display: none; }
  .nav-menu { display: block; }
  .footer-grid { flex-direction: column; align-items: center; text-align: center; }
  .footer-links { justify-content: center; flex-wrap: wrap; row-gap: 0.5rem; }
}

/* --------------------------------------------------------------------------
   Responsive — phone
   -------------------------------------------------------------------------- */
@media (max-width: 600px) {
  .wrap { width: min(1120px, 94vw); }
  .section { padding: clamp(2.25rem, 7vw, 4rem) 0; }
  .hero { padding-top: clamp(2rem, 7vw, 3.5rem); }
  .hero h1 { font-size: clamp(1.85rem, 7.5vw, 2.4rem); }
  .hero .lede { font-size: 1rem; }
  .nav .btn { padding: 0.65rem 1rem; font-size: 0.9rem; min-height: 44px; }
  .card { padding: var(--space-md); }
  .card-grid { grid-template-columns: 1fr; }
  .faq-item summary { font-size: 0.95rem; line-height: 1.4; padding-top: 0.85rem; padding-bottom: 0.85rem; }
  .cta-band { padding: clamp(2.5rem, 7vw, 4rem) 0; }
  .cta-band .app-store-badge { height: 52px; }

  /* Hero: one featured phone — three side-by-side still overflows narrow screens */
  .hero-art .phone-frame:nth-child(1),
  .hero-art .phone-frame:nth-child(3) { display: none; }
  .hero-art .phone-frame:nth-child(2) {
    width: min(220px, 72vw);
    transform: none;
  }

  /* Screens: stack vertically */
  .screens-row {
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem 0;
  }
  .screens-row .phone-frame {
    width: min(220px, 72vw);
    transform: none !important;
  }

  .help-toc ul { flex-direction: column; gap: 0.6rem; }
  .concept-grid { grid-template-columns: 1fr; }
  .use-case { padding: var(--space-md); }
}

@media (max-width: 380px) {
  .brand-name { font-size: 1rem; }
  .nav-links { gap: 0.75rem; }
  .nav-menu summary { padding-inline: 0.5rem; font-size: 0.9rem; }
  .footer-links { gap: 0.85rem; }
  .footer-links a { font-size: 0.85rem; }
}
