/* Sabuco site styles. System fonts only, so pages make no third-party requests. */
:root {
  --bg: #f6f8f8;
  --surface: #ffffff;
  --fg: #1a2427;
  --muted: #56666b;
  --rule: #d9e1e2;
  --accent: #1d5c68;
  --accent-soft: #e3eef0;
  --font-head: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-body: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111719;
    --surface: #182124;
    --fg: #e3eaeb;
    --muted: #95a6aa;
    --rule: #2a373b;
    --accent: #7fc3cf;
    --accent-soft: #1c3036;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
}
img { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 0.15em; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
strong { font-weight: 600; }
p { margin: 0 0 1rem; }

.wrap {
  width: 100%;
  max-width: 68rem;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* Header and footer shared by every page */
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1.25rem;
}
.brand {
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.875rem;
  color: var(--accent);
  text-decoration: none;
}
main { flex: 1; }
.site-footer { border-top: 1px solid var(--rule); }
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
  padding-block: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--muted);
}
.site-footer nav { display: flex; gap: 1.25rem; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }

/* Home */
.home {
  display: grid;
  align-content: center;
  gap: 1.25rem;
  min-height: 60vh;
  padding-block: 4rem;
}
.home h1 {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(2.5rem, 1.5rem + 5vw, 5rem);
  line-height: 1;
  letter-spacing: -0.03em;
  margin: 0;
}
.home p { font-size: 1.25rem; color: var(--muted); max-width: 32rem; margin: 0; }
.home h2 {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.5rem;
  margin: 1.5rem 0 0;
}
.home a { color: var(--accent); }

/* Legal pages: a reading column with a sticky contents rail on wide screens */
.doc-head {
  display: grid;
  gap: 0.75rem;
  padding-block: 2.5rem 2rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2.5rem;
}
.doc-head h1 {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0;
  text-wrap: balance;
}
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--muted);
}
.layout {
  display: grid;
  grid-template-columns: 14rem minmax(0, 1fr);
  gap: 3.5rem;
  align-items: start;
  padding-bottom: 3rem;
}
nav.toc {
  position: sticky;
  top: 1.5rem;
  font-family: var(--font-head);
  font-size: 0.875rem;
}
.toc-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.75rem;
}
nav.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.125rem;
  counter-reset: toc;
}
nav.toc li { counter-increment: toc; }
nav.toc a {
  display: grid;
  grid-template-columns: 1.75rem 1fr;
  padding: 0.3rem 0.5rem 0.3rem 0;
  color: var(--fg);
  text-decoration: none;
  border-radius: 4px;
}
nav.toc a::before {
  content: counter(toc);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  padding-top: 0.15rem;
}
nav.toc a:hover { color: var(--accent); }

article { min-width: 0; max-width: 42rem; }
.summary {
  background: var(--accent-soft);
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 3rem;
}
.summary h2 {
  font-size: 0.8125rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 0.5rem;
  color: var(--accent);
}
.summary ul { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.35rem; }

article section { scroll-margin-top: 1.5rem; padding-bottom: 2.25rem; }
article section + section { border-top: 1px solid var(--rule); padding-top: 2.25rem; }
article h2 {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.375rem;
  line-height: 1.3;
  margin: 0 0 0.875rem;
  text-wrap: balance;
}
article h2 .num {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.875rem;
  color: var(--muted);
  margin-right: 0.6rem;
  vertical-align: 0.15em;
}
article h3 {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.0625rem;
  margin: 1.5rem 0 0.5rem;
}
ul.list { margin: 0 0 1rem; padding-left: 1.25rem; display: grid; gap: 0.4rem; }

.table-scroll { overflow-x: auto; margin: 0 0 1rem; }
table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; line-height: 1.5; }
th, td {
  text-align: left;
  vertical-align: top;
  padding: 0.7rem 0.75rem 0.7rem 0;
  border-bottom: 1px solid var(--rule);
}
th {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.contact-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin: 0 0 1rem;
}
.email { font-family: var(--font-mono); font-size: 1rem; overflow-wrap: anywhere; }
button.copy {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
}
button.copy:hover { background: var(--accent-soft); }

@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  nav.toc {
    position: static;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: 6px;
    padding: 1rem 1.25rem;
  }
  nav.toc ol { grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); }
}
