/* tamy.me V2 — "Río de color". Sin frameworks. */
:root {
  /* Tema claro (principal) */
  --bg: #ffffff;
  --ink: #111111;
  --dim: #6f6b66;
  --line: rgba(17, 17, 17, .14);
  --sombra: 0 24px 60px rgba(0, 0, 0, .18);
  --grano: .05;
  --overlay: rgba(255, 255, 255, .96);
  --azul-txt: #2b4bd9;
  --patron: .22;
  --rojo: #e2262c;
  --magenta: #c4258f;
  --amarillo: #f5b400;
  --teal: #1aa3b0;
  --lima: #a8c83a;
  /* Paleta del briefing de Tamy */
  --p-azul: #2b4bd9; --p-amarillo: #f6b800; --p-rojo: #e23a2c; --p-verde: #0f3f2b; --p-rosa: #ec4a9a; --p-naranja: #f5772a;
  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --body: "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --pad: clamp(18px, 3.5vw, 56px);
}
:root[data-theme="dark"] {
  --bg: #0b0b0c;
  --ink: #f1ede6;
  --dim: #8d8882;
  --line: rgba(241, 237, 230, .16);
  --sombra: 0 30px 80px rgba(0, 0, 0, .6);
  --grano: .07;
  --overlay: rgba(11, 11, 12, .96);
  --azul-txt: #6d86ff;
  --patron: .13;
}
/* Logos: una versión por tema */
.solo-oscuro { display: none; } .solo-claro { display: block; }
:root[data-theme="dark"] .solo-oscuro { display: block; } :root[data-theme="dark"] .solo-claro { display: none; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--body); font-size: 17px; line-height: 1.55;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-variation-settings: "wdth" 118; font-weight: 900; line-height: .9; letter-spacing: -.02em; text-transform: uppercase; }
.mono { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
.mono b { color: var(--ink); font-weight: 400; }

/* Grano */
.grain { position: fixed; inset: -50%; width: 200%; height: 200%; pointer-events: none; z-index: 50; opacity: var(--grano); mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grano 1.2s steps(6) infinite; }
@keyframes grano { 0%{transform:translate(0,0)} 20%{transform:translate(-3%,2%)} 40%{transform:translate(2%,-4%)} 60%{transform:translate(-4%,-1%)} 80%{transform:translate(3%,3%)} 100%{transform:translate(0,0)} }

/* Barra de paleta (como en el briefing) */
.paleta { position: fixed; top: 0; left: 0; right: 0; height: 6px; display: flex; z-index: 46; }
.paleta i { flex: 1; }
.paleta i:nth-child(1){background:var(--p-azul)} .paleta i:nth-child(2){background:var(--p-amarillo)} .paleta i:nth-child(3){background:var(--p-rojo)}
.paleta i:nth-child(4){background:var(--p-verde)} .paleta i:nth-child(5){background:var(--p-rosa)} .paleta i:nth-child(6){background:var(--p-naranja)}

/* Cabecera */
.top { position: fixed; inset: 0 0 auto 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; padding: 16px var(--pad); color: var(--ink); background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 80%, transparent), transparent); }
.top .mark img { width: 34px; height: auto; }
.top .center { display: none; }
@media (min-width: 900px) { .top .center { display: block; } }
.top nav { display: flex; gap: 22px; align-items: center; }
.top nav a, .top nav button { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); background: none; border: 0; cursor: pointer; padding: 0; }
.top nav a:hover, .top nav button:hover { color: var(--amarillo); }

/* Hero */
.hero { position: relative; min-height: 100svh; display: grid; grid-template-rows: 1fr auto; padding: 0 var(--pad) clamp(20px, 4vh, 48px); }
.hero .word { align-self: center; position: relative; }
.hero .word h1 { margin: 0; line-height: 0; }
.hero .word .wm {
  display: block; width: min(100%, 1500px); aspect-ratio: 1643 / 343; margin: 0 auto;
  background: url("img/hero.webp") center 55% / cover no-repeat; filter: contrast(1.05) saturate(1.1); image-rendering: auto;
  -webkit-mask: url("img/tamy-wordmark.png") center / contain no-repeat; mask: url("img/tamy-wordmark.png") center / contain no-repeat;
}
.hero .word::after { content: ""; position: absolute; inset: -8% -8% -8%; background: radial-gradient(60% 60% at 50% 55%, rgba(226,38,44,.12), transparent 70%); z-index: -1; filter: blur(30px); }
.hero .foot { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 16px; }
.hero .foot .tag { font-size: clamp(18px, 2.2vw, 28px); line-height: 1.2; max-width: 22ch; font-weight: 500; }
.hero .foot .tag em { font-style: normal; color: var(--amarillo); }
.hero .foot .scroll { text-align: center; }
.hero .foot .right { text-align: right; padding-right: 130px; }
@media (max-width: 700px) { .hero .foot { grid-template-columns: 1fr; } .hero .foot .right, .hero .foot .scroll { text-align: left; } }

