/* ==========================================================================
   RidgeReader — outdoor nav tech
   Brand tokens are all in :root. Change them here, not in the markup.
   ========================================================================== */

:root {
  /* Brand — sampled from the logo SVGs */
  --rr-red:        #d74d43;
  --rr-orange:     #dc6d49;
  --rr-orange-lit: #e59550;
  --rr-yellow:     #ffd23f;
  --rr-green:      #6cb558;

  /* Slope-angle legend. Separate from the brand palette on purpose: these
     represent measured steepness bands, so they track the app's output ramp
     rather than the brand. Values sampled from the app's own rendered output
     (iphone_RMNP_result_RidgeReader.png), not from the brand palette. */
  --slope-white:  #ffffff;
  --slope-yellow: #fbea4e;
  --slope-orange: #f3aa3c;
  --slope-red:    #ea3423;
  --slope-purple: #72147f;
  --slope-blue:   #0000d5;
  --slope-black:  #000000;

  /* Surfaces — --ink matches the phone-mockup background exactly (#090e18),
     which is what lets the mockups sit on the dark sections seamlessly. */
  --ink:      #090e18;
  --ink-2:    #111a2b;
  --ink-3:    #1b2740;
  --paper:    #ffffff;
  --paper-2:  #f4f6f9;

  --text-on-dark:      #ffffff;
  --text-on-dark-soft: #a9b4c7;
  --text-on-light:     #161c26;
  --text-on-light-soft:#5a6675;

  --border-dark:  rgba(255, 255, 255, 0.14);
  --border-light: rgba(15, 23, 38, 0.12);

  --font-display: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body:    "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --wrap:    1200px;
  --wrap-sm: 780px;
  --radius:  14px;

  --pad-section: clamp(4.5rem, 10vw, 8.5rem);
}

/* ---------- Reset / base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--text-on-dark);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }

a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--rr-orange-lit);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 2.5rem);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--paper);
  color: var(--text-on-light);
  padding: 0.75rem 1.25rem;
  z-index: 200;
  font-weight: 600;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

/* ---------- Shared type ---------- */

.eyebrow {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--rr-orange-lit);
  margin-bottom: 1.1rem;
}

.section-title {
  font-size: clamp(2rem, 4.6vw, 3.25rem);
}

.lede {
  font-size: clamp(1.05rem, 1.7vw, 1.3rem);
  line-height: 1.6;
  color: var(--text-on-dark-soft);
  max-width: 46ch;
}

.section--light .lede { color: var(--text-on-light-soft); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  padding: 0.95rem 1.85rem;
  border-radius: 999px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, background-color 0.18s ease,
              border-color 0.18s ease, color 0.18s ease;
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: linear-gradient(100deg, var(--rr-red), var(--rr-orange-lit));
  color: #fff;
  box-shadow: 0 8px 26px rgba(215, 77, 67, 0.32);
}
.btn--primary:hover { box-shadow: 0 12px 32px rgba(215, 77, 67, 0.42); }

.btn--ghost {
  border-color: var(--border-dark);
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(6px);
}
.btn--ghost:hover { background: rgba(255, 255, 255, 0.13); }

.btn--sm { padding: 0.65rem 1.35rem; font-size: 0.85rem; }

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  padding-block: 1.1rem;
  transition: background-color 0.3s ease, border-color 0.3s ease,
              padding 0.3s ease, backdrop-filter 0.3s ease;
  border-bottom: 1px solid transparent;
}

.site-header.is-stuck {
  background: rgba(9, 14, 24, 0.88);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--border-dark);
  padding-block: 0.7rem;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-header__logo img {
  height: clamp(30px, 4.4vw, 42px);
  width: auto;
  transition: height 0.3s ease;
}
.site-header.is-stuck .site-header__logo img { height: 30px; }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  min-height: clamp(600px, 96svh, 900px);
  display: flex;
  align-items: flex-end;
  padding-block: 8rem clamp(3.5rem, 8vw, 6rem);
  overflow: hidden;
  isolation: isolate;
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* The asset itself is already cropped down to the ridge, so only a slight
     downward bias is needed to keep the shading clear of the headline. */
  object-position: 50% 72%;
}

/* Two overlays: a vertical scrim for text legibility, and a warm brand wash.
   Kept light so the shading stays vivid; the headline leans on its own
   text-shadow rather than on a heavy wash. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to bottom,
      rgba(9, 14, 24, 0.42) 0%,
      rgba(9, 14, 24, 0.12) 26%,
      rgba(9, 14, 24, 0.44) 60%,
      rgba(9, 14, 24, 0.78) 86%,
      var(--ink) 100%),
    linear-gradient(115deg,
      rgba(215, 77, 67, 0.10) 0%,
      rgba(9, 14, 24, 0) 55%);
}

.hero__inner { max-width: 900px; }

.hero h1 {
  font-size: clamp(2.6rem, 7.2vw, 5.4rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  margin-bottom: 1.4rem;
  /* Carries the legibility load now that the scrim is light. Kept as a soft
     glow rather than a hard edge, which would muddy the gradient-filled word. */
  text-shadow: 0 2px 24px rgba(9, 14, 24, 0.75);
}

