/* ══════════════════════════════════════════════════
   FERPLEXIA — SISTEMA DE DISEÑO COMPARTIDO
   Usado por las páginas de contenido (privacidad, términos).
   Los tokens, el header y el footer son una copia fiel de
   los de index.html: cualquier cambio de marca debe
   aplicarse en ambos lugares.
══════════════════════════════════════════════════ */

:root {
  color-scheme: light dark;

  --bg:        light-dark(oklch(0.98 0.004 260), oklch(0.17 0.014 260));
  --surface:   light-dark(#fff,                  oklch(0.215 0.016 260));
  --surface-2: light-dark(oklch(0.98 0.004 260), oklch(0.245 0.016 260));
  --header-bg: light-dark(oklch(0.98 0.004 260 / 0.82), oklch(0.17 0.014 260 / 0.82));

  --ink:       light-dark(oklch(0.22 0.02 260), oklch(0.96 0.005 260));
  --ink-2:     light-dark(oklch(0.28 0.02 260), oklch(0.90 0.008 260));
  --ink-3:     light-dark(oklch(0.25 0.02 260), oklch(0.93 0.008 260));
  --muted:     light-dark(oklch(0.45 0.02 260), oklch(0.72 0.012 260));
  --muted-2:   light-dark(oklch(0.5 0.02 260),  oklch(0.68 0.012 260));
  --muted-3:   light-dark(oklch(0.58 0.02 260), oklch(0.645 0.012 260));
  --muted-4:   light-dark(oklch(0.6 0.02 260),  oklch(0.625 0.012 260));

  --brand:      light-dark(oklch(0.52 0.16 262), oklch(0.70 0.15 262));
  --brand-dark: light-dark(oklch(0.44 0.16 262), oklch(0.80 0.12 262));
  --brand-soft: light-dark(oklch(0.94 0.02 262), oklch(0.30 0.05 262));
  --brand-halo: light-dark(oklch(0.96 0.03 262), oklch(0.24 0.045 262));
  --brand-ink:  light-dark(oklch(0.42 0.12 262), oklch(0.84 0.10 262));
  --on-brand:   light-dark(#fff, oklch(0.16 0.04 262));

  --line:           light-dark(oklch(0.91 0.008 260), oklch(0.315 0.014 260));
  --line-2:         light-dark(oklch(0.94 0.006 260), oklch(0.275 0.014 260));
  --line-3:         light-dark(oklch(0.96 0.004 260), oklch(0.25 0.012 260));
  --line-section:   light-dark(oklch(0.92 0.008 260), oklch(0.27 0.014 260));
  --btn-line:       light-dark(oklch(0.89 0.008 260), oklch(0.34 0.014 260));
  --btn-line-hover: light-dark(oklch(0.70 0.02 260),  oklch(0.52 0.02 260));

  --ok:      light-dark(oklch(0.52 0.11 160), oklch(0.74 0.13 160));
  --ok-bg:   light-dark(oklch(0.93 0.05 160), oklch(0.30 0.06 160));
  --ok-ink:  light-dark(oklch(0.42 0.11 160), oklch(0.84 0.12 160));

  --dark:      light-dark(oklch(0.22 0.02 260), oklch(0.115 0.012 260));
  --dark-text: oklch(0.78 0.01 260);

  --sh-c: light-dark(oklch(0.4 0.06 262 / 0.6), oklch(0.02 0.01 260 / 0.75));
  --sh-sm: 0 20px 40px -30px var(--sh-c);
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"]  { color-scheme: dark; }

/* ══════════════════════════════════════════════════
   BASE
══════════════════════════════════════════════════ */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Instrument Sans", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-wrap: pretty;
  overflow-x: clip;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.03em; }
p { margin: 0; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.page { max-width: 100%; overflow-x: clip; }
.wrap { max-width: 1240px; margin: 0 auto; }
.mono { font-family: 'IBM Plex Mono', monospace; }

.eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-3);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--muted-4); display: block; flex: 0 0 auto; }
.eyebrow--brand { color: var(--brand); }
.eyebrow--brand::before { background: var(--brand); }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--brand); color: var(--on-brand);
  padding: 12px 18px; border-radius: 10px; font-size: 14px; font-weight: 500;
  transition: top .2s ease;
}
.skip-link:focus { top: 12px; color: var(--on-brand); }

section { padding: clamp(40px, 8vh, 90px) clamp(18px, 4vw, 40px); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 500;
  padding: 15px 24px;
  border-radius: 12px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .18s ease, border-color .18s ease, color .18s ease;
}
.btn--primary { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.btn--primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: var(--on-brand); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; } }
:root.theme-switching, :root.theme-switching *, :root.theme-switching *::before, :root.theme-switching *::after {
  transition: background-color .28s ease, border-color .28s ease, color .28s ease, box-shadow .28s ease, fill .28s ease !important;
}
@media (prefers-reduced-motion: reduce) { :root.theme-switching, :root.theme-switching * { transition: none !important; } }

