/* Nakuro Studio · taller japonés: laca, tinta, papel y pinceladas. Colores del logotipo. */
:root {
  --paper: #f5e6ca; --paper-hi: #fcf5e6; --ink: #14090a; --red: #8e2a2a; --red-hi: #b0342f;
  --indigo: #1d3557; --gold: #d9a02b; --muted: #5f4a43; --line: #14090a26;
  --wrap: 1180px;
  --display: "Reggae One", "Arial Black", system-ui, sans-serif;
  --body: "Zen Kaku Gothic New", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-in-out: cubic-bezier(.77, 0, .175, 1);
  --spring: cubic-bezier(.2, .9, .25, 1.3);
  /* borde de pincelada */
  --brush: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 40' preserveAspectRatio='none'%3E%3Cpath d='M0 40V19l22-6 9 7 31-12 13 8 38-3 7-9 15 11 44-4 18-8 11 10 39 2 21-13 8 9 47-1 12-7 25 12 33-6 6-10 19 12 41-2 17-9 14 8 36 3 24-12 9 10 41 7v32z'/%3E%3C/svg%3E");
  color-scheme: light;
}
@view-transition { navigation: auto; }
* { box-sizing: border-box; }
/* solo se permite desplazar: ni pellizco ni doble toque */
*, *::before, *::after { touch-action: pan-x pan-y; }
/* el rebote del móvil enseña papel arriba y tinta abajo */
html { scroll-behavior: smooth; overflow-x: clip; background: linear-gradient(var(--paper) 50%, var(--ink) 50%) fixed var(--ink); }
body { margin: 0; background: var(--paper); color: var(--ink); font: 500 17px/1.65 var(--body); overflow-x: clip; }
img, svg, canvas { max-width: 100%; }
img { height: auto; }
[hidden] { display: none !important; }
a { color: var(--red); }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.12; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 5vw, 4.1rem); }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.9rem); }
h3 { font-size: 1.25rem; }
.wrap { width: min(var(--wrap), 100% - 40px); margin-inline: auto; }
.narrow { max-width: 800px; }
.center { text-align: center; }
.muted, .kicker { color: var(--muted); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; z-index: 99; background: #fff; color: #000; padding: 8px 12px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
::selection { background: var(--red); color: var(--paper); }

/* Botones: sello estampado que se hunde al pulsar */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .8rem 1.45rem; border: 2px solid var(--ink); border-radius: 6px 14px 7px 12px; background: var(--red); color: var(--paper); font: 700 1rem/1.2 var(--body); text-decoration: none; cursor: pointer; box-shadow: 4px 4px 0 var(--ink); transition: transform 160ms var(--ease-out), box-shadow 160ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .btn:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); } }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-ghost { background: var(--paper-hi); color: var(--ink); }
.btn-paper { background: var(--paper); color: var(--ink); }
.btn-small { padding: .5rem .9rem; font-size: .86rem; box-shadow: 3px 3px 0 var(--ink); }

