/* ==========================================================================
   virilo.com · v2 (2026)
   Vanilla CSS. Sin frameworks. Temas por CSS custom properties.
   Tipografías (autoalojadas vía download_assets.py):
     - Fraunces          → display / titulares
     - Instrument Sans   → cuerpo / UI
     - IBM Plex Mono     → datos, rankings, eyebrows
   ========================================================================== */

/* ---------- Reset mínimo ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }

/* ---------- Temas ---------- */
:root {
  /* Tema 1 · "blanco" (por defecto): fondo blanco, tinta azulada, naranja de marca */
  --bg: #ffffff;
  --bg-alt: #f6f7f9;
  --ink: #1a2233;
  --muted: #5b6577;
  --accent: #f39200;
  --accent-ink: #b16800;        /* naranja oscurecido: texto accesible sobre claro */
  --on-accent: #201500;
  --card: #ffffff;
  --line: #e7eaf0;
  --band: #2e3c55;              /* banda oscura (contratar) */
  --band-ink: #eef1f6;
  --band-muted: #c3cbd8;
  --nav-bg: rgba(255, 255, 255, .78);
  --shadow: 0 10px 30px rgba(26, 34, 51, .08);
  --grid-line: rgba(26, 34, 51, .07);
  --chip-bg: #fff4e2;
  --chip-ink: #8a5300;
  --focus: #1a56db;
}

html[data-theme="noche"] {
  --bg: #0e1420;
  --bg-alt: #131b2b;
  --ink: #edf1f8;
  --muted: #9aa5b8;
  --accent: #ffb340;
  --accent-ink: #ffc266;
  --on-accent: #241703;
  --card: #172134;
  --line: #24304a;
  --band: #060a12;
  --band-ink: #edf1f8;
  --band-muted: #9aa5b8;
  --nav-bg: rgba(14, 20, 32, .72);
  --shadow: 0 12px 34px rgba(0, 0, 0, .45);
  --grid-line: rgba(237, 241, 248, .06);
  --chip-bg: #2b2211;
  --chip-ink: #ffce80;
  --focus: #7aa7ff;
}

html[data-theme="marino"] {
  --bg: #f3f6fb;
  --bg-alt: #e9eef7;
  --ink: #22304a;
  --muted: #5d6b85;
  --accent: #2e4a76;
  --accent-ink: #2e4a76;
  --on-accent: #f4f8ff;
  --card: #ffffff;
  --line: #d9e1ee;
  --band: #22304a;
  --band-ink: #eef2fa;
  --band-muted: #bcc7da;
  --nav-bg: rgba(243, 246, 251, .8);
  --shadow: 0 10px 28px rgba(34, 48, 74, .10);
  --grid-line: rgba(34, 48, 74, .08);
  --chip-bg: #dfe8f6;
  --chip-ink: #2e4a76;
  --focus: #1a56db;
}

html[data-theme="esmeralda"] {
  --bg: #f4f8f6;
  --bg-alt: #eaf1ee;
  --ink: #14211d;
  --muted: #51645d;
  --accent: #0c8a72;
  --accent-ink: #0a705d;
  --on-accent: #f2fffb;
  --card: #ffffff;
  --line: #d8e4df;
  --band: #10312a;
  --band-ink: #ecf5f2;
  --band-muted: #b4c8c1;
  --nav-bg: rgba(244, 248, 246, .8);
  --shadow: 0 10px 28px rgba(16, 49, 42, .10);
  --grid-line: rgba(20, 33, 29, .07);
  --chip-bg: #dcefe9;
  --chip-ink: #0a5c4d;
  --focus: #1a56db;
}

/* ---------- Base ---------- */
body {
  font-family: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
}
h1, h2, h3 {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 .5em;
  text-wrap: balance;
}
p { margin: 0 0 1em; }
.mono { font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--ink); color: var(--bg); padding: .6rem 1rem; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

.container { width: min(1120px, 92vw); margin-inline: auto; }

.eyebrow {
  font-family: "IBM Plex Mono", monospace;
  font-size: .78rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent-ink); display: block; margin-bottom: .9rem;
}

section { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 46ch; margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.section-head h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); }
.section-head .lead { color: var(--muted); font-size: 1.05rem; margin: 0; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, box-shadow .25s ease;
}
.nav.is-scrolled { border-color: var(--line); box-shadow: 0 4px 24px rgba(0,0,0,.06); }
.nav-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .8rem 0; flex-wrap: wrap;
}
.brand {
  font-family: "Fraunces", Georgia, serif; font-weight: 600;
  font-size: clamp(1.15rem, 2.4vw, 1.45rem); text-decoration: none; color: var(--ink);
}
.brand .dot { color: var(--accent); }
.nav-actions { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
.nav-contact { display: flex; align-items: center; gap: .9rem; font-size: .95rem; }
.nav-contact a { display: inline-flex; align-items: center; gap: .4rem; text-decoration: none; color: var(--muted); }
.nav-contact a:hover { color: var(--ink); }
.nav-contact svg { width: 18px; height: 18px; stroke: currentColor; }
.nav-contact .label { display: inline; }

.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; font-size: .85rem; }
.lang a, .lang span { padding: .28rem .7rem; text-decoration: none; color: var(--muted); }
.lang .active { background: var(--accent); color: var(--on-accent); font-weight: 600; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .78rem 1.5rem; border-radius: 999px; border: 0;
  font-weight: 600; text-decoration: none; font-size: 1rem;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow); }
