/* ============================================================================
   OUR LOVE STORY — style.css
   Direction (from unslop): intimate, unhurried, tender.
   World: a private film and its contact sheet — title card, letterbox, a red thread.
   One warm-black ramp, one muted red accent, gold only for Maryam's achievements.
   Spacing on a 4px grid. One easing curve. No glow, no hue gradients.
   Persian type: never add letter-spacing; line-heights are taller than Latin.
   ========================================================================== */

@font-face {
  font-family: 'Vazirmatn';
  src: url('assets/fonts/Vazirmatn.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  /* warm ramp (dark) */
  --bg-deep: #12110f;
  --bg: #161513;
  --card: #1c1a18;
  --raised: #262421;
  --text: #efe9de;
  --text-2: #aaa398;
  --text-3: #8a847a;
  --line: rgba(239, 233, 222, .08);
  --line-2: rgba(239, 233, 222, .16);

  /* accent: muted romantic red (4.9:1 on --bg) */
  --accent: #d2625a;
  --accent-soft: rgba(210, 98, 90, .32);
  /* gold: achievements only */
  --gold: #c9a46a;
  --gold-soft: rgba(201, 164, 106, .3);

  --font: 'Vazirmatn', Tahoma, 'Segoe UI', 'Noto Sans Arabic', system-ui, sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --t-fast: 150ms;
  --t-mid: 200ms;
  --t-slow: 400ms;

  --page-pad: 32px;
  --player-w: 168px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--bg);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.8;
  font-variant-numeric: tabular-nums;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body.is-welcome, body.scene-open { overflow: hidden; }

h1, h2, h3, p, ol { margin: 0; padding: 0; }
ol { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { display: block; flex: none; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; border-radius: 8px; }

/* line icons: one stroke everywhere */
.player svg, .scene svg, .brand svg, .btn svg, .chip svg, .e-go svg, .p-icon {
  fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}

/* ============================================================================
   LETTERBOX BARS (welcome only)
   ========================================================================== */
.bar {
  position: fixed; inset-inline: 0; z-index: 30; background: #000;
  height: clamp(56px, 11vh, 120px);
  transition: transform 700ms var(--ease);
}
.bar-top { top: 0; }
.bar-bottom { bottom: 0; display: flex; align-items: center; justify-content: center; padding-inline: 20px; }
body.is-entered .bar-top { transform: translateY(-101%); }
body.is-entered .bar-bottom { transform: translateY(101%); }
/* the footer counter lives in the page after entering */
body.is-entered .bar-bottom .visit { opacity: 0; }

/* ============================================================================
   BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 24px; border-radius: 10px;
  font-size: 16px; font-weight: 500; line-height: 1.4; white-space: nowrap;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease);
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--text); color: var(--bg); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5); }
.btn-primary:hover { background: #fff; }
.btn-quiet { min-height: 44px; padding: 0 16px; background: var(--card); border: 1px solid var(--line); color: var(--text); }
.btn-quiet svg { width: 18px; height: 18px; color: var(--text-2); }
.btn-quiet:hover:not(:disabled) { background: var(--raised); border-color: var(--line-2); }
.btn-quiet:disabled { opacity: .35; cursor: default; }

/* ============================================================================
   MUSIC PLAYER
   ========================================================================== */
.player {
  position: fixed; z-index: 60; top: 8px; left: max(16px, env(safe-area-inset-left));
  display: flex; align-items: center; gap: 2px; height: 40px; padding: 0 4px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
}
.pl-btn {
  position: relative; width: 36px; height: 32px; display: grid; place-items: center; border-radius: 8px; color: var(--text-2);
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.pl-btn svg { width: 18px; height: 18px; }
.pl-btn:hover { background: var(--raised); color: var(--text); }
.pl-btn:active { transform: scale(.94); }
.pl-btn[aria-pressed="true"] { color: var(--text); }
.pl-btn:disabled { opacity: .35; cursor: default; }
.pl-sep { width: 1px; height: 16px; background: var(--line-2); margin-inline: 2px; }
/* play/pause and volume/mute swap icons from state */
.i-pause, .i-mute { display: none; }
#plPlay[aria-pressed="true"] .i-play { display: none; }
#plPlay[aria-pressed="true"] .i-pause { display: block; }
#plMute[aria-pressed="true"] .i-vol { display: none; }
#plMute[aria-pressed="true"] .i-mute { display: block; }
#plPlay[aria-pressed="true"] svg { fill: currentColor; }
.i-play { fill: currentColor; }
/* the accent marks what is live: a quiet dot while music plays */
#plPlay[aria-pressed="true"]::after {
  content: ''; position: absolute; top: 4px; inset-inline-end: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}

/* ============================================================================
   SCREEN 1 — WELCOME: the opening scene
   ========================================================================== */
.welcome {
  position: fixed; inset: 0; z-index: 10; overflow: hidden;
  display: grid; place-items: center; padding: 24px;
  background: var(--bg-deep);
}
/* neutral vignette: the edges fall off to black like a lens */
.welcome::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 80% 70% at 50% 46%, transparent 35%, rgba(0, 0, 0, .6) 100%);
}
/* one soft projector light that follows the pointer, warm ivory at very low strength */
.welcome-light {
  position: absolute; left: 0; top: 0; width: 720px; height: 720px; margin: -360px 0 0 -360px; pointer-events: none;
  background: radial-gradient(circle, rgba(239, 233, 222, .06), transparent 62%);
  opacity: 0; transition: opacity 800ms var(--ease); will-change: transform;
}
.has-pointer .welcome-light { opacity: 1; }
body.is-entered .welcome { opacity: 0; visibility: hidden; transition: opacity var(--t-slow) var(--ease), visibility 0s linear var(--t-slow); }
.welcome.is-gone { display: none; }

