/* ==========================================================================
   GRUPO INDÓMITO · sistema base compartido
   Tokens, reset, tipografía, componentes. Cada web añade su hoja propia.
   Sin fuentes externas: pilas tipográficas del sistema.
   ========================================================================== */

:root {
  /* Paleta de marca */
  --ink: #191b1a;          /* carbón */
  --ink-2: #242726;
  --paper: #faf9f6;        /* blanco cálido */
  --stone: #ece6db;        /* piedra clara */
  --stone-2: #d9d0c0;      /* piedra */
  --bronze: #c4a46a;       /* bronce: fondos, detalles, sobre carbón */
  --bronze-deep: #7a5f2f;  /* bronce para texto sobre claro (AA) */
  --muted: #5a5d59;        /* texto secundario sobre claro (AA) */
  --muted-dark: #b6b1a7;   /* texto secundario sobre carbón (AA) */
  --line: rgba(25, 27, 26, 0.14);
  --line-dark: rgba(250, 249, 246, 0.16);
  --ok: #2f6b4a;
  --warn: #8a5a12;
  --bad: #9b2f25;

  /* Tipografía */
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, "URW Palladio L", P052, "Hoefler Text", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-lead: clamp(1.075rem, 0.95rem + 0.5vw, 1.25rem);
  --fs-h3: clamp(1.35rem, 1.1rem + 0.9vw, 1.75rem);
  --fs-h2: clamp(2rem, 1.35rem + 2.6vw, 3.5rem);
  --fs-h1: clamp(2.6rem, 1.4rem + 5vw, 5.75rem);

  /* Espaciado y medidas */
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1280px;
  --section: clamp(72px, 6vw + 40px, 152px);
  --radius: 2px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --header-h: 72px;
}

/* Reset ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: var(--fs-base); line-height: 1.6; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
img, video, svg { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--bronze); outline-offset: 3px; }
::selection { background: var(--bronze); color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* Utilidades ------------------------------------------------------------- */
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.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 { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--ink); color: var(--paper); padding: 10px 16px; text-decoration: none; transition: top 0.2s; }
.skip:focus { top: 12px; }

/* Tipografía ------------------------------------------------------------- */
.eyebrow { font-family: var(--sans); font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--bronze-deep); }
.display, h1, h2 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.015em; line-height: 1.04; }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-family: var(--serif); font-weight: 400; font-size: var(--fs-h3); line-height: 1.2; }
h1 em, h2 em, h3 em { font-style: italic; color: var(--bronze-deep); }
.lead { font-size: var(--fs-lead); line-height: 1.55; color: var(--muted); max-width: 40ch; }
.fine { font-size: var(--fs-sm); color: var(--muted); line-height: 1.5; }
.num { font-variant-numeric: tabular-nums; }
p + p { margin-top: 1em; }

