/* AreaCalc GPS website: the app's colors (dark field green, black, yellow accents). */
:root {
  --green: #22382a;
  --green-deep: #172619;
  --black: #000000;
  --card: #1c1c1e;
  --card-raised: #2c2c2e;
  --line: #3a3a3c;
  --yellow: #ffd60a;
  --white: #ffffff;
  --text: #e5e5ea;
  --muted: #aeaeb2;
  --faint: #8e8e93;
  --blue: #0a84ff;
  --radius: 16px;
  --max: 1080px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

/* Hidden means hidden, even on elements styled with their own display (e.g. .button). */
[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  /* Links to a section (#pro, #support, a feature card…) stop below the sticky header, not under it. */
  scroll-padding-top: 64px;
}

body {
  margin: 0;
  background: var(--black);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  /* The footer sits at the bottom of the window even on short pages. */
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

body > main {
  flex: 1 0 auto;
}

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

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

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(23, 38, 25, 0.92);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  text-decoration: none;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.3px;
  white-space: nowrap;
}

.brand img {
  width: 32px;
  height: 32px;
}

.pro {
  color: var(--yellow);
}

.nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav a {
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
}

.nav a:hover {
  color: var(--white);
}

.nav a.button,
.nav a.button:hover {
  color: #1c1c1e;
}

.nav .nav-optional {
  display: none;
}

/* Narrow phones: just the brand and the download button. */
@media (max-width: 420px) {
  .nav .nav-wide {
    display: none;
  }
}

@media (min-width: 720px) {
  .nav .nav-optional {
    display: inline;
  }
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 14px;
  background: var(--yellow);
  color: #1c1c1e;
  font-weight: 700;
  font-size: 17px;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  white-space: nowrap;
}

.button:hover {
  filter: brightness(1.05);
}

.button.is-current {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}

.button.small {
  min-height: 38px;
  padding: 0 16px;
  font-size: 15px;
  border-radius: 10px;
}

.button.secondary {
  background: var(--card-raised);
  color: var(--white);
}

/* Hero */
.hero {
  background: radial-gradient(120% 90% at 50% 0%, #2d4a37 0%, var(--green) 45%, var(--green-deep) 100%);
  text-align: center;
  padding: 40px 0 64px;
}

.hero .mark {
  width: 80px;
  height: 80px;
  margin: 0 auto 14px;
}

.hero h1 {
  margin: 0;
  color: var(--white);
  font-size: clamp(36px, 8vw, 60px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -1.5px;
}

.hero .tagline {
  margin: 16px auto 0;
  max-width: 560px;
  color: var(--text);
  font-size: clamp(18px, 3.5vw, 21px);
}

.hero .actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
}

.hero .note {
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
}

.platforms {
  color: var(--muted);
  font-size: 14px;
  margin-top: 6px;
}

/* Sections */
section {
  padding: 72px 0;
}

section + section {
  border-top: 1px solid #111;
}

.section-title {
  margin: 0 0 8px;
  color: var(--white);
  font-size: clamp(28px, 5vw, 38px);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.8px;
}

.section-lead {
  margin: 0 0 36px;
  color: var(--muted);
  max-width: 640px;
}

.grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .grid.three {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px;
  border: 1.5px solid transparent;
}

.card.highlight {
  border-color: var(--yellow);
  background: rgba(255, 214, 10, 0.07);
}

.card h3 {
  margin: 14px 0 6px;
  color: var(--white);
  font-size: 19px;
  font-weight: 700;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.icon {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: var(--card-raised);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--yellow);
}

.icon svg {
  width: 24px;
  height: 24px;
}

.tag {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--yellow);
  color: #1c1c1e;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  vertical-align: 3px;
}

/* How it works */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
  counter-reset: step;
}

@media (min-width: 800px) {
  .steps {
    grid-template-columns: repeat(4, 1fr);
  }
}

.steps li {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 16px;
  background: var(--card-raised);
  color: var(--yellow);
  font-weight: 800;
  margin-bottom: 12px;
}

