:root {
  --paper: #f3efe8;
  --ink: #141312;
  --red: #c8102e;
  --muted: #6d665e;
  --display: 'Bodoni Moda', 'Didot', Georgia, serif;
  --text: 'Inter', system-ui, sans-serif;
  --ease: cubic-bezier(.22, .8, .2, 1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: #1c1b1a radial-gradient(circle at 50% 30%, #2b2927, #121110 70%);
  color: var(--ink); font-family: var(--text); font-weight: 400;
  -webkit-font-smoothing: antialiased; overflow: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.app {
  position: relative; width: 100%; max-width: 480px; height: 100svh; margin: 0 auto;
  overflow: hidden; background: var(--paper); perspective: 1800px;
  box-shadow: 0 0 80px rgba(0, 0, 0, .5);
}

/* ───────── animated pieces ───────── */
.a { opacity: 0; transform: translateY(18px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: calc(var(--i) * 90ms + 150ms); }
.cover.ready .a, .page.active .a, .page.seen .a { opacity: 1; transform: none; }

/* ───────── cover ───────── */
.cover {
  position: absolute; inset: 0; z-index: 10; color: #fff; overflow: hidden; cursor: pointer;
  transform-origin: 0 50%; transform-style: preserve-3d; backface-visibility: hidden;
  transition: transform 1.25s cubic-bezier(.6, 0, .25, 1), box-shadow 1.25s;
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.cover.turn { transform: rotateY(-108deg); box-shadow: 40px 0 60px rgba(0, 0, 0, .35); pointer-events: none; }
.cover-photo, .back-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover-photo { object-position: 50% 40%; animation: kenburns 18s ease-out both; }
@keyframes kenburns { from { transform: scale(1.14); } to { transform: scale(1.02); } }
.cover-shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .05) 32%, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, .25) 66%, rgba(0, 0, 0, .78) 100%);
}
.grain {
  position: absolute; inset: -50%; pointer-events: none; opacity: .16; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(4) infinite;
}
@keyframes grain { 0% { transform: translate(0, 0); } 25% { transform: translate(-4%, 3%); } 50% { transform: translate(3%, -2%); } 75% { transform: translate(-2%, -4%); } }

.mast { position: absolute; top: 0; left: 0; right: 0; padding: max(18px, env(safe-area-inset-top)) 20px 0; text-align: center; }
.mast-top { font-size: 9.5px; letter-spacing: .26em; text-transform: uppercase; opacity: .92; white-space: nowrap; }
.masthead {
  display: block; font-family: var(--display); font-weight: 900; line-height: .82;
  font-size: clamp(120px, 42vw, 196px); letter-spacing: -.04em; margin-top: 6px;
  text-shadow: 0 2px 24px rgba(0, 0, 0, .18);
}
.masthead em { font-style: italic; font-weight: 400; font-size: .62em; vertical-align: .32em; margin: 0 -.02em; color: var(--red); }
.mast-sub { font-family: var(--display); font-style: italic; font-size: 17px; letter-spacing: .02em; margin-top: 4px; }

