/* FEUDALPUNK — hoja de estilos única. Paleta de la Biblia v1.6. */

/* ------------------------------------------------------------ fuentes (OFL, autoalojadas) */
@font-face { font-family: 'Cinzel'; src: url('/assets/fonts/cinzel-var.woff2') format('woff2'); font-weight: 400 900; font-display: swap; }
@font-face { font-family: 'Alegreya Sans'; src: url('/assets/fonts/alegreya-sans-regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Alegreya Sans'; src: url('/assets/fonts/alegreya-sans-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Alegreya Sans'; src: url('/assets/fonts/alegreya-sans-bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'VT323'; src: url('/assets/fonts/vt323.woff2') format('woff2'); font-display: swap; }

:root {
  --steel: #2B303A; --steel-hi: #4A5264; --steel-lo: #171A21;
  --stone: #5A5E66; --stone-hi: #7A808A; --stone-lo: #363940;
  --wood: #4A3222; --wood-hi: #6B4A35; --wood-lo: #291A11;
  --amber: #F29F3D; --amber-hi: #FFD275; --amber-lo: #B8531E;
  --ice: #6BD4F0; --ice-hi: #B8F2FF; --ice-lo: #2E7EA1;
  --sky: #1E223D; --sky-hi: #3D2E52; --sky-lo: #0F1121;

  --text: #ECE5D6;          /* pergamino */
  --text-dim: #BDB8C9;      /* 9:1 sobre --sky-lo */
  --line: rgba(122, 128, 138, .35);
  --glass: rgba(15, 17, 33, .62);

  --f-display: 'Cinzel', Georgia, serif;
  --f-body: 'Alegreya Sans', 'Segoe UI', system-ui, sans-serif;
  --f-hud: 'VT323', ui-monospace, 'Consolas', monospace;

  --gutter: clamp(1rem, 4vw, 3rem);
  --bar-h: 64px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --chamfer: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
  color-scheme: dark;
}

/* ------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--bar-h) + 1rem); background: var(--sky-lo); }
body { margin: 0; min-height: 100vh; overflow-x: clip; background: transparent; color: var(--text); font: 400 1.0625rem/1.6 var(--f-body); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, video, svg { display: block; max-width: 100%; }
img, video { height: auto; }
a { color: var(--amber-hi); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: #fff1c9; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 700; line-height: 1.12; letter-spacing: .04em; margin: 0 0 .5em; text-wrap: balance; }
p { margin: 0 0 1em; }
button { font: inherit; color: inherit; }
main { display: block; outline: none; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
::selection { background: var(--amber); color: var(--sky-lo); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip { position: fixed; left: 1rem; top: -4rem; z-index: 300; padding: .75rem 1rem; background: var(--amber); color: var(--sky-lo); font-weight: 700; text-decoration: none; transition: top .2s; }
.skip:focus { top: 1rem; color: var(--sky-lo); }
.hud { font-family: var(--f-hud); font-size: 1.25rem; line-height: 1.1; letter-spacing: .06em; text-transform: uppercase; color: var(--ice); text-shadow: 0 0 6px rgba(107, 212, 240, .3); margin: 0 0 .6rem; }
.glyph { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ------------------------------------------------------------ cielo de fondo */
.sky { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(120% 70% at 78% -10%, rgba(61, 46, 82, .9) 0, transparent 60%),
    radial-gradient(90% 60% at 0% 110%, rgba(30, 34, 61, .95) 0, transparent 65%),
    linear-gradient(180deg, #13152a 0%, var(--sky-lo) 60%); }
.stars { position: absolute; inset: 0; background-repeat: repeat; }
.stars.s1 { background-image: url('/assets/img/stars-1.webp'); opacity: .6; }
.stars.s2 { background-image: url('/assets/img/stars-2.webp'); opacity: .5; }
.is-loaded .stars.s2 { animation: twinkle 7s ease-in-out infinite alternate; }
@keyframes twinkle { to { opacity: .1; } }

/* ------------------------------------------------------------ barra superior */
.bar { position: fixed; inset: 0 0 auto; z-index: 50; height: var(--bar-h); display: flex; align-items: center; gap: 1rem; padding: 0 var(--gutter);
  background: linear-gradient(180deg, rgba(15, 17, 33, .88), rgba(15, 17, 33, 0)); transition: background .4s var(--ease), box-shadow .4s; view-transition-name: bar; }
.bar.is-scrolled { background: rgba(15, 17, 33, .9); box-shadow: 0 1px 0 var(--line); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--text); text-decoration: none; min-height: 44px; margin-right: auto; }
.brand:hover { color: var(--amber-hi); }
.brand-emblem { width: 26px; height: 31px; }
.brand-word { font-family: var(--f-display); font-weight: 700; font-size: 1.05rem; letter-spacing: .2em; text-transform: uppercase; }
.emblem, .brand-emblem, .wm-emblem, .foot-emblem, .empty-emblem { overflow: visible; }
.em-shield { fill: var(--steel); stroke: var(--amber); stroke-width: 1.6; }
.em-chev { fill: none; stroke: var(--amber); stroke-width: 1.8; stroke-linejoin: round; }
.em-star { fill: var(--ice); }
.bar-nav { display: none; }
.bar-nav ul { display: flex; gap: clamp(.6rem, 1.4vw, 1.4rem); list-style: none; margin: 0; padding: 0; }
.bar-nav a { display: inline-block; padding: .6rem 0; font-family: var(--f-display); font-weight: 600; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-dim); text-decoration: none; border-bottom: 1px solid transparent; }
.bar-nav a:hover, .bar-nav a[aria-current] { color: var(--amber-hi); border-color: var(--amber); }
@media (min-width: 1180px) { .bar-nav { display: block; } }
.bar-tools { display: flex; align-items: center; gap: .5rem; }
.tool { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-width: 44px; height: 44px; padding: 0 .7rem; border: 1px solid rgba(122, 128, 138, .45); background: rgba(23, 26, 33, .55); color: var(--text); cursor: pointer; text-decoration: none; font-family: var(--f-display); font-weight: 600; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; transition: border-color .2s, color .2s, box-shadow .2s; }
.tool:hover { border-color: var(--amber); color: var(--amber-hi); box-shadow: 0 0 18px rgba(242, 159, 61, .2); }
.tool .glyph { width: 20px; height: 20px; }
.chart-toggle-label { display: none; }
@media (min-width: 560px) { .chart-toggle-label { display: inline; } }
.sound-toggle .g-on { display: none; }
.sound-toggle[aria-pressed="true"] { border-color: var(--amber); color: var(--amber-hi); }
.sound-toggle[aria-pressed="true"] .g-on { display: block; }
.sound-toggle[aria-pressed="true"] .g-off { display: none; }
.sound-toggle[aria-pressed="true"] .w1, .sound-toggle[aria-pressed="true"] .w2 { animation: wave 1.6s ease-in-out infinite; }
.sound-toggle[aria-pressed="true"] .w2 { animation-delay: .3s; }
@keyframes wave { 50% { opacity: .25; } }

/* ------------------------------------------------------------ botones */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .6em; min-height: 48px; padding: .7em 1.3em; border: 1px solid rgba(255, 210, 117, .4); background: rgba(15, 17, 33, .72); color: var(--text); font-family: var(--f-display); font-weight: 600; font-size: .85rem; letter-spacing: .14em; text-transform: uppercase; text-decoration: none; cursor: pointer; transition: border-color .25s, color .25s, box-shadow .25s, background .25s; }
.btn::before, .btn::after { content: ''; position: absolute; width: 7px; height: 7px; border: 1px solid var(--amber); pointer-events: none; }
.btn::before { top: -4px; left: -4px; border-right: 0; border-bottom: 0; }
.btn::after { bottom: -4px; right: -4px; border-left: 0; border-top: 0; }
.btn:hover { border-color: var(--amber); color: var(--amber-hi); box-shadow: 0 0 28px rgba(242, 159, 61, .22); }
.btn .glyph { width: 1.1em; height: 1.1em; }
.btn--amber { background: linear-gradient(180deg, var(--amber-hi), var(--amber) 55%, #d9822c); color: #1d1206; border-color: var(--amber-hi); }
.btn--amber:hover { color: #1d1206; background: linear-gradient(180deg, #ffe4a3, var(--amber-hi) 60%, var(--amber)); }
.ctas { display: flex; flex-wrap: wrap; gap: .9rem 1rem; margin-top: 1.6rem; }

/* ------------------------------------------------------------ fondos a sangre */
.bg { position: absolute; inset: -10% 0; background-color: var(--sky); background-size: cover; background-position: center; }
.bg picture { display: contents; }
.bg-img, .bg-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--focus, 50% 50%); }
@media (max-aspect-ratio: 4/5) { .bg-img.has-portrait { object-position: 50% 50%; } }
.bg-video { opacity: 0; transition: opacity 1.2s var(--ease); }
.bg-video.is-playing { opacity: 1; }
.is-loaded .kb .bg-img { animation: kenburns 42s ease-in-out infinite alternate; transform-origin: 60% 45%; will-change: transform; }
@keyframes kenburns { from { transform: scale(1.02) translate3d(0, 0, 0); } to { transform: scale(1.14) translate3d(-1.5%, -1%, 0); } }
.bg--pixel .bg-img { inset: 0 0 auto; height: 124%; object-position: 50% 0 !important; } /* oculta los rótulos inferiores de las láminas */
.bg--empty { background: radial-gradient(80% 60% at 70% 20%, var(--sky-hi), var(--sky-lo)); }

/* ------------------------------------------------------------ héroes */
.hero { position: relative; display: grid; align-items: end; min-height: 74svh; overflow: hidden; isolation: isolate; }
.hero--home { min-height: 100svh; }
.hero--def, .hero--music { min-height: 58svh; }
.hero--404 { min-height: 100svh; }
.hero-scrim, .panel-scrim { position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(15, 17, 33, .7) 0, rgba(15, 17, 33, 0) 22%),
    linear-gradient(0deg, rgba(15, 17, 33, .97) 0, rgba(15, 17, 33, .78) 28%, rgba(15, 17, 33, .15) 62%, rgba(15, 17, 33, 0) 80%); }
.hero-content { position: relative; z-index: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: calc(var(--bar-h) + 2rem) var(--gutter) clamp(2.5rem, 8vh, 5.5rem); }
.wordmark { margin: 0 0 .25em; font-weight: 800; font-size: clamp(2.3rem, 9.6vw, 7.6rem); line-height: .95; letter-spacing: .07em; text-transform: uppercase; }
.wm-emblem { width: clamp(40px, 5.5vw, 66px); height: auto; margin-bottom: .25em; }
.wm-text { display: block; color: #F7D9A6; background: linear-gradient(180deg, #FFF1D6 0%, #F7D9A6 38%, var(--amber) 72%, #C8662A 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.tagline { font-family: var(--f-display); font-weight: 600; font-size: clamp(1.25rem, 3.2vw, 2.1rem); letter-spacing: .06em; color: var(--amber-hi); margin-bottom: .4em; text-shadow: 0 2px 12px rgba(15, 17, 33, .9); }
.hero-sub, .lead { max-width: 40ch; font-size: clamp(1.1rem, 1.8vw, 1.35rem); color: var(--text); text-shadow: 0 1px 10px rgba(15, 17, 33, .95); }
.page-title { font-size: clamp(2.2rem, 7vw, 5.4rem); letter-spacing: .05em; text-transform: uppercase; text-shadow: 0 2px 10px rgba(15, 17, 33, .9); margin-bottom: .3em; }
.title-sub { display: block; font-size: .32em; letter-spacing: .4em; color: var(--amber); margin-top: .5em; }
.scroll-hint { position: absolute; z-index: 1; left: 50%; bottom: 1rem; transform: translateX(-50%); display: none; flex-direction: column; align-items: center; color: var(--text-dim); text-decoration: none; }
.scroll-hint .hud { font-size: 1rem; margin: 0; }
.is-loaded .scroll-hint .glyph { animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(6px); } }
@media (min-width: 900px) and (min-height: 700px) { .scroll-hint { display: flex; } }

.crumbs ol { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; margin: 0 0 1rem; padding: 0; font-family: var(--f-hud); font-size: 1.15rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim); }
.crumbs li + li::before { content: '›'; margin-right: .4rem; color: var(--amber); }
.crumbs a { color: var(--text-dim); text-decoration: none; }
.crumbs a:hover { color: var(--amber-hi); }

/* ------------------------------------------------------------ viaje (paneles de la portada) */
.panel { position: relative; display: grid; align-items: center; min-height: 88svh; overflow: hidden; isolation: isolate; border-top: 1px solid rgba(242, 159, 61, .18); }
.panel .panel-scrim { background: linear-gradient(90deg, rgba(15, 17, 33, .92) 0, rgba(15, 17, 33, .55) 45%, rgba(15, 17, 33, .05) 80%), linear-gradient(0deg, rgba(15, 17, 33, .7), transparent 40%); }
.panel-content { position: relative; z-index: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 4rem var(--gutter); }
.panel-title { font-size: clamp(2.6rem, 9vw, 6.5rem); text-transform: uppercase; letter-spacing: .06em; margin-bottom: .2em; text-shadow: 0 2px 10px rgba(15, 17, 33, .9); }
.panel-teaser { font-size: clamp(1.15rem, 2vw, 1.5rem); max-width: 30ch; text-shadow: 0 1px 10px rgba(15, 17, 33, .95); }
@media (min-width: 900px) {
  .panel:nth-child(even) .panel-content { text-align: right; display: flex; flex-direction: column; align-items: flex-end; }
  .panel:nth-child(even) .panel-scrim { background: linear-gradient(270deg, rgba(15, 17, 33, .92) 0, rgba(15, 17, 33, .55) 45%, rgba(15, 17, 33, .05) 80%), linear-gradient(0deg, rgba(15, 17, 33, .7), transparent 40%); }
}
@media (max-width: 899px) { .panel { align-items: end; } .panel .panel-scrim { background: linear-gradient(0deg, rgba(15, 17, 33, .96) 0, rgba(15, 17, 33, .7) 35%, rgba(15, 17, 33, .05) 75%); } }

/* ------------------------------------------------------------ bandas */
.band { position: relative; padding: clamp(3.5rem, 9vh, 7rem) 0; }
.journey .panel:nth-child(n+2), .band, .next-sector, .foot { content-visibility: auto; contain-intrinsic-size: auto 800px; }
.band-inner { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); }
.band-inner--narrow { max-width: 860px; }
.band-inner--wide { max-width: 1600px; }
.band-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4em 1em; font-size: clamp(1.6rem, 4vw, 2.7rem); text-transform: uppercase; letter-spacing: .06em; margin-bottom: .9em; }
.band-title::after { content: ''; flex: 1 1 4rem; height: 1px; min-width: 3rem; align-self: center; background: linear-gradient(90deg, var(--amber), rgba(242, 159, 61, 0)); }
.band-text { max-width: 60ch; font-size: 1.15rem; color: var(--text-dim); }
.band--gradient { background: linear-gradient(180deg, transparent, rgba(30, 34, 61, .55) 30%, rgba(30, 34, 61, .55) 70%, transparent); }
.band--music { text-align: left; }
.count { font-size: 1.2rem; margin: 0; }
.page-head { padding: calc(var(--bar-h) + 3rem) 0 1rem; }

