/* ─────────── RIMIKTASH · the magazine ─────────── */
:root {
  --bg: #e9e6df;
  --paper: #fcfbf8;
  --page: #fdfcf9;
  --ink: #131110;
  --ink-deep: #0c0b0a;
  --muted: #8b857a;
  --taupe: #a89f92;
  --sand: #dcd6cb;
  --accent: #e63b12;
  --hair: rgba(19, 17, 16, .8);
  --line: 1.5px solid var(--ink);
  --r: 4px;
  --ease-spring: cubic-bezier(.3, .95, .25, 1);
  font-size: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
html { scroll-behavior: smooth; }

body {
  font-family: "Space Grotesk", -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

[hidden] { display: none !important; }
::selection { background: var(--accent); color: #fff; }
button { touch-action: manipulation; }

.grain {
  position: fixed; inset: 0; z-index: 90; pointer-events: none; opacity: .4;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.035 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

.burst { position: fixed; z-index: 300; pointer-events: none; font-size: 20px; animation: burstFly .8s cubic-bezier(.2,.7,.3,1) forwards; }
@keyframes burstFly {
  from { transform: translate(0,0) scale(.5); opacity: 1; }
  to { transform: translate(var(--bx), var(--by)) scale(1.4) rotate(var(--br)); opacity: 0; }
}

/* ═══════════ GATE ═══════════ */
#gate {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: var(--bg);
  transition: opacity .6s ease, transform .6s ease;
}
#gate.away { opacity: 0; transform: translateY(-3vh); pointer-events: none; }

.gate-card {
  position: relative; z-index: 2;
  background: var(--paper); border: var(--line);
  box-shadow: 0 30px 60px -30px rgba(19,17,16,.4);
  padding: 2.8rem 2.4rem 2.2rem; text-align: center;
  width: min(420px, calc(100vw - 2rem));
  animation: cardIn .7s cubic-bezier(.2,.9,.3,1.15) both;
}
@keyframes cardIn { from { transform: translateY(34px); opacity: 0; } }

.gate-kicker { font: 700 .6rem "Space Grotesk", sans-serif; letter-spacing: .3em; color: var(--muted); }
.gate-title {
  font-family: "Anton", sans-serif; font-weight: 400;
  font-size: clamp(2.8rem, 11vw, 4.2rem); line-height: .95; margin-top: .5rem;
  letter-spacing: .01em;
}
.gate-title span { color: var(--accent); }
.gate-sub {
  font-family: "Instrument Serif", serif; font-style: italic;
  font-size: 1.05rem; color: var(--muted); margin: .7rem 0 1.8rem;
}

.gate-field {
  display: flex; align-items: center;
  background: var(--bg); border: var(--line);
  padding: .3rem .5rem .3rem 1.1rem;
  transition: box-shadow .2s;
}
.gate-field:focus-within { box-shadow: 0 0 0 3px rgba(230,59,18,.25); }
.gate-prefix { font: 700 1rem "Space Grotesk", sans-serif; user-select: none; }
#gate-input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font: 600 1rem "Space Grotesk", sans-serif; letter-spacing: .25em;
  color: var(--ink); padding: .55rem .3rem;
}
#gate-input::placeholder { color: var(--sand); }

.gate-btn {
  margin-top: 1rem; width: 100%; cursor: pointer;
  background: var(--ink); color: var(--paper);
  border: var(--line);
  font: 700 .85rem "Space Grotesk", sans-serif; letter-spacing: .18em;
  padding: 1rem; transition: background .2s;
}
.gate-btn:hover { background: var(--accent); border-color: var(--accent); }
.gate-hint { margin-top: 1.1rem; font: 400 .68rem "Space Grotesk", sans-serif; letter-spacing: .05em; color: var(--muted); }

.gate-card.wrong { animation: shake .5s; }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-7px); }
  40%, 60% { transform: translateX(7px); }
}

/* ═══════════ SHELL ═══════════ */
#app { position: relative; z-index: 2; min-height: 100%; display: flex; flex-direction: column; animation: appIn .7s ease both; }
@keyframes appIn { from { opacity: 0; transform: translateY(12px); } }

.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: .95rem clamp(1rem, 3vw, 2.4rem);
  background: rgba(233, 230, 223, .9);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: var(--line);
}
.brand { font-family: "Anton", sans-serif; font-size: 1.05rem; letter-spacing: .06em; }
.brand sup { font: 700 .5rem "Space Grotesk", sans-serif; vertical-align: super; }