.welcome-inner {
  position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 24px; max-width: 880px; opacity: 0;
}
.is-ready .welcome-inner { opacity: 1; }

.welcome-range { font-size: 14px; line-height: 20px; color: var(--text-3); }
.names { display: flex; align-items: center; gap: 16px; font-size: 20px; line-height: 28px; color: var(--text-2); }
.name { flex: none; }
.thread-line { width: clamp(96px, 22vw, 160px); height: 24px; overflow: visible; }
.thread-line path { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linecap: round; }
.thread-line .thread-heart { fill: var(--accent); stroke: none; }
.welcome-title {
  font-size: clamp(40px, 8vw, 72px); font-weight: 400; line-height: 1.4; letter-spacing: 0;
  color: var(--text); margin-block: 8px 16px; text-wrap: balance;
}

/* one entrance on load: a short fade and rise, staged */
.is-ready .welcome-range, .is-ready .names, .is-ready .welcome-title, .is-ready #enterBtn {
  animation: rise var(--t-slow) var(--ease) both;
}
.is-ready .names { animation-delay: 80ms; }
.is-ready .welcome-title { animation-delay: 200ms; }
.is-ready #enterBtn { animation-delay: 360ms; }
.is-ready .thread-line path { stroke-dasharray: 1; animation: draw 1200ms var(--ease) 300ms both; }
.is-ready .thread-line path:nth-child(2) { animation-delay: 300ms; }
.is-ready .thread-line .thread-heart { stroke-dasharray: none; animation: fade 600ms var(--ease) 1000ms both; }

/* ============================================================================
   TRANSITION CURTAIN
   ========================================================================== */