/* ------------------------------------------------------------ revelado al desplazar */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .9s var(--ease), transform .9s var(--ease); animation: reveal-fallback 0s 2.5s forwards; }
.js .reveal.in { opacity: 1; transform: none; animation: none; }
@keyframes reveal-fallback { to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------ mosaico de obras */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: clamp(.8rem, 1.6vw, 1.3rem); list-style: none; margin: 0 0 2rem; padding: 0; }
.tiles--gallery { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.tile[hidden] { display: none; }
@media (max-width: 599px) {
  .tiles--gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .tiles--gallery .tile-meta { padding: .55rem .6rem .7rem; gap: .35rem; }
  .tiles--gallery .tile-title { font-size: .85rem; }
  .tiles--gallery .tag { font-size: .95rem; padding: 0 .3rem; }
}
.tile-link { display: block; height: 100%; color: var(--text); text-decoration: none; background: linear-gradient(170deg, rgba(43, 48, 58, .7), rgba(23, 26, 33, .9)); border: 1px solid rgba(74, 82, 100, .6); transition: border-color .3s, box-shadow .3s, transform .3s var(--ease); }
.tile-link:hover { border-color: var(--amber); box-shadow: 0 10px 40px -12px rgba(242, 159, 61, .35); color: var(--text); }
.tile-media { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background-size: cover; background-position: center; background-color: var(--steel-lo); }
.tile-img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.tile--port .tile-img { object-position: 50% 30%; }
.tile-link:hover .tile-img { transform: scale(1.06); }
.tile-meta { display: flex; flex-direction: column; gap: .45rem; padding: .85rem 1rem 1rem; }
.tile-title { font-family: var(--f-display); font-weight: 700; font-size: 1rem; letter-spacing: .04em; line-height: 1.25; }
.tile-tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.tag { display: inline-block; padding: .05rem .45rem; border: 1px solid rgba(107, 212, 240, .45); font-family: var(--f-hud); font-size: 1.05rem; letter-spacing: .05em; text-transform: uppercase; color: var(--ice-hi); line-height: 1.2; }
.tag--pixel { border-color: rgba(242, 159, 61, .5); color: var(--amber-hi); }
.tile-loop { position: absolute; top: .6rem; left: .6rem; display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .5rem; background: rgba(15, 17, 33, .75); font-family: var(--f-hud); font-size: 1rem; text-transform: uppercase; color: var(--ice-hi); }
.tile-loop .glyph { width: 14px; height: 14px; }

/* ------------------------------------------------------------ fichas */
.cards { align-items: start; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: clamp(.8rem, 1.6vw, 1.3rem); list-style: none; margin: 0; padding: 0; }
.card { position: relative; display: flex; flex-direction: column; padding: 1.4rem 1.4rem 1.3rem; background: linear-gradient(165deg, rgba(43, 48, 58, .8), rgba(23, 26, 33, .92)); border: 1px solid rgba(74, 82, 100, .55); clip-path: var(--chamfer); }
.card::before { content: ''; position: absolute; inset: 0 0 auto; height: 2px; background: linear-gradient(90deg, var(--amber), transparent 70%); }
.card-title { font-size: 1.2rem; letter-spacing: .05em; text-transform: uppercase; margin-bottom: .35em; }
.card-text { color: var(--text-dim); margin-bottom: 1rem; }
.card .lvl { margin-top: auto; }
.card-art { display: block; margin: -.2rem -.2rem 1rem; border: 1px solid rgba(74, 82, 100, .6); }
.card-art:hover { border-color: var(--amber); }
.card--house { align-items: flex-start; }
.card--house::before { height: 3px; background: linear-gradient(90deg, var(--h1), var(--h2)); }
.card--house .blazon { width: 88px; height: auto; margin-bottom: 1rem; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .55)); }
.card-motto { font-style: italic; font-size: 1.1rem; color: var(--h2); margin-bottom: .5rem; }
.swatch-row { display: flex; gap: .35rem; margin: auto 0 0; }
.swatch-row span { width: 28px; height: 10px; border: 1px solid rgba(255, 255, 255, .2); }
.lvl { display: inline-flex; align-items: center; gap: .6rem; font-family: var(--f-hud); font-size: 1.1rem; text-transform: uppercase; color: var(--text-dim); }
.lvl-segs { display: inline-flex; gap: 3px; }
.seg { display: inline-grid; place-items: center; width: 1.6rem; height: 1.35rem; border: 1px solid rgba(107, 212, 240, .35); color: var(--stone-hi); line-height: 1; }
.seg.on { background: linear-gradient(180deg, var(--amber-hi), var(--amber)); border-color: var(--amber-hi); color: #1d1206; }

/* ------------------------------------------------------------ vacío */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .3rem; padding: 3rem 1.5rem; border: 1px dashed rgba(122, 128, 138, .5); background: rgba(23, 26, 33, .5); }
.empty-emblem { width: 52px; height: auto; opacity: .85; margin-bottom: .6rem; }
.empty h2, .empty h3 { font-size: 1.4rem; text-transform: uppercase; }
.empty p { color: var(--text-dim); max-width: 46ch; }

