/* =========================================================
   CrapMap — landing page styles
   Cartographic "wayfinding" direction.
   ========================================================= */

:root {
  /* Color */
  --paper:  #F4F7F6;   /* cool fresh-white background (map paper) */
  --paper-2:#EAF1EF;   /* tinted band */
  --ink:    #072F4A;   /* near-navy text / dark bands */
  --ink-2:  #3D5A6C;   /* muted text */
  --teal:   #308681;   /* primary brand */
  --teal-d: #1F5E5A;   /* darker teal */
  --blue:   #2C88DF;   /* links / accents */
  --mist:   #CDDAE5;   /* surfaces, lines */
  --marker: #F2654B;   /* single warm accent: pins + emphasis */
  --white:  #FFFFFF;

  /* Type */
  --display: "Fredoka", system-ui, sans-serif;
  --body: "Hanken Grotesk", system-ui, sans-serif;
  --mono: "Space Mono", ui-monospace, monospace;

  /* Layout */
  --maxw: 1120px;
  --maxw-narrow: 760px;
  --pad: 22px;
  --radius: 18px;
  --radius-sm: 12px;
  --rail: 30px; /* reserved left rail the route line + waypoint dots live in */

  --shadow: 0 18px 44px -22px rgba(7, 47, 74, .35);
  --shadow-sm: 0 8px 20px -12px rgba(7, 47, 74, .4);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--teal); text-decoration: none; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.08; margin: 0; letter-spacing: -.01em; }
h1 em, h2 em { font-style: normal; color: var(--marker); }
p { margin: 0; }

.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad); width: 100%; }
.wrap--narrow { max-width: var(--maxw-narrow); }
/* Content inside the route's column gets a left rail so text never crosses the line */
#main .wrap { padding-left: calc(var(--pad) + var(--rail)); }
#main .download__inner { padding-left: var(--pad); } /* centered band: keep symmetric */

.skip-link {
  position: absolute; left: 12px; top: -48px;
  background: var(--ink); color: var(--white);
  padding: 10px 16px; border-radius: 8px; z-index: 100;
  transition: top .18s ease;
}
.skip-link:focus { top: 12px; }

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  font-family: var(--display); font-weight: 600;
  border-radius: 999px; padding: .8em 1.4em;
  cursor: pointer; border: 0; transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn--primary { background: var(--teal); color: var(--white); box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--teal-d); transform: translateY(-2px); }
.btn--sm { padding: .55em 1.1em; font-size: .95rem; }

/* ---------- Eyebrow (GPS coordinate label = signature device) ---------- */
.eyebrow {
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--teal-d);
  position: relative;
  margin: 0 0 1rem;
}
/* waypoint dot sits on the route line, in the left rail */
.eyebrow__dot {
  position: absolute; top: .1em;
  left: calc((var(--rail) / 2 + 6.5px) * -1);
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--marker);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--marker) 22%, transparent);
}
.eyebrow--light { color: color-mix(in srgb, var(--mist) 90%, white); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 80%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid color-mix(in srgb, var(--mist) 70%, transparent);
}
.nav__inner { display: flex; align-items: center; gap: 1rem; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: .5rem; color: var(--ink); }
.brand__pin { width: 26px; height: 26px; display: block; }
.brand__name { font-family: var(--display); font-weight: 700; font-size: 1.3rem; letter-spacing: -.02em; }
.nav__links { display: flex; gap: 1.4rem; margin-left: auto; }
.nav__links a {
  color: var(--ink-2); font-weight: 500; font-size: .96rem;
  padding: .3em 0; position: relative;
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 0;
  background: var(--marker); transition: width .2s ease;
}
.nav__links a:hover { color: var(--ink); }
.nav__links a:hover::after { width: 100%; }
.nav .btn--primary { margin-left: 0; }