.curtain { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: #000; opacity: 0; pointer-events: none; }
.curtain svg { width: clamp(96px, 18vw, 160px); height: auto; fill: none; stroke: var(--accent); stroke-width: .6; stroke-linecap: round; stroke-linejoin: round; }
.curtain path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.curtain.is-on { opacity: 1; pointer-events: auto; transition: opacity 300ms var(--ease); }
.curtain.is-on path { animation: draw 900ms var(--ease) 150ms forwards; }
.curtain.is-off { opacity: 0; transition: opacity 600ms var(--ease); }

/* ============================================================================
   SCREEN 2 — MEMORIES
   ========================================================================== */
.memories { display: none; position: relative; z-index: 1; }
body.is-entered .memories { display: block; }
body.is-entered .memories > * { animation: fade 600ms var(--ease) both; }

.topbar { max-width: 1200px; margin-inline: auto; padding: 0 var(--page-pad); height: 56px; display: flex; align-items: center; }
.brand { display: inline-flex; align-items: center; gap: 8px; height: 40px; font-size: 16px; font-weight: 500; }
.brand svg { width: 18px; height: 18px; stroke: none; fill: var(--accent); }

/* --- hero: asymmetric split. text on one side, the chapters as contents on the other --- */
.hero {
  max-width: 1200px; margin-inline: auto; padding: 48px var(--page-pad) 96px;
  min-height: calc(100vh - 56px - 56px); min-height: calc(100svh - 112px);
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 96px; align-items: center;
}
.hero-text { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.hero-eyebrow { font-size: 14px; line-height: 20px; color: var(--accent); }
.hero-title { font-size: clamp(40px, 6vw, 72px); font-weight: 400; line-height: 1.4; color: var(--text); text-wrap: balance; }
.hero-sub { font-size: 18px; line-height: 30px; color: var(--text-2); max-width: 36rem; margin-bottom: 16px; }

.contents { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.contents a {
  display: grid; grid-template-columns: 40px 1fr auto; align-items: center; column-gap: 16px; min-height: 64px; padding: 0 8px;
  border-bottom: 1px solid var(--line); border-radius: 0;
  transition: background-color var(--t-fast) var(--ease);
}
.contents a:hover { background: var(--card); }
.c-no { font-size: 14px; color: var(--text-3); }
.c-title { font-size: 20px; line-height: 28px; font-weight: 400; }
.c-count { font-size: 14px; color: var(--text-3); }

/* --- toolbar: chapter links + category filters, sticky --- */
.toolbar {
  position: sticky; top: 0; z-index: 40; height: 56px; display: flex; align-items: center;
  padding-inline-start: var(--page-pad); padding-left: calc(var(--player-w) + 16px);
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.tb-scroll { flex: 1; min-width: 0; height: 100%; display: flex; align-items: center; gap: 16px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-inline-end: var(--page-pad); }
.tb-scroll::-webkit-scrollbar { display: none; }
.tb-group { display: flex; align-items: center; gap: 4px; flex: none; }
.tb-sep { flex: none; width: 1px; height: 20px; background: var(--line-2); }
.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 8px; flex: none;
  font-size: 14px; line-height: 20px; color: var(--text-2); border: 1px solid transparent; white-space: nowrap;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.chip:hover { color: var(--text); background: var(--card); }
.chip .n { color: var(--text-3); font-size: 12px; }
.chip[aria-pressed="true"], .chip.is-current { color: var(--text); background: var(--raised); border-color: var(--line-2); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dot, var(--text-3)); }

/* --- timeline chapters --- */
.timeline { max-width: 1200px; margin-inline: auto; padding: 96px var(--page-pad) 0; scroll-margin-top: 56px; outline: none; }

.chapter { display: grid; grid-template-columns: 240px minmax(0, 1fr); column-gap: 64px; margin-bottom: 128px; scroll-margin-top: 80px; }
.chapter-head { position: sticky; top: 88px; align-self: start; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.chapter-year { font-size: 14px; line-height: 20px; color: var(--accent); }
.chapter-title { font-size: 32px; font-weight: 400; line-height: 1.5; color: var(--text); }
.chapter-count { font-size: 14px; line-height: 20px; color: var(--text-3); }

/* --- thread layout: one red thread, a knot per memory --- */
.entries { position: relative; padding-inline-start: 40px; --p: 0; }
.entries::before, .entries::after {
  content: ''; position: absolute; top: 12px; bottom: 12px; inset-inline-start: 10px; width: 2px; border-radius: 2px;
}
.entries::before { background: var(--line-2); }
.entries::after { background: var(--accent); transform-origin: top; transform: scaleY(var(--p)); transition: transform 120ms linear; }

.entry { position: relative; }
.entry + .entry { margin-top: 4px; }
.e-dot {
  position: absolute; top: 28px; inset-inline-start: -40px; width: 22px; height: 22px; margin-top: -11px; display: grid; place-items: center;
  border-radius: 50%; background: var(--bg);
}
.e-dot::after { content: ''; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--text-3); background: var(--bg); transition: border-color var(--t-mid) var(--ease), background-color var(--t-mid) var(--ease); }
.entry.is-passed .e-dot::after { border-color: var(--accent); }
.entry.is-featured .e-dot::after { width: 14px; height: 14px; border-color: var(--accent); background: var(--accent); }

.entry-btn {
  position: relative; width: 100%; display: grid; grid-template-columns: 144px minmax(0, 1fr) 24px; align-items: center; column-gap: 24px;
  min-height: 80px; padding: 20px 24px; border-radius: 12px; text-align: start;
  transition: background-color var(--t-fast) var(--ease);
}
.entry-btn:hover { background: var(--card); }
.entry-btn:active { background: var(--raised); }
.e-date { display: flex; align-items: baseline; gap: 8px; color: var(--text-2); font-size: 14px; line-height: 20px; }
.e-day { font-size: 32px; line-height: 1; font-weight: 500; color: var(--text); }
.e-mon { color: var(--text-2); }
.e-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.e-title { font-size: 20px; line-height: 1.6; font-weight: 400; color: var(--text); }
.e-cat { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; line-height: 20px; color: var(--text-3); }
.e-cat .dot, .scene-cat .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dot, var(--text-3)); }
.e-go { color: var(--text-3); opacity: 0; transform: translateX(4px); transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease); }
.e-go svg { width: 18px; height: 18px; }
.entry-btn:hover .e-go, .entry-btn:focus-visible .e-go { opacity: 1; transform: none; }