.nav { display: flex; gap: clamp(.9rem, 3vw, 2rem); margin-inline: auto; }
.nav a {
  font: 700 .7rem "Space Grotesk", sans-serif; text-transform: uppercase;
  letter-spacing: .16em; color: var(--ink);
  cursor: pointer; position: relative; user-select: none; padding: .2rem 0;
}
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform .3s var(--ease-spring);
}
.nav a:hover { color: var(--accent); }
.nav a:hover::after, .nav a.active::after { transform: scaleX(1); }
.nav a.active { color: var(--accent); }

.topbar-fine { font: 700 .55rem "Space Mono", monospace; letter-spacing: .18em; color: var(--muted); }

.view { display: none; padding: 1.4rem clamp(.9rem, 3.5vw, 3rem) 3.5rem; flex: 1; }
.view.active { display: block; animation: viewIn .4s ease both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } }

.view-note { text-align: center; font: 700 .62rem "Space Grotesk", sans-serif; letter-spacing: .14em; color: var(--muted); margin-bottom: 1rem; text-transform: uppercase; }

.mini-btn {
  border: var(--line); background: var(--paper); cursor: pointer;
  font: 700 .68rem "Space Grotesk", sans-serif; letter-spacing: .12em; color: var(--ink);
  padding: .55rem 1rem; transition: background .15s, color .15s;
}
.mini-btn:hover { background: var(--ink); color: var(--paper); }
.mini-btn.big { font-size: .8rem; padding: .75rem 1.5rem; background: var(--ink); color: var(--paper); }
.mini-btn.big:hover { background: var(--accent); border-color: var(--accent); }

/* ═══════════ SECTION HEADINGS ═══════════ */
.home-sec { padding: clamp(2.6rem, 6vh, 4.6rem) 0; scroll-margin-top: 80px; }
.home-sec + .home-sec { border-top: 1px solid var(--hair); }

.sec-head { text-align: center; margin-bottom: clamp(1.6rem, 4vh, 2.8rem); }
.sec-idx {
  display: block; font: 700 .6rem "Space Grotesk", sans-serif; letter-spacing: .34em;
  color: var(--muted); margin-bottom: .8rem;
}
.sec-title {
  font-family: "Anton", sans-serif; font-weight: 400; text-transform: uppercase;
  font-size: clamp(3rem, 11vw, 7.4rem); line-height: .9; letter-spacing: .005em;
}
.sec-title em {
  font-family: "Instrument Serif", serif; font-style: italic; text-transform: none;
  color: var(--accent); letter-spacing: 0; margin-left: .04em; font-size: .95em;
}
.sec-sub {
  display: block; font-family: "Instrument Serif", serif; font-style: italic;
  font-size: clamp(1rem, 2.6vw, 1.25rem); color: var(--muted); margin-top: .8rem;
}
.sec-head.small { margin-bottom: 1.4rem; }
.sec-head.small .sec-title { font-size: clamp(2.2rem, 7vw, 3.8rem); }

.rev { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .8s var(--ease-spring); }
.rev.in { opacity: 1; transform: none; }

/* ═══════════ THE MAGAZINE ═══════════ */
.bookx-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 1.3rem;
  perspective: 2600px;
}
.bookx {
  position: relative;
  width: min(920px, 94vw); aspect-ratio: 3/2;
  transform: translateX(-25%);
  transition: transform 1.15s cubic-bezier(.45,.05,.2,1);
  transform-style: preserve-3d;
  cursor: pointer;
  filter: drop-shadow(0 30px 44px rgba(19, 17, 16, .38));
}
.bookx.open { transform: translateX(0); }

.bx-base { position: absolute; inset: 0; display: flex; visibility: hidden; transition: visibility 0s 1.1s; }
.bookx.open .bx-base { visibility: visible; transition-delay: 0s; }
/* sheet stack edges */
.bx-base::before, .bx-base::after {
  content: ""; position: absolute; top: .8%; bottom: .8%; width: 8px;
  background: repeating-linear-gradient(90deg, #fff 0 2px, #cfc9be 2px 3px);
}
.bx-base::before { left: -7px; }
.bx-base::after { right: -7px; }

.bx-page {
  width: 50%; height: 100%; position: relative; overflow: hidden;
  background: var(--page);
  border: 1px solid #26221d;
}
.bx-left  { border-right: 0; }
.bx-right { border-left: 0; }
.bx-left::after {
  content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 9%;
  background: linear-gradient(to right, transparent, rgba(19,17,16,.14));
  pointer-events: none; z-index: 5;
}
.bx-right::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 9%;
  background: linear-gradient(to left, transparent, rgba(19,17,16,.14));
  pointer-events: none; z-index: 5;
}

