/* Mesura legal pages — zinc + amber, matching the app's ForUI design language.
   Self-contained: no webfonts, no scripts, no third-party requests. */

:root {
  --bg: #ffffff;
  --surface: #fafafa;
  --text: #18181b;
  --muted: #52525b;
  --border: #e4e4e7;
  --accent: #b45309;
  --accent-soft: #fffbeb;
  --radius: 12px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #09090b;
    --surface: #18181b;
    --text: #fafafa;
    --muted: #a1a1aa;
    --border: #27272a;
    --accent: #fbbf24;
    --accent-soft: #1c1917;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

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

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 10;
  background: var(--bg);
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
}

/* --- header ------------------------------------------------------------- */

header.site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 46rem;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}
.brand .mark { color: var(--accent); font-size: 1.1em; line-height: 1; }

.lang { position: relative; font-size: 0.9rem; }
.lang > summary {
  list-style: none;
  cursor: pointer;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  white-space: nowrap;
}
.lang > summary::-webkit-details-marker { display: none; }
.lang > summary:hover { color: var(--text); border-color: var(--muted); }
.lang .globe { color: var(--accent); }

.lang > ul {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  z-index: 5;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  min-width: 11rem;
  max-height: 60vh;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 28px rgb(0 0 0 / 0.12);
}
.lang > ul a {
  display: block;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
}
.lang > ul a:hover { background: var(--surface); }
.lang > ul a[aria-current] { color: var(--accent); font-weight: 600; }

/* --- content ------------------------------------------------------------ */

main {
  max-width: 46rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

h1 {
  font-size: clamp(1.9rem, 5vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 1rem 0 0.5rem;
  text-wrap: balance;
}

h2 {
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  margin: 2.5rem 0 0.75rem;
  scroll-margin-top: 1.5rem;
}

h3 {
  font-size: 1.02rem;
  margin: 1.75rem 0 0.5rem;
  color: var(--text);
}

p, ul, ol { margin: 0 0 1rem; }
ul, ol { padding-left: 1.4rem; }
li { margin-bottom: 0.4rem; }
li::marker { color: var(--muted); }

.meta { color: var(--muted); font-size: 0.9rem; margin-top: 0; }

.lede { font-size: 1.06rem; color: var(--text); }
.lede p:last-child { margin-bottom: 0; }

section { scroll-margin-top: 1.5rem; }
section h2 { counter-increment: sec; }
main { counter-reset: sec; }
section h2::before {
  content: counter(sec) ". ";
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.note {
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  margin: 0 0 1rem;
  font-size: 0.97rem;
}

/* --- table of contents -------------------------------------------------- */

.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.35rem 0.6rem;
  margin: 2rem 0 0;
  font-size: 0.95rem;
}
.toc h2 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 0.6rem;
}
.toc h2::before { content: none; }
.toc ol { margin: 0; padding-left: 1.3rem; }
.toc li { margin-bottom: 0.3rem; }
.toc a { color: var(--text); text-decoration: none; }
.toc a:hover { color: var(--accent); text-decoration: underline; }

/* --- index cards -------------------------------------------------------- */

.cards { display: grid; gap: 1rem; margin: 2rem 0; }
@media (min-width: 40rem) {
  .cards { grid-template-columns: 1fr 1fr; }
}

.card {
  display: block;
  padding: 1.25rem 1.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card h2 { margin: 0 0 0.4rem; font-size: 1.15rem; }
.card h2::before { content: none; }
.card p { color: var(--muted); font-size: 0.95rem; margin-bottom: 0.75rem; }
.card .go { color: var(--accent); font-size: 0.9rem; font-weight: 600; }

.contact { color: var(--muted); font-size: 0.95rem; }

/* --- footer ------------------------------------------------------------- */

footer.site {
  max-width: 46rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--muted);
}
footer.site nav { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
footer.site a { color: var(--muted); }
footer.site a:hover { color: var(--accent); }
.fine { margin: 0.75rem 0 0; font-size: 0.83rem; }

/* --- print -------------------------------------------------------------- */

@media print {
  :root { --bg: #fff; --text: #000; --muted: #444; --border: #ccc; --accent: #000; --surface: #fff; --accent-soft: #fff; }
  body { font-size: 11pt; line-height: 1.5; }
  .lang, .skip, footer.site nav { display: none; }
  a { color: #000; text-decoration: none; }
  .toc { break-after: page; }
  section { break-inside: avoid-page; }
  h2 { break-after: avoid-page; }
}