/* ══════════════════════════════════════════════════
   HEADER
══════════════════════════════════════════════════ */
.site-header { position: sticky; top: 0; z-index: 60; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); background: var(--header-bg); border-bottom: 1px solid var(--line); }
.site-header__bar { max-width: 1240px; margin: 0 auto; padding: 14px clamp(16px, 4vw, 40px); display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand span { font-weight: 600; letter-spacing: -0.02em; font-size: 17px; }
.brand__logo { width: 28px; height: 28px; display: block; flex: 0 0 auto; }

.site-nav { display: flex; gap: 22px; margin-left: auto; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.site-nav a { font-size: 14px; color: var(--muted); }
.site-nav a:hover { color: var(--ink); }

.header-actions { display: flex; align-items: center; gap: 10px; }
.theme-btn {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 0;
  border-radius: 12px; border: 1px solid var(--btn-line);
  background: var(--surface); color: var(--ink-2); cursor: pointer;
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.theme-btn:hover { border-color: var(--btn-line-hover); color: var(--ink); }
.theme-btn svg { width: 18px; height: 18px; display: block; }
.theme-btn .i-sun { display: none; }
:root[data-scheme="dark"] .theme-btn .i-sun  { display: block; }
:root[data-scheme="dark"] .theme-btn .i-moon { display: none; }

.menu-btn { display: none; align-items: center; justify-content: center; gap: 6px; width: 46px; height: 44px; min-height: 44px; border-radius: 12px; border: 1px solid var(--btn-line); background: var(--surface); cursor: pointer; flex-direction: column; }
.menu-btn span { display: block; width: 18px; height: 1.5px; background: var(--ink-2); }
.menu-panel { display: none; border-top: 1px solid var(--line); background: var(--bg); padding: 10px clamp(16px, 4vw, 40px) 20px; }
.menu-panel a { display: block; font-size: 16px; color: var(--ink-2); padding: 13px 4px; border-bottom: 1px solid var(--line-2); }
.menu-panel .btn { margin-top: 12px; width: 100%; }
.site-header.is-open .menu-panel { display: grid; }

@media (max-width: 999px) {
  .site-nav { display: none; }
  .menu-btn { display: flex; }
  .header-actions { margin-left: auto; }
}

/* ══════════════════════════════════════════════════
   MIGA DE PAN
══════════════════════════════════════════════════ */
.breadcrumb {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px clamp(18px, 4vw, 40px) 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: 13px; color: var(--muted-3);
}
.breadcrumb a { color: var(--muted-3); }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb span[aria-current] { color: var(--muted); }

/* ══════════════════════════════════════════════════
   ARTÍCULO LEGAL — encabezado y prosa
══════════════════════════════════════════════════ */
.article-hero { padding: clamp(24px, 5vh, 48px) clamp(18px, 4vw, 40px) clamp(32px, 6vh, 56px); }
.article-hero__inner { max-width: 780px; margin: 0 auto; }
.article-hero h1 { font-size: clamp(32px, 5vw, 50px); line-height: 1.06; letter-spacing: -0.03em; margin: 16px 0 14px; }
.article-hero .lead { font-size: clamp(16px, 1.6vw, 18px); line-height: 1.6; color: var(--muted); max-width: 62ch; }
.article-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 20px; font-size: 12.5px; color: var(--muted-3); font-family: 'IBM Plex Mono', monospace; }

.article-body { padding-top: 0; padding-bottom: clamp(40px, 7vh, 70px); }
.article-body__inner { max-width: 780px; margin: 0 auto; }
.prose { max-width: 68ch; }
.prose > * + * { margin-top: 16px; }
.prose h2 { font-size: clamp(20px, 2.4vw, 26px); line-height: 1.2; letter-spacing: -0.02em; margin-top: 44px; padding-top: 26px; border-top: 1px solid var(--line-section); }
.prose > h2:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.prose p { font-size: 15.5px; line-height: 1.7; color: var(--ink-2); }
.prose ul, .prose ol { margin: 0; padding-left: 22px; display: grid; gap: 8px; }
.prose li { font-size: 15.5px; line-height: 1.6; color: var(--ink-2); }
.prose li::marker { color: var(--muted-3); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }

.callout { background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; }
.callout .label { font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-3); margin-bottom: 8px; }
.callout p { color: var(--ink-2); font-size: 14px; }

.back-link { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; margin-bottom: 20px; }

/* ══════════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════════ */
.site-footer { padding: 48px clamp(18px, 4vw, 40px) 36px; background: var(--dark); color: oklch(0.72 0.01 260); border-top: 1px solid oklch(0.3 0.02 260); }
.site-footer__inner { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 30px 24px; font-size: 13px; }
.footer-brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 500; font-size: 15px; }
.footer-brand svg { width: 24px; height: 24px; }
.site-footer .tagline { margin-top: 10px; max-width: 28ch; line-height: 1.5; }
.site-footer .col-title { font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: oklch(0.55 0.01 260); margin-bottom: 14px; }
.footer-links { display: grid; gap: 10px; }
.footer-links a { color: inherit; }
.footer-links a:hover { color: #fff; }
.footer-social { display: flex; align-items: center; gap: 10px; }
.footer-social a { width: 34px; height: 34px; border-radius: 10px; background: oklch(0.27 0.015 260); display: flex; align-items: center; justify-content: center; color: oklch(0.75 0.01 260); transition: background .2s ease, color .2s ease, transform .2s ease; }
.footer-social a:hover { background: oklch(0.32 0.02 260); color: #fff; transform: translateY(-2px); }
.footer-social svg { width: 15px; height: 15px; }
.site-footer__bottom { max-width: 1240px; margin: 36px auto 0; padding-top: 20px; border-top: 1px solid oklch(0.28 0.02 260); font-size: 12px; color: oklch(0.55 0.01 260); }

@media (max-width: 639px) {
  .theme-btn { width: 46px; height: 44px; }
  button { min-height: 44px; }
  .site-footer__inner { grid-template-columns: 1fr; }
}
