/* giveaway — scroll-cinema magazine site
   ───────────────────────────────────── */

:root {
  /* Neutraal off-white, geen gele undertone — Vogue/Apartamento gevoel */
  --bg: #f3f2ef;
  --bg-soft: #ebeae6;
  --bg-paper: #f7f5f1;          /* iets warmer, voor de brief */
  --ink: #111111;
  --ink-soft: #5a5a5a;
  --line: #e1e0db;
  --line-strong: #c5c3bd;
  --shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.25),
            0 8px 20px -10px rgba(0, 0, 0, 0.12);

  /* Logo: Didot LT Pro Bold (lokaal) → Bodoni Moda Bold (Google Fonts) → systeem */
  --serif-display: "Didot LT Pro", "Didot LT Std", "Linotype Didot",
                   "Bodoni Moda", "Didot", "Bodoni 72", "Times New Roman", serif;
  --serif-editorial: "Bodoni Moda", "Didot LT Pro", "Didot", "Times New Roman", serif;
  --hand: "Caveat", "Bradley Hand", "Segoe Script", cursive;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;

  --topbar-h: 76px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Page-level scrollbar overal verbergen (magazine + cover). Scrollen werkt nog. */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
html::-webkit-scrollbar,
body::-webkit-scrollbar { display: none; width: 0; height: 0; }

/* Tijdens het cover-scherm: scrollen blokkeren.
   Na portaal: scrollen geactiveerd door .is-reading. */
body.is-cover { overflow: hidden; }
body.is-reading { overflow: visible; }

img { display: block; max-width: 100%; }

/* ───────── Splash loader: cover-bg + drift + Enter ───────── */
.site-loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #14120e;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 1s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.site-loader.is-hidden {
  opacity: 0;
  pointer-events: none;
}

/* Ingezoomde, geblurrede cover als achtergrond, traag driftend zodat je
   verschillende delen van de cover voorbij ziet komen. */
.site-loader-bg {
  position: absolute;
  inset: 0;
}
.site-loader-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;     /* anchor: top van de cover-image */
  filter: blur(48px) brightness(0.72) saturate(1.1);
  transform-origin: center top;    /* schaling vanaf top, blijft dus aan de top hangen */
  animation: loader-drift 36s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite alternate;
  will-change: transform, filter;
}
@keyframes loader-drift {
  /* Start aan de top van de cover en drift langzaam naar dieper liggende
     delen. Y is ALTIJD ≤ 0 zodat de bovenkant van de image nooit van de
     viewport-top af zakt (anders zou de donkere bg er onderdoor komen).
     X is klein genoeg dat de zijkanten ook nooit zichtbaar worden. */
  0%   { transform: scale(1.7)  translate(0%,    0%);  }
  20%  { transform: scale(1.85) translate(3%,  -10%);  }
  40%  { transform: scale(1.7)  translate(-3%, -22%);  }
  60%  { transform: scale(1.85) translate(4%,  -32%);  }
  80%  { transform: scale(1.95) translate(-2%, -18%);  }
  100% { transform: scale(1.75) translate(2%,   -8%);  }
}

/* Donker veil zodat het logo helder leesbaar blijft op iedere bg-frame */
.site-loader-veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(0,0,0,0.15), rgba(0,0,0,0.55) 75%),
    rgba(0,0,0,0.18);
  pointer-events: none;
}

.site-loader-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 64px;
  animation: site-loader-in 1.1s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.site-loader-mark {
  position: relative;
  font-family: var(--serif-display);
  font-weight: 700;
  font-size: 132px;
  letter-spacing: -0.1em;
  color: #fff;
  line-height: 1;
  /* Alleen een zachte drop-shadow voor leesbaarheid, geen glow */
  text-shadow: 0 4px 40px rgba(0, 0, 0, 0.45);
  animation: mark-breathe 6s ease-in-out infinite;
  will-change: transform;
}
@keyframes mark-breathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.012); }
}

/* Vaste-hoogte container voor pulse + Enter zodat het logo NIET verschuift
   zodra de knop verschijnt. Beide elementen overlappen op dezelfde positie. */
