/* =============================================================
   mil trazos ediciones — "Mesa de dibujo"
   Color de las tapas, papel, crayón y mil trazos a mano.
   ============================================================= */

/* 1. Tokens ---------------------------------------------------- */
:root {
  --paper: #fbf5ea;
  --paper-2: #f3ead8;
  --ink: #1d1814;
  --ink-2: #4a4038;
  --ink-3: #7a6e62;
  --tomate: #ec4a2c;
  --girasol: #f7c33b;
  --cielo: #8fcbea;
  --pasto: #3f9a5c;
  --rosa: #f6a9c6;
  --uva: #6b51a3;
  --naranja: #f2892b;
  --line: rgba(29, 24, 20, .16);
  --on-ink: #fbf5ea;
  --on-ink-2: rgba(251, 245, 234, .7);
  --line-ink: rgba(251, 245, 234, .18);

  --font: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
  --hand: "Gochi Hand", "Comic Sans MS", cursive;

  --step--1: clamp(.86rem, .83rem + .15vw, .95rem);
  --step-0: clamp(1rem, .96rem + .22vw, 1.12rem);
  --step-1: clamp(1.22rem, 1.1rem + .55vw, 1.6rem);
  --step-2: clamp(1.6rem, 1.3rem + 1.4vw, 2.5rem);
  --step-3: clamp(2.2rem, 1.5rem + 3.2vw, 4.4rem);
  --step-4: clamp(3rem, 1.6rem + 6.4vw, 8rem);

  --gutter: clamp(1.1rem, .6rem + 2.6vw, 3rem);
  --max: 1360px;
  --section: clamp(4.5rem, 3rem + 7vw, 9rem);
  --nav-h: 74px;
  --wobble: 255px 18px 225px 18px / 18px 225px 18px 255px;
  --wobble-2: 18px 225px 18px 255px / 255px 18px 225px 18px;
  --shadow: 0 2px 2px rgba(29,24,20,.08), 0 14px 26px -12px rgba(29,24,20,.38);
  --shadow-up: 0 3px 3px rgba(29,24,20,.08), 0 26px 40px -16px rgba(29,24,20,.45);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-back: cubic-bezier(0.34, 1.56, 0.64, 1);
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.11 0 0 0 0 0.09 0 0 0 0 0.08 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* 2. Reset & base ---------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; scroll-padding-top: calc(var(--nav-h) + 12px); }
body {
  font-family: var(--font); font-size: var(--step-0); line-height: 1.6; color: var(--ink);
  background: var(--paper) var(--noise); font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased; overflow-x: clip;
}
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { font-weight: 750; line-height: .98; letter-spacing: -0.035em; text-wrap: balance; font-stretch: 92%; }
::selection { background: var(--girasol); color: var(--ink); }
:focus-visible { outline: 3px solid var(--tomate); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }

/* 3. Utilities ------------------------------------------------- */
.skip-link { position: fixed; top: -100px; left: 1rem; z-index: 9999; padding: .7rem 1rem; background: var(--ink); color: var(--paper); border-radius: 8px; }
.skip-link:focus { top: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section); position: relative; }
.num { font-variant-numeric: tabular-nums; }
.mano { font-family: var(--hand); font-weight: 400; letter-spacing: 0; line-height: 1.1; }
.bg-tomate { background-color: var(--tomate); color: var(--paper); }
.bg-girasol { background-color: var(--girasol); }
.bg-cielo { background-color: var(--cielo); }
.bg-pasto { background-color: var(--pasto); color: var(--paper); }
.bg-rosa { background-color: var(--rosa); }
.bg-ink { background-color: var(--ink); color: var(--on-ink); }
.bg-paper2 { background-color: var(--paper-2); }
[class*="bg-"] { background-image: var(--noise); }

/* 4. Typography ------------------------------------------------ */
.h-display { font-size: var(--step-4); font-weight: 800; letter-spacing: -0.045em; line-height: .9; }
.h-1 { font-size: var(--step-3); font-weight: 780; }
.h-2 { font-size: var(--step-2); font-weight: 720; letter-spacing: -0.025em; line-height: 1.02; }
.h-3 { font-size: var(--step-1); font-weight: 680; letter-spacing: -0.015em; line-height: 1.15; }
.lead { font-size: var(--step-1); line-height: 1.4; max-width: 34ch; font-weight: 420; }
.body-l { font-size: calc(var(--step-0) * 1.05); max-width: 60ch; }
.muted { color: var(--ink-3); }
.prose { max-width: 64ch; color: var(--ink-2); }
.prose p + p { margin-top: 1em; }
.note { font-family: var(--hand); font-size: clamp(1.15rem, 1rem + .6vw, 1.5rem); line-height: 1.15; display: inline-flex; align-items: center; gap: .5rem; transform: rotate(-3deg); }
.note svg { width: 46px; height: auto; flex: none; }
.scribble { position: relative; display: inline-block; }
.scribble svg { position: absolute; left: -4%; width: 108%; bottom: -.18em; height: .35em; overflow: visible; pointer-events: none; }
.scribble path { fill: none; stroke: var(--tomate); stroke-width: 5; stroke-linecap: round; }

