/* FIESTAS DE LOS JUEGOS VIRALES · the programme. Four inks on coated paper, a biro and a rubber stamp. */
@font-face { font-family: 'Ultra'; src: url('fonts/Ultra.woff2') format('woff2'); font-display: block; }
@font-face { font-family: 'Archivo'; src: url('fonts/Archivo-var.woff2') format('woff2'); font-weight: 400 900; font-stretch: 62% 100%; font-display: swap; }
@font-face { font-family: 'Archivo'; src: url('fonts/Archivo-Italic-var.woff2') format('woff2'); font-weight: 400 700; font-stretch: 75% 100%; font-style: italic; font-display: swap; }
@font-face { font-family: 'Biro'; src: url('fonts/NothingYouCouldDo.woff2') format('woff2'); font-display: swap; }

:root {
  --red: #E3262B; --red-deep: #B8141C; --yellow: #FFD02E; --green: #00874A; --blue: #1B4DA1;
  --ink: #1D1A17; --ink-2: #4A433C; --paper: #FFFEFA; --paper-2: #F3F0E8;
  --biro: #1C3FB7; --stamp: #D3202A;
  --slab: 'Ultra', 'Rockwell Extra Bold', Rockwell, 'Clarendon', Georgia, serif;
  --sans: 'Archivo', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --hand: 'Biro', 'Bradley Hand', 'Segoe Print', 'Comic Sans MS', cursive;
  --gut: clamp(18px, 5vw, 56px);
  --flag-h: clamp(62px, 15vw, 96px);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 12px; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 17px/1.5 var(--sans); font-stretch: 100%;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
html.js body { opacity: 0; animation: reveal 0s 1.6s forwards; }
html.ready body { opacity: 1; animation: none; }
@keyframes reveal { to { opacity: 1; } }
img { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--biro); outline-offset: 3px; }
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

.skip {
  position: absolute; left: 12px; top: -80px; z-index: 20; padding: 12px 16px;
  background: var(--paper); color: var(--ink); font-weight: 700; text-decoration: none;
  box-shadow: 3px 3px 0 var(--ink);
}
.skip:focus { top: 12px; }

/* ── the booklet: a cover and the inner pages; on a wide screen the cover stays open on the left ── */
.booklet { min-height: 100vh; }
@media (min-width: 1024px) {
  .booklet { display: grid; grid-template-columns: minmax(400px, 42%) 1fr; align-items: start; }
  .booklet > .cover { position: sticky; top: 0; height: 100vh; height: 100dvh; overflow: hidden auto; scrollbar-width: none; }
  .booklet > .cover::-webkit-scrollbar { display: none; }
}

/* ── the cover ── */
.cover {
  position: relative; background: var(--red); color: #fff; container-type: inline-size;
  padding-top: var(--flag-h);
  background-image: radial-gradient(rgba(0, 0, 0, .07) 1px, transparent 1.2px);
  background-size: 5px 5px;
}
.bunting { position: absolute; inset: 0 0 auto 0; width: 100%; height: calc(var(--flag-h) + 12px); overflow: hidden; pointer-events: none; }
.bunting .str { fill: none; stroke: var(--ink); stroke-width: 1.6; }
.bunting .flag { transform-box: fill-box; transform-origin: 50% 0; }
.bunting .flag path { stroke: rgba(29, 26, 23, .35); stroke-width: .8; stroke-linejoin: round; }
.bunting .flag .fold { fill: none; stroke: rgba(29, 26, 23, .16); stroke-width: 3; stroke-linecap: round; }

.cover-in {
  position: relative; display: flex; flex-direction: column;
  padding: 6px var(--gut) clamp(30px, 7vw, 48px);
}
@media (min-width: 1024px) { .cover-in { min-height: calc(100dvh - var(--flag-h)); } }

.cover-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 clamp(10px, 3vw, 22px); }
.lang, .to-salon {
  min-height: 44px; margin: 0; padding: 10px 14px 9px; display: inline-flex; align-items: center; gap: 7px; text-decoration: none;
  border: 0; border-radius: 2px; background: var(--paper); color: var(--ink); cursor: pointer;
  font: 700 13px/1 var(--sans); font-stretch: 85%; letter-spacing: .08em; text-transform: uppercase;
  box-shadow: 3px 3px 0 var(--ink); transition: transform .18s var(--ease-out), box-shadow .18s var(--ease-out);
}
.lang:hover, .to-salon:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.lang:active, .to-salon:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.lang:focus-visible, .to-salon:focus-visible { outline-color: var(--yellow); }
.to-salon svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; margin: -2px 0; }

