/* Web de Montavo: una sala de cine a oscuras con la luz ámbar del proyector (docs/guias_visuales.md, docs/web.md). */
:root {
  --bg: #0b0a09;
  --panel: #151311;
  --line: #2a2621;
  --text: #f2ede4;
  --muted: #a39b8f;
  --amber: #f2a93b;
  --amber-soft: rgba(242, 169, 59, .4);
  --projected: #f7ead2;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Hiragino Sans", "Apple SD Gothic Neo", "PingFang TC", system-ui, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Hiragino Sans", "Apple SD Gothic Neo", "PingFang TC", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
  --serif: "New York", ui-serif, "Iowan Old Style", Georgia, serif;
  --flicker: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--sans);
  overflow-x: hidden;
}
/* Grano de película sobre toda la página. */
body::after {
  content: ""; position: fixed; inset: -50%; z-index: 50; pointer-events: none; opacity: .07;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
@media (prefers-reduced-motion: no-preference) {
  body::after { animation: grain .9s steps(6) infinite; }
  html { scroll-behavior: smooth; }
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}
a { color: var(--amber); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 4px; }
.label {
  font: 600 12px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--amber);
}

/* Cabecera */
.top {
  position: relative; z-index: 10; max-width: 1180px; margin: 0 auto;
  padding: 18px max(16px, env(safe-area-inset-left));
  display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap;
}
.home .top { position: absolute; inset: 0 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font: 700 19px/1 var(--display); }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 9px; }
.top nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; font-size: 15px; }
.top nav a { color: var(--muted); }
.top nav a:hover { color: var(--text); text-decoration: none; }
select {
  background: rgba(21, 19, 17, .8); color: var(--text); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 14px;
}

