/* ==========================================================================
   TurMap — site styles
   --------------------------------------------------------------------------
   One stylesheet for all three pages. No framework, no build step.

   Layout order below, so you can jump straight to what you want to change:

     1. Tokens        — colours, fonts, spacing. Change these first.
     2. Reset         — the handful of resets actually worth having
     3. Page frame    — <body>, the centred column, header, footer
     4. Home page     — hero, download badge, feature cards, prose
     5. Document page — the long-form privacy pages
     6. Print

   Colour tokens come from docs/turmap-brand-and-store.md §4:
   navy #1a2e4a, accent #e8833a, cream #faf8f4.
   ========================================================================== */


/* 1. Tokens ================================================================
   Light mode is the default. Dark mode overrides only the colour tokens
   further down — no layout rules are repeated there, so you can restyle
   the site by editing this block alone. */

:root {
  --ink:          #1a2e4a;  /* body text, headings */
  --ink-soft:     #55637a;  /* secondary text, captions */
  --ground:       #faf8f4;  /* page background */
  --panel:        #f1ece3;  /* subtle raised blocks */
  --rule:         #ddd5c8;  /* hairlines */
  --accent:       #c25f18;  /* links. Darker than brand #e8833a so it
                               clears 4.5:1 contrast on cream. */
  --accent-plain: #e8833a;  /* the true brand orange, for non-text marks */

  --measure:      34rem;    /* reading column width */
  --gutter:       1.25rem;  /* page side padding on narrow screens */

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink:      #f1ece3;
    --ink-soft: #a8b3c4;
    --ground:   #14243a;
    --panel:    #1e3352;
    --rule:     #2e4569;
    --accent:   #f0964f;  /* lighter than brand orange, for contrast on navy */
  }
}


/* 2. Reset ================================================================= */

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

body, h1, h2, h3, p, ul, ol, dl, dd, figure, table {
  margin: 0;
}

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


/* 3. Page frame ============================================================ */

body {
  font-family: var(--font);
  font-size: 1.0625rem;      /* 17px — comfortable on a phone */
  line-height: 1.65;
  color: var(--ink);
  background: var(--ground);
  -webkit-text-size-adjust: 100%;
}

