:root {
  --paper: #fbf7ef;
  --paper-2: #f6efe0;
  --ink: #3b2f24;
  --muted: #7d6b55;
  --gold: #b8924a;
  --gold-ink: #a8823c;
  --gold-soft: #ecd9a8;
  --sepia: #6b5236;
  --sage: #c9d6bf;
  --sage-ink: #7f9a74;
  --sage-wash: #d9e2d2;
  --blush: #f2d6cf;
  --blush-2: #ecbfb4;
  --blush-ink: #c98a7e;
  --blush-wash: #f5e2db;
  --jasmine: #fffdf6;
  --jasmine-ink: #c9c2a8;
  --temple-wash: rgba(236, 217, 168, 0.32);
  --door: #e7d2a4;
  --flame: #f2a23a;
  --peacock-green: #5f8a5a;
  --peacock-bronze: #b8924a;
  --peacock-teal: #2f7f7a;
  --peacock-blue: #1f3f6e;
  --teak: #24140b;
  --teak-2: #4a2a16;
  --teak-3: #6b3e20;
  --mural-red: #a63d25;
  --mural-ochre: #d9a03f;
  --mural-green: #3e6b3a;
  --display: "Playfair Display", "Didot", Georgia, serif;
  --serif: "Cormorant Garamond", "Garamond", Georgia, serif;
  --script: "Pinyon Script", "Snell Roundhand", cursive;
  --ml: "Manjari", "Noto Sans Malayalam", sans-serif;
  --mural: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='18'%3E%3Crect width='48' height='18' fill='%2324140b'/%3E%3Cpath d='M0 1.5h48M0 16.5h48' stroke='%23d9a03f' stroke-width='1.4'/%3E%3Cpath d='M4 14 L12 4 L20 14Z' fill='%23a63d25'/%3E%3Ccircle cx='30' cy='9' r='3.2' fill='%23d9a03f'/%3E%3Cpath d='M36 9 q6 -6 10 0 q-6 6 -10 0Z' fill='%233e6b3a'/%3E%3C/svg%3E");
  color-scheme: light;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body.is-locked { overflow: hidden; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--gold-ink); outline-offset: 3px; }

#petals { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 40; }

.mural-band { height: 18px; background: var(--mural) repeat-x left center / auto 18px; }

