/* ==========================================================================
   Anchor — landing + legal styles (self-contained; no framework).
   Individual-first group trip planner. Calm, serif, ink-on-paper, teal accent.
   Shared by index.html, privacy.html, terms.html, 404.html.
   ========================================================================== */
:root {
  --bg: #faf7f2;
  --ink: #1c1a17;
  --muted: #6b655c;
  --line: #e7e0d5;
  --accent: #0f7a6b;
  --card: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111311;
    --ink: #eef0ec;
    --muted: #9aa39a;
    --line: #262a26;
    --accent: #5fd6c0;
    --card: #171a17;
  }
}
:root[data-theme="light"] {
  --bg: #faf7f2; --ink: #1c1a17; --muted: #6b655c; --line: #e7e0d5; --accent: #0f7a6b; --card: #fff;
}
:root[data-theme="dark"] {
  --bg: #111311; --ink: #eef0ec; --muted: #9aa39a; --line: #262a26; --accent: #5fd6c0; --card: #171a17;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 400 18px/1.65 ui-serif, Georgia, "Times New Roman", serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Shared shell -------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: clamp(28px, 6vw, 64px) 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.brand {
  font: 700 15px/1 ui-sans-serif, system-ui, -apple-system, sans-serif;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  border: 0;
}
h1 {
  font-weight: 600;
  font-size: clamp(28px, 5.4vw, 42px);
  line-height: 1.1;
  letter-spacing: -.02em;
  margin: .45em 0 .5em;
  max-width: 18ch;
}
.lede {
  color: var(--muted);
  font-size: clamp(18px, 2.6vw, 21px);
  margin: 0 0 1.6em;
  max-width: 34ch;
}
p { margin: 0 0 1.1em; }
.rule { height: 1px; background: var(--line); border: 0; margin: 2em 0; }

/* Official Apple "Download on the App Store" badge + faded "coming soon" caption.
   Black lockup on light backgrounds, white on dark (per Apple's guidelines). */
.appstore {
  margin-top: 1.7em;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .7em;
}
.appstore .badge { height: 48px; width: auto; display: block; }
.appstore .badge-dark { display: none; } /* light theme default: show black lockup */
.soon-note {
  font: 600 12px/1 ui-sans-serif, system-ui, sans-serif;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: .55;
}

@media (prefers-color-scheme: dark) {
  .appstore .badge-light { display: none; }
  .appstore .badge-dark { display: block; }
}
/* Explicit theme toggle wins in both directions. */
:root[data-theme="light"] .appstore .badge-light { display: block; }
:root[data-theme="light"] .appstore .badge-dark { display: none; }
:root[data-theme="dark"] .appstore .badge-light { display: none; }
:root[data-theme="dark"] .appstore .badge-dark { display: block; }

/* Links --------------------------------------------------------------------- */
a { color: var(--accent); text-decoration: none; border-bottom: 1px solid transparent; }
a:hover { border-bottom-color: currentColor; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus {
  left: 16px; top: 16px; z-index: 5;
  padding: 8px 14px; background: var(--accent); color: var(--bg);
  border-radius: 6px; font: 600 13px ui-sans-serif, system-ui, sans-serif;
}

/* Footer -------------------------------------------------------------------- */
footer { border-top: 1px solid var(--line); }
.foot {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 24px;
  color: var(--muted);
  font: 400 13.5px/1.6 ui-sans-serif, system-ui, sans-serif;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  justify-content: space-between;
}
.foot p { margin: 0; max-width: 52ch; }
.foot nav { display: flex; gap: 14px; flex-wrap: wrap; }

/* Document layout — legal pages (privacy, terms) --------------------------- */
.doc { width: 100%; max-width: 720px; margin: 0 auto; padding: clamp(28px, 6vw, 64px) 24px; flex: 1; }
.doc .brand { display: inline-block; margin-bottom: clamp(20px, 4vw, 36px); }
.doc h1 { font-size: clamp(30px, 6vw, 44px); margin: 0 0 8px; }
.doc-meta {
  margin: 0 0 clamp(28px, 4vw, 44px);
  font: 600 12px/1 ui-sans-serif, system-ui, sans-serif;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.doc section { margin-bottom: clamp(24px, 3.4vw, 36px); }
.doc h2 {
  font-weight: 600;
  font-size: clamp(19px, 2.2vw, 23px);
  letter-spacing: -.01em;
  margin: 0 0 10px;
}
.doc p, .doc li { max-width: 64ch; }
.doc ul { margin: 0 0 1.1em; padding-left: 1.15em; }
.doc li { margin-bottom: 6px; }
.doc .backlink {
  display: inline-block;
  margin-top: 1.4em;
  font: 600 13px/1 ui-sans-serif, system-ui, sans-serif;
  letter-spacing: .06em;
  text-transform: uppercase;
}