/* 5. Components ------------------------------------------------ */
.btn {
  --bg: var(--ink); --fg: var(--paper);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  min-height: 54px; padding: .85rem 1.55rem; background: var(--bg); color: var(--fg);
  border-radius: var(--wobble); font-weight: 650; font-size: var(--step-0); line-height: 1; white-space: nowrap;
  box-shadow: 3px 4px 0 rgba(29,24,20,.9);
  transition: transform .35s var(--ease-back), box-shadow .35s var(--ease-out), background-color .25s, color .25s;
}
.btn:hover { transform: translate(-2px, -3px) rotate(-1.2deg); box-shadow: 6px 8px 0 rgba(29,24,20,.9); }
.btn:active { transform: translate(2px, 3px); box-shadow: 1px 1px 0 rgba(29,24,20,.9); }
.btn svg { width: 19px; height: 19px; flex: none; }
.btn--ghost { --bg: var(--paper); --fg: var(--ink); box-shadow: inset 0 0 0 2px var(--ink), 3px 4px 0 rgba(29,24,20,.9); }
.btn--ghost:hover { box-shadow: inset 0 0 0 2px var(--ink), 6px 8px 0 rgba(29,24,20,.9); }
.btn--light { --bg: var(--paper); --fg: var(--ink); }
.btn--tomate { --bg: var(--tomate); --fg: #fff; }
.btn--girasol { --bg: var(--girasol); --fg: var(--ink); }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.bg-ink .btn, .final .btn { box-shadow: 3px 4px 0 rgba(251,245,234,.85); }
.bg-ink .btn:hover, .final .btn:hover { box-shadow: 6px 8px 0 rgba(251,245,234,.85); }
.bg-ink .btn--ghost, .final .btn--ghost { --bg: transparent; --fg: var(--paper); box-shadow: inset 0 0 0 2px var(--paper), 3px 4px 0 rgba(251,245,234,.85); }

.link { display: inline-flex; align-items: center; gap: .45rem; font-weight: 650; position: relative; padding-bottom: 3px; }
.link::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 8px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 8' preserveAspectRatio='none'%3E%3Cpath d='M1 5 C 20 1, 40 7, 60 4 S 100 2, 119 5' fill='none' stroke='%23ec4a2c' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat; transform-origin: left; transition: transform .5s var(--ease-out); }
.link:hover::after { transform: scaleX(.3); }
.link svg { width: 17px; height: 17px; transition: transform .4s var(--ease-back); }
.link:hover svg { transform: translateX(4px); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; height: var(--nav-h); transition: background-color .3s, box-shadow .3s, transform .5s var(--ease-out); }
.site-header.is-scrolled { background: rgba(251,245,234,.94); box-shadow: 0 2px 0 var(--ink); }
.site-header.is-hidden { transform: translateY(-110%); }
.nav { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1.2rem; }
.brand { display: inline-flex; transition: transform .45s var(--ease-back); }
.brand:hover { transform: rotate(-4deg) scale(1.05); }
.brand svg { height: 44px; width: auto; }
.nav-links { display: none; gap: .3rem; font-weight: 600; font-size: var(--step--1); }
.nav-links a { position: relative; padding: .55rem .9rem; border-radius: var(--wobble); transition: background-color .25s, transform .35s var(--ease-back); }
.nav-links a:nth-child(1):hover { background: var(--girasol); transform: rotate(-2deg); }
.nav-links a:nth-child(2):hover { background: var(--cielo); transform: rotate(2deg); }
.nav-links a:nth-child(3):hover { background: var(--rosa); transform: rotate(-2deg); }
.nav-links a:nth-child(4):hover { background: var(--pasto); color: var(--paper); transform: rotate(1.5deg); }
.nav-links a:nth-child(5):hover { background: var(--tomate); color: #fff; transform: rotate(-1.5deg); }
.nav-links a[aria-current="page"] { background: var(--ink); color: var(--paper); }
.nav-actions { display: flex; align-items: center; gap: .3rem; }
.icon-btn { position: relative; display: inline-flex; align-items: center; gap: .5rem; min-width: 46px; min-height: 46px; padding: 0 .75rem; border-radius: var(--wobble); font-weight: 650; font-size: var(--step--1); transition: background-color .25s; }
.icon-btn:hover { background: var(--paper-2); }
.icon-btn svg { width: 23px; height: 23px; }
.cart-count { min-width: 1.45rem; height: 1.45rem; padding: 0 .3rem; border-radius: 50%; display: inline-grid; place-items: center; font-size: .75rem; font-weight: 750; background: var(--tomate); color: #fff; font-variant-numeric: tabular-nums; transition: transform .45s var(--ease-back); }
.cart-count.is-bump { transform: scale(1.5) rotate(-12deg); }
.cart-label { display: none; }
.menu-btn .bars { display: grid; gap: 6px; }
.menu-btn .bar { display: block; width: 22px; height: 2.5px; border-radius: 2px; background: currentColor; transition: transform .45s var(--ease-out); }
.menu-open .menu-btn .bar:first-child { transform: translateY(4.25px) rotate(45deg); }
.menu-open .menu-btn .bar:last-child { transform: translateY(-4.25px) rotate(-45deg); }
.mobile-menu { position: fixed; inset: var(--nav-h) 0 0 0; z-index: 49; background: var(--girasol) var(--noise); padding: 1.2rem var(--gutter) 2rem; display: flex; flex-direction: column; justify-content: space-between; clip-path: circle(0% at 92% 0); visibility: hidden; transition: clip-path .7s var(--ease-out), visibility 0s .7s; }
.menu-open .mobile-menu { clip-path: circle(150% at 92% 0); visibility: visible; transition: clip-path .7s var(--ease-out); }
.mobile-menu ul { list-style: none; padding: 0; }
.mobile-menu li a { display: flex; justify-content: space-between; align-items: baseline; padding: .55rem 0; font-size: clamp(2.2rem, 11vw, 3.4rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; }
.mobile-menu li:nth-child(even) a { padding-left: 1.4rem; }
.mobile-menu li a span { font-family: var(--hand); font-size: 1.1rem; font-weight: 400; letter-spacing: 0; }
.mobile-menu .mm-foot { display: grid; gap: .45rem; font-weight: 600; }
.menu-open { overflow: hidden; }

/* Book card = sticker on the table */
.books { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(2.2rem, 4vw, 3.6rem) clamp(1rem, 2.4vw, 2.4rem); }
.book { position: relative; display: flex; flex-direction: column; }
.book-cover { position: relative; display: grid; place-items: end center; aspect-ratio: 1 / 1.05; padding: 6% 6% 0; }
.book-cover::before { content: ""; position: absolute; inset: 12% 2% 0; border-radius: var(--wobble); background: var(--c, var(--paper-2)); opacity: .9; transform: rotate(var(--bg-r, -2deg)); transition: transform .6s var(--ease-back); }
.book:nth-child(4n+1) { --c: var(--girasol); --bg-r: -2.5deg; --r: -2deg; }
.book:nth-child(4n+2) { --c: var(--cielo); --bg-r: 2deg; --r: 1.5deg; }
.book:nth-child(4n+3) { --c: var(--rosa); --bg-r: -1.5deg; --r: -1deg; }
.book:nth-child(4n+4) { --c: #b9dcb0; --bg-r: 2.5deg; --r: 2deg; }
.book-cover img { position: relative; max-height: 92%; width: auto; max-width: 88%; object-fit: contain; border-radius: 3px; box-shadow: var(--shadow); transform: rotate(var(--r, 0deg)); transform-origin: 50% 100%; transition: transform .6s var(--ease-back), box-shadow .6s var(--ease-out); }
.book:hover .book-cover img { transform: rotate(calc(var(--r, 0deg) * -1.6)) translateY(-14px) scale(1.04); box-shadow: var(--shadow-up); }
.book:hover .book-cover::before { transform: rotate(calc(var(--bg-r, 0deg) * -1)) scale(1.03); }
.book-body { padding-top: 1rem; display: grid; gap: .15rem; }
.book-title { font-size: clamp(1.05rem, .98rem + .4vw, 1.3rem); line-height: 1.12; letter-spacing: -0.02em; font-weight: 720; }
.book-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.book-by { font-size: var(--step--1); color: var(--ink-3); line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.book-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .55rem; }
.price { font-variant-numeric: tabular-nums; font-weight: 750; letter-spacing: -0.02em; }
.price small { font-weight: 450; color: var(--ink-3); font-size: .8em; }
.add { position: relative; z-index: 2; display: inline-flex; align-items: center; gap: .35rem; min-height: 42px; padding: 0 .85rem; border-radius: var(--wobble); background: var(--ink); color: var(--paper); font-size: var(--step--1); font-weight: 650; transition: transform .35s var(--ease-back), background-color .25s; }
.add svg { width: 15px; height: 15px; transition: transform .45s var(--ease-back); }
.add:hover { transform: rotate(-3deg) scale(1.06); background: var(--tomate); }
.add:hover svg { transform: rotate(180deg); }
.add.is-done { background: var(--pasto); }
.book.is-out .book-cover img { filter: grayscale(.6); opacity: .8; }
.stock-note { font-size: var(--step--1); color: var(--ink-3); position: relative; z-index: 2; }
.stock-note a { text-decoration: underline; text-underline-offset: 3px; }

.sec-head { display: grid; gap: 1rem; margin-bottom: clamp(2.4rem, 4vw, 4rem); }
.sec-head-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1.2rem 2rem; }
.sec-head .h-1 { max-width: 15ch; }

/* 6. Home ------------------------------------------------------ */

/* Hero: the drawing table */
.hero { position: relative; padding-top: clamp(1rem, 3vw, 2.5rem); padding-bottom: clamp(3rem, 6vw, 6rem); overflow: clip; }
.hero-grid { position: relative; display: grid; gap: 2.2rem; }
.hero-copy { position: relative; z-index: 3; }
.hero h1 { font-size: clamp(3.1rem, 1.2rem + 8.4vw, 9.2rem); font-weight: 820; letter-spacing: -0.05em; line-height: .86; font-stretch: 88%; max-width: 9ch; }
.hero .lead { margin-top: 1.5rem; max-width: 30ch; }
.hero-ctas { display: flex; flex-wrap: wrap; align-items: center; gap: .9rem 1.2rem; margin-top: 2rem; }

.desk { position: relative; z-index: 2; min-height: 460px; }
.sheet {
  position: relative; margin-inline: auto; width: min(100%, 560px); aspect-ratio: 4 / 3.3;
  background: #fffdf8; box-shadow: 0 1px 1px rgba(0,0,0,.06), 0 30px 50px -28px rgba(29,24,20,.5);
  transform: rotate(-2deg); border-radius: 3px;
}
.sheet::before, .sheet::after { content: ""; position: absolute; width: 110px; height: 30px; background: rgba(247,195,59,.75); top: -14px; z-index: 2; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.sheet::before { left: -26px; transform: rotate(-32deg); }
.sheet::after { right: -26px; transform: rotate(28deg); background: rgba(143,203,234,.8); }
.sheet canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; border-radius: 3px; }
.sheet-hint { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: .4rem; pointer-events: none; color: var(--ink-3); transition: opacity .5s; }
.sheet-hint .mano { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.5rem); color: var(--ink); }
.sheet.is-drawing .sheet-hint { opacity: 0; }
.sheet-hint svg { width: 74px; margin: .6rem auto 0; }
.sheet-hint path { fill: none; stroke: var(--tomate); stroke-width: 3; stroke-linecap: round; }
.crayons { position: relative; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .55rem .7rem; margin-top: 1.4rem; }
.crayon { width: 40px; height: 40px; border-radius: 50%; background: var(--c); box-shadow: inset 0 -4px 0 rgba(0,0,0,.18), 0 2px 0 rgba(0,0,0,.12); transition: transform .35s var(--ease-back); }
.crayon:hover { transform: translateY(-4px) rotate(-8deg); }
.crayon[aria-pressed="true"] { transform: translateY(-6px) scale(1.12); box-shadow: inset 0 -4px 0 rgba(0,0,0,.18), 0 0 0 3px var(--paper), 0 0 0 5px var(--ink); }
.tool { min-height: 40px; padding: 0 .85rem; border-radius: var(--wobble); font-size: var(--step--1); font-weight: 650; box-shadow: inset 0 0 0 2px var(--ink); transition: background-color .25s, transform .3s var(--ease-back); }
.tool:hover { background: var(--girasol); transform: rotate(-2deg); }
.counter { width: 100%; text-align: center; font-family: var(--hand); font-size: 1.3rem; margin-top: .3rem; }
.counter b { font-family: var(--font); font-weight: 800; font-variant-numeric: tabular-nums; color: var(--tomate); }

.loose { position: absolute; z-index: 4; width: var(--w, 120px); left: var(--x); top: var(--y); transform: rotate(var(--r)); touch-action: none; cursor: grab; user-select: none; transition: transform .5s var(--ease-back), filter .3s; }
.loose img { width: 100%; border-radius: 3px; box-shadow: var(--shadow); pointer-events: none; -webkit-user-drag: none; }
.loose:hover { transform: rotate(calc(var(--r) * -1)) scale(1.06); }
.loose.is-dragging { cursor: grabbing; transition: none; filter: drop-shadow(0 26px 22px rgba(0,0,0,.28)); z-index: 6; }
.loose-note { position: absolute; z-index: 5; font-family: var(--hand); font-size: 1.25rem; line-height: 1.05; pointer-events: none; }
.loose-note svg { width: 60px; }
.loose-note path { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.doodle { position: absolute; pointer-events: none; z-index: 1; overflow: visible; }
.doodle path, .doodle circle { fill: none; stroke: var(--c, var(--tomate)); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

/* Covers belt (novedades) */
.belt-sec { position: relative; overflow: clip; }
.belt { display: flex; gap: clamp(1.2rem, 3vw, 2.6rem); overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter); padding: 2.5rem var(--gutter) 3rem; scrollbar-width: none; cursor: grab; }
.belt::-webkit-scrollbar { display: none; }
.belt.is-drag { cursor: grabbing; scroll-snap-type: none; }
.belt.is-drag a { pointer-events: none; }
.belt .book { flex: none; width: clamp(200px, 56vw, 290px); scroll-snap-align: start; }
.belt .book-cover::before { display: none; }
.belt .book-cover img { border: 7px solid #fff; border-radius: 4px; }
.belt .book-by { color: rgba(255,255,255,.82); }
.belt .add { background: var(--paper); color: var(--ink); }
.belt .add:hover { background: var(--girasol); }
.belt-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem 2rem; }
.belt-head .note { color: var(--paper); }
.belt-head .note path { stroke: var(--paper); }
.bg-tomate .link::after { filter: brightness(0) invert(1); }

/* Flip book */
.flip-sec .sec-head .h-1 { max-width: 13ch; }
.flip-layout { display: grid; gap: clamp(1.6rem, 4vw, 3rem); align-items: center; }
.flip-picks { display: flex; gap: .8rem; overflow-x: auto; padding: .6rem .2rem 1rem; scrollbar-width: none; }
.flip-picks::-webkit-scrollbar { display: none; }
.pick { flex: none; width: 76px; transition: transform .4s var(--ease-back); }
.pick img { width: 100%; border-radius: 3px; box-shadow: var(--shadow); }
.pick:hover { transform: translateY(-6px) rotate(-4deg); }
.pick[aria-pressed="true"] { transform: translateY(-10px) rotate(3deg) scale(1.08); }
.pick[aria-pressed="true"] img { box-shadow: 0 0 0 3px var(--paper), 0 0 0 6px var(--ink), var(--shadow-up); }
.flip-stage { perspective: 2200px; }
.fbook { position: relative; width: 100%; aspect-ratio: 16 / 10; max-width: 880px; margin-inline: auto; }
.fbook::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 60px; transform: translateX(-50%); background: linear-gradient(90deg, transparent, rgba(0,0,0,.22) 48%, rgba(255,255,255,.15) 52%, transparent); pointer-events: none; z-index: 5; }
.fhalf { position: absolute; top: 0; bottom: 0; width: 50%; background-size: 200% 100%; background-repeat: no-repeat; box-shadow: var(--shadow-up); }
.fhalf.l { left: 0; background-position: 0 0; border-radius: 6px 0 0 6px; }
.fhalf.r { right: 0; background-position: 100% 0; border-radius: 0 6px 6px 0; }
.leaf { position: absolute; top: 0; bottom: 0; width: 50%; transform-style: preserve-3d; z-index: 4; transition: transform .9s cubic-bezier(.45,.05,.25,1); }
.leaf.fwd { left: 50%; transform-origin: left center; }
.leaf.back { left: 0; transform-origin: right center; }
.leaf .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; background-size: 200% 100%; background-repeat: no-repeat; }
.leaf .face::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.18), transparent 30%); opacity: var(--shade, 0); }
.leaf .b { transform: rotateY(180deg); }
.leaf.fwd .a { background-position: 100% 0; border-radius: 0 6px 6px 0; }
.leaf.fwd .b { background-position: 0 0; border-radius: 6px 0 0 6px; }
.leaf.back .a { background-position: 0 0; border-radius: 6px 0 0 6px; }
.leaf.back .b { background-position: 100% 0; border-radius: 0 6px 6px 0; }
.leaf.fwd.go { transform: rotateY(-180deg); }
.leaf.back.go { transform: rotateY(180deg); }
.fbook-hit { position: absolute; top: 0; bottom: 0; width: 50%; z-index: 6; }
.fbook-hit.prev { left: 0; cursor: w-resize; }
.fbook-hit.next { right: 0; cursor: e-resize; }
.flip-ctrl { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1.6rem; flex-wrap: wrap; }
.flip-ctrl .tool { min-width: 48px; min-height: 48px; font-size: 1.1rem; background: var(--paper); }
.flip-info { display: grid; gap: .8rem; align-content: start; }
.flip-info .h-2 { max-width: 14ch; }
.flip-info .by { font-weight: 550; }
.flip-info .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.4rem; margin-top: .6rem; }
.flip-info .price { font-size: var(--step-2); }
.page-count { font-family: var(--hand); font-size: 1.3rem; min-width: 6ch; text-align: center; }