/* featured: the moment two people became a couple gets room */
.entry.is-featured .entry-btn { padding-block: 28px; background: var(--card); border: 1px solid var(--accent-soft); }
.entry.is-featured .e-day { color: var(--accent); font-size: 40px; }
.entry.is-featured .e-title { font-size: 28px; line-height: 1.5; }
.entry.is-featured .entry-btn:hover { background: var(--raised); }

/* --- panel layout: birthdays and achievements --- */
.chapter[data-layout="panels"] .entries { padding-inline-start: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.chapter[data-layout="panels"] .entries::before, .chapter[data-layout="panels"] .entries::after, .chapter[data-layout="panels"] .e-dot { display: none; }
.chapter[data-layout="panels"] .entry + .entry { margin: 0; }
.chapter[data-layout="panels"] .entry-btn {
  height: 100%; grid-template-columns: 1fr; align-content: space-between; row-gap: 40px; min-height: 216px; padding: 24px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
}
.chapter[data-layout="panels"] .entry-btn:hover { background: var(--raised); border-color: var(--line-2); }
.chapter[data-layout="panels"] .e-go { position: absolute; top: 24px; inset-inline-end: 24px; }
.chapter[data-layout="panels"] .e-date { flex-direction: column; align-items: flex-start; gap: 4px; }
.chapter[data-layout="panels"] .e-day { font-size: 56px; font-weight: 400; }
.chapter[data-layout="panels"] .e-mon { font-size: 18px; line-height: 24px; }
.chapter[data-layout="panels"] .e-title { font-size: 24px; }
.p-icon { position: absolute; top: 24px; inset-inline-start: 24px; width: 24px; height: 24px; color: var(--text-3); display: none; }
.chapter[data-theme="gold"] .p-icon { display: block; color: var(--gold); }
.chapter[data-theme="gold"] .entry-btn { border-color: var(--gold-soft); }
.chapter[data-theme="gold"] .entry-btn:hover { border-color: var(--gold); }
.chapter[data-theme="gold"] .e-day { color: var(--gold); }
.chapter[data-theme="gold"] .chapter-year { color: var(--gold); }
.chapter[data-theme="gold"] .e-date { padding-top: 40px; }

/* reveal: opacity and a small rise, once, no stagger */
.reveal { opacity: 0; transform: translateY(8px); transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease); }
.reveal.in { opacity: 1; transform: none; }