.steps strong {
  display: block;
  color: var(--white);
  margin-bottom: 4px;
}

.steps span {
  color: var(--muted);
  font-size: 16px;
}

/* Plans */
.plans {
  display: grid;
  gap: 14px;
}

@media (min-width: 760px) {
  .plans {
    grid-template-columns: 1fr 1fr;
  }
}

.plan h3 {
  margin: 0 0 4px;
}

.plan ul {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.plan li {
  position: relative;
  padding-left: 28px;
  margin: 8px 0;
  color: var(--text);
}

.plan li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 7px;
  width: 12px;
  height: 7px;
  border-left: 2.5px solid var(--yellow);
  border-bottom: 2.5px solid var(--yellow);
  transform: rotate(-45deg);
}

.plan .price {
  color: var(--muted);
  font-size: 15px;
}

/* Support */
.faq {
  display: grid;
  gap: 10px;
}

.faq details {
  background: var(--card);
  border-radius: 14px;
  padding: 0 20px;
}

.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 0;
  color: var(--white);
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  color: var(--yellow);
  font-weight: 700;
  font-size: 22px;
  line-height: 1;
}

.faq details[open] summary::after {
  content: "−";
}

.faq details p,
.faq details ol,
.faq details ul {
  margin: 0 0 18px;
  color: var(--muted);
}

.contact {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  background: var(--green);
  border-radius: var(--radius);
  padding: 22px;
}

.contact p {
  margin: 0;
  flex: 1 1 280px;
  color: var(--text);
}

.contact strong {
  color: var(--white);
}

/* Footer */
.site-footer {
  background: var(--green-deep);
  padding: 36px 0 44px;
  color: var(--muted);
  font-size: 14px;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  justify-content: space-between;
  align-items: center;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.site-footer a {
  color: var(--text);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--white);
  text-decoration: underline;
}

/* Long-form pages (privacy, terms) */
.doc {
  max-width: 760px;
  padding-top: 48px;
  padding-bottom: 72px;
}

.doc h1 {
  color: var(--white);
  font-size: clamp(30px, 6vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.8px;
  margin: 0 0 8px;
}

.doc h2 {
  color: var(--white);
  font-size: 22px;
  margin: 40px 0 10px;
  letter-spacing: -0.3px;
}

.doc p,
.doc li {
  color: var(--text);
}

.doc strong {
  color: var(--white);
}

.doc ul {
  padding-left: 22px;
}

.doc li {
  margin: 6px 0;
}

.doc .meta {
  color: var(--muted);
  margin-bottom: 28px;
}

.doc .summary {
  background: var(--card);
  border-radius: var(--radius);
  padding: 6px 22px;
}

/* A part still to be filled in before publishing. */
.todo {
  background: rgba(255, 159, 10, 0.18);
  color: #ffb340;
  border-radius: 4px;
  padding: 0 4px;
}

.center-page {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 64px 20px;
}

.center-page .mark {
  width: 96px;
  height: 96px;
  margin: 0 auto 20px;
}

.center-page h1 {
  color: var(--white);
  margin: 0 0 10px;
  font-size: 30px;
  letter-spacing: -0.6px;
}

.center-page p {
  color: var(--muted);
  max-width: 460px;
  margin: 0 auto 24px;
}

.center-page .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* Hero drawing: the app's look, measuring a field. */
.hero-art {
  width: min(100%, 760px);
  height: auto;
  aspect-ratio: 16 / 9;
  margin: 28px auto 0;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* Phones: the drawing reaches nearly to the screen edges, as large as it can be. */
@media (max-width: 640px) {
  .hero-art {
    width: calc(100% + 24px);
    max-width: none;
    margin-left: -12px;
    margin-right: -12px;
    border-radius: 14px;
  }
}

.how-steps {
  list-style: none;
  margin: 2px 0 16px;
  padding: 0;
  display: grid;
  gap: 12px;
  counter-reset: how;
}

.how-steps li {
  position: relative;
  padding-left: 38px;
  color: var(--white);
  font-size: 15px;
  line-height: 1.45;
  counter-increment: how;
}

.how-steps li::before {
  content: counter(how);
  position: absolute;
  left: 0;
  top: -2px;
  width: 26px;
  height: 26px;
  border-radius: 13px;
  background: var(--card-raised);
  color: var(--yellow);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}


/* Free vs Pro: each item links down to its feature card. */
.plan li a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px dashed rgba(255, 214, 10, 0.5);
}

.plan li a:hover {
  color: var(--white);
  border-bottom-color: var(--yellow);
}

.plan li a::after {
  /* A no-break space: the › stays with the last word instead of wrapping on its own. */
  content: "\00a0›";
  color: var(--yellow);
}

.plan li.plan-limit {
  color: var(--muted);
}


/* The free and Pro feature lists read as one run: less space between them. */
#features {
  padding-bottom: 24px;
}

