/* Pixelario · portada (index.html)
   Solo maquetación de la portada. Colores, tipos, radios y componentes salen del sistema
   (styles.css · brand.css · components.css). */

.home main { display: block; }
.h-sec { padding-block: 96px 8px; scroll-margin-top: 80px; }
.h-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 28px; }
.h-head > div:first-child { display: grid; gap: 10px; max-width: 62ch; }
.h-head h2 { margin: 0; font: 800 var(--fs-h2)/1 var(--display); letter-spacing: var(--tr-display); font-variation-settings: "opsz" 96; text-wrap: balance; }
.h-head p { margin: 0; color: var(--muted); }
.h-head-end { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.mono { font-family: var(--mono); }

/* Entradas: el contenido aparece al llegar, sin bloquear si falla el JS */
.h-in { animation: h-in var(--dur-3) var(--ease) both; animation-delay: calc(var(--d, 0) * 70ms + 80ms); }
@keyframes h-in { from { opacity: 0; transform: translateY(16px); } }
.js .rv { opacity: 0; transform: translateY(22px); transition: opacity var(--dur-3) var(--ease), transform var(--dur-3) var(--ease); }
.js .rv.in { opacity: 1; transform: none; }

/* ============ HERO ============ */
.h-hero { position: relative; padding-block: 28px 0; isolation: isolate; overflow: hidden; }
.h-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 70% at 78% 30%, color-mix(in oklab, var(--pack) 16%, transparent), transparent 70%),
    linear-gradient(rgba(244, 239, 230, .035) 1px, transparent 1px) 0 0 / 80px 80px,
    linear-gradient(90deg, rgba(244, 239, 230, .035) 1px, transparent 1px) 0 0 / 80px 80px;
  -webkit-mask-image: radial-gradient(90% 80% at 60% 30%, #000 30%, transparent 80%); mask-image: radial-gradient(90% 80% at 60% 30%, #000 30%, transparent 80%);
  transition: background var(--dur-4) var(--ease); }
.h-hero-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 48px; align-items: center; min-height: min(78vh, 760px); padding-block: 24px 40px; }
.h-copy { display: grid; gap: 22px; min-width: 0; }
.h-title { margin: 0; font: 800 clamp(44px, 6.2vw, 88px)/.92 var(--display); letter-spacing: -.045em; font-variation-settings: "opsz" 96; text-wrap: balance; }
.h-title .h-in { display: inline-block; }
.h-title .hl { color: var(--fg); background: linear-gradient(var(--spark), var(--spark)) 0 92% / 100% .11em no-repeat; padding-bottom: .04em; transition: background-color var(--dur-4); }
.h-lead { margin: 0; font-size: var(--fs-lg); line-height: 1.5; color: var(--muted); max-width: 52ch; }

.h-search { display: grid; gap: 12px; padding: 12px; border-radius: var(--shape-xl); background: var(--surface); border: var(--bw) solid var(--line-2); box-shadow: var(--sh-2); }
.h-search-row { display: flex; gap: 8px; align-items: stretch; }
.h-q { flex: 1; min-width: 0; }
.h-q .input { background: var(--bg); }
.h-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; border: 0; margin: 0; padding: 0; }
.h-res .slot { min-width: 54px; height: 40px; padding: 0 10px; }
.h-res .slot b { font-size: var(--fs-xs); }
.h-ver { width: auto; min-width: 170px; flex: 1 1 170px; max-width: 240px; min-height: 40px; }
.h-ctas { display: flex; flex-wrap: wrap; gap: 10px; }