.site-loader-bottom {
  position: relative;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-loader-pulse {
  display: block;
  position: relative;
  width: 220px;
  height: 1px;
  background: rgba(255,255,255,0.18);
  overflow: hidden;
  transition: opacity 0.3s ease;
}
.site-loader-pulse > span {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 35%;
  background: rgba(255,255,255,0.85);
  animation: loader-pulse 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
.site-loader-pulse[hidden] { display: none; }

.site-loader-enter {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: #fff;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.6);
  padding: 14px 38px;
  cursor: pointer;
  outline: 0;
  transition: background 0.3s ease, border-color 0.3s ease, letter-spacing 0.3s ease, color 0.3s ease;
  animation: enter-fade-in 0.85s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
.site-loader-enter[hidden] { display: none; }
.site-loader-enter:hover {
  background: #fff;
  color: #14120e;
  border-color: #fff;
  letter-spacing: 0.42em;
}
.site-loader-enter:focus-visible {
  outline: 1px solid #fff;
  outline-offset: 4px;
}

/* Reveal-animatie wanneer de loader fade-uit (na Enter): bg zoomt verder in,
   inner-content fade-out met lichte upward drift. */
.site-loader.is-hidden .site-loader-bg img {
  transform: scale(2.4);
  filter: blur(72px) brightness(0.55);
  transition: transform 1.1s cubic-bezier(0.22, 0.61, 0.36, 1),
              filter    1.1s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.site-loader.is-hidden .site-loader-inner {
  opacity: 0;
  transform: translateY(-14px) scale(1.04);
  transition: opacity 0.7s ease,
              transform 1s cubic-bezier(0.22, 0.61, 0.36, 1);
}

@keyframes site-loader-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes loader-pulse {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(370%); }
}
@keyframes enter-fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 720px) {
  .site-loader-mark  { font-size: 78px; }
  .site-loader-inner { gap: 42px; }
  .site-loader-enter { padding: 12px 30px; font-size: 10px; }
  .site-loader-pulse { width: 160px; }
}

/* ───────── Topbar ───────── */

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--topbar-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 24px;
  background: rgba(243, 242, 239, 0.85);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid rgba(225, 224, 219, 0.55);
  z-index: 105;
  pointer-events: auto;
}
.topbar-spacer { display: block; }

.brand {
  font-family: var(--serif-display);
  font-weight: 700;
  font-size: 34px;
  letter-spacing: -0.1em;
  color: var(--ink);
  text-decoration: none;
  justify-self: center;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  height: 100%;
  /* Optical centering: cap-height van Didot zit iets boven het midden,
     dus 1px naar beneden voor visuele balans met de iconen. */
  padding-top: 2px;
  user-select: none;
}

.icon-btn {
  background: transparent;
  border: 0;
  padding: 8px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink);
  border-radius: 999px;
  transition: background 0.18s ease;
}
.icon-btn:hover { background: rgba(0, 0, 0, 0.05); }
.icon-btn:focus-visible { outline: 1px solid var(--ink); outline-offset: 2px; }

.icon-btn:first-of-type { justify-self: start; }
.icon-btn.info { justify-self: end; }

/* Brand-icon links in de topbar (eerste grid-kolom).
   Padding zorgt voor wat zwarte ademruimte rondom het logo. */
.brand-icon {
  justify-self: start;
  width: 40px;
  height: 40px;
  max-width: 40px;
  max-height: 40px;
  background: #000;
  border-radius: 9px;
  padding: 6px;
  object-fit: contain;
  object-position: center;
  display: block;
  box-sizing: border-box;
}

