/*
 * Shared theme for the static policy pages (security, privacy, terms, cookies).
 * Values mirror src/index.css (brand frame) and src/Theme.css (sky-over-sand
 * theme) so these pages match the React app.
 */

:root {
  --brand-max: 1120px;
  --brand-gutter: 24px;
  --brand-top: 20px;
  --brand-bar-height: 44px;
  --theme-sky-top: #050f2c;
  --theme-sky-mid: #0a2466;
  --theme-sky-low: #0d3fa6;
  --theme-sky-height: 260px;
  --theme-sand: #fbf4e6;
  --theme-card: #fffdf7;
  --theme-tile: #fdf9f0;
  --theme-ink: #12151d;
  --theme-ink-soft: #4a5162;
  --theme-ink-faint: #6e7586;
  --theme-line: rgba(18, 21, 29, 0.09);
  --theme-sun: #facc15;
  --theme-sun-soft: #fef3c7;
  --theme-sun-deep: #854d0e;
  --theme-brand: #0052ff;
  --theme-brand-deep: #0041cc;
  --theme-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --theme-card-shadow:
    0 0 0 1px rgba(250, 204, 21, 0.28),
    0 30px 70px -36px rgba(2, 6, 23, 0.55);

  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  line-height: 1.5;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--theme-ink);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 80' preserveAspectRatio='none'%3E%3Cpath fill='%23fbf4e6' d='M0 48 C 240 8, 480 8, 720 40 S 1200 76, 1440 32 L 1440 80 L 0 80 Z'/%3E%3C/svg%3E")
      0 calc(var(--theme-sky-height) - 56px) / 100% 57px no-repeat,
    linear-gradient(170deg, var(--theme-sky-top) 0%, var(--theme-sky-mid) 55%, var(--theme-sky-low) 100%)
      0 0 / 100% var(--theme-sky-height) no-repeat,
    var(--theme-sand);
}

/* ---------- Header: wordmark left, tabs centred (same frame as the app) ---------- */

.site-header {
  max-width: var(--brand-max);
  margin: 0 auto;
  padding: var(--brand-top) var(--brand-gutter) 0;
}

.site-header-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-areas: "brand nav spacer";
  align-items: center;
  gap: 12px 16px;
  min-height: var(--brand-bar-height);
}

.brand-wordmark {
  grid-area: brand;
  justify-self: start;
  margin: 0;
  font-family: var(--theme-display);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.5px;
  color: #fff;
  text-decoration: none;
}

.nav-tabs {
  grid-area: nav;
  display: flex;
  padding: 3px;
  gap: 4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

.nav-tab {
  flex: 0 0 auto;
  padding: 6px 18px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
}

.nav-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.brand-wordmark:focus-visible,
.nav-tab:focus-visible {
  outline: 3px solid var(--theme-sun);
  outline-offset: 2px;
}

/* ---------- Policy card on the sand ---------- */

main {
  width: min(760px, calc(100% - 2 * var(--brand-gutter)));
  margin: 28px auto 0;
  padding: 40px;
  background: var(--theme-card);
  border-radius: 28px;
  box-shadow: var(--theme-card-shadow);
}

h1,
h2,
h3 {
  font-family: var(--theme-display);
  color: var(--theme-ink);
  letter-spacing: -0.3px;
}

h1 {
  margin: 0 0 8px;
  font-size: 34px;
  line-height: 1.15;
}

h2 {
  margin: 36px 0 10px;
  font-size: 21px;
  line-height: 1.3;
}

h3 {
  margin: 24px 0 8px;
  font-size: 16px;
}

p,
li {
  color: var(--theme-ink-soft);
  font-size: 16px;
  line-height: 1.65;
}

strong { color: var(--theme-ink); }

li + li { margin-top: 6px; }

a { color: var(--theme-brand); }

a:hover { color: var(--theme-brand-deep); }

code {
  overflow-wrap: anywhere;
  font-size: 14px;
}

.updated {
  margin-top: 0;
  color: var(--theme-ink-faint);
  font-size: 14px;
}

.summary {
  font-size: 18px;
  color: var(--theme-ink);
}

.notice {
  font-weight: 700;
  color: var(--theme-ink);
}

/* ---------- Footer: centred links, same as the app footer ---------- */

.site-footer {
  max-width: var(--brand-max);
  margin: 64px auto 0;
  padding: 24px var(--brand-gutter) 32px;
  border-top: 1px solid var(--theme-line);
  color: var(--theme-ink-faint);
  font-size: 12px;
  text-align: center;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
}

.footer-links a {
  color: var(--theme-ink-soft);
  text-decoration: none;
}

.footer-links a:hover,
.footer-links a[aria-current="page"] {
  color: var(--theme-ink);
  text-decoration: underline;
}

.footer-copyright {
  margin: 9px 0 0;
  color: var(--theme-ink-faint);
  font-size: 12px;
}

/* ---------- Narrow screens: tabs drop to their own centred row ---------- */

@media (max-width: 900px) {
  .site-header-row {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "brand"
      "nav";
  }

  .nav-tabs {
    width: 100%;
    justify-content: center;
  }

  .nav-tab { flex: 1; }
}

@media (max-width: 560px) {
  :root {
    --brand-gutter: 16px;
    --brand-top: 16px;
  }

  .nav-tab { padding: 8px 6px; }

  main {
    padding: 24px 20px;
    border-radius: 24px;
  }

  h1 { font-size: 28px; }
}