/* Probador 3D */
.h-tryon { min-width: 0; }
.tryon { display: grid; border-radius: var(--shape-xl); background: var(--surface); border: var(--bw) solid var(--line-2); box-shadow: var(--sh-3); overflow: hidden; }
.tryon-bar { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: var(--bw) solid var(--line); }
.tryon-t { margin: 0; font: 500 var(--fs-2xs)/1 var(--mono); letter-spacing: var(--tr-label); text-transform: uppercase; color: var(--fg); display: inline-flex; align-items: center; gap: 8px; }
.tryon-t::before { content: ""; width: 7px; height: 7px; border-radius: 1.5px; background: var(--spark); }
.tryon-hint { margin-left: auto; font-size: var(--fs-xs); color: var(--muted); }
.tryon-stage { position: relative; aspect-ratio: 5 / 4; max-width: 100%; overflow: hidden; background: radial-gradient(70% 70% at 50% 40%, color-mix(in oklab, var(--pack) 22%, var(--surface)), var(--surface) 75%); transition: background var(--dur-4); }
.tryon-stage canvas#heroGl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; cursor: grab; }
.tryon-poster { position: absolute; inset: 0; display: grid; place-items: center; transition: opacity var(--dur-3) var(--ease); }
.tryon-poster img, .tryon-poster canvas { width: 46%; height: auto; image-rendering: pixelated; filter: drop-shadow(0 24px 30px rgba(0, 0, 0, .5)); animation: float 5s ease-in-out infinite; }
.tryon-stage.gl .tryon-poster { opacity: 0; }
@keyframes float { 50% { transform: translateY(-8px) rotate(-3deg); } }
.tryon-floor { position: absolute; left: 25%; right: 25%; bottom: 8%; height: 18px; border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 0, 0, .55), transparent); pointer-events: none; }
.tryon-info { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 14px 14px 4px; }
.tryon-name { display: grid; gap: 2px; min-width: 0; }
.tryon-name a { font: 800 22px/1.05 var(--display); letter-spacing: -.03em; color: var(--fg); text-decoration: none; }
.tryon-name a:hover { text-decoration: underline; text-decoration-color: var(--spark); text-underline-offset: 4px; }
.tryon-by { font-size: var(--fs-xs); color: var(--muted); }
.tryon-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tryon-hotbar { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 4px; padding: 12px 14px 14px; }
.tryon-hotbar button { position: relative; aspect-ratio: 1; max-width: 100%; display: grid; place-items: center; padding: 0; border: 0; cursor: pointer; border-radius: 8px 2px 8px 8px; background: var(--bg);
  box-shadow: inset 0 2px 0 rgba(0, 0, 0, .4), 0 0 0 1px var(--line); transition: box-shadow var(--dur-1), background var(--dur-1), transform var(--dur-2) var(--ease-px); }
.tryon-hotbar button img, .tryon-hotbar button canvas { width: 62%; height: auto; image-rendering: pixelated; }
.tryon-hotbar button .k { position: absolute; left: 4px; top: 3px; font: 500 9.5px/1 var(--mono); color: var(--faint); }
.tryon-hotbar button:hover { background: var(--surface-2); transform: translateY(-2px); }
.tryon-hotbar button[aria-checked="true"] { background: color-mix(in oklab, var(--spark) 16%, var(--bg)); box-shadow: 0 0 0 2px var(--spark), 0 8px 18px -8px var(--spark); }
.tryon-hotbar button:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
.tryon-hotbar .empty-slot { box-shadow: inset 0 2px 0 rgba(0, 0, 0, .3), 0 0 0 1px var(--line); border-radius: 8px 2px 8px 8px; aspect-ratio: 1; opacity: .5; }

/* Pilares Create / Discover / Share */
.h-pillars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: var(--bw) solid var(--line); margin-top: 8px; }
.pillar { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; padding: 22px 20px 24px 0; text-decoration: none; color: var(--fg); }
.pillar + .pillar { padding-left: 24px; border-left: var(--bw) solid var(--line); }
.pillar::before { content: ""; position: absolute; left: 0; top: -1px; height: 2px; width: 0; background: var(--spark); transition: width var(--dur-3) var(--ease-px); }
.pillar + .pillar::before { left: 24px; }
.pillar:hover::before, .pillar:focus-visible::before { width: 64px; }
.pl-k { font: 800 30px/1 var(--display); letter-spacing: -.035em; font-variation-settings: "opsz" 96; }
.pl-t { grid-column: 1; color: var(--muted); font-size: var(--fs-sm); max-width: 36ch; }
.pl-go { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-size: 20px; color: var(--faint); transition: transform var(--dur-2) var(--ease), color var(--dur-2); }
.pillar:hover .pl-go { transform: translateX(4px); color: var(--spark); }