/* Pantalla de carga: el logo se imprime y las cortinas se abren */
.loader { display: none; }
.intro .loader { position: fixed; inset: 0; z-index: 100; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--paper); --p: 0; animation: loader-safety .5s 4.2s forwards; transition: visibility 0s .8s; }
.loader > * { position: relative; z-index: 1; }
.loader .loader-curtain { position: absolute; z-index: 0; top: 0; bottom: 0; width: 50.5%; background: #000; transition: translate .75s var(--ease-in-out); }
.loader-curtain.left { left: 0; } .loader-curtain.right { right: 0; }
.intro .loader.is-done { visibility: hidden; pointer-events: none; }
.loader.is-done .left { translate: -101% 0; } .loader.is-done .right { translate: 101% 0; }
.loader.is-done > :not(.loader-curtain) { opacity: 0; transition: opacity .2s; }
@keyframes loader-safety { to { opacity: 0; visibility: hidden; } }
.loader-print { width: min(280px, 68vw); aspect-ratio: 1; }
.loader-print img { display: block; width: 100%; clip-path: inset(calc((1 - var(--p)) * 100%) 0 0 0); }
.loader-head { position: absolute; left: -8%; right: -8%; top: calc((1 - var(--p)) * 100%); height: 2px; background: var(--gold); box-shadow: 0 0 16px 3px #ffb347; }
.loader-head::after { content: ""; position: absolute; bottom: 0; left: 40%; width: 20px; height: 22px; background: var(--paper); clip-path: polygon(0 0, 100% 0, 100% 60%, 50% 100%, 0 60%); animation: nozzle .5s ease-in-out infinite alternate; }
@keyframes nozzle { from { left: 8%; } to { left: 88%; } }
.loader-bar { width: min(240px, 60vw); height: 6px; border-radius: 9px; background: #ffffff1f; overflow: hidden; }
.loader-bar i { display: block; height: 100%; background: var(--red-hi); transform-origin: left; transform: scaleX(var(--p)); }
.loader p { margin: 0; font-variant-numeric: tabular-nums; }
.loader button { background: none; border: 0; color: var(--paper); text-decoration: underline; cursor: pointer; font: inherit; }

/* Cabecera */
.header { position: sticky; top: 0; z-index: 30; background: var(--paper); border-bottom: 3px solid var(--ink); }
.scroll-line { position: absolute; left: 0; right: 0; bottom: -3px; height: 3px; background: var(--red-hi); transform-origin: left; transform: scaleX(var(--scroll, 0)); }
.header-row { display: flex; align-items: center; gap: 18px; min-height: 84px; width: min(1320px, 100% - 32px); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 400 1.4rem/1 var(--display); }
.brand img { width: 58px; height: 58px; border-radius: 50%; object-fit: cover; object-position: 42% 42%; background: #000; transition: rotate .5s var(--spring); }
.header.is-small .header-row { min-height: 66px; }
.header.is-small .brand img { width: 48px; height: 48px; }
.brand:hover img { rotate: -10deg; }
.brand small { display: block; font: 700 .72rem var(--body); letter-spacing: .42em; color: var(--red); margin-top: 4px; }
.nav { position: relative; display: flex; margin-inline: auto; isolation: isolate; }
.nav a { padding: .55rem .95rem; color: var(--ink); font-weight: 700; font-size: .95rem; text-decoration: none; white-space: nowrap; transition: color .2s, transform .3s var(--spring); }
.nav a:hover { transform: translateY(-2px) scale(1.08); }
.nav a.is-pill { color: var(--paper); }
.nav-pill { position: absolute; z-index: -1; left: 0; top: 0; bottom: 0; border-radius: 6px 16px 8px 14px; background: var(--ink); opacity: 0; pointer-events: none; transition: transform .45s var(--spring), width .45s var(--spring), opacity .2s; }
.header-actions { display: flex; align-items: center; gap: 14px; white-space: nowrap; }
.cart-link { color: var(--ink); font-weight: 700; text-decoration: none; }
.cart-link span, .dock em { display: inline-block; min-width: 19px; border-radius: 99px; background: var(--red-hi); color: #fff; text-align: center; font: 700 .72rem/19px var(--body); font-style: normal; }
.bump { animation: bump .5s var(--spring); }
@keyframes bump { 40% { scale: 1.6; } }

/* Dock */
.dock { display: none; }
@media (max-width: 1120px) {
  .nav, .cart-link { display: none; }
  .header-actions { margin-left: auto; }
  /* barra de abajo: espejo de la cabecera (papel y línea de tinta), pegada al borde */
  .dock { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); padding: 8px max(6px, env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(6px, env(safe-area-inset-left, 0px)); background: var(--paper); border-top: 3px solid var(--ink); }
  .dock a { position: relative; display: grid; justify-items: center; gap: 3px; min-width: 0; color: var(--ink); text-decoration: none; font-size: .72rem; font-weight: 700; line-height: 1.2; -webkit-tap-highlight-color: transparent; }
  .dock svg { width: 54px; height: 32px; padding: 5px 16px; border-radius: 16px; transition: background .2s, color .2s, transform 160ms var(--ease-out); }
  .dock a:active svg { transform: scale(.9); }
  .dock a[aria-current] { color: var(--red); }
  .dock a[aria-current] svg { background: var(--red); color: var(--paper); }
  .dock em { position: absolute; top: -2px; left: calc(50% + 8px); }
}
@media (max-width: 460px) { .brand span { font-size: 1.1rem; } .header-actions .btn { white-space: normal; text-align: center; max-width: 165px; } }

/* Carteles (carrusel) */
.slider { position: relative; display: grid; overflow: hidden; }
.slide { grid-area: 1 / 1; display: grid; grid-template-columns: 1fr 1fr; align-items: center; min-height: clamp(540px, 52vw, 680px); padding-bottom: 92px; color: var(--paper); visibility: hidden; clip-path: polygon(0 0, 0 0, 0 25%, 0 50%, 0 75%, 0 100%, 0 100%); transition: clip-path .8s var(--ease-in-out), visibility .8s; }
.slide.is-active { visibility: visible; z-index: 1; clip-path: polygon(0 0, 130% 0, 112% 25%, 126% 50%, 108% 75%, 120% 100%, 0 100%); }
.tone-laca { background: var(--red); }
.tone-tinta { background: var(--ink); }
.tone-indigo { background: var(--indigo); }
.tone-oro { background: var(--gold); color: var(--ink); }
.slide-text { min-width: 0; padding: 48px clamp(24px, 6vw, 96px); }
.slide-text h1, .slide-text h2 { font-size: clamp(2.2rem, 3.9vw, 3.6rem); }
.slide-text p { font-size: 1.2rem; max-width: 32ch; margin: 0 0 1.6rem; }
.slide.is-active .slide-text > * { animation: rise .7s var(--ease-out) backwards; }
.slide.is-active h1, .slide.is-active h2 { animation-delay: .18s; }
.slide.is-active p { animation-delay: .27s; }
.slide.is-active .btn { animation-delay: .33s; }
.intro .slide.is-active .slide-text > * { animation-delay: 2.1s; }
@keyframes rise { from { opacity: 0; translate: 0 28px; } }
.slide-media { display: grid; place-items: center; min-width: 0; padding: 28px; }
.sun { position: relative; width: min(100%, 480px); aspect-ratio: 1; border-radius: 50%; background: #000; box-shadow: 0 0 0 10px var(--paper), 0 0 0 13px var(--ink); }
.slide.is-active .sun { animation: sun-in .9s .1s var(--ease-out) backwards; }
@keyframes sun-in { from { opacity: 0; scale: .92; rotate: -14deg; } }
.sun-emblem { display: block; width: 100%; border-radius: 50%; }
.sun canvas { position: absolute; inset: 6%; width: 88%; height: 88%; touch-action: pan-y; cursor: grab; }
.slider-arrow { position: absolute; z-index: 3; top: calc(50% - 60px); width: 46px; height: 46px; border: 2px solid var(--ink); border-radius: 50%; background: var(--paper); color: var(--ink); font-size: 1.7rem; line-height: 1; cursor: pointer; transition: scale .2s var(--ease-out); }
.slider-arrow:hover { scale: 1.12; }
.slider-arrow:active { scale: .95; }
.prev { left: 12px; } .next { right: 12px; }
.slider-bar { position: absolute; z-index: 3; left: 50%; bottom: 40px; translate: -50% 0; display: flex; align-items: stretch; gap: 10px; width: min(var(--wrap), 100% - 28px); }
.slider-tabs { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.slider-tabs button, .slider-pause { min-width: 0; border: 2px solid var(--ink); border-radius: 8px 14px 9px 13px; background: var(--paper); color: var(--ink); font: 700 .85rem var(--body); cursor: pointer; }
.slider-tabs button { padding: 8px 12px 10px; text-align: left; transition: translate .25s var(--ease-out); }
.slider-tabs button:hover, .slider-tabs .is-active { translate: 0 -5px; }
.slider-tabs span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slider-tabs i { display: block; height: 5px; margin-top: 6px; border-radius: 4px; background: var(--line); overflow: hidden; }
.slider-tabs i::after { content: ""; display: block; height: 100%; background: var(--red-hi); transform-origin: left; transform: scaleX(0); }
.slider-tabs .is-active i::after { transform: scaleX(var(--fill, 0)); }
.slider-pause { padding: 0 14px; }
@media (max-width: 800px) {
  .slide { grid-template-columns: 1fr; align-content: start; min-height: 690px; }
  .slide-media { order: -1; padding: 30px 20px 0; }
  .sun { width: min(78%, 310px); }
  .slide-text { padding: 30px 20px 0; }
  .slider-arrow { top: 160px; width: 38px; height: 38px; }
  .prev { left: 4px; } .next { right: 4px; }
  .slider-tabs { gap: 5px; } .slider-tabs button { padding: 8px 6px; } .slider-tabs span { height: 0; visibility: hidden; } .slider-tabs i { margin: 0; }
}

/* Bordes de pincelada entre secciones */
.brush-top, .brush-bottom, .noren-section, .workshop, .page-head, .footer { position: relative; }
.brush-top::before, .workshop::before, .footer::before, .brush-bottom::after, .page-head::after {
  content: ""; position: absolute; left: 0; right: 0; height: 34px; background: var(--edge);
  -webkit-mask: var(--brush) 0 0 / 600px 100%; mask: var(--brush) 0 0 / 600px 100%; pointer-events: none; }
.brush-top::before, .workshop::before, .footer::before { bottom: calc(100% - 1px); }
.brush-bottom::after, .page-head::after { top: calc(100% - 1px); scale: 1 -1; z-index: 2; }

/* Cortinas noren */
.noren-section { padding: clamp(56px, 8vw, 100px) 0 clamp(70px, 9vw, 120px); }
.noren-section .title { text-align: center; margin-bottom: 36px; }
.noren { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding-top: 20px; }
.noren::before { content: ""; position: absolute; z-index: 2; left: -18px; right: -18px; top: 8px; height: 16px; border-radius: 9px; background: linear-gradient(#7a4a22, #3b2110); box-shadow: 0 6px 10px -4px #0006; }
.curtain { display: block; min-width: 0; text-decoration: none; color: var(--paper); perspective: 900px; }
.curtain-cloth { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 400px; padding: 40px 14px 60px; text-align: center; background: repeating-linear-gradient(90deg, #ffffff0d 0 2px, transparent 2px 22px), var(--red); transform-origin: top center; transition: transform .6s var(--spring), filter .25s; clip-path: polygon(0 0, 100% 0, 100% 96%, 75% 100%, 50% 96%, 25% 100%, 0 96%); }
.curtain:nth-child(even) .curtain-cloth { background-color: var(--indigo); }
.curtain svg { width: 84px; height: 84px; padding: 10px; border-radius: 50%; border: 3px solid currentColor; }
.curtain b { font: 400 clamp(1.4rem, 2.4vw, 2.1rem)/1.15 var(--display); }
.curtain small { font-size: .95rem; font-weight: 500; max-width: 18ch; }
.curtain:hover .curtain-cloth, .curtain:focus-visible .curtain-cloth { transform: rotateX(13deg) skewX(-3deg) translateY(4px); filter: brightness(1.15); }
.curtain:active .curtain-cloth { transform: rotateX(24deg) skewX(-5deg); }
.curtain:nth-child(even):hover .curtain-cloth { transform: rotateX(13deg) skewX(3deg) translateY(4px); }
@media (max-width: 760px) {
  .noren { grid-template-columns: 1fr 1fr; row-gap: 14px; }
  .noren::before { left: -8px; right: -8px; }
  .curtain-cloth { min-height: 260px; padding: 28px 10px 40px; }
  .curtain svg { width: 66px; height: 66px; }
}

/* El proceso, gobernado por el scroll */
.story { --edge: var(--paper-hi); background: var(--paper-hi); }
.story-grid { display: grid; grid-template-columns: 1fr 1fr 10px; gap: clamp(20px, 4vw, 56px); align-items: center; padding-block: 70px; }
.story-grid > * { min-width: 0; }
.story-steps { list-style: none; margin: 0; padding: 0; }
.story-steps li { display: grid; grid-template-columns: 48px 1fr; column-gap: 16px; padding: 12px 0; }
.story-steps li::before { content: attr(data-n); grid-row: span 2; align-self: start; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--ink); font: 400 1.15rem var(--display); transition: background .25s, color .25s, rotate .4s var(--spring); }
.story-steps b { font: 400 1.35rem/1.3 var(--display); }
.story-steps p { margin: 4px 0 0; color: var(--muted); }
.story-art canvas { display: block; width: 100%; height: min(68vh, 560px); }
.story-art { background: radial-gradient(closest-side, var(--paper) 0 78%, transparent 79%); }
.story-rail { height: min(60vh, 480px); border-radius: 9px; background: var(--line); overflow: hidden; }
.story-rail i { display: block; height: 100%; background: var(--red-hi); transform-origin: top; transform: scaleY(0); }
/* solo cuando el script puede mover la escena */
.story.is-live { height: 420vh; }
.story.is-live .story-stick { position: sticky; top: 66px; height: calc(100svh - 66px); display: grid; align-items: center; overflow: hidden; }
.story.is-live .story-grid { padding-block: 0; }
.story.is-live .story-steps li { opacity: .32; transition: opacity .25s; }
.story.is-live .story-steps li.is-on { opacity: 1; }
.story.is-live .story-steps li.is-on::before { background: var(--red); color: var(--paper); rotate: -10deg; }
@media (max-width: 800px) {
  .story-grid { grid-template-columns: 1fr; gap: 8px; }
  .story-rail { display: none; }
  .story-art { order: -1; }
  .story.is-live .story-stick { height: calc(100svh - 66px - 68px); }
  .story.is-live .story-art canvas { height: 44svh; }
  .story.is-live .title { font-size: 1.5rem; margin: 0 0 8px; }
  .story.is-live .story-steps li { display: none; padding: 0; }
  .story.is-live .story-steps li.is-on { display: grid; }
}

/* Mesa de color */
.lab { --edge: var(--ink); background: var(--ink); color: var(--paper); padding: clamp(50px, 7vw, 96px) 0; margin-block: 34px; }
.lab .muted, .lab .lead { color: #d8c6a8; }
.lab-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 72px); align-items: center; }
.lab-grid > * { min-width: 0; }
.title { margin-bottom: 1rem; }
.lead { color: var(--muted); max-width: 54ch; margin: 0 0 1.5rem; font-size: 1.15rem; }
.chips, .filters, .tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.chips button, .filters button, .tabs button { padding: .5rem 1.1rem; border: 2px solid currentColor; border-radius: 8px 15px 9px 14px; background: transparent; color: inherit; font: 700 .92rem var(--body); cursor: pointer; transition: transform 160ms var(--ease-out); }
.chips button:hover, .filters button:hover, .tabs button:hover { transform: translateY(-3px) rotate(-2deg); }
.chips button:active, .filters button:active, .tabs button:active { transform: scale(.96); }
.chips button[aria-pressed="true"] { background: var(--paper); border-color: var(--paper); color: var(--ink); }
.filters button[aria-pressed="true"], .tabs button[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.paints { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 30px; }
.paints button { width: 50px; height: 50px; border: 4px solid var(--paper); border-radius: 50% 46% 52% 48%; background: var(--paint); cursor: pointer; transition: transform .3s var(--spring); }
.paints button:hover { transform: scale(1.2) rotate(12deg); }
.paints button[aria-pressed="true"] { transform: scale(1.12); box-shadow: 0 0 0 3px var(--gold); }
.stage { margin: 0; border: 3px solid var(--paper); border-radius: 18px 34px 20px 30px; background: radial-gradient(80% 65% at 50% 42%, #45201f, #14090a); overflow: hidden; }
.stage canvas { display: block; width: 100%; height: clamp(360px, 44vw, 480px); cursor: grab; touch-action: pan-y; }
.stage figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; padding: 14px 22px 20px; font-variant-numeric: tabular-nums; }
.stage i { width: 100%; height: 8px; border-radius: 9px; background: #ffffff1f; overflow: hidden; }
.stage em { display: block; width: 0; height: 100%; background: var(--gold); }
@media (max-width: 860px) { .lab-grid { grid-template-columns: 1fr; } }

/* Talleres */
.workshop { --edge: var(--red); background: var(--red); color: var(--paper); padding: 40px 0 64px; margin-top: 74px; }
.workshop .lead { color: var(--paper); }
.workshop .btn { background: var(--paper); color: var(--ink); }
.workshop-grid { display: grid; grid-template-columns: auto 1fr; gap: clamp(30px, 6vw, 80px); align-items: center; }
.workshop-art { position: relative; width: min(230px, 56vw); }
.workshop-emblem { display: block; width: 100%; border-radius: 50%; border: 6px solid var(--paper); background: #000; }
.hanko { position: absolute; right: -22px; bottom: -6px; padding: 8px 12px; rotate: -9deg; border: 3px double var(--red); border-radius: 8px; background: var(--paper); color: var(--red); font: 400 1.1rem var(--display); }
.workshop.is-in .hanko { animation: stamp .45s .25s var(--spring) backwards; }
@keyframes stamp { from { opacity: 0; scale: 2.2; } }
@media (max-width: 720px) { .workshop-grid { grid-template-columns: 1fr; } .workshop-art { width: 170px; justify-self: center; } }

/* Cabeceras interiores */
.page-head { --edge: var(--red); background: var(--red); color: var(--paper); margin-bottom: 20px; }
.page-head .lead { color: var(--paper); margin: 0; }
.page-head-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: 28px; align-items: center; padding-block: 30px 14px; }
.page-head-grid > * { min-width: 0; }
.page-head-grid > div:first-child { animation: rise .6s var(--ease-out) backwards; }
.disc { justify-self: center; width: min(250px, 100%); aspect-ratio: 1; border-radius: 50%; background: #000; box-shadow: 0 0 0 7px var(--paper), 0 0 0 10px var(--ink); animation: sun-in .8s var(--ease-out) backwards; }
.disc canvas { width: 100%; height: 100%; touch-action: pan-y; cursor: grab; }
@media (max-width: 720px) { .page-head-grid { grid-template-columns: 1fr; } .disc { order: -1; width: 180px; } }

.block { padding: clamp(50px, 7vw, 90px) 0; }
.block-alt { background: var(--paper-hi); }
.tiles { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.tile { padding: 26px; background: var(--paper-hi); border: 2px solid var(--ink); border-radius: 12px 26px 14px 22px; box-shadow: 6px 6px 0 var(--red); }
.tile h2 { font-size: 1.35rem; }
.tile p { margin: 0; color: var(--muted); }
.will-reveal { opacity: 0; translate: 0 30px; }
.will-reveal.is-in { opacity: 1; translate: 0 0; transition: opacity .5s var(--delay) ease, translate .6s var(--delay) var(--ease-out); }
[data-tilt], .product { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .25s ease-out, box-shadow .25s; }

/* Catálogo */
.grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.product { display: flex; flex-direction: column; overflow: hidden; background: var(--paper-hi); border: 2px solid var(--ink); border-radius: 14px 28px 16px 24px; color: var(--ink); text-decoration: none; box-shadow: 5px 5px 0 var(--ink); }
.product:hover { box-shadow: 10px 10px 0 var(--red); }
.grid .product { animation: print-in .8s calc(var(--i, 0) * 60ms) steps(16) backwards; }
@keyframes print-in { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }
.thumb { display: grid; place-items: center; aspect-ratio: 1; overflow: hidden; background: #000; }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: scale .5s var(--ease-out); }
.product:hover .thumb img { scale: 1.07; }
.thumb.is-empty img { width: 60%; height: 60%; object-fit: contain; opacity: .4; }
.product-info { padding: 16px 18px 20px; }
.product-info h3 { margin-bottom: .35rem; }
.price { color: var(--red); font-weight: 700; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.dots { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.dot { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--ink); border-radius: 50%; transition: transform .25s var(--spring); }
.dot:hover { transform: scale(1.3); }
.skeleton { aspect-ratio: .78; border-radius: 14px 28px 16px 24px; background: linear-gradient(110deg, #e8d6b4 35%, var(--paper-hi) 50%, #e8d6b4 65%) 0 0 / 250% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -250% 0; } }
.spinner { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 40px 0; color: var(--muted); }
.spinner::before { content: ""; width: 54px; height: 54px; border: 7px solid var(--line); border-top-color: var(--red); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { rotate: 360deg; } }
.empty { grid-column: 1 / -1; padding: 54px 20px; text-align: center; border: 3px dashed var(--ink); border-radius: 20px 40px 22px 36px; background: var(--paper-hi); }
.empty::before { content: ""; display: block; width: 66px; height: 66px; margin: 0 auto 18px; border-radius: 50% 50% 12px 12px; background: repeating-linear-gradient(0deg, var(--red) 0 5px, transparent 5px 8px); animation: print-loop 2.6s steps(14) infinite; }
@keyframes print-loop { 0% { clip-path: inset(100% 0 0 0); } 70%, 100% { clip-path: inset(0 0 0 0); } }
.detail { display: grid; gap: 40px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
.detail .thumb { border: 3px solid var(--ink); border-radius: 18px 34px 20px 30px; animation: print-in .9s steps(20) backwards; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatches label { display: block; margin: 0; cursor: pointer; }
.swatches input { position: absolute; width: 1px; opacity: 0; }
.swatches .dot { width: 36px; height: 36px; }
.swatches input:checked + .dot { box-shadow: 0 0 0 3px var(--paper), 0 0 0 6px var(--red); }
.swatches input:focus-visible + .dot { outline: 3px solid var(--gold); outline-offset: 7px; }

/* Formularios */
.card { margin-bottom: 24px; padding: clamp(20px, 3vw, 36px); background: var(--paper-hi); border: 2px solid var(--ink); border-radius: 12px 28px 14px 24px; box-shadow: 7px 7px 0 var(--ink); }
fieldset { min-width: 0; margin: 0 0 16px; padding: 0; border: 0; }
legend { margin-bottom: 14px; padding: 0; font: 400 1.25rem var(--display); }
label { display: block; margin-bottom: 16px; font-size: .93rem; font-weight: 700; }
input, select, textarea { display: block; width: 100%; margin-top: 6px; padding: .75rem .9rem; background: #fff; color: var(--ink); border: 2px solid #14090a59; border-radius: 8px; font: 500 1rem var(--body); transition: border-color .2s, box-shadow .2s; }
input:focus, select:focus, textarea:focus { border-color: var(--red); box-shadow: 0 0 0 4px #8e2a2a30; outline: none; }
textarea { resize: vertical; }
input[type=checkbox], input[type=radio] { display: inline-block; width: auto; margin: 0 .5rem 0 0; accent-color: var(--red); }
input[type=color] { width: 70px; height: 46px; padding: 3px; }
.check { font-weight: 500; }
.row { display: grid; gap: 0 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hp { position: absolute; left: -9999px; }
.msg { min-height: 1.4em; margin: 0 0 10px; font-weight: 700; }
.msg.error { color: #a3160f; animation: shake .35s; } .msg.ok { color: #1e6b3a; animation: rise .4s var(--ease-out); }
@keyframes shake { 25% { translate: -6px 0; } 75% { translate: 6px 0; } }
.meter { position: sticky; top: 76px; z-index: 5; --done: 0; margin-bottom: 18px; padding: 12px 18px; border-radius: 12px; background: var(--ink); color: var(--paper); font-size: .92rem; }
.meter i { display: block; height: 8px; margin-top: 8px; border-radius: 9px; background: #ffffff26; overflow: hidden; }
.meter i::after { content: ""; display: block; height: 100%; background: var(--gold); transform-origin: left; transform: scaleX(var(--done)); transition: transform .4s var(--ease-out); }
[data-request-done] { animation: rise .5s var(--ease-out); }
[data-request-done] h2::before { content: "Recibido"; display: table; margin-bottom: 16px; padding: 6px 14px; rotate: -7deg; border: 3px double var(--red); border-radius: 8px; color: var(--red); font-size: 1.2rem; animation: stamp .45s .2s var(--spring) backwards; }

/* Carga dentro del botón: el engranaje del logotipo girando */
.is-loading, .is-loading:disabled { position: relative; opacity: 1 !important; color: transparent !important; cursor: progress !important; }
.is-loading > * { visibility: hidden; }
.is-loading::after { content: ""; position: absolute; top: 50%; left: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; background: var(--spin, var(--paper)); animation: spin 1s linear infinite;
  -webkit-mask: var(--gear) center / contain no-repeat; mask: var(--gear) center / contain no-repeat; }
:root { --gear: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10.3 1h3.4l.5 3 1.9.8 2.5-1.8 2.4 2.4-1.8 2.5.8 1.9 3 .5v3.4l-3 .5-.8 1.9 1.8 2.5-2.4 2.4-2.5-1.8-1.9.8-.5 3h-3.4l-.5-3-1.9-.8-2.5 1.8L3 18.6l1.8-2.5-.8-1.9-3-.5v-3.4l3-.5.8-1.9L3 5.4 5.4 3l2.5 1.8L9.8 4zM12 8.5a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7z' fill-rule='evenodd'/%3E%3C/svg%3E"); }
input:disabled, select:disabled, textarea:disabled { background: #ece0c6; color: var(--muted); cursor: not-allowed; }

/* Secciones */
.card > h2 { font-size: 1.5rem; }
.line { padding: 12px 0; border-top: 2px dashed var(--line); }
.line:first-of-type { border-top: 0; padding-top: 0; }
.tabs.sections { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tabs.sections button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: .65rem .3rem; }
@media (max-width: 420px) { .tabs.sections button { font-size: .8rem; } }
.sections em { min-width: 20px; border-radius: 99px; background: var(--red); color: var(--paper); font: 700 .72rem/20px var(--body); font-style: normal; }
.account-section { animation: rise .3s var(--ease-out); }
[data-editor] fieldset { margin-top: 22px; padding-top: 18px; border-top: 2px dashed var(--ink); }

.card.danger { border-color: var(--red-hi); box-shadow: 7px 7px 0 var(--red-hi); }
.card.danger h3 { color: var(--red); }

/* Acceso y registro */
.auth { max-width: 460px; margin-inline: auto; }
.auth-tabs { position: relative; display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 24px; border: 2px solid var(--ink); border-radius: 8px 16px 9px 14px; overflow: hidden; }
.auth-tabs button { position: relative; z-index: 1; padding: .7rem .4rem; border: 0; background: none; color: var(--ink); font: 700 .98rem var(--body); cursor: pointer; transition: color .25s; }
.auth-tabs button[aria-selected="true"] { color: var(--paper); }
.auth-tabs button:focus-visible { outline-offset: -5px; }
.auth-mark { position: absolute; top: 0; bottom: 0; left: 0; width: 50%; background: var(--red); transition: transform .3s var(--ease-out); }
.auth.is-register .auth-mark { transform: translateX(100%); }
.auth-panel { animation: rise .3s var(--ease-out); }
.auth-panel .btn { width: 100%; }
.auth-switch { margin: 20px 0 0; text-align: center; color: var(--muted); }
.auth-switch button { padding: 0; border: 0; background: none; color: var(--red); font: 700 1em var(--body); text-decoration: underline; cursor: pointer; }

/* Pedidos, tablas y panel */
.item { margin-bottom: 16px; padding: 20px; background: var(--paper-hi); border: 2px solid var(--ink); border-radius: 10px 22px 12px 18px; overflow-wrap: anywhere; }
.item-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center; }
.badge { display: inline-block; padding: .15rem .75rem; border: 2px solid var(--red); border-radius: 6px; color: var(--red); font-size: .8rem; font-weight: 700; rotate: -2deg; }
dl { display: grid; grid-template-columns: minmax(120px, 200px) 1fr; gap: 4px 14px; margin: 12px 0; font-size: .95rem; }
dt { color: var(--muted); } dd { margin: 0; white-space: pre-line; }
@media (max-width: 520px) { dl { grid-template-columns: 1fr; } dd { margin-bottom: 8px; } }
.tabs { margin-top: 18px; }
.split { display: grid; gap: 30px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.repeat { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); align-items: end; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 2px dashed var(--line); }
.repeat label { margin: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border: 2px solid var(--line); border-radius: 99px; background: #fff; color: var(--ink); font: 700 .85rem var(--body); cursor: pointer; }
.preview { width: 160px; height: 160px; object-fit: cover; border-radius: 12px; background: #000; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: 8px 10px; border: 1px solid #14090a59; text-align: left; }
.legal h2 { margin-top: 1.8em; font-size: 1.35rem; }
mark { padding: 0 4px; border-radius: 3px; background: #ffd873; color: var(--ink); }

/* Pie */
.footer { --edge: var(--ink); display: flow-root; margin-top: 74px; padding: 30px 0 0; background: var(--ink); color: var(--paper); }
main:has(> .workshop:last-child) + .footer { margin-top: 0; }
.footer a { display: block; width: fit-content; padding: 3px 0; color: var(--paper); text-decoration: none; transition: translate .2s var(--ease-out); }
.footer a:hover { translate: 6px 0; text-decoration: underline; }
.footer-grid { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); font-size: .95rem; }
.footer-grid img { border-radius: 50%; background: #000; }
.footer h2 { font-size: 1.15rem; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-top: 28px; padding-block: 18px; border-top: 1px solid #f5e6ca33; font-size: .9rem; }
.footer a.credit { position: relative; z-index: 2; padding: 10px 16px; border: 2px solid var(--paper); border-radius: 8px 14px 9px 13px; font-weight: 700; }
.footer a.credit:hover { translate: 0 -3px; background: var(--paper); color: var(--ink); text-decoration: none; }
.footer-word { margin: 0; padding-bottom: .12em; text-align: center; font: 400 15vw/1.2 var(--display); color: #3a1717; user-select: none; pointer-events: none; }

/* hueco, dentro del pie oscuro, para la barra inferior */
@media (max-width: 1120px) { .footer { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); } }

::view-transition-old(root) { animation: page-out .3s var(--ease-out) both; }
::view-transition-new(root) { animation: page-in .55s var(--ease-in-out) both; }
@keyframes page-out { to { opacity: .4; } }
@keyframes page-in { from { clip-path: polygon(0 0, 0 0, -20% 100%, -20% 100%); } to { clip-path: polygon(0 0, 125% 0, 105% 100%, -20% 100%); } }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .is-loading::after, .spinner::before { animation: spin 1.6s linear infinite !important; }
}
