/* ============================================================
   PENDIO — promotional site
   Light theme, matched to the Pendio app design tokens.
   Two semantic accents only: orange = up/strain, blue = down.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Helvetica, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color .5s ease, color .5s ease;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---------- shared scale ---------- */
:root {
  --maxw: 1160px;
  --pad: clamp(20px, 5vw, 64px);
  --r: 18px;
  --r-lg: 26px;
  --tab: tabular-nums;
}

/* ============================================================
   THEME — light (matches the Pendio app)
   ============================================================ */
:root {
  --bg: #F2F2F7;
  --bg2: #FFFFFF;
  --surface: #FFFFFF;
  --surface2: #ECECF1;
  --ink: #101013;
  --muted: rgba(60,60,67,0.62);
  --faint: rgba(60,60,67,0.34);
  --line: rgba(60,60,67,0.13);
  --line-strong: rgba(60,60,67,0.22);
  --climb: #C4501A;
  --climb-deep: #A8420F;
  --descent: #3F6DC2;
  --descent-deep: #2B4D8F;
  --climb-soft: rgba(196,80,26,0.12);
  --descent-soft: rgba(63,109,194,0.12);
  --climb-fill: rgba(196,80,26,0.22);
  --descent-fill: rgba(63,109,194,0.22);
  --terrain-fill: rgba(60,70,90,0.10);
  --terrain-line: #8A93A3;
  --card-shadow: 0 1px 3px rgba(20,20,30,0.05), 0 14px 36px -18px rgba(20,30,50,0.16);
  --frame-border: 1px solid rgba(60,60,67,0.12);
  --frame-glow: 0 18px 50px -24px rgba(20,30,50,0.22);
  --btn-bg: var(--climb);
  --btn-ink: #ffffff;
  --topo-color: rgba(60,80,120,0.05);
  --hero-vignette: radial-gradient(120% 90% at 70% 0%, rgba(196,80,26,0.06), transparent 55%), radial-gradient(90% 80% at 10% 100%, rgba(63,109,194,0.06), transparent 60%);
  --eyebrow-ink: var(--climb);
  --h1: clamp(2.7rem, 6.4vw, 5.4rem);
  --h2: clamp(2rem, 4.2vw, 3.4rem);
  --lead: clamp(1.12rem, 1.7vw, 1.4rem);
}

/* ============================================================
   TYPE
   ============================================================ */
.eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--eyebrow-ink);
  margin: 0 0 1.1rem;
  display: inline-flex; align-items: center; gap: 0.55em;
}
.eyebrow::before {
  content: ""; width: 22px; height: 2px; background: currentColor; opacity: .8;
}
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.03em; text-wrap: balance; line-height: 1.04; }
h1 { font-size: var(--h1); }
h2 { font-size: var(--h2); line-height: 1.06; }
h3 { font-size: clamp(1.3rem, 2.2vw, 1.7rem); letter-spacing: -0.02em; line-height: 1.15; }
.lead { font-size: var(--lead); line-height: 1.5; color: var(--muted); margin: 1.3rem 0 0; max-width: 40ch; text-wrap: pretty; }
p { line-height: 1.55; }
.tnum { font-variant-numeric: tabular-nums; }
.up { color: var(--climb); }
.down { color: var(--descent); }



/* ============================================================
   LAYOUT
   ============================================================ */
.wrap { max-width: var(--maxw); margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); }
section { position: relative; }
.section-pad { padding-top: clamp(72px, 11vw, 150px); padding-bottom: clamp(72px, 11vw, 150px); }

