/* ============================================================
   Custodir — Legal / document pages
   Shared stylesheet. Matches the landing palette & typography.
   ============================================================ */
:root {
  --ink: #0A0A0B;
  --ink-2: #141416;
  --ink-3: #1d1d20;
  --paper: #FAF8F3;
  --paper-2: #F1ECE0;
  --line-d: rgba(245,239,217,0.10);
  --line-l: rgba(10,10,11,0.10);
  --gold: #D4AF37;
  --gold-2: #E8C66A;
  --gold-deep: #9C7A3F;
  --cream: #F5EFD9;
  --green: #4FAE6F;
  --red: #C8543B;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --sans: 'Inter', system-ui, sans-serif;
  --serif: 'Fraunces', Georgia, serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
html, body {
  margin: 0; padding: 0;
  background: var(--ink); color: var(--cream);
  font-family: var(--sans); -webkit-font-smoothing: antialiased;
}
::selection { background: var(--gold); color: var(--ink); }
a { color: inherit; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 64px; }
@media (max-width: 900px) { .wrap { padding: 0 24px; } }

/* ==================== NAV ==================== */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  background: rgba(10,10,11,0.72);
  border-bottom: 1px solid var(--line-d);
}
.nav-row { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand-mk { width: 32px; height: 32px; }
.brand-name { font-family: var(--serif); font-size: 22px; letter-spacing: -0.02em; }
.brand-name em { font-style: italic; color: var(--gold); }
.brand-name .pt { color: var(--gold); }
.nav-links { display: flex; gap: 30px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; opacity: 0.7; }
.nav-links a { text-decoration: none; transition: opacity .2s, color .2s; }
.nav-links a:hover { opacity: 1; color: var(--gold); }
.nav-links a.active { color: var(--gold); opacity: 1; }
.nav-cta {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase;
  border: 1px solid var(--gold); color: var(--gold); padding: 8px 18px; border-radius: 999px;
  text-decoration: none; transition: all .2s; white-space: nowrap;
}
.nav-cta:hover { background: var(--gold); color: var(--ink); }
@media (max-width: 820px) { .nav-links { display: none; } }

/* ==================== DOC HEADER ==================== */
.doc-head {
  position: relative; overflow: hidden;
  padding: 88px 0 56px;
  border-bottom: 1px solid var(--line-d);
}
.doc-head::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(212,175,55,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212,175,55,0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  pointer-events: none;
  mask-image: radial-gradient(ellipse 70% 80% at 20% 30%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 20% 30%, #000 20%, transparent 75%);
}
.doc-head .wrap { position: relative; z-index: 2; }
.crumb {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em;
  opacity: 0.5; margin-bottom: 28px;
}
.crumb a { text-decoration: none; }
.crumb a:hover { color: var(--gold); }
.crumb .sep { opacity: 0.4; margin: 0 8px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase;
  opacity: 0.65; margin-bottom: 22px;
}
.eyebrow::before { content: ''; width: 32px; height: 1px; background: var(--gold); }
h1.doc-title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(40px, 6vw, 76px); line-height: 0.98; letter-spacing: -0.035em;
  font-variation-settings: 'opsz' 144;
  margin: 0 0 30px; max-width: 16ch;
}
h1.doc-title em { font-style: italic; color: var(--gold); font-weight: 300; }

/* meta line (version / date / foro) */
.doc-meta {
  display: flex; flex-wrap: wrap; gap: 0;
  border: 1px solid var(--line-d); border-radius: 10px; overflow: hidden;
  background: var(--ink-2); max-width: 760px;
}
.doc-meta .cell {
  padding: 16px 22px; flex: 1 1 auto; min-width: 160px;
  border-right: 1px solid var(--line-d);
}
.doc-meta .cell:last-child { border-right: none; }
.doc-meta .k { font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; opacity: 0.5; }
.doc-meta .v { font-family: var(--serif); font-size: 19px; margin-top: 6px; letter-spacing: -0.01em; }
.doc-meta .v em { font-style: italic; color: var(--gold); }

/* ==================== LAYOUT (TOC + body) ==================== */
.doc-layout {
  display: grid; grid-template-columns: 232px 1fr; gap: 72px;
  padding: 72px 0 120px; align-items: start;
}
@media (max-width: 980px) { .doc-layout { grid-template-columns: 1fr; gap: 8px; } }

.toc { position: sticky; top: 96px; }
@media (max-width: 980px) { .toc { display: none; } }
.toc-label {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
  opacity: 0.45; margin-bottom: 18px;
}
.toc ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.toc li a {
  display: flex; gap: 12px; align-items: baseline;
  text-decoration: none; padding: 7px 0;
  font-size: 14px; line-height: 1.35; opacity: 0.6;
  border-left: 1px solid transparent; padding-left: 14px; margin-left: -1px;
  transition: opacity .2s, color .2s, border-color .2s;
}
.toc li a .n { font-family: var(--mono); font-size: 11px; color: var(--gold); opacity: 0.8; flex-shrink: 0; }
.toc li a:hover { opacity: 1; color: var(--gold); }
.toc li a.active { opacity: 1; color: var(--cream); border-left-color: var(--gold); }
.toc li a.active .n { opacity: 1; }

/* ==================== DOC BODY ==================== */
.doc-body { max-width: 820px; }
.doc-body section { padding: 0 0 56px; scroll-margin-top: 96px; }
.doc-body section + section { border-top: 1px solid var(--line-d); padding-top: 56px; }

.sec-num { font-family: var(--mono); font-size: 12px; letter-spacing: 0.2em; color: var(--gold); }
.doc-body h2 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(28px, 3.4vw, 40px); line-height: 1.05; letter-spacing: -0.025em;
  margin: 12px 0 24px;
}
.doc-body h2 em { font-style: italic; color: var(--gold); }
.doc-body h3 {
  font-family: var(--serif); font-weight: 500;
  font-size: 21px; letter-spacing: -0.015em; margin: 36px 0 14px;
}
.doc-body p { font-size: 17px; line-height: 1.7; opacity: 0.82; margin: 0 0 18px; }
.doc-body p:last-child { margin-bottom: 0; }
.doc-body a.link { color: var(--gold); text-decoration: none; border-bottom: 1px solid rgba(212,175,55,0.35); transition: border-color .2s; }
.doc-body a.link:hover { border-color: var(--gold); }
.doc-body strong { color: var(--cream); font-weight: 600; }
.doc-body code {
  font-family: var(--mono); font-size: 0.86em;
  background: rgba(245,239,217,0.06); border: 1px solid var(--line-d);
  padding: 1px 6px; border-radius: 4px; color: var(--gold-2);
}