/* ── magazine pages ── */
.mg-page {
  position: absolute; inset: 0; background: var(--page);
  padding: 5.5% 7%;
  display: flex; flex-direction: column;
}
.mg-kicker { font: 700 clamp(.4rem, .95vw, .6rem) "Space Grotesk", sans-serif; letter-spacing: .26em; }
.mg-head {
  font-family: "Instrument Serif", serif; font-weight: 400;
  font-size: clamp(.95rem, 2.5vw, 1.85rem); line-height: 1.02;
  margin-top: 2.5%;
}
.mg-byline {
  display: flex; justify-content: space-between; gap: 4%;
  border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair);
  margin-top: 4%; padding: 1.6% 0;
  font: 700 clamp(.34rem, .8vw, .5rem) "Space Grotesk", sans-serif;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink);
  white-space: nowrap; overflow: hidden;
}
.mg-cols { flex: 1; display: grid; grid-template-columns: 1.05fr .9fr; gap: 6%; margin-top: 4.5%; min-height: 0; overflow: hidden; }
.mg-text p {
  font: 400 clamp(.42rem, 1.08vw, .7rem) "Space Grotesk", sans-serif;
  line-height: 1.6; color: #29251f; margin-bottom: .9em;
}
.mg-text p:first-child::first-letter {
  font-family: "Instrument Serif", serif;
  font-size: 2.6em; float: left; line-height: .8; padding-right: .12em;
}
.mg-side { min-height: 0; display: flex; }
.mg-side img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mg-quote {
  align-self: center;
  font-family: "Instrument Serif", serif; font-style: italic;
  font-size: clamp(.72rem, 1.9vw, 1.35rem); line-height: 1.25; color: var(--ink);
  border-left: 2.5px solid var(--accent); padding-left: 8%;
}
.mg-folio {
  display: flex; justify-content: space-between; margin-top: 3.5%;
  font: 700 clamp(.32rem, .75vw, .48rem) "Space Grotesk", sans-serif;
  letter-spacing: .16em; color: var(--muted); text-transform: uppercase;
}

/* feature page (photo side) */
.mg-feature { position: absolute; inset: 0; overflow: hidden; background: #101010; }
.mg-feature img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mg-feature::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.5), transparent 32%, transparent 68%, rgba(0,0,0,.55));
}
.mg-feat-title {
  position: absolute; z-index: 2; top: 4.5%; left: 6%; right: 6%;
  font-family: "Anton", sans-serif; font-weight: 400; text-transform: uppercase;
  font-size: clamp(1rem, 3.4vw, 2.5rem); line-height: .95; color: #fff;
  letter-spacing: .01em;
}
.mg-feat-no {
  position: absolute; z-index: 2; right: 6%; bottom: 12%;
  background: var(--accent); color: #fff;
  font-family: "Anton", sans-serif; font-size: clamp(.7rem, 1.9vw, 1.3rem);
  padding: .25em .5em;
}
.mg-feat-meta {
  position: absolute; z-index: 2; left: 6%; right: 6%; bottom: 4%;
  display: flex; justify-content: space-between;
  font: 700 clamp(.34rem, .8vw, .5rem) "Space Grotesk", sans-serif;
  letter-spacing: .2em; color: rgba(255,255,255,.9); text-transform: uppercase;
}

/* letter + contents page */
.mg-letter p {
  font: 400 clamp(.44rem, 1.12vw, .72rem) "Space Grotesk", sans-serif;
  line-height: 1.65; color: #29251f; margin-bottom: .9em;
}
.mg-letter p:last-of-type { font-family: "Instrument Serif", serif; font-style: italic; font-size: clamp(.5rem, 1.3vw, .85rem); }
.mg-toc { margin-top: auto; border-top: 1px solid var(--hair); padding-top: 3%; }
.mg-toc-row {
  display: flex; justify-content: space-between; gap: 4%;
  font: 700 clamp(.36rem, .88vw, .56rem) "Space Grotesk", sans-serif;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink);
  padding: .9% 0; border-bottom: 1px dotted rgba(19,17,16,.3);
}
.mg-toc-row .toc-no { color: var(--accent); }
.mg-toc-row .toc-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* inside cover / colophon page */
.mg-colophon {
  position: absolute; inset: 0; background: var(--page);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.2%;
}
.mg-colophon span, .colophon .col-line {
  font: 700 clamp(.36rem, .85vw, .55rem) "Space Grotesk", sans-serif;
  letter-spacing: .24em; color: var(--muted); text-transform: uppercase;
  display: block; text-align: center; margin: .3em 0;
}