/* topo background texture */
.topo {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    repeating-radial-gradient(circle at 30% 20%, transparent 0 38px, var(--topo-color) 38px 39px);
  opacity: 1; -webkit-mask-image: linear-gradient(180deg, transparent, #000 25%, #000 75%, transparent);
          mask-image: linear-gradient(180deg, transparent, #000 25%, #000 75%, transparent);
}

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  background: color-mix(in srgb, var(--bg) 74%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; font-size: 1.18rem; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; }
.brand svg { display: block; }
.nav-links { display: flex; align-items: center; gap: 1.8rem; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 0.95rem; font-weight: 500; transition: color .2s; }
.nav-links a:hover { color: var(--ink); }
@media (max-width: 720px) { .nav-links a.navlink { display: none; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  font: inherit; font-weight: 600; font-size: 0.98rem;
  padding: 0.72em 1.3em; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--btn-bg); color: var(--btn-ink);
  text-decoration: none; letter-spacing: -0.01em;
  transition: transform .15s ease, filter .2s ease, box-shadow .2s ease;
  box-shadow: 0 8px 24px -10px color-mix(in srgb, var(--climb) 70%, transparent);
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn:active { transform: translateY(0); }
.btn.ghost {
  background: transparent; color: var(--ink);
  border: 1px solid var(--line-strong); box-shadow: none;
}
.btn.ghost:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.btn.sm { padding: 0.55em 1.05em; font-size: 0.92rem; }

/* ============================================================
   HERO
   ============================================================ */
.hero { position: relative; overflow: hidden; padding-top: clamp(40px, 7vw, 80px); padding-bottom: clamp(56px, 9vw, 120px); }
.hero::before { content: ""; position: absolute; inset: 0; background: var(--hero-vignette); pointer-events: none; z-index: 0; }
.hero .wrap { position: relative; z-index: 1; }
.hero-grid { display: grid; grid-template-columns: 1fr; gap: clamp(36px, 5vw, 64px); align-items: center; }
@media (min-width: 940px) { .hero-grid { grid-template-columns: 1.02fr 1.18fr; } }
.hero-copy { max-width: 620px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 2rem; align-items: center; }
.hero-note { margin: 1rem 0 0; font-size: 0.86rem; color: var(--faint); }

/* inline email form */
.signup { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.signup input[type="email"] {
  font: inherit; font-size: 0.98rem; padding: 0.72em 1.05em; min-width: 0; flex: 1 1 220px;
  border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.signup input[type="email"]::placeholder { color: var(--faint); }
.signup input[type="email"]:focus { border-color: var(--climb); box-shadow: 0 0 0 3px var(--climb-soft); }
.signup.ok input { border-color: var(--descent); }

/* ============================================================
   PROFILE CARD (interactive hero visual)
   ============================================================ */
.profile-card {
  position: relative; background: var(--surface); border-radius: var(--r-lg);
  border: var(--frame-border); box-shadow: var(--frame-glow);
  padding: clamp(18px, 2.4vw, 26px); overflow: hidden;
}
.profile-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 0.4rem; }
.profile-title { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.profile-peak { font-size: 0.84rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.profile-svg-wrap { position: relative; width: 100%; touch-action: none; }
.profile-svg { width: 100%; height: auto; display: block; cursor: crosshair; }
.profile-svg .ridge-line { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--terrain-line) 50%, transparent)); }

.scrub-readout {
  position: absolute; top: 6px; left: 0; transform: translateX(-50%);
  background: var(--ink); color: var(--bg);
  padding: 0.3em 0.6em; border-radius: 8px; font-size: 0.74rem; font-weight: 600;
  font-variant-numeric: tabular-nums; white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity .15s; box-shadow: 0 6px 18px -6px rgba(0,0,0,.5);
}
.profile-svg-wrap.active .scrub-readout { opacity: 1; }

.profile-foot { display: flex; flex-direction: column; gap: 0; margin-top: 0.5rem; }
.seg-row {
  display: flex; align-items: center; gap: 0.7rem; padding: 0.7rem 0.1rem;
  border-top: 1px solid var(--line); font-size: 0.95rem;
}
.seg-row .dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.seg-row .label { font-weight: 600; }
.seg-row .val { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.profile-stats { display: flex; flex-wrap: wrap; gap: 1.4rem 2rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.pstat .k { font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); font-weight: 700; }
.pstat .v { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.pstat .v .u { font-size: 0.8rem; color: var(--muted); font-weight: 600; }

/* ============================================================
   FEATURE ROWS
   ============================================================ */
.feature { display: grid; grid-template-columns: 1fr; gap: clamp(32px, 5vw, 70px); align-items: center; }
@media (min-width: 900px) {
  .feature { grid-template-columns: 1fr 1fr; }
  .feature.flip .feature-media { order: -1; }
}
.feature-copy { max-width: 30em; }
.feature-copy h2 { margin-bottom: 0.2rem; }
.feature-copy p { color: var(--muted); font-size: var(--lead); line-height: 1.5; margin: 1.1rem 0 0; }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.6rem; }
.chip {
  font-size: 0.82rem; font-weight: 600; padding: 0.42em 0.85em; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); color: var(--muted);
}
.chip.up { color: var(--climb); border-color: color-mix(in srgb, var(--climb) 35%, var(--line)); background: var(--climb-soft); }
.chip.down { color: var(--descent); border-color: color-mix(in srgb, var(--descent) 35%, var(--line)); background: var(--descent-soft); }

/* media frames for screenshots */
.shot {
  display: block; border-radius: 22px; border: var(--frame-border);
  box-shadow: var(--frame-glow); background: var(--surface); overflow: hidden;
}
.shot img { display: block; width: 100%; height: auto; }
.media-center { display: flex; justify-content: center; }
.shot.narrow { max-width: 360px; width: 100%; }
.shot.card-crop { max-width: 440px; width: 100%; }

/* phone frame — pinned to the elevation hero; gently pans on hover */
.phone {
  position: relative; width: 300px; max-width: 78vw; margin: 0 auto;
  border-radius: 46px; padding: 12px; background: var(--surface2);
  border: var(--frame-border); box-shadow: var(--frame-glow);
}
.phone::before {
  content: ""; position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
  width: 92px; height: 26px; border-radius: 16px; background: rgba(0,0,0,0.4); z-index: 3;
}

.phone-screen { position: relative; border-radius: 36px; overflow: hidden; height: 560px; background: #F2F2F7; }
.phone-screen img { width: 100%; display: block; }
.phone-screen::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 90px;
  background: linear-gradient(transparent, var(--surface2));
}
.phone-scroll { transform: translateY(0); transition: transform 7s linear; }
.phone:hover .phone-scroll { transform: translateY(calc(-100% + 560px)); }
@media (prefers-reduced-motion: reduce), (hover: none) { .phone:hover .phone-scroll { transform: translateY(0); } }

/* ============================================================
   METRIC STAT STRIP
   ============================================================ */
.statstrip {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
}
@media (min-width: 640px) { .statstrip { grid-template-columns: repeat(4, 1fr); } }
.statstrip .cell { background: var(--surface); padding: 1.4rem 1.2rem; }
.statstrip .cell .k { font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); font-weight: 700; }
.statstrip .cell .v { font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin-top: 0.3rem; }
.statstrip .cell .v .u { font-size: 0.62em; color: var(--muted); font-weight: 600; margin-left: 2px; }

/* ============================================================
   SECTION HEADERS
   ============================================================ */
.section-head { max-width: 36ch; margin-bottom: clamp(36px, 5vw, 64px); }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; max-width: min(92vw, 680px); }
.section-head .lead { margin-left: auto; margin-right: auto; }
/* statement band: a long sentence needs a real measure, not a skinny column */
.section-head.statement { max-width: min(94vw, 780px); }
.section-head.statement h2 { font-size: clamp(2.1rem, 4.6vw, 3.5rem); line-height: 1.05; }
.section-head.statement .lead { max-width: 42ch; }
.band { background: var(--bg2); }
.band-line { border-top: 1px solid var(--line); }

/* ============================================================
   PRIVACY
   ============================================================ */
.privacy-card {
  background: var(--surface); border: var(--frame-border); border-radius: var(--r-lg);
  box-shadow: var(--card-shadow); padding: clamp(32px, 5vw, 60px);
  display: grid; gap: clamp(28px,4vw,48px); grid-template-columns: 1fr; align-items: center;
}
@media (min-width: 820px) { .privacy-card { grid-template-columns: auto 1fr; } }
.privacy-card .lock { width: 84px; height: 84px; border-radius: 24px; background: var(--surface2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--descent); }
.privacy-steps { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.4rem; }
.privacy-steps .step { font-size: 0.86rem; color: var(--muted); display: flex; align-items: center; gap: 0.5rem; }
.privacy-steps .step + .step::before { content: "→"; color: var(--faint); margin-right: 0.5rem; }

/* ============================================================
   CTA / SIGNUP BLOCK
   ============================================================ */
.cta-block { text-align: center; }
.cta-block .signup { max-width: 460px; margin: 2rem auto 0; }
.cta-block .hero-note { text-align: center; }

/* ============================================================
   FAQ
   ============================================================ */
.faq { max-width: 760px; margin: 0 auto; }
.faq details {
  border-top: 1px solid var(--line); padding: 0.4rem 0;
}
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding: 1.2rem 0; font-weight: 600; font-size: 1.1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; letter-spacing: -0.01em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .plus { flex: none; width: 22px; height: 22px; position: relative; transition: transform .25s; }
.faq summary .plus::before, .faq summary .plus::after { content: ""; position: absolute; background: var(--muted); border-radius: 2px; }
.faq summary .plus::before { top: 50%; left: 0; right: 0; height: 2px; transform: translateY(-50%); }
.faq summary .plus::after { left: 50%; top: 0; bottom: 0; width: 2px; transform: translateX(-50%); transition: opacity .25s; }
.faq details[open] summary .plus::after { opacity: 0; }
.faq details[open] summary .plus { transform: rotate(180deg); }
.faq .ans { color: var(--muted); line-height: 1.6; padding: 0 0 1.4rem; max-width: 64ch; font-size: 1.02rem; }
.faq .ans a { color: var(--climb); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { border-top: 1px solid var(--line); padding: clamp(40px,6vw,64px) 0; }
.footer .wrap { display: flex; flex-wrap: wrap; gap: 1.4rem 2rem; align-items: center; justify-content: space-between; }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--ink); }
.footer .links { display: flex; gap: 1.6rem; flex-wrap: wrap; font-size: 0.92rem; }
.footer .strava { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; color: var(--faint); font-weight: 600; letter-spacing: 0.02em; }
.footer .strava .sb { background: #FC4C02; color: #fff; padding: 0.15em 0.5em; border-radius: 5px; font-size: 0.72rem; }

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1 !important; transform: none !important; } }

/* ============================================================
   POLISH
   ============================================================ */
::selection { background: var(--climb-soft); color: var(--ink); }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible {
  outline: 2px solid var(--climb); outline-offset: 2px; border-radius: 6px;
}
.hero-caption {
  margin: 0.9rem 0 0; text-align: center; font-size: 0.8rem; color: var(--faint);
  letter-spacing: 0.01em;
}
.hero-caption .up { color: var(--climb); font-weight: 600; }
.hero-caption .down { color: var(--descent); font-weight: 600; }

/* tighten the very top of the hero on phones, keep the profile breathing */
@media (max-width: 600px) {
  .hero { padding-top: 18px; }
  .profile-stats { gap: 1rem 1.4rem; }
  .pstat .v { font-size: 1.25rem; }
  .nav .wrap { height: 58px; }
}

/* the marker dot should not block the drag on touch */
.profile-svg .marker { pointer-events: none; }
