:root {
  --paper: #F2EEE3;
  --ink: #0E0E0E;
  --red: #FF2A00;
  --blue: #2B00FF;
  --pink: #FF4FD8;
  --lime: #C6FF00;
  --yellow: #FFE600;
  --accent: var(--red);

  /* page palette: swapped by the PAINT button (data-paint on <html>) */
  --bg: var(--blue);
  --fg: var(--lime);
  --hi: var(--pink);
  --hi2: var(--yellow);
  /* second block (the pile) + the two strips that frame it */
  --bg2: var(--pink); --fg2: var(--ink); --hi3: var(--blue);
  --strip1: var(--lime); --strip2: var(--yellow);

  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --pixel: "Tiny5", ui-monospace, monospace; /* pixel face with an open C (Pixelify's C read as an O) */
  --deva: "Yatra One", serif;
}
[data-paint="cream"] { --bg: var(--paper); --fg: var(--ink); --hi: var(--red); --hi2: var(--blue);
  --bg2: var(--yellow); --fg2: var(--ink); --hi3: var(--red); --strip1: var(--lime); --strip2: var(--pink); }
[data-paint="red"] { --bg: var(--red); --fg: var(--yellow); --hi: var(--paper); --hi2: var(--ink);
  --bg2: var(--paper); --fg2: var(--ink); --hi3: var(--red); --strip1: var(--lime); --strip2: var(--pink); }
[data-paint="pink"] { --bg: var(--pink); --fg: var(--ink); --hi: var(--lime); --hi2: var(--blue);
  --bg2: var(--blue); --fg2: var(--lime); --hi3: var(--yellow); --strip1: var(--lime); --strip2: var(--pink); }
[data-paint="lime"] { --bg: var(--lime); --fg: var(--blue); --hi: var(--red); --hi2: var(--ink);
  --bg2: var(--blue); --fg2: var(--lime); --hi3: var(--pink); --strip1: var(--pink); --strip2: var(--yellow); }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--ink); overflow-x: clip; } /* ink shows on over-scroll bounce; tilted strips overhang the edges, so clip — never pan sideways */
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--display);
  transition: background .4s, color .4s;
  overflow-x: clip;
}
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
::selection { background: var(--lime); color: var(--ink); }

/* film grain over everything */
.grain {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 90;
  opacity: .14;
  transform: translateZ(0); /* own layer, painted once */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* cursor blob (fine pointers only) */
.cursor {
  position: fixed; left: 0; top: 0; z-index: 100;
  width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border-radius: 50%;
  background: var(--lime);
  mix-blend-mode: difference;
  pointer-events: none;
  display: grid; place-items: center;
  transition: width .25s, height .25s, margin .25s;
}
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

/* top bar */
.bar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 16px;
  padding: 10px 20px;
  font: 500 14px/1 var(--pixel);
  background: var(--ink); color: var(--paper);
}
.logo { display: flex; align-items: center; gap: 6px; text-decoration: none; font-weight: 700; color: var(--lime); }
.logo img { width: 16px; height: 16px; margin-block: -2px; border-radius: 50%; object-fit: cover; transition: rotate .4s cubic-bezier(.2, .9, .3, 1.6); }
.logo:hover img { rotate: -14deg; }
.bar-mid { margin-left: auto; }
.bar-clock b { color: var(--pink); font-weight: 500; font-variant-numeric: tabular-nums; }
.bar-cta {
  text-decoration: none; background: var(--red); color: var(--paper);
  padding: 6px 10px; border-radius: 99px;
  white-space: nowrap; flex: none; /* "READ ↓" never splits onto two lines */
}
.bar-cta:hover { background: var(--lime); color: var(--ink); }
.paint {
  display: flex; align-items: center; gap: 8px;
  font: 600 14px/1 var(--pixel);
  padding: 5px 6px 5px 10px; border-radius: 99px;
  border: 1px solid #444; background: none; color: var(--paper);
}
.paint i { width: 18px; height: 18px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 0 0 3px var(--fg); }
.paint:hover { border-color: var(--paper); }
.paint:hover i { rotate: 180deg; transition: rotate .3s; }