.empty { max-width: 1200px; margin: 0 auto; padding: 0 var(--page-pad) 96px; text-align: center; color: var(--text-3); }

/* --- footer + visit counter --- */
.site-footer { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 64px 20px calc(96px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); text-align: center; margin-top: 32px; }
.footer-mark svg { width: 24px; height: 24px; fill: var(--accent); stroke: none; }
.footer-names { font-size: 16px; color: var(--text-2); }

.visit { display: flex; align-items: baseline; justify-content: center; flex-wrap: wrap; gap: 8px; font-size: 14px; line-height: 24px; color: var(--text-3); min-height: 24px; }
.visit .v-num { font-size: 24px; font-weight: 500; line-height: 24px; color: var(--text); font-variant-numeric: tabular-nums; }
.visit-footer .v-num { font-size: 32px; line-height: 32px; }
.visit .v-heart { width: 14px; height: 14px; align-self: center; fill: var(--accent); stroke: none; }
.visit .v-wait { display: inline-block; width: 64px; height: 16px; border-radius: 4px; background: var(--raised); align-self: center; animation: pulseLoad 1.4s ease-in-out infinite; }
.visit .v-retry { color: var(--text-2); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--line-2); }
.visit .v-retry:hover { color: var(--text); }
.visit-footer .v-retry { padding: 4px 8px; }
.visit-footer .v-heart { display: none; }

/* ============================================================================
   DETAIL VIEW — a single scene
   ========================================================================== */
.scene { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px; }
.scene-backdrop { position: absolute; inset: 0; background: rgba(10, 9, 8, .94); opacity: 0; transition: opacity var(--t-mid) var(--ease); }
.scene.is-open .scene-backdrop { opacity: 1; }

