/* ============================================================
   LEGAL PAGES — shared styles for aviso-legal.html + privacidad.html
   Mirrors the design tokens from index.html so the experience
   feels continuous, but stays lighter (no JS, no animations).
   ============================================================ */
:root {
  --bg:             oklch(0.16 0.005 240);
  --bg-deep:        oklch(0.12 0.005 240);
  --surface:        oklch(0.21 0.008 240);
  --ink:            oklch(0.96 0.005 240);
  --ink-muted:      oklch(0.70 0.012 240);
  --ink-dim:        oklch(0.52 0.012 240);
  --accent:         oklch(0.78 0.13 195);
  --border:         oklch(0.96 0.005 240 / 0.08);
  --border-strong:  oklch(0.96 0.005 240 / 0.18);

  --font-display: "Cabinet Grotesk", system-ui, sans-serif;
  --font-body:    "Switzer", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, monospace;

  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;

  color-scheme: dark light;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg:             oklch(0.985 0.003 240);
    --bg-deep:        oklch(0.955 0.005 240);
    --surface:        oklch(0.975 0.005 240);
    --ink:            oklch(0.18 0.012 240);
    --ink-muted:      oklch(0.42 0.014 240);
    --ink-dim:        oklch(0.60 0.012 240);
    --accent:         oklch(0.52 0.16 195);
    --border:         oklch(0.18 0.012 240 / 0.10);
    --border-strong:  oklch(0.18 0.012 240 / 0.22);
  }
}

@font-face {
  font-family: "Cabinet Grotesk";
  font-weight: 800; font-style: normal; font-display: swap;
  src: url("fonts/cabinet-grotesk-800.woff2") format("woff2");
}
@font-face {
  font-family: "Cabinet Grotesk";
  font-weight: 500; font-style: normal; font-display: swap;
  src: url("fonts/cabinet-grotesk-500.woff2") format("woff2");
}
@font-face {
  font-family: "Switzer";
  font-weight: 400; font-style: normal; font-display: swap;
  src: url("fonts/switzer-400.woff2") format("woff2");
}
@font-face {
  font-family: "Switzer";
  font-weight: 500; font-style: normal; font-display: swap;
  src: url("fonts/switzer-500.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-weight: 400; font-style: normal; font-display: swap;
  src: url("fonts/jetbrains-mono-400.woff2") format("woff2");
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: 4rem;
}

/* ============================================================
   VIEW TRANSITIONS API — cross-document navigation.
   Same definitions as index.html so transitions are symmetric.
   ============================================================ */
@view-transition {
  navigation: auto;
}
.logo { view-transition-name: site-logo; }
footer { view-transition-name: site-footer; }
header { view-transition-name: site-header; }
main { view-transition-name: page-root; }

::view-transition-old(root) {
  animation: 280ms cubic-bezier(0.4, 0, 0.2, 1) both vtFadeOut;
}
::view-transition-new(root) {
  animation: 380ms cubic-bezier(0.2, 0, 0, 1) 60ms both vtFadeIn;
}
::view-transition-old(page-root) {
  animation: 240ms cubic-bezier(0.4, 0, 0.2, 1) both vtSlideOut;
}
::view-transition-new(page-root) {
  animation: 380ms cubic-bezier(0.2, 0, 0, 1) 80ms both vtSlideIn;
}
::view-transition-old(site-logo),
::view-transition-new(site-logo),
::view-transition-old(site-header),
::view-transition-new(site-header),
::view-transition-old(site-footer),
::view-transition-new(site-footer) {
  animation: 320ms cubic-bezier(0.2, 0, 0, 1) both;
}

@keyframes vtFadeOut { to { opacity: 0; } }
@keyframes vtFadeIn  { from { opacity: 0; } }
@keyframes vtSlideOut {
  to { opacity: 0; transform: translateY(-12px); }
}
@keyframes vtSlideIn {
  from { opacity: 0; transform: translateY(14px); }
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root),
  ::view-transition-old(page-root),
  ::view-transition-new(page-root),
  ::view-transition-old(site-logo),
  ::view-transition-new(site-logo),
  ::view-transition-old(site-header),
  ::view-transition-new(site-header),
  ::view-transition-old(site-footer),
  ::view-transition-new(site-footer) {
    animation: 120ms linear both vtFadeOut;
  }
  ::view-transition-new(root) { animation: 160ms linear both vtFadeIn; }
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

/* Header — sticky, plain */
header {
  position: sticky; top: 0;
  z-index: 50;
  background: oklch(0.16 0.005 240 / 0.82);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
@media (prefers-color-scheme: light) {
  header { background: oklch(0.985 0.003 240 / 0.85); }
}
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-4);
  max-width: 1240px;
  margin: 0 auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}
.logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
}
.logo .dot {
  display: inline-block;
  width: 0.45rem; height: 0.45rem;
  background: var(--accent);
  border-radius: var(--radius-pill);
  transform: translateY(1px);
}
.back-link {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink-muted);
  text-decoration: none;
  transition: color 140ms cubic-bezier(0.23, 1, 0.32, 1);
}
.back-link:hover { color: var(--accent); }

/* Page header */
.page-head {
  padding: var(--space-24) 0 var(--space-12);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-12);
}
.page-head .eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--accent);
  text-transform: lowercase;
  display: inline-block;
  margin-bottom: var(--space-3);
}
.page-head h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 4vw, 2.75rem);
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: var(--space-4);
  text-wrap: balance;
}
.page-head .meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-dim);
  letter-spacing: 0.02em;
}

/* TOC */
.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-8);
  margin-bottom: var(--space-16);
}
.toc h2 {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--ink-dim);
  font-weight: 500;
  text-transform: lowercase;
  margin-bottom: var(--space-4);
}
.toc ol {
  list-style: none;
  counter-reset: toc;
  display: grid;
  gap: 0.4rem;
}
.toc li { counter-increment: toc; }
.toc a {
  display: flex;
  gap: 0.6rem;
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 0.92rem;
  padding-block: 0.2rem;
  transition: color 140ms cubic-bezier(0.23, 1, 0.32, 1);
}
.toc a::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--font-mono);
  color: var(--ink-dim);
  flex-shrink: 0;
  width: 1.8em;
}
.toc a:hover { color: var(--ink); }

/* Article content */
article section {
  margin-bottom: var(--space-12);
  scroll-margin-top: 5rem;
}
article h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.3rem, 2.5vw, 1.7rem);
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: var(--space-4);
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  text-wrap: balance;
}
article h2::before {
  content: attr(data-num);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
article h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.05rem;
  margin: var(--space-6) 0 var(--space-3);
  color: var(--ink);
}
article p, article li {
  color: var(--ink-muted);
  font-size: 0.97rem;
  margin-bottom: var(--space-3);
  max-width: 64ch;
}
article p strong { color: var(--ink); font-weight: 600; }
article ul, article ol {
  margin: var(--space-3) 0 var(--space-4) var(--space-6);
}
article ul { list-style: disc; }
article li { padding-left: 0.3rem; }
article a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 140ms cubic-bezier(0.23, 1, 0.32, 1);
}
article a:hover { color: var(--ink); }

/* Definition list — for "Datos del responsable" type blocks */
dl.legal-data {
  display: grid;
  grid-template-columns: minmax(140px, 28%) 1fr;
  gap: var(--space-3) var(--space-6);
  padding: var(--space-6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin: var(--space-4) 0 var(--space-6);
}
dl.legal-data dt {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-dim);
  letter-spacing: 0.03em;
  text-transform: lowercase;
}
dl.legal-data dd {
  font-size: 0.95rem;
  color: var(--ink);
}
.placeholder {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  background: oklch(0.78 0.13 195 / 0.10);
  padding: 0.1rem 0.5rem;
  border-radius: var(--radius-sm);
}
@media (prefers-color-scheme: light) {
  .placeholder {
    background: oklch(0.52 0.16 195 / 0.10);
  }
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: var(--space-12) 0;
  margin-top: var(--space-24);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink-dim);
  text-align: center;
}
footer a {
  color: var(--ink-muted);
  text-decoration: none;
  margin-inline: 0.6rem;
}
footer a:hover { color: var(--accent); }

@media (max-width: 600px) {
  dl.legal-data { grid-template-columns: 1fr; gap: var(--space-2); }
  dl.legal-data dt { margin-top: var(--space-2); }
  article h2 { flex-direction: column; gap: 0.2rem; }
}

/* Focus visibility */
:focus { outline: none; }
a:focus-visible, button:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px var(--bg),
    0 0 0 4px var(--accent);
  border-radius: var(--radius-sm);
}
