/* Nappy Hero public pages. Tokens mirror the mobile app's "Gentle" design
   (nappy_hero_app: lib/themes/gentle_tokens.dart). No external CSS or fonts. */

@font-face {
  font-family: "Nunito";
  src: url("../fonts/Nunito-Variable.fd696212e2f0.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Luckiest Guy";
  src: url("../fonts/LuckiestGuy-Regular.f6ac3fc2e95a.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --ground: #fff7f3;
  --card: #ffffff;
  --primary: #0e6f73;
  --primary-pressed: #0a5558;
  --on-primary: #ffffff;
  --tint: #e3f1f1;
  --on-tint: #0a5558;
  --blush: #f9dce2;
  --rose: #b4405c;
  --rose-pressed: #8a2e45;
  --on-rose: #ffffff;
  --on-blush: #8a2e45;
  --ink: #2b2a33;
  --ink-body: #4a4650;
  --ink-muted: #6b6470;
  --hairline: #e3d8d3;
  --star: #8a5600;
  --shadow: 0 6px 20px rgba(43, 42, 51, 0.1);
  --shadow-soft: 0 2px 10px rgba(43, 42, 51, 0.06);

  /* Stylised map (home hero) */
  --map-land: #f6efe9;
  --map-road: #ffffff;
  --map-block: #eadfd6;
  --map-park: #cfe5c6;
  --map-boundary: #d6c4b7;
  --map-pin: #0e6f73;
  --map-pin-core: #ffffff;
  --map-you: #2f6fde;
  --map-you-ring: #ffffff;
  --map-locate-ink: #4a4650;

  /* Phone mockup: the app itself is always light, like a real screenshot. */
  --phone-bezel: #0b1415;
  --app-sheet: #fff7f3;
  --app-card: #ffffff;
  --app-ink: #2b2a33;
  --app-muted: #6b6470;
  --app-tint: #e3f1f1;
  --app-on-tint: #0a5558;
  --app-blush: #f9dce2;
  --app-primary: #0e6f73;

  --radius-card: 22px;
  --radius-pill: 999px;
  --gutter: 20px;
  --max: 1080px;
  --touch: 48px;

  --font: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-brand: "Luckiest Guy", "Nunito", system-ui, sans-serif;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #10272a;
    --card: #183739;
    --primary: #6cc9c9;
    --primary-pressed: #8ed8d8;
    --on-primary: #04302f;
    --tint: #1f4a4d;
    --on-tint: #bde7e6;
    --blush: #5a2a38;
    --rose: #f08da5;
    --rose-pressed: #f5a8ba;
    --on-rose: #3a0f1c;
    --on-blush: #f9dce2;
    --ink: #f3ece8;
    --ink-body: #ddd4d7;
    --ink-muted: #b9aeb3;
    --hairline: #2e5254;
    --star: #f0b65a;
    --shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
    --shadow-soft: 0 2px 10px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--ground);
  color: var(--ink-body);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
}

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

h1,
h2,
h3 {
  color: var(--ink);
  line-height: 1.2;
  margin: 0 0 0.5em;
  font-weight: 800;
}

h1 {
  font-size: clamp(2rem, 6.5vw, 3.25rem);
}

h2 {
  font-size: clamp(1.5rem, 4.5vw, 2rem);
}

h3 {
  font-size: 1.2rem;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--primary);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--primary-pressed);
}

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

.container {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  background: var(--primary);
  color: var(--on-primary);
  padding: 0.75rem 1rem;
  border-radius: 12px;
}

.skip-link:focus {
  top: 8px;
  color: var(--on-primary);
}

/* Header and footer */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--hairline);
}

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

.site-header__inner {
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: var(--touch);
  text-decoration: none;
}

.brand__name {
  font-family: var(--font-brand);
  font-size: 1.6rem;
  line-height: 1.1;
  color: var(--primary);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  min-width: 0;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  padding: 0 0.9rem;
  border-radius: var(--radius-pill);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.nav-links a:hover {
  background: var(--tint);
  color: var(--on-tint);
}

.nav-links a[aria-current="page"] {
  background: var(--tint);
  color: var(--on-tint);
}

/* Language switcher: plain links, flag plus short code */
.lang-switcher__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.lang-switcher__link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: var(--touch);
  min-height: var(--touch);
  padding: 0 0.6rem;
  justify-content: center;
  border-radius: var(--radius-pill);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}

.lang-switcher__link:hover,
.lang-switcher__link[aria-current] {
  background: var(--tint);
  color: var(--on-tint);
}

.site-main {
  flex: 1 0 auto;
}

.site-footer {
  border-top: 1px solid var(--hairline);
  background: var(--card);
  margin-top: 3rem;
  padding-block: 1rem;
  color: var(--ink-muted);
}

.site-footer p {
  margin: 0;
}

/* Buttons */
.button,
.store-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  border-radius: var(--radius-pill);
  font-weight: 800;
  text-decoration: none;
  background: var(--primary);
  color: var(--on-primary);
  padding: 0 1.75rem;
}

