/* Lato, self-hosted, the same two weights and the same files as the app. This
   page loads no other stylesheet, so it declares the faces itself. */
@font-face {
  font-family: Lato;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local("Lato Regular"), local("Lato-Regular"),
       url(../fonts/lato-latin-400.woff2) format("woff2");
}
@font-face {
  font-family: Lato;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: local("Lato Bold"), local("Lato-Bold"),
       url(../fonts/lato-latin-700.woff2) format("woff2");
}

/* Standalone legal page. It deliberately does not import the story shell: the terms
   must stay readable on their own, and the palette below mirrors src/styles.css. */
:root {
  --ink: #292928;
  --muted: #696967;
  --paper: #fffef9;
  --line: #dcdcd8;
  --blue: #003c65;
  --gold: #c89b14;
}

.locale-pending body { visibility: hidden; }

* { box-sizing: border-box; }

/* The app's skip link: first in the page, shown only once focused, above the sticky
   header. Its target stops below that header, not under it. */
.skip-link {
  position: fixed; z-index: 900; top: 0; left: 0;
  padding: 10px 16px; border-bottom-right-radius: 8px;
  color: white; background: var(--blue); font-weight: 700; text-decoration: none;
  transform: translateY(-110%);
}
.skip-link:focus { transform: translateY(0); }
#main { scroll-margin-top: 82px; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: white;
  font-family: Lato, Arial, sans-serif;
  font-synthesis: none;
}

.terms-header {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 82px;
  padding: 0 max(24px, calc((100% - 1180px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: rgb(255 255 255 / 96%);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

/* Brand lockup, language switch and climate-data button. These match the app
   masthead in src/styles.css rule for rule: one mark, one wordmark, one pair of
   controls, so the header reads the same on every surface of the service. */
.terms-brand, .terms-back { color: inherit; text-decoration: none; }
.terms-brand { display: flex; align-items: center; gap: 12px; font-size: 1.05rem; font-weight: 700; }
.terms-brand-mark { width: 42px; height: 42px; display: inline-flex; flex: 0 0 auto; }
.terms-brand-mark svg { width: 100%; height: 100%; overflow: visible; }
.brand-mark__place { fill: var(--blue); }
.brand-mark__future { fill: none; stroke: var(--gold); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.terms-brand-text { display: flex; flex-direction: column; gap: 1px; line-height: 1.15; }
.terms-brand-name { color: var(--blue); }
.terms-brand-tagline { color: var(--muted); font-size: .68rem; font-weight: 400; letter-spacing: .01em; }

.terms-header-actions { display: flex; align-items: center; gap: 14px; }
.locale-switch { display: flex; padding: 2px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); }
.locale-switch button { padding: 5px 8px; border: 0; border-radius: 5px; color: var(--muted); background: transparent; font: inherit; font-size: .72rem; font-weight: 700; cursor: pointer; }
.locale-switch button[aria-pressed="true"] { color: white; background: var(--blue); }
.terms-back {
  padding: 8px 12px; border-radius: 7px; color: white; background: var(--blue);
  font-size: .72rem; font-weight: 700; white-space: nowrap;
}

.terms-page {
  width: min(760px, calc(100% - 48px));
  margin: 0 auto;
  padding: 48px 0 64px;
  line-height: 1.65;
}

.terms-eyebrow {
  margin: 0 0 12px; color: var(--blue); font-size: .75rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
}
.terms-page h1 { margin: 0 0 8px; font-size: 2rem; font-weight: 700; line-height: 1.2; }
.terms-page h2 {
  margin: 36px 0 10px; padding-top: 20px; border-top: 1px solid var(--line);
  font-size: 1.15rem; font-weight: 700;
}
.terms-updated { margin: 0 0 28px; color: var(--muted); font-size: .88rem; }
.terms-page p { margin: 0 0 14px; text-wrap: pretty; }
.terms-page ul { margin: 0 0 14px; padding-left: 22px; }
.terms-page li { margin-bottom: 6px; }
.terms-page address {
  margin-top: 16px; padding: 16px 18px; border-left: 4px solid var(--gold);
  background: var(--paper); font-style: normal; line-height: 1.7;
}

/* Same shape as the app footer in src/styles.css: the product and its developer on
   one side, the cross-links on the other. */
.terms-footer {
  width: min(760px, calc(100% - 48px));
  margin: 0 auto;
  padding: 24px 0 40px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .88rem;
}
.terms-footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.terms-footer a {
  color: var(--blue); font-weight: 700; text-decoration-color: var(--gold);
  text-decoration-thickness: 2px; text-underline-offset: 3px;
}

/* Same breakpoint as the app masthead: the tagline is the first thing to go when
   the header narrows, so the lockup collapses identically on every surface. */
@media (max-width: 850px) {
  .terms-brand-tagline { display: none; }
}

@media (max-width: 640px) {
  .terms-header { min-height: 72px; padding-inline: 16px; gap: 12px; }
  .terms-header-actions { gap: 8px; }
  .terms-brand { gap: 8px; font-size: .95rem; }
  .terms-brand-mark { width: 34px; height: 34px; }
  .locale-switch button { padding-inline: 5px; font-size: .64rem; }
  .terms-page { width: calc(100% - 32px); padding-top: 32px; }
  .terms-page h1 { font-size: 1.6rem; }
  .terms-footer { width: calc(100% - 32px); flex-direction: column; gap: 10px; }
  .terms-footer-links { align-items: flex-start; flex-direction: column; gap: 8px; }
}
