/* ============================================================
   Nordquest — marketing site stylesheet
   Design tokens mirror the app's "Wilderness" design system:
   nordquest_app/lib/src/design_system/foundations/
   ============================================================ */

/* ---------- Fonts (self-hosted, latin subset) ---------- */
@font-face {
  font-family: 'Young Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/young-serif.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/space-grotesk-var.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-500.woff2') format('woff2');
}

/* ---------- Design tokens ---------- */
:root {
  /* core palette */
  --cream: #F5EBE2;
  --body-bg: #EFEBE3;
  --surface-lifted: #FBF7F1;
  --deep-teal: #0B4A5C;
  --deep-teal-2: #0F5B70;
  --deep-ink: #093846;
  --ink: #1B2A2F;
  --lime: #DAF080;
  --mint: #A3F0C4;
  --ice: #BFF1F5;
  /* app token is #6B7F84; darkened for WCAG 4.5:1 on cream backgrounds */
  --muted: #54676D;
  --coral: #DD5050;
  --hairline: rgba(11, 74, 92, 0.078);
  --hairline-strong: rgba(11, 74, 92, 0.161);

  /* progress greens (app heatmap ramp) */
  --green-1: #C5E892;
  --green-2: #56B870;
  --green-3: #2E8857;
  --green-4: #0E5F4A;

  /* hero gradient = app login screen */
  --hero-gradient: radial-gradient(120% 90% at 50% 0%, #11657A 0%, #0B4A5C 55%, #073746 100%);

  /* type */
  --font-display: 'Young Serif', Georgia, serif;
  --font-body: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* shape */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  /* spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--body-bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--deep-ink);
  margin: 0;
}

p {
  margin: 0;
}

a {
  color: var(--deep-teal);
}

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

.container {
  width: min(1080px, 100% - 48px);
  margin-inline: auto;
}

/* ---------- Wordmark (matches the app login screen) ---------- */
.wordmark {
  font-family: var(--font-display);
  letter-spacing: -0.5px;
}
.wordmark .q {
  font-style: italic;
  color: var(--lime);
}

/* ---------- Hero ---------- */
.hero {
  background: var(--hero-gradient);
  color: var(--cream);
  overflow: hidden;
  padding: 48px 0 0;
}

.hero .container {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: var(--space-xl);
}

.hero__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 28px;
  color: var(--cream);
  margin-bottom: 56px;
}

.brand-icon {
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(245, 235, 226, 0.18);
}

.brand-icon--sm {
  border-radius: 7px;
}

.hero__text {
  padding-bottom: 72px;
}

.hero h1 {
  font-size: clamp(38px, 5.2vw, 58px);
  line-height: 1.04;
  letter-spacing: -1px;
  color: var(--cream);
  margin-bottom: var(--space-lg);
  text-wrap: balance;
}

.hero__sub {
  font-size: 18px;
  line-height: 1.55;
  color: rgba(245, 235, 226, 0.84);
  max-width: 44ch;
  margin-bottom: var(--space-xl);
  text-wrap: pretty;
}

/* ---------- Store badges ---------- */
.badges {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* Equal heights, Apple first; ¼-height clear space comes from the gap+padding */
.badges img {
  height: 54px;
  width: auto;
}

/* ---------- Phone mockup (CSS frame, screenshot as <img>) ---------- */
.phone-stage {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  min-height: 480px;
}

.phone {
  position: relative;
  width: min(290px, 74vw);
  aspect-ratio: 390 / 844;
  padding: 10px;
  background: linear-gradient(135deg, #3a3f44, #0c0e10 40%);
  border-radius: 52px;
  box-shadow:
    inset 0 0 2px 1px rgba(255, 255, 255, 0.18),
    0 1px 2px rgba(7, 55, 70, 0.25),
    0 8px 20px rgba(7, 55, 70, 0.28),
    0 24px 60px rgba(7, 55, 70, 0.35);
}

.phone__screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 42px;
  overflow: hidden;
  background: var(--deep-ink);
}

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

/* hero arrangement: main phone tilted, second peeking behind */
.hero .phone-stage {
  padding-top: 32px;
}

.hero .phone--main {
  transform: rotate(-3.5deg);
  z-index: 2;
  margin-bottom: -56px; /* sinks into the section edge */
  left: -30px; /* off-center so the back phone shows more */
}

.hero .phone--back {
  position: absolute;
  right: max(-64px, calc(50% - 344px));
  bottom: -110px;
  transform: rotate(5deg) scale(0.92);
  z-index: 1;
  opacity: 0.96;
}

/* ---------- Sections ---------- */
.section {
  padding: 96px 0;
}

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

/* ---------- Feature blocks ---------- */
.feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(32px, 6vw, 80px);
  padding: 56px 0;
}

.feature:nth-child(even) .feature__media {
  order: -1;
}

.feature__kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--lime);
  display: inline-block;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-md);
}

.feature h2 {
  font-size: clamp(28px, 3.4vw, 38px);
  line-height: 1.08;
  margin-bottom: var(--space-md);
}

.feature p {
  font-size: 17px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 46ch;
}

.feature__media {
  display: flex;
  justify-content: center;
}

.feature .phone {
  width: min(260px, 70vw);
}

/* ---------- Stat strip ---------- */
.stats {
  border-top: 1px solid var(--hairline-strong);
  border-bottom: 1px solid var(--hairline-strong);
  background: var(--surface-lifted);
}

