/*
 * Freeza — landing and legal pages.
 *
 * Colours, type and radii come from tokens.css, generated from
 * design/tokens/tokens.json (`npm run design:build`), so these pages and the
 * app share one palette. Load tokens.css first. Theme follows the system.
 */

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* The one decorative flourish: a glacier glow behind the top of the page. */
body::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 42rem;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(70% 60% at 50% 0%, color-mix(in srgb, var(--color-ice) 38%, transparent), transparent 70%);
  opacity: 0.6;
}

a {
  color: var(--color-accent);
  text-decoration-color: color-mix(in srgb, var(--color-accent) 35%, transparent);
  text-underline-offset: 3px;
}
a:hover { text-decoration-color: currentColor; }

:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- Top bar ---------- */

.topbar {
  width: 100%;
  max-width: 70rem;
  margin: 0 auto;
  padding: max(1.25rem, env(safe-area-inset-top)) 1.5rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--color-text);
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.brand img { width: 34px; height: 34px; border-radius: 8px; box-shadow: 0 2px 8px rgba(14, 47, 85, 0.18); }

/* ---------- Landing ---------- */

.hero {
  max-width: 70rem;
  margin: 0 auto;
  padding: 3rem 1.5rem 1rem;
  text-align: center;
}

.mark { display: block; width: 7.5rem; height: 7.5rem; margin: 0 auto; }
.mark img { width: 100%; height: 100%; display: block; border-radius: 22.5%; box-shadow: 0 16px 50px rgba(14, 47, 85, 0.22); }

h1 {
  margin: 1.75rem 0 0.5rem;
  font-size: clamp(2.6rem, 8vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.tagline {
  margin: 0;
  font-size: clamp(1.2rem, 3.4vw, 1.6rem);
  font-weight: 500;
  color: var(--color-text-2);
  letter-spacing: -0.02em;
}

.lede {
  max-width: 34rem;
  margin: 1.25rem auto 0;
  color: var(--color-text-2);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 2rem;
  height: 3rem;
  padding: 0 1.35rem 0 1.1rem;
  border-radius: 999px;
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
  color: var(--color-text-2);
  font-size: var(--text-callout);
  font-weight: 600;
}
.badge::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 0 4px var(--color-accent-tint);
}

.tagline strong { font-weight: 600; color: var(--color-text); }

.slogan {
  margin: 2.25rem 0 0;
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.credit {
  color: var(--color-text-2);
  font-size: var(--text-footnote);
  font-style: italic;
}

.hero-wrap { padding-bottom: 3rem; }

.contact {
  margin: 2.5rem 0 0;
  text-align: center;
  color: var(--color-text-2);
}
.contact a { font-weight: 600; }

/* 404 */
.lost { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 2rem 1.5rem; }
.lost img { width: 12rem; height: 12rem; }
.lost h1 { margin-top: 1rem; font-size: clamp(2rem, 6vw, 2.75rem); }

/* ---------- Legal pages ---------- */

.page {
  width: 100%;
  max-width: 45rem;
  margin: 0 auto;
  padding: 1rem 1.5rem 2rem;
}

.page-head {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 1.25rem 0 2rem;
  color: var(--color-text);
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.page-head img { width: 34px; height: 34px; border-radius: 8px; box-shadow: 0 2px 8px rgba(14, 47, 85, 0.18); }

.page h1 {
  margin: 0 0 0.75rem;
  font-size: var(--text-large-title);
  line-height: var(--text-large-title--line-height);
  font-weight: 700;
  letter-spacing: -0.025em;
}

.page h2 {
  font-size: var(--text-title-3);
  line-height: var(--text-title-3--line-height);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 2.5rem 0 0.6rem;
}

.page h3 { font-size: var(--text-headline); font-weight: 600; margin: 1.6rem 0 0.4rem; }

.page p, .page li { max-width: 68ch; color: var(--color-text); }
.page strong { font-weight: 600; }
.page ul { padding-left: 1.2rem; }
.page li { margin: 0.3rem 0; }

.meta { margin: 0 0 2rem; }

.callout {
  margin: 1.75rem 0;
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius-group);
  background: var(--color-accent-tint);
  font-size: var(--text-callout);
}
.callout p { margin: 0.4rem 0; }
.callout p:first-child { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }

.table-wrap {
  overflow-x: auto;
  margin: 1rem 0;
  background: var(--color-surface);
  border-radius: var(--radius-group);
  box-shadow: var(--shadow-card);
}
table { width: 100%; border-collapse: collapse; font-size: var(--text-subheadline); }
th, td {
  text-align: left;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--color-separator);
  vertical-align: top;
}
tr:last-child th, tr:last-child td { border-bottom: 0; }
th { font-weight: 600; white-space: nowrap; }
td { color: var(--color-text-2); }

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 0.12em 0.4em;
  border-radius: 5px;
  background: var(--color-surface-2);
}

/* ---------- Footer ---------- */

footer {
  width: 100%;
  max-width: 70rem;
  margin: 3rem auto 0;
  padding: 1.5rem 1.5rem max(2rem, env(safe-area-inset-bottom));
  border-top: 1px solid var(--color-separator);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  font-size: var(--text-footnote);
  color: var(--color-text-2);
}
.page + footer, .hero-wrap + footer { margin-top: auto; }
footer nav, footer nav > span.is-active { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.5rem; }
footer a { color: var(--color-text-2); text-decoration: none; }
footer a:hover { color: var(--color-accent); text-decoration: underline; }
footer .sep { color: var(--color-text-3); }
footer .credit { flex-basis: 100%; margin: 0 0 0.25rem; text-align: center; }

/* ---------- Language switch: a segmented control, as in the app ---------- */

.lang {
  display: inline-flex;
  padding: 2px;
  border-radius: var(--radius-sm);
  background: var(--color-surface-2);
}
.lang button, .lang a {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0.3rem 0.8rem;
  border-radius: 8px;
  font: inherit;
  font-size: var(--text-footnote);
  font-weight: 600;
  color: var(--color-text-2);
  cursor: pointer;
  text-decoration: none;
  line-height: 1.5;
}
.lang button[aria-pressed='true'],
.lang a[aria-current='page'] {
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

[data-lang] { display: none; }
[data-lang].is-active { display: revert; }

/* ---------- Terms of use ---------- */

.page .version {
  margin: -0.25rem 0 2rem;
  font-size: var(--text-subheadline);
  color: var(--color-text-2);
}
.page ol { padding-left: 1.4rem; }

/*
 * The terms' PDFs (npm run legal:pdf) and any printout use these styles: the
 * reproducible copy § 312i BGB asks for, plain ink, no chrome.
 */
@media print {
  :root { --color-text: #000; --color-text-2: #000; --color-accent: #000; --color-bg: #fff; }
  body { background: none; font-size: 11pt; }
  body::before, footer, .lang, .brand img { display: none; }
  .page { max-width: none; padding: 0; }
  .page h2 { break-after: avoid; }
  .callout { background: none; border: 1px solid #999; }
  a { text-decoration: none; }
}