/* fin page */
.mg-fin {
  position: absolute; inset: 0; background: var(--ink-deep);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4%;
  text-align: center; padding: 8%;
}
.mg-fin .fin-big { font-family: "Anton", sans-serif; text-transform: uppercase; font-size: clamp(1.2rem, 3.8vw, 2.8rem); color: #fff; line-height: .95; }
.mg-fin .fin-script { font-family: "Instrument Serif", serif; font-style: italic; font-size: clamp(.7rem, 1.9vw, 1.2rem); color: var(--taupe); }
.mg-fin .fin-meta { font: 700 clamp(.34rem, .8vw, .5rem) "Space Grotesk", sans-serif; letter-spacing: .3em; color: rgba(255,255,255,.6); text-transform: uppercase; }

/* turning page */
.bx-turn {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 50%;
  transform-origin: left center; transform-style: preserve-3d;
  z-index: 20; pointer-events: none;
}
.bx-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; }
.bx-turn .bx-face { background: var(--page); border: 1px solid #26221d; }
.bx-turn .bx-back { transform: rotateY(180deg); }

/* the cover */
.bx-cover {
  position: absolute; top: -1.5%; bottom: -1.5%; left: 50%; width: 51%;
  transform-origin: left center; transform-style: preserve-3d;
  transition: transform 1.15s cubic-bezier(.45,.05,.2,1);
  z-index: 30;
}
.bookx.open .bx-cover { transform: rotateY(-180deg); }

.cv-front { background: #101010; border: 1px solid #101010; }
.cv-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cv-shade {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.5), transparent 34%, transparent 62%, rgba(0,0,0,.6));
}
.cv-mast {
  position: absolute; top: 3.5%; left: 4%; right: 4%; text-align: center;
  font-family: "Anton", sans-serif; font-size: clamp(1.7rem, 5.4vw, 4rem);
  color: #fff; letter-spacing: .015em; line-height: 1;
}
.cv-lines { position: absolute; bottom: 13%; left: 0; right: 0; text-align: center; display: flex; flex-direction: column; gap: .5em; }
.cv-script { font-family: "Instrument Serif", serif; font-style: italic; font-size: clamp(1rem, 3vw, 1.9rem); color: #fff; }
.cv-tag { font: 700 clamp(.4rem, 1vw, .6rem) "Space Grotesk", sans-serif; letter-spacing: .34em; color: #fff; }
.cv-foot {
  position: absolute; bottom: 3%; left: 4.5%; right: 4.5%;
  display: flex; justify-content: space-between;
  font: 700 clamp(.34rem, .8vw, .5rem) "Space Grotesk", sans-serif;
  letter-spacing: .16em; color: rgba(255,255,255,.85);
}
.cv-back { transform: rotateY(180deg); background: var(--page); border: 1px solid #26221d; display: grid; place-items: center; }

.bookx-controls { display: flex; align-items: center; gap: 1.1rem; }
.page-btn {
  width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  border: var(--line); background: var(--paper); color: var(--ink);
  font: 700 1rem "Space Grotesk", sans-serif;
  transition: background .15s, color .15s;
}
.page-btn:hover { background: var(--ink); color: var(--paper); }
.page-label { font: 700 .64rem "Space Grotesk", sans-serif; letter-spacing: .2em; color: var(--muted); text-transform: uppercase; min-width: 150px; text-align: center; }
.page-btn.jukebox { background: var(--accent); border-color: var(--accent); color: #fff; }
.page-btn.jukebox.off { background: var(--paper); border-color: var(--muted); color: var(--muted); }

/* ═══════════ ALBUMS ═══════════ */
.albums-stage {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--ink-deep);
  border: var(--line);
  padding: 8px;
  height: calc(100dvh - 190px); min-height: 480px;
  max-width: 1400px; margin: 0 auto;
}
.albums-note { margin-top: .9rem; margin-bottom: 0; }

.panel {
  position: relative; flex: 1; min-height: 0; min-width: 0;
  overflow: hidden; cursor: pointer;
  transition: flex .6s var(--ease-spring);
  will-change: flex;
}
.panel img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; filter: saturate(.92);
  transition: transform .6s var(--ease-spring), filter .4s;
}
.panel:active img { transform: scale(1.04); }
.panel.active { flex: 7; }
.panel.active img { filter: saturate(1.05); }
.panel::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(12,11,10,.8), transparent 55%);
  opacity: 0; transition: opacity .4s;
}
.panel.active::after { opacity: 1; }

.p-tag {
  position: absolute; z-index: 2; top: 10px; left: 12px;
  font: 700 .58rem "Space Grotesk", sans-serif; letter-spacing: .12em;
  color: #fff; background: rgba(12,11,10,.6); backdrop-filter: blur(6px);
  padding: .28rem .6rem; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: calc(100% - 24px);
  transition: opacity .3s;
}
.panel.active .p-tag { opacity: 0; }