/* ============ POPULARES: podio ============ */
.podium { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px; align-items: stretch; }
.pod-1 { position: relative; display: block; border-radius: var(--shape-xl); overflow: hidden; color: var(--fg); text-decoration: none; background: var(--surface); border: var(--bw) solid var(--line); min-height: 360px; }
.pod-1 .img { position: absolute; inset: 0; }
.pod-1 .img > * { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; transition: transform 1.2s var(--ease); }
.pod-1:hover .img > * { transform: scale(1.04); }
.pod-1::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 35%, rgba(15, 14, 13, .92)); }
.pod-1 .body { position: absolute; z-index: 1; left: 24px; right: 24px; bottom: 22px; display: grid; gap: 8px; }
.pod-rank { font: 800 92px/.8 var(--display); letter-spacing: -.06em; color: var(--fg); font-variation-settings: "opsz" 96; }
.pod-rank sup { font-size: .32em; vertical-align: top; color: var(--spark); margin-left: 2px; }
.pod-1 h3 { margin: 0; font: 800 clamp(28px, 3vw, 40px)/1 var(--display); letter-spacing: -.035em; }
.pod-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: var(--fs-xs); color: var(--paper-200); }
.pod-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; align-content: start; }
.pod-list a { display: grid; grid-template-columns: 54px 112px minmax(0, 1fr); gap: 16px; align-items: center; padding: 10px; border-radius: var(--shape-lg); color: var(--fg); text-decoration: none; transition: background var(--dur-1); }
.pod-list a:hover, .pod-list a:focus-visible { background: var(--surface); }
.pod-list .n { font: 800 44px/1 var(--display); letter-spacing: -.05em; color: var(--surface-4); text-align: center; transition: color var(--dur-2); font-variation-settings: "opsz" 96; }
.pod-list a:hover .n { color: var(--spark); }
.pod-list .th { aspect-ratio: 16 / 9; border-radius: 10px 3px 10px 10px; overflow: hidden; background: var(--surface-2); }
.pod-list .th > * { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; display: block; }
.pod-list b { display: block; font-size: var(--fs-md); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pod-list .m { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: var(--fs-xs); color: var(--muted); margin-top: 2px; }

/* ============ RECIENTES: carril ============ */
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 290px); gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 14px; scrollbar-width: thin; scrollbar-color: var(--surface-4) transparent; overscroll-behavior-x: contain; }
.rail > * { scroll-snap-align: start; }
.rail .when { font: 500 var(--fs-2xs) var(--mono); color: var(--faint); }
.rail:focus-visible { outline-offset: 6px; }

/* ============ RECOMENDADOS ============ */
.liked { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.liked .card .img .likes { position: absolute; right: 10px; bottom: 10px; z-index: 2; display: inline-flex; align-items: center; gap: 5px; }
.liked .card:first-child { grid-row: span 2; }
.liked .card:first-child .img { aspect-ratio: auto; flex: 1; min-height: 260px; }

/* ============ CREADORES ============ */
.creators { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 12px; }
.creator .rk { position: absolute; top: 8px; right: 10px; font: 500 var(--fs-2xs) var(--mono); color: var(--faint); }
.creator .strip { display: flex; gap: 4px; margin-top: 8px; }
.creator .strip > * { width: 22px; height: 22px; image-rendering: pixelated; }

/* ============ COMUNIDADES ============ */
.tribes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 12px; }
.tribe { --c: var(--surface-3); position: relative; display: grid; gap: 14px; padding: 20px; min-height: 180px; align-content: space-between; border-radius: var(--shape-lg); color: var(--fg); text-decoration: none; overflow: hidden;
  background: linear-gradient(160deg, color-mix(in oklab, var(--c) 18%, var(--surface)), var(--surface) 70%); border: var(--bw) solid var(--line); transition: border-color var(--dur-2), transform var(--dur-2) var(--ease); }
