/* Libitum · web. Colores y tipos del sistema de diseño (design/system/project/tokens.json, tema oscuro). */
@font-face { font-family: "Instrument Sans"; src: url(fonts/instrument_sans.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url(fonts/eb_garamond_italic.woff2) format("woff2"); font-style: italic; font-weight: 400 800; font-display: swap; }
@font-face { font-family: "Bravura L"; src: url(fonts/bravura_libitum.woff2) format("woff2"); font-display: block; }

:root {
  --stage: #0e0f11; --bg: #111214; --surface: #1a1c1f; --surface-2: #24272b; --line: #2b2e33;
  --ink: #ecedec; --muted: #9ba1a8; --brass: #d6a84b; --brass-soft: #3a2f1a; --on-brass: #1b1d20;
  --paper: #fbfaf6; --cover: #e4e0d5; --sepia: #f4ecd8; --score-ink: #1b1d20;
  --red: #c8372d; --blue: #2563b8; --green: #2f7d52; --ok: #5dbb86;
  --sans: "Instrument Sans", Roboto, system-ui, sans-serif;
  --serif: "EB Garamond", Georgia, serif;
}
* { box-sizing: border-box; margin: 0; }
html { background: var(--stage); }
body { font-family: var(--sans); color: var(--ink); background: var(--stage); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
em { font-family: var(--serif); font-style: italic; font-size: 1.12em; }

#film { height: 1250vh; }
.stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }

.logo { position: fixed; z-index: 20; top: 22px; left: 28px; font-weight: 600; font-size: 20px; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; opacity: 0; visibility: hidden; }
.logo i, .wordmark i { font-style: normal; color: var(--brass); }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.nav { position: fixed; z-index: 20; top: 14px; right: clamp(14px, 2vw, 28px); display: flex; gap: 10px; }
.btn.sm { padding: 10px 16px; font-size: 14px; background: rgba(14,15,17,.72); display: inline-flex; align-items: center; gap: 8px; }
.btn.sm.main { background: var(--brass); }
.btn svg { width: 11px; height: 11px; fill: currentColor; flex: none; }
.hero-cta { margin-top: clamp(22px, 4vh, 40px); }
.btn.play { display: inline-flex; align-items: center; gap: 12px; padding: 16px 26px 16px 22px; border-color: var(--brass); color: var(--ink); }
.btn.play svg { width: 14px; height: 14px; fill: var(--brass); }
.btn.play span { color: var(--muted); font-weight: 500; }
.btn[aria-disabled="true"], .btn.main[aria-disabled="true"] { background: transparent; border-color: var(--brass); color: var(--brass); cursor: default; }
.btn.main[aria-disabled="true"]:hover { background: transparent; border-color: var(--brass); }
[hidden] { display: none !important; }

/* Pentagrama de fondo */
.staff { position: absolute; inset: 0; width: 100%; height: 100%; }
.staff path { fill: none; stroke: var(--ink); stroke-width: 1.4; vector-effect: non-scaling-stroke; opacity: .2; }

/* Inicio */
.hero { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; padding: 0 clamp(20px, 7vw, 120px) 12vh; }
.wordmark { font-weight: 600; font-size: clamp(84px, 21vw, 380px); line-height: .86; letter-spacing: -0.055em; margin-left: -0.05em; }
.hero-line { margin-top: clamp(18px, 3vh, 36px); font-size: clamp(22px, 2.6vw, 40px); letter-spacing: -0.015em; }
.hero-sub { margin-top: 10px; font-size: clamp(15px, 1.2vw, 18px); color: var(--muted); }
.hint { position: absolute; left: clamp(20px, 7vw, 120px); bottom: 34px; font-size: 14px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 12px; }
.hint span { width: 1px; height: 34px; background: linear-gradient(var(--brass), transparent); }

/* Tablet */
.rig { position: absolute; left: 69%; top: 50%; width: 0; height: 0; }
.mover { position: absolute; width: 0; height: 0; }
.tablet { position: absolute; width: 624px; height: 864px; margin: -432px 0 0 -312px; transform: scale(var(--s, .8)); border-radius: 34px; background: #050506; padding: 12px; box-shadow: 0 0 0 1px #2b2e33, 0 40px 90px rgba(0,0,0,.6); }
.screen { position: relative; width: 600px; height: 840px; border-radius: 22px; overflow: hidden; background: var(--bg); }
.scr { position: absolute; inset: 0; }

.lib { padding: 34px 30px 0; overflow: hidden; }
.lib-t { font-size: 34px; line-height: 40px; font-weight: 600; letter-spacing: -0.02em; }
.lib-search { margin: 18px 0 20px; height: 48px; border-radius: 12px; background: var(--surface-2); color: var(--muted); font-size: 16px; display: flex; align-items: center; padding: 0 18px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px 16px; }
.cover { aspect-ratio: 5 / 7; background: var(--cover); border-radius: 4px; padding: 8px; color: #33352f; }
.cover div { height: 100%; border: 1px solid #8d8a7d; outline: 1px solid #8d8a7d; outline-offset: -4px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 10px; }
.cover b { font: italic 500 22px/1.1 var(--serif); }
.cover u { display: block; width: 44px; height: 13px; margin: 18px 0 14px; background: repeating-linear-gradient(#77756a 0 1px, transparent 1px 3px); }
.cover small { font-size: 8px; letter-spacing: .22em; text-transform: uppercase; }
.cv-name { margin-top: 8px; font-size: 14px; font-weight: 600; }
.cv-inst { font-size: 12px; color: var(--muted); }

.viewer { background: var(--stage); opacity: 0; visibility: hidden; }
.pages { position: absolute; left: 30px; top: 38px; width: 540px; height: 764px; perspective: 1800px; }
.page { position: absolute; inset: 0; background: var(--paper); color: var(--score-ink); box-shadow: 0 2px 12px rgba(0,0,0,.45); transform-origin: left center; backface-visibility: hidden; }
.page header { position: relative; height: 104px; padding-top: 34px; text-align: center; }
.page h3 { font: italic 500 30px/1 var(--serif); }
.page .inst, .page .comp { position: absolute; bottom: 6px; font: italic 500 14px var(--serif); }
.page .inst { left: 26px; } .page .comp { right: 26px; }
.score { filter: invert(0); }
.score svg { display: block; width: 100%; height: auto; }
.ann { position: absolute; left: 0; top: 104px; width: 100%; overflow: visible; pointer-events: none; }
.ann .pen { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.ann text { font-family: "Bravura L"; }
.shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.34), transparent 70%); opacity: 0; }
.lens { position: absolute; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; border: 2.5px solid var(--brass); box-shadow: 0 6px 18px rgba(0,0,0,.28), inset 0 0 0 3px rgba(255,255,255,.7); transform: scale(0); }
.pill { position: absolute; right: 14px; top: 8px; height: 26px; width: 58px; border-radius: 999px; background: rgba(12,13,15,.92); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; color: #f4f4f2; }
.pill span { position: absolute; inset: 0; display: grid; place-items: center; } .pill .n2 { opacity: 0; }
.tap { position: absolute; right: 70px; top: 430px; width: 76px; height: 76px; border-radius: 50%; background: rgba(214,168,75,.5); transform: scale(0); opacity: 0; }

.tray { position: absolute; left: 22px; right: 22px; bottom: 18px; height: 60px; border-radius: 999px; background: rgba(12,13,15,.94); display: flex; align-items: center; gap: 12px; padding: 0 16px; font-size: 13px; font-weight: 600; color: #f4f4f2; transform: translateY(110px); }
.tray .tool { display: flex; align-items: center; gap: 7px; padding: 8px 10px; border-radius: 999px; white-space: nowrap; }
.tray .tool.on { background: var(--brass-soft); }
.tray .tool b, .tray .dot { width: 18px; height: 18px; border-radius: 50%; background: var(--c); border: 2px solid #f4f4f2; flex: none; }
.tray .done { margin-left: auto; color: #f0cf86; }

.sheet { position: absolute; left: 0; right: 0; bottom: 0; height: 356px; border-radius: 28px 28px 0 0; background: var(--surface); transform: translateY(380px); text-align: center; }
.metro, .tuner { position: absolute; inset: 0; padding-top: 26px; }
.tuner { opacity: 0; }
.pend { width: 220px; } .dial { width: 250px; margin-top: 10px; }
.sheet svg { fill: var(--ink); stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.sheet .arc { fill: none; stroke: var(--line); }
.sheet .arm rect { fill: var(--brass); stroke: none; }
.sheet .mid { stroke: var(--ok); stroke-width: 4; }
.bpm, .note { font-weight: 600; font-size: 72px; line-height: 72px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.lbl { position: relative; margin-top: 8px; font-size: 15px; color: var(--muted); height: 20px; }
.lbl span { position: absolute; left: 0; right: 0; } .tune-b { color: var(--ok); font-weight: 600; opacity: 0; }

.set { background: var(--bg); padding: 34px 30px; transform: translateX(100%); }
.set-sub { margin-top: 6px; color: var(--muted); font-size: 15px; }
.set ol { list-style: none; padding: 0; margin-top: 26px; }
.set li { display: grid; grid-template-columns: 34px 1fr 28px; align-items: center; height: 76px; border-bottom: 1px solid var(--line); }
.set li i { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; }
.set li b { font-size: 19px; font-weight: 600; display: block; } .set li small { font-size: 14px; color: var(--muted); }
.set li svg { width: 24px; height: 24px; fill: none; stroke: var(--ok); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.set-pill { margin-top: 30px; } .set-pill span { display: inline-block; padding: 14px 20px; border-radius: 999px; background: var(--brass-soft); font-size: 15px; font-weight: 600; }
.set-cloud { margin-top: 16px; font-size: 14px; color: var(--muted); }

/* Textos */
.caps { position: absolute; left: clamp(20px, 7vw, 120px); top: 0; bottom: 0; width: min(36vw, 520px); display: grid; align-content: center; }
.cap { grid-area: 1 / 1; align-self: center; opacity: 0; visibility: hidden; }
.cap h2, .end h2 { font: italic 500 clamp(38px, 4.6vw, 76px)/1.02 var(--serif); letter-spacing: -0.01em; text-wrap: balance; }
.cap p { margin-top: 22px; font-size: clamp(16px, 1.25vw, 19px); line-height: 1.5; color: var(--muted); max-width: 34ch; }

/* Final */
.end { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding: 0 clamp(20px, 7vw, 120px); opacity: 0; visibility: hidden; }
.end h2 { font-size: clamp(56px, 10vw, 170px); }
.end > p { margin-top: 26px; font-size: clamp(17px, 1.5vw, 22px); line-height: 1.5; color: var(--muted); max-width: 46ch; }
.cta { margin-top: 38px; display: flex; flex-wrap: wrap; gap: 14px; }
.btn { font: 600 17px var(--sans); color: var(--ink); background: none; border: 1px solid #4a4e55; border-radius: 999px; padding: 17px 28px; text-decoration: none; cursor: pointer; }
.btn.main { background: var(--brass); border-color: var(--brass); color: var(--on-brass); }
.btn:hover { border-color: var(--ink); } .btn.main:hover { background: #e3b961; }
.btn:focus-visible, .logo:focus-visible { outline: 2px solid var(--brass); outline-offset: 4px; }
.end .fine { margin-top: 30px; font-size: 14px; color: var(--muted); max-width: none; }
.end .fine + .fine { margin-top: 10px; }
.fine a { color: var(--ink); text-underline-offset: 3px; }

.bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; }
.bar i { display: block; height: 100%; background: var(--brass); transform-origin: left; transform: scaleX(0); }

/* Tráiler: la escena que sigue a la portada. El marco cabe siempre entero en la pantalla, bajo la cabecera */
.cine { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 76px clamp(16px, 5vw, 80px) 36px; opacity: 0; visibility: hidden; }
.cine-box { position: relative; width: min(100%, 1280px, calc((100vh - 112px) * 16 / 9)); width: min(100%, 1280px, calc((100svh - 112px) * 16 / 9)); }
.cine-frame { aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden; background: #000; box-shadow: 0 0 0 1px var(--line), 0 40px 90px rgba(0,0,0,.6); }
.cine.vert .cine-box { width: min(100%, calc((100svh - 180px) * 9 / 16)); } .cine.vert .cine-frame { aspect-ratio: 9 / 16; }
.cine video { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.cine .sound { position: absolute; left: 14px; top: 14px; }
.cine .sound[aria-pressed="true"] { opacity: .75; }

/* Móvil y vertical: la tablet arriba, el texto debajo */
@media (max-width: 860px), (max-aspect-ratio: 1/1) {
  .rig { left: 50%; top: 34%; }
  .caps { left: 20px; right: 20px; width: auto; top: auto; bottom: 0; height: 34%; align-content: start; }
  .cap { align-self: start; }
  .cap h2 { font-size: clamp(28px, 7.6vw, 44px); } .cap p { margin-top: 12px; font-size: 15px; max-width: none; }
  .hero { padding-bottom: 8vh; }
  /* en móvil el vídeo es pequeño: el botón del sonido va debajo, no encima */
  .cine { padding-left: 16px; padding-right: 16px; }
  .cine .sound { position: static; margin: 14px auto 0; display: flex; }
  .hint { display: none; }
  .nav .btn.sm.main { display: none; }
}

/* Modo tráiler (?trailer): la misma película, a tiempo en vez de a scroll */
.trailer #film { height: 100vh; } .trailer .hint, .trailer .bar, .trailer .cta, .trailer .logo, .trailer .nav, .trailer .hero-cta, .trailer .cine { display: none; }

/* Páginas de texto (privacidad) */
.legal { max-width: 720px; margin: 0 auto; padding: 96px 20px 120px; line-height: 1.6; color: var(--muted); font-size: 17px; }
.legal .logo { position: static; opacity: 1; visibility: visible; display: inline-block; margin-bottom: 56px; color: var(--ink); text-decoration: none; }
.legal h1 { font: italic 500 clamp(40px, 7vw, 64px)/1.05 var(--serif); color: var(--ink); }
.legal h2 { margin-top: 44px; font-size: 20px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.legal p, .legal ul { margin-top: 14px; } .legal ul { padding-left: 1.2em; } .legal li + li { margin-top: 8px; }
.legal strong { color: var(--ink); font-weight: 600; }
.legal a { color: var(--brass); text-underline-offset: 3px; overflow-wrap: anywhere; }
.legal .lead { margin-top: 22px; font-size: 19px; color: var(--ink); }
.legal .fecha { margin-top: 10px; font-size: 14px; }
.legal footer { margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 14px; }

/* Caso de estudio (como-se-hizo.html) */
.caso { overflow-x: hidden; }
.caso-top { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; padding: 14px clamp(16px, 4vw, 40px); background: rgba(14,15,17,.86); border-bottom: 1px solid var(--line); }
.caso-top .logo { position: static; opacity: 1; visibility: visible; }
.caso-nav { display: flex; align-items: center; gap: 18px; }
.caso-nav .lang { font-size: 14px; font-weight: 500; color: var(--muted); text-decoration: none; }
.caso-nav .lang:hover { color: var(--ink); }
.caso main { max-width: 760px; margin: 0 auto; padding: 0 16px; color: var(--muted); font-size: 18px; line-height: 1.65; }
.caso main section { padding-top: clamp(64px, 10vw, 112px); }
.caso-hero { padding-top: clamp(56px, 9vw, 104px) !important; }
.kicker { font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--brass); }
.caso h1 { margin-top: 14px; font: italic 500 clamp(48px, 9vw, 96px)/1 var(--serif); color: var(--ink); letter-spacing: -0.01em; text-wrap: balance; }
.caso h2 { font: italic 500 clamp(34px, 5vw, 52px)/1.05 var(--serif); color: var(--ink); text-wrap: balance; margin-bottom: 8px; }
.caso h3 { font-size: 18px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.caso main p, .caso main ol, .caso main ul, .caso .tabla { margin-top: 18px; }
.caso strong { color: var(--ink); font-weight: 600; }
.caso .lead { margin-top: 24px; font-size: clamp(19px, 2.2vw, 23px); line-height: 1.5; color: var(--ink); }
.ficha { margin-top: 36px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px 28px; padding: 24px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ficha dt { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ficha dd { margin: 6px 0 0; font-size: 15px; line-height: 1.45; color: var(--ink); }
.caso figure { margin: 0; }
.caso figure.wide { margin: 44px calc(50% - min(50vw - 16px, 560px)) 0; }
.caso figure img { display: block; width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.caso figcaption { margin-top: 12px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.par { margin: 28px calc(50% - min(50vw - 16px, 560px)) 0; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.tesis { padding: 22px 24px; border-left: 2px solid var(--brass); background: var(--surface); border-radius: 0 12px 12px 0; }
.fases { padding-left: 1.3em; } .fases li + li, .falta li + li { margin-top: 12px; } .falta { padding-left: 1.2em; }
.fases li::marker { color: var(--brass); font-weight: 600; }
.cards { margin-top: 28px; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.cards article { padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.cards article p { margin-top: 10px; font-size: 15px; line-height: 1.55; }
.tabla { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
.tabla table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.tabla th, .tabla td { padding: 12px 16px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tabla thead th { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tabla tbody th { text-align: left; font-weight: 500; color: var(--ink); }
.tabla tbody tr:last-child th, .tabla tbody tr:last-child td { border-bottom: 0; }
.tabla tr.yo th, .tabla tr.yo td { color: var(--brass); font-weight: 600; background: var(--brass-soft); }
.nota { font-size: 15px; line-height: 1.6; padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px; }
.cifras { margin-top: 28px; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 28px 24px; }
.cifras dt { font: italic 500 clamp(40px, 6vw, 56px)/1 var(--serif); color: var(--ink); }
.cifras dd { margin: 8px 0 0; font-size: 15px; line-height: 1.45; }
.caso-pie { max-width: 760px; margin: clamp(80px, 12vw, 140px) auto 0; padding: 32px 16px 64px; border-top: 1px solid var(--line); color: var(--muted); font-size: 15px; line-height: 1.6; }
.caso-pie .firma { font: italic 500 28px/1.2 var(--serif); color: var(--ink); }
.caso-pie p + p { margin-top: 6px; } .caso-pie .sub { margin-top: 18px; font-size: 14px; }
.caso-pie a, .caso main a { color: var(--brass); text-underline-offset: 3px; }
@media (max-width: 640px) { .par { grid-template-columns: 1fr; } .caso main { font-size: 17px; } }