/* ---------- Route line (the wayfinding spine) ---------- */
#main { position: relative; }
.route {
  position: absolute;
  top: 0;
  height: 100%;
  /* centre of the left rail, tracking the centred content column */
  left: calc(max(0px, (100% - var(--maxw)) / 2) + var(--pad) + var(--rail) / 2);
  width: 2px;
  margin-left: -1px;
  z-index: 4; /* above section background bands, in the empty rail (no text here) */
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    var(--mist) 0 7px,
    transparent 7px 16px
  );
  transform-origin: top center;
}
/* draw-in: the route grows downward on load (JS adds .is-ready) */
.is-ready .route { transform: scaleY(0); animation: route-draw 2s ease forwards .2s; }
@keyframes route-draw { to { transform: scaleY(1); } }

.hero, .section, .download { position: relative; }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.6rem;
  padding-top: clamp(2.6rem, 6vw, 5rem);
  padding-bottom: clamp(2.6rem, 6vw, 5rem);
  align-items: center;
}
.hero__copy { max-width: 36ch; }
h1 { font-size: clamp(2.5rem, 7vw, 4.1rem); margin-bottom: 1rem; }
.lede { font-size: clamp(1.05rem, 1.6vw, 1.22rem); color: var(--ink-2); max-width: 46ch; }

.stores { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.8rem 0 1.1rem; }
.stores--center { justify-content: center; }
.store {
  display: inline-flex; align-items: center; gap: .65rem;
  background: var(--ink); color: var(--white);
  padding: .6rem 1.1rem; border-radius: 14px;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  box-shadow: var(--shadow-sm);
}
.store:hover { transform: translateY(-2px); background: #0b3c5d; }
.store__glyph { width: 26px; height: 26px; fill: var(--white); flex: none; }
.store__glyph--play { fill: none; }
.store__text { display: flex; flex-direction: column; line-height: 1.05; text-align: left; }
.store__text small { font-size: .62rem; opacity: .82; letter-spacing: .04em; text-transform: uppercase; }
.store__text strong { font-family: var(--display); font-weight: 600; font-size: 1.12rem; }

.trust { font-size: .95rem; color: var(--ink-2); display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.trust strong { color: var(--ink); }
.stars { color: #F5A623; letter-spacing: .05em; }

/* ---------- Hero map card ---------- */
.hero__map { perspective: 1200px; }
.mapcard {
  position: relative;
  aspect-ratio: 5 / 4.4;
  background:
    radial-gradient(120% 120% at 70% 20%, #EAF3F1 0%, #DCEAE8 55%, #CFE0DD 100%);
  border-radius: 24px;
  border: 1px solid color-mix(in srgb, var(--mist) 80%, white);
  box-shadow: var(--shadow);
  overflow: hidden;
  rotate: 1.5deg;
}
.mapcard__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(color-mix(in srgb, var(--mist) 55%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--mist) 55%, transparent) 1px, transparent 1px);
  background-size: 46px 46px;
  opacity: .7;
}
.mapcard__road {
  position: absolute; height: 11px; border-radius: 8px;
  background: var(--white);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--mist) 80%, transparent);
}
.mapcard__road--1 { top: 38%; left: -10%; width: 130%; rotate: -8deg; }
.mapcard__road--2 { top: 12%; left: 55%; width: 90%; height: 9px; rotate: 64deg; }
.mapcard__blob {
  position: absolute; width: 46%; height: 40%; top: 56%; left: 6%;
  background: color-mix(in srgb, var(--teal) 16%, var(--white));
  border-radius: 46% 54% 60% 40% / 55% 48% 52% 45%;
  border: 1px solid color-mix(in srgb, var(--teal) 25%, transparent);
}