.hamburger,
.hamburger::before,
.hamburger::after {
  content: "";
  display: block;
  width: 26px;
  height: 1.4px;
  background: var(--ink);
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.hamburger { position: relative; }
.hamburger::before { position: absolute; top: -8px; left: 0; }
.hamburger::after  { position: absolute; top:  8px; left: 0; }

.icon-btn[aria-expanded="true"] .hamburger { background: transparent; }
.icon-btn[aria-expanded="true"] .hamburger::before { transform: translateY(8px) rotate(45deg); }
.icon-btn[aria-expanded="true"] .hamburger::after  { transform: translateY(-8px) rotate(-45deg); }

.info-glyph {
  font-family: var(--serif-editorial);
  font-style: italic;
  font-weight: 400;
  font-size: 26px;
  line-height: 1;
  /* Optical centering: italic "i" heeft een lage stip boven en zware
     baseline; 1px omhoog brengt 'm visueel in lijn met de andere icons. */
  transform: translateY(-1px);
}

/* ───────── Sidebar ───────── */

/* Sidebar = permanente verticale strip met cover-cards aan de linkerkant.
   Boven cover-screen (100) zodat-ie zichtbaar is, onder topbar (105) zodat
   de logo/info-knoppen niet door de sidebar worden bedekt. */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 220px;
  background: var(--bg);
  transform: translateX(-100%);
  transition: transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1),
              width     0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
  z-index: 102;
}
/* Collapsed-state: smal, alleen kleine cover-thumbs blijven zichtbaar */
.sidebar.is-collapsed {
  width: 88px;
}
body.is-cover  .sidebar { transform: translateX(0); }
body.is-reading .sidebar { transform: translateX(-100%); }
/* Boot-class: forceer hidden op eerste paint, zodat transition de slide-in pakt */
body.boot .sidebar { transform: translateX(-100%) !important; }

.sidebar-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: calc(var(--topbar-h) + 22px) 22px 22px;
  transition: padding 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.sidebar.is-collapsed .sidebar-inner {
  padding: calc(var(--topbar-h) + 18px) 12px 18px;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 16px 0;
  min-height: 24px;
}

.sidebar-label {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  white-space: nowrap;
  transition: opacity 0.25s ease;
}

.sidebar-toggle {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--ink-soft);
  border-radius: 999px;
  transition: color 0.2s ease, background 0.2s ease, transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.sidebar-toggle:hover {
  color: var(--ink);
  background: rgba(0, 0, 0, 0.04);
}
.sidebar.is-collapsed .sidebar-toggle {
  transform: rotate(180deg);
}

/* In collapsed-state: label, meta-block (N° + datum) en footer faden uit.
   De thumbs zelf blijven zichtbaar zodat je nog steeds op een nummer kan klikken. */
.sidebar.is-collapsed .sidebar-label,
.sidebar.is-collapsed .sidebar-foot,
.sidebar.is-collapsed .edition-btn .meta-block {
  opacity: 0;
  pointer-events: none;
  max-height: 0;
  margin: 0;
  overflow: hidden;
  transition: opacity 0.2s ease, max-height 0.3s ease, margin 0.3s ease;
}
.sidebar-label,
.sidebar-foot,
.edition-btn .meta-block {
  transition: opacity 0.3s ease 0.15s, max-height 0.3s ease 0.15s, margin 0.3s ease 0.15s;
  max-height: 60px;
}
/* In collapsed: tighter spacing tussen cards */
.sidebar.is-collapsed .edition-list { gap: 12px; }
.sidebar.is-collapsed .edition-btn { gap: 0; }

.edition-list {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  overflow-y: auto;
  /* Scrollbar verbergen maar scrollen behouden */
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;       /* IE/Edge */
}
.edition-list::-webkit-scrollbar { display: none; }  /* Chrome/Safari */
.edition-list li + li { margin-top: 2px; }
/* Items altijd zichtbaar — geen entry-animatie meer. */