/* the masthead is set like a poster: every line justified to the same measure (main.js fits the sizes) */
.mast { margin: 0; font-weight: 400; }
.mast-big, .mast-de { display: block; white-space: nowrap; }
.mast-big {
  font: 400 17cqi/.84 var(--slab); color: var(--yellow); text-transform: uppercase;
  text-shadow: .055em .055em 0 var(--ink);
  margin-left: -.02em;
}
.mast-de {
  margin-top: .3em; font: 800 8.2cqi/1 var(--sans); font-stretch: 62%;
  text-transform: uppercase; letter-spacing: .01em;
}
.dates {
  display: flex; align-items: center; gap: 14px; margin: clamp(12px, 3vw, 18px) 0 0;
  font: 400 clamp(18px, 5cqi, 30px)/1 var(--slab); color: var(--yellow); text-transform: uppercase;
  text-shadow: .06em .06em 0 var(--ink);
}
.dates::after { content: ''; flex: 1; height: 5px; background: var(--yellow); box-shadow: 2px 2px 0 var(--ink); }
.blurb { margin: clamp(16px, 4vw, 24px) 0 0; max-width: 32ch; font: 500 clamp(17px, 4.6cqi, 21px)/1.42 var(--sans); }

/* the contents, only where the cover stays open */
.index { display: none; }
@media (min-width: 1024px) {
  .index { display: block; margin-top: auto; padding-top: 36px; }
  .index ol { list-style: none; margin: 0; padding: 0; border-top: 2px solid #fff; }
  .index a {
    display: grid; grid-template-columns: 7.4em 1fr auto; align-items: baseline; gap: 12px;
    position: relative; padding: 7px 2px 6px; border-bottom: 1px dashed rgba(255, 255, 255, .55); text-decoration: none;
    font: 500 15px/1.2 var(--sans); transition: background-color .15s, color .15s;
  }
  .index a:hover { background: rgba(255, 255, 255, .12); }
  .index a[aria-current] { background: var(--red-deep); }
  .index a[aria-current]::before {
    content: ''; position: absolute; left: -20px; top: 50%; width: 12px; height: 16px; margin-top: -8px;
    background: var(--yellow); clip-path: polygon(0 0, 100% 50%, 0 100%);
  }
  .index a:focus-visible { outline-color: var(--yellow); outline-offset: 1px; }
  .index .ix-t { font-weight: 800; font-stretch: 75%; text-transform: uppercase; letter-spacing: .02em; }
  .index .ix-h { font-variant-numeric: tabular-nums; }
  .index .ix-tick { color: var(--yellow); font-family: var(--hand); font-size: 18px; line-height: 0; margin-left: 4px; }
}

/* ── the inner pages ── */
.pages { position: relative; min-width: 0; padding: clamp(30px, 7vw, 64px) var(--gut) 0; outline: none; }
.pages > .prog-h, .days { max-width: 760px; margin-inline: auto; }
.prog-h {
  position: relative; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 18px;
  padding-bottom: 12px; margin-bottom: clamp(28px, 6vw, 44px); border-bottom: 7px double var(--ink);
}
.prog-h h2 { margin: 0; font: 400 clamp(29px, 8vw, 50px)/1 var(--slab); text-transform: uppercase; letter-spacing: -.005em; text-wrap: balance; }
/* without the open cover, the contents fold into a strip of dates: one pennant per day, in its ink */
.strip { flex: 1 0 100%; margin-top: clamp(10px, 3vw, 16px); }
.strip ol { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; }
.strip a {
  --c: var(--red); --on: #fff; display: grid; place-items: center; min-height: 46px; padding-bottom: 7px;
  background: var(--c); color: var(--on); font: 400 clamp(16px, 4.4vw, 24px)/1 var(--slab); text-decoration: none;
  font-variant-numeric: tabular-nums; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 8px), 0 100%);
}
.strip a:focus-visible { clip-path: none; outline-offset: 2px; }
@media (hover: hover) { .strip a:hover { filter: brightness(1.08); } }
@media (min-width: 1024px) { .strip { display: none; } }
.biro { font-family: var(--hand); color: var(--biro); font-weight: 400; line-height: 1.15; }
.been { margin: 0; font-size: clamp(21px, 5.4vw, 26px); transform: rotate(-4deg); transform-origin: 0 50%; }

