/* ── Legal Pages — Design Tokens ── */

:root {
  --ink: 20 20 19;

  --background: #f5f4ed;
  --foreground: #3d3c38;
  --foreground: rgb(var(--ink));
  --card: #f0efe7;
  --card: rgb(var(--ink) / 0.02);
  --primary: #333BFA;
  --primary-foreground: #ffffff;
  --muted: #eae9e1;
  --muted: rgb(var(--ink) / 0.04);
  --muted-foreground: #87867f;
  --muted-foreground: rgb(var(--ink) / 0.5);
  --accent: #eae9e1;
  --accent: rgb(var(--ink) / 0.04);
  --accent-foreground: #3d3c38;
  --accent-foreground: rgb(var(--ink));
  --destructive: #b53333;
  --success: #10B981;
  --border: #e0dfd7;
  --border: rgb(var(--ink) / 0.08);
  --ring: #333BFA;
  --text-body: #4d4c48;
  --text-body: rgb(var(--ink) / 0.8);

  --radius: 0.625rem;
  --font: "Inter", system-ui, -apple-system, sans-serif;
}

/* ── Dark theme ── */
.dark {
  --ink: 240 238 230;

  --background: #141413;
  --foreground: #d4d2ca;
  --foreground: rgb(var(--ink));
  --card: #191918;
  --card: rgb(var(--ink) / 0.02);
  --primary: #6B71FF;
  --primary-foreground: #141413;
  --muted: #1e1e1c;
  --muted: rgb(var(--ink) / 0.04);
  --muted-foreground: #87867f;
  --muted-foreground: rgb(var(--ink) / 0.5);
  --accent: #1e1e1c;
  --accent: rgb(var(--ink) / 0.04);
  --accent-foreground: #d4d2ca;
  --accent-foreground: rgb(var(--ink));
  --destructive: #e05252;
  --success: #34d399;
  --border: #2a2a28;
  --border: rgb(var(--ink) / 0.08);
  --ring: #6B71FF;
  --text-body: #bfbdb6;
  --text-body: rgb(var(--ink) / 0.8);
}

/* ── No-JS fallback ── */
@media (prefers-color-scheme: dark) {
  :root:not(.light) {
    --ink: 240 238 230;
    --background: #141413;
    --foreground: #d4d2ca;
    --foreground: rgb(var(--ink));
    --card: #191918;
    --card: rgb(var(--ink) / 0.02);
    --primary: #6B71FF;
    --primary-foreground: #141413;
    --muted: #1e1e1c;
    --muted: rgb(var(--ink) / 0.04);
    --muted-foreground: #87867f;
    --muted-foreground: rgb(var(--ink) / 0.5);
    --accent: #1e1e1c;
    --accent: rgb(var(--ink) / 0.04);
    --accent-foreground: #d4d2ca;
    --accent-foreground: rgb(var(--ink));
    --destructive: #e05252;
    --success: #34d399;
    --border: #2a2a28;
    --border: rgb(var(--ink) / 0.08);
    --ring: #6B71FF;
    --text-body: #bfbdb6;
    --text-body: rgb(var(--ink) / 0.8);
  }
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Site header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--background);
  border-bottom: 1px solid var(--border);
}
@supports (color-mix(in srgb, red, blue) and (backdrop-filter: blur(1px))) {
  .site-header {
    background: color-mix(in srgb, var(--background) 85%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
}
.site-header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--foreground);
  text-decoration: none;
}
.logo-icon {
  width: 28px;
  height: 28px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.logo-icon svg { color: var(--primary-foreground); }
.logo-text {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Header actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Icon button — 44px touch target */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  border: none;
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: background 150ms, color 150ms;
}
.icon-btn:hover {
  background: var(--accent);
  color: var(--accent-foreground);
}
.icon-btn svg { width: 20px; height: 20px; }


/* ── Page ── */
main.page {
  max-width: 680px;
  margin: 0 auto;
  padding: 64px 24px 120px;
}

/* ── Document header ── */
.doc-header { margin-bottom: 48px; }
.doc-header h1 {
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--foreground);
  margin-bottom: 12px;
  white-space: nowrap;
}
.doc-meta {
  font-size: 14px;
  color: var(--muted-foreground);
}
.doc-meta span + span::before {
  content: '\00b7';
  margin: 0 8px;
}