/* hero */
.hero {
  position: relative;
  min-height: calc(100svh - 34px);
  padding: 3vw 20px 40px;
  overflow: hidden;
  display: flex; flex-direction: column; justify-content: center;
}
.hero-type {
  position: relative; z-index: 2;
  margin: 0;
  font-weight: 800;
  font-variation-settings: "wdth" 75, "opsz" 96;
  line-height: .78;
  letter-spacing: -.04em;
}
.hero-type .w1 {
  display: block;
  width: max-content;
  font-size: 30vw; /* app.js refits this to the full width */
  white-space: nowrap;
}
.hero-type { pointer-events: none; } /* let hovers/clicks reach the landmarks behind the wordmark… */
.hero-type .w1 span { position: relative; pointer-events: auto; } /* …but keep the letter hover */
/* the tight line-height leaves each letter's box shorter than the glyph; this invisible pad covers the
   whole glyph (plus the lift), so hovering its bottom edge can't flicker in and out */
.hero-type .w1 span::after { content: ""; position: absolute; inset: -.15em -.02em -.3em; }
.hero-type .w1 span { display: inline-block; animation: drop .8s cubic-bezier(.2, .9, .3, 1.3) backwards; animation-delay: calc(var(--i) * 80ms); }
.hero-type .w1 i { display: inline-block; font-style: normal; -webkit-text-stroke: .03em var(--bg); paint-order: stroke fill; transition: color .2s, translate .25s cubic-bezier(.2, .9, .3, 1.6); } /* same paint-coloured outline as the "se", so it cuts cleanly over the collage */
.hero-type .w1 span:hover i { translate: 0 -.08em; color: var(--hi2); }
.hero-type .w1 span:nth-child(2n):hover i { color: var(--pink); }
@keyframes drop { from { translate: 0 -120%; opacity: 0; } }
.hero-type .w2 {
  position: absolute; right: 2vw; bottom: -.12em;
  font-size: 26vw;
  line-height: .7;
}
.hero-type em {
  font: italic 400 1em/.7 var(--serif);
  letter-spacing: -.02em;
  color: var(--hi);
  -webkit-text-stroke: .045em var(--bg);
  paint-order: stroke fill;
}
.hero-type sup {
  font-size: .22em; vertical-align: top;
  display: inline-block;
  color: var(--hi2);
  animation: spin 7s linear infinite;
}
@keyframes spin { to { rotate: 360deg; } }

.hero-tag {
  position: relative; z-index: 2;
  margin: 4vw 0 0;
  max-width: 22ch;
  font: 400 clamp(22px, 3vw, 44px)/1.05 var(--serif);
}
.hero-tag em { color: var(--hi2); white-space: nowrap; }

.badge {
  position: absolute; z-index: 11; /* above the collage, tucked into the bottom-right corner */
  right: 28px; bottom: 30px;
  width: clamp(120px, 13vw, 200px); aspect-ratio: 1;
  display: grid; place-items: center;
  background: var(--yellow);
  border-radius: 50%;
  rotate: -12deg;
}
.badge svg { position: absolute; inset: 0; animation: spin 18s linear infinite; }
.badge text { font: 700 16px var(--pixel); fill: var(--ink); }
.badge span {
  font: 400 clamp(24px, 3vw, 44px)/.9 var(--deva);
  text-align: center; color: var(--red);
}