.tribe:hover, .tribe:focus-visible { border-color: color-mix(in oklab, var(--c) 55%, var(--line-2)); transform: translateY(-2px); }
.tribe h3 { margin: 0; font: 800 28px/1 var(--display); letter-spacing: -.035em; }
.tribe p { margin: 4px 0 0; font-size: var(--fs-xs); color: var(--muted); }
.tribe .items { display: flex; gap: 6px; }
.tribe .items > * { width: 34px; height: 34px; padding: 5px; border-radius: 8px 2px 8px 8px; background: rgba(15, 14, 13, .55); image-rendering: pixelated; box-shadow: inset 0 2px 0 rgba(0, 0, 0, .3); }
.tribe .cnt { position: absolute; top: 18px; right: 18px; font: 500 var(--fs-2xs) var(--mono); color: var(--paper-200); }
.tribe.is-empty { background: var(--surface); border-style: dashed; }
.tribe.is-empty .cnt { color: var(--faint); }
.tribe.discord { --c: #5865f2; }

/* ============ STUDIO ============ */
.studio-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.studio-copy { display: grid; gap: 18px; }
.studio-copy h2 { margin: 0; font: 800 var(--fs-h1)/.95 var(--display); letter-spacing: var(--tr-display); font-variation-settings: "opsz" 96; }
.studio-copy > p { margin: 0; color: var(--muted); max-width: 52ch; }
.toolist { list-style: none; margin: 4px 0 6px; padding: 0; display: grid; gap: 2px; }
.toolist li { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 14px; align-items: start; padding: 12px 0; border-top: var(--bw) solid var(--line); }
.toolist li .status { justify-self: start; }
.toolist b { display: block; font-size: var(--fs-sm); }
.toolist span:not(.status) { font-size: var(--fs-xs); color: var(--muted); }
.inspector { border-radius: var(--shape-xl); background: var(--surface); border: var(--bw) solid var(--line-2); box-shadow: var(--sh-3); overflow: hidden; }
.insp-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: var(--bw) solid var(--line); }
.insp-bar h3 { margin: 0; font: 500 var(--fs-2xs)/1 var(--mono); letter-spacing: var(--tr-label); text-transform: uppercase; }
.insp-file { font-size: var(--fs-2xs); color: var(--muted); }
.insp-body { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 18px; padding: 18px; align-items: start; }
#insp { width: 100%; height: auto; aspect-ratio: 1; image-rendering: pixelated; border-radius: 12px 3px 12px 12px; cursor: crosshair;
  background-color: var(--bg); background-image: conic-gradient(rgba(244, 239, 230, .05) 25%, transparent 0 50%, rgba(244, 239, 230, .05) 0 75%, transparent 0); background-size: 20px 20px; }
.insp-side { display: grid; gap: 18px; min-width: 0; }
.insp-read { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: center; }
.insp-read b { font: 500 var(--fs-sm) var(--mono); }
.ds-k { font: 500 var(--fs-2xs) var(--mono); letter-spacing: var(--tr-label); text-transform: uppercase; color: var(--faint); }
.sw-big { grid-column: 1 / -1; height: 36px; border-radius: 8px 2px 8px 8px; border: var(--bw) solid var(--line-2); background: var(--surface-2); }
.palette { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; margin-top: 8px; }
.palette span { aspect-ratio: 1; border-radius: 4px 1px 4px 4px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25); }
#inspPick { width: 100%; }
#inspPick button { flex: 1; }

/* ============ PLUS ============ */
.h-plus .plus-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center; padding: 48px; border-radius: var(--shape-xl);
  background: var(--surface); border: var(--bw) solid color-mix(in oklab, var(--brand) 30%, var(--line)); overflow: hidden; isolation: isolate; }
.plus-copy { display: grid; gap: 18px; justify-items: start; }
.plus-copy h2 { margin: 0; font: 800 var(--fs-h2)/1.02 var(--display); letter-spacing: var(--tr-display); font-variation-settings: "opsz" 96; }
.plus-copy h2 .dim { color: var(--muted); }
.plus-copy p { margin: 0; color: var(--muted); max-width: 50ch; }
.perks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.perks li { display: grid; gap: 6px; padding: 18px; border-radius: var(--shape-lg); background: var(--bg); border: var(--bw) solid var(--line); }
.perks b { font-size: var(--fs-md); }
.perks span:not(.perk-ico) { font-size: var(--fs-xs); color: var(--muted); }
.perk-ico { width: 40px; height: 40px; display: grid; place-items: center; margin-bottom: 6px; border-radius: 10px 3px 10px 10px; background: color-mix(in oklab, var(--brand) 16%, var(--surface)); color: var(--mandarina-300); --ico-px: var(--brand); }

