/* KmicWear magazine — the reading room, the book and the reader's controls.
 * Page layouts (print design) live in magazine-pages.css.
 */

:root {
  --display: 'Playfair Display', 'Times New Roman', Georgia, serif;
  --body: 'Newsreader', Georgia, 'Times New Roman', serif;
  --ui: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --walnut-0: #0e0805;
  --walnut-1: #1d110a;
  --walnut-2: #3a2416;
  --walnut-3: #5a3923;
  --sunlight: 255, 196, 120;
  --cream: #fbf6ec;
  --cream-soft: rgba(251, 246, 236, 0.66);
  --paper: #f6f1e7;
  --paper-edge: #ddd3c2;
  --ink: #17110d;
  --ink-soft: rgba(23, 17, 13, 0.7);
  --red: #c8202f;
  --amber: #ff9f1c;
  --gold: #c58a2c;

  --bar-h: 64px;
  --reader-h: 92px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-film: cubic-bezier(0.77, 0, 0.18, 1);

  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .24 0 0 0 0 .18 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  height: 100%;   /* iOS before 15.4 has no dvh */
  height: 100dvh;
  overflow: hidden;
  background: var(--walnut-1);
  color: var(--cream);
  font: 400 1rem/1.5 var(--ui);
  -webkit-font-smoothing: antialiased;
  display: grid;
  grid-template-rows: var(--bar-h) 1fr;
}
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
/* Tapping Next quickly must not double-tap-zoom the page on iOS. */
button, a, input, label { touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 6px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: fixed; left: 16px; top: -60px; z-index: 300; padding: 10px 16px; background: var(--cream); color: var(--ink); border-radius: 999px; text-decoration: none; }
.skip-link:focus { top: 12px; }