/* ── Sections ── */
.section { margin-bottom: 48px; }
.section h2 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--foreground);
  margin-bottom: 20px;
}
.section h3 {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.4;
  color: var(--foreground);
  margin-top: 32px;
  margin-bottom: 12px;
}
.section h2 + h3 { margin-top: 0; }

/* ── Typography ── */
p {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-body);
  margin-bottom: 16px;
}
p:last-child { margin-bottom: 0; }
p strong { color: var(--foreground); font-weight: 600; }

a { color: var(--primary); text-decoration: none; }
.section a:hover,
.contact-box a:hover { text-decoration: underline; }

/* ── Lists ── */
ul {
  margin: 8px 0 16px;
  padding-left: 24px;
  list-style: none;
}
ul li {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-body);
  padding: 4px 0;
  position: relative;
}
ul li::before {
  content: '';
  position: absolute;
  left: -16px;
  top: 16px;
  width: 4px;
  height: 4px;
  border-radius: 9999px;
  background: var(--muted-foreground);
}

/* ── Tables ── */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 24px 0;
  font-size: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}
th {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  text-align: left;
  padding: 12px 16px;
  background: var(--card);
}
td {
  color: var(--text-body);
  padding: 12px 16px;
}
tr + tr td { border-top: 1px solid var(--border); }
td strong { color: var(--foreground); font-weight: 600; }
td a { font-size: 14px; }

/* ── Data summary ── */
.data-summary {
  margin: 32px 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}
.data-summary-header {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  padding: 12px 16px;
  background: var(--card);
}
.data-row { display: grid; grid-template-columns: 1fr 1fr 1fr; }
.data-row + .data-row { border-top: 1px solid var(--border); }
.data-cell {
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-body);
}
.data-cell strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 4px;
}
.collected { color: var(--success); font-weight: 500; }
.not-collected { color: var(--muted-foreground); font-weight: 500; }

/* ── Tags ── */
.tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tag {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-foreground);
  padding: 4px 12px;
  border-radius: 9999px;
  border: 1px solid var(--border);
}

/* ── Contact ── */
.contact-box {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 24px;
  margin-top: 16px;
}
.contact-box p { margin: 0; font-size: 17px; color: var(--text-body); }

/* ── Footer ── */
footer {
  margin-top: 80px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
footer p { font-size: 14px; color: var(--muted-foreground); margin: 0; }

/* ── Noscript ── */
.noscript-bar {
  background: var(--card);
  padding: 8px 24px;
  font-size: 14px;
  color: var(--muted-foreground);
  text-align: center;
}

/* ── Focus ── */
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
  .site-header { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--background); }
}

/* ── Tablet (641–1024px) ── */
@media (max-width: 1024px) {
  .data-row { grid-template-columns: 1fr 1fr; }
  .data-cell:nth-child(3) { display: none; }
}

/* ── Mobile (≤640px) ── */
@media (max-width: 640px) {
  .doc-header h1 { font-size: 28px; white-space: normal; }
  .section h2 { font-size: 22px; }
  .data-row { grid-template-columns: 1fr; }
  .data-cell { display: block; }
  .data-cell:nth-child(3) { display: block; }
  .data-row:first-child { display: none; }
  .data-cell::before {
    content: attr(data-label);
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--muted-foreground);
    margin-bottom: 4px;
  }
  .logo-text { display: none; }
}

/* ── Print ── */
@media print {
  .site-header,
  .icon-btn,
  .lang-menu,
  .noscript-bar { display: none; }
  body { background: #fff; color: #000; font-size: 12pt; }
  main.page { max-width: 100%; padding: 0; }
  a { color: #000; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 10pt; color: #666; }
  a[href^="mailto:"]::after { content: " (" attr(href) ")"; }
  a[href^="#"]::after { content: ""; }
  .contact-box, table, .data-summary { border-color: #ccc; }
  footer { border-color: #ccc; }
  .tags .tag { border-color: #ccc; color: #666; }
}
