/* Ridge website — shared styles.
   Tokens mirror the Ridge Brand Guide (25 Sep 2026), which mirrors the app's Ridge Colours asset catalog. */

:root {
  --bg: #F7F9FB;          /* RidgeBackground */
  --bg2: #ECEFF3;         /* RidgeBackground2 (Surface) */
  --fill: #E0E4EB;        /* RidgeSecondaryButton (Fill) */
  --text: #12161C;        /* RidgeText */
  --text2: #223044;       /* RidgeText2 */
  --outline: #989898;     /* RidgeOutline */
  --primary: #46A1DE;     /* RidgePrimaryButton */
  --on-primary: #12161C;  /* text on blue: always dark (6.4:1 light, 4.6:1 dark) */
  --success: #69B261;
  --danger: #F14A3F;
  --line: rgba(34, 48, 68, 0.15);
  --shadow: rgba(0, 0, 0, 0.2);
  --footer-bg: #12161C;
  --footer-text: #F5F7FA;
  --footer-text2: #B9C3D1;

  /* Run difficulty and map: fixed in both themes, only ever used for their meaning */
  --run-novice: #4FBD0F;
  --run-easy: #0A78DC;
  --run-intermediate: #FF1903;
  --run-advanced: #000000;
  --lift: #7D8DDE;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", system-ui, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", system-ui, sans-serif;

  --r-button: 12px;
  --r-card: 16px;
  --r-sheet: 24px;
  --r-panel: 32px;

  --wrap: 1200px;
  --gutter: 24px;
  color-scheme: light;
}

/* Light is the default for everyone. Dark only applies when the visitor picks it with the header toggle. */
:root[data-theme="dark"] {
  --bg: #12161C;
  --bg2: #1E252F;
  --fill: #333841;
  --text: #F5F7FA;
  --text2: #DDE4EE;
  --outline: #7C7C7C;
  --primary: #2E86C1;
  --success: #57934E;
  --danger: #E0303B;
  --line: rgba(221, 228, 238, 0.15);
  --shadow: rgba(0, 0, 0, 0.5);
  --footer-bg: #0B0E12;
  color-scheme: dark;
}
.icon-d { display: none; }
:root[data-theme="dark"] .icon-l { display: none; }
:root[data-theme="dark"] .icon-d { display: block; }

