/* Peakxy landing page — standalone (the app's styles.css pins the body for
   the chat UI; this page scrolls). Shares the brand tokens + font stack. */

:root {
  --paper: #f5f6f4;
  --surface: #ffffff;
  --ink: #101418;
  --muted: #5c6570;
  --line: #e3e6e2;
  --accent: #2743e8;
  --accent-2: #b332dd;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* Dark theme — same palette as the app (styles.css), shared via the
   peakxy.theme localStorage key so the choice follows the visitor in. */
:root[data-theme="dark"] {
  --paper: #14161a;
  --surface: #1c1f24;
  --ink: #f1f2f4;
  --muted: #9aa1ab;
  --line: #2c3038;
  --accent: #5b7cff;
  --accent-2: #cf6bff;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 {
  font-family: var(--display);
  letter-spacing: -0.02em;
  margin: 0;
}
p { margin: 0; }
a { color: inherit; text-decoration: none; }
:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 8px;
}

.container {
  max-width: 1080px;
  margin-inline: auto;
  padding-inline: clamp(16px, 5vw, 32px);
}

/* anchor sections shouldn't hide under the sticky header */
section[id] { scroll-margin-top: 76px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  transition: background 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}
.btn:active { transform: translateY(1px); }
.btn-dark {
  background: var(--ink);
  color: var(--surface); /* ink flips light in dark mode, so the label flips too */
}
.btn-dark:hover { background: #23292f; box-shadow: 0 6px 16px rgba(16, 20, 24, 0.2); }
:root[data-theme="dark"] .btn-dark:hover { background: #ffffff; }
.btn-light {
  background: var(--surface);
  color: var(--ink);
}
.btn-light:hover { box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25); }
.btn-sm { min-height: 40px; padding: 0 18px; font-size: 14px; }
.apple-glyph { margin-top: -2px; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}
.header-brand {
  position: relative; /* anchors the beta tooltip */
  display: flex;
  align-items: center;
  gap: 10px;
}
.wordmark {
  font-family: var(--display);
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -0.02em;
}
.wordmark .caret { color: var(--accent); margin-left: 1px; }

/* ---------- beta tag + tooltip ---------- */
.beta-tag {
  position: relative; /* anchors the unread dot */
  padding: 3px 9px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--accent);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.4;
  cursor: help;
}
.beta-tooltip {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 30;
  width: min(300px, calc(100vw - 32px));
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 16px 40px -12px rgba(16, 20, 24, 0.22);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 150ms ease, visibility 150ms ease, transform 150ms ease;
}
/* invisible bridge over the 10px gap so the pointer can travel from the tag
   into the tooltip (to click the mailto link) without it closing */
.beta-tooltip::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 12px;
}
.beta-tooltip a { color: var(--accent); font-weight: 600; }
.beta-tooltip a:hover { text-decoration: underline; }
.beta-tag:hover ~ .beta-tooltip,
.beta-tag:focus ~ .beta-tooltip,
.beta-tooltip:hover,
.beta-tooltip.open { /* tap-to-toggle path for touch screens (see landing.js) */
  opacity: 1;
  visibility: visible;
  transform: none;
}
/* unread dot: nudges a first look at the disclaimer, cleared once opened */
.beta-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #e5484d;
  border: 2px solid var(--surface);
  animation: beta-pulse 2s ease-out infinite;
}
.beta-dot[hidden] { display: none; }
@keyframes beta-pulse {
  0% { box-shadow: 0 0 0 0 rgba(229, 72, 77, 0.45); }
  70% { box-shadow: 0 0 0 7px rgba(229, 72, 77, 0); }
  100% { box-shadow: 0 0 0 0 rgba(229, 72, 77, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .beta-dot { animation: none; }
}
.header-actions {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.5vw, 26px);
}
.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.5vw, 26px);
}
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}
.nav-link {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--muted);
  transition: color 150ms ease;
}
.nav-link:hover { color: var(--ink); }

/* ---------- mobile nav (hamburger + slide-down menu, <768px) ---------- */
.nav-burger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-right: -8px; /* icon aligns optically with the container edge */
  padding: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
}
.burger-box {
  position: relative;
  display: block;
  width: 20px;
  height: 14px;
}
.burger-line {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform 220ms ease, opacity 150ms ease;
}
.burger-line:nth-child(1) { top: 0; }
.burger-line:nth-child(2) { top: 6px; }
.burger-line:nth-child(3) { top: 12px; }
.nav-burger[aria-expanded="true"] .burger-line:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-burger[aria-expanded="true"] .burger-line:nth-child(2) { opacity: 0; }
.nav-burger[aria-expanded="true"] .burger-line:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.mobile-menu {
  display: none; /* becomes block in the <768px media query */
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  padding: 8px 16px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 24px 40px -16px rgba(16, 20, 24, 0.18);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease, visibility 220ms ease;
}
.mobile-menu.open {
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
}
.mobile-menu nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mobile-link {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}
.mobile-link:hover, .mobile-link:active { background: var(--paper); }
.mobile-cta { margin-top: 10px; width: 100%; }
body.menu-open { overflow: hidden; } /* lock page scroll behind the open menu */