/* Capítulos */
.cap { position: relative; }
.cap-head { display: flex; align-items: baseline; gap: 18px; padding: 0 var(--pad); }
.cap-head .n { font-family: var(--mono); font-size: 12px; color: var(--dim); }
.cap-head h2 { font-size: clamp(42px, 8vw, 132px); }
.cap-head .sub { margin-left: auto; max-width: 30ch; color: var(--dim); font-size: 15px; text-align: right; }
@media (max-width: 700px) { .cap-head { flex-wrap: wrap; } .cap-head .sub { margin-left: 0; text-align: left; } }

/* 01 Río: sticky + pista horizontal. Obras "tiradas sobre la mesa": inclinadas y montándose entre sí */
.rio { height: 260vh; }
.rio .pin { position: sticky; top: 0; height: 100svh; overflow: hidden; display: flex; flex-direction: column; }
.rio .cap-head { padding-top: 88px; }
.rio .cap-head.mini { justify-content: space-between; }
.rio .cap-head.mini .sub { margin-left: 0; }
.rio .track { position: relative; flex: 1; display: flex; align-items: center; padding-left: calc(var(--pad) + 2vw); will-change: transform; }
.rio .obra { position: relative; flex: 0 0 auto; cursor: zoom-in; margin-left: -5vw; padding: 6px; background: #fff; box-shadow: 0 18px 50px rgba(0,0,0,.22); transition: transform .45s ease, box-shadow .45s ease; }
:root[data-theme="dark"] .rio .obra { background: #1a1a1c; box-shadow: 0 24px 60px rgba(0,0,0,.6); }
.rio .obra:first-child { margin-left: 0; }
.rio .obra img { height: var(--h, 44vh); width: auto; max-width: none; display: block; }
.rio .obra .cap-txt { position: absolute; left: 6px; top: calc(100% + 8px); white-space: nowrap; opacity: 0; transition: opacity .3s; }
.rio .obra:hover { z-index: 10 !important; transform: rotate(0deg) translateY(-8px) scale(1.03) !important; box-shadow: 0 30px 70px rgba(0,0,0,.3); }
.rio .obra:hover .cap-txt { opacity: 1; }
/* Inclinaciones, alturas y solapes pseudoaleatorios (ciclo de 7) */
.rio .obra:nth-child(7n+1) { --h: 52vh; transform: rotate(-4deg) translateY(-6vh); z-index: 3; }
.rio .obra:nth-child(7n+2) { --h: 36vh; transform: rotate(5deg) translateY(9vh); z-index: 5; }
.rio .obra:nth-child(7n+3) { --h: 46vh; transform: rotate(-2deg) translateY(-1vh); z-index: 2; }
.rio .obra:nth-child(7n+4) { --h: 40vh; transform: rotate(6deg) translateY(-11vh); z-index: 4; }
.rio .obra:nth-child(7n+5) { --h: 56vh; transform: rotate(-5deg) translateY(4vh); z-index: 1; }
.rio .obra:nth-child(7n+6) { --h: 34vh; transform: rotate(3deg) translateY(12vh); z-index: 6; }
.rio .obra:nth-child(7n+7) { --h: 48vh; transform: rotate(-7deg) translateY(-4vh); z-index: 2; }
.rio .fin { flex: 0 0 auto; width: 34vw; padding-left: 8vw; }
.rio .fin p { font-family: var(--display); font-variation-settings: "wdth" 110; font-weight: 800; font-size: clamp(26px, 3.5vw, 54px); line-height: 1; text-transform: uppercase; max-width: 12ch; }
.rio .fin p span { color: var(--rojo); }
.rio .bar { position: absolute; left: var(--pad); right: var(--pad); bottom: 22px; height: 1px; background: var(--line); }
.rio .bar i { position: absolute; left: 0; top: -1px; height: 3px; width: 0; background: var(--ink); }
@media (max-width: 720px) {
  .rio { height: auto; }
  .rio .pin { position: static; height: auto; overflow: visible; }
  .rio .track { overflow-x: auto; scroll-snap-type: x mandatory; padding: 14vh var(--pad) 10vh; scrollbar-width: none; }
  .rio .track::-webkit-scrollbar { display: none; }
  .rio .obra { scroll-snap-align: center; margin-left: -8vw; }
  .rio .obra img { height: 46vh; }
  .rio .obra:nth-child(7n+1), .rio .obra:nth-child(7n+3), .rio .obra:nth-child(7n+5), .rio .obra:nth-child(7n+7) { --h: 46vh; }
  .rio .obra:nth-child(7n+2), .rio .obra:nth-child(7n+4), .rio .obra:nth-child(7n+6) { --h: 36vh; }
  .rio .fin { width: 80vw; }
  .rio .bar { display: none; }
}

/* 02 Tamy */
.tamy { padding: clamp(80px, 14vh, 160px) 0 0; }
.tamy .grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(28px, 5vw, 80px); padding: 40px var(--pad) 0; align-items: start; }
@media (max-width: 720px) { .tamy .grid { grid-template-columns: 1fr; } }
/* Collage superpuesto; el contenedor tiene proporción fija para que nada se salga */
.tamy .fotos { position: relative; aspect-ratio: 4 / 5; }
.tamy .fotos img { position: absolute; box-shadow: var(--sombra); }
.tamy .fotos .a { left: 0; top: 0; width: 66%; z-index: 1; }
.tamy .fotos .b { right: 0; top: 18%; width: 44%; z-index: 2; }
.tamy .fotos .c { left: 4%; top: 60%; width: 40%; z-index: 3; }
.tamy .fotos .d { right: 4%; top: 56%; width: 40%; z-index: 2; }
@media (max-width: 720px) {
  .tamy .fotos { aspect-ratio: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; }
  .tamy .fotos img.a, .tamy .fotos img.b, .tamy .fotos img.c, .tamy .fotos img.d { position: static; width: 100%; margin: 0; grid-column: auto; grid-row: auto; transform: none !important; }
  .tamy .fotos img.d { grid-column: 1 / -1; aspect-ratio: 4 / 3; object-fit: cover; object-position: 50% 35%; }
  .tamy .fotos img.a { grid-column: 1 / -1; aspect-ratio: 4 / 3; object-fit: cover; object-position: 50% 45%; }
  .tamy .fotos img.b, .tamy .fotos img.c { aspect-ratio: 3 / 4; object-fit: cover; }
  .tamy .texto { position: static; }
}
.tamy .texto { position: sticky; top: 90px; }
.tamy .texto p { font-size: clamp(19px, 1.7vw, 24px); line-height: 1.45; margin: 0 0 1.1em; max-width: 46ch; }
.tamy .texto p:first-of-type { font-family: var(--display); font-variation-settings: "wdth" 105; font-weight: 800; font-size: clamp(26px, 2.8vw, 40px); line-height: 1.05; text-transform: none; letter-spacing: -.01em; }
.tamy .texto mark { background: none; color: var(--amarillo); }
.tamy .texto mark.m { color: var(--magenta); } .tamy .texto mark.t { color: var(--teal); } .tamy .texto mark.r { color: var(--rojo); }
.tamy .datos { display: grid; grid-template-columns: repeat(3, auto); gap: 24px; margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); }
.tamy .datos div b { display: block; font-family: var(--display); font-weight: 800; font-size: 22px; text-transform: none; }

