/*
 * Tee Cabin — legal pages.
 *
 * The palette is NOT invented here: it is the app's, from theme/tokens.ts, sampled from
 * cabincolors.jpg. These pages are reached by tapping "Terms" on the sign-up screen of a
 * dark forest-green app, at the exact moment a person is agreeing to something. A white
 * flash at that moment reads as "you have left the product" — so the default is the app's
 * own dark green, and light is a supported alternative rather than the assumption.
 */

:root {
  /* dark — the default, and the app's own */
  --bg: #21322c;
  --bg-deep: #182620;
  --surface: #2b3c35;
  --line: #3a4c44;
  --ink: #e9efe9;
  --ink-dim: #aebab0;
  --muted: #8f9c92;
  --accent: #cbb587;
  --accent-deep: #a8925f;

  --measure: 68ch;
  --serif: Georgia, 'Iowan Old Style', 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    /* An off-white tinted toward the brand's OWN hue (green), never toward warm cream —
       the warm-neutral band is the default everything drifts to, and it is not this brand. */
    --bg: #f3f6f2;
    --bg-deep: #e7ece6;
    --surface: #ffffff;
    --line: #d3dbd2;
    --ink: #182620;
    --ink-dim: #47564d;
    --muted: #5d6b62;
    /* #CBB587 gold is ~2.4:1 on a light bg — unreadable. Links get the deep forest green
       with a gold underline: the identity survives and the contrast is real. */
    --accent: #4a5f52;
    --accent-deep: #7a6634;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 22px 96px;
}

/* --- masthead ------------------------------------------------------------ */
header.top {
  border-bottom: 1px solid var(--line);
  background: var(--bg-deep);
  margin-bottom: 44px;
}
header.top .wrap {
  padding-top: 26px;
  padding-bottom: 22px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.brand {
  font-family: var(--serif);
  font-size: 25px;
  letter-spacing: -0.2px;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
}
/* The one gold mark on the page: the ball on the tee, standing in for the dot of the i.
   Gold means an ACCENT here exactly as it means an ACTION in the app — spend it once. */
.brand .ball {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent-deep);
  display: inline-block;
  margin-left: 1px;
  transform: translateY(-13px);
}
@media (prefers-color-scheme: light) { .brand .ball { background: #a8925f; } }

nav.top-nav { display: flex; gap: 20px; font-size: 14.5px; }
nav.top-nav a { color: var(--ink-dim); text-decoration: none; }
nav.top-nav a:hover { color: var(--ink); }
nav.top-nav a[aria-current='page'] { color: var(--ink); }

/* --- type ---------------------------------------------------------------- */
h1 {
  font-family: var(--serif);
  font-size: clamp(30px, 6vw, 40px);
  line-height: 1.18;
  letter-spacing: -0.4px;
  margin: 0 0 6px;
  text-wrap: balance;
}
h2 {
  font-family: var(--serif);
  font-size: clamp(20px, 3.4vw, 24px);
  line-height: 1.3;
  margin: 46px 0 10px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  text-wrap: balance;
}
h2:first-of-type { border-top: 0; padding-top: 0; }

p, li { text-wrap: pretty; }
p { margin: 0 0 17px; }

.updated {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 34px;
}

.lede { color: var(--ink-dim); }

strong { color: var(--ink); font-weight: 650; }

ul { padding-left: 20px; margin: 0 0 18px; }
li { margin-bottom: 9px; }
li::marker { color: var(--accent-deep); }

a { color: var(--accent); text-decoration-color: var(--accent-deep); text-underline-offset: 3px; }
@media (prefers-color-scheme: light) {
  a { text-decoration-color: #a8925f; text-decoration-thickness: 1.5px; }
}
a:hover { color: var(--ink); }

/* --- what we collect ------------------------------------------------------ */
/*
 * This was a three-column <table>, and on a 420px phone it was USELESS: you saw the "What"
 * column, a stack of tall empty rows, and had to scroll sideways inside a box to find the
 * sentence explaining why. A phone is how most people reach this page — they tap "Terms" or
 * "Privacy" inside the app — so the phone is the case that has to work.
 *
 * It is a description list now: stacked on a phone, aligned into two columns on anything
 * wider. Nothing scrolls sideways, ever.
 */
.collect {
  margin: 0 0 26px;
  border-top: 1px solid var(--line);
}
.collect .row {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.collect dt {
  color: var(--ink);
  font-weight: 650;
  font-size: 15.5px;
  margin: 0 0 5px;
}
.collect dd {
  margin: 0;
  color: var(--ink-dim);
  font-size: 15.5px;
}
.collect .src {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13.5px;
}

@media (min-width: 700px) {
  .collect .row {
    display: grid;
    grid-template-columns: 210px 1fr;
    gap: 26px;
    align-items: baseline;
  }
  .collect dt { margin: 0; }
}

/* --- the landing page ----------------------------------------------------- */
.docs { display: flex; flex-direction: column; gap: 14px; margin: 34px 0 0; }
.doc {
  display: block;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  text-decoration: none;
  color: var(--ink);
  transition: border-color 220ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}
.doc:hover { border-color: var(--accent-deep); transform: translateY(-2px); color: var(--ink); }
.doc h3 { font-family: var(--serif); font-size: 20px; margin: 0 0 4px; font-weight: 400; }
.doc p { margin: 0; color: var(--ink-dim); font-size: 15px; }

@media (prefers-reduced-motion: reduce) {
  .doc { transition: border-color 220ms ease; }
  .doc:hover { transform: none; }
}

/* --- footer --------------------------------------------------------------- */
footer {
  margin-top: 64px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}
footer p { margin: 0 0 6px; }