/* La sala. Al deslizar, la cámara avanza hasta entrar en la pantalla (site.js mueve --p de 0 a 1). */
.theater { position: relative; background: #000; }
.theater .pin { position: relative; height: 100svh; overflow: hidden; }
.js.motion .theater { height: 240svh; }
.js.motion .theater .pin { position: sticky; top: 0; }
.stage {
  --sh: max(100svh, min(66.67vw, 130svh)); --fx: .5;
  position: absolute; top: 0; height: var(--sh); width: calc(var(--sh) * 1.5);
  left: calc(50% - var(--sh) * 1.5 * var(--fx));
  transform-origin: 65.1% 38.2%; will-change: transform;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
}
.room { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.theater .pin::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: calc(1 - var(--p, 0) * 2);
  background:
    linear-gradient(to bottom, rgba(11, 10, 9, .75), transparent 18%, transparent 55%, var(--bg) 96%),
    radial-gradient(ellipse at 60% 40%, transparent 45%, rgba(0, 0, 0, .55));
}
.dust { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; mix-blend-mode: screen; }
.screen {
  position: absolute; left: 42.2%; top: 25.6%; width: 45.8%; height: 25.2%;
  container-type: size; display: grid; place-items: center; text-align: center;
  color: var(--projected); opacity: calc(1 - (var(--p, 0) - .45) * 4);
}
.screen::before {
  content: ""; position: absolute; inset: 0; opacity: .5;
  background: radial-gradient(ellipse at 40% 50%, rgba(255, 226, 180, .32), rgba(242, 169, 59, .1) 55%, transparent 80%);
}
.card { position: relative; mix-blend-mode: screen; padding: 0 4cqw; }
.card .label { font-size: max(9px, 2.6cqh); color: rgba(247, 234, 210, .7); }
.card h1 {
  margin: 4cqh 0 2cqh; font: 700 min(30cqh, 13cqw)/1 var(--display); letter-spacing: -.01em;
  text-shadow: 0 0 2.4cqh rgba(255, 210, 150, .45);
}
.card .tagline { margin: 0; font: 600 max(11px, 7.5cqh)/1.2 var(--display); color: var(--amber); }
.leader { position: absolute; inset: 0; display: none; place-items: center; mix-blend-mode: screen; }
.leader .dial {
  width: 62cqh; aspect-ratio: 1; border-radius: 50%; position: relative; display: grid; place-items: center;
  border: .6cqh solid rgba(247, 234, 210, .6);
  background: conic-gradient(rgba(247, 234, 210, .28) var(--sweep), transparent 0);
  font: 700 34cqh/1 var(--mono); color: var(--projected);
}
.leader .dial::before, .leader .dial::after { content: ""; position: absolute; background: rgba(247, 234, 210, .35); }
.leader .dial::before { left: -40cqh; right: -40cqh; top: 50%; height: .4cqh; }
.leader .dial::after { top: -10cqh; bottom: -10cqh; left: 50%; width: .4cqh; }
@property --sweep { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.js.motion .theater:not(.ready) .card { opacity: 0; }
.js.motion .theater.counting .leader { display: grid; }
.js.motion .theater.counting .dial { animation: sweep .7s linear infinite; }
.js.motion .theater.ready .card { animation: projectorOn .9s var(--flicker) both, weave 5s steps(12) 1s infinite; }
.js.motion .theater.ready .screen::before { animation: screenOn .9s var(--flicker) both, lamp 3.2s ease-in-out 1s infinite; }
@keyframes sweep { from { --sweep: 0deg; } to { --sweep: 360deg; } }
/* El mismo parpadeo de «La sala se ilumina» en la app: 0,7 → 0,12 → 0,85 → 0,35 → 1. */
@keyframes projectorOn {
  0% { opacity: 0; } 18% { opacity: .7; } 32% { opacity: .12; } 52% { opacity: .85; } 70% { opacity: .35; } 100% { opacity: 1; }
}
@keyframes screenOn {
  0% { opacity: 0; } 18% { opacity: .35; } 32% { opacity: .06; } 52% { opacity: .42; } 70% { opacity: .18; } 100% { opacity: .5; }
}
/* La ventanilla de un proyector nunca está quieta del todo. */
@keyframes weave {
  0%, 100% { transform: translate(0, 0); } 25% { transform: translate(.15cqh, -.2cqh); }
  50% { transform: translate(-.1cqh, .15cqh); } 75% { transform: translate(.1cqh, .2cqh); }
}
@keyframes lamp { 0%, 100% { opacity: .5; } 40% { opacity: .44; } 55% { opacity: .54; } 70% { opacity: .47; } }
.intro {
  position: absolute; z-index: 2; left: 0; right: 0; bottom: max(5svh, 28px);
  max-width: 720px; margin: 0 auto; padding: 0 20px; text-align: center;
  opacity: calc(1 - var(--p, 0) * 6);
}
.lead { margin: 0 auto 22px; color: #d6cec2; font-size: clamp(17px, 2.2vw, 21px); text-shadow: 0 1px 12px #000; }
.soon {
  display: inline-block; background: var(--amber); color: #1a1206; font-weight: 700;
  padding: 13px 28px; border-radius: 999px; font-size: 16px;
  box-shadow: 0 0 20px var(--amber-soft);
}
.cue { display: none; }
.js.motion .cue {
  display: block; width: 1px; height: 34px; margin: 22px auto 0; overflow: hidden; position: relative;
  background: rgba(247, 234, 210, .18);
}
.js.motion .cue::after {
  content: ""; position: absolute; left: 0; top: 0; width: 1px; height: 12px; background: var(--amber);
  animation: cue 1.8s cubic-bezier(.6, 0, .3, 1) infinite;
}
@keyframes cue { from { transform: translateY(-14px); } to { transform: translateY(36px); } }
.fade {
  position: absolute; inset: 0; z-index: 3; pointer-events: none; background: var(--bg);
  opacity: calc((var(--p, 0) - .78) * 5);
}

/* Las funciones son una línea de tiempo: la página se recorre como un montaje, con el cabezal ámbar fijo. */
.timeline { position: relative; }
.timeline .pin { padding: 76px 0 24px; }
.section-title { text-align: center; margin: 0 0 18px; padding: 0 16px; }
.section-title span { display: block; font: 700 clamp(26px, 4.4vw, 44px)/1.1 var(--display); letter-spacing: -.01em; }
.timecode, .ruler, .playhead { display: none; }
.film {
  display: flex; gap: 24px; list-style: none; margin: 0; padding: 34px 20px;
  overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  background:
    repeating-linear-gradient(to right, rgba(255, 255, 255, .09) 0 12px, transparent 12px 22px) 0 10px / 100% 9px no-repeat,
    repeating-linear-gradient(to right, rgba(255, 255, 255, .09) 0 12px, transparent 12px 22px) 0 calc(100% - 10px) / 100% 9px no-repeat,
    #121110;
  border-block: 1px solid rgba(255, 255, 255, .08);
}
.frame {
  flex: none; width: min(820px, 80vw); scroll-snap-align: center;
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 44px;
  padding: 18px 28px; border-radius: 6px; background: var(--bg);
  border: 1px solid rgba(255, 255, 255, .06);
}
.shot {
  display: block; height: min(56svh, 600px); width: auto; border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 0 20px var(--amber-soft), 0 24px 60px rgba(0, 0, 0, .6);
}
.copy h3 { font: 700 clamp(26px, 3.6vw, 42px)/1.12 var(--display); letter-spacing: -.01em; margin: 14px 0 12px; }
.copy p:last-child { color: #cfc7bb; font-size: clamp(17px, 1.6vw, 20px); margin: 0; }

.js.motion .timeline { height: calc(100svh + var(--frames) * 85svh); }
.js.motion .timeline .pin {
  position: sticky; top: 0; height: 100svh; overflow: hidden;
  display: grid; grid-template: auto auto minmax(0, 1fr) / minmax(0, 1fr); padding: 72px 0 20px;
}
.js.motion .timecode {
  display: block; text-align: center; font: 600 15px/1 var(--mono); letter-spacing: .08em;
  color: var(--amber); font-variant-numeric: tabular-nums; margin-bottom: 10px;
}
.js.motion .viewer { position: relative; display: grid; grid-template: auto minmax(0, 1fr) / minmax(0, 1fr); min-height: 0; }
.js.motion .ruler {
  display: block; height: 18px;
  background:
    repeating-linear-gradient(to right, rgba(255, 255, 255, .5) 0 1px, transparent 1px 120px) var(--x, 0) 100% / auto 7px repeat-x,
    repeating-linear-gradient(to right, rgba(255, 255, 255, .24) 0 1px, transparent 1px 12px) var(--x, 0) 100% / auto 4px repeat-x;
  border-bottom: 1px solid rgba(255, 255, 255, .14);
}
.js.motion .playhead {
  display: block; position: absolute; z-index: 2; left: 50%; top: 3px; width: 12px; height: 12px; margin-left: -6px;
  border-radius: 2px; background: var(--amber); box-shadow: 0 0 20px var(--amber-soft);
}
.js.motion .playhead::after {
  content: ""; position: absolute; left: 5px; top: 12px; width: 2px; height: 40px;
  background: linear-gradient(to bottom, var(--amber), transparent);
}
.js.motion .film {
  overflow: visible; width: max-content; padding-inline: 50vw; height: 100%; align-items: stretch;
  will-change: transform; scroll-snap-type: none;
}
.js.motion .frame { transition: border-color .4s ease; }
.js.motion .frame .shot { height: min(100%, 600px); max-height: calc(100svh - 300px); transition: filter .5s var(--flicker), box-shadow .5s ease; }
.js.motion .frame .copy { transition: opacity .45s ease, transform .6s var(--flicker); }
.js.motion .frame:not(.lit) .shot { filter: brightness(.22) saturate(.6); box-shadow: 0 24px 60px rgba(0, 0, 0, .6); }
.js.motion .frame:not(.lit) .copy { opacity: .14; transform: translateY(10px); }
.js.motion .frame.lit { border-color: rgba(242, 169, 59, .35); }

/* Ficha técnica, como los créditos finales. */
.credits { max-width: 760px; margin: 40px auto 0; padding: 72px 16px 56px; text-align: center; }
.credits h2 { font: 700 clamp(26px, 4vw, 34px)/1.2 var(--display); margin: 14px 0 36px; }
.credits dl { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 28px; margin: 0; }
.credits dt { text-align: right; font: 500 13px/1.9 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.credits dd { text-align: left; margin: 0; font-size: 19px; font-weight: 600; }
.js.motion .rise { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .9s var(--flicker); transition-delay: calc(var(--i, 0) * 70ms); }
.js.motion .rise.in { opacity: 1; transform: none; }

/* Fin: el único intertítulo en New York cursiva, como el de 1916 de la presentación. */
.finale { max-width: 760px; margin: 40px auto 0; padding: 0 16px 24px; text-align: center; }
.intertitle {
  margin: 0 auto 36px; padding: 40px 24px; max-width: 480px;
  border: 1px solid rgba(247, 234, 210, .25); outline: 1px solid rgba(247, 234, 210, .12); outline-offset: 6px;
}
.intertitle p { margin: 0; font: italic 400 clamp(48px, 9vw, 76px)/1 var(--serif); color: var(--projected); }
.js.motion .intertitle:not(.in) { opacity: 0; }
.js.motion .intertitle.in { animation: projectorOn .9s var(--flicker) both; }
.finale .made { color: var(--muted); margin-top: 28px; }

@media (max-width: 760px) {
  .stage { --sh: min(134vw, 62svh); --fx: .651; top: 9svh; }
  .timeline .pin, .js.motion .timeline .pin { padding-top: 64px; }
  .film { gap: 14px; padding-block: 28px; }
  .frame { width: 78vw; grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; justify-items: center; gap: 16px; text-align: center; padding: 16px 14px 18px; }
  .shot { height: 44svh; border-radius: 20px; }
  .js.motion .frame .shot { height: 100%; max-height: 46svh; min-height: 0; }
  .copy h3 { margin: 10px 0 8px; }
  .credits dl { gap: 4px 16px; }
  .credits dd { margin-bottom: 10px; }
}
@media (max-width: 420px) {
  .credits dl { grid-template-columns: 1fr; }
  .credits dt, .credits dd { text-align: center; }
}
@media (prefers-contrast: more), (prefers-reduced-transparency: reduce) {
  .dust, .screen::before { display: none; }
  .shot, .soon, .js.motion .playhead { box-shadow: none; }
  .shot { border-color: var(--amber); }
}

/* Páginas de texto */
.page { background: var(--bg) url("/assets/beam.jpg") no-repeat center top / min(1400px, 160vw) auto; }
.doc { max-width: 720px; margin: 0 auto; padding: 40px 16px 48px; }
.doc h1 { font: 700 clamp(36px, 7vw, 56px)/1.08 var(--display); letter-spacing: -.01em; margin: 14px 0 10px; }
.doc h2 { font-size: 22px; margin: 36px 0 6px; }
.doc p { color: #d8d1c6; }
.muted { color: var(--muted) !important; }
.contact { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px 20px; }
details { border-top: 1px solid var(--line); padding: 14px 0; }
details summary { cursor: pointer; font-weight: 600; }
details p { margin: 8px 0 0; }

footer {
  max-width: 1180px; margin: 56px auto 0; padding: 32px 16px calc(32px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; text-align: center;
}
footer p { margin: 4px 0; }

/* En el móvil, la cabecera cabe en una línea: Privacidad y Soporte siguen en el pie. */
@media (max-width: 560px) {
  .top { flex-wrap: nowrap; padding-top: 14px; }
  .top nav a { display: none; }
  select { max-width: 150px; }
}