/* Frases (marquee) */
.frases { margin-top: clamp(60px, 10vh, 120px); overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 14px 0; }
.frases .lane { display: flex; gap: 14px; width: max-content; animation: lane 60s linear infinite; }
.frases:hover .lane { animation-play-state: paused; }
.frases .lane img { width: 170px; height: 170px; border-radius: 4px; }
@keyframes lane { to { transform: translateX(-50%); } }

/* 03 Capitán Río: paneles en horizontal mientras bajas */
.cr { height: 380vh; }
.cr .pin { position: sticky; top: 0; height: 100svh; overflow: hidden; }
.cr .patron { position: absolute; inset: 0; opacity: var(--patron); background: url("img/cr-p1.webp") 0 0 / 380px repeat; mask-image: linear-gradient(180deg, transparent, #000 20%, #000 80%, transparent); -webkit-mask-image: linear-gradient(180deg, transparent, #000 20%, #000 80%, transparent); }
.cr .patron.dos { background-image: url("img/cr-p2.webp"); background-position: 190px 190px; opacity: calc(var(--patron) * .6); }
.cr .track { position: relative; height: 100%; display: flex; align-items: center; will-change: transform; }
.cr .panel { flex: 0 0 auto; width: auto; max-width: 92vw; height: 100%; padding: 100px 6vw 60px var(--pad); display: flex; align-items: center; gap: clamp(24px, 4vw, 56px); }
.cr .panel + .panel { padding-left: 0; }
.cr .panel.p2 { margin-left: 42vw; }   /* el 2º arranca fuera de pantalla: entra mientras el 1º sigue quieto */
.cr .panel.p1 { will-change: transform; }
.cr .panel.p1 { flex-direction: column; align-items: flex-start; justify-content: center; gap: 18px; width: 58vw; padding-right: 4vw; }
.cr .cabeza { display: flex; align-items: center; gap: 20px; }
.cr .cabeza img { height: clamp(42px, 5vw, 64px); width: auto; }
.cr h2 { font-size: clamp(36px, 6.4vw, 104px); max-width: 12ch; }
.cr h2 span { color: var(--amarillo); }
.cr p { font-size: clamp(17px, 1.5vw, 21px); max-width: 46ch; margin: 0 0 1em; }
.cr p.big { font-family: var(--display); font-variation-settings: "wdth" 105; font-weight: 800; font-size: clamp(24px, 2.6vw, 38px); line-height: 1.05; text-transform: none; max-width: 24ch; }
.cr .p1 p.big { max-width: 30ch; }
.cr .pista { margin-top: 10px; }
.cr .txt { flex: 0 1 34vw; min-width: 280px; }
.cr .foto { flex: 0 0 auto; height: min(68vh, 640px); width: auto; box-shadow: var(--sombra); border-radius: 3px; }
.cr .foto.chica { height: min(38vh, 360px); align-self: flex-end; margin-bottom: 4vh; transform: rotate(3deg); }
.cr .p3 .foto:first-child { transform: rotate(-2deg); }
.cr .estampado { flex: 0 0 auto; width: min(38vw, 520px); aspect-ratio: 1; object-fit: cover; border-radius: 3px; box-shadow: var(--sombra); transform: rotate(-3deg); }
.cr .cita { margin: 22px 0; padding: 0; border: 0; font-family: var(--display); font-variation-settings: "wdth" 100; font-weight: 700; font-size: clamp(20px, 2vw, 28px); line-height: 1.15; max-width: 30ch; }
.cr .cita.rosa { color: var(--p-rosa); } .cr .cita.azul { color: var(--azul-txt); }
.cr p.big mark { background: var(--p-amarillo); color: #111; padding: 0 .15em; }
.cr .btn { display: inline-flex; align-items: center; gap: 10px; margin-top: 10px; padding: 14px 20px; border: 1px solid var(--ink); border-radius: 999px; font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; transition: background .2s, color .2s; }
.cr .btn:hover { background: var(--amarillo); border-color: var(--amarillo); color: #111; }
.cr .hash { display: inline-block; margin: 10px 0 0 14px; color: var(--p-naranja); }
.cr .disenos { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 26px; }
.cr .disenos span { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--dim); }
.cr .bar { position: absolute; left: var(--pad); right: var(--pad); bottom: 22px; height: 1px; background: var(--line); }
.cr .bar i { position: absolute; left: 0; top: -1px; height: 3px; width: 0; background: var(--ink); }
@media (max-width: 720px) {
  .cr { height: auto; }
  .cr .pin { position: static; height: auto; overflow: visible; }
  .cr .track { display: block; height: auto; transform: none !important; }
  .cr .panel { width: auto; height: auto; flex-direction: column; align-items: flex-start; padding: 60px var(--pad) 20px; }
  .cr .panel.p1 { padding-top: 90px; }
  .cr .txt { flex: none; }
  .cr .panel.p2 { margin-left: 0; }
  .cr .foto, .cr .foto.chica { height: auto; width: 100%; max-height: none; transform: none; margin: 0; }
  .cr .estampado { width: 100%; transform: none; }
  .cr .pista, .cr .bar { display: none; }
}

/* 04 Hola */
.hola { padding: clamp(80px, 16vh, 200px) var(--pad) 60px; text-align: center; }
.hola .cierre { font-family: var(--display); font-variation-settings: "wdth" 105; font-weight: 800; font-size: clamp(24px, 3.4vw, 46px); line-height: 1.05; text-transform: uppercase; max-width: 22ch; margin: 0 auto 60px; }
.hola .cierre .c1{color:var(--azul-txt)} .hola .cierre .c2{color:var(--p-rosa)} .hola .cierre .c3{color:var(--p-rojo)} .hola .cierre .c4{color:var(--p-amarillo)} .hola .cierre .c5{color:var(--lima)}
.hola h2 { font-size: clamp(48px, 10.2vw, 180px); }
.hola h2 span { color: var(--rojo); }
.hola .mail { display: inline-block; margin: 28px 0 18px; font-family: var(--display); font-variation-settings: "wdth" 100; font-weight: 800; font-size: clamp(22px, 4.6vw, 64px); letter-spacing: -.02em; border-bottom: 3px solid var(--amarillo); line-height: 1.1; word-break: break-all; }
.hola .mail:hover { color: var(--amarillo); }
.hola .links { display: flex; justify-content: center; gap: 28px; flex-wrap: wrap; margin-top: 18px; }
.hola .links a { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.hola .links a:hover { color: var(--ink); }
footer { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 40px var(--pad); border-top: 1px solid var(--line); }

/* Dial (navegación abstracta) */
.dial { position: fixed; right: 22px; bottom: 22px; z-index: 45; width: 108px; height: 108px; }
.dial svg { width: 100%; height: 100%; overflow: visible; }
.dial .ring { fill: none; stroke: var(--line); stroke-width: 1; }
.dial .arc { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; transition: stroke-dashoffset .15s linear; }
.dial .dot { fill: var(--bg); stroke: var(--ink); stroke-width: 1.2; cursor: pointer; transition: fill .2s, r .2s; }
.dial .dot:hover, .dial .dot.on { fill: var(--amarillo); stroke: var(--amarillo); }
.dial .lbl { position: absolute; right: 118px; bottom: 44px; white-space: nowrap; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); opacity: 0; transition: opacity .2s; pointer-events: none; }
.dial:hover .lbl { opacity: 1; }
.dial .num { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--mono); font-size: 12px; pointer-events: none; }
@media (max-width: 700px) { .dial { width: 72px; height: 72px; right: 14px; bottom: 14px; } .dial .lbl { display: none; } }

/* Menú a pantalla completa */
.menu { position: fixed; inset: 0; z-index: 60; background: var(--overlay); display: none; padding: 100px var(--pad) 40px; overflow: auto; }
.menu.open { display: block; }
.menu ul { list-style: none; margin: 0; padding: 0; }
.menu li a { display: flex; align-items: baseline; gap: 20px; padding: 10px 0; border-bottom: 1px solid var(--line); font-family: var(--display); font-variation-settings: "wdth" 118; font-weight: 900; font-size: clamp(40px, 8.6vw, 128px); line-height: 1; text-transform: uppercase; color: var(--dim); transition: color .2s; }
.menu li a:hover { color: var(--ink); }
.menu li a small { font-family: var(--mono); font-size: 12px; font-weight: 400; letter-spacing: .08em; }
.menu .peek { position: fixed; width: 260px; aspect-ratio: 4 / 5; pointer-events: none; opacity: 0; transform: translate(-50%, -50%) rotate(-3deg); transition: opacity .2s; object-fit: cover; box-shadow: var(--sombra); }
.menu .cerrar { position: fixed; top: 16px; right: var(--pad); font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); background: none; border: 0; cursor: pointer; }
.menu .pie { display: flex; gap: 24px; margin-top: 30px; }

/* Visor */
dialog.visor { border: 0; padding: 0; margin: 0; width: 100vw; height: 100vh; max-width: none; max-height: none; background: rgba(11,11,12,.97); color: var(--ink); }
dialog.visor::backdrop { background: rgba(0,0,0,.6); }
.visor .marco { width: 100%; height: 100%; display: grid; place-items: center; padding: 60px 20px 70px; }
.visor img { max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 30px 90px rgba(0,0,0,.7); }
.visor .pie { position: fixed; left: var(--pad); right: var(--pad); bottom: 22px; display: flex; justify-content: space-between; }
.visor button { position: fixed; background: none; border: 1px solid var(--line); color: var(--ink); width: 44px; height: 44px; border-radius: 50%; cursor: pointer; font-size: 20px; }
.visor .x { top: 16px; right: 16px; }
.visor .p { left: 16px; top: 50%; } .visor .n { right: 16px; top: 50%; }

/* Reveal */
.rv { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s ease; }
.rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .grain, .frases .lane { animation: none; } .rv { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }

/* Botón de tema */
.tema { display: inline-flex; align-items: center; gap: 6px; }
.tema i { width: 10px; height: 10px; border-radius: 50%; border: 1px solid currentColor; background: linear-gradient(90deg, currentColor 50%, transparent 50%); }