.hero__tagline {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.4vw, 1.6rem);
  font-weight: 500;
  color: #e6ebf3;
  margin-bottom: 2.4rem;
  max-width: 34ch;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  align-items: center;
}

.hero__note {
  font-size: 0.9rem;
  color: var(--text-on-dark-soft);
  margin-top: 1.5rem;
}

/* ==========================================================================
   Generic sections
   ========================================================================== */

.section { padding-block: var(--pad-section); }

.section--light {
  background: var(--paper);
  color: var(--text-on-light);
}

.section--tint { background: var(--ink-2); }

/* Separates two consecutive --ink sections. They can't be tinted apart:
   the phone mockups only disappear against --ink exactly. */
.section--divided { border-top: 1px solid var(--border-dark); }

.section__head { max-width: 62ch; margin-bottom: clamp(2.5rem, 5vw, 4rem); }

/* ---------- Product: photo in / analysis out ---------- */

.showcase__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1rem, 4vw, 3rem);
  align-items: center;
  margin-top: clamp(2rem, 5vw, 3.5rem);
}

/* Top-aligned so the phones stay level when one caption wraps to two lines
   and the other doesn't — happens at ~390px. The grid keeps align-items:
   center so the arrow between them stays vertically centred. */
.shot {
  text-align: center;
  align-self: start;
}

/* Full mockup, uncropped — the whole phone including the bottom bezel. */
.shot__frame {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
}

.shot__frame img {
  width: 100%;
  height: auto;
  display: block;
}

.shot__label {
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-on-dark-soft);
  margin-top: 1.1rem;
}

.shot__label .dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 0.5rem;
  vertical-align: middle;
}
.dot--in  { background: var(--text-on-dark-soft); }
.dot--out { background: var(--rr-orange); }

.showcase__arrow {
  display: none;
  place-items: center;
  color: var(--rr-orange);
}

@media (min-width: 900px) {
  .showcase__grid { grid-template-columns: 1fr auto 1fr; }
  .showcase__arrow { display: grid; }
}

/* Side by side on a phone left each mockup ~167px wide — too small to make
   out the app UI, which is the whole point of showing them. Stacking roughly
   doubles them; the arrow rotates to keep the before/after reading order. */
@media (max-width: 700px) {
  .showcase__grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    max-width: 360px;
    margin-inline: auto;
  }

  .showcase__arrow {
    display: grid;
    transform: rotate(90deg);
  }

  .showcase__arrow svg { width: 32px; height: 32px; }
}

/* ---------- Slope scale ---------- */

.scale {
  margin-top: clamp(3rem, 6vw, 5rem);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 3.5vw, 2.5rem);
  background: rgba(255, 255, 255, 0.03);
}

.scale__title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.scale__sub {
  font-size: 0.92rem;
  color: var(--text-on-dark-soft);
  margin-bottom: 1.6rem;
}

.scale__bands {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 0.4rem;
}

/* Labels are pure black rather than the site's near-black: it takes the red
   band from 4.46:1 to 5.01:1, which passes AA at any text size. That's what
   allows the smaller mobile sizing below. */