/* Botones y enlaces ---------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.75em; min-height: 52px; padding: 0 28px; border: 1px solid var(--ink); border-radius: var(--radius); background: var(--ink); color: var(--paper); font-size: var(--fs-sm); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.3s var(--ease); }
.btn:hover { background: var(--ink-2); transform: translateY(-1px); }
.btn .arrow { transition: transform 0.3s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }
.btn--bronze { background: var(--bronze); border-color: var(--bronze); color: var(--ink); }
.btn--bronze:hover { background: #d1b47d; }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }
.btn--light { background: var(--paper); border-color: var(--paper); color: var(--ink); }
.btn--light:hover { background: #fff; }
.btn--ghost-light { background: transparent; border-color: var(--line-dark); color: var(--paper); }
.btn--ghost-light:hover { border-color: var(--paper); background: rgba(250,249,246,.06); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; transform: none; }

.link { display: inline-flex; align-items: center; gap: 0.5em; padding: 0; border: 0; background: none; font-size: var(--fs-sm); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none; background-image: linear-gradient(currentColor, currentColor); background-size: 0% 1px; background-position: 0 100%; background-repeat: no-repeat; padding-bottom: 4px; transition: background-size 0.4s var(--ease); }
.link:hover, .link:focus-visible { background-size: 100% 1px; }

/* Cabecera --------------------------------------------------------------- */
.site-header { position: sticky; top: 0; z-index: 50; height: var(--header-h); background: rgba(250, 249, 246, 0.9); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid transparent; transition: border-color 0.3s, background 0.3s; }
.site-header.is-scrolled { border-bottom-color: var(--line); }
.site-header .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; flex-shrink: 0; }
.brand__symbol { width: 36px; height: auto; }
.brand__word { height: 15px; width: auto; }
.brand__tag { font-size: 10px; font-weight: 700; letter-spacing: 0.42em; margin-left: -2px; padding-left: 12px; border-left: 1px solid currentColor; line-height: 1; }
.nav { display: flex; align-items: center; gap: clamp(18px, 2.2vw, 36px); }
.nav a:not(.btn) { font-size: var(--fs-sm); text-decoration: none; color: var(--muted); transition: color 0.2s; }
.nav a:not(.btn):hover, .nav a[aria-current="true"] { color: var(--ink); }
.nav .btn { min-height: 42px; padding: 0 20px; font-size: 12px; }
.menu-toggle { display: none; width: 44px; height: 44px; border: 0; background: none; padding: 10px; }
.menu-toggle span { display: block; height: 1.5px; background: currentColor; transition: transform 0.3s var(--ease), opacity 0.3s; }
.menu-toggle span + span { margin-top: 6px; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

@media (max-width: 900px) {
  .menu-toggle { display: block; }
  .nav { position: fixed; inset: var(--header-h) 0 auto 0; flex-direction: column; align-items: stretch; gap: 0; padding: 8px var(--gutter) 24px; background: var(--paper); border-bottom: 1px solid var(--line); transform: translateY(-8px); opacity: 0; visibility: hidden; transition: opacity 0.25s, transform 0.25s var(--ease), visibility 0.25s; }
  .nav.is-open { opacity: 1; visibility: visible; transform: none; }
  .nav a:not(.btn) { padding: 16px 0; border-bottom: 1px solid var(--line); font-size: 1rem; color: var(--ink); }
  .nav .btn { margin-top: 20px; min-height: 52px; }
}

/* Secciones y revelado --------------------------------------------------- */
.section { padding-block: var(--section); }
.section-head { display: grid; gap: 20px; margin-bottom: clamp(40px, 5vw, 72px); max-width: 760px; }
.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

.js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.js [data-reveal].is-in { opacity: 1; transform: none; }
.js [data-reveal="fade"] { transform: none; }
@media (prefers-reduced-motion: reduce) { .js [data-reveal] { opacity: 1; transform: none; } }

/* Formularios ------------------------------------------------------------ */
.field { display: grid; gap: 8px; align-content: start; }
.field label, .field .label { font-size: var(--fs-sm); font-weight: 600; }
.field input, .field select, .field textarea { width: 100%; min-height: 50px; padding: 12px 14px; border: 1px solid var(--stone-2); border-radius: var(--radius); background: #fff; font-size: 1rem; transition: border-color 0.2s, box-shadow 0.2s; }
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(196, 164, 106, 0.35); }
.field [aria-invalid="true"] { border-color: var(--bad); }
.field .hint { font-size: var(--fs-xs); color: var(--muted); }
.field .error { font-size: var(--fs-xs); color: var(--bad); font-weight: 600; }
.check { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; font-size: var(--fs-sm); line-height: 1.5; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--ink); }
.privacy-box { padding: 16px 18px; border-left: 2px solid var(--bronze); background: rgba(236, 230, 219, 0.55); font-size: var(--fs-xs); line-height: 1.55; color: var(--muted); }
.privacy-box strong { color: var(--ink); }
.status { padding: 14px 16px; border: 1px solid var(--line); font-size: var(--fs-sm); background: #fff; }
.status--ok { border-color: rgba(47, 107, 74, 0.45); }
.status--warn { border-color: rgba(138, 90, 18, 0.45); }
.status--bad { border-color: rgba(155, 47, 37, 0.5); }

/* Diálogos --------------------------------------------------------------- */
dialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: clamp(24px, 4vw, 40px); border: 0; border-radius: var(--radius); background: var(--paper); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3); }
dialog::backdrop { background: rgba(25, 27, 26, 0.6); }
dialog h2 { font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.2rem); margin-bottom: 16px; }
.dialog-close { position: absolute; top: 12px; right: 12px; min-width: 44px; min-height: 44px; border: 0; background: none; font-size: var(--fs-sm); }
.cookie-row { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); font-size: var(--fs-sm); }
.cookie-row small { display: block; color: var(--muted); }

/* Páginas legales -------------------------------------------------------- */
.legal { padding-block: clamp(48px, 6vw, 96px) var(--section); }
.legal .wrap { max-width: 820px; }
.legal h1 { font-size: clamp(2.2rem, 1.6rem + 2.5vw, 3.5rem); margin: 16px 0 24px; }
.legal h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem); margin: 48px 0 14px; line-height: 1.2; }
.legal h3 { font-size: 1.15rem; margin: 28px 0 10px; font-family: var(--sans); font-weight: 600; }
.legal p, .legal li { color: #333633; }
.legal ul { padding-left: 1.2em; }
.legal li + li { margin-top: 6px; }
.legal table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); margin: 16px 0; }
.legal th, .legal td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.legal th { font-weight: 600; background: var(--stone); }
.legal .table-scroll { overflow-x: auto; }
.draft-banner { margin-bottom: 32px; padding: 16px 18px; border: 1px solid rgba(138, 90, 18, 0.45); background: #fbf4e6; font-size: var(--fs-sm); }
.pending { background: #fbf0d9; padding: 0 4px; border-radius: 2px; font-weight: 600; color: #6b4a10; }

/* Pie -------------------------------------------------------------------- */
.site-footer { background: var(--ink); color: var(--paper); padding-block: clamp(56px, 6vw, 96px) 32px; }
.site-footer a { color: var(--paper); }
.footer-grid { display: grid; gap: 40px; grid-template-columns: 1.4fr 1fr 1fr; }
.footer-brand img { width: 64px; margin-bottom: 20px; }
.footer-brand p { color: var(--muted-dark); font-size: var(--fs-sm); max-width: 34ch; }
.footer-col h2 { font-family: var(--sans); font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--bronze); margin-bottom: 16px; }
.footer-col ul { list-style: none; padding: 0; display: grid; gap: 10px; }
.footer-col a, .footer-col button { font-size: var(--fs-sm); text-decoration: none; color: var(--paper); background: none; border: 0; padding: 0; text-align: left; opacity: 0.85; }
.footer-col a:hover, .footer-col button:hover { opacity: 1; text-decoration: underline; }
.footer-legal { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line-dark); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: var(--fs-xs); color: var(--muted-dark); }
@media (max-width: 760px) { .footer-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 420px) { .footer-grid { grid-template-columns: minmax(0, 1fr); } }