.p-info {
  position: absolute; z-index: 2; left: 16px; right: 16px; bottom: 14px;
  opacity: 0; transform: translateY(14px);
  transition: opacity .45s .12s, transform .45s .12s var(--ease-spring);
  pointer-events: none;
}
.panel.active .p-info { opacity: 1; transform: none; }
.p-name {
  font-family: "Anton", sans-serif; text-transform: uppercase;
  font-size: clamp(1.3rem, 4.8vw, 2.4rem);
  line-height: .95; color: #fff; letter-spacing: .01em;
}
.p-meta { font: 700 .6rem "Space Grotesk", sans-serif; letter-spacing: .16em; color: var(--accent); margin-top: .5rem; text-transform: uppercase; }

@media (min-width: 760px) {
  .albums-stage { flex-direction: row; height: calc(100dvh - 210px); }
  .panel.active { flex: 5; }
  .p-tag {
    top: auto; left: 50%; bottom: 14px; transform: translateX(-50%) rotate(180deg);
    writing-mode: vertical-rl; max-width: none; max-height: calc(100% - 28px);
  }
}

/* ═══════════ ALBUM OVERLAY ═══════════ */
#album-overlay {
  position: fixed; inset: 0; z-index: 150;
  background: var(--paper);
  display: flex; flex-direction: column;
  transform: translateY(103%);
  transition: transform .65s cubic-bezier(.2, .9, .22, 1);
  visibility: hidden;
}
#album-overlay.open { transform: translateY(0); visibility: visible; }

.ao-top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 1.2rem; border-bottom: var(--line);
}
.ao-index { font: 700 .64rem "Space Grotesk", sans-serif; letter-spacing: .2em; color: var(--muted); text-transform: uppercase; }
.ao-close {
  border: var(--line); background: transparent; cursor: pointer;
  font: 700 .64rem "Space Grotesk", sans-serif; letter-spacing: .12em; color: var(--ink);
  padding: .5rem .9rem; transition: background .15s, color .15s;
}
.ao-close:hover { background: var(--ink); color: var(--paper); }

.ao-strip {
  flex: 1; display: flex; align-items: center; gap: clamp(12px, 2.5vw, 28px);
  overflow-x: auto; overflow-y: hidden;
  padding: 4vh clamp(6vw, 10vw, 12vw);
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  cursor: grab;
}
.ao-strip::-webkit-scrollbar { display: none; }
.ao-strip.dragging { cursor: grabbing; scroll-snap-type: none; }
.ao-item {
  flex: 0 0 auto; scroll-snap-align: center;
  height: 46vh; max-height: 520px;
  animation: aoIn .7s var(--ease-spring) both;
}
.ao-item:nth-child(3n+2) { height: 34vh; max-height: 400px; }
.ao-item:nth-child(3n)   { height: 40vh; max-height: 460px; }
@keyframes aoIn { from { opacity: 0; transform: translateY(30px); } }
.ao-item img {
  height: 100%; width: auto; display: block;
  box-shadow: 0 24px 60px -24px rgba(19,17,16,.5);
  user-select: none; -webkit-user-drag: none;
  transition: transform .4s var(--ease-spring);
}
.ao-item:active img { transform: scale(.985); }

.ao-foot { text-align: center; padding: 0 1rem calc(2.2vh + env(safe-area-inset-bottom, 0px)); }
.ao-title {
  font-family: "Anton", sans-serif; font-weight: 400; text-transform: uppercase;
  font-size: clamp(2rem, 8vw, 4.6rem); line-height: .92;
}
.ao-sub { font-family: "Instrument Serif", serif; font-style: italic; font-size: clamp(.95rem, 2.4vw, 1.2rem); color: var(--muted); margin-top: .7rem; }

/* ═══════════ THE WALL ═══════════ */
.wall { columns: 3 300px; column-gap: clamp(18px, 3vw, 34px); max-width: 1240px; margin: 0 auto; }
.art { break-inside: avoid; margin-bottom: clamp(22px, 3.4vw, 40px); cursor: zoom-in; }
.art.rev { transition-delay: var(--d, 0s); }
.art-frame {
  background: #fff;
  padding: clamp(8px, 1.4vw, 14px);
  border: 1px solid var(--ink);
  box-shadow: 0 16px 34px -22px rgba(19, 17, 16, .5);
  transition: transform .35s var(--ease-spring), box-shadow .35s;
}
.art-frame img { width: 100%; display: block; }
.art:hover .art-frame {
  transform: translateY(-5px);
  box-shadow: 0 30px 48px -24px rgba(19, 17, 16, .55);
}
.art-cap { margin-top: .6rem; text-align: center; font-family: "Instrument Serif", serif; font-style: italic; font-size: .95rem; color: var(--ink); }
.art-cap .art-no { font: 700 .54rem "Space Grotesk", sans-serif; font-style: normal; letter-spacing: .2em; color: var(--accent); margin-right: .5rem; text-transform: uppercase; }