.theme-toggle {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--fill); color: var(--text); border: 0; cursor: pointer;
}
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .moon { display: block; }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
.theme-toggle:not(.ready) { visibility: hidden; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); text-wrap: balance; }
p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 4px; }
.plus { color: var(--primary); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: calc(var(--wrap) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }

.h1 { font-size: clamp(38px, 5.2vw, 60px); font-weight: 700; line-height: 1.06; letter-spacing: -0.025em; }
.h2 { font-size: clamp(30px, 3.6vw, 44px); font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.lede { color: var(--text2); font-size: clamp(17px, 1.4vw, 19px); max-width: 46ch; margin-top: 20px; }

/* ---------- Buttons and links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: var(--r-button);
  font: 600 16px/1.2 var(--font); text-decoration: none; border: 0; cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.btn:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-secondary { background: var(--fill); color: var(--text); }

.link { font-weight: 600; font-size: 16px; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.link:hover { text-decoration-color: var(--primary); }

.cta-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 16px; margin-top: 32px; }
.cta-row .or { color: var(--text2); font-size: 15px; }

/* App Store badge (stand-in; swap for Apple's official badge artwork before launch, see README) */
.appstore {
  display: inline-flex; align-items: center; gap: 10px;
  height: 52px; padding: 0 18px 0 14px; border-radius: 12px;
  background: #000; color: #fff; text-decoration: none;
  border: 1px solid #A6A6A6;
  transition: transform 0.15s ease;
}
.appstore:hover { transform: translateY(-1px); }
.appstore svg { width: 26px; height: 26px; fill: #fff; flex: none; }
.appstore span { display: flex; flex-direction: column; line-height: 1.05; }
.appstore small { font-size: 11px; font-weight: 500; letter-spacing: 0.01em; }
.appstore b { font-size: 21px; font-weight: 600; letter-spacing: -0.01em; }
.appstore.sm { height: 44px; padding: 0 14px 0 12px; }
.appstore.sm svg { width: 22px; height: 22px; }
.appstore.sm b { font-size: 18px; }
.appstore.sm small { font-size: 10px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
}
.site-header .wrap { display: flex; align-items: center; gap: 20px; height: 72px; }
.site-header .nav { margin-right: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -0.02em; }
.brand img { width: 34px; height: 34px; border-radius: 8px; }
.nav { display: flex; gap: 28px; margin-left: auto; }
.nav a { text-decoration: none; font-weight: 500; font-size: 16px; color: var(--text2); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }
.nav a[aria-current="page"] { font-weight: 600; }
.site-header .btn { padding: 10px 16px; font-size: 15px; }

/* ---------- Hero ---------- */
.hero { padding-top: 16px; }
.hero-card {
  position: relative;
  background: var(--bg2);
  border-radius: var(--r-panel);
  padding: clamp(40px, 6vw, 88px) clamp(24px, 5vw, 72px);
  display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: 40px;
  min-height: 560px;
}
/* Two phones side by side, never overlapping, so every screenshot is fully visible */
.hero-art { position: relative; display: flex; justify-content: center; align-items: flex-start; gap: clamp(14px, 3vw, 32px); padding-block: 36px 24px; }
.hero-art .device { width: min(46%, 240px); }
.hero-art .device.a { transform: rotate(-3deg); }
.hero-art .device.b { margin-top: 56px; transform: rotate(3deg); }
/* Aspen sits off the phone's bottom-left corner, clear of the tab bar */
.hero-art .aspen { position: absolute; width: 30%; left: -32%; bottom: -7%; transform: rotate(10deg); }
.hero-art .float { position: absolute; right: 0; top: 0; }

/* ---------- Phone mock ---------- */
/* The frame wraps the full screenshot (923×2000, iPhone proportions): nothing is cropped or scaled to fit.
   Corner radii use container units so they match the iPhone screen at any size. */
.device { position: relative; container-type: inline-size; }
.phone {
  position: relative;
  background: #12161C;
  padding: 7px;
  border-radius: calc(13.5cqw + 5px);
  box-shadow: 0 24px 48px -16px rgba(18, 22, 28, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}
.phone > img { display: block; width: 100%; height: auto; border-radius: calc(13.5cqw - 2px); }
/* Dynamic Island, over the blanked status bar */
.phone::after {
  content: ""; position: absolute; left: 50%; transform: translateX(-50%);
  top: calc(7px + 2.6cqw); width: 30cqw; height: 8.6cqw; border-radius: 999px; background: #000;
}

/* ---------- Placeholder image slots ---------- */
.ph {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: var(--fill);
  border: 1.5px dashed var(--outline);
  color: var(--text2);
  text-align: center; padding: 16px;
  font-size: 13px; line-height: 1.35; font-weight: 500;
}
.ph svg { width: 28px; height: 28px; stroke: currentColor; fill: none; stroke-width: 1.6; opacity: 0.7; }
.ph span { max-width: 26ch; text-wrap: balance; }
.ph b { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; }

/* ---------- Feature rows ---------- */
.feature { padding-block: clamp(72px, 10vw, 136px); }
.feature .wrap { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: clamp(40px, 7vw, 112px); }
.feature.flip .copy { order: 2; }
.feature .copy { max-width: 520px; }
.feature.flip .copy { justify-self: end; }
.media { position: relative; max-width: 440px; width: 100%; justify-self: center; }
.media > .ph, .media > img { aspect-ratio: 4 / 5; border-radius: var(--r-sheet); width: 100%; height: auto; object-fit: cover; }
.media .accent { position: absolute; width: 84px; transform: rotate(10deg); }

/* Floating Ridge UI — stands in for komoot's hand-drawn annotations */
.float {
  position: absolute; z-index: 2;
  background: var(--bg); color: var(--text);
  border-radius: var(--r-card);
  box-shadow: 0 4px 8px var(--shadow), 0 16px 40px -12px var(--shadow);
}
.float.stat { width: 300px; padding: 16px; right: -48px; bottom: 40px; }
.float.stat h4 { font-size: 17px; font-weight: 600; margin-bottom: 12px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; gap: 2px; }
.stats b { display: block; font-size: 17px; font-weight: 700; }
.stats span { display: block; font-size: 12px; color: var(--text2); font-weight: 500; }

.float.steps { width: 290px; padding: 8px 16px; left: -56px; bottom: 56px; }
.rw { display: flex; align-items: center; gap: 12px; padding-block: 8px; }
.rw + .rw { border-top: 1px solid var(--line); }
.rw .bar { width: 5px; align-self: stretch; border-radius: 3px; flex: none; }
.rw .t { flex: 1; min-width: 0; }
.rw .t b { display: block; font-weight: 600; font-size: 15px; line-height: 1.3; }
.rw .t span { font-size: 12px; font-weight: 500; color: var(--text2); }
.rw .n { font-size: 12px; font-weight: 600; color: var(--text2); font-variant-numeric: tabular-nums; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 22%, var(--bg));
  border: 1px solid var(--outline);
  font-size: 13px; font-weight: 600; color: var(--text);
}
.float.pill { border-radius: 999px; }
.pill svg { width: 15px; height: 15px; }

/* Placement over real photos: keep people in the shot visible */
.float.stat.at-bl { right: auto; left: -48px; bottom: 40px; }
.float.steps.at-tl { bottom: auto; top: 40px; }

.float.toast { display: inline-flex; align-items: center; gap: 8px; padding: 12px 16px; font-weight: 500; font-size: 15px; white-space: nowrap; }
.toast svg { width: 20px; height: 20px; color: var(--primary); flex: none; }

svg.i { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Ridge+ ---------- */
.plus-card {
  background: var(--bg2); border-radius: var(--r-panel);
  padding: clamp(40px, 6vw, 80px) clamp(24px, 5vw, 72px);
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center;
}
.wordmark { font-size: clamp(44px, 5vw, 60px); font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.plus-card .sub { font-size: 20px; font-weight: 600; margin-top: 12px; }
.features { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 4px; max-width: 460px; }
.features li { display: flex; align-items: center; gap: 14px; padding: 10px 0; font-weight: 500; }
.features li + li { border-top: 1px solid var(--line); }
.features .ic { width: 36px; height: 36px; border-radius: 50%; background: var(--bg); display: grid; place-items: center; flex: none; color: var(--primary); }
.features .ic svg { width: 18px; height: 18px; }
.features .ic.green { color: var(--success); }
.features .ic.red { color: var(--danger); }
.passes { margin-top: 24px; color: var(--text2); max-width: 46ch; }
.fine { margin-top: 12px; font-size: 13px; color: var(--text2); max-width: 52ch; }
.plus-art { position: relative; justify-self: center; width: min(100%, 280px); }

/* ---------- Closing CTA band ---------- */
.band { padding-block: clamp(72px, 10vw, 128px); }
.band-card {
  background: var(--bg2); border-radius: var(--r-panel);
  padding: 40px clamp(24px, 5vw, 64px);
  display: flex; align-items: center; gap: 32px; flex-wrap: wrap;
  max-width: 980px; margin-inline: auto;
}
.band-card .aspen { width: 76px; transform: rotate(10deg); flex: none; }
.band-card .copy { flex: 1 1 320px; }
.band-card h2 { font-size: clamp(24px, 2.6vw, 32px); font-weight: 700; letter-spacing: -0.015em; line-height: 1.15; }
.band-card p { color: var(--text2); margin-top: 6px; font-size: 16px; }

/* ---------- Page hero (support, legal) ---------- */
.page-hero { padding-block: clamp(48px, 7vw, 88px) clamp(24px, 4vw, 40px); }
.page-hero .lede { max-width: 56ch; }

/* ---------- Support ---------- */
.support-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: clamp(40px, 6vw, 88px); align-items: start; padding-bottom: clamp(72px, 10vw, 128px); }
.faq h2 { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 8px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 0; font-weight: 600; font-size: 18px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; width: 10px; height: 10px; flex: none; margin-right: 4px;
  border-right: 2px solid var(--text2); border-bottom: 2px solid var(--text2);
  transform: translateY(-3px) rotate(45deg); transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.faq .answer { padding: 0 0 22px; color: var(--text2); display: grid; gap: 12px; max-width: 64ch; }
.faq .answer ul { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.faq .answer a { color: var(--text); font-weight: 600; }

.contact-card {
  position: sticky; top: 96px;
  background: var(--bg2); border-radius: var(--r-sheet);
  padding: 28px 24px; display: grid; gap: 14px;
}
.contact-card .aspen { width: 64px; transform: rotate(10deg); }
.contact-card h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.contact-card p { color: var(--text2); font-size: 16px; }
.contact-card .btn { justify-self: start; }
.contact-card .mail { font-weight: 600; word-break: break-all; }
.contact-card hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; width: 100%; }
.contact-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 16px; }

/* ---------- Legal ---------- */
.seg { display: inline-flex; gap: 4px; padding: 4px; margin-top: 28px; background: var(--fill); border-radius: var(--r-button); }
.seg a { padding: 8px 16px; border-radius: 9px; font-weight: 600; font-size: 15px; text-decoration: none; color: var(--text); }
.seg a:hover { background: var(--bg); }

.legal-layout { display: grid; grid-template-columns: 240px minmax(0, 720px); gap: clamp(40px, 6vw, 96px); align-items: start; padding-bottom: clamp(72px, 10vw, 128px); }
.toc { position: sticky; top: 96px; max-height: calc(100vh - 120px); overflow: auto; font-size: 14px; padding-right: 8px; }
.toc h2 { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text2); margin: 0 0 10px; }
.toc h2:not(:first-child) { margin-top: 28px; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.toc a { display: block; padding: 5px 10px; border-radius: 8px; color: var(--text2); text-decoration: none; line-height: 1.35; }
.toc a:hover { background: var(--bg2); color: var(--text); }

.doc + .doc { margin-top: 88px; padding-top: 72px; border-top: 1px solid var(--line); }
.doc > h2 { font-size: clamp(28px, 3vw, 36px); font-weight: 700; letter-spacing: -0.02em; }
.doc .updated { color: var(--text2); font-size: 15px; margin-top: 6px; }
.doc section { margin-top: 40px; }
.doc h3 { font-size: 21px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 12px; }
.doc h4 { font-size: 17px; font-weight: 600; margin: 22px 0 8px; }
.doc p { color: var(--text2); margin-top: 10px; }
.doc ul { color: var(--text2); margin: 10px 0 0; padding-left: 22px; display: grid; gap: 6px; }
.doc li::marker { color: var(--outline); }
.doc a { color: var(--text); font-weight: 600; }
.doc section, .doc h4 { scroll-margin-top: 96px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--footer-bg); color: var(--footer-text); padding-block: 64px 32px; margin-top: 0; }
.site-footer .brand { color: var(--footer-text); }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 40px; margin-top: 36px; }
.foot-grid h3 { font-size: 15px; font-weight: 600; margin-bottom: 14px; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.foot-grid a { color: var(--footer-text2); text-decoration: none; font-size: 15px; }
.foot-grid a:hover { color: var(--footer-text); text-decoration: underline; }
.foot-grid p { color: var(--footer-text2); font-size: 15px; max-width: 32ch; }
.social { display: inline-flex; align-items: center; gap: 10px; }
.social svg { width: 20px; height: 20px; }
.foot-base {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: 56px; padding-top: 24px; border-top: 1px solid rgba(245, 247, 250, 0.14);
  color: var(--footer-text2); font-size: 13px;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-card, .plus-card { grid-template-columns: 1fr; }
  .hero-art { max-width: 540px; width: 100%; margin-inline: auto; }
  .feature .wrap { grid-template-columns: 1fr; }
  .feature .media { order: -1; }
  .feature.flip .copy { order: 0; justify-self: start; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .support-layout { grid-template-columns: 1fr; }
  .support-layout .contact-card { position: static; order: -1; }
  .legal-layout { grid-template-columns: 1fr; }
  .toc { display: none; }
  .plus-art { margin-top: 8px; }
}

@media (max-width: 640px) {
  :root { --gutter: 16px; }
  body { font-size: 17px; }
  .site-header .wrap { height: 60px; gap: 16px; }
  .site-header .btn { display: none; }
  .site-header .wrap { gap: 12px; }
  .nav { gap: 14px; margin-right: 0; }
  .contact-card .aspen { width: 48px; }
  .theme-toggle { width: 34px; height: 34px; }
  .nav a { font-size: 15px; }
  .brand { font-size: 20px; }
  .brand img { width: 30px; height: 30px; }
  .hero-card { min-height: 0; border-radius: var(--r-sheet); }
  .hero-art { padding-block: 8px 16px; }
  .hero-art .device.b { margin-top: 36px; }
  .hero-art .aspen { width: 24%; left: -21%; bottom: -6%; }
  .hero-art .float { display: none; }
  .float.stat { width: auto; left: 16px; right: 16px; bottom: -28px; }
  .float.stat.at-bl { left: 16px; right: 16px; }
  .float.steps.at-tl { top: 16px; bottom: auto; }
  .float.steps { width: auto; left: 16px; right: 16px; bottom: -40px; }
  .float.toast { right: 16px !important; left: auto !important; }
  .media { margin-bottom: 28px; }
  .media .accent { width: 64px; }
  .plus-card, .band-card { border-radius: var(--r-sheet); }
  .foot-grid { grid-template-columns: 1fr; gap: 32px; }
}

@media print {
  .site-header, .site-footer, .toc, .seg, .theme-toggle { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .legal-layout { display: block; padding: 0; }
  .doc p, .doc ul { color: #000; }
  .doc + .doc { break-before: page; border: 0; margin: 0; padding: 0; }
}

@media (max-width: 400px) {
  .site-header .brand-name { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .appstore, .faq summary::after { transition: none; }
}
