/* Bright Digital AI, Wave 0. Light theme, one gold accent, system fonts. */
:root {
  --bg: #FBFAF7;
  --surface: #FFFFFF;
  --ink: #1F1D1A;
  --muted: #57524A;
  --line: #E4DDCF;
  --gold: #BB9C59;        /* accent from the old logo, decorative only */
  --gold-ink: #7A5A17;    /* gold dark enough for text and links on light backgrounds */
  --notice-bg: #FBF3E2;
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
          "Noto Sans", sans-serif;
  --measure: 46rem;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-wrap: break-word;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }

img { max-width: 100%; height: auto; }

a { color: var(--gold-ink); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, summary:focus-visible {
  outline: 3px solid var(--gold-ink);
  outline-offset: 2px;
  border-radius: 3px;
}

.wrap { width: 100%; max-width: 60rem; margin: 0 auto; padding: 0 16px; }

.skip {
  position: absolute; left: 16px; top: -100px;
  background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 6px; z-index: 10;
}
.skip:focus { top: 8px; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.site-header::before { content: ""; display: block; height: 3px; background: var(--gold); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 600; letter-spacing: 0.01em; }
.brand img { width: 44px; height: 44px; border-radius: 50%; }
.lang {
  font-size: 0.9375rem; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px;
  text-decoration: none; white-space: nowrap;
}
.lang:hover { border-color: var(--gold); }

/* Documents */
main.wrap { padding-top: 28px; padding-bottom: 48px; }
h1, h2, h3 { line-height: 1.25; color: var(--ink); }
h1 { font-size: 1.75rem; margin: 0 0 16px; letter-spacing: -0.01em; }
h2 {
  font-size: 1.3rem; margin: 40px 0 12px; padding-top: 16px; border-top: 1px solid var(--line);
  scroll-margin-top: 16px;
}
h3 { font-size: 1.08rem; margin: 28px 0 8px; }
p, ul, ol { margin: 0 0 14px; }
ul, ol { padding-left: 1.3em; }
li { margin-bottom: 6px; }

.notice {
  background: var(--notice-bg); border-left: 4px solid var(--gold); border-radius: var(--radius);
  padding: 12px 16px; margin: 0 0 16px; font-size: 0.975rem;
}
.meta { color: var(--muted); font-size: 0.95rem; }
.meta a { color: var(--gold-ink); }

.toc {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 16px; margin: 0 0 20px;
}
.toc summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.toc ol { margin: 10px 0 4px; font-size: 0.975rem; }
.toc li { margin-bottom: 4px; }

/* Tables: cards on small screens, real tables from 720px */
.table { margin: 0 0 20px; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
tr {
  display: block; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px 14px; margin-bottom: 10px;
}
td { display: block; padding: 4px 0; }
td[data-label]::before {
  content: attr(data-label); display: block; font-size: 0.8125rem; font-weight: 600;
  color: var(--muted); letter-spacing: 0.01em;
}
td:empty { display: none; }
table.kv td:first-child { font-weight: 600; font-size: 0.875rem; color: var(--muted); padding-bottom: 0; }

@media (min-width: 720px) {
  body { font-size: 1.0625rem; }
  h1 { font-size: 2.1rem; }
  main.wrap { padding-top: 40px; }
  .doc article > p, .doc article > ul, .doc article > ol, .doc article > h2,
  .doc article > h3, .doc .notice, .doc .toc { max-width: var(--measure); }
  thead { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; }
  tr { display: table-row; background: none; border: 0; border-radius: 0; padding: 0; margin: 0; }
  th, td {
    display: table-cell; text-align: left; vertical-align: top; padding: 10px 12px;
    border-bottom: 1px solid var(--line);
  }
  th { font-size: 0.875rem; color: var(--muted); border-bottom: 2px solid var(--gold); background: var(--surface); }
  tbody tr:nth-child(even) td { background: #F6F3EC; }
  td[data-label]::before { content: none; }
  td:empty { display: table-cell; }
  table { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; border-collapse: separate; border-spacing: 0; }
  tbody tr:last-child td { border-bottom: 0; }
  table.kv td:first-child { width: 34%; padding-bottom: 10px; }
}

.to-top { margin-top: 32px; font-size: 0.95rem; }

/* Home and 404 */
.home > * { max-width: var(--measure); }
.home h1 { font-size: 2rem; margin-top: 8px; }
.lead { font-size: 1.2rem; color: var(--ink); max-width: 36rem; }
.soon {
  display: inline-block; margin: 4px 0 28px; padding: 6px 14px; border-radius: 999px;
  background: var(--notice-bg); border: 1px solid var(--gold); color: var(--ink); font-weight: 600;
}
.links {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 20px; margin-bottom: 16px;
}
.links h2 { border: 0; padding: 0; margin: 0 0 8px; font-size: 1.1rem; }
.links ul, .plain { list-style: none; padding: 0; }
.links li, .plain li { margin-bottom: 8px; }
.contact { color: var(--muted); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 20px 0 28px; font-size: 0.9rem; color: var(--muted); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 10px; }
.site-footer .legal { margin: 0; }

@media print {
  .site-header, .site-footer, .toc, .skip, .to-top { display: none; }
  body { background: #fff; }
  a { color: inherit; }
}