#pro {
  padding-top: 32px;
  border-top: 0;
}

/* Get AreaCalc: store buttons stacked full width on phones. */
@media (max-width: 520px) {
  .store-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

.get-about {
  margin-top: 22px !important;
}

.get-about a {
  font-weight: 600;
  text-decoration: none;
}

/* ---- Phone menu (menu.js): ☰ in the header, a panel sliding in from the right ---- */
.menu-button {
  display: none;
  width: 44px;
  height: 44px;
  margin-right: -6px;
  border: 0;
  border-radius: 10px;
  background: rgba(28, 28, 30, 0.7);
  color: var(--white);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.menu-button svg {
  width: 24px;
  height: 24px;
}

/* Narrow screens: the ☰ replaces the header's links and button. */
@media (max-width: 719px) {
  .nav > a {
    display: none !important;
  }

  .menu-button {
    display: inline-flex;
  }
}

.menu-root {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
}

.menu-root.is-open {
  pointer-events: auto;
}

.menu-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.menu-root.is-open .menu-backdrop {
  opacity: 1;
}

/* As the app's side menu: dark panel, logo at the top, rounded grey items. */
.menu-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(85vw, 340px);
  overflow-y: auto;
  background: var(--card);
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.5);
  transform: translateX(105%);
  transition: transform 0.22s ease;
}

.menu-root.is-open .menu-panel {
  transform: translateX(0);
}

.menu-panel:focus {
  outline: none;
}

.menu-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
}

.menu-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--white);
  text-decoration: none;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.menu-logo img {
  width: 48px;
  height: 48px;
}

.menu-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 18px;
  background: var(--card-raised);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.menu-close svg {
  width: 18px;
  height: 18px;
}

.menu-items {
  display: grid;
  gap: 8px;
}

.menu-legal {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--card-raised);
  color: var(--white);
  font-size: 17px;
  text-decoration: none;
  border: 1px solid transparent;
}

.menu-item:hover,
.menu-item:active {
  background: #3a3a3c;
}

.menu-item:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 2px;
}

.menu-chevron {
  color: var(--faint);
  font-size: 22px;
  line-height: 1;
}

.menu-item-highlight {
  border-color: var(--yellow);
  background: rgba(255, 214, 10, 0.1);
  color: var(--yellow);
  font-weight: 700;
}

.menu-item[aria-current="page"] .menu-chevron {
  color: var(--yellow);
}

.menu-item-small {
  min-height: 42px;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
}

/* No scrolling the page behind the open menu. */
html.menu-open,
html.menu-open body {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .menu-panel,
  .menu-backdrop {
    transition: none;
  }
}

/* Free vs. Pro prices */
.plan .amount {
  margin: 6px 0 2px;
  color: var(--white);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.8px;
  line-height: 1.1;
}

.plan .amount span {
  color: var(--muted);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
  margin-left: 2px;
}

.plan .amount-alt {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
}