.cover-lines { position: absolute; left: 20px; top: 31%; width: 50%; display: grid; gap: 14px; }
.cl { display: grid; gap: 2px; text-shadow: 0 1px 12px rgba(0, 0, 0, .35); }
.kicker { font-size: 10px; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; }
.cl .kicker { color: #fff; background: var(--red); justify-self: start; padding: 3px 6px 2px; letter-spacing: .2em; font-size: 9px; }
.cl-text { font-family: var(--display); font-size: 19px; line-height: 1.12; font-weight: 500; }

.cover-feature { position: absolute; left: 20px; right: 20px; bottom: 96px; }
.cf-kicker { font-size: 10px; letter-spacing: .3em; text-transform: uppercase; opacity: .85; margin-bottom: 6px; }
.cf-names { font-family: var(--display); font-size: clamp(48px, 15vw, 66px); line-height: .92; font-weight: 400; letter-spacing: -.01em; }
.cf-names em { color: var(--red); font-style: italic; }
.cf-deck { font-family: var(--display); font-style: italic; font-size: 20px; margin-top: 8px; opacity: .95; }

.cover-foot { position: absolute; left: 20px; right: 20px; bottom: max(22px, env(safe-area-inset-bottom)); display: flex; justify-content: space-between; align-items: flex-end; }
.cue { font-size: 11px; letter-spacing: .26em; text-transform: uppercase; display: flex; gap: 10px; align-items: center; }
.cue span { display: inline-block; animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateX(6px); } }
.barcode { background: #fff; color: var(--ink); padding: 6px 7px 4px; display: grid; gap: 2px; justify-items: center; }
.barcode .bars { width: 78px; height: 34px; fill: var(--ink); display: block; }
.barcode span { font-size: 8px; letter-spacing: .3em; }
.barcode em { font-style: normal; font-size: 6.5px; letter-spacing: .12em; color: var(--muted); }
.barcode.small { justify-self: center; margin: 22px auto 0; }
.barcode.small span { font-size: 6.5px; letter-spacing: .15em; }

/* ───────── issue / spreads ───────── */
.issue { position: absolute; inset: 0; visibility: hidden; }
.issue.on { visibility: visible; }
.spreads {
  position: absolute; inset: 0; display: flex; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior: contain;
}
.spreads::-webkit-scrollbar { display: none; }
.page { flex: 0 0 100%; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; position: relative; overflow: hidden; background: var(--paper); }
.page .scroll { height: 100%; overflow-y: auto; overflow-x: hidden; padding-bottom: 92px; scrollbar-width: none; }
.page .scroll::-webkit-scrollbar { display: none; }
.pad { padding: 0 22px; }

.folio-top {
  display: flex; justify-content: space-between; padding: max(16px, env(safe-area-inset-top)) 22px 12px;
  font-size: 9px; letter-spacing: .26em; text-transform: uppercase; color: var(--muted);
  position: relative; z-index: 2;
}
.folio { padding: 34px 22px 0; font-size: 9px; letter-spacing: .26em; text-transform: uppercase; color: var(--muted); }
.folio span { color: var(--red); font-weight: 600; margin-right: 8px; }

.kicker.red { color: var(--red); }
.kicker.light { color: #fff; }
.display { font-family: var(--display); font-weight: 400; font-size: 56px; line-height: .95; letter-spacing: -.015em; margin: 8px 0 18px; }
.display em { font-style: italic; color: var(--red); }
.display.light { color: #fff; }
.display.light em { color: #fff; }
.display.huge { font-size: clamp(58px, 18vw, 82px); font-weight: 500; letter-spacing: -.03em; }
.body { font-size: 15px; line-height: 1.65; color: #2a2724; }
.body p + p { margin-top: 12px; }
.dropcap p:first-child::first-letter {
  float: left; font-family: var(--display); font-weight: 700; font-size: 74px; line-height: .78;
  padding: 6px 8px 0 0; color: var(--red);
}
.big-italic { font-family: var(--display); font-style: italic; font-size: 22px; line-height: 1.35; color: var(--ink); }
.deck { font-family: var(--display); font-style: italic; font-size: 20px; line-height: 1.35; margin: 20px 0 8px; }
.sig { font-family: var(--display); font-style: italic; font-size: 22px; margin-top: 18px; text-align: right; }
.rule { width: 46px; height: 2px; background: var(--red); margin: 4px 0 16px; }

/* photos */
.ph { margin: 0; }
.ph-in { overflow: hidden; background: #ddd6cc; }
.ph-in img { display: block; width: 100%; height: 100%; object-fit: cover; transform: scale(1.18); will-change: transform; }
.ph figcaption { font-size: 9px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-top: 7px; }
.ph-top .ph-in { height: 44svh; min-height: 300px; }
.p-contents .folio-top, .p-venue .folio-top, .p-gift .folio-top, .p-interview .folio-top { position: absolute; left: 0; right: 0; color: #fff; text-shadow: 0 1px 8px rgba(0, 0, 0, .5); background: linear-gradient(rgba(0, 0, 0, .38), rgba(0, 0, 0, 0)); padding-bottom: 30px; }
.p-contents .ph-top { margin-bottom: 22px; }
.ph-inset { float: right; width: 44%; margin: 4px 0 10px 14px; }
.ph-inset .ph-in { height: 190px; }
.p-letter .display { margin-bottom: 14px; }

/* contents */
.toc { list-style: none; border-top: 1px solid var(--ink); }
.toc button { width: 100%; display: grid; grid-template-columns: 34px 1fr auto; align-items: baseline; padding: 11px 0; border-bottom: 1px solid rgba(20, 19, 18, .14); text-align: left; }
.toc b { font-family: var(--display); color: var(--red); font-weight: 500; font-size: 15px; }
.toc span { font-family: var(--display); font-size: 21px; }
.toc i { font-style: normal; color: var(--muted); transition: transform .3s; }
.toc button:hover i { transform: translateX(4px); color: var(--red); }

/* interview */
.hero-ph { position: relative; }
.ph-wide .ph-in { height: 56svh; min-height: 360px; }
.hero-ph::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .35), rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, .65)); pointer-events: none; }
.hero-title { position: absolute; left: 22px; bottom: 6px; z-index: 1; }
.qa { padding: 16px 0; border-bottom: 1px solid rgba(20, 19, 18, .14); }
.q { font-family: var(--display); font-weight: 700; font-size: 18px; margin-bottom: 6px; }
.q::before { content: 'Q. '; color: var(--red); }
.ans { font-size: 14.5px; line-height: 1.6; color: #2a2724; }
.pull { font-family: var(--display); font-style: italic; font-size: 30px; line-height: 1.1; color: var(--red); border-left: 3px solid var(--red); padding-left: 14px; margin: 26px 0 0; }

/* evening */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.duo .ph-in { height: 190px; }
.duo .ph-low { margin-top: 34px; }
.schedule { list-style: none; border-top: 1px solid var(--ink); }
.schedule li { display: grid; grid-template-columns: 96px 1fr; gap: 10px; padding: 14px 0; border-bottom: 1px solid rgba(20, 19, 18, .14); }
.schedule .t b { font-family: var(--display); font-size: 36px; font-weight: 400; line-height: .9; color: var(--red); }
.schedule .t small { font-size: 9px; letter-spacing: .2em; margin-left: 4px; color: var(--muted); }
.st { font-size: 11px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; margin-top: 4px; }
.sx { font-size: 14px; line-height: 1.5; color: #4a443e; margin-top: 4px; }

/* venue */
.ph-venue .ph-in { height: 58svh; min-height: 380px; }
.venue-card { position: relative; margin: -70px 16px 0; padding: 22px 20px 26px; background: var(--paper); }
.addr { font-size: 15px; line-height: 1.6; }

/* countdown */
.dark { background: var(--ink); color: #f3efe8; }
.dark .folio-top, .dark .folio { color: rgba(243, 239, 232, .55); }
.count-pad { padding-top: 30px; }
.big-days { display: flex; align-items: flex-end; gap: 10px; border-bottom: 1px solid rgba(243, 239, 232, .25); padding-bottom: 6px; }
.big-days b { font-family: var(--display); font-weight: 400; font-size: clamp(150px, 50vw, 220px); line-height: .8; letter-spacing: -.05em; font-variant-numeric: lining-nums; }
.big-days span { font-family: var(--display); font-style: italic; font-size: 30px; color: var(--red); padding-bottom: 14px; }
.hms { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid rgba(243, 239, 232, .25); }
.hms div { padding: 16px 0 14px; }
.hms div + div { border-left: 1px solid rgba(243, 239, 232, .25); padding-left: 14px; }
.hms b { display: block; font-family: var(--display); font-weight: 400; font-size: 46px; line-height: 1; font-variant-numeric: tabular-nums lining-nums; }
.hms span { font-size: 9px; letter-spacing: .26em; text-transform: uppercase; opacity: .6; }
.count-deck { font-family: var(--display); font-size: 34px; line-height: 1.05; margin: 26px 0 8px; }
.count-deck em { color: var(--red); }
.count-date { font-size: 10px; letter-spacing: .24em; text-transform: uppercase; opacity: .65; }

/* dress */
.dress-grid { display: grid; grid-template-columns: 58% 1fr; gap: 14px; padding: 0 0 0 22px; align-items: end; margin-bottom: 18px; }
.ph-tall .ph-in { height: 52svh; min-height: 340px; }
.dress-side { padding-right: 18px; }
.dress-side .display { font-size: 44px; }
.dress-title { font-family: var(--display); font-size: 26px; font-weight: 500; margin-bottom: 10px; }
.swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 20px; }
.swatches i { display: block; aspect-ratio: 1 / 1.25; border: 1px solid rgba(20, 19, 18, .12); }
.swatches span { display: block; font-size: 9px; letter-spacing: .2em; text-transform: uppercase; margin-top: 6px; color: var(--muted); }

/* gift */
.ph-gift .ph-in { height: 50svh; min-height: 330px; }
.p-gift .pad { padding-top: 24px; }

/* back cover */
.p-back { color: #fff; }
.p-back .back-photo { transform: scale(1.18); }
.p-back .folio-top, .p-back .folio { position: relative; color: rgba(255, 255, 255, .8); }
.p-back .scroll { position: relative; display: flex; flex-direction: column; }
.back-inner { position: relative; margin-top: auto; padding: 0 22px; text-align: center; }
.back-title { font-size: clamp(54px, 17vw, 74px); margin-bottom: 10px; }
.back-deadline { font-size: 11px; letter-spacing: .24em; text-transform: uppercase; opacity: .9; margin-bottom: 20px; }
.back-sig { font-family: var(--display); font-style: italic; font-size: 19px; margin-top: 18px; }
.p-back .folio { text-align: center; }

/* buttons */
.btn {
  display: inline-block; padding: 14px 30px; border: 1px solid var(--ink); color: var(--ink);
  font-size: 11px; font-weight: 600; letter-spacing: .26em; text-transform: uppercase; text-decoration: none;
  transition: background .3s, color .3s; margin-top: 8px;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn.light { border-color: #f3efe8; color: #f3efe8; margin-top: 26px; }
.btn.light:hover { background: #f3efe8; color: var(--ink); }
.btn.solid { background: var(--red); border-color: var(--red); color: #fff; padding: 16px 48px; }
.btn.solid:hover { background: #fff; color: var(--red); border-color: #fff; }

/* HUD */
.hud {
  position: absolute; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 5;
  display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 999px;
  background: rgba(243, 239, 232, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .18); color: var(--ink);
}
.nav { width: 40px; height: 40px; border-radius: 50%; font-size: 17px; transition: background .2s, opacity .2s; }
.nav:hover:not(:disabled) { background: rgba(20, 19, 18, .08); }
.nav:disabled { opacity: .25; cursor: default; }
.counter { font-size: 11px; letter-spacing: .2em; min-width: 66px; text-align: center; color: var(--muted); }
.counter b { color: var(--red); font-weight: 600; }
.progress { position: absolute; left: 0; right: 0; top: 0; height: 2px; z-index: 5; background: rgba(20, 19, 18, .08); }
.progress i { display: block; height: 100%; width: 0; background: var(--red); transition: width .5s var(--ease); }

.music-btn { position: fixed; top: 14px; right: max(14px, calc(50vw - 240px + 14px)); z-index: 20; width: 38px; height: 38px; border-radius: 50%; background: rgba(243, 239, 232, .9); }
.music-btn svg { width: 18px; height: 18px; fill: none; stroke: var(--ink); stroke-width: 1.5; }
.music-btn.playing svg { animation: spin 6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
}

/* refinements */
.count-pad .kicker { margin-bottom: 26px; }
.p-back .cover-shade { background: linear-gradient(180deg, rgba(0, 0, 0, .35) 0%, rgba(0, 0, 0, .12) 22%, rgba(0, 0, 0, .55) 48%, rgba(0, 0, 0, .82) 100%); }
.p-back .back-title { text-shadow: 0 2px 30px rgba(0, 0, 0, .45); }

/* polish: keep cover text legible on short phones */
.cl { text-shadow: 0 1px 3px rgba(0, 0, 0, .45), 0 2px 16px rgba(0, 0, 0, .4); }
.cover-feature { text-shadow: 0 2px 18px rgba(0, 0, 0, .45); }
@media (max-height: 720px) {
  .cover-lines { top: 30%; gap: 8px; width: 46%; }
  .cl-text { font-size: 16px; }
  .cover-feature { bottom: 78px; }
}
button:focus-visible, a:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