.scene-card {
  position: relative; width: min(720px, 100%); max-height: calc(100dvh - 48px); overflow-y: auto; outline: none;
  display: flex; flex-direction: column; gap: 48px; padding: 56px 48px 32px;
  background: var(--bg); border: 1px solid var(--line-2); border-radius: 20px;
  opacity: 0; transform: translateY(12px); transition: opacity var(--t-mid) var(--ease), transform var(--t-slow) var(--ease);
  scrollbar-width: none;
}
.scene-card::-webkit-scrollbar { display: none; }
.scene.is-open .scene-card { opacity: 1; transform: none; }
.scene-close { position: absolute; top: 16px; inset-inline-start: 16px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; color: var(--text-2); transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.scene-close svg { width: 20px; height: 20px; }
.scene-close:hover { background: var(--raised); color: var(--text); }

.scene-body { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.scene-body.swap { animation: rise var(--t-slow) var(--ease) both; }
.scene-cat { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; line-height: 24px; color: var(--text-2); }
.scene-cat svg { width: 18px; height: 18px; color: var(--text-3); }
.scene-date { display: flex; align-items: baseline; gap: 16px; }
.scene-day { font-size: clamp(88px, 22vw, 144px); font-weight: 400; line-height: 1.1; color: var(--text); }
.scene-month { font-size: 20px; line-height: 28px; color: var(--text-2); }
.scene-thread { display: block; width: 100%; height: 1.5px; background: var(--accent); transform-origin: right center; }
.scene.is-open .scene-body.swap .scene-thread { animation: growX 700ms var(--ease) 100ms both; }
.scene-title { font-size: clamp(28px, 6vw, 44px); font-weight: 400; line-height: 1.5; color: var(--text); text-wrap: balance; margin-top: 8px; }
.scene-desc { font-size: 18px; line-height: 2; color: var(--text-2); max-width: 36rem; }
.scene[data-theme="gold"] .scene-thread { background: var(--gold); }
.scene[data-theme="gold"] .scene-cat svg { color: var(--gold); }

.scene-nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 24px; border-top: 1px solid var(--line); }
.scene-pos { font-size: 14px; color: var(--text-3); }

.noscript { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px; background: var(--bg); color: var(--text); text-align: center; }

/* ============================================================================
   KEYFRAMES
   ========================================================================== */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes growX { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes pulseLoad { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }

/* ============================================================================
   RESPONSIVE
   ========================================================================== */
body.player-multi { --player-w: 208px; }

/* touch: controls reach a comfortable 44px target */
@media (pointer: coarse) {
  .player { height: 48px; top: 4px; }
  .pl-btn { width: 44px; height: 40px; }
  body:not(.player-multi) { --player-w: 128px; }
  .chip { height: 40px; }
}

@media (max-width: 960px) {
  :root { --page-pad: 24px; }
  .hero { grid-template-columns: 1fr; gap: 48px; min-height: 0; padding-block: 32px 64px; }
  .chapter { grid-template-columns: 1fr; row-gap: 24px; margin-bottom: 96px; }
  .chapter-head { position: static; flex-direction: row; align-items: baseline; flex-wrap: wrap; gap: 8px 16px; }
  .chapter-title { font-size: 28px; }
  .timeline { padding-top: 64px; }
}

@media (max-width: 640px) {
  :root { --page-pad: 20px; --player-w: 128px; }
  .btn { width: 100%; }
  .scene-nav .btn { width: auto; }
  .hero-sub { font-size: 16px; line-height: 28px; }
  .contents a { min-height: 56px; }
  .c-title { font-size: 18px; }

  .tb-scroll { gap: 12px; }
  .entries { padding-inline-start: 32px; }
  .entries::before, .entries::after { inset-inline-start: 6px; }
  .e-dot { inset-inline-start: -32px; }
  .entry-btn { grid-template-columns: 56px minmax(0, 1fr) 16px; column-gap: 16px; min-height: 72px; padding: 16px 12px; }
  .e-date { flex-direction: column; align-items: flex-start; gap: 0; }
  .e-day { font-size: 28px; }
  .e-mon { font-size: 13px; }
  .e-title { font-size: 18px; }
  .e-go { opacity: .5; transform: none; }
  .entry.is-featured .entry-btn { padding-block: 20px; }
  .entry.is-featured .e-title { font-size: 22px; }
  .entry.is-featured .e-day { font-size: 32px; }

  .chapter[data-layout="panels"] .entries { grid-template-columns: 1fr; }
  .chapter[data-layout="panels"] .entry-btn { min-height: 176px; row-gap: 24px; }
  .chapter[data-layout="panels"] .e-day { font-size: 48px; }
  .chapter[data-layout="panels"] .e-date { flex-direction: column; }

  .scene { padding: 12px; align-items: end; }
  .scene-card { padding: 56px 24px 24px; gap: 32px; max-height: calc(100dvh - 24px); border-radius: 20px 20px 16px 16px; }
  .scene-nav .btn span { display: none; }
  .scene-nav .btn { min-width: 44px; padding: 0 12px; }
}

@media (max-height: 520px) and (orientation: landscape) {
  .welcome-inner { gap: 12px; }
  .welcome-title { font-size: 32px; margin-block: 0 8px; }
  .bar { height: 48px; }
}

/* ============================================================================
   REDUCED MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important; transition-delay: 0s !important; }
  .reveal { opacity: 1; transform: none; }
  .welcome-light { display: none; }
}