.pin {
  position: absolute;
  width: 22px; height: 22px;
  transform: translate(-50%, -100%);
}
.pin::before {
  content: ""; position: absolute; inset: 0;
  background: url("assets/poosvg.svg") center/contain no-repeat;
  filter: drop-shadow(0 2px 3px rgba(8,30,40,.28));
}
.pin--here { width: 26px; height: 26px; z-index: 4; }
.pin__pulse {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -10%);
  width: 26px; height: 26px; border-radius: 50%;
  background: color-mix(in srgb, var(--marker) 45%, transparent);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--marker) 45%, transparent); }
  70% { box-shadow: 0 0 0 22px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.pin__here-label {
  position: absolute; top: -30px; left: 50%; transform: translateX(-50%);
  font-family: var(--mono); font-size: .62rem; white-space: nowrap;
  background: var(--ink); color: var(--white); padding: 3px 8px; border-radius: 6px;
}
.pin__here-label::after {
  content: ""; position: absolute; left: 50%; bottom: -4px; transform: translateX(-50%) rotate(45deg);
  width: 8px; height: 8px; background: var(--ink);
}

.badge--rating {
  position: absolute; transform: translate(-50%, -50%);
  font-family: var(--mono); font-size: .68rem; font-weight: 700;
  background: var(--white); color: var(--ink);
  padding: 3px 8px; border-radius: 999px; box-shadow: var(--shadow-sm);
  border: 1px solid color-mix(in srgb, var(--mist) 80%, white);
}

.mapcard__hud {
  position: absolute; left: 14px; bottom: 14px; right: 14px;
  display: flex; align-items: center; gap: .5rem;
  background: color-mix(in srgb, var(--white) 86%, transparent);
  backdrop-filter: blur(6px);
  border: 1px solid color-mix(in srgb, var(--mist) 80%, white);
  padding: .55rem .8rem; border-radius: 12px;
  font-size: .82rem; font-weight: 600; color: var(--ink);
}
.mapcard__hud-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--teal); flex: none; }

/* pin drop animation */
.pin--drop, .pin--here { animation: drop .6s cubic-bezier(.18,.9,.32,1.2) both; }
.pin--drop:nth-of-type(odd) { animation-delay: .5s; }
.pin--drop:nth-of-type(even) { animation-delay: .7s; }
.pin--here { animation-delay: .95s; }
@keyframes drop {
  0% { opacity: 0; transform: translate(-50%, -160%); }
  100% { opacity: 1; }
}

/* ---------- Sections ---------- */
.section { padding-block: clamp(3.4rem, 8vw, 6rem); }
.section__lede { font-size: 1.12rem; color: var(--ink-2); max-width: 52ch; margin-top: .9rem; }
h2 { font-size: clamp(1.9rem, 4.4vw, 3rem); }
h3 { font-size: 1.2rem; }

.problem { background: var(--paper); }
.problem h2 { max-width: 18ch; }

.card {
  background: var(--white);
  border: 1px solid color-mix(in srgb, var(--mist) 70%, white);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

/* Problem grid */
.problem__grid {
  list-style: none; margin: 2.4rem 0 0; padding: 0;
  display: grid; gap: 1.1rem;
  grid-template-columns: 1fr;
}
.problem__item h3 { margin-bottom: .4rem; }
.problem__item p { color: var(--ink-2); }

/* How it works */
.how { background: var(--paper-2); }
.how__steps {
  list-style: none; margin: 2.6rem 0 0; padding: 0;
  display: grid; gap: 1.6rem 1.4rem;
  grid-template-columns: 1fr;
  counter-reset: step;
}
.how__step { position: relative; padding-left: 3.6rem; }
.how__num {
  position: absolute; left: 0; top: -2px;
  font-family: var(--mono); font-weight: 700; font-size: .9rem;
  width: 2.5rem; height: 2.5rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--white); color: var(--teal-d);
  border: 2px solid var(--teal);
}
.how__step h3 { margin-bottom: .3rem; }
.how__step p { color: var(--ink-2); }

/* Features */
.features__grid {
  margin-top: 2.6rem;
  display: grid; gap: 1.1rem;
  grid-template-columns: 1fr;
}
.feature__badge { display: block; width: 72px; height: 72px; margin-top: 1rem; object-fit: contain; }
.feature__stars { display: block; margin-top: 1rem; color: var(--marker); font-size: 1.15rem; letter-spacing: .12em; line-height: 1; }
.feature__quote { margin: .35rem 0 0; color: var(--ink); font-size: 1.02rem; }
.feature__quote em { font-style: italic; }
.feature__plus {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; margin-top: 1rem;
  border-radius: 50%; background: var(--teal); color: var(--white);
  font-family: var(--display); font-weight: 600; font-size: 2rem; line-height: 1;
  box-shadow: var(--shadow-sm);
}
.feature h3 { margin-bottom: .45rem; }
.feature p { color: var(--ink-2); }
.feature--wide { border-color: color-mix(in srgb, var(--teal) 28%, white); }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.1rem; }
.chip {
  font-size: .82rem; font-weight: 600;
  background: color-mix(in srgb, var(--teal) 9%, var(--white));
  color: var(--teal-d);
  border: 1px solid color-mix(in srgb, var(--teal) 22%, transparent);
  padding: .35em .8em; border-radius: 999px;
}