/* a day: its ribbon, then the act. Each day prints in one of the four inks */
.act { --c: var(--red); --on: #fff; position: relative; margin: 0 0 clamp(64px, 13vw, 104px); scroll-margin-top: 16px; }
.act.ink-blue, .strip .ink-blue { --c: var(--blue); }
.act.ink-green, .strip .ink-green { --c: var(--green); }
.act.ink-yellow, .strip .ink-yellow { --c: var(--yellow); --on: var(--ink); }
.ribbon {
  display: flex; align-items: center; gap: 12px; margin: 0 0 clamp(16px, 4vw, 22px); padding: 9px 44px 7px 14px;
  background: var(--c); color: var(--on); font: 400 clamp(19px, 5vw, 26px)/1 var(--slab); text-transform: uppercase;
  clip-path: polygon(0 0, 100% 0, calc(100% - 22px) 50%, 100% 100%, 0 100%);
}

.act-body { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; }
.hour {
  position: relative; grid-row: 1; align-self: baseline; padding-top: .18em;
  font: 400 clamp(19px, 5vw, 27px)/1 var(--slab); color: var(--red); white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.act h3 {
  grid-row: 1; margin: 0; font: 900 clamp(30px, 9.4vw, 58px)/.92 var(--sans); font-stretch: 68%;
  text-transform: uppercase; letter-spacing: -.004em; text-wrap: balance;
}
.act .what { grid-column: 1 / -1; margin: 10px 0 0; font: 700 17px/1.35 var(--sans); font-stretch: 90%; text-wrap: pretty; }
.act .what em { display: block; margin-top: 2px; font-weight: 500; font-stretch: 100%; color: var(--ink-2); }
.act .went { grid-column: 1 / -1; margin: 8px 0 0; font-size: 22px; transform: rotate(-2.5deg); transform-origin: 0 50%; }
.act .went[hidden] { display: none; }
.stage { grid-column: 1 / -1; position: relative; margin-top: 18px; }
.photo {
  display: block; position: relative; aspect-ratio: 1200 / 630; overflow: hidden;
  background: var(--paper-2); border: 2px solid var(--ink);
}
.photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease-out), filter .6s var(--ease-out); }
.photo:hover img { transform: scale(1.025); filter: saturate(1.08); }
.act .pitch { grid-column: 1 / -1; margin: 40px 0 0; max-width: 62ch; font-size: 18px; line-height: 1.5; text-wrap: pretty; }
.act .meta { grid-column: 1 / -1; margin: 12px 0 0; font: 500 15px/1.45 var(--sans); color: var(--ink-2); }
.act .meta b { font-weight: 800; font-stretch: 72%; letter-spacing: .04em; text-transform: uppercase; color: var(--ink); margin-right: .35em; }
.act .note { grid-column: 1 / -1; margin: 4px 0 0; font: italic 500 15px/1.45 var(--sans); color: var(--ink-2); }

@media (min-width: 700px) {
  .act-body { grid-template-columns: 8.5rem minmax(0, 1fr); column-gap: 22px; }
  .hour { justify-self: end; text-align: right; }
  .act .what, .act .went, .stage, .act .pitch, .act .meta, .act .note { grid-column: 2; }
}

/* the pennant: «¡Allá voy!» */
.go {
  position: absolute; right: -8px; bottom: -24px; z-index: 2; display: block; text-decoration: none;
  filter: drop-shadow(3px 3px 0 var(--ink)); transform-origin: 0 50%;
  transition: transform .2s var(--ease-out), filter .2s var(--ease-out);
}
.go span {
  display: block; padding: 13px 44px 12px 20px; background: var(--c); color: var(--on);
  font: 400 clamp(17px, 4.4vw, 21px)/1 var(--slab); text-transform: uppercase; white-space: nowrap;
  clip-path: polygon(0 0, calc(100% - 26px) 0, 100% 50%, calc(100% - 26px) 100%, 0 100%);
}
.go:hover { transform: translate(-1px, -2px) rotate(-1.5deg); filter: drop-shadow(4px 5px 0 var(--ink)); }
.go:active { transform: translate(2px, 2px); filter: drop-shadow(1px 1px 0 var(--ink)); }
.go:focus-visible { outline: 3px solid var(--biro); outline-offset: 5px; }

