:root {
  --bg: #f7f7f8;
  --surface: #ffffff;
  --surface-2: #eef0f2;
  --text: #17181a;
  --muted: #666b74;
  --border: #e2e4e8;
  --border-strong: #8a8f99;
  --accent: #4056e4;
  --accent-soft: rgba(64, 86, 228, 0.09);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #101114;
    --surface: #17181c;
    --surface-2: #1f2127;
    --text: #ececee;
    --muted: #9a9ea6;
    --border: #26282e;
    --border-strong: #6b7079;
    --accent: #8b96ff;
    --accent-soft: rgba(139, 150, 255, 0.12);
    color-scheme: dark;
  }
}

:root[data-theme='dark'] {
  --bg: #101114;
  --surface: #17181c;
  --surface-2: #1f2127;
  --text: #ececee;
  --muted: #9a9ea6;
  --border: #26282e;
  --border-strong: #6b7079;
  --accent: #8b96ff;
  --accent-soft: rgba(139, 150, 255, 0.12);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

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

.legal-page {
  display: flex;
  flex-direction: column;
}

.site-header,
.legal-main,
.legal-footer {
  width: min(calc(100% - 40px), 760px);
  margin-inline: auto;
}

.site-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--border);
}

.brand-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.015em;
  text-decoration: none;
}

.brand-mark {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
}

.brand-name {
  font-size: 18px;
}

.header-note {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.legal-main {
  flex: 1;
  padding-block: clamp(28px, 6vw, 64px);
}

.legal-card {
  padding: clamp(24px, 5vw, 48px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

h1,
h2 {
  color: var(--text);
  line-height: 1.2;
}

h1 {
  margin: 0;
  max-width: 18ch;
  font-size: clamp(30px, 6vw, 44px);
  letter-spacing: -0.035em;
}

.lede {
  margin: 16px 0 0;
  max-width: 62ch;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

.legal-card section {
  margin-top: 34px;
}

h2 {
  margin: 0 0 8px;
  font-size: 18px;
  letter-spacing: -0.012em;
}

.legal-card p,
.legal-card ul {
  margin: 0;
  color: var(--muted);
}

.legal-card p + p,
.legal-card p + ul,
.legal-card ul + p {
  margin-top: 10px;
}

.legal-card ul {
  padding-left: 22px;
}

.legal-card li + li {
  margin-top: 6px;
}

.privacy-note {
  padding: 16px 18px;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text) !important;
}

.last-updated {
  margin-top: 36px !important;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 13px;
}

.legal-footer {
  min-height: 72px;
  padding-block: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}

.legal-footer p {
  margin: 0;
}

.legal-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.legal-links a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
}

.legal-links a[aria-current='page'] {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.error-page {
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
}

.not-found {
  width: min(100%, 520px);
}

.not-found .brand-link {
  margin-bottom: 28px;
}

.not-found h1 {
  max-width: none;
  margin: 0 0 8px;
  font-size: clamp(30px, 8vw, 40px);
}

.not-found__message {
  margin: 0 0 24px;
  color: var(--muted);
}

.not-found__primary {
  min-height: 44px;
  padding: 9px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--bg);
  background: var(--text);
  border: 1px solid var(--text);
  border-radius: 8px;
  text-decoration: none;
}

.not-found__links {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 18px;
  font-size: 13px;
}

@media (max-width: 540px) {
  .site-header,
  .legal-main,
  .legal-footer {
    width: min(calc(100% - 28px), 760px);
  }

  .site-header {
    min-height: 68px;
  }

  .legal-main {
    padding-block: 20px 28px;
  }

  .legal-card {
    padding: 22px 18px;
    border-radius: 12px;
  }

  .legal-card section {
    margin-top: 28px;
  }

  .legal-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  a {
    transition: color 120ms ease, opacity 120ms ease;
  }
}