.stats .container {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: clamp(24px, 6vw, 80px);
  flex-wrap: wrap;
  padding-top: 48px;
  padding-bottom: 48px;
}

.stat {
  text-align: center;
}

.stat__num {
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 44px);
  color: var(--deep-ink);
  line-height: 1.1;
}

.stat__label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 6px;
}

/* ---------- Coming soon ---------- */
.coming {
  padding: 56px 0 8px;
  text-align: center;
}

.coming__label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--lime);
  display: inline-block;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
}

.coming__chips {
  list-style: none;
  margin: var(--space-md) 0 0;
  padding: 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

/* ghost chips: not collectable yet */
.coming__chips li {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--deep-teal);
  background: var(--surface-lifted);
  border: 1px solid var(--hairline-strong);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
}

.coming__note {
  margin-top: var(--space-md);
  font-size: 15px;
  color: var(--muted);
}

/* ---------- Final CTA ---------- */
.cta {
  text-align: center;
}

.cta h2 {
  font-size: clamp(32px, 4.4vw, 46px);
  margin-bottom: var(--space-md);
}

.cta p {
  color: var(--muted);
  font-size: 17px;
  margin-bottom: var(--space-xl);
}

.cta .badges {
  justify-content: center;
}

/* ---------- Footer ---------- */
.footer {
  background: var(--deep-ink);
  color: rgba(245, 235, 226, 0.75);
  padding: 48px 0;
  font-size: 14px;
}

.footer .container {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  color: var(--cream);
}

.footer__links {
  display: flex;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.footer a {
  color: var(--cream);
  text-decoration-color: rgba(245, 235, 226, 0.4);
  text-underline-offset: 3px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
}

.footer__legal {
  font-size: 12px;
  line-height: 1.7;
  color: rgba(245, 235, 226, 0.74);
}

/* ============================================================
   Utility pages (confirm / reset / privacy)
   ============================================================ */

.page-dark {
  background: var(--hero-gradient);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

.card {
  background: var(--surface-lifted);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  width: 100%;
  max-width: 460px;
}

.card h1 {
  font-size: 26px;
  line-height: 1.2;
  margin-bottom: var(--space-md);
  text-align: center;
}

.card p {
  color: var(--muted);
  text-align: center;
  margin-bottom: var(--space-sm);
}

.card .form {
  margin-top: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card label {
  font-size: 14px;
  font-weight: 600;
  color: var(--deep-ink);
  display: block;
  margin-bottom: 6px;
}

.card input {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  outline: none;
}

.card input:focus {
  border: 1.5px solid var(--deep-teal);
}

.button {
  font: inherit;
  font-weight: 600;
  background: var(--ink);
  color: var(--lime);
  border: 0;
  border-radius: var(--radius-lg);
  min-height: 52px;
  padding: 0 24px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.button:disabled {
  opacity: 0.5;
  cursor: default;
}

.error-text,
.card p.error-text {
  color: var(--coral);
  font-size: 14px;
  text-align: center;
}

.hidden {
  display: none !important;
}

/* ---------- Privacy page ---------- */
.prose-page {
  background: var(--body-bg);
}

.prose {
  width: min(760px, 100% - 48px);
  margin-inline: auto;
  padding: 48px 0 96px;
}

.prose__home {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  font-weight: 600;
  text-decoration: none;
  color: var(--deep-teal);
  margin-bottom: var(--space-lg);
}

.prose h1 {
  font-size: clamp(30px, 4vw, 40px);
  margin-bottom: var(--space-sm);
}

.prose .updated {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: var(--space-xl);
}

.prose h2 {
  font-size: 22px;
  margin: var(--space-xl) 0 var(--space-sm);
  scroll-margin-top: 24px;
}

.prose p,
.prose li {
  color: var(--ink);
  line-height: 1.65;
  margin-bottom: var(--space-sm);
}

.prose ul {
  padding-left: 22px;
  margin: var(--space-sm) 0;
}

.prose .legal-footer {
  margin-top: 64px;
  padding-top: var(--space-lg);
  border-top: 1px solid var(--hairline-strong);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  text-align: center;
}

/* ============================================================
   Motion — CSS-only scroll entrances, fully gated
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .feature .phone,
    .stat {
      animation: rise-in both;
      animation-timeline: view();
      animation-range: entry 0% entry 70%;
    }
  }

  .hero .phone--main {
    animation: hero-phone-in 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(36px);
  }
}

@keyframes hero-phone-in {
  from {
    opacity: 0;
    transform: rotate(-3.5deg) translateY(48px);
  }
  to {
    opacity: 1;
    transform: rotate(-3.5deg) translateY(0);
  }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 860px) {
  .hero .container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero__brand {
    margin-bottom: 36px;
    justify-content: center;
  }

  .hero__text {
    padding-bottom: 0;
  }

  .hero__sub {
    margin-inline: auto;
  }

  .hero .badges {
    justify-content: center;
  }

  .hero .phone-stage {
    min-height: 0;
    padding-top: 48px;
  }

  .hero .phone--back {
    display: none;
  }

  .hero .phone--main {
    margin-bottom: -64px;
    left: 0; /* back phone is hidden — recenter */
  }

  .hero {
    padding-bottom: 0;
  }

  .feature {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 40px 0;
  }

  .feature:nth-child(even) .feature__media {
    order: 0;
  }

  .feature p {
    margin-inline: auto;
  }

  .section {
    padding: 72px 0;
  }
}

@media (max-width: 420px) {
  .badges img {
    height: 48px;
  }
}