/* Every page wraps its content in <div class="column">. */
.column {
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
a:hover { text-decoration-thickness: 2px; }

/* --- Site header: wordmark, repeated on every page --- */

.site-header {
  padding-block: 2.5rem 0;
}

.wordmark {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}

/* The app icon beside the wordmark. Rendered from the shipping icon,
   AppIcon.icon (= AppIcon-Skiing as of 2026-09-30), via its 512 px preview
   Trailkeeper/Assets.xcassets/AppIconPreview-Skiing.imageset/Skiing.png.
   If the default icon changes, regenerate icon-128.png, icon-32.png,
   favicon.ico and apple-touch-icon.png from the new preview. */
.wordmark .logo {
  width: 2.25rem;
  height: 2.25rem;
  margin-right: 0.6rem;
  vertical-align: middle;
  transform: translateY(-1px);
}

/* --- Homepage brand block: big centred icon and name --- */

.brand-header {
  position: relative;
  overflow: hidden;            /* the 3840 px star field must never cause sideways scroll */
  padding-block: 250px 0;      /* room for the sky; icon centre = 250 + 72 = LOGO_Y in the generator */
  text-align: center;
}
.brand-header .column {
  position: relative;
  z-index: 1;                  /* icon and name above the stars */
}

/* The star field. Drawn 1:1 in CSS pixels by scripts/starfield/make_starfield.py
   (W 3840, H 400, LOGO_Y 322): if you change the size or the header padding,
   change the script's constants and re-run it. 3840 px wide so it reaches
   the window edge on any screen up to 4K; the header clips the rest. Stars
   take the ink colour, so light mode reads as a printed star chart and dark
   mode as the night sky. They fade out before the name. Hovering a star
   shows its catalogue name, HR number and magnitude. */
.starfield {
  position: absolute;
  top: 0;
  left: 50%;
  width: 3840px;
  height: 400px;
  margin-left: -1920px;
  z-index: 0;
  -webkit-mask-image: linear-gradient(to bottom, #000 82%, transparent);
          mask-image: linear-gradient(to bottom, #000 82%, transparent);
}
.starfield .stars circle { fill: var(--ink); opacity: 0.6; }
.starfield .asterism line {
  stroke: var(--ink-soft);
  stroke-width: 1;
  opacity: 0.35;
}
.starfield .asterism .pointer { stroke-dasharray: 2 6; }

/* Phones: shrink the sky about the icon's centre so the whole Dipper and
   Polaris stay on screen, and pull everything up 60 px with less padding. */
@media (max-width: 560px) {
  .brand-header { padding-top: 190px; }
  .starfield {
    transform-origin: 1920px 322px;
    transform: translateY(-60px) scale(0.75);
  }
}

.brand {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  color: var(--ink);
  text-decoration: none;
  border-radius: 32px;
}
.brand:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 6px;
}

/* The image carries its own rounded corners. */
.brand-icon {
  display: block;
  width: 9rem;
  height: 9rem;
  transition: transform 0.15s ease;
}
.brand:hover .brand-icon { transform: translateY(-2px); }

.brand-name {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

@media (prefers-reduced-motion: reduce) {
  .brand-icon { transition: none; }
  .brand:hover .brand-icon { transform: none; }
}

/* --- Site footer --- */

.site-footer {
  margin-top: 4rem;
  padding-block: 1.5rem 3rem;
  border-top: 1px solid var(--rule);
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin-bottom: 0.75rem;
}

.site-footer .credit { margin-top: 0.5rem; font-size: 0.875rem; }


/* 4. Home page ============================================================= */

/* --- Hero: headline, intro paragraph, platforms --- */

.hero {
  padding-block: 3rem 0.5rem;
}

.hero h1 {
  font-size: 2.25rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 650;
  margin-bottom: 0.75rem;
}

/* The paragraph under the headline: what tur means, what goes on the map. */
.hero .lede {
  font-size: 1.1875rem;
  color: var(--ink-soft);
  margin-bottom: 1.25rem;
}

/* "Free, with optional TurMap Plus" — small, quiet, near the top on purpose. */
.hero .platforms {
  font-size: 0.9375rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}


/* --- Download / App Store badge --- */

.download {
  padding-block: 1.75rem;
}

/* Apple's real badge is a fixed-aspect image; this just keeps it from
   stretching and gives it room. Apple's guidelines set the minimum size
   and the clear space around it — check them rather than trusting this. */
.download img {
  height: 60px;
  width: auto;
}

/* Stand-in shown until the App Store listing exists. It deliberately does
   NOT look like Apple's badge: a convincing fake badge that doesn't click
   through is worse than an honest label. Delete this rule with the markup. */
.badge-placeholder {
  display: inline-block;
  padding: 0.7rem 1.25rem;
  border: 1.5px dashed var(--rule);
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 0.9375rem;
  font-weight: 500;
  margin: 0;
}

/* "For iPhone and iPad" under the badge. */
.download-platforms {
  margin-top: 0.6rem;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

.download-note {
  margin-top: 1rem;
  font-size: 0.9375rem;
  color: var(--ink-soft);
  max-width: 30rem;
}


/* --- Feature cards --- */

.cards { padding-block: 1.5rem; }

/* Two columns where there's room, one on a phone. auto-fit means no
   media query is needed — the cards reflow on their own. */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1.5rem 2rem;
}

.card h3 {
  font-size: 1rem;
  font-weight: 650;
  margin-bottom: 0.35rem;
}

.card p {
  font-size: 0.9375rem;
  color: var(--ink-soft);
  margin: 0;
}


/* "Plus" marker on a feature card. Small and quiet: it answers "is this
   free?" without shouting. Apple requires paid features to be marked as
   such in store copy (guideline 2.3.2); the site does the same. */
.tag-plus {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.05rem 0.45rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: 0.15em;
}


/* --- Prose sections --- */

.prose { margin-block: 2rem; }

.prose h2 {
  font-size: 1.25rem;
  margin-top: 2.5rem;
  margin-bottom: 0.65rem;
}

.prose p + p { margin-top: 0.85rem; }



/* 5. Document pages (privacy, faq) ================================== */

.doc {
  padding-block: 2rem;
}

.doc h1 {
  font-size: 1.875rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.doc .updated {
  color: var(--ink-soft);
  font-size: 0.9375rem;
  margin-bottom: 2rem;
}

.doc h2 {
  font-size: 1.25rem;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}

.doc h3 {
  font-size: 1.0625rem;
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

.doc p  { margin-bottom: 1rem; }
.doc ul { margin-bottom: 1rem; padding-left: 1.25rem; }
.doc li { margin-bottom: 0.4rem; }

/* The summary box at the top of each policy. */
.doc .summary {
  padding: 1.25rem;
  background: var(--panel);
  border-radius: 8px;
  margin-bottom: 2rem;
}
.doc .summary p:last-child { margin-bottom: 0; }

/* Tables: the storage table and the rights table. They go horizontally
   scrollable rather than squashed on a phone. */
.table-wrap { overflow-x: auto; margin-bottom: 1.5rem; }

.doc table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9375rem;
}
.doc th, .doc td {
  text-align: left;
  vertical-align: top;
  padding: 0.5rem 0.75rem 0.5rem 0;
  border-bottom: 1px solid var(--rule);
}
.doc th { font-weight: 600; }

/* FAQ (site/faq). Each question is a <details>: a quiet row with a hairline
   under it, and a small chevron that turns when it opens. No JavaScript. */
.doc .faq {
  border-bottom: 1px solid var(--rule);
}
.doc .faq summary {
  list-style: none;              /* hide the default triangle */
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.85rem 0;
  font-weight: 600;
}
.doc .faq summary::-webkit-details-marker { display: none; }
.doc .faq summary::after {
  content: "";
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid var(--ink-soft);
  border-bottom: 2px solid var(--ink-soft);
  transform: translateY(-0.15rem) rotate(45deg);
  transition: transform 0.15s ease;
}
.doc .faq[open] summary::after {
  transform: translateY(0.1rem) rotate(-135deg);
}
.doc .faq summary:hover { color: var(--accent); }
.doc .faq > p { color: var(--ink); }
.doc .faq > p:last-child { padding-bottom: 0.5rem; }
/* The last question's hairline already separates it from the next section,
   so that section's heading drops its own rule. */
.doc .faq + h2 { border-top: 0; padding-top: 0; }
/* The "still have a question?" line under the last answer. */
.doc .faq-contact {
  margin-top: 2rem;
  color: var(--ink-soft);
}

/* Language switch between the English and Norwegian policies. */
.lang-switch {
  font-size: 0.9375rem;
  color: var(--ink-soft);
  margin-bottom: 1.5rem;
}


/* 6. Print ================================================================= */

@media print {
  .site-footer nav, .lang-switch { display: none; }
  body { color: #000; background: #fff; font-size: 11pt; }
  a { color: #000; }
}