/* ═══════════ PILE ═══════════ */
.board {
  position: relative; height: max(68vh, 540px); max-width: 1200px; margin: 0 auto;
  border: var(--line);
  background:
    radial-gradient(rgba(19,17,16,.07) 1.5px, transparent 1.5px) 0 0 / 24px 24px,
    var(--paper);
  overflow: hidden; touch-action: none;
}
.polaroid {
  position: absolute; width: clamp(130px, 17vw, 200px);
  background: #fff; padding: 8px 8px 30px;
  border: 1px solid var(--ink);
  cursor: grab; user-select: none;
  box-shadow: 0 10px 24px -12px rgba(19,17,16,.45);
  transition: box-shadow .2s;
  animation: polaroidIn .6s cubic-bezier(.2,.9,.3,1.15) both;
}
@keyframes polaroidIn { from { opacity: 0; transform: rotate(var(--rot)) translateY(40px) scale(.85); } }
.polaroid:active { cursor: grabbing; }
.polaroid.lifted { box-shadow: 0 26px 40px -16px rgba(19,17,16,.55); }
.polaroid img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; pointer-events: none; }
.polaroid .cap {
  position: absolute; left: 4px; right: 4px; bottom: 7px; text-align: center;
  font: 700 .5rem "Space Grotesk", sans-serif; letter-spacing: .08em; color: var(--muted);
  pointer-events: none; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.polaroid .tape {
  position: absolute; top: -9px; left: 50%; transform: translateX(-50%) rotate(-3deg);
  width: 56px; height: 18px; background: rgba(220, 214, 203, .9);
  border: 1px solid rgba(19,17,16,.25);
  pointer-events: none;
}

/* ═══════════ STORY ═══════════ */
.story {
  position: relative; margin: 0 auto;
  width: min(430px, 92vw); height: min(70vh, 680px);
  border: var(--line); overflow: hidden;
  background: #121110; box-shadow: 0 30px 60px -30px rgba(19,17,16,.6);
}
.story-img { width: 100%; height: 100%; object-fit: cover; animation: kenburns 5s ease-out both; }
@keyframes kenburns { from { transform: scale(1.1); } to { transform: scale(1); } }
.story-progress { position: absolute; top: 12px; left: 12px; right: 12px; z-index: 3; display: flex; gap: 4px; }
.story-progress .seg { flex: 1; height: 3px; background: rgba(255,255,255,.35); overflow: hidden; }
.story-progress .seg i { display: block; height: 100%; width: 0; background: #fff; }
.story-progress .seg.done i { width: 100%; }
.story-progress .seg.now i { animation: fill var(--dur, 4.5s) linear both; animation-play-state: var(--ps, running); }
@keyframes fill { to { width: 100%; } }
.story-caption {
  position: absolute; bottom: 16px; left: 0; right: 0; z-index: 3;
  text-align: center; font: 700 .64rem "Space Grotesk", sans-serif; letter-spacing: .16em;
  color: #fff; text-transform: uppercase; text-shadow: 0 2px 10px rgba(0,0,0,.7);
  padding: 0 1rem;
}
.story-tap { position: absolute; top: 0; bottom: 0; width: 50%; z-index: 2; cursor: pointer; }
.story-tap.left { left: 0; } .story-tap.right { right: 0; }
.story-actions { position: absolute; top: 24px; right: 12px; z-index: 4; display: flex; gap: 6px; }
.story-chip {
  border: 1px solid rgba(255,255,255,.7); background: rgba(0,0,0,.4); color: #fff; cursor: pointer;
  font: 700 .58rem "Space Grotesk", sans-serif; letter-spacing: .12em;
  padding: .35rem .6rem;
}
.story-chip.on { background: var(--accent); border-color: var(--accent); }

/* ═══════════ SPIN ═══════════ */
.spin-wrap { display: flex; flex-direction: column; align-items: center; gap: 1.4rem; }
.wheel-zone { position: relative; width: min(440px, 88vw); aspect-ratio: 1; }
.wheel {
  width: 100%; height: 100%; border-radius: 50%;
  border: 2px solid var(--ink);
  box-shadow: 0 24px 44px -24px rgba(19,17,16,.5), inset 0 0 0 10px var(--paper);
  position: relative;
  transition: transform 4.6s cubic-bezier(.12, .68, .06, 1);
  will-change: transform;
}
.wheel-thumb {
  position: absolute; top: 50%; left: 50%;
  width: clamp(38px, 10vw, 52px); height: clamp(38px, 10vw, 52px);
  border-radius: 50%; border: 2px solid var(--ink);
  object-fit: cover; pointer-events: none;
}
.wheel-pointer {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%); z-index: 3;
  width: 0; height: 0;
  border-left: 14px solid transparent; border-right: 14px solid transparent;
  border-top: 24px solid var(--accent);
}
.wheel-btn {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); z-index: 2;
  width: 96px; height: 96px; border-radius: 50%; cursor: pointer;
  border: 2px solid var(--ink); background: var(--accent); color: #fff;
  font-family: "Anton", sans-serif; font-size: 1.05rem; letter-spacing: .06em;
  transition: transform .12s;
}
.wheel-btn:hover { transform: translate(-50%,-50%) scale(1.05); }
.wheel-btn:active { transform: translate(-50%,-50%) scale(.97); }
.wheel-btn:disabled { opacity: .6; cursor: wait; }