.button:hover,
.store-button:hover {
  background: var(--primary-pressed);
  color: var(--on-primary);
}

.button--rose {
  background: var(--rose);
  color: var(--on-rose);
}

.button--rose:hover {
  background: var(--rose-pressed);
  color: var(--on-rose);
}

.store-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
}

.store-button {
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  padding: 0.5rem 1.5rem;
  line-height: 1.2;
  min-width: 170px;
}

.store-button__small {
  font-size: 0.875rem;
  font-weight: 600;
}

.store-button__name {
  font-size: 1.2rem;
}

.store-button--soon {
  background: var(--tint);
  color: var(--on-tint);
  border: 2px dashed var(--primary);
}

.store-button--soon:hover {
  background: var(--tint);
  color: var(--on-tint);
}

/* Official store badges: shown unmodified, only for live store listings. The Google
   Play file carries its own clear-space padding, so its box is taller (60px) for the
   artwork to match the App Store badge's 40px. */
.store-badge {
  display: inline-flex;
  align-items: center;
  min-height: 60px;
}

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

/* Hero */
.hero {
  padding-block: 2rem 1rem;
}

.hero__inner {
  display: grid;
  gap: 2rem;
  align-items: center;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 1rem;
  padding: 0.25rem 0.9rem;
  border-radius: var(--radius-pill);
  background: var(--blush);
  color: var(--on-blush);
  font-weight: 700;
  font-size: 0.9rem;
}

.lead {
  font-size: 1.2rem;
  color: var(--ink-body);
}

.hero__art {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 280px;
}

.hero__glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(92%, 440px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--tint);
  opacity: 0.7;
}

.phone {
  position: relative;
  container-type: inline-size;
  width: min(100%, 270px);
  aspect-ratio: 9 / 18.5;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 44px;
  background: var(--phone-bezel);
  box-shadow: var(--shadow), 0 24px 48px rgba(11, 20, 21, 0.25);
}

.phone__screen {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 34px;
  background: var(--map-land);
}

.phone__notch {
  position: absolute;
  top: 3.2cqw;
  left: 50%;
  width: 26cqw;
  height: 6.5cqw;
  transform: translateX(-50%);
  border-radius: var(--radius-pill);
  background: var(--phone-bezel);
}

.sheet {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  display: grid;
  gap: 2.6cqw;
  padding: 4.2cqw 4.2cqw 5cqw;
  border-radius: 22px 22px 0 0;
  background: var(--app-sheet);
  color: var(--app-ink);
  box-shadow: 0 -4px 16px rgba(43, 42, 51, 0.12);
  font-size: 4cqw;
  line-height: 1.3;
}

.sheet p {
  margin: 0;
}

.sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sheet__title {
  font-size: 5cqw;
  font-weight: 800;
}

.sheet__more {
  padding: 1cqw 3cqw;
  border-radius: var(--radius-pill);
  background: var(--app-tint);
  color: var(--app-on-tint);
  font-size: 3.5cqw;
  font-weight: 700;
}

.sheet__card {
  display: flex;
  align-items: center;
  gap: 3cqw;
  padding: 2.6cqw;
  border-radius: 14px;
  background: var(--app-card);
  box-shadow: var(--shadow-soft);
}

.sheet__thumb {
  flex: none;
  width: 44px;
  aspect-ratio: 1;
  border-radius: 12px;
  background: var(--app-blush);
}

.sheet__text {
  flex: 1;
  min-width: 0;
}

.sheet__name {
  font-size: 4cqw;
  font-weight: 800;
}

.sheet__meta {
  color: var(--app-muted);
  font-size: 3.5cqw;
}

.sheet__chevron {
  color: var(--app-muted);
  font-size: 6cqw;
  line-height: 1;
}

.sheet__go {
  display: block;
  padding: 3cqw;
  border-radius: var(--radius-pill);
  background: var(--app-primary);
  color: #ffffff;
  font-size: 4cqw;
  font-weight: 800;
  text-align: center;
}

.map {
  display: block;
  width: 100%;
  height: 100%;
}

.map__land {
  fill: var(--map-land);
}

.map__block {
  fill: var(--map-block);
}

.map__park {
  fill: var(--map-park);
}

.map__boundary {
  fill: none;
  stroke: var(--map-boundary);
  stroke-width: 2;
  stroke-dasharray: 7 6;
}

.map__road {
  fill: none;
  stroke: var(--map-road);
  stroke-linecap: round;
}

.map__road--minor {
  stroke-width: 7;
}

.map__road--major {
  stroke-width: 14;
}

.map__pin-body {
  fill: var(--map-pin);
  stroke: var(--map-pin-core);
  stroke-width: 1.5;
}

.map__pin-core {
  fill: var(--map-pin-core);
}

.map__halo {
  fill: var(--map-you);
  opacity: 0.2;
  transform-box: fill-box;
  transform-origin: center;
}