/* ------------------------------------------------------------ siguiente sector */
.next-sector { position: relative; display: grid; place-items: center; align-content: center; gap: 1.5rem; min-height: 62svh; overflow: hidden; isolation: isolate; text-align: center; padding: 4rem var(--gutter); }
.next-sector .panel-scrim { background: radial-gradient(70% 70% at 50% 50%, rgba(15, 17, 33, .55), rgba(15, 17, 33, .9)); }
.next-link { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; color: var(--text); text-decoration: none; padding: 1rem; }
.next-title { display: inline-flex; align-items: center; gap: .3em; font-family: var(--f-display); font-weight: 800; font-size: clamp(2.4rem, 8vw, 5.5rem); letter-spacing: .06em; text-transform: uppercase; text-shadow: 0 2px 10px rgba(15, 17, 33, .9); transition: color .3s; }
.next-title .glyph { width: .7em; height: .7em; transition: transform .4s var(--ease); }
.next-link:hover { color: var(--text); }
.next-link:hover .next-title { color: var(--amber-hi); }
.next-link:hover .next-title .glyph { transform: translateX(.2em); }
.prev-link { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: .4rem; color: var(--text-dim); text-decoration: none; min-height: 44px; }
.prev-link .glyph { width: 1em; height: 1em; }

/* ------------------------------------------------------------ gradiente A·B·C */
.grad { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 1.2rem; list-style: none; margin: 1.5rem 0 2rem; padding: 0; }
.grad-col { display: grid; gap: .5rem; padding: 1.3rem; background: rgba(23, 26, 33, .65); border: 1px solid var(--line); }
.grad-letter { font-family: var(--f-display); font-weight: 800; font-size: 3rem; line-height: 1; color: var(--amber); }
.grad-name { font-family: var(--f-display); font-weight: 700; font-size: 1.15rem; letter-spacing: .06em; text-transform: uppercase; }
.grad-bar { position: relative; display: block; height: 10px; background: linear-gradient(90deg, var(--ice-lo), var(--ice)); }
.grad-med { position: absolute; inset: 0 auto 0 0; width: var(--med); background: linear-gradient(90deg, var(--wood-hi), var(--amber)); box-shadow: 2px 0 0 var(--sky-lo); }
.grad-ratio { font-size: 1.1rem; margin: 0; color: var(--text-dim); text-shadow: none; }
.grad-text { color: var(--text-dim); }