/* lists */
.doc-body ul { list-style: none; padding: 0; margin: 0 0 18px; display: flex; flex-direction: column; gap: 12px; }
.doc-body ul li { font-size: 17px; line-height: 1.6; opacity: 0.82; padding-left: 26px; position: relative; }
.doc-body ul li::before { content: '—'; color: var(--gold); position: absolute; left: 0; }
.doc-body ul li.no::before { content: '×'; color: var(--red); font-family: var(--mono); }
.doc-body ul li.yes::before { content: '✓'; color: var(--green); font-family: var(--mono); }
.doc-body ol.steps { list-style: none; counter-reset: s; padding: 0; margin: 0 0 18px; display: flex; flex-direction: column; gap: 14px; }
.doc-body ol.steps li {
  counter-increment: s; font-size: 17px; line-height: 1.6; opacity: 0.85;
  padding-left: 44px; position: relative;
}
.doc-body ol.steps li::before {
  content: counter(s, decimal-leading-zero);
  position: absolute; left: 0; top: 1px;
  font-family: var(--mono); font-size: 12px; color: var(--gold);
  border: 1px solid var(--line-d); border-radius: 6px;
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
}

/* callout / disclaimer blockquote */
.callout {
  border: 1px solid var(--line-d); border-left: 2px solid var(--gold);
  border-radius: 8px; background: rgba(212,175,55,0.05);
  padding: 22px 26px; margin: 0 0 24px;
}
.callout p { margin: 0; opacity: 0.9; }
.callout p + p { margin-top: 12px; }
.callout.warn { border-left-color: var(--red); background: rgba(200,84,59,0.06); }
.callout .tag { font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); display: block; margin-bottom: 10px; }
.callout.warn .tag { color: var(--red); }

/* lead one-liner (privacy summary) */
.lead-line {
  font-family: var(--serif); font-size: clamp(22px, 2.6vw, 30px); line-height: 1.4;
  letter-spacing: -0.01em; opacity: 0.95; margin: 0 0 8px;
}
.lead-line em { font-style: italic; color: var(--gold); }

/* tables */
.tbl-wrap { border: 1px solid var(--line-d); border-radius: 10px; overflow: hidden; margin: 0 0 24px; overflow-x: auto; }
table.doc-tbl { width: 100%; border-collapse: collapse; font-family: var(--sans); min-width: 520px; }
table.doc-tbl th, table.doc-tbl td {
  padding: 14px 18px; text-align: left; vertical-align: top;
  border-bottom: 1px solid var(--line-d); font-size: 14.5px; line-height: 1.5;
}
table.doc-tbl th {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase;
  opacity: 0.6; font-weight: 500; background: rgba(245,239,217,0.03);
}
table.doc-tbl th.us { color: var(--gold); opacity: 1; background: rgba(212,175,55,0.08); border-bottom: 2px solid var(--gold-deep); }
table.doc-tbl td.us { background: rgba(212,175,55,0.04); }
table.doc-tbl tr:last-child td { border-bottom: none; }
table.doc-tbl td strong { color: var(--cream); }
table.doc-tbl td .mono { font-family: var(--mono); font-size: 13px; }
table.doc-tbl .yes { color: var(--green); font-family: var(--mono); }
table.doc-tbl .no { color: var(--red); font-family: var(--mono); opacity: 0.85; }
table.doc-tbl .partial { color: var(--gold-deep); font-family: var(--mono); font-size: 13px; }

/* footer note */
.doc-foot-note {
  font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.04em;
  opacity: 0.5; line-height: 1.7; margin-top: 8px;
}

/* ==================== FOOTER ==================== */
footer {
  border-top: 1px solid var(--line-d);
  padding: 48px 0 40px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em;
  opacity: 0.6;
}
.foot-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 24px; }
.foot-links { display: flex; gap: 26px; flex-wrap: wrap; }
.foot-row a { text-decoration: none; opacity: 0.85; }
.foot-row a:hover { color: var(--gold); opacity: 1; }
.foot-tag { width: 100%; opacity: 0.45; font-size: 11px; letter-spacing: 0.16em; }

/* reveal — content is ALWAYS opaque; only a subtle transform animates,
   so any stalled transition / capture fails to VISIBLE, never invisible. */
.reveal { transition: transform .7s cubic-bezier(.2,.7,.2,1); will-change: transform; }
html.js-anim .reveal:not(.in) { transform: translateY(20px); }
@media (prefers-reduced-motion: reduce) { html.js-anim .reveal:not(.in) { transform: none; } }