/* ============ CIFRAS ============ */
.numbers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: var(--bw) solid var(--line); border-bottom: var(--bw) solid var(--line); }
.numbers .num { display: grid; gap: 8px; padding: 28px 24px 30px 0; }
.numbers .num + .num { padding-left: 24px; border-left: var(--bw) solid var(--line); }
.numbers .v { font: 800 clamp(40px, 5vw, 72px)/.9 var(--display); letter-spacing: -.045em; font-variant-numeric: tabular-nums; font-variation-settings: "opsz" 96; }
.numbers .k { font: 500 var(--fs-2xs) var(--mono); letter-spacing: var(--tr-label); text-transform: uppercase; color: var(--muted); }
.numbers .s { font-size: var(--fs-xs); color: var(--faint); }
.numbers .state { grid-column: 1 / -1; border: 0; }

/* Esqueletos de la portada */
.sk-pod { display: contents; }
.sk-pod .skel-media { min-height: 360px; aspect-ratio: auto; }

/* ============ RESPONSIVE ============ */
@media (max-width: 1080px) {
  .h-hero-grid { grid-template-columns: minmax(0, 1fr); min-height: 0; gap: 32px; }
  .h-tryon { max-width: 560px; width: 100%; justify-self: center; }
  .podium, .studio-grid, .h-plus .plus-grid { grid-template-columns: minmax(0, 1fr); }
  .liked { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .liked .card:first-child { grid-row: auto; grid-column: 1 / -1; }
  .numbers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .numbers .num:nth-child(3) { padding-left: 0; border-left: 0; }
  .numbers .num:nth-child(n+3) { border-top: var(--bw) solid var(--line); }
}
@media (max-width: 760px) {
  .h-sec { padding-block: 64px 4px; }
  .h-search-row { flex-wrap: wrap; }
  .h-search-row .btn { flex: 1 1 100%; }
  .h-pillars { grid-template-columns: minmax(0, 1fr); }
  .pillar + .pillar { padding-left: 0; border-left: 0; border-top: var(--bw) solid var(--line); }
  .pillar + .pillar::before { left: 0; }
  .pod-list a { grid-template-columns: 40px 88px minmax(0, 1fr); gap: 12px; padding: 8px 4px; }
  .pod-list .n { font-size: 32px; }
  .pod-1 { min-height: 300px; }
  .pod-rank { font-size: 64px; }
  .liked { grid-template-columns: minmax(0, 1fr); }
  .insp-body { grid-template-columns: minmax(0, 1fr); }
  .h-plus .plus-grid { padding: 26px 20px; }
  .perks { grid-template-columns: minmax(0, 1fr); }
  .toolist li { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .tryon-hotbar { gap: 3px; padding: 10px; }
}
@media (max-width: 480px) {
  .numbers { grid-template-columns: minmax(0, 1fr); }
  .numbers .num, .numbers .num + .num { padding-left: 0; border-left: 0; border-top: var(--bw) solid var(--line); }
  .numbers .num:first-child { border-top: 0; }
  .tryon-hotbar button .k { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .h-in { animation: none; }
  .js .rv { opacity: 1; transform: none; transition: none; }
  .tryon-poster img, .tryon-poster canvas { animation: none; }
}
@media (max-width: 760px) {
  .tribes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tribe { min-height: 0; padding: 14px; gap: 10px; }
  .tribe h3 { font-size: 20px; }
  .tribe p { display: none; }
  .tribe .cnt { position: static; order: -1; }
  .tribe .items > * { width: 26px; height: 26px; padding: 3px; }
  .tribe .items > :nth-child(n+4) { display: none; }
}
.tryon-stage.gl .tryon-floor { display: none; }
.podium > .state, .liked > .state, .creators > .state { grid-column: 1 / -1; }
.tryon-name > a { display: inline-flex; align-items: center; min-height: 24px; }
.state-mini { margin: 0; padding: 18px 20px; border-radius: var(--shape-lg); border: 1.5px dashed var(--line-2); color: var(--muted); font-size: var(--fs-sm); }