.plan .save {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 6px;
  background: var(--yellow);
  color: #1c1c1e;
  font-size: 12px;
  font-weight: 800;
  vertical-align: 1px;
}

.plans-note {
  margin: 14px 0 0;
  color: var(--faint);
  font-size: 13px;
}

/* Plan card titles: "AreaCalc GPS Free" / "AreaCalc GPS Pro". */
.plan .plan-title {
  margin: 0 0 4px;
  color: var(--white);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

/* Text that wraps only between these pieces (e.g. at a comma). */
.nowrap {
  white-space: nowrap;
}

/* How it works page: a carousel, one tool per slide (how-it-works/carousel.js). */
.how-page {
  padding-top: 40px;
  padding-bottom: 64px;
}

.how-page > h1 {
  color: var(--white);
  font-size: clamp(32px, 6vw, 44px);
  letter-spacing: -1px;
  margin: 0 0 6px;
}

.how-page > .meta {
  color: var(--muted);
  margin: 0 0 24px;
}

.carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  /* Bleed to the screen edges on phones, so the swipe feels native. */
  margin: 0 -20px;
  align-items: flex-start;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.carousel-track:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 4px;
  border-radius: 8px;
}

.slide {
  border-top: 0;
  flex: 0 0 100%;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  padding: 0 20px;
  display: grid;
  gap: 18px;
  align-content: start;
}

@media (min-width: 820px) {
  .slide {
    grid-template-columns: 1.2fr 1fr;
    gap: 36px;
    align-items: center;
  }
}

.slide .how-media {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  background: #1f3324;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.slide.how-pro .how-media {
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4), 0 0 0 1.5px rgba(255, 214, 10, 0.5);
}

.slide-text h2 {
  margin: 0;
  color: var(--white);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.how-line {
  margin: 6px 0 16px;
  color: var(--text);
}

/* Arrows either side of the dots. */
.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 28px;
}

.carousel-arrow {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 22px;
  border: 0;
  background: var(--card-raised);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.carousel-arrow svg {
  width: 22px;
  height: 22px;
}

.carousel-arrow:disabled {
  opacity: 0.3;
  cursor: default;
}

.carousel-dots {
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px;
}

/* Phones: swiping replaces the arrows, and the dots go above the slides, where they stay in view. */
@media (max-width: 640px) {
  .carousel {
    display: flex;
    flex-direction: column;
  }

  .carousel-controls {
    order: -1;
    margin: 0 0 14px;
  }

  .carousel-arrow {
    display: none;
  }
}

/* A 24-point touch target around each small dot; the current one is a yellow pill. */
.carousel-dot {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: #48484a;
  transition: width 0.2s ease, background 0.2s ease;
}

.carousel-dot[aria-selected="true"]::before {
  width: 20px;
  background: var(--yellow);
}

.carousel-dot:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: -2px;
  border-radius: 12px;
}

@media (prefers-reduced-motion: reduce) {
  .carousel-track {
    scroll-behavior: auto;
  }

  .carousel-dot::before {
    transition: none;
  }
}


/* See it in action: three animated demos, each opening its How it Works slide. */
.demo-grid {
  display: grid;
  gap: 16px;
}

@media (min-width: 760px) {
  .demo-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.demo-card {
  display: block;
  overflow: hidden;
  border-radius: 18px;
  background: var(--card);
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: border-color 0.15s ease;
}

.demo-card:hover,
.demo-card:focus-visible {
  border-color: var(--yellow);
}

.demo-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  background: #1f3324;
}

.demo-card-body {
  display: block;
  padding: 14px 16px 16px;
}

.demo-card-title {
  display: block;
  color: var(--white);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.demo-card-title::after {
  content: "\00a0›";
  color: var(--yellow);
}

.demo-card-line {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 15px;
}

.demo-more {
  margin: 24px 0 0;
  text-align: center;
}

/* See it in action: a tighter band between Free vs. Pro and Support. */
#in-action {
  padding: 40px 0;
}