.btn-primary:hover { transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-ink); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: clip;
  padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(3.5rem, 8vw, 6rem);
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 44px 44px;
  background-position: center top;
}
.hero::after { /* difumina el grid hacia abajo */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 30%, var(--bg) 96%);
  pointer-events: none;
}
.hero .container { position: relative; z-index: 1; }
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 5vw, 4rem); align-items: center;
}
.hero h1 { font-size: clamp(2.2rem, 5.2vw, 3.6rem); }
.hero .role {
  font-family: "IBM Plex Mono", monospace; font-size: clamp(.95rem, 1.6vw, 1.1rem);
  color: var(--accent-ink); margin: 0 0 1.4rem; letter-spacing: .02em;
}
.hero .bio { color: var(--muted); font-size: 1.02rem; max-width: 58ch; }
.hero .bio a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.hero-ctas { display: flex; gap: .9rem; flex-wrap: wrap; margin-top: 1.6rem; }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.3rem; padding: 0; list-style: none; }
.chips li {
  font-family: "IBM Plex Mono", monospace; font-size: .78rem;
  background: var(--chip-bg); color: var(--chip-ink);
  padding: .32rem .75rem; border-radius: 999px;
}

.hero-photo { position: relative; }
.hero-photo img {
  border-radius: 18px; box-shadow: var(--shadow);
  aspect-ratio: 4 / 5; object-fit: cover; width: 100%;
}
.hero-photo::before {
  content: ""; position: absolute; inset: 14px -14px -14px 14px;
  border: 2px solid var(--accent); border-radius: 18px; z-index: -1; opacity: .55;
}

/* ---------- Servicios (3 pilares) ---------- */
.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 1.7rem 1.6rem; box-shadow: var(--shadow);
}
.card h3 { font-size: 1.3rem; }
.card p { color: var(--muted); margin: 0; font-size: .98rem; }
.card .card-img { height: 130px; display: grid; place-items: center; margin-bottom: 1.1rem; }
.card .card-img img { max-height: 130px; width: auto; border-radius: 10px; }

/* ---------- Capacidades (grid) ---------- */
.cap-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.3rem; }
.cap {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 1.4rem 1.4rem 1.5rem; display: flex; flex-direction: column; gap: .55rem;
}
.cap h3 { font-family: "Instrument Sans", sans-serif; font-weight: 700; font-size: 1.06rem; margin: 0; }
.cap p { color: var(--muted); font-size: .95rem; margin: 0; }
.cap img { border-radius: 10px; margin-top: .5rem; max-height: 150px; width: auto; }
.cap.wide { grid-column: span 3; }
.cap.wide p { max-width: 75ch; }

/* ---------- Interpretabilidad ---------- */
.interp img { border-radius: 16px; box-shadow: var(--shadow); margin-inline: auto; }

/* ---------- Testimonios ---------- */
.quotes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.quote {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 1.7rem; display: flex; flex-direction: column; gap: 1.2rem; margin: 0;
}
.quote blockquote { margin: 0; color: var(--muted); font-size: .97rem; }
.quote blockquote::before { content: "“"; font-family: "Fraunces", serif; font-size: 2.6rem; line-height: 0; color: var(--accent); display: block; margin: .8rem 0 .2rem; }
.quote .who { display: flex; align-items: center; gap: .8rem; margin-top: auto; }
.quote .who img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; }
.quote .who strong { display: block; font-size: .98rem; }
.quote .who span { color: var(--muted); font-size: .85rem; }
.malt-link { margin-top: 2rem; text-align: right; font-size: .95rem; }
.malt-link a { color: var(--accent-ink); }

