/* Lalage · La mesa: layout. Paper components and blocks live in blocks.css.
   Surfaces: body[data-surface] sets the table; .band[data-role] sheets alternate on top of it.
   A = the other surface, B = blush, P = same surface as the table. */

:root { --gap: clamp(20px, 5.5vw, 80px); }

/* ---------- surfaces ---------- */
[data-surface=crema],
[data-surface=crema] .band[data-role=P],
[data-surface=coral] .band[data-role=A],
.band[data-role=B] {
	--mat: #F4EADB; --line: rgba(184, 66, 58, .22); --line2: rgba(184, 66, 58, .09);
	--on-mat: #38312E; --accent: #EA6A61; --accent-ink: #38312E; --tape: rgba(234, 106, 97, .55); --shadow: rgba(90, 50, 30, .28);
}
[data-surface=coral],
[data-surface=coral] .band[data-role=P],
[data-surface=crema] .band[data-role=A] {
	--mat: #EA6A61; --line: rgba(255, 253, 248, .3); --line2: rgba(255, 253, 248, .12);
	--on-mat: #211B19; --accent: #FFFDF8; --accent-ink: #B8423A; --tape: rgba(255, 248, 232, .75); --shadow: rgba(110, 30, 24, .38);
}
.band[data-role=B] { --mat: #EDDFDE; --line: rgba(184, 66, 58, .2); --line2: rgba(184, 66, 58, .08); --shadow: rgba(90, 50, 30, .26); }

body, .band {
	--paper-shadow: 0 8px 14px var(--shadow);
	background-color: var(--mat);
	background-image:
		linear-gradient(var(--line) 1px, transparent 1px),
		linear-gradient(90deg, var(--line) 1px, transparent 1px),
		linear-gradient(var(--line2) 1px, transparent 1px),
		linear-gradient(90deg, var(--line2) 1px, transparent 1px);
	background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
	color: var(--on-mat);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { overflow-x: clip; }
body { margin: 0; font-family: var(--f-type); font-size: 18px; line-height: 1.5; }
img { max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }
/* clip-path would cut the focus ring off the torn strips. */
.strip:focus-visible { clip-path: none; outline-offset: 3px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: #F9F8F6; padding: 10px 16px; text-decoration: none; }
.skip:focus { top: 12px; }
.wrap { max-width: 1360px; margin-inline: auto; padding-inline: var(--gap); }
.row { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; }

/* ---------- type ---------- */
.h1 { font-family: var(--f-display); font-weight: 400; font-size: clamp(54px, 7.8vw, 112px); line-height: .92; margin: 0; overflow-wrap: break-word; hyphens: auto; }
/* Titles next to a photo get less room: keep long words (MAÑANA COLLAGERA) whole. */
.work .h1 { font-size: clamp(44px, 5.4vw, 84px); }
.h2 { font-family: var(--f-display); font-weight: 400; font-size: clamp(42px, 5.3vw, 76px); line-height: .95; margin: 0; }
.h3 { font-family: var(--f-display); font-weight: 400; font-size: clamp(30px, 3.1vw, 44px); line-height: 1.02; margin: 6px 0 16px; }
.h3.xl { font-size: clamp(36px, 4.2vw, 60px); }
.h4 { font-family: var(--f-display); font-weight: 400; font-size: clamp(24px, 2.1vw, 30px); line-height: 1.05; margin: 4px 0 0; }
.h3 a, .h4 a { text-decoration: none; }
.h3 a:hover, .h4 a:hover { color: var(--mark); }
.typed { font-family: var(--f-type); margin: 0; }
.lead { font-size: clamp(18px, 1.55vw, 22px); line-height: 1.5; max-width: 34ch; margin: 0 0 10px; }
.date { font-size: 15px; color: var(--ink-soft); margin: 0; }
.date.onmat { color: var(--on-mat); margin: 40px 0 8px; }
.read { font-family: var(--f-read); font-size: clamp(19px, 1.55vw, 22px); line-height: 1.55; margin: 14px 0 18px; max-width: 62ch; }
.card .read { font-size: 19px; }
.more { font-size: 18px; color: var(--mark); text-underline-offset: 5px; text-decoration-thickness: 2px; }

/* ---------- strips ---------- */
.strip.sm { font-size: 18px; padding: 11px 16px 8px; }
.strip.big { font-size: clamp(24px, 2.2vw, 32px); padding: 18px 26px 13px; }
.strip:hover { transform: rotate(0deg) translateY(-2px); }
.strip.cur { box-shadow: inset 0 -5px 0 var(--mark); }
.pi.cur { box-shadow: inset 0 -5px 0 var(--coral); }

/* ---------- header (inner pages) ---------- */
.top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 18px 28px; max-width: 1520px; margin: 0 auto; padding: 30px var(--gap) 0; }
.topnav { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.topnav .strip { font-size: 18px; padding: 11px 15px 8px; }
/* The menu is only black and red strips with light text, at every width. */
.topnav .strip { background: var(--ink); color: #F9F8F6; }
.topnav .strip:nth-child(even) { background: var(--mark); }
.topnav .strip.cur { box-shadow: inset 0 -5px 0 #F9F8F6; }
/* On the front page the menu sits alone above the table, on the right. */
.top-home { justify-content: flex-end; padding-bottom: 4px; position: relative; z-index: 4; }
.top-home .topnav .strip { font-size: 20px; padding: 12px 18px 9px; }
.home-logo { display: block; flex: none; width: 84px; padding: 4px; border-radius: 50%; background: var(--paper); box-shadow: var(--paper-shadow); transform: rotate(-6deg); }
.home-logo img { display: block; width: 100%; height: auto; border-radius: 50%; }
a.home-logo:hover { transform: rotate(0deg); }
.top-home .home-logo { display: none; } /* wide screens: the big seal on the table takes its place */
.menu-toggle { display: none; }

/* ---------- the table (front page): a 1440×900 board scaled with the page ---------- */
.hero { position: relative; z-index: 3; container-type: inline-size; max-width: 1680px; margin: 0 auto; } /* above the first sheet, so cut-outs reaching it stay visible */
.stage { position: relative; height: min(62.5vw, 1050px); height: 62.5cqw; }
.stage .pos { position: absolute; margin: 0; left: calc(var(--x) * 100cqw / 1440); top: calc(var(--y) * 100cqw / 1440); width: calc(var(--w) * 100cqw / 1440); }
.stage .p-title { width: auto; }
/* The logo as a paper seal pinned to the table. */
.p-logo { aspect-ratio: 1; border-radius: 50%; background: var(--paper); padding: calc(16 * 100cqw / 1440); box-shadow: var(--paper-shadow), inset 0 0 0 calc(3 * 100cqw / 1440) rgba(184, 66, 58, .18); transform: rotate(var(--r, 0deg)); z-index: 2; }
.p-logo img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.p-logo .tape { top: -6%; }
.p-title { font-family: var(--f-display); font-weight: 400; font-size: calc(76 * 100cqw / 1440); line-height: .96; letter-spacing: -.01em; color: var(--on-mat); z-index: 1; }
.p-note { font-size: max(14px, calc(18 * 100cqw / 1440)); padding: 1.4cqw 1.5cqw; }
.p-work { font-size: max(11px, calc(14 * 100cqw / 1440)); padding: .7cqw; }
.p-work img { aspect-ratio: 3 / 4; object-fit: cover; }
.p-work .cap { padding-top: .6cqw; }
.hint { position: absolute; right: 24px; bottom: 14px; font-size: 14px; }
[data-drag], .stage .deco, .stage .p-note { cursor: grab; touch-action: none; user-select: none; -webkit-user-drag: none; }
[data-drag].dragging { cursor: grabbing; z-index: 9; transition: none; }
[data-drag] img { pointer-events: none; }

/* ---------- cut-outs: placed with custom properties from the template ---------- */
.cut { transform: rotate(calc(var(--r, 0deg) + var(--turn, 0deg))) scaleX(var(--flip, 1)); }
/* Hands that follow the scroll. The scissors point up-right in the image: +115deg points them down, -65deg up. */
[data-scroll=down] [data-turn=v] { --turn: 115deg; }
[data-scroll=up] [data-turn=v] { --turn: -65deg; }
[data-scroll=up] [data-turn=h] { --flip: -1; }
/* Swallows fly the way the page moves: facing left and diving going down, facing right and climbing going up. */
[data-scroll=down] [data-turn=bird] { --flip: -1 !important; --turn: -14deg; }
[data-scroll=up] [data-turn=bird] { --flip: 1 !important; --turn: -14deg; }
@media (prefers-reduced-motion: no-preference) {
	[data-turn] { transition: transform .45s cubic-bezier(.3, 1.4, .5, 1); }
}
.edge, .near { position: absolute; z-index: 2; pointer-events: none; top: var(--top, auto); right: var(--right, auto); bottom: var(--bottom, auto); left: var(--left, auto); width: var(--w, 160px); }
.side-cut { display: block; width: 140px; margin: 40px 0 0 60px; }

/* ---------- bands: torn sheets ---------- */
.band { position: relative; margin-top: 150px; padding-bottom: 130px; }
.band::before, .band::after { content: ""; position: absolute; left: 0; right: 0; height: 28px; clip-path: var(--torn); pointer-events: none; }
.band::before { top: -27px; background: var(--mat); z-index: 1; }
/* The torn edge's shadow: the same edge, darker, a few pixels higher. No filter on the band, so moving cut-outs never repaint it. */
.band::after { top: -32px; background: rgba(70, 35, 20, .13); }
.band + .band { margin-top: 0; }
main:has(> .band:last-child) + .band { margin-top: 0; }
.band.foot-band { padding-bottom: 60px; }

/* ---------- sections ---------- */
.sec { padding-top: 90px; position: relative; }
.sec.first { padding-top: 70px; }
.sechead { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 20px 60px; margin-bottom: 56px; }
.h2 + .prints, .h2 + .tickets { margin-top: 56px; }
.two { display: flex; flex-wrap: wrap; gap: 50px clamp(40px, 6vw, 90px); align-items: center; }
.two > .photo-col { flex: 1 1 380px; max-width: 520px; position: relative; }
.two > .photo-col.big { max-width: 640px; flex-basis: 440px; }
.two > .text-col { min-width: 0; flex: 1 1 360px; display: flex; flex-direction: column; align-items: flex-start; gap: 26px; }
.sec > .strip, .text-col > .strip { margin-top: 10px; }

/* prints */
.ph { display: flex; align-items: center; justify-content: center; aspect-ratio: 3 / 4; border: 2px dashed var(--rule); color: var(--ink-soft); }
.prints { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 50px 44px; align-items: start; margin-bottom: 56px; }
.prints > :nth-child(even) { margin-top: 44px; }
.prints.gallery { margin-top: 80px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 70px 56px; align-items: start; }
.wall .drop { margin-top: 50px; }

/* sheets and cards */
.sheet, .card, .spec, .postal { box-shadow: var(--paper-shadow); }
.sheet { position: relative; background: var(--paper); color: var(--ink); padding: clamp(28px, 3.5vw, 44px) clamp(24px, 4vw, 52px) 48px; transform: rotate(var(--r, 0deg)); }
.card { position: relative; background: var(--paper); color: var(--ink); padding: 26px 30px 30px; transform: rotate(var(--r, 0deg)); }
.card.tall { padding: 40px 32px 34px; }
.sheet.feat { display: flex; flex-wrap: wrap; gap: 30px 50px; align-items: center; justify-content: space-between; }
.sheet.feat .paper-text { flex: 1 1 420px; }
.paper-thumb { display: block; width: clamp(180px, 22vw, 300px); transform: rotate(5deg); }
.paper-thumb img { display: block; }
.blogrow { display: flex; flex-wrap: wrap; gap: 50px 64px; align-items: flex-start; }
.lead-post { flex: 1 1 520px; max-width: 760px; }
.lead-post .paper-thumb { position: absolute; right: -60px; top: -50px; width: clamp(130px, 13vw, 200px); }
.lead-post:has(.paper-thumb) { padding-right: clamp(60px, 10vw, 160px); }
.blogside { flex: 1 1 320px; display: flex; flex-direction: column; align-items: flex-start; gap: 30px; padding-top: clamp(0px, 8vw, 140px); }
.blogside .card { width: 100%; max-width: 440px; }
.blogside .shift { margin-left: clamp(0px, 4vw, 60px); }
.pager { margin-top: 70px; }

/* tickets: staggered like they were dropped on the table */
.tickets { display: flex; flex-direction: column; gap: 38px; max-width: 1040px; }
.tickets > :nth-child(3n+2) { margin-left: 34px; }
.tickets > :nth-child(3n) { margin-left: 68px; }

/* long reading */
.post-title { max-width: 18ch; }
.postwrap { display: flex; flex-wrap: wrap; gap: 40px 80px; align-items: flex-start; margin-top: 56px; }
.sheet.long { flex: 1 1 560px; max-width: 820px; padding: clamp(34px, 5vw, 64px) clamp(24px, 6vw, 76px) clamp(40px, 5vw, 70px); }
.entry.onmat, .intro { color: var(--on-mat); }
.entry.onmat a { color: inherit; }
.text-col .entry { font-size: clamp(19px, 1.5vw, 22px); max-width: 60ch; }
.intro { max-width: 60ch; margin-bottom: 50px; }
.side { flex: 1 1 260px; max-width: 360px; padding-top: 30px; }
.comments { margin-top: 60px; max-width: 820px; font-family: var(--f-read); }
.comments .comment-list { padding-left: 1.2em; }
.comments input:not([type=checkbox]):not([type=submit]), .comments textarea { width: 100%; font: inherit; border: 0; border-bottom: 2px solid var(--ink); background: transparent; padding: 6px 2px; }
.prevnext { justify-content: space-between; margin-top: 40px; }

/* specs */
.spec { background: var(--paper); color: var(--ink); margin: 0; padding: 8px 26px; transform: rotate(var(--r, 0deg)); width: 100%; max-width: 460px; font-size: 18px; }
.spec div { display: flex; justify-content: space-between; gap: 20px; padding: 13px 0; border-bottom: 2px dashed var(--rule); }
.spec div:last-child { border: 0; }
.spec dt { color: var(--ink-soft); }
.spec dd { margin: 0; text-align: right; }
.work { margin-top: 60px; align-items: flex-start; }

/* ctas */
.cta-row { gap: 30px 40px; }
.commission .pile { flex: 1 1 380px; max-width: 560px; position: relative; min-height: 420px; }
.commission .pile > .print { width: 60%; margin-left: 27%; }
.evento .note { flex: 0 1 520px; font-size: 19px; }
.evento .note .h3 { margin-top: 0; }
.past { padding-top: 110px; }

/* postal form */
.postal-wrap { position: relative; max-width: 1120px; }
.status { font-size: 19px; margin-bottom: 26px; }
.postal { display: grid; grid-template-columns: 1.25fr 1fr; background: var(--paper); color: var(--ink); padding: 46px 0; transform: rotate(var(--r, 0deg)); font-size: 18px; }
.pl { padding: 0 46px; border-right: 3px solid var(--ink); display: flex; flex-direction: column; }
.prr { padding: 120px 46px 0; display: flex; flex-direction: column; position: relative; }
.postal label { font-size: 16px; color: var(--ink-soft); margin: 18px 0 4px; }
.pl label { margin-top: 0; }
.postal input, .postal select, .postal textarea { font: inherit; color: var(--ink); background: transparent; border: 0; border-bottom: 2px solid var(--ink); padding: 8px 2px; border-radius: 0; width: 100%; }
.postal textarea { flex: 1; resize: vertical; line-height: 44px; padding: 0 2px; border-bottom: 0; min-height: 352px; background-image: repeating-linear-gradient(transparent 0 42px, var(--rule) 42px 44px); }
.postal button { align-self: flex-start; margin-top: 34px; --r: -2deg; font-size: 22px; }
.stamp { position: absolute; right: 46px; top: 0; width: 96px; padding: 8px; border: 3px dashed var(--mark); transform: rotate(4deg); }
.hp { position: absolute; left: -9999px; }

/* 404 */
.lost { min-height: 60vh; display: flex; flex-direction: column; gap: 30px; align-items: flex-start; padding-bottom: 60px; }

/* footer */
.foot { display: flex; flex-wrap: wrap; align-items: center; gap: 30px 36px; padding-top: 90px; }
.foot-logo, .foot-logo img { width: 96px; height: auto; border-radius: 50%; transform: rotate(-8deg); }
.foot .typed { font-size: 17px; line-height: 1.6; }
.footlinks { margin-left: auto; display: flex; flex-wrap: wrap; gap: 18px; }
.footlinks .strip { font-size: 19px; }
body[data-surface=coral] .foot-band img[data-logo] { outline: 6px solid var(--paper); outline-offset: -1px; }

@keyframes drop { from { opacity: 0; transform: translateY(-26px) rotate(calc(var(--r, 0deg) * -4)); } }

/* parallax target: translate composes with the rotate in transform */
[data-p] { translate: var(--px, 0) var(--py, 0); }
@media (prefers-reduced-motion: no-preference) {
	.strip, .print { transition: transform .18s ease; }
}

/* ---------- tablet & phone ---------- */
@media (max-width: 899.98px) {
	body { font-size: 17px; }
	.wide-only { display: none; }
	.stage { height: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 26px 18px; padding: 26px 20px 30px; }
	.stage .pos { position: relative; left: auto; top: auto; width: auto; }
	.stage .p-logo { display: none; }
	.p-title { grid-column: 1 / -1; font-size: min(6.4vw, 30px); min-width: 0; text-wrap: balance; }
	/* The hand can drift over the first sheet on phones: it must not catch taps meant for it. */
	.stage .deco { pointer-events: none; }
	.p-note { grid-column: 1 / -1; font-size: 17px; padding: 16px 18px; }
	.p-work { font-size: 13px; padding: 7px; }
	.p-work:nth-of-type(odd) { margin-top: 26px; }
	.stage .deco { display: none; }
	.stage .deco.keep { display: block; grid-column: 2; width: 70%; justify-self: end; margin-top: -40px; }
	.hint { display: none; }
	[data-drag], .stage .deco, .stage .p-note { cursor: pointer; touch-action: auto; user-select: auto; }
	.stage .p-logo { cursor: default; }
	.band { margin-top: 110px; padding-bottom: 90px; }
	.edge { width: 96px; top: -70px; }
	.prints { grid-template-columns: 1fr 1fr; gap: 34px 18px; }
	.prints > :nth-child(even) { margin-top: 30px; }
	.print { padding: 7px; font-size: 13px; }
	.tape { width: 70px; height: 22px; margin-left: -35px; top: -11px; }
	.tickets > * { margin-left: 0 !important; }
	.postal { grid-template-columns: 1fr; padding: 30px 0; }
	.pl { border-right: 0; border-bottom: 3px solid var(--ink); padding: 0 24px 26px; }
	.prr { padding: 30px 24px 0; }
	.stamp { position: static; width: 70px; align-self: flex-end; margin-bottom: -20px; }
	.postal textarea { min-height: 260px; }
	.lead-post .paper-thumb, .postwrap > .side { display: none; }
	.lead-post:has(.paper-thumb) { padding-right: 24px; }
	.commission .pile { min-height: 0; }
	.footlinks { margin-left: 0; }
	.top { padding-top: 20px; }
	.top-home { justify-content: flex-start; flex-wrap: nowrap; align-items: flex-start; gap: 14px; }
	.home-logo, .top-home .home-logo { display: block; width: 74px; }
	.topnav .strip { font-size: 16px; padding: 10px 12px 7px; }
	/* Phones: one "Menú" strip; tapping it drops the menu strips under it, like paper falling on the table. */
	.top { flex-wrap: nowrap; align-items: center; position: relative; z-index: 6; }
	.top-home { justify-content: space-between; }
	.js .menu-toggle { display: inline-block; margin-left: auto; font-size: 20px; padding: 12px 20px 9px; --r: 2deg; }
	.js .menu-toggle::after { content: " ↓"; content: " ↓" / ""; } /* decorative: aria-expanded tells the state */
	.js .menu-toggle[aria-expanded=true]::after { content: " ↑"; content: " ↑" / ""; }
	.js .topnav { display: none; position: absolute; top: calc(100% + 10px); right: var(--gap); flex-direction: column; align-items: flex-end; gap: 12px; }
	/* Open: the strips lie on a sheet of blush paper, and the page behind dims. */
	.js .top.open .topnav {
		display: flex; left: var(--gap); align-items: stretch; gap: 14px; padding: 26px 22px 30px;
		background-color: var(--blush);
		background-image: linear-gradient(rgba(184, 66, 58, .16) 1px, transparent 1px), linear-gradient(90deg, rgba(184, 66, 58, .16) 1px, transparent 1px);
		background-size: 24px 24px;
		box-shadow: 0 14px 30px rgba(40, 20, 15, .35);
		transform: rotate(-1deg);
	}
	.js .top.open .topnav .strip { align-self: center; }
	.js .top.open::before { content: ""; position: fixed; inset: 0; background: rgba(56, 49, 46, .45); z-index: -1; }
	.js .topnav .strip { font-size: 20px; padding: 12px 18px 9px; }
	@media (prefers-reduced-motion: no-preference) {
		.js .top.open .topnav .strip { animation: drop .32s cubic-bezier(.3, 1.5, .5, 1) backwards; }
		.js .top.open .topnav .strip:nth-child(2) { animation-delay: .04s; }
		.js .top.open .topnav .strip:nth-child(3) { animation-delay: .08s; }
		.js .top.open .topnav .strip:nth-child(4) { animation-delay: .12s; }
		.js .top.open .topnav .strip:nth-child(5) { animation-delay: .16s; }
		.js .top.open .topnav .strip:nth-child(n+6) { animation-delay: .2s; }
	}
}
@media (max-width: 480px) {
	.grid3 { gap: 50px; }
	.sechead { margin-bottom: 40px; }
	.strip { font-size: 20px; }
}
