@import url("/design-tokens.css");

:root {
  --canvas: var(--bg);
  --surface: var(--panel-strong);
  --surface-soft: var(--panel-muted);
  --text: var(--ink);
  --border: var(--line-strong);
  --brand: var(--accent);
  --brand-deep: var(--accent-deep);
  --on-brand: var(--on-accent);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  overflow-x: hidden;
  font-kerning: normal;
  font-optical-sizing: auto;
  font-feature-settings: "kern" 1, "liga" 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  background: linear-gradient(180deg, oklch(98.5% 0.014 154), var(--canvas));
  color: var(--text);
}

.skip-link {
  position: fixed;
  top: var(--space-xs);
  left: calc(var(--space-xs) + env(safe-area-inset-left));
  z-index: var(--z-tooltip);
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  border-radius: var(--radius-sm);
  background: var(--brand-deep);
  color: var(--on-brand);
  font-weight: 800;
}

.skip-link:focus-visible {
  width: auto;
  height: auto;
  padding: var(--space-xs) var(--space-sm);
  clip-path: none;
  opacity: 1;
  pointer-events: auto;
}

.legal-shell {
  width: min(900px, calc(100vw - 32px - env(safe-area-inset-left) - env(safe-area-inset-right)));
  margin: 0 auto;
  padding: clamp(24px, 4vw, 36px) 0 clamp(42px, 6vw, 56px);
}

.legal-header,
.legal-section,
.legal-disclosure,
.legal-footer {
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--brand) 14%, transparent);
  border-radius: 20px;
  scroll-margin-top: 24px;
}

.legal-company-line {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.legal-header {
  display: grid;
  gap: var(--space-sm);
  padding: clamp(24px, 3.6vw, 30px);
  margin-bottom: var(--space-sm);
}

.legal-brand {
  display: block;
  width: min(19rem, 72vw);
}

.legal-brand img {
  display: block;
  width: 100%;
  height: auto;
}

.legal-header > *,
.legal-disclosure > *,
.meta-row,
.meta-pill {
  min-width: 0;
  max-width: 100%;
}

.legal-section,
.legal-disclosure,
.legal-footer {
  padding: clamp(20px, 3vw, 24px);
  margin-bottom: var(--space-xs);
}

.legal-section:not(.legal-quick-nav) {
  margin-bottom: 0;
  padding: var(--space-md) var(--space-xs);
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
}

.legal-shell > .legal-section:not(.legal-quick-nav),
.legal-shell > .legal-disclosure {
  content-visibility: auto;
  contain-intrinsic-size: auto 320px;
}

.legal-disclosure {
  margin-bottom: 0;
  padding: var(--space-sm) var(--space-xs);
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
}

.legal-footer {
  margin: var(--space-md) 0 0;
  padding: var(--space-md) 0 0;
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
}

.legal-quick-nav {
  border-color: color-mix(in srgb, var(--brand) 35%, var(--border));
  background: var(--surface-soft);
}

.legal-quick-nav h2 {
  font-family: var(--font-body);
}

.quick-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-xs);
  margin-top: var(--space-sm);
}

.quick-links a {
  align-items: flex-start;
  min-height: 44px;
  padding: 8px 0;
  color: var(--brand-deep);
  font-weight: 700;
  line-height: 1.35;
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.legal-disclosure > summary {
  min-height: 44px;
  cursor: pointer;
  color: var(--text);
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: var(--leading-title);
}

.legal-disclosure > summary::marker {
  color: var(--brand);
}

.legal-disclosure[open] > summary {
  margin-bottom: 12px;
}

.legal-disclosure[open] > :not(summary) {
  animation: legal-state-reveal var(--motion-view) var(--ease-out-quart) both;
}

@keyframes legal-state-reveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.eyebrow {
  margin: 0;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.075em;
  text-transform: uppercase;
  color: var(--brand-deep);
}

h1,
h2 {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: 0;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.legal-disclosure > summary,
.legal-quick-nav h2 {
  font-family: var(--font-body);
}

h1 {
  font-size: var(--text-4xl);
  line-height: 1.1;
  letter-spacing: -0.015em;
  max-width: 13ch;
}

h2 {
  font-size: var(--text-xl);
  line-height: var(--leading-title);
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}

p,
li {
  max-width: 68ch;
  color: var(--muted);
  line-height: var(--leading-body);
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

ul,
ol {
  margin: 12px 0 0;
  padding-left: 20px;
}

a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--brand-deep);
  text-decoration: underline;
  text-underline-offset: 0.16em;
  overflow-wrap: anywhere;
  touch-action: manipulation;
}

a:hover {
  color: var(--brand);
  text-decoration-thickness: 0.12em;
}

.lede {
  font-size: var(--text-md);
  line-height: 1.64;
  max-width: 58ch;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  padding: 9px 12px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid color-mix(in srgb, var(--brand) 14%, transparent);
  color: var(--brand-deep);
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: normal;
  overflow-wrap: anywhere;
}

.section-grid {
  display: grid;
  gap: var(--space-xs);
}

.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 44px;
  padding: 11px 14px;
  border-radius: 999px;
  background: var(--brand);
  color: var(--on-brand);
  text-decoration: none;
  font-weight: 700;
  transition: background-color var(--motion-state) var(--ease-out-quart), color var(--motion-state) var(--ease-out-quart), box-shadow var(--motion-state) var(--ease-out-quart);
  -webkit-tap-highlight-color: color-mix(in srgb, var(--brand) 18%, transparent);
}

a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.back-link:hover,
.back-link:focus-visible {
  background: var(--brand-deep);
  color: var(--on-brand);
  box-shadow: 0 12px 28px color-mix(in srgb, var(--brand) 18%, transparent);
}

.back-link:active {
  box-shadow: none;
}

.legal-footer .back-link,
.legal-footer .back-link:hover,
.legal-footer .back-link:focus-visible {
  padding: 0;
  background: transparent;
  color: var(--brand-deep);
  text-decoration: underline;
  text-underline-offset: 0.16em;
  box-shadow: none;
}

.small-note {
  font-size: var(--text-sm);
}

.meta-pill,
.legal-company-line,
ol,
time {
  font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .legal-shell > .legal-section:not(.legal-quick-nav),
  .legal-shell > .legal-disclosure {
    content-visibility: visible;
    contain-intrinsic-size: none;
  }
}

@media (max-width: 720px) {
  .legal-shell {
    width: min(100vw - 20px, 100%);
    padding: 18px 0 34px;
  }

  .legal-header,
  .legal-section,
  .legal-disclosure,
  .legal-footer {
    border-radius: 22px;
  }

  .legal-header {
    padding: 22px 20px 24px;
  }

  .legal-section,
  .legal-disclosure,
  .legal-footer {
    padding: 18px;
  }

  .legal-section:not(.legal-quick-nav) {
    padding: var(--space-md) var(--space-2xs);
  }

  .legal-disclosure {
    padding: var(--space-sm) var(--space-2xs);
    border-radius: 0;
  }

  .legal-footer {
    padding: var(--space-md) 0 0;
    border-radius: 0;
  }

  .quick-links {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .legal-shell {
    width: min(100vw - 16px, 100%);
  }

  h1 {
    max-width: 12ch;
  }

  .meta-pill,
  .back-link {
    width: 100%;
  }
}