/* ═══════════ MATCH ═══════════ */
.match-wrap { max-width: 560px; margin: 0 auto; }
.match-hud {
  display: flex; justify-content: space-between; align-items: center; gap: .8rem;
  font: 700 .68rem "Space Grotesk", sans-serif; letter-spacing: .12em; margin-bottom: 1rem;
}
.match-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.match-card { aspect-ratio: 3/4; perspective: 700px; cursor: pointer; }
.match-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .45s cubic-bezier(.3,.8,.3,1.1); }
.match-card.flipped .match-inner, .match-card.matched .match-inner { transform: rotateY(180deg); }
.match-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border: 1px solid var(--ink); overflow: hidden;
}
.match-face.back {
  background:
    radial-gradient(rgba(19,17,16,.1) 1.5px, transparent 1.5px) 0 0 / 14px 14px,
    var(--sand);
  display: grid; place-items: center; font-size: 1.2rem;
  transition: background .2s;
}
.match-card:hover .match-face.back { background-color: var(--taupe); }
.match-face.front { transform: rotateY(180deg); }
.match-face.front img { width: 100%; height: 100%; object-fit: cover; display: block; }
.match-card.matched { animation: matchPop .5s cubic-bezier(.2,.9,.3,1.4); }
.match-card.matched .match-face.front { box-shadow: inset 0 0 0 3px var(--accent); }
@keyframes matchPop { 40% { transform: scale(1.08); } }

/* ═══════════ SCRATCH ═══════════ */
.scratch-wrap { display: flex; flex-direction: column; align-items: center; gap: 1.2rem; }
.scratch-frame {
  position: relative; width: min(420px, 88vw); aspect-ratio: 3/4;
  border: var(--line); overflow: hidden;
  box-shadow: 0 24px 44px -24px rgba(19,17,16,.5); touch-action: none;
}
.scratch-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#scratch-canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; transition: opacity .8s ease; }
#scratch-canvas.revealed { opacity: 0; pointer-events: none; }

/* ═══════════ FOOTER ═══════════ */
.footer {
  margin-top: auto;
  display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; justify-content: center;
  padding: 1.1rem 1.2rem calc(1.1rem + env(safe-area-inset-bottom, 0px));
  border-top: var(--line); background: var(--ink-deep);
}
.footer-label { font: 700 .64rem "Space Grotesk", sans-serif; letter-spacing: .2em; color: var(--taupe); }
.footer-games { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; }
.footer-games button {
  border: 1px solid var(--taupe); background: transparent; color: var(--bg); cursor: pointer;
  font: 700 .62rem "Space Grotesk", sans-serif; letter-spacing: .12em;
  padding: .5rem .9rem;
  transition: background .2s, border-color .2s;
}
.footer-games button:hover { background: var(--accent); border-color: var(--accent); }
.footer-fine { font: 400 .56rem "Space Mono", monospace; letter-spacing: .14em; color: var(--muted); width: 100%; text-align: center; margin-top: .2rem; }