/* ---------- Leaderboard (competiciones) ---------- */
.board { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--card); }
.row {
  display: grid; grid-template-columns: 110px minmax(0, 1.3fr) minmax(0, 1.7fr) 170px;
  gap: 1.2rem; align-items: center;
  padding: 1.05rem 1.4rem; border-bottom: 1px solid var(--line);
  text-decoration: none; color: inherit;
  transition: background .15s ease;
}
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--bg-alt); }
.row .rank { font-family: "IBM Plex Mono", monospace; font-size: 1.15rem; font-weight: 600; color: var(--accent-ink); }
.row .rank small { display: block; font-size: .72rem; color: var(--muted); font-weight: 400; }
.row .name strong { display: block; font-size: 1rem; }
.row .name span { font-family: "IBM Plex Mono", monospace; font-size: .74rem; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.row .desc { color: var(--muted); font-size: .92rem; }
.pct { display: flex; flex-direction: column; gap: .35rem; }
.pct .bar { height: 6px; border-radius: 999px; background: var(--bg-alt); border: 1px solid var(--line); overflow: hidden; }
.pct .bar i { display: block; height: 100%; background: var(--accent); width: var(--w, 50%); }
.pct small { font-family: "IBM Plex Mono", monospace; font-size: .72rem; color: var(--muted); }
.board-foot { margin-top: 1.2rem; font-size: .95rem; }
.board-foot a { color: var(--accent-ink); }

/* ---------- Banda contratar ---------- */
.band { background: var(--band); color: var(--band-ink); }
.band .section-head h2 { color: var(--band-ink); }
.band p { color: var(--band-muted); max-width: 65ch; }
.band a:not(.btn) { color: var(--band-ink); text-decoration: underline; text-underline-offset: 3px; }
.band .eyebrow { color: var(--accent); }

/* ---------- Legal ---------- */
.legal-data { font-size: 1rem; line-height: 1.9; }
canvas.vlg {
  display: block; margin: .4rem 0 0;
  -webkit-user-select: none; user-select: none;
}

/* ---------- Páginas legales (prosa) ---------- */
.prose { max-width: 72ch; padding-bottom: 4rem; }
.prose h1 { font-size: clamp(1.8rem, 3.6vw, 2.4rem); margin-top: 2.5rem; }
.prose h2 { font-size: 1.35rem; margin-top: 2.2rem; }
.prose p, .prose li { color: var(--muted); font-size: .98rem; }
.prose strong { color: var(--ink); }
.prose a { color: var(--accent-ink); }
.prose table { border-collapse: collapse; width: 100%; margin: 1rem 0 1.5rem; font-size: .9rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: .55rem .7rem; text-align: left; vertical-align: top; }
.prose th { background: var(--bg-alt); font-weight: 600; color: var(--ink); }
.prose td { color: var(--muted); }
.prose .updated { font-family: "IBM Plex Mono", monospace; font-size: .78rem; color: var(--muted); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 2.4rem 0 5.5rem; font-size: .92rem; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; align-items: center; }
.footer-links { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; margin: .4rem 0 0; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--accent-ink); }
.linklike {
  background: none; border: 0; padding: 0; color: var(--muted);
  text-decoration: underline; text-underline-offset: 2px; font-size: inherit;
}
.linklike:hover { color: var(--accent-ink); }
.social { display: flex; gap: 1rem; }
.social a { display: inline-flex; padding: .45rem; border-radius: 10px; color: var(--muted); }
.social a:hover { color: var(--accent-ink); background: var(--bg-alt); }
.social svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; }

/* ---------- Flotantes ---------- */
.fab-cta {
  position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 90;
  box-shadow: 0 12px 30px rgba(0,0,0,.25);
}
.backtotop {
  position: fixed; right: 1.2rem; bottom: 5.4rem; z-index: 90;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--card); border: 1px solid var(--line); color: var(--ink);
  display: grid; place-items: center; text-decoration: none;
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.backtotop.show { opacity: 1; pointer-events: auto; }

/* ---------- Consentimiento ---------- */
.consent {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 120;
  background: var(--band); color: var(--band-ink);
  padding: 1rem 0; box-shadow: 0 -8px 30px rgba(0,0,0,.25);
  display: none;
}
.consent.show { display: block; }
.consent-inner { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
.consent p { margin: 0; font-size: .88rem; color: var(--band-muted); flex: 1 1 42ch; }
.consent a { color: var(--band-ink); }
.consent .btn { padding: .55rem 1.1rem; font-size: .9rem; }
.btn-quiet { background: transparent; color: var(--band-muted); border: 1px solid var(--band-muted); }

/* ---------- Animaciones ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
[data-parallax] { will-change: transform; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  [data-parallax] { transform: none !important; }
  .btn, .row { transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .cards-3, .quotes, .cap-grid { grid-template-columns: repeat(2, 1fr); }
  .cap.wide { grid-column: span 2; }
  .row { grid-template-columns: 84px 1fr 150px; }
  .row .desc { display: none; }
}
@media (max-width: 720px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-photo { order: -1; max-width: 340px; }
  .cards-3, .quotes, .cap-grid { grid-template-columns: 1fr; }
  .cap.wide { grid-column: span 1; }
  .nav-contact .label { display: none; } /* solo iconos en móvil */
  .row { grid-template-columns: 64px 1fr; }
  .row .pct { grid-column: 2; }
  .malt-link { text-align: left; }
}
