/* STYX — shared styles (index.html, brand.html). Direction A, "A linha". Tokens per SITE_SPEC_v0. */

/* ---------- Tokens: dark first ---------- */
:root {
  color-scheme: dark;
  --bg: #0B1020;
  --bg2: #111A2E;
  --fg: #ECE8DF;
  --mute: #9AA4B8;
  --line: #B08D57;
  --river: #3C6E9F;
  --ok: #6FA37A;
  --warn: #C98B5A;
  --rule-soft: color-mix(in srgb, var(--mute) 28%, transparent);

  --font-sans: "Archivo", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --font-serif: "Spectral", Georgia, "Times New Roman", Times, serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  /* type scale 12 / 14 / 16 / 20 / 28 / 40 / 64 */
  --fs-12: 0.75rem; --fs-14: 0.875rem; --fs-16: 1rem; --fs-20: 1.25rem;
  --fs-28: 1.75rem; --fs-40: 2.5rem; --fs-64: 4rem;

  --maxw: 1120px;
  --gutter: 24px;
  --section-gap: 96px;
  --header-h: 56px;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #F2EFE8; --bg2: #FFFFFF; --fg: #10141F; --mute: #5B6474; --line: #8C6A3C; --river: #2F5B86;
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #F2EFE8; --bg2: #FFFFFF; --fg: #10141F; --mute: #5B6474; --line: #8C6A3C; --river: #2F5B86;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B1020; --bg2: #111A2E; --fg: #ECE8DF; --mute: #9AA4B8; --line: #B08D57; --river: #3C6E9F;
}
@media (max-width: 640px) {
  :root { --gutter: 16px; --section-gap: 56px; }
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--fs-16);
  line-height: 1.5;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ol, ul, figure, dl, dd { margin: 0; }
ol, ul { padding: 0; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration-color: var(--line); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--line); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--line); color: var(--bg); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: 16px; top: -48px; z-index: 20; background: var(--fg); color: var(--bg); padding: 8px 12px; }
.skip-link:focus { top: 8px; }

/* ---------- Layout ---------- */
.wrap {
  width: 100%;
  max-width: calc(var(--maxw) + 2 * var(--gutter));
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}
.section { position: relative; padding-block: var(--section-gap); }
/* the line is the only divider between sections (container width; the full-bleed line is reserved for the hero) */
.section + .section::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: min(var(--maxw), calc(100% - 2 * var(--gutter))); border-top: 1px solid var(--line);
}
.stack { display: flex; flex-direction: column; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 48px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 48px; }
@media (max-width: 860px) { .grid-3, .grid-2 { grid-template-columns: minmax(0, 1fr); gap: 40px; } }

/* ---------- Type ---------- */
.display { font-family: var(--font-sans); font-weight: 700; font-size: clamp(var(--fs-28), 4vw, var(--fs-40)); line-height: 1.1; letter-spacing: -0.02em; }
h2, .h2 { font-family: var(--font-sans); font-weight: 700; font-size: var(--fs-28); line-height: 1.15; letter-spacing: -0.015em; }
h3, .h3 { font-family: var(--font-sans); font-weight: 700; font-size: var(--fs-20); line-height: 1.2; letter-spacing: -0.01em; }
.eyebrow {
  font-family: var(--font-sans); font-weight: 500; font-size: var(--fs-12);
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--mute);
}
.prose, .lede { font-family: var(--font-serif); max-width: 65ch; }
.prose { font-size: var(--fs-16); line-height: 1.6; }
.lede { font-size: var(--fs-20); line-height: 1.5; }
.small { font-size: var(--fs-14); }
.mute { color: var(--mute); }
.mono, .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.caption { font-family: var(--font-mono); font-size: var(--fs-12); line-height: 1.5; color: var(--mute); font-variant-numeric: tabular-nums; }
.section-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 40px; }

/* ---------- The line ---------- */
.the-line { display: block; width: 100%; height: 0; margin: 0; border: 0; border-top: 1px solid var(--line); }
.the-line--bleed { width: 100%; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule-soft);
  padding-top: env(safe-area-inset-top);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: var(--header-h); }
.brand-link { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; letter-spacing: -0.02em; font-size: var(--fs-16); }
.brand-link svg { width: 24px; height: 24px; color: var(--line); flex: none; }
.site-nav ul { list-style: none; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 20px; }
.site-nav a {
  text-decoration: none; font-size: var(--fs-14); font-weight: 500; color: var(--mute);
  padding-block: 6px; border-bottom: 1px solid transparent;
}
.site-nav a:hover, .site-nav a[aria-current="true"] { color: var(--fg); border-bottom-color: var(--line); }
@media (max-width: 560px) {
  .site-header .wrap { flex-direction: column; align-items: flex-start; gap: 0; padding-block: 8px; }
  .site-nav ul { justify-content: flex-start; gap: 0 16px; }
  .site-nav a { font-size: var(--fs-12); }
}

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 40px calc(40px + env(safe-area-inset-bottom)); }
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 24px 48px; }
.site-footer .brand-link { font-size: var(--fs-20); }
.footer-meta { display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-14); color: var(--mute); }
.footer-meta .mono { color: var(--fg); user-select: all; -webkit-user-select: all; }
.legal { flex-basis: 100%; font-size: var(--fs-12); color: var(--mute); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.table-wrap:focus-visible { outline-offset: 4px; }
.data-table { width: 100%; border-collapse: collapse; font-size: var(--fs-14); }
.data-table th, .data-table td { padding: 12px 16px 12px 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule-soft); }
.data-table thead th {
  font-family: var(--font-sans); font-weight: 500; font-size: var(--fs-12); text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--mute); border-bottom: 1px solid var(--line); vertical-align: bottom;
}
.data-table tbody th { font-weight: 700; }
.data-table td.num, .data-table th.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table thead th.num { font-family: var(--font-sans); }

/* ---------- Buttons ---------- */
.button {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 18px;
  font-family: var(--font-sans); font-weight: 500; font-size: var(--fs-14); letter-spacing: 0.02em;
  color: var(--fg); background: transparent; border: 1px solid var(--line); border-radius: 0; text-decoration: none; cursor: pointer;
}
.button:hover { background: color-mix(in srgb, var(--line) 14%, transparent); }
.button[aria-disabled="true"] { cursor: default; color: var(--mute); }
.button[aria-disabled="true"]:hover { background: transparent; }