/* ═══════════ LIGHTBOX ═══════════ */
#lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(12, 11, 10, .92);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  display: grid; place-items: center;
  animation: lbIn .25s ease both;
}
@keyframes lbIn { from { opacity: 0; } }
#lb-img {
  max-width: min(92vw, 1100px); max-height: 80vh;
  border: 1px solid var(--paper);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.7);
  animation: lbImgIn .3s cubic-bezier(.2,.9,.3,1.15) both;
}
@keyframes lbImgIn { from { transform: scale(.93); opacity: 0; } }
.lb-caption {
  position: fixed; bottom: 20px; left: 0; right: 0; text-align: center;
  font-family: "Instrument Serif", serif; font-style: italic; font-size: 1.15rem;
  color: var(--sand); padding: 0 1rem;
}
.lb-close, .lb-nav {
  position: fixed; z-index: 2; cursor: pointer;
  background: var(--paper); color: var(--ink); border: 1px solid var(--ink);
  border-radius: 50%; transition: background .15s, color .15s;
  font-family: "Space Grotesk", sans-serif; font-weight: 700;
}
.lb-close { top: 18px; right: 18px; width: 44px; height: 44px; font-size: 1rem; }
.lb-nav { top: 50%; transform: translateY(-50%); width: 50px; height: 50px; font-size: 1.2rem; }
.lb-nav.prev { left: 16px; } .lb-nav.next { right: 16px; }
.lb-close:hover, .lb-nav:hover { background: var(--accent); color: #fff; }

/* single-page slide-in (mobile) */
@keyframes pgSlideL { from { opacity: 0; transform: translateX(7%); } }
@keyframes pgSlideR { from { opacity: 0; transform: translateX(-7%); } }

/* ── small screens ── */
@media (max-width: 720px) {
  .topbar { justify-content: space-between; }
  .nav { order: 3; width: 100%; justify-content: center; margin-inline: 0; }
  .topbar-fine { display: none; }
  .wall { columns: 2 150px; }
  .board { height: 62vh; }
  .match-grid { gap: 7px; }
  .lb-nav { display: none; }

  /* the magazine reads one full-screen page at a time */
  .sec-head { margin-bottom: 1rem; }
  .sec-idx { font-size: .52rem; margin-bottom: .5rem; }
  .sec-title { font-size: 11vw; }
  .sec-sub { font-size: .85rem; margin-top: .5rem; }
  .home-sec { padding: 1.4rem 0; }
  #sec-book { scroll-margin-top: 155px; }

  .bookx {
    aspect-ratio: auto;
    width: min(96vw, 560px);
    height: calc(100dvh - 340px);
    min-height: 420px;
    transform: none;
  }
  .bookx.open { transform: none; }
  .bx-left { display: none; }
  .bx-page.bx-right { width: 100%; border-left: 1px solid #26221d; }
  .bx-right::after { display: none; }
  .bx-base::before { display: none; }
  .bx-turn { display: none !important; }
  .bx-cover { left: 0; width: 100%; top: -1%; bottom: -1%; }

  .mg-page { padding: 6% 7%; overflow-y: auto; }
  /* let article content grow and scroll instead of clipping */
  .mg-cols { flex: none; overflow: visible; margin-top: 4%; }
  .mg-side { display: block; min-height: 0; }
  .mg-side img { width: 100%; height: auto; max-height: 32vh; object-fit: cover; }
  .mg-quote { display: block; margin-top: 6%; }
  .mg-folio { margin-top: 5%; padding-bottom: 2%; }
  .mg-kicker { font-size: 2.5vw; }
  .mg-head { font-size: 5.8vw; }
  .mg-byline { font-size: 2.1vw; padding: 2.8% 0; margin-top: 3%; }
  .mg-text p { font-size: 3.1vw; line-height: 1.55; }
  .mg-letter p { font-size: 2.8vw; line-height: 1.55; }
  .mg-letter p:last-of-type { font-size: 3.2vw; }
  .mg-quote { font-size: 4.6vw; }
  .mg-toc-row { font-size: 2.4vw; }
  .mg-folio { font-size: 2vw; }
  .mg-feat-title { font-size: 8vw; }
  .mg-feat-no { font-size: 5vw; }
  .mg-feat-meta { font-size: 2.3vw; }
  .mg-colophon span { font-size: 2.5vw; }
  .mg-fin .fin-big { font-size: 9vw; }
  .mg-fin .fin-script { font-size: 4.2vw; }
  .mg-fin .fin-meta { font-size: 2.4vw; }

  /* album overlay: swipeable strip with a visible peek of the next photo */
  .ao-strip {
    padding: 2vh 9vw;
    gap: 14px;
    scroll-snap-type: x mandatory;
  }
  .ao-item, .ao-item:nth-child(3n), .ao-item:nth-child(3n+2) {
    height: auto; max-height: none;
    display: flex; align-items: center;
  }
  .ao-item img {
    width: auto; height: auto;
    max-width: 78vw; max-height: 52vh;
  }
  .ao-title { font-size: 9vw; }
  .ao-sub { font-size: 3.6vw; padding: 0 1.4rem; }
  .cv-mast { font-size: 11vw; }
  .cv-script { font-size: 6vw; }
  .cv-tag { font-size: 2.6vw; }
  .cv-foot { font-size: 2.2vw; }
  .colophon .col-line { font-size: 2.5vw; }
}