/* Card-style edition button: cover-thumb full-width op de strip, label eronder */
.edition-btn {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-family: var(--sans);
  color: var(--ink);
}
.edition-btn .thumb {
  width: 100%;
  aspect-ratio: 0.74;
  background: var(--bg-soft);
  overflow: hidden;
  box-shadow:
    0 10px 22px -12px rgba(0,0,0,0.35),
    0 3px 6px -3px rgba(0,0,0,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1),
              box-shadow 0.45s ease;
}
.edition-btn .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.edition-btn .thumb-fallback {
  font-family: var(--serif-editorial);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
}
.edition-btn .meta-block {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 0 2px;
}
.edition-btn .num {
  font-family: var(--serif-editorial);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.01em;
  line-height: 1;
  color: var(--ink);
}
.edition-btn .date {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.edition-btn:hover .thumb { transform: translateY(-2px); }
.edition-btn:hover .thumb img { transform: scale(1.04); }
.edition-btn:hover .num { font-style: italic; }

.edition-btn[aria-current="true"] .num { font-style: italic; }
.edition-btn[aria-current="true"] .thumb {
  outline: 1px solid var(--ink);
  outline-offset: 3px;
}

.edition-btn.is-coming { cursor: default; opacity: 0.5; }
.edition-btn.is-coming:hover .thumb { transform: none; }
.edition-btn.is-coming:hover .thumb img { transform: none; }
.edition-btn.is-coming:hover .num { font-style: normal; }

.sidebar-foot {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 24px 0 0 0;
}

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 14, 0.28);
  /* Boven cover (100) zodat scrim klikbaar is in beide modes */
  z-index: 112;
  opacity: 0;
  transition: opacity 0.28s ease;
}
.scrim.is-visible { opacity: 1; }

/* ───────── Cover landing ───────── */

.cover-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  perspective: 1400px;
  overflow: hidden;
  cursor: pointer;
  transition: opacity 0.35s ease;
}
/* Cover blijft in het midden van het scherm — sidebar is een lichte
   overlay aan de linkerkant, niet een layout-blok dat de cover verschuift. */
body.is-reading .cover-screen { opacity: 0; pointer-events: none; }

.cover-stage {
  position: relative;
  width: min(70vw, 70vh * 0.74);
  aspect-ratio: 0.74;
  transform-style: preserve-3d;
  will-change: transform, opacity, filter;
  box-shadow: var(--shadow);
}
@media (max-aspect-ratio: 1/1) {
  .cover-stage { width: min(86vw, 92vh * 0.74); }
}

.cover-art {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #1a1a1a;
}
.cover-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ───────── Wormhole / portaal ───────── */

.wormhole {
  position: fixed;
  inset: 0;
  z-index: 110;
  pointer-events: none;
  overflow: hidden;
  perspective: 600px;
  perspective-origin: 50% 50%;
  opacity: 0;
}
.wh-tunnel {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wh-ring {
  position: absolute;
  width: 80vmax;
  height: 80vmax;
  border: 1px solid rgba(17, 17, 17, 0.5);
  border-radius: 2px;
  transform: translateZ(0) scale(0.05);
  opacity: 0;
}
.wh-flash {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
}

/* ───────── Magazine — scroll cinema ───────── */

.magazine {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
  opacity: 0;
  transition: opacity 0.4s ease 0.2s;
}
body.is-reading .magazine { opacity: 1; }

.pages-track {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

/* Pages liggen in een 2-kolom Z-grid. JS positioneert ze op
   left = col*100vw, top = row*100vh, zodat de pages-track als
   een grote canvas werkt waar de camera doorheen pant. */
.page {
  position: absolute;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--topbar-h) + 12px) 5vw 60px;
  pointer-events: none;
}

.page-card {
  position: relative;
  /* Zelfde formaat als de cover */
  width: min(70vw, calc(82vh * 0.74));
  aspect-ratio: 0.74;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  cursor: zoom-in;
  transition: transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1),
              box-shadow 0.4s ease;
}
.page-card:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow:
    0 40px 80px -30px rgba(0, 0, 0, 0.32),
    0 14px 28px -14px rgba(0, 0, 0, 0.18);
}

.page-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.page-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 40px;
  text-align: center;
}
.page-fallback .label {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.page-fallback .num {
  font-family: var(--serif-editorial);
  font-weight: 700;
  font-size: 96px;
  line-height: 1;
}
.page-fallback .hint {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-soft);
  max-width: 36ch;
  line-height: 1.5;
}

.page-folio {
  position: absolute;
  bottom: 18px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--serif-editorial);
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--ink-soft);
}

