/* Grigri's landing page, in the app's mountain colors (specs/theme.md). */
:root {
  --night: #161a16;
  --surface: #1f241e;
  --surface-high: #2a3028;
  --olive: #8f9b5d;
  --moss: #6f9468;
  --pine: #3f5c45;
  --sand: #e2d3b3;
  --tan: #b9936a;
  --granite: #9aa09a;
  --sky: #86b8dc;
  --clay: #d9826b;
  --snow: #ece6d6;
  --line: rgba(236, 230, 214, 0.12);
  --radius: 20px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { margin: 0; }

body {
  background: var(--night);
  color: var(--snow);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--sky); }

h1, h2, h3 { color: var(--sand); margin: 0; line-height: 1.1; letter-spacing: -0.02em; }

/* The top bar, over the hero */
.bar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px clamp(16px, 4vw, 48px);
}
.bar-end { justify-content: flex-end; }
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--sand);
  font-weight: 800;
  font-size: 1.35rem;
  text-decoration: none;
}
.brand img { border-radius: 8px; }

/* Buttons */
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  border: 0;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.pill:hover { transform: translateY(-1px); }
.pill:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }
.pill-google {
  background: var(--olive);
  color: var(--night);
  font-size: 1.1rem;
  min-height: 56px;
  padding: 0 28px 0 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.pill-google:hover { background: #a3b06a; }
.pill-google .g {
  width: 40px;
  height: 40px;
  padding: 8px;
  background: #fff;
  border-radius: 50%;
}
.pill-ghost {
  background: rgba(22, 26, 22, 0.55);
  color: var(--snow);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.pill-ghost:hover { background: var(--surface-high); }

/* The hero: a crag edge to edge, the pitch and a swiping card */
.hero {
  position: relative;
  min-height: min(100svh, 860px);
  display: flex;
  align-items: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 70% 20%, rgba(134, 184, 220, 0.18), transparent 60%),
    linear-gradient(160deg, var(--pine), var(--night) 70%);
}
.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: drift 30s ease-in-out infinite alternate;
}
.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(22, 26, 22, 0.92) 0%, rgba(22, 26, 22, 0.55) 55%, rgba(22, 26, 22, 0.25) 100%),
    linear-gradient(0deg, var(--night) 0%, transparent 35%);
}
.hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 96px clamp(16px, 4vw, 48px) 64px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  align-items: center;
}
.hero h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); font-weight: 800; margin: 16px 0; }
.lead { font-size: clamp(1.1rem, 2vw, 1.35rem); color: var(--snow); max-width: 34ch; margin: 0 0 32px; }
.fine { color: var(--granite); margin: 16px 0 0; font-size: 0.95rem; }

/* The demo deck: a plan card that swipes right, Tinder-style */
.deck { position: relative; justify-self: center; width: min(340px, 80vw); aspect-ratio: 3 / 4.2; }
.card {
  position: absolute;
  inset: 0 0 72px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  overflow: hidden;
  background: linear-gradient(160deg, var(--surface-high), var(--surface));
}
.card-back { transform: rotate(-5deg) scale(0.95); opacity: 0.7; }
.card-top {
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  animation: swipe 6s ease-in-out infinite;
  transform-origin: 50% 110%;
}
.card-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card-info {
  position: absolute;
  inset: auto 0 0;
  padding: 48px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: linear-gradient(0deg, rgba(22, 26, 22, 0.95), transparent);
}
.card-info strong { color: var(--sand); font-size: 1.6rem; }
.card-info .who { color: var(--granite); font-size: 0.9rem; }
.stamp {
  position: absolute;
  top: 24px;
  left: 20px;
  padding: 4px 12px;
  border: 3px solid var(--olive);
  border-radius: 8px;
  color: var(--olive);
  font-weight: 900;
  font-size: 1.6rem;
  letter-spacing: 0.1em;
  transform: rotate(-14deg);
  opacity: 0;
  animation: stamp 6s ease-in-out infinite;
}
.deck-actions {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  justify-content: center;
  gap: 28px;
}
.round {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 1.5rem;
  font-weight: 900;
}
.round-no { color: var(--clay); }
.round-yes { color: var(--olive); animation: press 6s ease-in-out infinite; }