/* ---------- hero ---------- */
.hero {
  background:
    radial-gradient(900px 460px at 18% -140px, color-mix(in srgb, var(--accent) 8%, transparent), transparent 70%),
    radial-gradient(720px 420px at 95% 20%, color-mix(in srgb, var(--accent-2) 6%, transparent), transparent 70%),
    var(--surface);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: clamp(28px, 5vw, 64px);
  padding-block: clamp(48px, 9vh, 96px);
}
.badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 5px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 22px;
}
.hero-copy h1 {
  font-size: clamp(34px, 5.4vw, 56px);
  font-weight: 800;
  line-height: 1.06;
}
.hero-sub {
  max-width: 44ch;
  color: var(--muted);
  font-size: clamp(16px, 1.6vw, 18px);
}
.hero-cta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.cta-note { color: var(--muted); font-size: 14px; font-weight: 500; }

/* ---------- phone mockup ---------- */
.hero-phone { display: flex; justify-content: center; }
.phone {
  width: min(300px, 78vw);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 36px;
  padding: 14px 14px 18px;
  background: var(--surface);
  box-shadow:
    0 32px 64px -24px rgba(16, 20, 24, 0.25),
    0 6px 16px rgba(16, 20, 24, 0.06);
}
.phone-notch {
  width: 92px;
  height: 8px;
  margin: 2px auto 14px;
  border-radius: 999px;
  background: var(--line);
}
.phone-chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.phone-chat-who { display: flex; flex-direction: column; text-align: left; }
.phone-chat-who strong { font-size: 14px; line-height: 1.2; }
.phone-chat-who span { font-size: 12px; color: var(--muted); }
.phone-chat {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-block: 16px;
}
.bubble {
  max-width: 85%;
  padding: 9px 13px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.45;
  text-align: left;
}
.bubble-coach {
  align-self: flex-start;
  background: var(--paper);
  border-bottom-left-radius: 6px;
}
.bubble-user {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 6px;
}
.phone-composer {
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  text-align: left;
}

/* ---------- avatars (gradient circles w/ initials — no placeholder squares) ---------- */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}
.avatar-lg { width: 52px; height: 52px; font-size: 20px; }
.avatar-maya { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.avatar-leo { background: linear-gradient(135deg, #0ea56f, #12b8c4); }
.avatar-ana { background: linear-gradient(135deg, #e5484d, #f08c3a); }

/* ---------- sections ---------- */
.section { padding-block: clamp(56px, 9vh, 88px); }
.section-alt { background: var(--paper); }
.section h2 {
  font-size: clamp(26px, 3.4vw, 36px);
  font-weight: 800;
}
.section-sub {
  margin-top: 8px;
  color: var(--muted);
}

/* ---------- coaches ---------- */
.coach-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 32px;
}
.coach-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}
.coach-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--ink) 16%, var(--line));
  box-shadow: 0 16px 32px -16px rgba(16, 20, 24, 0.18);
}
.coach-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.coach-head h3 { font-size: 19px; font-weight: 700; }
.role-chip {
  padding: 3px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}
.coach-card p { color: var(--muted); font-size: 14.5px; }

/* ---------- how it works ---------- */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 32px;
}
.step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
}
.step-icon { color: var(--accent); }
.step h3 { font-size: 17px; font-weight: 700; }
.step p { color: var(--muted); font-size: 14.5px; }

/* ---------- testimonial (Inter — no serif clash) ---------- */
.testimonial .container {
  max-width: 720px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.stars { color: #f5a623; font-size: 18px; letter-spacing: 4px; }
.testimonial blockquote {
  margin: 0;
  font-size: clamp(19px, 2.4vw, 24px);
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: -0.01em;
}
.attribution { color: var(--muted); font-size: 14.5px; }
.attribution strong { color: var(--ink); }

/* ---------- footer CTA band ---------- */
.cta-band {
  background: var(--ink);
  color: var(--surface); /* ink flips light in dark mode, so the text flips too */
  text-align: center;
  padding-block: clamp(56px, 9vh, 88px);
}
.cta-band .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.cta-band h2 { font-size: clamp(26px, 3.4vw, 36px); font-weight: 800; }
.cta-band p { color: color-mix(in srgb, var(--surface) 72%, transparent); }
.cta-band .btn { margin-top: 10px; }

/* ---------- "coming soon" modal (Download / Get the app CTAs) ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: rgba(16, 20, 24, 0.45);
}
.modal-backdrop[hidden] { display: none; }
.modal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  min-width: 220px;
  padding: 26px 28px 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 18px 50px rgba(16, 20, 24, 0.25);
}
.modal p {
  margin: 0;
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
}
.modal .btn { min-width: 120px; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 24px;
  font-size: 13.5px;
  color: var(--muted);
}
.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.footer-nav { display: flex; gap: 18px; }
.footer-nav a:hover { color: var(--ink); }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: left;
  }
  .hero-phone { order: 2; }
  .coach-grid, .steps-grid { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
  .site-nav { display: none; }         /* desktop links collapse into… */
  .nav-burger { display: inline-flex; } /* …the hamburger */
  .mobile-menu { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .coach-card, .burger-line, .mobile-menu { transition: none; }
}