.page-counter {
  position: fixed;
  bottom: 24px;
  left: 28px;
  z-index: 30;
  font-family: var(--serif-editorial);
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
body.is-reading .page-counter { opacity: 1; }

/* ───────── Page-zoom modal ───────── */

.page-modal {
  border: 0;
  padding: 0;
  margin: 0;
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  background: rgba(20, 18, 14, 0.94);
  color: var(--ink);
}
.page-modal::backdrop { background: rgba(20, 18, 14, 0.94); }
.page-modal[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close {
  position: fixed;
  top: 18px;
  right: 22px;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.modal-close:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.5); }

.modal-page {
  width: min(85vw, calc(92vh * 0.74));
  aspect-ratio: 0.74;
  background: #fff;
  overflow: hidden;
  box-shadow:
    0 80px 120px -50px rgba(0, 0, 0, 0.7),
    0 20px 40px -20px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modal-rise 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.modal-page > * {
  width: 100%;
  height: 100%;
  cursor: default;
  box-shadow: none;
  transform: none !important;
}

@keyframes modal-rise {
  from { transform: translateY(20px) scale(0.96); opacity: 0; }
  to   { transform: translateY(0)    scale(1);    opacity: 1; }
}

/* ───────── Info dialog als brief ───────── */

.info-dialog {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: 560px;
  width: calc(100% - 32px);
  perspective: 1400px;
  /* Geen focus-outline rond de dialog zelf */
  outline: 0;
}
.info-dialog:focus { outline: 0; }
.info-dialog::backdrop {
  background: rgba(20, 18, 14, 0.55);
  backdrop-filter: blur(3px);
  animation: letter-backdrop 0.5s ease both;
}
.info-dialog[open] {
  display: block;
  position: fixed;
  inset: 0;
  margin: auto;
}
.info-dialog[open] .letter-paper {
  transform-origin: 50% 0%;
  animation: letter-open 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

@keyframes letter-open {
  0% {
    opacity: 0;
    transform: translateY(40px) rotateX(-65deg) scale(0.9);
  }
  60% {
    opacity: 1;
    transform: translateY(0) rotateX(8deg) scale(1.005);
  }
  100% {
    opacity: 1;
    transform: translateY(0) rotateX(0deg) scale(1);
  }
}
@keyframes letter-backdrop {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.letter-paper {
  position: relative;
  background-color: var(--bg-paper);
  padding: 56px 52px 44px;
  border: 1px solid var(--line);
  box-shadow:
    0 40px 80px -40px rgba(0, 0, 0, 0.35),
    0 12px 28px -16px rgba(0, 0, 0, 0.18);
  /* Subtiele papier-textuur: SVG-grain bovenop + zachte radial gradients */
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.92' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.55 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/></svg>"),
    radial-gradient(ellipse at 18% 0%, rgba(0,0,0,0.03), transparent 60%),
    radial-gradient(ellipse at 82% 100%, rgba(0,0,0,0.025), transparent 55%);
  background-size: 180px 180px, auto, auto;
  background-blend-mode: multiply, normal, normal;
}

.dialog-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: transparent;
  border: 0;
  font-size: 24px;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
  width: 32px;
  height: 32px;
  z-index: 2;
  outline: 0;
  -webkit-tap-highlight-color: transparent;
}
.dialog-close:hover { color: var(--ink); }
/* Alleen toetsenbord-gebruikers krijgen een focus-ring, geen blauw kader bij klik */
.dialog-close:focus { outline: 0; }
.dialog-close:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 2px;
  border-radius: 2px;
}

.letter-date {
  display: block;
  margin: 0 0 28px 0;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-align: right;
  text-decoration: none;
  /* Bewust discreet: geen pointer/hover, voelt aan als gewone tekst voor bezoekers. */
  cursor: default;
  -webkit-tap-highlight-color: transparent;
}
a.letter-date:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 4px;
}

.letter-greeting {
  font-family: var(--serif-editorial);
  font-style: italic;
  font-weight: 400;
  font-size: 38px;
  letter-spacing: 0.01em;
  margin: 0 0 22px 0;
  line-height: 1;
}

.letter-body p {
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--ink);
  margin: 0 0 14px 0;
}
.letter-body p:last-child { margin-bottom: 0; }
.letter-body em {
  font-family: var(--serif-editorial);
  font-style: italic;
  font-size: 1.05em;
}