/* the pen: a ring round the hour of every act you went to, and a stamp when you finished it */
.ring { position: absolute; left: -12px; top: -10px; width: calc(100% + 24px); height: calc(100% + 16px); overflow: visible; pointer-events: none; }
@media (min-width: 700px) { .ring { left: -14px; width: calc(100% + 26px); } }
.ring path { fill: none; stroke: var(--biro); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ring.pend path, .ring.draw path { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); }
.ring.draw path { animation: pen 1.1s cubic-bezier(.45, .05, .35, 1) .35s forwards; }
@keyframes pen { to { stroke-dashoffset: 0; } }
/* the note is written left to right after the ring closes; the stamp comes down last */
.went.pend, .been.pend { clip-path: inset(0 100% 0 0); }
.went.write { animation: write .9s cubic-bezier(.5, 0, .4, 1) 1.25s both; }
.been.write { animation: write .9s cubic-bezier(.5, 0, .4, 1) .3s both; }
@keyframes write { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.stamp {
  position: absolute; left: 14px; top: 12px; z-index: 1; padding: 6px 12px 4px;
  border: 3px solid var(--stamp); border-radius: 4px; color: var(--stamp); background: rgba(255, 254, 250, .78);
  font: 400 clamp(15px, 3.8vw, 19px)/1 var(--slab); text-transform: uppercase; letter-spacing: .02em;
  transform: rotate(-9deg); mix-blend-mode: multiply;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='60'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.2 1.9'/%3E%3C/filter%3E%3Crect width='120' height='60' filter='url(%23n)'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='60'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.2 1.9'/%3E%3C/filter%3E%3Crect width='120' height='60' filter='url(%23n)'/%3E%3C/svg%3E");
}
.stamp[hidden] { display: none; }
.stamp.pend { opacity: 0; }
.stamp.thunk { animation: thunk .42s cubic-bezier(.5, 0, .75, 0) 2.2s both; }
@keyframes thunk {
  0% { opacity: 0; transform: rotate(-16deg) scale(1.9); }
  80% { opacity: 1; transform: rotate(-8deg) scale(.96); }
  100% { opacity: 1; transform: rotate(-9deg) scale(1); }
}

/* ── the adverts: every shop brought its own ad, so every ad is set differently ── */
.ad { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 18px; max-width: 540px; margin: 0 auto clamp(64px, 13vw, 104px); padding: 20px 22px; }
.ad svg { width: clamp(56px, 15vw, 76px); height: auto; overflow: visible; }
.ad .nm, .ad p { margin: 0; }
.ad .nm { display: block; }
.ad p { text-wrap: pretty; }
@media (max-width: 379px) { .ad { grid-template-columns: minmax(0, 1fr); gap: 12px; } }
.ad-cafe { background: var(--ink); color: #fff; outline: 2px dashed rgba(255, 255, 255, .7); outline-offset: -9px; }
.ad-cafe .nm { font: 900 clamp(24px, 6.6vw, 34px)/1 var(--sans); font-stretch: 62%; text-transform: uppercase; letter-spacing: .05em; }
.ad-cafe p { margin-top: 6px; font: italic 500 16px/1.4 var(--sans); }
.ad-cafe p + p { margin-top: 2px; color: var(--yellow); }
.ad-optica { background: var(--paper); color: var(--blue); border: 7px double var(--blue); }
.ad-optica .nm { font: italic 700 clamp(27px, 7.4vw, 38px)/1 var(--sans); font-stretch: 100%; letter-spacing: -.01em; }
.ad-optica .nm span { display: block; margin-bottom: 4px; font: normal 600 12px/1 var(--sans); letter-spacing: .32em; text-transform: uppercase; }
.ad-optica p { margin-top: 6px; font: 500 16px/1.4 var(--sans); color: var(--ink); }
.ad-churros { background: var(--yellow); color: var(--ink); border: 4px solid var(--red); border-radius: 22px; box-shadow: 5px 5px 0 var(--ink); }
.ad-churros .nm { font: 400 clamp(23px, 6.4vw, 32px)/1.02 var(--slab); color: var(--red); text-transform: uppercase; text-shadow: .05em .05em 0 var(--ink); }
.ad-churros p { margin-top: 8px; font: 700 16px/1.35 var(--sans); }
.ad-tape { background: var(--green); color: #fff; box-shadow: inset 0 0 0 6px var(--green), inset 0 0 0 8px #fff; padding: 24px 26px; }
.ad-tape .nm { font: 900 clamp(22px, 6vw, 30px)/1 var(--sans); font-stretch: 100%; letter-spacing: -.012em; text-transform: uppercase; color: var(--yellow); }
.ad-tape p { margin-top: 8px; font: 800 15px/1.35 var(--sans); font-stretch: 70%; letter-spacing: .05em; text-transform: uppercase; color: #fff; }
.ad-tape p + p { margin-top: 2px; color: #fff; font: italic 500 16px/1.4 var(--sans); letter-spacing: 0; text-transform: none; }

/* ── the mayor's letter, the programme's centrefold ── */
.saluda { max-width: 640px; margin: 0 auto clamp(64px, 13vw, 104px); padding: clamp(26px, 6vw, 40px) 0; border-block: 7px double var(--ink); }
.saluda h3 { margin: 0 0 18px; font: 400 clamp(29px, 8vw, 46px)/1 var(--slab); text-transform: uppercase; text-wrap: balance; }
.saluda p { margin: 0 0 14px; max-width: 62ch; font-size: 18px; line-height: 1.58; text-wrap: pretty; }
.saluda p:first-of-type { font-style: italic; font-weight: 600; }
.saluda p:nth-of-type(2)::first-letter {
  float: left; margin: .06em .1em 0 0; font: 400 3.5em/.8 var(--slab); color: var(--red); text-shadow: .05em .05em 0 var(--ink);
}
.saluda .bye { margin-top: 22px; font-weight: 800; }
.saluda .sign { display: flex; align-items: flex-end; gap: 6px; margin: 4px 0 0; }
.saluda .sign svg { width: 150px; height: 58px; overflow: visible; }
.saluda .sign svg path { fill: none; stroke: var(--biro); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.saluda .sign span { font-size: 24px; transform: rotate(-3deg); }

/* ── the back cover ── */
.back {
  position: relative; margin: 0 calc(-1 * var(--gut)); padding: calc(var(--flag-h) + 18px) var(--gut) calc(34px + env(safe-area-inset-bottom));
  background: var(--red); color: #fff; container-type: inline-size;
  background-image: radial-gradient(rgba(0, 0, 0, .07) 1px, transparent 1.2px); background-size: 5px 5px;
}
.back > * { max-width: 760px; margin-inline: auto; }
.back .bunting { max-width: none; }
.back .fin { margin-block: 0 22px; font: 400 10.4cqi/.9 var(--slab); color: var(--yellow); text-transform: uppercase; text-shadow: .055em .055em 0 var(--ink); white-space: nowrap; }
.back ul { list-style: none; margin-block: 0; padding: 14px 0 0; border-top: 2px solid #fff; display: grid; gap: 6px; }
.back li { font: 500 14px/1.45 var(--sans); max-width: 70ch; }
.back .up { margin-block: 14px 0; }
.back .top { display: inline-flex; align-items: center; min-height: 44px; font: 700 15px/1 var(--sans); color: #fff; text-underline-offset: 4px; }
.back .top:focus-visible, .back a:focus-visible { outline-color: var(--yellow); }

/* the spread's fold: both pages darken a touch as they run into the staples */
@media (min-width: 1024px) {
  .pages { background: linear-gradient(90deg, rgba(29, 26, 23, .13), rgba(29, 26, 23, .04) 7px, rgba(29, 26, 23, 0) 28px) no-repeat; }
  .back {
    background-image: linear-gradient(90deg, rgba(0, 0, 0, .2), rgba(0, 0, 0, 0) 24px), radial-gradient(rgba(0, 0, 0, .07) 1px, transparent 1.2px);
    background-size: 100% 100%, 5px 5px;
  }
  .booklet > .cover {
    background-image: linear-gradient(270deg, rgba(0, 0, 0, .2), rgba(0, 0, 0, 0) 22px), radial-gradient(rgba(0, 0, 0, .07) 1px, transparent 1.2px);
    background-size: 100% 100%, 5px 5px;
  }
}

.nojs { max-width: 760px; margin: 0 auto 40px; font-size: 18px; }
.nojs a { font-weight: 800; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .ring.draw path, .ring.pend path { stroke-dashoffset: 0; }
  .went.pend, .been.pend { clip-path: none; }
  .stamp.pend { opacity: 1; }
}