/* ---------- the room ---------- */
.room { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.room__table {
  position: absolute; inset: -10%;
  background:
    var(--grain),
    repeating-linear-gradient(92deg, rgba(0, 0, 0, 0.18) 0 2px, transparent 2px 9px, rgba(255, 220, 180, 0.03) 9px 11px, transparent 11px 23px),
    radial-gradient(ellipse 70% 55% at 50% 42%, var(--walnut-3) 0%, var(--walnut-2) 38%, var(--walnut-1) 72%, var(--walnut-0) 100%);
}
/* Late sun through window blinds, slowly drifting across the desk. */
.room__blinds {
  position: absolute; inset: -30%;
  background: repeating-linear-gradient(-28deg, rgba(var(--sunlight), 0) 0 46px, rgba(var(--sunlight), 0.16) 46px 92px);
  -webkit-mask: radial-gradient(ellipse 55% 50% at 66% 30%, #000 0%, transparent 72%);
  mask: radial-gradient(ellipse 55% 50% at 66% 30%, #000 0%, transparent 72%);
  mix-blend-mode: soft-light;
  filter: blur(6px);
  animation: blinds 38s ease-in-out infinite alternate;
}
@keyframes blinds { to { transform: translate3d(-4%, 3%, 0) rotate(1.5deg); } }
.room__glow { position: absolute; inset: 0; background: radial-gradient(ellipse 45% 38% at 50% 46%, rgba(var(--sunlight), 0.14), transparent 70%), radial-gradient(ellipse 120% 90% at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.55) 100%); }
.room__dust i {
  position: absolute; width: 3px; height: 3px; border-radius: 50%;
  background: rgba(var(--sunlight), 0.55); filter: blur(0.6px);
  animation: dust 22s linear infinite;
}
.room__dust i:nth-child(1) { left: 62%; top: 22%; animation-delay: -3s; }
.room__dust i:nth-child(2) { left: 70%; top: 40%; animation-delay: -9s; animation-duration: 28s; }
.room__dust i:nth-child(3) { left: 55%; top: 30%; animation-delay: -15s; width: 2px; height: 2px; }
.room__dust i:nth-child(4) { left: 78%; top: 18%; animation-delay: -6s; animation-duration: 31s; }
.room__dust i:nth-child(5) { left: 66%; top: 55%; animation-delay: -12s; width: 2px; height: 2px; }
.room__dust i:nth-child(6) { left: 48%; top: 14%; animation-delay: -18s; animation-duration: 26s; }
.room__dust i:nth-child(7) { left: 74%; top: 30%; animation-delay: -1s; width: 4px; height: 4px; opacity: 0.6; }
.room__dust i:nth-child(8) { left: 58%; top: 48%; animation-delay: -21s; }
@keyframes dust {
  0% { transform: translate3d(0, 0, 0); opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { transform: translate3d(-90px, 140px, 0); opacity: 0; }
}

/* ---------- top bar ---------- */
.bar {
  position: relative; z-index: 20;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  /* viewport-fit=cover: keep the bar clear of the notch in landscape. */
  padding: 0 max(clamp(16px, 3vw, 36px), env(safe-area-inset-right)) 0 max(clamp(16px, 3vw, 36px), env(safe-area-inset-left));
  background: linear-gradient(to bottom, rgba(10, 6, 4, 0.7), transparent);
}
.bar__brand { font: 900 1.45rem/1 var(--display); letter-spacing: -0.02em; text-decoration: none; justify-self: start; }
.bar__brand em { font-weight: 400; font-style: italic; color: var(--amber); }
.bar__title { margin: 0; display: flex; flex-direction: column; align-items: center; text-align: center; line-height: 1.2; }
.bar__title span:first-child { font: 600 0.72rem/1.2 var(--ui); letter-spacing: 0.3em; text-transform: uppercase; color: var(--cream-soft); }
.bar__issue { font: italic 400 1rem/1.3 var(--display); }
.bar__tools { justify-self: end; display: flex; align-items: center; gap: 8px; }
.tool, .bag-link {
  display: inline-grid; place-items: center; height: 40px; min-width: 40px; padding: 0 10px;
  border: 1px solid rgba(251, 246, 236, 0.22); border-radius: 999px;
  background: rgba(20, 12, 8, 0.4); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: background 0.25s, border-color 0.25s, transform 0.2s var(--ease-out);
}
.tool:hover, .bag-link:hover { background: rgba(251, 246, 236, 0.12); border-color: rgba(251, 246, 236, 0.45); }
.tool:active, .bag-link:active { transform: scale(0.96); }
.tool svg, .bag-link svg { width: 20px; height: 20px; }
.tool .tool__mute { display: none; }
.tool.is-off .tool__wave { display: none; }
.tool.is-off .tool__mute { display: inline; }
.bag-link { display: inline-flex; gap: 8px; text-decoration: none; padding: 0 14px; font-size: 0.86rem; font-weight: 500; }
.bag-link__count { min-width: 22px; height: 22px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 999px; background: var(--amber); color: var(--ink); font-size: 0.74rem; font-weight: 700; }

/* ---------- stage and book ---------- */
.reading { position: relative; z-index: 1; display: grid; grid-template-rows: 1fr auto auto; min-height: 0; }
.stage {
  position: relative; min-height: 0; min-width: 0;
  display: flex; overflow: hidden; overflow: clip;
  padding: 12px 0 18px;
}
.stage.is-zoomed { overflow: auto; cursor: grab; touch-action: pan-x pan-y; scrollbar-width: thin; scrollbar-color: rgba(251, 246, 236, 0.3) transparent; }
.book {
  --pw: 420px; --ph: 560px; --shift: 0; --stack-l: 0; --stack-r: 1;
  position: relative; flex: none; margin: auto;
  width: calc(var(--pw) * 2); height: var(--ph);
  font-size: calc(var(--pw) / 50);
  --u: calc(var(--pw) / 50);
  transform: translateX(calc(var(--shift) * var(--pw)));
  transition: transform 0.95s var(--ease-film);
  user-select: none; -webkit-user-select: none;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none; /* no "Save image" sheet when a thumb rests on a photo mid-swipe */
}
.stage.is-zoomed .book { touch-action: pan-x pan-y; }
.book[data-mode='single'] { width: var(--pw); }
.js .book { opacity: 0; }
/* Set down on the desk. Individual transform properties, so the cover-centring shift keeps working. */
.is-ready .book { opacity: 1; animation: arrive 1.3s var(--ease-out) backwards; }
@keyframes arrive {
  from { opacity: 0; translate: 0 60px; rotate: x 18deg; scale: 0.92; filter: blur(4px); }
}

/* The soft shadow the magazine throws on the desk. Follows the visible half when closed. */
.book__shadow {
  position: absolute; top: 1%; bottom: -1%; left: 0; right: 0;
  border-radius: 4px;
  box-shadow: 0 30px 50px -10px rgba(0, 0, 0, 0.75), 0 12px 18px -6px rgba(0, 0, 0, 0.5), 0 60px 120px 10px rgba(0, 0, 0, 0.45);
  transition: left 0.95s var(--ease-film), right 0.95s var(--ease-film);
}
.book.is-closed-front .book__shadow { left: 50%; }
.book.is-closed-back .book__shadow { right: 50%; }

/* Page-block thickness: thin stacked paper edges that grow on one side as you read. */
.book::before, .book::after {
  content: ''; position: absolute; top: 3px; bottom: 3px; z-index: 0; pointer-events: none;
  background: repeating-linear-gradient(to right, #efe8db 0 1px, #c9bea9 1px 2px);
  transition: width 0.6s var(--ease-out);
}
.book::before { right: 100%; width: calc(var(--stack-l) * 7px); border-radius: 3px 0 0 3px; box-shadow: -2px 3px 4px rgba(0, 0, 0, 0.35); }
.book::after { left: 100%; width: calc(var(--stack-r) * 7px); border-radius: 0 3px 3px 0; box-shadow: 2px 3px 4px rgba(0, 0, 0, 0.35); }
.book.is-closed-front::before, .book.is-closed-back::after, .book[data-mode='single']::before { width: 0; }
/* Closed, the piles sit on the cover's outer edge, not the empty half. */
.book.is-closed-front::after { left: 100%; }
.book.is-closed-back::before { right: 100%; }

.book__leaves { position: absolute; top: 0; bottom: 0; left: var(--pw); width: var(--pw); z-index: 1; }
.book[data-mode='single'] .book__leaves { left: 0; }
.book.is-dragging { cursor: grabbing; }

.leaf {
  position: absolute; inset: 0;
  transform-origin: 0 50%;
  transform-style: preserve-3d;
  will-change: transform;
}
/* Out of the render tree, not just invisible: iOS keeps layers and decoded photos for hidden sheets. */
.leaf.is-away { display: none; }
/* The face turned away is hidden outright; WebKit's backface-visibility lets its layered children show through. */
.leaf:not(.is-turned) > .face--back, .leaf.is-turned > .face--front { visibility: hidden; }
.leaf.is-peeling { transition: transform 0.35s var(--ease-out); }
.face {
  position: absolute; inset: 0; overflow: hidden;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: var(--paper);
}
.face--back { transform: rotateY(180deg); }
/* Lighting while a sheet is in the air: the far edge darkens as it turns from the light,
 * a highlight rides across the curve of the paper. */
.face__shade { position: absolute; inset: 0; pointer-events: none; z-index: 30; }
.face--front .face__shade { background: linear-gradient(to right, rgba(24, 14, 6, 0.2), rgba(24, 14, 6, 0.55) 55%, rgba(24, 14, 6, 0.9)); opacity: var(--front-shade, 0); }
.face--back .face__shade { background: linear-gradient(to left, rgba(24, 14, 6, 0.2), rgba(24, 14, 6, 0.55) 55%, rgba(24, 14, 6, 0.9)); opacity: var(--back-shade, 0); }
.face__shade::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to right, transparent calc(var(--sheen, 0%) - 22%), rgba(255, 248, 230, 0.32) var(--sheen, 0%), transparent calc(var(--sheen, 0%) + 22%));
  opacity: var(--lift, 0);
}

/* Shadow a lifted sheet throws onto the page beneath it, just past its edge. */
.cast { position: absolute; top: 0; bottom: 0; width: 100%; z-index: 400; pointer-events: none; opacity: 0; }
.cast--right { left: 0; background: linear-gradient(to right, transparent var(--edge, 100%), rgba(10, 5, 2, 0.5) var(--edge, 100%), rgba(10, 5, 2, 0.16) calc(var(--edge, 100%) + 10%), transparent calc(var(--edge, 100%) + 32%)); }
.cast--left { right: 100%; background: linear-gradient(to left, transparent var(--edge, 100%), rgba(10, 5, 2, 0.5) var(--edge, 100%), rgba(10, 5, 2, 0.16) calc(var(--edge, 100%) + 10%), transparent calc(var(--edge, 100%) + 32%)); }
.book[data-mode='single'] .cast--left { display: none; }

/* ---------- the paper itself ---------- */
.page { position: absolute; inset: 0; overflow: hidden; background: var(--grain), var(--paper); color: var(--ink); }
.page--blank { background: var(--grain), linear-gradient(to left, #ece5d8, var(--paper) 30%); }
/* The fold: right-hand pages darken toward the spine on their left, left-hand pages on their right. */
.page__gutter { position: absolute; inset: 0; pointer-events: none; z-index: 20; }
.page--right .page__gutter { background: linear-gradient(to right, rgba(20, 10, 4, 0.42), rgba(20, 10, 4, 0.12) 3.5%, rgba(20, 10, 4, 0.03) 9%, transparent 14%), linear-gradient(to left, rgba(0, 0, 0, 0.08), transparent 2%); }
.page--left .page__gutter { background: linear-gradient(to left, rgba(20, 10, 4, 0.42), rgba(20, 10, 4, 0.12) 3.5%, rgba(20, 10, 4, 0.03) 9%, transparent 14%), linear-gradient(to right, rgba(0, 0, 0, 0.08), transparent 2%); }
.page--single .page__gutter { background: linear-gradient(to right, rgba(20, 10, 4, 0.3), rgba(20, 10, 4, 0.06) 3%, transparent 8%); }
/* The paper's curve catches a little light just off the fold. */
.page__gloss { position: absolute; inset: 0; pointer-events: none; z-index: 21; }
.page--right .page__gloss, .page--single .page__gloss { background: linear-gradient(to right, transparent 4%, rgba(255, 255, 255, 0.14) 8%, transparent 17%); }
.page--left .page__gloss { background: linear-gradient(to left, transparent 4%, rgba(255, 255, 255, 0.14) 8%, transparent 17%); }

/* ---------- reader controls ---------- */
.reader {
  justify-self: center; z-index: 10;
  display: flex; align-items: center; gap: 10px;
  width: min(560px, calc(100% - 32px));
  padding: 8px;
  border: 1px solid rgba(251, 246, 236, 0.16); border-radius: 999px;
  background: rgba(18, 11, 7, 0.55); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.8);
}
.reader__turn, .reader__zoom {
  flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%;
  border: 0; background: var(--cream); color: var(--ink);
  transition: transform 0.25s var(--ease-out), background 0.25s, opacity 0.25s;
}
.reader__turn svg { width: 24px; height: 24px; transition: transform 0.25s var(--ease-out); }
.reader__turn:hover:not(:disabled) { background: #fff; }
.reader__turn:hover:not(:disabled) svg { transform: translateX(-3px); }
.reader__turn--next:hover:not(:disabled) svg { transform: translateX(3px); }
.reader__turn:active:not(:disabled) { transform: scale(0.94); }
.reader__turn:disabled { opacity: 0.28; cursor: default; }
.reader__turn--next { background: var(--amber); }
.reader__turn--next:hover:not(:disabled) { background: #ffb347; }
.reader__zoom { width: 44px; height: 44px; background: transparent; color: var(--cream); border: 1px solid rgba(251, 246, 236, 0.24); }
.reader__zoom svg { width: 20px; height: 20px; }
.reader__zoom:hover { background: rgba(251, 246, 236, 0.1); }
.reader__zoom[aria-pressed='true'] { background: var(--cream); color: var(--ink); }
.reader__zoom[aria-pressed='true'] .reader__zoom-plus { display: none; }
.reader__mid { flex: 1; min-width: 0; display: grid; gap: 6px; padding: 0 6px; }
.reader__label { margin: 0; text-align: center; font: italic 400 1rem/1.1 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader__scrub {
  --fill: 0%;
  -webkit-appearance: none; appearance: none; width: 100%; height: 20px; margin: 0; background: transparent; cursor: pointer;
}
.reader__scrub::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: linear-gradient(to right, var(--amber) var(--fill), rgba(251, 246, 236, 0.22) var(--fill)); }
.reader__scrub::-moz-range-track { height: 3px; border-radius: 3px; background: linear-gradient(to right, var(--amber) var(--fill), rgba(251, 246, 236, 0.22) var(--fill)); }
.reader__scrub::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6.5px; border-radius: 50%; background: var(--cream); border: 3px solid var(--amber); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4); }
.reader__scrub::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--cream); border: 3px solid var(--amber); }
.hint { margin: 10px 0 14px; text-align: center; font-size: 0.8rem; color: var(--cream-soft); }
.hint kbd { font: inherit; padding: 1px 6px; border: 1px solid rgba(251, 246, 236, 0.3); border-radius: 4px; }
.noscript { text-align: center; color: var(--cream); }
.boot-error { margin: auto; padding: 0 24px; }
.boot-failed .book { display: none; }
/* Touch: a thumb-sized handle on the page scrubber. */
@media (pointer: coarse) {
  .reader__scrub { height: 32px; }
  .reader__scrub::-webkit-slider-thumb { width: 26px; height: 26px; margin-top: -11.5px; }
}

/* ---------- shop-the-page picker ---------- */
.pick { padding: 0; border: 0; background: transparent; color: var(--ink); max-width: none; max-height: none; width: 100%; height: 100%; overflow: hidden; }
.pick::backdrop { background: rgba(8, 4, 2, 0); backdrop-filter: blur(0); transition: background 0.35s, backdrop-filter 0.35s; }
.pick.is-open::backdrop { background: rgba(8, 4, 2, 0.6); backdrop-filter: blur(6px); }
.pick:not([open]) { display: none; }
.pick[open] { display: grid; place-items: center; }
/* iOS before 15.4: no top layer or ::backdrop, so the dialog lays itself over the page. */
.pick.is-fallback { position: fixed; inset: 0; z-index: 250; margin: 0; background: rgba(8, 4, 2, 0.6); }
.pick__panel {
  position: relative; width: min(820px, calc(100% - 32px)); max-height: calc(100dvh - 48px); overflow: auto;
  background: var(--grain), var(--paper); border-radius: 4px;
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.8);
  opacity: 0; transform: translateY(24px) rotate(-0.8deg) scale(0.97);
  transition: opacity 0.32s var(--ease-out), transform 0.42s var(--ease-out);
}
.pick.is-open .pick__panel { opacity: 1; transform: none; }
.pick.is-closing .pick__panel { opacity: 0; transform: translateY(16px) scale(0.98); }
.pick__close { position: absolute; top: 12px; right: 12px; z-index: 2; width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(251, 246, 236, 0.9); }
.pick__close svg { width: 20px; height: 20px; }
.pick__body { display: grid; grid-template-columns: 1fr 1.1fr; }
.pick__img { width: 100%; height: 100%; min-height: 360px; object-fit: cover; object-position: 50% 15%; background: #e4dccd; }
.pick__form { padding: 36px 32px 28px; display: flex; flex-direction: column; gap: 14px; }
.pick__kicker { margin: 0; font: 600 0.72rem/1.2 var(--ui); letter-spacing: 0.22em; text-transform: uppercase; color: var(--red); }
.pick__title { margin: 0; font: 700 2.1rem/1 var(--display); letter-spacing: -0.02em; }
.pick__price { margin: 0; font: 700 1.1rem/1.2 var(--ui); }
.pick__price s { font-weight: 400; opacity: 0.5; margin-left: 4px; }
.pick__price b { margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: var(--red); color: #fff; font-size: 0.74rem; letter-spacing: 0.04em; }
.pick__story { margin: 0; font: 400 1.05rem/1.5 var(--body); color: var(--ink-soft); }
.pick__chips { margin: 0; padding: 0; border: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pick__chips legend { width: 100%; margin-bottom: 8px; font: 600 0.72rem/1 var(--ui); letter-spacing: 0.18em; text-transform: uppercase; }
.pick__chip input { position: absolute; opacity: 0; pointer-events: none; }
.pick__chip span { display: inline-grid; place-items: center; min-width: 46px; height: 40px; padding: 0 14px; border: 1px solid rgba(23, 17, 13, 0.25); border-radius: 999px; font-size: 0.9rem; cursor: pointer; transition: background 0.2s, color 0.2s, border-color 0.2s; }
.pick__chip span:hover { border-color: var(--ink); }
.pick__chip input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--cream); }
.pick__chip input:focus-visible + span { outline: 2px solid var(--amber); outline-offset: 2px; }
.pick__add { margin-top: 6px; height: 52px; border: 0; border-radius: 999px; background: var(--ink); color: var(--cream); font-weight: 700; letter-spacing: 0.04em; transition: background 0.2s, transform 0.2s var(--ease-out); }
.pick__add:hover { background: var(--red); }
.pick__add:active { transform: scale(0.98); }
.pick__more { align-self: center; font-size: 0.86rem; color: var(--ink-soft); }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--reader-h) + 40px); z-index: 200;
  max-width: calc(100% - 32px); padding: 12px 20px; border-radius: 999px;
  background: var(--cream); color: var(--ink); font-size: 0.92rem; font-weight: 500;
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.7);
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  transition: opacity 0.3s, transform 0.4s var(--ease-out);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast:empty { visibility: hidden; }

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  :root { --bar-h: 56px; }
  .bar { grid-template-columns: auto 1fr auto; gap: 10px; }
  .bar__title { align-items: flex-start; text-align: left; }
  .bar__issue { display: none; }
  .tool--wide-only, .bag-link__label { display: none; }
  .bag-link { padding: 0 10px; }
  .reader { gap: 6px; padding: 6px; }
  .reader__turn { width: 46px; height: 46px; }
  .reader__zoom { width: 40px; height: 40px; }
  .hint { display: none; }
  .reading { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .pick[open] { place-items: end center; }
  .pick__panel { width: 100%; max-height: 92dvh; border-radius: 16px 16px 0 0; transform: translateY(40px); }
  .pick__body { grid-template-columns: 1fr; }
  .pick__img { min-height: 0; height: 34vh; }
  .pick__form { padding: 22px 20px 26px; }
  .pick__title { font-size: 1.7rem; }
}

/* ---------- phones on their side: give the page every pixel of height ---------- */
@media (max-height: 500px) {
  :root { --bar-h: 46px; }
  .bar__issue, .hint { display: none; }
  .tool, .bag-link { height: 36px; min-width: 36px; }
  .stage { padding: 2px 0 6px; }
  .reader { gap: 6px; padding: 4px; }
  .reader__turn { width: 40px; height: 40px; }
  .reader__zoom { width: 36px; height: 36px; }
  .reader__mid { gap: 0; }
  .reader__label { font-size: 0.85rem; }
  .reading { padding-bottom: max(6px, env(safe-area-inset-bottom)); }
}

/* ---------- reduced motion ---------- */
.reduced .room__blinds, .reduced .room__dust i { animation: none; }
.reduced .room__dust { display: none; }
.reduced .is-ready .book, .reduced .book { animation: none; transition: none; }
.reduced .book__shadow, .reduced .pick__panel, .reduced .pick::backdrop { transition: none; }