.band {
  border-radius: 9px;
  padding: 0.8rem 0.4rem;
  text-align: center;
  border: 1px solid transparent;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.band--1 { background: var(--slope-white);  color: #000; }
.band--2 { background: var(--slope-yellow); color: #000; }
.band--3 { background: var(--slope-orange); color: #000; }
.band--4 { background: var(--slope-red);    color: #000; }
.band--5 { background: var(--slope-purple); color: #fff; }
.band--6 { background: var(--slope-blue);   color: #fff; }

/* Near-black on a near-black section: without an edge this band would read
   as a hole in the row rather than a color. */
.band--7 {
  background: var(--slope-black);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

/* The legend is supporting detail, not a headline — on a phone it was taking
   more vertical space than the mockups it explains. */
@media (max-width: 700px) {
  .scale { padding: 1.15rem 1rem 1.25rem; margin-top: 2.5rem; }
  .scale__title { font-size: 0.95rem; }
  .scale__sub { font-size: 0.82rem; margin-bottom: 1rem; }

  .scale__bands {
    grid-template-columns: repeat(auto-fit, minmax(62px, 1fr));
    gap: 0.3rem;
  }

  .band {
    font-size: 0.8rem;
    padding: 0.45rem 0.2rem;
    border-radius: 6px;
  }
}

/* ==========================================================================
   How it works
   ========================================================================== */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: clamp(1.75rem, 4vw, 3rem);
  counter-reset: step;
}

.step {
  position: relative;
  padding-top: 2.25rem;
  border-top: 2px solid var(--border-light);
  counter-increment: step;
}

.step::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  top: -0.25rem;
  left: 0;
  transform: translateY(-100%);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--rr-orange);
}

/* Source icons are white-on-black with a hard square edge; the tile makes
   that read as deliberate rather than as a stray black rectangle. */
.step__icon {
  width: 64px;
  height: 64px;
  object-fit: contain;
  background: var(--ink);
  border-radius: 15px;
  padding: 11px;
  margin-bottom: 1.35rem;
}

.step h3 {
  font-size: 1.3rem;
  margin-bottom: 0.65rem;
}

.step p {
  color: var(--text-on-light-soft);
  font-size: 1rem;
}

.step__optional {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-on-light-soft);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  margin-left: 0.5rem;
  vertical-align: 3px;
}

/* ==========================================================================
   Waitlist
   ========================================================================== */

.waitlist { background: var(--ink-2); }

.waitlist__inner {
  max-width: var(--wrap-sm);
  margin-inline: auto;
  text-align: center;
}

.waitlist__form {
  margin-top: 2.5rem;
  text-align: left;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 560px) {
  .field-row { grid-template-columns: 1fr; }
}

.field { margin-bottom: 1rem; }

.field label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-on-dark-soft);
  margin-bottom: 0.5rem;
}

.field input[type="text"],
.field input[type="email"] {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid var(--border-dark);
  border-radius: 10px;
  padding: 0.9rem 1.05rem;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.field input::placeholder { color: rgba(169, 180, 199, 0.6); }

.field input:focus {
  outline: none;
  border-color: var(--rr-orange);
  background: rgba(255, 255, 255, 0.1);
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  font-size: 0.95rem;
  color: var(--text-on-dark-soft);
  margin: 1.25rem 0 1.75rem;
  cursor: pointer;
}

.check input {
  margin-top: 0.28rem;
  width: 18px;
  height: 18px;
  accent-color: var(--rr-orange);
  flex-shrink: 0;
}

.waitlist .btn--primary { width: 100%; }

.form-note {
  font-size: 0.85rem;
  color: var(--text-on-dark-soft);
  text-align: center;
  margin-top: 1.25rem;
}

.form-note a { color: var(--rr-orange-lit); }

.form-status {
  margin-top: 1.25rem;
  padding: 0.9rem 1.1rem;
  border-radius: 10px;
  font-size: 0.95rem;
  text-align: center;
}
.form-status[hidden] { display: none; }
.form-status--ok {
  background: rgba(108, 181, 88, 0.16);
  border: 1px solid rgba(108, 181, 88, 0.45);
  color: #c9ecc0;
}
.form-status--err {
  background: rgba(215, 77, 67, 0.16);
  border: 1px solid rgba(215, 77, 67, 0.45);
  color: #f4c3bf;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.site-footer__media { position: absolute; inset: 0; z-index: -2; }

.site-footer__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to bottom,
    rgba(9, 14, 24, 0.72) 0%,
    rgba(9, 14, 24, 0.9) 55%,
    var(--ink) 100%);
}

.site-footer__lead {
  padding-block: clamp(5rem, 11vw, 9rem) clamp(3rem, 6vw, 4.5rem);
  text-align: center;
}

.site-footer__lead h2 {
  font-size: clamp(2rem, 5.5vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.site-footer__bar {
  border-top: 1px solid var(--border-dark);
  padding-block: 2.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.75rem 2.5rem;
  align-items: center;
  justify-content: space-between;
}

.site-footer__bar img { height: 34px; width: auto; }

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  font-size: 0.92rem;
  color: var(--text-on-dark-soft);
}

.footer-meta a { text-decoration: none; }
.footer-meta a:hover { color: var(--rr-orange-lit); }

.footer-tagline {
  font-family: var(--font-display);
  font-weight: 600;
  color: #fff;
}

.site-footer__legal {
  border-top: 1px solid var(--border-dark);
  padding-block: 1.5rem 2.5rem;
  font-size: 0.82rem;
  color: var(--text-on-dark-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
}

/* ==========================================================================
   Legal pages (privacy)
   ========================================================================== */

.doc {
  padding-block: clamp(8rem, 16vw, 11rem) clamp(4rem, 8vw, 6rem);
  max-width: 72ch;
}

.doc h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); margin-bottom: 0.6rem; }
.doc h2 { font-size: 1.3rem; margin: 2.75rem 0 0.75rem; }
.doc p, .doc li { color: var(--text-on-dark-soft); }
.doc p { margin-bottom: 1rem; }
.doc ul { padding-left: 1.25rem; margin-bottom: 1rem; }
.doc li { margin-bottom: 0.4rem; }
.doc a { color: var(--rr-orange-lit); }
.doc__updated { font-size: 0.9rem; color: var(--text-on-dark-soft); }

/* ==========================================================================
   Scroll-in animation
   ========================================================================== */

/* The hidden state is scoped to .js, which an inline script in <head> sets.
   Without JS the content is simply visible — it never depends on the
   observer having run. */
.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; }
}