/* Each loop starts with the card off screen, so the script can bring in
   the next plan on animationiteration, unseen. */
@keyframes swipe {
  0% { transform: scale(0.95); opacity: 0; }
  14%, 69% { transform: none; opacity: 1; }
  84% { transform: translateX(8%) rotate(6deg); opacity: 1; }
  99% { transform: translateX(140%) rotate(24deg); opacity: 0; }
  100% { transform: scale(0.95); opacity: 0; }
}
@keyframes stamp { 0%, 69% { opacity: 0; } 79%, 96% { opacity: 1; } 100% { opacity: 0; } }
@keyframes press { 0%, 74% { transform: none; } 80% { transform: scale(1.18); background: var(--pine); } 88%, 100% { transform: none; } }
@keyframes drift { from { transform: scale(1.04); } to { transform: scale(1.12) translateX(-2%); } }

/* Sections */
section:not(.hero) {
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px clamp(16px, 4vw, 48px);
}
h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); font-weight: 800; }
.note { color: var(--granite); margin: 6px 0 0; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

/* Crags near me: a row of photo cards, Airbnb-style */
.strip {
  list-style: none;
  margin: 0 calc(-1 * clamp(16px, 4vw, 48px));
  padding: 4px clamp(16px, 4vw, 48px) 16px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(240px, 300px);
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: clamp(16px, 4vw, 48px);
  scrollbar-width: thin;
}
.strip:empty { display: none; }
.crag { scroll-snap-align: start; }
.crag-photo {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-high);
  border: 1px solid var(--line);
}
.crag-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.crag:hover .crag-photo img { transform: scale(1.05); }
.crag-dist {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(22, 26, 22, 0.75);
  color: var(--snow);
  font-size: 0.85rem;
  font-weight: 700;
  backdrop-filter: blur(6px);
}
.crag-name { display: block; margin-top: 10px; color: var(--sand); font-weight: 700; font-size: 1.05rem; }
.crag-area { display: block; color: var(--granite); font-size: 0.9rem; }
.crag-credit { display: block; margin-top: 2px; color: var(--granite); font-size: 0.75rem; }
.crag-credit a { color: inherit; }

/* How it works */
.steps {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.steps li {
  padding: 24px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  counter-increment: step;
}
.step-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 16px;
  border-radius: 16px;
  background: var(--pine);
  font-size: 1.6rem;
}
.steps h3 { font-size: 1.25rem; margin-bottom: 6px; }
.steps h3::before { content: counter(step) ". "; color: var(--olive); }
.steps p { margin: 0; color: var(--granite); }

/* Free */
.free {
  text-align: center;
}
.free h2 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.checks {
  list-style: none;
  margin: 28px auto 20px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
.checks li {
  padding: 10px 18px 10px 14px;
  border-radius: 999px;
  background: var(--surface-high);
  border: 1px solid var(--line);
  font-weight: 600;
}
.checks li::before { content: "✓"; color: var(--olive); font-weight: 900; margin-right: 8px; }
.free .note { max-width: 56ch; margin: 0 auto; }

/* The last call */
section.final {
  text-align: center;
  margin-bottom: 32px;
  padding-top: 64px;
  padding-bottom: 64px;
  border-radius: 28px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(143, 155, 93, 0.25), transparent 70%),
    var(--surface);
  border: 1px solid var(--line);
  max-width: calc(1200px - 2 * clamp(16px, 4vw, 48px));
}
.final h2 { max-width: 22ch; margin: 0 auto 28px; }

.foot {
  padding: 24px clamp(16px, 4vw, 48px) 40px;
  text-align: center;
  color: var(--granite);
  font-size: 0.85rem;
}
.foot p { margin: 4px 0; }

/* Phones: the pitch first, then a smaller deck */
@media (max-width: 820px) {
  .hero-inner { grid-template-columns: 1fr; padding-top: 88px; gap: 40px; }
  .hero-shade {
    background: linear-gradient(0deg, var(--night) 0%, rgba(22, 26, 22, 0.75) 50%, rgba(22, 26, 22, 0.5) 100%);
  }
  .deck { width: min(280px, 72vw); }
  .steps { grid-template-columns: 1fr; }
  section.final { margin-left: 16px; margin-right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