.map__you-ring {
  fill: var(--map-you-ring);
}

.map__you {
  fill: var(--map-you);
}

.map__locate circle:first-child {
  fill: var(--map-pin-core);
}

.map__locate {
  filter: drop-shadow(0 2px 4px rgba(43, 42, 51, 0.25));
}

.map__locate-ring,
.map__locate-ticks {
  fill: none;
  stroke: var(--map-locate-ink);
  stroke-width: 2;
  stroke-linecap: round;
}

.map__locate-dot {
  fill: var(--map-locate-ink);
}

@media (prefers-reduced-motion: no-preference) {
  .map__halo {
    animation: map-pulse 2.6s ease-out infinite;
  }
}

@keyframes map-pulse {
  from {
    transform: scale(0.55);
    opacity: 0.4;
  }

  to {
    transform: scale(1.25);
    opacity: 0;
  }
}

/* Sections */
.section {
  padding-block: 2.5rem;
}

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

.section--tint h2,
.section--tint h3 {
  color: var(--on-tint);
}

.section--tint p {
  color: var(--on-tint);
}

.cards,
.steps {
  display: grid;
  gap: 1rem;
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
}

.card {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  padding: 1.5rem;
}

.card p {
  margin: 0;
}

.steps {
  counter-reset: step;
}

.steps li {
  position: relative;
  padding-left: 3.5rem;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 800;
}

.steps p {
  margin: 0;
}

.faq__item {
  border-top: 1px solid var(--hairline);
  padding-block: 1.25rem;
}

.faq__item:last-child {
  border-bottom: 1px solid var(--hairline);
}

.faq__item h3 {
  margin-top: 0;
}

.faq__item p {
  margin: 0;
  max-width: 65ch;
}

.cta {
  text-align: center;
  background: var(--blush);
  color: var(--on-blush);
  border-radius: var(--radius-card);
  padding: 2.5rem 1.5rem;
}

.cta h2,
.cta p {
  color: var(--on-blush);
}

/* Text pages (About, errors) */
.prose {
  max-width: 720px;
  padding-block: 2.5rem 0;
  overflow-wrap: anywhere;
}

.prose__icon {
  display: block;
  margin-bottom: 1rem;
}

.prose h2 {
  margin-top: 1.75rem;
}

.message {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  background: var(--tint);
  color: var(--on-tint);
}

.message--error {
  background: var(--blush);
  color: var(--on-blush);
}

@media (min-width: 720px) {
  .hero {
    padding-block: 3.5rem 2rem;
  }

  .hero__inner {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 3rem;
  }

  .hero__art {
    min-height: 380px;
  }

  .cards,
  .steps {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }

  /* Any number of feature cards fills the row (3 or 4 across). */
  .cards {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .section {
    padding-block: 4rem;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .button,
  .store-button,
  .lang-switcher__link,
  .nav-links a {
    transition: background-color 0.15s ease;
  }
}

.prose ul,
.prose ol {
  padding-left: 1.25rem;
}

.prose li {
  margin-bottom: 0.5rem;
}

.prose .toc {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}

.prose .toc ul {
  margin: 0;
  list-style: none;
  padding: 0;
  columns: 2 14rem;
}

.prose .toc li {
  margin: 0;
}

.prose .toc a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.prose h2[id] {
  scroll-margin-top: 1rem;
}


/* Leaderboard */
.prose--flush {
  padding-inline: 0;
}

.boards {
  display: grid;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.board {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  padding: 1.25rem 1rem 0.75rem;
  min-width: 0;
}

.board h2 {
  margin: 0 0 0.75rem;
  padding-inline: 0.5rem;
}

.board__sub {
  color: var(--ink-muted);
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
}

.board__table {
  width: 100%;
  border-collapse: collapse;
}

.board__table th,
.board__table td {
  padding: 0.7rem 0.5rem;
  text-align: left;
  border-top: 1px solid var(--hairline);
}

.board__table th {
  color: var(--ink-muted);
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.board__table .board__num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.board__rank {
  width: 3.5rem;
  color: var(--ink-muted);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.board__rank--top {
  color: var(--rose);
}

.board__name {
  color: var(--ink);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.board__empty {
  margin: 0;
  padding: 1rem 0.5rem 1.25rem;
  color: var(--ink-body);
}

.cta .store-buttons {
  justify-content: center;
}

@media (min-width: 720px) {
  .boards {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .board {
    padding-inline: 1.5rem;
  }
}

/* Mobile robustness: long emails/URLs and wide tables wrap or scroll inside the
   prose column instead of widening the page; table-of-contents links get a
   comfortable touch target; extra header links (e.g. language switcher) wrap. */
.prose table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

.prose th,
.prose td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--hairline);
  text-align: left;
}

@media (max-width: 480px) {
  .phone {
    width: min(100%, 250px);
  }

  .site-header__inner nav,
  .site-footer__inner nav {
    width: 100%;
  }

  .nav-links a {
    padding-inline: 0.75rem;
  }
}