/* ------------------------------------------------------------ ¿qué es? */
.band--def { padding-top: 2.5rem; }
.definition { font-size: clamp(1.3rem, 2.5vw, 1.8rem); line-height: 1.45; }
.definition dfn { font-family: var(--f-display); font-style: normal; font-weight: 800; color: var(--amber-hi); letter-spacing: .04em; }
.definition strong { color: var(--amber-hi); font-weight: 700; }
.definition em { color: var(--ice-hi); }
.etym { font-family: var(--f-body); font-style: italic; color: var(--text-dim); text-shadow: none; text-transform: none; letter-spacing: 0; font-size: 1.2rem; line-height: 1.5; }
.traits, .nots, .layers { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 1.2rem; list-style: none; margin: 0; padding: 0; }
.trait, .not { padding: 1.3rem; border-left: 2px solid var(--amber); background: linear-gradient(90deg, rgba(43, 48, 58, .55), transparent); }
.trait h3, .not h3 { font-size: 1.1rem; text-transform: uppercase; letter-spacing: .05em; }
.trait p, .not p { color: var(--text-dim); margin: 0; }
.trait-n { font-size: 1.1rem; }
.nots { grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.not { border-left-color: var(--amber-lo); }
.not-x { display: block; font-size: 1.6rem; line-height: 1; color: var(--amber); margin-bottom: .5rem; }
.rules { margin-top: 1.5rem; color: var(--text-dim); font-style: italic; max-width: 70ch; }
.pal-head, .pal-row { display: grid; grid-template-columns: minmax(9rem, 1.2fr) repeat(3, minmax(0, 1fr)); gap: .6rem; align-items: center; }
.pal-head { margin-bottom: .4rem; font-size: 1.05rem; color: var(--text-dim); text-shadow: none; }
.palette { display: grid; gap: .6rem; list-style: none; margin: 0; padding: 0; }
.pal-name { font-family: var(--f-display); font-weight: 700; font-size: .95rem; letter-spacing: .04em; }
.sw { display: flex; flex-direction: column; gap: .3rem; padding: 0; border: 0; background: none; cursor: pointer; text-align: left; min-width: 0; }
.sw-chip { display: block; height: 56px; background: var(--c); border: 1px solid rgba(255, 255, 255, .14); transition: transform .2s var(--ease), box-shadow .2s; }
.sw:hover .sw-chip { transform: translateY(-2px); box-shadow: 0 8px 20px -8px var(--c); }
.sw-hex { margin: 0; font-size: 1.1rem; color: var(--text); text-shadow: none; }
.sw.is-copied .sw-hex::after { content: ' ✓'; color: var(--amber); }
@media (max-width: 560px) {
  .pal-head { display: none; }
  .pal-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pal-name { grid-column: 1 / -1; }
}
.styles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 1.4rem; list-style: none; margin: 0; padding: 0; }
.style-card h3 { font-size: 1.3rem; text-transform: uppercase; margin-top: .4rem; }
.style-card p { color: var(--text-dim); }
.style-card .card-art { margin: 0 0 .8rem; }
.faq { display: grid; gap: .6rem; margin-bottom: 1rem; }
.faq-item { border: 1px solid var(--line); background: rgba(23, 26, 33, .55); }
.faq-item summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.2rem; cursor: pointer; list-style: none; min-height: 48px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-family: var(--f-hud); font-size: 1.6rem; color: var(--amber); line-height: 1; }
.faq-item[open] summary::after { content: '−'; }
.faq-item h3 { font-size: 1.05rem; margin: 0; letter-spacing: .03em; }
.faq-item p { padding: 0 1.2rem 1.1rem; margin: 0; color: var(--text-dim); }