.gate {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  overflow: hidden; color: #f6e7c4;
  background: #241530;
}
.gate-sky {
  position: absolute; inset: -10%;
  background:
    radial-gradient(circle at 50% 46%, rgba(255, 196, 120, 0.42) 0%, rgba(214, 120, 96, 0.22) 22%, transparent 48%),
    radial-gradient(ellipse at 50% 120%, #7a3b52 0%, transparent 55%),
    radial-gradient(ellipse at 50% -20%, #3c2a5c 0%, transparent 60%),
    linear-gradient(180deg, #241530 0%, #3a1f3d 55%, #5a2c45 100%);
}
.gate-sky::after {
  content: ""; position: absolute; inset: 0; opacity: 0.55;
  background-image:
    radial-gradient(1.4px 1.4px at 12% 18%, #ffe9b5 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 82% 14%, #ffe9b5 50%, transparent 51%),
    radial-gradient(1px 1px at 70% 32%, #ffe9b5 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 26% 38%, #ffe9b5 50%, transparent 51%),
    radial-gradient(1px 1px at 90% 44%, #ffe9b5 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 8% 62%, #ffe9b5 50%, transparent 51%),
    radial-gradient(1px 1px at 38% 10%, #ffe9b5 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 60% 8%, #ffe9b5 50%, transparent 51%);
  animation: twinkle 5s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: 0.25; } to { opacity: 0.7; } }
.gate-jasmine { position: absolute; top: -2%; width: min(260px, 30vw); height: auto; opacity: 0.92; filter: drop-shadow(0 6px 10px rgba(20, 8, 24, 0.4)); }
.gate-jasmine-l { left: -2%; }
.gate-jasmine-r { right: -2%; transform: scaleX(-1); }
.gate-center {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center; padding: 0 20px;
}
.diya-stage { position: relative; width: min(380px, 78vw); aspect-ratio: 1; display: grid; place-items: center; margin-bottom: -6px; }
.diya-halo {
  position: absolute; width: 62%; aspect-ratio: 1; border-radius: 50%; top: 14%;
  background: radial-gradient(circle, rgba(255, 214, 140, 0.7) 0%, rgba(255, 170, 90, 0.25) 40%, transparent 70%);
  animation: halo 3.2s ease-in-out infinite;
}
@keyframes halo { 0%, 100% { transform: scale(1); opacity: 0.85; } 50% { transform: scale(1.08); opacity: 1; } }
.kolam { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.kolam-track { fill: none; stroke: rgba(240, 200, 120, 0.18); stroke-width: 1.2; }
.kolam-progress { fill: none; stroke: #f0c878; stroke-width: 2.2; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; transform: rotate(-90deg); transform-origin: 200px 200px; filter: drop-shadow(0 0 6px rgba(255, 200, 110, 0.7)); }
.kolam-loops path { fill: none; stroke: rgba(240, 200, 120, 0.55); stroke-width: 1.2; }
.kolam-dots circle { fill: rgba(250, 226, 170, 0.7); }
.diya { position: relative; width: 60%; height: auto; overflow: visible; margin-top: 6%; filter: drop-shadow(0 18px 24px rgba(20, 8, 24, 0.55)); }
.diya-flame { transform-box: fill-box; transform-origin: 50% 100%; animation: flicker 1.8s ease-in-out infinite; filter: drop-shadow(0 0 10px rgba(255, 170, 70, 0.9)); }
.gate-ml { margin: 0; font-family: var(--ml); color: #e8c48a; font-size: 18px; letter-spacing: 0.04em; }
.gate-names { font-family: var(--display); font-size: clamp(32px, 5.4vw, 54px); letter-spacing: 0.06em; margin: 0; color: #f8e3b0; line-height: 1.1; }
.gate-names .amp, .closing-names .amp { font-family: var(--script); color: #f0b79f; font-size: 0.9em; padding: 0 0.1em; letter-spacing: 0; }
.closing-names .amp { color: var(--blush-ink); }
.gate-status { margin: 0; font-size: 17px; color: #d9bfa0; font-variant-numeric: tabular-nums; min-height: 1.6em; }
.gate-open {
  margin-top: 6px; padding: 13px 32px;
  background: linear-gradient(180deg, #fbe2a2, #d9a24e); color: #2a1530;
  border: 0; border-radius: 999px; cursor: pointer;
  font-family: var(--display); font-size: 17px; letter-spacing: 0.04em;
  box-shadow: 0 0 0 1px rgba(255, 240, 200, 0.5) inset, 0 12px 34px rgba(255, 170, 80, 0.35);
  transition: transform 0.25s ease, opacity 0.5s ease;
}
.gate-open:disabled { opacity: 0; transform: translateY(6px); cursor: default; }
.gate-open:not(:disabled):hover { transform: translateY(-2px); }
.gate-hint { margin: 2px 0 0; font-size: 15px; font-style: italic; color: #b99a8c; }
.gate-bloom {
  position: absolute; z-index: 3; left: 50%; top: 42%;
  width: 40vmax; height: 40vmax; margin: -20vmax 0 0 -20vmax; border-radius: 50%;
  background: radial-gradient(circle, #fffaf0 0%, #fbf3e2 45%, rgba(251, 243, 226, 0) 70%);
  transform: scale(0); opacity: 0; pointer-events: none;
}
.gate-skip {
  position: absolute; z-index: 5;
  right: calc(18px + env(safe-area-inset-right, 0px)); bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  background: transparent; border: 1px solid rgba(240, 200, 120, 0.4); color: #e3c9a3;
  padding: 8px 16px; border-radius: 999px; cursor: pointer; font-size: 15px;
}
.flame { transform-box: fill-box; transform-origin: 50% 100%; animation: flicker 1.6s ease-in-out infinite; animation-delay: var(--d, 0s); }
@keyframes flicker {
  0%, 100% { transform: scale(1, 1) skewX(0deg); opacity: 0.95; }
  35% { transform: scale(0.92, 1.08) skewX(2deg); opacity: 1; }
  70% { transform: scale(1.05, 0.94) skewX(-2deg); opacity: 0.88; }
}

.cover {
  position: relative; min-height: 100svh; overflow: hidden;
  display: grid; place-items: center;
  perspective: 1200px;
}
.cover-scene { position: relative; width: 100%; height: min(900px, 100svh); transform-style: preserve-3d; }
.layer { position: absolute; will-change: transform; }
.layer.art > svg, .layer.wash > svg { width: 100%; height: 100%; display: block; overflow: visible; }
.wash-blush { top: 0; right: 0; width: 46%; height: 46%; }
.wash-sage { bottom: 0; left: 0; width: 44%; height: 50%; }
.frame-lines { inset: 4.5% max(3%, calc(50% - 600px)); border: 1px solid rgba(184, 146, 74, 0.55); outline: 1px solid rgba(184, 146, 74, 0.3); outline-offset: -9px; }
.art-jasmine { top: -2%; left: 2%; width: min(300px, 30%); aspect-ratio: 300 / 420; }
.art-paisley { bottom: 6%; left: 7%; width: min(150px, 15%); aspect-ratio: 170 / 240; }
.art-gopuram { bottom: 4.6%; right: 9%; width: min(230px, 22%); aspect-ratio: 240 / 300; }
.art-deepam { bottom: 4.6%; right: 3.5%; width: min(54px, 5.5%); aspect-ratio: 80 / 300; }
.art-lotus { bottom: 3%; right: 27%; width: min(150px, 14%); aspect-ratio: 200 / 250; }
.art-feather { top: 8%; right: 8%; width: min(80px, 8%); aspect-ratio: 124 / 320; transform: rotate(18deg); }
.cover-title {
  inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; pointer-events: none; padding: 0 14%;
}
.crest { width: min(200px, 44vw); height: auto; }
.crest-flip { transform: scaleY(-1); }
.cover-ml { font-family: var(--ml); color: var(--sage-ink); font-size: clamp(16px, 2vw, 20px); margin: 8px 0 0; letter-spacing: 0.02em; }
.names { margin: 6px 0 0; font-family: var(--display); font-weight: 400; color: var(--gold); line-height: 0.98; display: flex; flex-direction: column; align-items: center; }
.names .name { font-size: clamp(56px, 10.5vw, 132px); letter-spacing: 0.035em; text-transform: uppercase; display: inline-block; }
.names .name .ch { display: inline-block; }
.names .amp { font-family: var(--script); font-size: clamp(40px, 6vw, 72px); color: var(--blush-ink); line-height: 0.6; margin: 6px 0 2px; }
.cover-date { margin: 14px 0 0; font-family: var(--display); font-size: clamp(17px, 1.9vw, 22px); color: var(--sepia); letter-spacing: 0.22em; }
.cover-tagline { margin: 6px 0 4px; font-style: italic; color: var(--muted); font-size: clamp(17px, 1.8vw, 21px); }
.scroll-cue {
  position: absolute; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  font-style: italic; font-size: 16px; color: var(--muted); text-decoration: none;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.scroll-cue::after { content: ""; width: 1px; height: 34px; background: linear-gradient(var(--gold), transparent); animation: cue 2.2s ease-in-out infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

.chapter-nav {
  position: sticky; top: 0; z-index: 30;
  display: flex; gap: 6px; justify-content: center; flex-wrap: wrap;
  padding: calc(10px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px));
  background: rgba(251, 247, 239, 0.86);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(184, 146, 74, 0.25);
}
.chapter-nav a {
  text-decoration: none; font-size: 16px; color: var(--muted);
  padding: 4px 14px; border-radius: 999px; transition: background 0.3s, color 0.3s;
}
.chapter-nav a:hover { color: var(--ink); }
.chapter-nav a[aria-current="true"] { background: var(--gold-soft); color: var(--ink); }

.blessing { padding: 90px max(16px, env(safe-area-inset-right, 0px)) 40px max(16px, env(safe-area-inset-left, 0px)); }
.blessing-panel {
  max-width: 1000px; margin: 0 auto;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(217, 160, 63, 0.18), transparent 60%),
    linear-gradient(180deg, #fdf6e3, #f6e9cc);
  border: 1px solid rgba(166, 61, 37, 0.25);
  box-shadow: 0 30px 60px -40px rgba(74, 42, 22, 0.5);
}
.blessing-body { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: center; padding: 40px clamp(20px, 5vw, 56px); }
.blessing-art { position: relative; height: 320px; }
.blessing-art svg { position: absolute; }
.b-temple { left: 18%; bottom: 0; width: 64%; height: auto; }
.b-deepam { bottom: 0; width: 13%; height: auto; }
.b-deepam-l { left: 2%; }
.b-deepam-r { right: 2%; }
.b-feather { right: 14%; top: -6%; width: 15%; height: auto; transform: rotate(-16deg); }
.b-flute { left: 6%; top: 4%; width: 52%; height: auto; transform: rotate(-12deg); }
.blessing-figure { margin: 0; position: relative; }
.blessing-figure img { width: 100%; max-height: 420px; object-fit: contain; border: 6px solid #fffaf0; box-shadow: 0 0 0 1px var(--mural-ochre), 0 20px 40px -20px rgba(74, 42, 22, 0.6); }
.blessing.has-image .blessing-art { display: none; }
.blessing-text h2 { font-family: var(--display); font-weight: 400; font-style: italic; font-size: clamp(30px, 4vw, 44px); color: var(--mural-red); margin: 0 0 10px; line-height: 1.15; text-wrap: balance; }
.blessing-text p { margin: 0; font-size: 21px; color: var(--sepia); max-width: 30ch; }

.album { padding: 20px 0 60px; }
.chapter { padding: 70px max(16px, env(safe-area-inset-right, 0px)) 30px max(16px, env(safe-area-inset-left, 0px)); scroll-margin-top: 60px; }
.chapter-head { max-width: 1100px; margin: 0 auto 50px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 28px; align-items: end; }
.chapter-num { font-family: var(--display); font-style: italic; font-size: clamp(70px, 11vw, 140px); line-height: 0.8; color: var(--gold-soft); grid-row: span 2; }
.chapter-head h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(36px, 5.4vw, 64px); line-height: 1.05; color: var(--ink); text-wrap: balance; }
.chapter-head p { margin: 8px 0 0; font-size: 21px; font-style: italic; color: var(--muted); max-width: 44ch; }
.chapter-count { font-style: normal; color: var(--gold-ink); }

.spreads { display: flex; flex-direction: column; align-items: center; gap: clamp(40px, 7vw, 90px); }
.spread {
  position: relative; width: min(1100px, 100%);
  aspect-ratio: 11 / 8.5;
  transform-style: preserve-3d;
  transform-origin: 50% 100%;
}
.paper {
  position: absolute; inset: 0; overflow: hidden;
  background: linear-gradient(90deg, var(--paper) 0%, #fffdf8 47%, #efe6d3 50%, #fffdf8 53%, var(--paper) 100%);
  box-shadow: 0 1px 0 rgba(184, 146, 74, 0.3), 0 40px 70px -40px rgba(74, 42, 22, 0.55), 0 2px 6px rgba(74, 42, 22, 0.08);
}
.paper::before { content: ""; position: absolute; inset: 3.2%; border: 1px solid rgba(184, 146, 74, 0.45); pointer-events: none; z-index: 1; }
.deco { position: absolute; pointer-events: none; z-index: 0; }
.deco svg { width: 100%; height: 100%; display: block; overflow: visible; }
.deco.corner { width: 9%; aspect-ratio: 1; z-index: 2; }
.deco.c-tl { top: 1.6%; left: 1.2%; }
.deco.c-tr { top: 1.6%; right: 1.2%; transform: scaleX(-1); }
.deco.c-bl { bottom: 1.6%; left: 1.2%; transform: scaleY(-1); }
.deco.c-br { bottom: 1.6%; right: 1.2%; transform: scale(-1, -1); }
.deco.d-jasmine { top: -4%; left: -1%; width: 24%; aspect-ratio: 300 / 420; }
.deco.d-lotus { bottom: -2%; right: 3%; width: 13%; aspect-ratio: 200 / 250; }
.deco.d-gopuram { bottom: 2%; right: 2%; width: 17%; aspect-ratio: 240 / 300; opacity: 0.85; }
.deco.d-paisley { bottom: 4%; left: 2.5%; width: 12%; aspect-ratio: 170 / 240; }
.deco.d-sage { bottom: 0; left: 0; width: 36%; height: 46%; }
.deco.d-blush { top: 0; right: 0; width: 34%; height: 40%; }
.deco.d-feather { top: 5%; right: 3%; width: 6%; aspect-ratio: 124 / 320; transform: rotate(14deg); }
.deco.d-flute { bottom: 4%; left: 4%; width: 22%; aspect-ratio: 290 / 90; transform: rotate(-8deg); }
.deco.d-crest { top: 2.6%; left: 50%; width: 15%; aspect-ratio: 200 / 72; transform: translateX(-50%); z-index: 2; }

.slots { position: absolute; inset: 8% 7.5%; z-index: 3; container-type: size; }
.layout-welcome .slots, .layout-stack .slots { inset: 8% 8% 8% 50%; }
.tree-host { width: 100%; height: 100%; display: grid; place-items: center; }
.box { display: flex; min-width: 0; min-height: 0; }
.box.row { flex-direction: row; }
.box.col { flex-direction: column; }
.tree { width: min(100cqw, calc(100cqh * var(--ta))); }
.leaf { display: flex; min-width: 0; min-height: 0; padding: 0.9cqmin; }
.frame {
  margin: 0; position: relative; min-width: 0; min-height: 0; flex: 1 1 auto;
  background: #fff; padding: 0.8cqmin;
  box-shadow: 0 18px 30px -18px rgba(59, 47, 36, 0.55), 0 1px 3px rgba(59, 47, 36, 0.12);
  transform: rotate(var(--tilt, 0deg));
  cursor: zoom-in;
  transition: transform 0.5s cubic-bezier(.2, .8, .2, 1), box-shadow 0.5s;
}
.frame:hover { transform: rotate(0deg) translateY(-4px) scale(1.012); box-shadow: 0 28px 40px -20px rgba(59, 47, 36, 0.6); z-index: 4; }
.frame img { width: 100%; height: 100%; display: block; object-fit: contain; background: var(--paper-2); }
.frame:focus-visible { outline-offset: 4px; }
.frame-zoom {
  position: absolute; right: 1.6cqmin; bottom: 1.6cqmin; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255, 252, 245, 0.92); box-shadow: 0 2px 8px rgba(59, 47, 36, 0.35);
  display: grid; place-items: center; opacity: 0; transform: scale(0.85);
  transition: opacity 0.3s, transform 0.3s; pointer-events: none;
}
.frame-zoom svg { width: 20px; height: 20px; fill: var(--gold-ink); }
.frame:hover .frame-zoom, .frame:focus-visible .frame-zoom { opacity: 1; transform: none; }
@media (hover: none) { .frame-zoom { opacity: 0.9; transform: none; } }

.fill { position: absolute; inset: 8% 7.5%; z-index: 1; pointer-events: none; }
.fill.half { inset: 8% 8% 8% 50%; }
.fill-band { position: absolute; left: 0; width: 100%; display: flex; align-items: center; justify-content: space-around; overflow: hidden; opacity: 0.92; }
.fill-band.top { top: 0; }
.fill-band.bottom { bottom: 0; }
.fill-band svg { height: 100%; min-width: 0; flex: 1 1 0; overflow: visible; }
.fill-band.top svg { width: 100%; flex: none; }
.fill-side { position: absolute; top: 0; height: 100%; display: flex; align-items: center; justify-content: center; opacity: 0.92; }
.fill-side.left { left: 0; }
.fill-side.right { right: 0; }
.fill-side svg { width: 80%; height: 76%; overflow: visible; }

.spread-text {
  position: absolute; z-index: 3; left: 8%; width: 36%; top: 50%; transform: translateY(-50%);
  text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.spread-text .st-names { font-family: var(--display); color: var(--gold); font-size: clamp(18px, 2.6vw, 32px); letter-spacing: 0.08em; text-transform: uppercase; line-height: 1.2; }
.spread-text .st-names .amp { font-family: var(--script); text-transform: none; color: var(--blush-ink); letter-spacing: 0; }
.spread-text p { margin: 0; font-style: italic; color: var(--sepia); font-size: clamp(14px, 1.7vw, 20px); line-height: 1.45; max-width: 26ch; }
.layout-stack .spread-text { width: 30%; }
.spread-caption {
  position: absolute; z-index: 3; left: 50%; bottom: 2.2%; transform: translateX(-50%);
  margin: 0; font-style: italic; color: var(--muted); font-size: clamp(12px, 1.4vw, 16px); white-space: nowrap;
}

.closing { position: relative; padding: 80px max(16px, env(safe-area-inset-right, 0px)) 120px max(16px, env(safe-area-inset-left, 0px)); overflow: hidden; }
.closing-inner { max-width: 640px; margin: 0 auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 18px; position: relative; z-index: 1; }
.closing-photo { margin: 0; padding: 10px; background: #fff; box-shadow: 0 30px 60px -36px rgba(59, 47, 36, 0.6); transform: rotate(-1.2deg); width: min(420px, 90%); }
.closing-photo img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: center 35%; }
.closing-text { margin: 10px 0 0; font-size: clamp(24px, 3vw, 32px); font-style: italic; color: var(--sepia); text-wrap: balance; }
.closing-names { margin: 0; font-family: var(--display); font-size: clamp(26px, 3.4vw, 38px); color: var(--gold); letter-spacing: 0.06em; text-transform: uppercase; }
.closing-names .amp { text-transform: none; color: var(--blush-ink); }
.closing-credit { margin: 6px 0 0; font-size: 16px; color: var(--muted); }
.closing-lotus { position: absolute; right: 6%; bottom: -10px; width: 160px; height: auto; opacity: 0.9; }

.site-footer {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 22px max(16px, env(safe-area-inset-right, 0px)) calc(90px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  border-top: 1px solid rgba(184, 146, 74, 0.3); font-size: 16px; color: var(--muted);
}
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }
.edit-link { opacity: 0.6; }

.music {
  position: fixed; z-index: 45;
  right: calc(18px + env(safe-area-inset-right, 0px)); bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px 10px 14px; border-radius: 999px; cursor: pointer;
  background: rgba(36, 20, 11, 0.88); color: #f0d79c; border: 1px solid rgba(217, 160, 63, 0.5);
  box-shadow: 0 12px 30px -12px rgba(36, 20, 11, 0.6);
  font-size: 15px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.music-bars { display: flex; align-items: flex-end; gap: 2px; height: 14px; }
.music-bars i { width: 3px; height: 30%; background: currentColor; border-radius: 2px; }
.music[aria-pressed="true"] .music-bars i { animation: bar 1s ease-in-out infinite; }
.music-bars i:nth-child(2) { animation-delay: 0.2s !important; }
.music-bars i:nth-child(3) { animation-delay: 0.4s !important; }
.music-bars i:nth-child(4) { animation-delay: 0.1s !important; }
@keyframes bar { 0%, 100% { height: 25%; } 50% { height: 100%; } }
body.is-locked .music { opacity: 0; pointer-events: none; }

.lightbox {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(26, 15, 8, 0.96);
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: calc(56px + env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  color: #f0e6d2;
}
.lb-figure { margin: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 0; }
.lb-figure img { max-width: 100%; max-height: calc(100% - 34px); object-fit: contain; border: 6px solid #fff; }
.lb-figure figcaption { font-style: italic; color: #cdb48a; font-size: 16px; }
.lb-close { position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); right: calc(14px + env(safe-area-inset-right, 0px)); }
.lb-close, .lb-nav { background: transparent; color: #f0d79c; border: 1px solid rgba(217, 160, 63, 0.45); border-radius: 999px; cursor: pointer; min-height: 44px; padding: 0 18px; }
.lb-nav { width: 48px; padding: 0; font-size: 26px; }

@media (max-width: 760px) {
  body { font-size: 18px; }
  .gate-jasmine { width: 38vw; opacity: 0.7; }
  .cover-scene { height: 100svh; }
  .cover-title { padding: 0 8%; }
  .art-jasmine { width: 42%; left: -6%; }
  .art-gopuram { width: 34%; right: 4%; }
  .art-deepam, .art-feather { display: none; }
  .art-lotus { width: 24%; right: 34%; }
  .art-paisley { width: 22%; left: 4%; }
  .blessing-body { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .blessing-art { width: 100%; height: 240px; }
  .chapter-head { grid-template-columns: 1fr; }
  .chapter-num { grid-row: auto; font-size: 64px; }
  .chapter-nav { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
  .chapter-nav a { white-space: nowrap; }
  .spread { aspect-ratio: auto; }
  .paper { position: relative; padding: 14% 7% 10%; background: var(--paper); }
  .slots, .layout-welcome .slots, .layout-stack .slots { position: relative; inset: auto; container-type: normal; }
  .tree, .box, .leaf { display: contents; }
  .slots .tree-host { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
  .frame { flex: none; aspect-ratio: var(--ar, 1.3); transform: none; padding: 6px; margin: 0; width: 100%; }
  .frame:hover { transform: none; }
  .frame[data-first] { grid-column: 1 / -1; }
  .fill { display: none; }
  .frame-zoom { right: 10px; bottom: 10px; }
  .spread-text, .layout-stack .spread-text { position: relative; left: auto; top: auto; transform: none; width: 100%; margin-bottom: 16px; }
  .spread-caption { position: relative; left: auto; bottom: auto; transform: none; white-space: normal; text-align: center; margin-top: 12px; }
  .deco.corner { width: 14%; }
  .deco.d-jasmine { width: 34%; }
  .deco.d-gopuram, .deco.d-lotus { width: 22%; opacity: 0.5; }
  .lightbox { grid-template-columns: 1fr; }
  .lb-nav { position: absolute; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
  .lb-prev { left: 16px; }
  .lb-next { right: 16px; }
  .music-label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .flame, .diya-flame, .diya-halo, .gate-sky::after, .scroll-cue::after, .music-bars i { animation: none !important; }
  .frame { transition: none; }
  #petals { display: none; }
}

.view-hint { max-width: 760px; margin: 0 auto 36px; padding: 0 20px; display: flex; gap: 10px; align-items: center; justify-content: center; text-align: center; font-style: italic; font-size: 19px; color: var(--muted); }
.view-hint svg { flex: none; width: 22px; height: 22px; fill: var(--gold-ink); }
#lb-open { margin-left: 12px; color: inherit; font-size: 0.9em; text-decoration: underline; text-underline-offset: 3px; opacity: 0.85; }