/* Who */
.who { background: var(--teal); color: var(--white); }
.who .eyebrow { color: color-mix(in srgb, var(--white) 78%, var(--teal)); }
.who h2 { color: var(--white); max-width: 18ch; }
.who__list {
  list-style: none; margin: 2rem 0 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: .7rem;
}
.who__list li {
  font-family: var(--display); font-weight: 500; font-size: 1.02rem;
  background: color-mix(in srgb, var(--white) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--white) 30%, transparent);
  padding: .55em 1.1em; border-radius: 999px;
}

/* FAQ */
.faq__item {
  background: var(--white);
  border: 1px solid color-mix(in srgb, var(--mist) 70%, white);
  border-radius: var(--radius-sm);
  padding: .25rem 1.3rem;
  margin-top: .8rem;
  box-shadow: var(--shadow-sm);
  max-width: var(--maxw-narrow);
}
.faq__item summary {
  cursor: pointer; list-style: none;
  font-family: var(--display); font-weight: 500; font-size: 1.08rem;
  padding: 1rem 2rem 1rem 0; position: relative;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  font-family: var(--body); font-size: 1.5rem; color: var(--teal); transition: transform .2s ease;
}
.faq__item[open] summary::after { content: "−"; }
.faq__item p { color: var(--ink-2); padding-bottom: 1.1rem; }

/* Download band */
.download { background: var(--ink); color: var(--white); text-align: center; }
.download__inner { padding-block: clamp(3.4rem, 8vw, 6rem); display: flex; flex-direction: column; align-items: center; }
.download .eyebrow { display: inline-flex; }
.download h2 { color: var(--white); font-size: clamp(2rem, 5vw, 3.2rem); }
.download__lede { color: color-mix(in srgb, var(--mist) 88%, white); max-width: 44ch; margin: 1rem 0 1.8rem; font-size: 1.1rem; }
.download .store { background: var(--white); color: var(--ink); }
.download .store:hover { background: var(--mist); }
.download .store__glyph { fill: var(--ink); }
.download .store__glyph--play { fill: none; }

/* Footer */
.footer { background: #052537; color: color-mix(in srgb, var(--mist) 75%, white); padding-block: 2.6rem; }
.footer__inner { display: flex; flex-direction: column; gap: 1.2rem; }
.brand--footer .brand__name { color: var(--white); }
.footer__links { display: flex; flex-wrap: wrap; gap: 1.2rem; }
.footer__links a { color: color-mix(in srgb, var(--mist) 85%, white); font-weight: 500; }
.footer__links a:hover { color: var(--white); }
.footer__meta { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; opacity: .8; }
.footer__coords { font-family: var(--mono); font-size: .76rem; letter-spacing: .05em; }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* ============== Responsive ============== */
@media (min-width: 600px) {
  .problem__grid { grid-template-columns: 1fr 1fr; }
  .how__steps { grid-template-columns: 1fr 1fr; }
  .features__grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 920px) {
  .hero { grid-template-columns: 1.05fr .95fr; gap: 3rem; }
  .features__grid { grid-template-columns: repeat(3, 1fr); }
  .feature--wide { grid-column: span 3; display: grid; grid-template-columns: 1.2fr 1fr; gap: 1.4rem; align-items: center; }
  .feature--wide .chips { grid-column: 2; grid-row: 1 / span 2; margin-top: 0; }
  .how__steps { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 720px) {
  .nav__links { display: none; }
}

/* ============== Reduced motion ============== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
  .route, .is-ready .route { transform: none !important; animation: none !important; }
  .pin__pulse { display: none; }
  .mapcard { rotate: 0deg; }
}