.floats { position: absolute; inset: 0; z-index: 1; }
.float {
  position: absolute;
  padding: 0; border: 0; background: none;
  rotate: var(--r);
  translate: var(--px, 0) var(--py, 0);
  transition: translate .4s cubic-bezier(.2, .8, .2, 1);
  animation: bob 5s ease-in-out infinite alternate;
}
.float:not(.placed) { visibility: hidden; width: 0; } /* never flash at natural size before app.js places it */
@keyframes bob { to { margin-top: -5px; } }
/* zine covers: pinned paper prints */
.float.zine { padding: 5px; background: #fff; box-shadow: 6px 8px 0 var(--ink); }
.float.zine img { display: block; width: 100%; height: auto; }
/* flat sticker-style pushpin: ink outline, hard offset shadow */
.pin {
  position: absolute; left: var(--pin-x, 50%); top: -12px;
  width: 24px; height: 24px; margin-left: -12px;
  border-radius: 50%;
  background: var(--red);
  border: 2.5px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  rotate: calc(var(--r) * -1);
}
.pin::before { content: ""; position: absolute; left: 4px; top: 3px; width: 6px; height: 6px; border-radius: 50%; background: #fff; }
.float.zine:hover { z-index: 30 !important; }
.float.zine:hover { scale: 1.06; transition: translate .4s cubic-bezier(.2, .8, .2, 1), scale .2s; }
/* die-cut sticker: white outline traced around the cut-out + our hard ink shadow */
.float.sticker-cut img {
  display: block; width: 100%; height: auto;
  filter:
    drop-shadow(3px 0 0 #fff) drop-shadow(-3px 0 0 #fff) drop-shadow(0 3px 0 #fff) drop-shadow(0 -3px 0 #fff)
    drop-shadow(6px 8px 0 var(--ink));
  transition: scale .25s cubic-bezier(.2, .9, .3, 1.5);
  will-change: transform;
}
.float:hover img { scale: 1.06; }
.floats .float:hover { z-index: 4; }

/* marquees */
.marquee {
  position: relative; z-index: 5;
  overflow: hidden;
  border-block: 3px solid var(--ink);
  color: var(--ink);
  rotate: -1.5deg;
  margin: 0 -20px;
  font: 700 clamp(22px, 3vw, 40px)/1 var(--pixel);
  white-space: nowrap;
}
.m-lime { background: var(--strip1); }
.m-pink { background: var(--strip2); rotate: 1.2deg; margin-top: -40px; } /* overlaps the pile's bottom edge */
.track { display: inline-flex; padding: 12px 0; animation: slide 30s linear infinite; }
.rev .track { animation-direction: reverse; }
.track span { padding-right: .6em; }
.track i { font-style: normal; color: var(--red); padding-right: .6em; }
.m-pink .track i { color: var(--blue); }
@keyframes slide { to { transform: translateX(-50%); } }

/* the pile */
/* the pile is its own colour block, tucked under both tilted strips so no landing colour peeks between */
.pile { margin-top: -40px; padding: 110px 20px 112px; overflow-x: clip; background: var(--bg2); color: var(--fg2); transition: background .4s, color .4s; }
.pile-head {
  display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between;
  gap: 20px; margin-bottom: 28px;
}
.pile-head h2 {
  margin: 0;
  font: 800 clamp(48px, 7vw, 110px)/.8 var(--display);
  font-variation-settings: "wdth" 75;
  letter-spacing: -.03em;
}
.pile-head h2 em {
  display: block; margin-top: 10px;
  font: italic 400 clamp(18px, 2vw, 28px) var(--serif);
  letter-spacing: 0; color: var(--hi3);
}
.controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.chips { display: flex; gap: 6px; }
.chip, .btn {
  font: 600 15px/1 var(--pixel);
  padding: 10px 14px;
  border: 2px solid var(--ink);
  border-radius: 99px;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  transition: translate .15s, box-shadow .15s, background .15s;
}
.chip:hover, .btn:hover { translate: -2px -2px; box-shadow: 3px 3px 0 var(--ink); }
.chip.on { background: var(--ink); color: var(--lime); }
.btn { background: var(--yellow); }
.btn[aria-pressed="true"] { background: var(--blue); color: #fff; }

.desk { position: relative; isolation: isolate; transition: height .5s; } /* card z-indexes stay inside the pile, never above the header */
.card {
  position: absolute;
  width: var(--cw, clamp(170px, 19vw, 280px));
  padding: 8px 8px 0;
  background: #fff;
  color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: 8px 10px 0 var(--ink);
  rotate: var(--r, 0deg);
  scale: var(--s, 1);
  touch-action: none;
  user-select: none;
  cursor: pointer;
  transition: rotate .5s cubic-bezier(.2, .9, .3, 1.3), scale .2s, box-shadow .2s, opacity .3s;
}
.desk.anim .card { transition: left .7s cubic-bezier(.2, .9, .2, 1.1), top .7s cubic-bezier(.2, .9, .2, 1.1), rotate .5s, scale .2s, box-shadow .2s; }
.card:hover { scale: calc(var(--s, 1) * 1.05); rotate: calc(var(--r, 0deg) * .3); z-index: 99 !important; }
.card img { aspect-ratio: 9 / 16; width: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }
.card .cap {
  display: flex; justify-content: space-between; gap: 8px;
  padding: 8px 2px 10px;
  font: 500 13px/1.1 var(--pixel);
}
.card .cap b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .tape {
  position: absolute; left: 50%; top: -14px;
  width: 90px; height: 26px; margin-left: -45px;
  background: color-mix(in srgb, var(--yellow) 75%, transparent);
  rotate: var(--tr, -4deg);
}
.card .sticker {
  position: absolute; right: -14px; top: 34px;
  padding: 6px 9px;
  font: 700 13px/1 var(--pixel);
  border: 2px solid var(--ink);
  border-radius: 99px;
  rotate: 10deg;
}
.sticker.film { background: var(--pink); }
.sticker.city { background: var(--lime); }
.sticker.talks { background: var(--blue); color: #fff; }
.card.gone { display: none; }

.desk.tidy {
  display: grid; gap: 34px 26px;
  grid-template-columns: repeat(6, minmax(0, 1fr)); /* 12 zines → two rows of six */
  height: auto !important;
}
.desk.tidy .card { position: relative; left: auto !important; top: auto !important; width: auto; --r: 0deg !important; --s: 1 !important; }

/* footer */
.foot { background: var(--ink); color: var(--paper); padding: 120px 20px 24px; margin-top: -40px; } /* tucks up under the tilted strip, so no paint shows between them */
.credits { display: grid; grid-template-columns: 2fr 1fr; gap: 40px 60px; }
.words ul { columns: 2; column-gap: 60px; }
.words li { break-inside: avoid; }
.side { display: flex; flex-direction: column; gap: 40px; }
.insta { display: inline-flex; align-items: center; gap: .3em; color: inherit; text-decoration: none; }
.insta svg { width: .9em; height: .9em; fill: none; stroke: currentColor; stroke-width: 2.2; flex: none; }
.insta .dot { fill: currentColor; stroke: none; }
.credits a { color: inherit; text-decoration: none; }
.credits a:hover { color: var(--lime); } /* the Instagram handle and the website credit light up alike */
.credits h3 { margin: 0 0 10px; font: 500 15px var(--pixel); color: var(--lime); text-transform: uppercase; }
.credits ul { list-style: none; margin: 0; padding: 0; font: 400 clamp(26px, 3.4vw, 48px)/1.05 var(--serif); }
.credits li:nth-child(odd) { font-style: italic; }
.foot-big {
  margin: 60px 0 30px;
  font: 800 clamp(64px, 15vw, 260px)/.8 var(--display);
  font-variation-settings: "wdth" 75;
  letter-spacing: 0;
}
.foot-big em { font: italic 400 1em var(--serif); color: var(--pink); letter-spacing: -.02em; }
.heart { color: var(--red); display: inline-block; animation: beat 1s ease-in-out infinite; }
@keyframes beat { 50% { scale: 1.2; } }
.foot-row { display: flex; justify-content: space-between; align-items: end; gap: 20px; font: 500 14px/1.5 var(--pixel); border-top: 1px solid #444; padding-top: 16px; }
.foot-row a { color: var(--lime); }

/* reader: a sticky stage over a tall scroll track; app.js maps scroll → layout + page turns */
.reader {
  position: fixed; inset: 0;
  width: 100vw; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  overflow-y: auto; overscroll-behavior: none; /* no rubber-band bounce past the first/last page */
  background: var(--bg); color: var(--fg);
}
.reader[open] { display: block; animation: pop .35s cubic-bezier(.2, .9, .3, 1.2); }
.reader::backdrop { background: var(--ink); }
@keyframes pop { from { opacity: 0; scale: .96; } }

.r-stage { position: sticky; top: 0; height: 100dvh; margin-bottom: -100dvh; overflow: clip; } /* clip, not hidden: hidden can still be scrolled sideways by the overhanging strip */
/* reading backdrop: a Delhi landmark as a duotone in the zine's colour, darkened at the edges
   so the pages stay the brightest thing on screen */
.r-dim {
  position: absolute; inset: 0;
  opacity: 0; pointer-events: none;
  overflow: hidden; isolation: isolate;
  background: color-mix(in oklab, var(--accent) 72%, #fff);
}
.r-place {
  position: absolute; inset: -3%;
  background: center / cover no-repeat;
  filter: grayscale(1) contrast(1.2) brightness(1.1);
  mix-blend-mode: multiply;
  transform: translateZ(0); /* filtered once, then just composited */
}
.r-dim::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(rgb(255 255 255 / .05) 1px, transparent 1.4px) 0 0 / 22px 22px,
    radial-gradient(ellipse 65% 75% at 50% 50%, rgb(0 0 0 / .18), rgb(0 0 0 / .62));
}
.r-where {
  position: absolute; z-index: 2; left: 22px; bottom: 96px;
  max-width: 230px;
  margin: 0;
  font: 400 12px/1.4 var(--pixel); color: #fff; text-shadow: 0 1px 6px rgb(0 0 0 / .6); /* white reads on any backdrop photo */
  opacity: 0; pointer-events: none;
}
.r-where b { font-size: 15px; font-weight: 700; }
.r-track { position: relative; pointer-events: none; }
.r-track i { position: absolute; left: 0; width: 1px; height: 1px; }

/* first open: full-height cover from the left edge, details sit on the site's own paint */
.r-cover {
  position: absolute; z-index: 3; left: 0; top: 0; /* above the fading details while it glides */
  overflow: hidden;
  transform-origin: 0 0;
  will-change: transform;
  border-right: 3px solid var(--ink);
  background: var(--ink);
  cursor: pointer;
}
.r-cover img { width: 100%; height: 100%; object-fit: cover; }
.r-meta {
  position: absolute; z-index: 2;
  left: calc(100dvh * 9 / 16); right: 0; top: 0; bottom: 0; /* starts where the full-height cover ends */
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 0 5vw calc(var(--dock) + var(--dock-h)); /* text stacks upward from just above the buttons */
  --dock: 30vh; --dock-h: 120px;
}
/* buttons sit at the same spot for every piece, however long the title is */
.r-dock {
  position: absolute; left: 5vw; right: 5vw;
  bottom: var(--dock); height: var(--dock-h);
}
.r-stickers { display: flex; gap: 8px; }
.r-stickers .sticker {
  padding: 7px 11px;
  font: 700 14px/1 var(--pixel); text-transform: uppercase;
  border: 2px solid var(--ink); border-radius: 99px;
  color: var(--ink);
  rotate: -4deg;
}
.r-stickers .sticker.talks { color: #fff; }
button.sticker { cursor: pointer; text-decoration: none; transition: rotate .2s cubic-bezier(.3, 1.6, .5, 1), translate .2s, box-shadow .2s; }
button.sticker:hover { rotate: 2deg; translate: -2px -2px; box-shadow: 3px 3px 0 var(--ink); }
.r-stickers .pages { background: var(--paper); color: var(--ink); rotate: 3deg; }
.r-sub { margin: 26px 0 0; font: italic 400 clamp(20px, 2vw, 30px)/1.1 var(--serif); color: var(--hi2); }
.r-sub:empty { display: none; }
.r-meta h2 {
  margin: 12px 0 0;
  font: 800 clamp(56px, 7vw, 130px)/.82 var(--display);
  font-variation-settings: "wdth" 75;
  letter-spacing: -.03em;
  text-wrap: balance;
}
.r-by { margin: 22px 0 0; font: 400 clamp(22px, 2.2vw, 34px)/1.15 var(--serif); }
.r-by em { color: var(--hi); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.r-dock .actions { margin-top: 28px; }
.hint { margin: 26px 0 0; font: 500 15px var(--pixel); }
.hint .arrow { display: inline-block; color: var(--hi); animation: nudge 1.2s ease-in-out infinite; }
@keyframes nudge { 50% { translate: 0 5px; } }
.r-marquee { position: absolute; left: 0; right: -20px; bottom: 7vh; margin: 0; font-size: clamp(18px, 2vw, 28px); }
.reader .btn.alt { background: var(--paper); }


/* stacked intro (phones, portrait tablets — anywhere a side-by-side split would squeeze the details):
   details top-centre, cover bottom-centre. app.js sets .stacked from the actual room available. */
.reader.stacked .r-meta { left: 0; bottom: 45%; justify-content: flex-start; align-items: center; text-align: center;
  padding: 64px 18px 0; }
.reader.stacked .r-stickers { justify-content: center; }
/* title block sits centred in the band above the pinned buttons */
.reader.stacked:not(.measuring) .r-meta { bottom: auto; height: var(--dock-top); justify-content: center; padding: 44px 18px 0; }
.reader.stacked .r-sub { margin-top: 16px; font-size: clamp(17px, 2.6vw, 24px); max-width: 30ch; }
.reader.stacked .r-meta h2 { font-size: clamp(38px, 9vw, 84px); max-width: 14ch; }
.reader.stacked .r-by { margin-top: 12px; font-size: clamp(19px, 2.8vw, 26px); }
.reader.stacked .r-dock { top: var(--dock-top, 300px); bottom: auto; left: 12px; right: 12px; height: auto; }
.reader.stacked .r-dock .actions { margin-top: 0; gap: 8px; justify-content: center; flex-wrap: nowrap; }
.reader.stacked .r-dock .btn { padding: 9px 13px; font-size: 13px; white-space: nowrap; }
.reader.stacked .hint { display: none; }
/* the strip runs right under the buttons; the cover sizes itself to the room left below it */
.reader.stacked .r-marquee { top: calc(var(--dock-top, 300px) + 60px); bottom: auto; left: -20px; right: -20px; font-size: 16px; }
.reader.stacked .r-marquee .track { padding: 9px 0; }
.reader.stacked .r-cover { border: 3px solid var(--ink); box-shadow: 6px 8px 0 var(--ink); }
/* short phones (an iPhone in Safari has ~660px once its toolbars show): a tighter title block,
   so the cover under it gets the room */
@media (max-height: 760px) {
  .reader.stacked .r-meta { padding-top: 58px; }
  .reader.stacked:not(.measuring) .r-meta { padding-top: 40px; }
  .reader.stacked .r-stickers .sticker { padding: 5px 9px; font-size: 12px; }
  .reader.stacked .r-sub { margin-top: 10px; font-size: 15px; }
  .reader.stacked .r-meta h2 { margin-top: 8px; font-size: clamp(28px, 7.6vw, 42px); }
  .reader.stacked .r-by { margin-top: 8px; font-size: 16px; }
  .reader.stacked .r-marquee { top: calc(var(--dock-top, 300px) + 50px); font-size: 14px; }
  .reader.stacked .r-marquee .track { padding: 7px 0; }
}
@media (max-width: 420px) { .reader.stacked .btn .w { display: none; } } /* "← PREV · GET PDF ↓ · NEXT →" so they fit one row */

/* short screens in the split layout (landscape phones, small laptops): scale the details to the height */
@media (max-height: 600px) {
  .reader:not(.stacked) .r-meta { --dock: 7vh; --dock-h: 44px; padding-top: 16px; }
  .reader:not(.stacked) .r-by { margin-bottom: 18px; }
  .reader:not(.stacked) .r-meta h2 { font-size: clamp(30px, 11vh, 84px); }
  .reader:not(.stacked) .r-sub { margin-top: 12px; font-size: 16px; }
  .reader:not(.stacked) .r-by { margin-top: 10px; font-size: 18px; }
  .reader:not(.stacked) .r-stickers .sticker { padding: 5px 9px; font-size: 12px; }
  .reader:not(.stacked) .hint, .reader:not(.stacked) .r-marquee { display: none; }
  .reader:not(.stacked) .r-dock .actions { margin-top: 0; }
}

/* the zine */
.r-book {
  position: absolute; z-index: 1;
  left: 50%; top: 50%;
  width: var(--bw); height: var(--ph);
  margin: calc(var(--ph) / -2) 0 0 calc(var(--bw) / -2);
  perspective: 2600px;
  cursor: pointer;
}
.spread { position: absolute; inset: 0; transform-style: preserve-3d; }
.leaf {
  position: absolute; top: 0; left: var(--spine);
  width: var(--pw); height: var(--ph);
  transform-origin: left center;
  transform-style: preserve-3d;
}
.face {
  position: absolute; inset: 0;
  overflow: hidden;
  background: #151515;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: 0 18px 50px rgb(0 0 0 / .35);
}
.leaf { will-change: transform; } /* each page is its own GPU layer: painted once, then only rotated */
.face.front { border-radius: 0 8px 8px 0; }
.face.back { border-radius: 8px 0 0 8px; transform: rotateY(180deg); }
.face img { width: 100%; height: 100%; object-fit: cover; }
/* gutter shadow near the spine (static) + a darker wash while the page is mid-turn (opacity only) */
.face::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(to right, rgb(0 0 0 / .28), transparent 7%);
}
.face.back::before { background: linear-gradient(to left, rgb(0 0 0 / .28), transparent 7%); }
.face .shade {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(to right, rgb(0 0 0 / .7), rgb(0 0 0 / .15));
  opacity: 0;
}
.face.back .shade { background: linear-gradient(to left, rgb(0 0 0 / .7), rgb(0 0 0 / .15)); }
.fin {
  height: 100%;
  display: grid; place-content: center; gap: 14px; text-align: center;
  background: var(--paper); color: var(--ink);
}
.fin b { font: italic 400 clamp(60px, 9vh, 120px)/1 var(--serif); color: var(--accent); }
.fin span { font: 700 16px var(--pixel); letter-spacing: .1em; }

.r-hud {
  position: absolute; z-index: 2; left: 22px; bottom: 20px;
  display: grid; gap: 4px;
  color: #fff; text-shadow: 0 1px 6px rgb(0 0 0 / .6); /* sits on the backdrop photo, like the place name */
  opacity: 0; pointer-events: none;
}
.r-hud b { font: 700 clamp(28px, 3vw, 44px)/1 var(--pixel); font-variant-numeric: tabular-nums; }
.r-hud span { font: 400 13px var(--pixel); opacity: .7; }
.r-progress { position: absolute; z-index: 2; left: 0; right: 0; top: 0; height: 4px; }
.r-progress i { display: block; height: 100%; background: var(--hi); transform-origin: 0 0; transform: scaleX(0); }
.r-end {
  position: absolute; z-index: 3; right: 22px; bottom: 20px;
  display: flex; gap: 10px;
  opacity: 0; translate: 0 12px; pointer-events: none;
  transition: opacity .3s, translate .3s;
}
.r-end.on { opacity: 1; translate: 0 0; pointer-events: auto; }

/* top-right: download, share, close */
.r-tools { position: fixed; z-index: 5; top: 18px; right: 18px; display: flex; gap: 10px; }
.tool {
  display: grid; place-items: center;
  width: 52px; height: 52px; padding: 0; border-radius: 50%;
  border: 2px solid var(--ink); background: var(--paper); color: var(--ink);
  font-size: 22px; cursor: pointer;
  transition: translate .2s, box-shadow .2s, background .2s, rotate .3s;
}
.tool svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
#r-share circle { fill: currentColor; stroke: none; }
.tool:hover { background: var(--yellow); translate: -2px -2px; box-shadow: 3px 3px 0 var(--ink); }
.close:hover { translate: none; box-shadow: none; rotate: 90deg; }
/* link copied: the share button flashes a tick */
#r-share.done { background: var(--yellow); }
#r-share.done svg { display: none; }
#r-share.done::after { content: "✓"; font-weight: 700; }

.phone-only { display: none; }
@media (max-width: 760px) {
  .phone-only { display: inline; }
  .bar { gap: 10px; padding: 10px 16px; font-size: 12px; }
  .bar-mid { display: none; }
  .bar-clock { margin-left: auto; }
  /* compact landing: covers tuck around the wordmark instead of floating far apart */
  /* fills the first screen: covers framing the top and bottom, wordmark + tagline in the middle */
  .hero { min-height: calc(100svh - 46px); padding: clamp(200px, 30svh, 260px) 16px clamp(210px, 31svh, 270px); justify-content: center; }
  .hero-tag { font-size: clamp(22px, 6.2vw, 30px); }
  @media (max-height: 720px) {
    .badge { width: 110px; bottom: 24px; }
    .hero { padding-block: 170px 180px; }
  }
  .badge { left: auto; right: 18px; top: auto; bottom: 34px; width: clamp(118px, 34vw, 150px); }
  .pile { padding: 100px 16px 104px; }
  .desk.tidy { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 14px; }
  .desk-only { display: none; }
  .card .sticker { right: -6px; font-size: 11px; }
  .foot { padding-inline: 16px; }
  .credits { grid-template-columns: 1fr; }
  .foot-big { font-size: 15.5vw; white-space: nowrap; } /* keeps the heart on the same line */
  .side { display: grid; grid-template-columns: 1fr 1fr; gap: 32px 20px; }
  .side > :nth-child(3) { grid-column: 1 / -1; } /* instagram gets the full row */
  .words ul { column-gap: 20px; font-size: 22px; }

  .r-hud { left: 14px; bottom: 14px; }
  .r-hud span { display: none; }
  .r-where { left: 14px; top: 12px; bottom: auto; height: 42px; display: flex; align-items: center; max-width: calc(100vw - 180px); } /* same line as the three round buttons */
  .r-end { right: 14px; bottom: 14px; gap: 8px; }
  .r-end .btn { padding: 9px 13px; font-size: 13px; }
  .r-end .w { display: none; } /* "← PREV · NEXT →", sharing the bottom row with the page count */
  .r-tools { top: 12px; right: 12px; gap: 8px; z-index: 3; }
  .tool { width: 42px; height: 42px; font-size: 18px; }
  .tool svg { width: 18px; height: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ?still in the URL freezes motion (handy for screenshots) */
.still *, .still *::before, .still *::after { animation: none !important; transition: none !important; }
html.still { scroll-behavior: auto; }
@media (min-width: 761px) { .still .hero { min-height: 860px; } }
@media (max-width: 760px) { .still .hero { min-height: 798px; } } /* screenshots: a real phone-height hero */