.letter-divider {
  width: 28px;
  height: 1px;
  background: var(--ink);
  margin: 30px 0 6px;
  opacity: 0.6;
}

.letter-signature {
  display: block;
  width: auto;
  max-width: 220px;
  height: auto;
  margin: 8px 0 0 -6px;
  /* PNG is donker op transparant — werkt direct op briefpapier */
  mix-blend-mode: multiply;
  user-select: none;
}

/* ───────── Mobile / phone-proof ───────── */

@media (max-width: 720px) {
  :root { --topbar-h: 56px; }

  /* Topbar compacter */
  .topbar { padding: 0 16px; }
  .brand  { font-size: 26px; }
  .icon-btn { width: 40px; height: 40px; padding: 6px; }
  .info-glyph { font-size: 22px; }
  .brand-icon { width: 34px; height: 34px; max-width: 34px; max-height: 34px; border-radius: 7px; padding: 5px; }

  /* Sidebar smaller default + tighter spacing */
  .sidebar { width: 168px; }
  .sidebar.is-collapsed { width: 64px; }
  .sidebar-inner { padding: calc(var(--topbar-h) + 14px) 14px 14px; }
  .sidebar.is-collapsed .sidebar-inner { padding: calc(var(--topbar-h) + 14px) 8px 14px; }
  .sidebar-head { margin-bottom: 12px; min-height: 22px; }
  .sidebar-toggle { width: 30px; height: 30px; }
  .edition-btn .thumb { width: 100%; }
  .edition-btn .num { font-size: 14px; }
  .edition-btn .date { font-size: 9px; }

  /* Cover: cover blijft gecentreerd, iets compacter zodat de sidebar overlap niet voelt */
  .cover-stage { width: min(82vw, 86vh * 0.74); }

  /* Magazine reading: vertical stack (al gehad), iets compacter */
  body.is-reading .magazine {
    height: auto !important;
    overflow: visible !important;
  }
  body.is-reading .pages-track {
    position: relative !important;
    inset: auto !important;
    transform: none !important;
    pointer-events: auto !important;
  }
  body.is-reading .page {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    width: 100vw !important;
    height: auto;
    min-height: calc(100vh - var(--topbar-h));
    padding: calc(var(--topbar-h) + 12px) 16px 30px;
    pointer-events: auto !important;
  }
  body.is-reading .page-card {
    width: min(90vw, calc(82vh * 0.74));
  }
  .page-counter { display: none; }

  /* Brief: tighter padding, kleinere fonts, betere touch-targets */
  .info-dialog { width: calc(100% - 24px); max-width: 100%; }
  .letter-paper { padding: 40px 24px 28px; }
  .letter-greeting { font-size: 28px; }
  .letter-body p { font-size: 15px; line-height: 1.7; }
  .letter-signature { max-width: 180px; }
  .dialog-close { width: 40px; height: 40px; font-size: 28px; }

  /* Page-zoom modal */
  .modal-page { width: 92vw; }
  .modal-close { width: 40px; height: 40px; }
}

/* Extra-small phones */
@media (max-width: 380px) {
  .sidebar { width: 140px; }
  .sidebar.is-collapsed { width: 56px; }
  .brand { font-size: 22px; }
  .cover-stage { width: min(78vw, 82vh * 0.74); }
  .letter-greeting { font-size: 24px; }
  .letter-body p { font-size: 14.5px; }
  .brand-icon { width: 30px; height: 30px; max-width: 30px; max-height: 30px; padding: 4px; }
}

/* Touch-friendly: alle interactive elements minimum 44px tap-target */
@media (hover: none) and (pointer: coarse) {
  .icon-btn,
  .edition-btn,
  .dialog-close,
  .modal-close {
    -webkit-tap-highlight-color: transparent;
  }
  /* Forceer hover-states uit zodat sticky-hover op touch geen issues geeft */
  .edition-btn:hover .thumb { transform: none; }
  .edition-btn:hover .thumb img { transform: none; }
  .edition-btn:hover .num { font-style: normal; }
}

/* ───────── A11y ───────── */
@media (prefers-reduced-motion: reduce) {
  .cover-cta { animation: none; }
  .scroll-line::after { animation: none; }
}