/* ------------------------------------------------------------ galería: filtros */
.filters { display: grid; gap: .8rem; margin-top: 1.5rem; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { min-height: 44px; padding: .4rem 1rem; border: 1px solid rgba(122, 128, 138, .5); background: rgba(23, 26, 33, .6); color: var(--text); cursor: pointer; font-family: var(--f-display); font-weight: 600; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; transition: border-color .2s, background .2s, color .2s; }
.chip:hover { border-color: var(--amber); color: var(--amber-hi); }
.chip[aria-pressed="true"] { background: linear-gradient(180deg, var(--amber-hi), var(--amber)); border-color: var(--amber-hi); color: #1d1206; }
.band--gallery { padding-top: 1.5rem; }

/* ------------------------------------------------------------ música */
.console { margin-bottom: 3rem; padding: 1.1rem; background: linear-gradient(170deg, var(--steel), var(--steel-lo)); border: 1px solid var(--steel-hi); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 20px 50px -20px rgba(0, 0, 0, .8); clip-path: var(--chamfer); }
.console-screen { position: relative; padding: 1rem; margin-bottom: 1rem; background: radial-gradient(120% 140% at 50% 40%, #10313b 0, #07161c 70%); border: 2px solid #0b0d12; box-shadow: inset 0 0 40px rgba(0, 0, 0, .7); overflow: hidden; }
.console-screen::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .22) 0 1px, transparent 1px 3px); }
.scope { width: 100%; height: 90px; }
.console-now { display: flex; align-items: center; gap: .5rem; margin: .5rem 0 0; }
.console-dot { width: 8px; height: 8px; background: var(--stone); }
.is-audio-on .console-dot { background: var(--amber); box-shadow: 0 0 10px var(--amber); animation: wave 1.2s infinite; }
.console-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.console-btn .g-pause { display: none; }
.console-btn[aria-pressed="true"] .g-pause { display: block; }
.console-btn[aria-pressed="true"] .g-play { display: none; }
.vol { display: inline-flex; align-items: center; gap: .7rem; }
.vol .hud { margin: 0; font-size: 1.1rem; }
.vol input { width: 140px; accent-color: var(--amber); min-height: 44px; }
.console-sub { margin: 1rem 0 0; font-size: 1.05rem; color: var(--text-dim); text-shadow: none; }
.tracks { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.track-btn { display: flex; align-items: center; gap: .9rem; width: 100%; min-height: 52px; padding: .6rem 1rem; text-align: left; border: 1px solid var(--line); background: rgba(23, 26, 33, .6); cursor: pointer; }
.track-btn:hover, .track-btn[aria-pressed="true"] { border-color: var(--amber); }
.track-btn .g-pause { display: none; }
.track-btn[aria-pressed="true"] .g-pause { display: block; color: var(--amber); }
.track-btn[aria-pressed="true"] .g-play { display: none; }
.track-n { margin: 0; }
.track-title { flex: 1; font-family: var(--f-display); font-weight: 600; }
.track-dur { margin: 0; color: var(--text-dim); text-shadow: none; }
.track--empty p { color: var(--text-dim); padding: 1rem 1.2rem; border: 1px dashed var(--line); margin: 0; }
.sound-grad { display: grid; grid-template-columns: repeat(3, 1fr); list-style: none; margin: 2rem 0 0; padding: 0; }
.sound-grad li { display: grid; gap: .3rem; padding: 1rem; border-top: 3px solid; border-image: linear-gradient(90deg, var(--wood-hi), var(--amber), var(--ice)) 1; color: var(--text-dim); }
.sound-grad .grad-letter { font-size: 2rem; }
@media (max-width: 560px) { .sound-grad { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ carta estelar */
.chart { position: fixed; inset: 0; z-index: 200; overflow-y: auto; overscroll-behavior: contain; color: var(--text);
  background: radial-gradient(90% 80% at 60% 10%, rgba(61, 46, 82, .97), rgba(15, 17, 33, .99) 70%), var(--sky-lo); }
.chart[hidden] { display: none; }
.chart::before { content: ''; position: fixed; inset: 0; pointer-events: none; opacity: .7;
  background-image: url('/assets/img/stars-1.webp'); }
.chart-preview { position: fixed; inset: 0; pointer-events: none; }
.chart-preview img { width: 100%; height: 120%; object-fit: cover; object-position: 50% 0; opacity: 0; filter: saturate(.85); transition: opacity .6s var(--ease); -webkit-mask-image: radial-gradient(80% 80% at 50% 50%, #000 30%, transparent 80%); mask-image: radial-gradient(80% 80% at 50% 50%, #000 30%, transparent 80%); }
.chart-preview img.is-on { opacity: .16; }
.chart-inner { position: relative; min-height: 100%; padding: 1.2rem var(--gutter) 3rem; }
.chart-head { padding-top: .4rem; }
.chart-title { font-family: var(--f-display); font-weight: 800; font-size: clamp(1.6rem, 4vw, 2.4rem); letter-spacing: .1em; text-transform: uppercase; margin: 0 0 .2rem; }
.chart-close { position: absolute; top: 1rem; right: var(--gutter); }
.chart-lines { display: none; }
.chart-nodes { list-style: none; margin: 1.5rem 0 0 23px; padding: 0; border-left: 1px dashed rgba(107, 212, 240, .45); display: grid; gap: .4rem; }
.node a { display: flex; align-items: center; gap: 1rem; min-height: 56px; padding: .3rem .4rem .3rem 0; color: var(--text); text-decoration: none; }
.node-dot { position: relative; display: grid; place-items: center; width: 46px; height: 46px; flex: none; margin-left: -23px; }
.node-dot::before { content: ''; position: absolute; inset: 6px; transform: rotate(45deg); border: 1px solid var(--ice); background: var(--sky-lo); box-shadow: 0 0 16px rgba(107, 212, 240, .3); transition: border-color .25s, box-shadow .25s, background .25s; }
.node-dot .glyph { position: relative; width: 20px; height: 20px; color: var(--ice-hi); }
.node-text { display: flex; flex-direction: column; }
.node-label { font-family: var(--f-display); font-weight: 700; font-size: 1.15rem; letter-spacing: .08em; text-transform: uppercase; }
.node-sub { white-space: nowrap; font-family: var(--f-hud); font-size: 1.05rem; letter-spacing: .05em; text-transform: uppercase; color: var(--ice); }
.node a:hover .node-dot::before, .node a:focus-visible .node-dot::before, .node a[aria-current] .node-dot::before { border-color: var(--amber); background: #2a1d10; box-shadow: 0 0 24px rgba(242, 159, 61, .55); }
.node a:hover .node-label, .node a[aria-current] .node-label { color: var(--amber-hi); }
.node a[aria-current] .node-dot .glyph { color: var(--amber-hi); }
.chart.is-open .node { animation: node-in .6s var(--ease) both; animation-delay: calc(var(--i) * 45ms); }
@keyframes node-in { from { opacity: 0; transform: translateY(10px) scale(.96); } }
@media (min-width: 900px) and (min-height: 600px) {
  .chart { overflow: hidden; }
  .chart-lines, .chart-nodes { position: absolute; inset: 15% 9% 12% 9%; width: auto; height: auto; }
  .chart-lines { display: block; overflow: visible; }
  .chart-lines line { stroke: rgba(107, 212, 240, .4); stroke-width: 1; vector-effect: non-scaling-stroke; stroke-dasharray: 3 6; }
  .chart.is-open .chart-lines line { animation: dash 30s linear infinite; }
  @keyframes dash { to { stroke-dashoffset: -300; } }
  .chart-nodes { margin: 0; padding: 0; border: 0; display: block; }
  .node { position: absolute; left: var(--x); top: var(--y); transform: translate(-23px, -50%); }
  .node a { padding-right: 1rem; }
  .node-dot { margin-left: 0; width: 46px; height: 46px; }
  .chart-close { top: 1.2rem; }
}

/* ------------------------------------------------------------ visor (lightbox) */
.lb { width: 100vw; max-width: 100vw; height: 100vh; height: 100dvh; max-height: 100dvh; margin: 0; padding: 0; border: 0; background: rgba(8, 9, 18, .97); color: var(--text); overflow: hidden; }
.lb::backdrop { background: rgba(0, 0, 0, .75); }
.lb[open] { display: grid; grid-template-rows: auto 1fr auto; }
.lb-bar { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .7rem var(--gutter); }
.lb-count { margin: 0; }
.lb-actions { display: flex; gap: .5rem; }
.lb-stage { position: relative; display: grid; place-items: center; min-height: 0; overflow: hidden; padding: 0 var(--gutter); }
.lb-stage img, .lb-stage video { max-width: 100%; max-height: calc(100vh - 12rem); max-height: calc(100dvh - 12rem); width: auto; height: auto; object-fit: contain; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .9); background: var(--steel-lo); }
.lb-cap { padding: .9rem var(--gutter) calc(1rem + env(safe-area-inset-bottom)); max-width: 1000px; margin: 0 auto; width: 100%; text-align: center; }
.lb-title { font-size: clamp(1.1rem, 2.4vw, 1.5rem); text-transform: uppercase; letter-spacing: .05em; margin: 0 0 .3rem; }
.lb-text { color: var(--text-dim); margin: 0 0 .5rem; }
.lb-cap .tile-tags { justify-content: center; }

/* ------------------------------------------------------------ pie */
.foot { display: grid; gap: 2rem; padding: 3.5rem var(--gutter) 2.5rem; max-width: 1240px; margin: 0 auto; border-top: 1px solid var(--line); }
.foot-brand { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: .3rem 1rem; }
.foot-emblem { width: 40px; height: auto; grid-row: span 2; }
.foot-word { font-family: var(--f-display); font-weight: 800; letter-spacing: .24em; text-transform: uppercase; font-size: 1.3rem; margin: 0; }
.foot-note { margin: 0; color: var(--text-dim); }
.foot-nav ul { display: flex; flex-wrap: wrap; gap: .2rem 1.4rem; list-style: none; margin: 0; padding: 0; }
.foot-nav a { display: inline-block; padding: .55rem 0; color: var(--text-dim); text-decoration: none; font-family: var(--f-display); font-weight: 600; font-size: .85rem; letter-spacing: .1em; text-transform: uppercase; }
.foot-nav a:hover, .foot-nav a[aria-current] { color: var(--amber-hi); }
.foot-meta { margin: 0; font-size: .95rem; color: var(--text-dim); }
.foot-meta a { color: var(--text); display: inline-block; padding: .4rem 0; }

/* ------------------------------------------------------------ transiciones entre páginas */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: vt-out .45s var(--ease) both; }
  ::view-transition-new(root) { animation: vt-in .65s var(--ease) both; }
  @keyframes vt-out { to { opacity: 0; transform: scale(1.04); filter: blur(6px) brightness(.6); } }
  @keyframes vt-in { from { opacity: 0; transform: scale(.98); filter: blur(4px) brightness(1.3); } }
}

/* ------------------------------------------------------------ movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .kb .bg-img { animation: none !important; transform: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .bg { will-change: auto; }
}
html.no-motion .kb .bg-img { animation: none; }

@media (forced-colors: active) {
  .btn, .tool, .chip, .tile-link { border: 1px solid ButtonText; }
  .wm-text { -webkit-text-fill-color: CanvasText; background: none; }
}

/* ------------------------------------------------------------ portada: título en el cielo superior central */
.hero--home { align-items: start; }
.hero--home .hero-content { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: calc(var(--bar-h) + clamp(1rem, 6vh, 4.5rem)); }
.hero--home .wordmark { display: flex; flex-direction: column; align-items: center; }
.hero--home .hero-sub { max-width: 46ch; }
.hero--home .ctas { justify-content: center; }
.hero--home .hero-scrim { background:
    radial-gradient(70% 48% at 50% 24%, rgba(15, 17, 33, .62) 0, rgba(15, 17, 33, .25) 55%, rgba(15, 17, 33, 0) 75%),
    linear-gradient(180deg, rgba(15, 17, 33, .55) 0, rgba(15, 17, 33, 0) 20%),
    linear-gradient(0deg, rgba(15, 17, 33, .9) 0, rgba(15, 17, 33, 0) 28%); }
.track-sub { display: block; font-family: var(--f-body); font-weight: 400; font-size: .92rem; color: var(--text-dim); letter-spacing: 0; }
.console-sub { font-size: 1rem; color: var(--text-dim); }