/* Book maker game */
.maker { display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.maker-ui { display: grid; gap: 1.3rem; }
.mk-row { display: grid; gap: .55rem; }
.mk-label { font-family: var(--hand); font-size: 1.35rem; line-height: 1; }
.mk-input { width: 100%; min-height: 52px; padding: .6rem 1rem; background: #fffdf8; border: 2px solid var(--ink); border-radius: var(--wobble-2); font-size: var(--step-1); font-weight: 650; letter-spacing: -0.01em; box-shadow: 3px 3px 0 var(--ink); }
.mk-input:focus { outline: none; box-shadow: 5px 5px 0 var(--tomate); }
.mk-opts { display: flex; flex-wrap: wrap; gap: .55rem; }
.swatch { width: 44px; height: 44px; border-radius: var(--wobble); background: var(--c); box-shadow: inset 0 0 0 2px rgba(29,24,20,.85); transition: transform .3s var(--ease-back); }
.swatch:hover { transform: rotate(-8deg) scale(1.08); }
.swatch[aria-pressed="true"] { transform: scale(1.12) rotate(6deg); box-shadow: inset 0 0 0 2px var(--ink), 0 0 0 3px var(--paper), 0 0 0 5px var(--ink); }
.opt { min-height: 44px; padding: 0 1rem; border-radius: var(--wobble); box-shadow: inset 0 0 0 2px var(--ink); font-weight: 650; font-size: var(--step--1); background: #fffdf8; transition: transform .3s var(--ease-back), background-color .2s, color .2s; }
.opt:hover { transform: rotate(-2deg); }
.opt[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.opt svg { width: 30px; height: 30px; }
.opt.ico { padding: 0 .5rem; }
.opt.ico path, .opt.ico circle { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.maker-stage { display: grid; justify-items: center; gap: 1.2rem; perspective: 1600px; }
.mbook { --bw: min(78vw, 360px); --ratio: 1; --depth: 26px; position: relative; width: var(--bw); height: calc(var(--bw) * var(--ratio)); transform-style: preserve-3d; transform: rotateX(4deg) rotateY(var(--ry, -24deg)); transition: transform .9s var(--ease-out), height .6s var(--ease-out), width .6s var(--ease-out); cursor: grab; touch-action: pan-y; }
.mbook.is-drag { transition: none; cursor: grabbing; }
.mbook > div { position: absolute; }
.m-front, .m-back { inset: 0; border-radius: 2px 6px 6px 2px; overflow: hidden; }
.m-front { background: var(--cov, var(--tomate)); transform: translateZ(calc(var(--depth) / 2)); box-shadow: inset 8px 0 10px -6px rgba(0,0,0,.35); }
.m-back { background: var(--cov, var(--tomate)); transform: rotateY(180deg) translateZ(calc(var(--depth) / 2)); filter: brightness(.92); }
.m-spine { top: 0; bottom: 0; left: 50%; width: var(--depth); margin-left: calc(var(--depth) / -2); background: var(--cov, var(--tomate)); transform: rotateY(-90deg) translateZ(calc(var(--bw) / 2)); filter: brightness(.82); display: grid; place-items: center; overflow: hidden; }
.m-spine span { writing-mode: vertical-rl; font-weight: 750; font-size: 11px; color: var(--ink-c, #fff); white-space: nowrap; letter-spacing: .02em; max-height: 86%; overflow: hidden; text-overflow: ellipsis; }
.m-pages { top: 3px; bottom: 3px; left: 50%; width: calc(var(--depth) - 4px); margin-left: calc((var(--depth) - 4px) / -2); background: repeating-linear-gradient(90deg, #fff 0 2px, #ece6da 2px 3px); transform: rotateY(90deg) translateZ(calc(var(--bw) / 2 - 3px)); }
.m-art { position: absolute; inset: 0; display: grid; place-items: center; padding: 14%; }
.m-art img, .m-art svg { width: 100%; height: 100%; object-fit: contain; }
.m-art svg path, .m-art svg circle, .m-art svg ellipse { fill: none; stroke: var(--ink-c, #fff); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.m-title { position: absolute; left: 8%; right: 8%; top: 7%; color: var(--ink-c, #fff); font-size: calc(var(--bw) * .115); line-height: .92; letter-spacing: -0.04em; font-weight: 820; overflow-wrap: anywhere; }
.m-title.f-fina { font-weight: 300; letter-spacing: -0.02em; font-stretch: 100%; }
.m-title.f-mano { font-family: var(--hand); font-weight: 400; letter-spacing: 0; font-size: calc(var(--bw) * .13); }
.m-author { position: absolute; left: 8%; bottom: 7%; right: 30%; color: var(--ink-c, #fff); font-size: calc(var(--bw) * .042); font-weight: 600; opacity: .92; }
.m-logo { position: absolute; right: 7%; bottom: 6%; width: 17%; }
.m-backtext { position: absolute; inset: 12%; color: var(--ink-c, #fff); font-family: var(--hand); font-size: calc(var(--bw) * .06); line-height: 1.15; transform: scaleX(-1) scaleX(-1); }
.maker-actions { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; }

/* Ages (colored tiles) */
.ages { display: grid; gap: clamp(1rem, 2vw, 1.6rem); list-style: none; padding: 0; }
.age a { position: relative; display: grid; min-height: 300px; padding: clamp(1.4rem, 3vw, 2.4rem); border-radius: var(--wobble); overflow: hidden; transition: transform .5s var(--ease-back); }
.age:nth-child(1) a { background: var(--girasol) var(--noise); transform: rotate(-1deg); }
.age:nth-child(2) a { background: var(--pasto) var(--noise); color: var(--paper); transform: rotate(.8deg); }
.age:nth-child(3) a { background: var(--rosa) var(--noise); transform: rotate(-.6deg); }
.age a:hover { transform: rotate(0) translateY(-6px); }
.age-t { font-size: var(--step-2); font-weight: 800; letter-spacing: -0.04em; line-height: .95; max-width: 9ch; }
.age-n { font-family: var(--hand); font-size: 1.35rem; display: block; margin-bottom: .4rem; }
.age-d { margin-top: .7rem; max-width: 26ch; font-size: var(--step--1); font-weight: 500; }
.age-covers { position: absolute; right: -4%; bottom: -8%; width: 56%; height: 62%; }
.age-covers img { position: absolute; width: 58%; border-radius: 3px; box-shadow: var(--shadow); transition: transform .7s var(--ease-back); }
.age-covers img:nth-child(1) { left: 0; bottom: 10%; transform: rotate(-12deg); }
.age-covers img:nth-child(2) { left: 22%; bottom: 22%; transform: rotate(4deg); z-index: 1; }
.age-covers img:nth-child(3) { left: 44%; bottom: 4%; transform: rotate(14deg); z-index: 2; }
.age a:hover .age-covers img:nth-child(1) { transform: rotate(-22deg) translate(-16px, -10px); }
.age a:hover .age-covers img:nth-child(2) { transform: rotate(0) translateY(-26px); }
.age a:hover .age-covers img:nth-child(3) { transform: rotate(24deg) translate(18px, -6px); }
.age-go { position: absolute; left: clamp(1.4rem, 3vw, 2.4rem); bottom: clamp(1.4rem, 3vw, 2.4rem); font-weight: 700; display: inline-flex; gap: .4rem; align-items: center; z-index: 3; }
.age-go svg { width: 18px; }

/* Arquilínea: the deck */
.arq-grid { display: grid; gap: clamp(2.4rem, 5vw, 5rem); align-items: center; }
.deck { position: relative; height: clamp(320px, 70vw, 520px); }
.card { position: absolute; left: 50%; top: 50%; width: clamp(170px, 42vw, 290px); aspect-ratio: 1; margin: calc(clamp(170px, 42vw, 290px) / -2) 0 0 calc(clamp(170px, 42vw, 290px) / -2); border-radius: 14px; overflow: hidden; background: #fff; box-shadow: 0 2px 0 rgba(255,255,255,.1), 0 24px 40px -18px rgba(0,0,0,.6); transform: rotate(var(--r)) translate(var(--tx), var(--ty)); transition: transform .7s var(--ease-back); cursor: pointer; }
.card img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.deck:hover .card { transform: rotate(calc(var(--r) * 2.2)) translate(calc(var(--tx) * 2.6), calc(var(--ty) * 1.6)); }
.card.is-top { z-index: 9; }
.arq-list { list-style: none; padding: 0; margin-top: 1.8rem; display: grid; gap: .5rem; }
.arq-list a { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .75rem 1.1rem; border-radius: var(--wobble-2); box-shadow: inset 0 0 0 1.5px var(--line-ink); transition: background-color .25s, color .25s, transform .4s var(--ease-back); }
.arq-list a:hover { background: var(--naranja); color: var(--ink); transform: rotate(-1deg); }
.arq-list .t { font-weight: 650; }
.arq-list .p { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Path: from the drawer to the press */
.path-sec { overflow: clip; }
.path { position: relative; display: grid; gap: clamp(2.4rem, 6vw, 4rem); margin-top: 3rem; }
.path-line { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.path-line path { fill: none; stroke: var(--girasol); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 8 10; }
.stop { position: relative; display: grid; grid-template-columns: auto 1fr; gap: .2rem 1.2rem; max-width: 34rem; align-items: start; }
.stop:nth-child(even) { margin-left: auto; }
.stop-ico { grid-row: span 2; width: 86px; height: 86px; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: var(--ink); transform: rotate(-6deg); box-shadow: 4px 5px 0 rgba(251,245,234,.85); }
.stop-ico svg { width: 52px; height: 52px; }
.stop-ico path, .stop-ico circle, .stop-ico rect { fill: none; stroke: var(--ink); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.stop strong { font-size: var(--step-2); font-weight: 780; letter-spacing: -0.03em; line-height: 1; }
.stop span { color: var(--on-ink-2); }

/* Pinboard (taller) */
.pins { display: grid; gap: clamp(2.4rem, 5vw, 4rem); }
.poster { position: relative; display: grid; gap: 1rem; }
.poster-img { position: relative; max-width: 480px; transform: rotate(var(--r, -2deg)); transition: transform .5s var(--ease-back); }
.poster:hover .poster-img { transform: rotate(0) scale(1.02); }
.poster-img img { width: 100%; border-radius: 4px; box-shadow: var(--shadow-up); }
.poster-img::before { content: ""; position: absolute; top: -12px; left: 50%; width: 26px; height: 26px; margin-left: -13px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ff8a73, var(--tomate) 60%, #a52a14); box-shadow: 0 6px 8px -2px rgba(0,0,0,.35); z-index: 2; }
.poster dl { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1.2rem; font-size: var(--step--1); }
.poster dt { font-family: var(--hand); font-size: 1.15rem; line-height: 1.3; }

/* Collage */
.collage { position: relative; display: grid; grid-template-columns: repeat(12, 1fr); gap: 1rem; }
.collage figure { position: relative; transform: rotate(var(--r)); transition: transform .5s var(--ease-back); }
.collage figure:hover { transform: rotate(0) scale(1.03); z-index: 3; }
.collage img { width: 100%; height: 100%; object-fit: cover; border: 8px solid #fff; border-bottom-width: 34px; box-shadow: var(--shadow-up); }
.collage figcaption { position: absolute; left: 14px; bottom: 6px; font-family: var(--hand); font-size: 1.05rem; color: var(--ink); }
.collage .tape::before { content: ""; position: absolute; top: -12px; left: 50%; width: 90px; height: 26px; margin-left: -45px; background: rgba(247,195,59,.75); transform: rotate(-4deg); z-index: 2; }
.c1 { grid-column: 1 / 8; grid-row: 1; --r: -2deg; aspect-ratio: 16 / 8; }
.c2 { grid-column: 8 / 13; grid-row: 1; --r: 3deg; margin-top: 3rem; aspect-ratio: 4 / 3; }
.c3 { grid-column: 2 / 7; grid-row: 2; --r: 2deg; margin-top: -1rem; aspect-ratio: 4 / 3; }
.c4 { grid-column: 7 / 13; grid-row: 2; --r: -3deg; margin-top: 2rem; aspect-ratio: 16 / 8; }

/* FAQ */
.faq-grid { display: grid; gap: clamp(2rem, 5vw, 5rem); }
.faq { display: grid; gap: .7rem; }
.faq details { background: #fffdf8; border-radius: var(--wobble-2); box-shadow: inset 0 0 0 2px var(--ink), 3px 4px 0 var(--ink); transition: transform .4s var(--ease-back); }
.faq details:nth-child(odd) { transform: rotate(-.4deg); }
.faq details:nth-child(even) { transform: rotate(.4deg); }
.faq details[open] { background: var(--girasol); transform: none; }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 1.2rem; padding: 1.05rem 1.3rem; font-weight: 700; font-size: var(--step-1); letter-spacing: -0.02em; line-height: 1.2; }
.faq summary::-webkit-details-marker { display: none; }
.faq .pm { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; font-size: 1.2rem; transition: transform .45s var(--ease-back); }
.faq .pm::before { content: "+"; line-height: 1; }
.faq details[open] .pm { transform: rotate(135deg); }
.faq .ans { padding: 0 1.3rem 1.3rem; max-width: 62ch; }

/* Final + footer */
.final { position: relative; overflow: clip; background: var(--ink) var(--noise); color: var(--on-ink); }
.final-inner { position: relative; z-index: 1; display: grid; gap: 2rem; padding-block: clamp(5rem, 10vw, 9rem); }
.final .h-display { max-width: 12ch; }
.final .lead { color: var(--on-ink-2); }
.final .ctas { display: flex; flex-wrap: wrap; gap: .9rem; }
.final-art { position: relative; width: 100%; max-width: 520px; height: clamp(260px, 60vw, 440px); justify-self: end; pointer-events: none; }
.final-art img { position: absolute; width: 42%; border-radius: 3px; box-shadow: 0 30px 40px -20px rgba(0,0,0,.7); }
.site-footer { background: var(--girasol) var(--noise); color: var(--ink); font-size: var(--step--1); }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2.2rem 1.5rem; padding-block: 3.5rem 2rem; }
.site-footer h2 { font-family: var(--hand); font-size: 1.4rem; font-weight: 400; letter-spacing: 0; margin-bottom: .7rem; }
.site-footer ul { list-style: none; padding: 0; display: grid; gap: .45rem; font-weight: 550; }
.site-footer a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.footer-brand { grid-column: 1 / -1; }
.footer-brand svg { height: 54px; width: auto; }
.footer-brand p { margin-top: 1rem; max-width: 34ch; font-weight: 500; }
.footer-big { font-size: clamp(4rem, 2rem + 13vw, 15rem); font-weight: 850; letter-spacing: -0.06em; line-height: .86; padding-top: .08em; font-stretch: 85%; padding-inline: var(--gutter); white-space: nowrap; overflow: hidden; margin-bottom: -.06em; user-select: none; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .8rem 2rem; padding-block: 1.2rem 2rem; border-top: 2px solid var(--ink); font-size: .8rem; font-weight: 550; }
.footer-bottom a { text-decoration: underline; text-underline-offset: 3px; }

/* Inner pages */
.page-head { position: relative; padding-top: clamp(2rem, 5vw, 5rem); padding-bottom: clamp(2rem, 4vw, 3.5rem); }
.page-head h1 { max-width: 14ch; }
.page-head .lead { margin-top: 1.2rem; max-width: 44ch; }
.page-head-row { display: grid; gap: 1.2rem; }
.crumbs { display: flex; flex-wrap: wrap; gap: .4rem; font-size: var(--step--1); color: var(--ink-3); margin-bottom: 1.2rem; list-style: none; padding: 0; font-weight: 550; }
.crumbs li + li::before { content: "→"; margin-right: .4rem; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }

.toolbar { position: sticky; top: var(--nav-h); z-index: 20; background: rgba(251,245,234,.96); border-block: 2px solid var(--ink); margin-bottom: clamp(2rem, 4vw, 3rem); transition: top .5s var(--ease-out); }
.has-hidden-header .toolbar { top: 0; }
.toolbar-inner { display: grid; gap: .3rem; padding-block: .6rem; }
.tabs { display: flex; gap: .5rem; overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--gutter) * -1); padding: .2rem var(--gutter); }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; min-height: 42px; display: inline-flex; align-items: center; gap: .35rem; padding: 0 .95rem; border-radius: var(--wobble); font-size: var(--step--1); font-weight: 650; box-shadow: inset 0 0 0 2px var(--ink); transition: transform .3s var(--ease-back), background-color .2s; }
.tab sup { font-size: .72em; font-variant-numeric: tabular-nums; }
.tab:hover { transform: rotate(-2deg); background: var(--girasol); }
.tab[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.tool-row { display: flex; gap: 1rem; align-items: center; }
.search { position: relative; flex: 1; }
.search svg { position: absolute; left: .2rem; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); }
.search input { width: 100%; min-height: 46px; padding: .5rem 0 .5rem 2rem; background: transparent; border: 0; font-size: var(--step-0); font-weight: 550; }
.search input:focus { outline: none; }
.sort { min-height: 44px; background: transparent; border: 0; font-weight: 650; font-size: var(--step--1); cursor: pointer; }
.results-note { font-family: var(--hand); font-size: 1.3rem; margin-bottom: 1.5rem; }
.empty-results { padding: 4rem 0; text-align: center; }

.product { display: grid; gap: clamp(2rem, 5vw, 5rem); padding-top: clamp(1.5rem, 3vw, 3rem); }
.p-gallery { display: grid; gap: .9rem; align-content: start; }
.p-main { position: relative; display: grid; place-items: center; background: var(--girasol) var(--noise); border-radius: var(--wobble); aspect-ratio: 1; padding: 10%; }
.p-main img { max-height: 100%; width: auto; max-width: 100%; object-fit: contain; border-radius: 3px; box-shadow: var(--shadow-up); transform: rotate(-2deg); transition: transform .6s var(--ease-back); }
.p-main:hover img { transform: rotate(1deg) scale(1.02); }
.p-main img.is-photo { transform: none; border-radius: 8px; }
.p-thumbs { display: flex; gap: .7rem; overflow-x: auto; scrollbar-width: none; padding: .3rem; }
.p-thumb { flex: none; width: 74px; height: 74px; border-radius: 10px; overflow: hidden; background: var(--paper-2); opacity: .75; transition: transform .3s var(--ease-back), opacity .2s; }
.p-thumb img { width: 100%; height: 100%; object-fit: cover; }
.p-thumb[aria-current="true"], .p-thumb:hover { opacity: 1; transform: rotate(-4deg); box-shadow: 0 0 0 3px var(--ink); }
.p-info { display: grid; gap: 1.2rem; align-content: start; }
.p-info .h-1 { max-width: 14ch; }
.p-by { font-weight: 550; color: var(--ink-2); }
.p-price { font-size: var(--step-3); font-weight: 800; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; line-height: 1; }
.p-stock { color: var(--ink-3); }
.field { display: grid; gap: .35rem; }
.field label { font-family: var(--hand); font-size: 1.2rem; line-height: 1; }
.field select, .field input, .field textarea { min-height: 50px; padding: .55rem .9rem; background: #fffdf8; border: 2px solid var(--ink); border-radius: var(--wobble-2); font-size: var(--step-0); font-weight: 550; }
.field select:focus, .field input:focus { outline: none; box-shadow: 4px 4px 0 var(--tomate); }
.p-buy { display: grid; gap: .8rem; }
.p-assure { list-style: none; padding: 1.1rem 1.2rem; display: grid; gap: .6rem; font-size: var(--step--1); background: var(--cielo) var(--noise); border-radius: var(--wobble-2); }
.p-assure li { display: flex; gap: .7rem; align-items: flex-start; font-weight: 500; }
.p-assure svg { width: 20px; height: 20px; flex: none; margin-top: .1rem; }
.ficha { display: grid; grid-template-columns: max-content 1fr; font-size: var(--step--1); }
.ficha dt, .ficha dd { padding: .75rem 0; border-bottom: 2px dotted var(--line); }
.ficha dt { font-family: var(--hand); font-size: 1.15rem; padding-right: 2rem; line-height: 1.2; }
.ficha dd { font-weight: 550; }
.p-desc { display: grid; gap: clamp(2rem, 5vw, 5rem); }

/* Cart */
.cart { position: fixed; inset: 0; z-index: 100; visibility: hidden; transition: visibility 0s .6s; }
.cart.is-open { visibility: visible; transition: none; }
.cart-scrim { position: absolute; inset: 0; background: rgba(29,24,20,.5); opacity: 0; transition: opacity .5s; }
.cart.is-open .cart-scrim { opacity: 1; }
.cart-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(460px, 100%); background: var(--paper) var(--noise); display: flex; flex-direction: column; transform: translateX(105%) rotate(2deg); transform-origin: top left; transition: transform .6s var(--ease-out); border-left: 2px solid var(--ink); }
.cart.is-open .cart-panel { transform: none; }
.cart-head { display: flex; align-items: center; justify-content: space-between; padding: 1rem var(--gutter); border-bottom: 2px solid var(--ink); background: var(--girasol); }
.cart-head h2 { font-size: var(--step-2); }
.cart-body { flex: 1; overflow-y: auto; padding: 0 var(--gutter); overscroll-behavior: contain; }
.cart-items { list-style: none; padding: 0; }
.ci { display: grid; grid-template-columns: 64px 1fr auto; gap: 1rem; padding: 1.1rem 0; border-bottom: 2px dotted var(--line); align-items: start; }
.ci img { width: 64px; border-radius: 3px; box-shadow: var(--shadow); transform: rotate(-3deg); }
.ci-t { font-weight: 700; line-height: 1.2; }
.ci-v { font-size: .82rem; color: var(--ink-3); margin-top: .2rem; }
.qty { display: inline-flex; align-items: center; margin-top: .6rem; border: 2px solid var(--ink); border-radius: var(--wobble); }
.qty button { width: 36px; height: 36px; display: grid; place-items: center; font-size: 1.1rem; font-weight: 700; }
.qty span { min-width: 1.6rem; text-align: center; font-variant-numeric: tabular-nums; font-weight: 700; }
.ci-p { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; display: grid; gap: .5rem; justify-items: end; }
.ci-x { font-size: .8rem; color: var(--ink-3); text-decoration: underline; min-height: 32px; font-weight: 500; }
.cart-empty { padding: 3rem 0; display: grid; gap: 1rem; justify-items: start; }
.cart-empty p { font-family: var(--hand); font-size: 2rem; line-height: 1.05; }
.cart-form { display: grid; gap: 1rem; padding: 1.4rem 0; }
.cart-foot { padding: 1.1rem var(--gutter) 1.4rem; border-top: 2px solid var(--ink); display: grid; gap: .8rem; }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; font-size: var(--step-2); font-weight: 800; letter-spacing: -0.03em; }
.cart-note { font-size: .82rem; color: var(--ink-3); line-height: 1.5; }

.toast { position: fixed; left: 50%; bottom: calc(1.2rem + env(safe-area-inset-bottom)); z-index: 120; display: flex; align-items: center; gap: .9rem; padding: .55rem .55rem .55rem 1.1rem; background: var(--ink); color: var(--paper); border-radius: var(--wobble); font-weight: 600; font-size: var(--step--1); transform: translate(-50%, 160%) rotate(-3deg); opacity: 0; visibility: hidden; max-width: calc(100% - 2rem); transition: transform .6s var(--ease-back), opacity .3s, visibility 0s .6s; box-shadow: 4px 5px 0 var(--tomate); }
.toast.is-on { transform: translate(-50%, 0) rotate(-1deg); opacity: 1; visibility: visible; transition: transform .6s var(--ease-back), opacity .3s; }
.toast button { min-height: 38px; padding: 0 .9rem; border-radius: var(--wobble); background: var(--girasol); color: var(--ink); font-weight: 700; white-space: nowrap; }
.has-mbar .toast { bottom: calc(5.4rem + env(safe-area-inset-bottom)); }
.has-mbar .site-footer { padding-bottom: 5rem; }
.m-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; gap: .6rem; padding: .6rem var(--gutter) calc(.7rem + env(safe-area-inset-bottom)); background: rgba(251,245,234,.97); border-top: 2px solid var(--ink); transform: translateY(110%); transition: transform .5s var(--ease-out); }
.m-bar.is-on { transform: translateY(0); }
.m-bar .btn { flex: 1; min-height: 48px; padding-inline: 1rem; font-size: var(--step--1); box-shadow: 2px 3px 0 var(--ink); }
.m-bar .cart-count { background: var(--girasol); color: var(--ink); }

.contact-list { list-style: none; padding: 0; display: grid; gap: .8rem; }
.contact-list li:nth-child(4n+1) > * { background: var(--girasol); }
.contact-list li:nth-child(4n+2) > * { background: var(--cielo); }
.contact-list li:nth-child(4n+3) > * { background: var(--rosa); }
.contact-list li:nth-child(4n+4) > * { background: #b9dcb0; }
.contact-list a, .contact-list div { display: grid; gap: .15rem; padding: 1.1rem 1.4rem; border-radius: var(--wobble-2); background-image: var(--noise); transition: transform .4s var(--ease-back); }
.contact-list a:hover { transform: rotate(-1deg) scale(1.01); }
.contact-list .l { font-family: var(--hand); font-size: 1.2rem; line-height: 1.1; }
.contact-list .v { font-size: clamp(1.25rem, .4rem + 4.2vw, 2.4rem); font-weight: 780; letter-spacing: -0.03em; line-height: 1.05; overflow-wrap: anywhere; }
.av-grid { display: grid; gap: clamp(3rem, 6vw, 5rem); }
.av { display: grid; gap: 1.6rem; align-items: center; }
.av-img { position: relative; display: block; transform: rotate(-1.5deg); transition: transform .5s var(--ease-back); }
.av:nth-child(even) .av-img { transform: rotate(1.5deg); }
.av-img:hover { transform: rotate(0) scale(1.02); }
.av-img img { width: 100%; border: 10px solid #fff; box-shadow: var(--shadow-up); border-radius: 4px; }
.play { position: absolute; left: 1.4rem; bottom: 1.4rem; display: inline-flex; align-items: center; gap: .6rem; padding: .6rem 1.1rem .6rem .7rem; border-radius: var(--wobble); background: var(--girasol); font-weight: 700; box-shadow: 3px 4px 0 var(--ink); }
.play svg { width: 26px; height: 26px; }
.credits { font-size: var(--step--1); color: var(--ink-3); display: grid; gap: .2rem; }
.wip { display: grid; gap: 1rem; }
.wip img { border: 10px solid #fff; box-shadow: var(--shadow-up); transform: rotate(var(--r, -2deg)); border-radius: 4px; }
.notfound { min-height: 70vh; display: grid; align-content: center; gap: 1.6rem; }
.taller-grid { display: grid; gap: clamp(2.4rem, 5vw, 4rem); }
.course { display: grid; gap: 1.2rem; }
.course-img { max-width: 500px; transform: rotate(var(--r, -2deg)); transition: transform .5s var(--ease-back); position: relative; }
.course:hover .course-img { transform: rotate(0); }
.course-img img { width: 100%; border-radius: 4px; box-shadow: var(--shadow-up); }
.course-img::before { content: ""; position: absolute; top: -12px; left: 50%; width: 26px; height: 26px; margin-left: -13px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ff8a73, var(--tomate) 60%, #a52a14); box-shadow: 0 6px 8px -2px rgba(0,0,0,.35); z-index: 2; }
.course dl { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.2rem; font-size: var(--step--1); }
.course dt { font-family: var(--hand); font-size: 1.15rem; line-height: 1.3; }
.course ul { padding-left: 1.1rem; display: grid; gap: .3rem; }
.steps { list-style: none; padding: 0; counter-reset: s; display: grid; gap: .8rem; margin-top: 2rem; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 3.2rem 1fr; gap: .1rem 1rem; padding: 1rem 1.2rem; border-radius: var(--wobble-2); box-shadow: inset 0 0 0 2px var(--line-ink); }
.steps li::before { content: counter(s); grid-row: span 2; width: 2.6rem; height: 2.6rem; border-radius: 50%; display: grid; place-items: center; background: var(--girasol); color: var(--ink); font-weight: 800; }
.steps strong { font-weight: 700; font-size: var(--step-1); letter-spacing: -0.02em; }
.steps span { color: var(--on-ink-2); font-size: var(--step--1); }
.publish-grid { display: grid; gap: clamp(2.4rem, 5vw, 5rem); }
.gallery { display: flex; gap: 1.4rem; overflow-x: auto; scroll-snap-type: x mandatory; padding: 1.4rem var(--gutter) 2rem; scrollbar-width: none; cursor: grab; }
.gallery::-webkit-scrollbar { display: none; }
.gallery.is-drag { cursor: grabbing; scroll-snap-type: none; }
.gallery figure { flex: none; width: clamp(280px, 70vw, 860px); scroll-snap-align: center; transform: rotate(var(--r, -1deg)); }
.gallery figure:nth-child(even) { --r: 1.2deg; }
.gallery .g-img { aspect-ratio: 1920 / 560; border: 8px solid #fff; box-shadow: var(--shadow-up); }
.gallery img { width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; }
.gallery figcaption { margin-top: .6rem; font-family: var(--hand); font-size: 1.15rem; }
.band { background: var(--ink) var(--noise); color: var(--on-ink); }

/* 7. Effects --------------------------------------------------- */
.js [data-reveal] { opacity: 0; transform: translateY(26px) rotate(-1deg); transition: opacity .8s var(--ease-out), transform .9s var(--ease-back); transition-delay: var(--d, 0s); }
.js [data-reveal].is-visible { opacity: 1; transform: none; }
.js .draw path { stroke-dasharray: var(--len, 1200); stroke-dashoffset: var(--len, 1200); }
.js .draw.is-drawn path { stroke-dashoffset: 0; transition: stroke-dashoffset 1.6s var(--ease-out) .2s; }
.js .loose { opacity: 0; translate: 0 -40px; }
.js .desk.is-in .loose { opacity: 1; translate: 0 0; transition: opacity .6s, translate .9s var(--ease-back), transform .5s var(--ease-back), filter .3s; transition-delay: var(--d, 0s); }
.reveal-safety [data-reveal], .reveal-safety .loose { opacity: 1 !important; transform: none; translate: none; }
.reveal-safety .draw path { stroke-dashoffset: 0 !important; }
@keyframes wiggle { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
.wiggle { animation: wiggle 2.6s ease-in-out infinite; }

@view-transition { navigation: auto; }

/* 8. Responsive ------------------------------------------------ */
@media (min-width: 540px) {
  .cart-label { display: inline; }
}
@media (min-width: 720px) {
  .books { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ages { grid-template-columns: repeat(3, 1fr); }
  .age a { min-height: 420px; }
  .pins, .taller-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
  .footer-brand { grid-column: auto; }
  .has-mbar .site-footer { padding-bottom: 0; }
  .av { grid-template-columns: 1.1fr 1fr; }
  .av:nth-child(even) .av-img { order: 2; }
  .m-bar { display: none; }
  .toast, .has-mbar .toast { bottom: 1.5rem; }
  .p-desc, .publish-grid { grid-template-columns: 1fr 1fr; }
  .contact-list { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 960px) {
  .nav-links { display: flex; }
  .menu-btn { display: none; }
  .hero-grid { grid-template-columns: 1fr 1.05fr; align-items: center; min-height: calc(100svh - var(--nav-h) - 3rem); }
  .desk { min-height: 600px; display: grid; align-content: center; }
  .books { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .flip-layout { grid-template-columns: 1.6fr 1fr; }
  .maker { grid-template-columns: 1fr 1.1fr; }
  .arq-grid { grid-template-columns: 1.1fr 1fr; }
  .faq-grid { grid-template-columns: .8fr 1.2fr; }
  .product { grid-template-columns: 1.05fr 1fr; }
  .p-gallery { position: sticky; top: calc(var(--nav-h) + 1.5rem); }
  .page-head-row { grid-template-columns: 1.3fr 1fr; gap: 3rem; align-items: end; }
  .final-inner { grid-template-columns: 1.4fr 1fr; align-items: end; }
  .path { gap: 1rem; }
}
@media (max-width: 719px) {
  .collage { grid-template-columns: 1fr; gap: 2rem; }
  .collage figure { grid-column: auto !important; grid-row: auto !important; margin: 0 !important; }
  .loose { --w: 92px !important; }
}

/* 9. Reduced motion (only intrusive) --------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .wiggle { animation: none; }
}
@media print { .site-header, .m-bar, .cart, .toast, .final { display: none !important; } }

/* Mobile hero: fewer loose covers, nothing over the copy */
@media (max-width: 959px) {
  .loose[data-slug="pitu-y-la-sandia"], .loose[data-slug="el-gigante"], .loose[data-slug="sol"], .hero > .doodle { display: none; }
  .desk { margin-top: 1.4rem; }
}
@media (max-width: 719px) {
  .path-line { display: none; }
}

/* =============================================================
   Cinematic hero: a mil trazos book opening, driven by scroll
   ============================================================= */
.cine { position: relative; margin-top: calc(var(--nav-h) * -1); background: #1d1814; color: #fff; }
.js .cine { height: 420vh; }
.cine-sticky { position: relative; height: 100svh; min-height: 560px; overflow: hidden; }
.js .cine-sticky { position: sticky; top: 0; }
.cine-poster, .cine-canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 55% 50%; }
.js .cine-poster { opacity: 0; transition: opacity .4s; }
.js .cine.no-frames .cine-poster { opacity: 1; }
.cine-shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(29,24,20,.4) 0%, rgba(29,24,20,0) 22%, rgba(29,24,20,0) 46%, rgba(29,24,20,.8) 100%); opacity: var(--shade, .9); }
.cine-text { position: absolute; left: var(--gutter); right: var(--gutter); bottom: clamp(5.5rem, 12vh, 8rem); max-width: var(--max); margin-inline: auto; display: grid; gap: 1rem; text-shadow: 0 2px 30px rgba(0,0,0,.45); }
.js .cine-text { opacity: 0; transform: translateY(24px); transition: opacity .5s var(--ease-out), transform .7s var(--ease-out); pointer-events: none; }
.js .cine-text.is-on { opacity: 1; transform: none; pointer-events: auto; }
.cine-text .mano { font-size: clamp(1.3rem, 1rem + 1vw, 1.9rem); color: var(--girasol); }
.cine-big { font-size: clamp(2.7rem, 1.2rem + 6.6vw, 7.6rem); font-weight: 820; letter-spacing: -0.05em; line-height: .9; font-stretch: 88%; max-width: 12ch; text-wrap: balance; color: #fff; }
.cine .lead { color: rgba(255,255,255,.9); max-width: 40ch; }
.cine .btn { box-shadow: 3px 4px 0 rgba(255,255,255,.85); }
.cine .btn--ghost { --bg: rgba(29,24,20,.35); --fg: #fff; box-shadow: inset 0 0 0 2px #fff, 3px 4px 0 rgba(255,255,255,.85); }
.cine-credit { font-size: var(--step--1); color: rgba(255,255,255,.78); display: inline-flex; gap: .4rem; align-items: center; width: fit-content; }
.cine-credit svg { width: 15px; }
.cine-credit:hover { color: #fff; text-decoration: underline; }
.cine-hint { position: absolute; left: 50%; bottom: 1.4rem; transform: translateX(-50%); display: grid; justify-items: center; gap: .2rem; color: #fff; text-shadow: 0 2px 16px rgba(0,0,0,.5); transition: opacity .4s; }
.cine-hint .mano { font-size: 1.25rem; }
.cine-hint svg { width: 18px; animation: hint 1.8s ease-in-out infinite; }
@keyframes hint { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(8px); } }
.cine.is-past-start .cine-hint { opacity: 0; }
.has-cine .site-header:not(.is-scrolled) { color: #fff; }
.has-cine .site-header:not(.is-scrolled) .brand path { fill: #fbf5ea; }
.has-cine .site-header:not(.is-scrolled) .brand text { fill: #1d1814; }
.has-cine .site-header:not(.is-scrolled) .icon-btn:hover { background: rgba(255,255,255,.14); }
.js .cine.no-frames { height: auto; }
.js .cine.no-frames .cine-sticky { position: relative; }
.js .cine.no-frames .t3 { opacity: 1; transform: none; pointer-events: auto; }
.js .cine.no-frames .t1, .js .cine.no-frames .t2, .js .cine.no-frames .cine-hint { display: none; }
.cine .t1, .cine .t2 { display: none; }
.js .cine .t1, .js .cine .t2 { display: grid; }
@media (prefers-reduced-motion: reduce) { .cine-hint svg { animation: none; } }
