/* ShaadiGatha Showcase — web version. Warm near-black, ivory and one muted gold, used sparingly. */

:root {
  --ink: #0E0C0B;
  --ivory: #F3EDE4;
  --gold-fixed: #C8A96A;

  --bg: #0E0C0B;
  --surface: #1A1715;
  --text: #F3EDE4;
  --secondary: rgba(243, 237, 228, 0.66);
  --tertiary: rgba(243, 237, 228, 0.4);
  --gold: #C8A96A;
  --hairline: rgba(255, 255, 255, 0.09);
  --card-edge: rgba(255, 255, 255, 0.05);
  --shadow: rgba(0, 0, 0, 0.25);

  --serif: "Didot", "Bodoni 72", "Bodoni Moda", "Bodoni MT", "Times New Roman", serif;
  --sans: "Avenir Next", "Avenir", "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --pad: 64px;
  --row-gap: 46px;
  --card-scale: 1;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);   /* ease-out */
  --t: 0.5s;
  --t-quick: 0.4s;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  color-scheme: dark;
}

:root[data-theme="ivory"] {
  --bg: #F3EDE4;
  --surface: #E8DFD2;
  --text: #1F1A16;
  --secondary: rgba(31, 26, 22, 0.66);
  --tertiary: rgba(31, 26, 22, 0.42);
  --gold: #9E7E3F;
  --hairline: rgba(0, 0, 0, 0.08);
  --card-edge: rgba(0, 0, 0, 0.06);
  --shadow: rgba(60, 40, 20, 0.16);
  color-scheme: light;
}

@media (max-width: 1100px) { :root { --pad: 40px; --card-scale: 0.86; --row-gap: 40px; } }
@media (max-width: 700px)  { :root { --pad: 20px; --card-scale: 0.62; --row-gap: 30px; } }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
body.locked { overflow: hidden; }
img { display: block; max-width: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus { outline: none; }
:focus-visible { outline: 1px solid var(--gold); outline-offset: 4px; }

.label {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--secondary);
}
.serif { font-family: var(--serif); font-weight: 400; }
.fade-in { animation: fadeIn var(--t) var(--ease) both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Images fade in once decoded */
img.lazy { opacity: 0; transition: opacity 0.6s var(--ease); }
img.lazy.loaded { opacity: 1; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--sans); font-weight: 500; font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase;
  padding: 13px 26px; border-radius: 2px; border: 1px solid rgba(200, 169, 106, 0.7);
  color: var(--ivory); background: rgba(243, 237, 228, 0.02);
  transition: background var(--t-quick) var(--ease), border-color var(--t-quick) var(--ease), transform 0.2s var(--ease);
  white-space: nowrap;
}
.btn:hover { background: rgba(243, 237, 228, 0.1); border-color: var(--gold-fixed); }
.btn:active { transform: scale(0.98); }
.btn.filled { background: rgba(243, 237, 228, 0.92); color: var(--ink); border-color: transparent; }
.btn.filled:hover { background: var(--ivory); }
.btn.themed { color: var(--text); border-color: color-mix(in srgb, var(--gold) 70%, transparent); }
.btn.themed:hover { background: color-mix(in srgb, var(--text) 8%, transparent); border-color: var(--gold); }

.pill {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 17px;
  background: rgba(0, 0, 0, 0.35); color: rgba(243, 237, 228, 0.9);
  font-family: var(--sans); font-weight: 500; font-size: 10px; letter-spacing: 0.28em; text-transform: uppercase;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: background var(--t-quick) var(--ease), opacity var(--t) var(--ease);
}
.pill.gold { box-shadow: inset 0 0 0 1px rgba(200, 169, 106, 0.6); }
.pill:hover { background: rgba(0, 0, 0, 0.5); }
.round {
  width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.3); color: var(--ivory);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: background var(--t-quick) var(--ease);
}
.round:hover { background: rgba(0, 0, 0, 0.5); }
.icon { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }

.back {
  position: absolute; z-index: 5; top: calc(28px + var(--safe-top)); left: calc(32px + var(--safe-left));
  display: inline-flex; align-items: center; gap: 10px; height: 36px; padding: 0 16px 0 12px; border-radius: 18px;
  background: rgba(0, 0, 0, 0.35); color: var(--ivory);
  font-weight: 500; font-size: 10px; letter-spacing: 0.28em; text-transform: uppercase;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: background var(--t-quick) var(--ease), opacity var(--t) var(--ease);
}
.back:hover { background: rgba(0, 0, 0, 0.55); }
:root[data-theme="ivory"] .back.on-page { background: rgba(31, 26, 22, 0.06); color: var(--text); }
@media (max-width: 700px) { .back { top: calc(14px + var(--safe-top)); left: calc(14px + var(--safe-left)); } }

/* ---------- Top controls (Home) ---------- */

.top-controls {
  position: fixed; z-index: 40; top: calc(30px + var(--safe-top)); right: calc(40px + var(--safe-right));
  display: flex; align-items: center; gap: 12px;
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease);
}
.top-controls.hidden { opacity: 0; pointer-events: none; transform: translateY(-6px); }
body.idle .top-controls { opacity: 0; }
body.idle .top-controls:hover, body.idle .top-controls:focus-within { opacity: 1; }
.offline-badge { color: rgba(243, 237, 228, 0.75); cursor: default; }
@media (max-width: 700px) {
  .top-controls { top: calc(14px + var(--safe-top)); right: calc(14px + var(--safe-right)); gap: 8px; }
  .top-controls .pill .wide { display: none; }
}

/* ---------- Home ---------- */

.screen { transition: opacity var(--t) var(--ease), transform var(--t) var(--ease); }
.home.covered { opacity: 0; transform: scale(0.985); pointer-events: none; }

.hero { position: relative; height: max(560px, 80vh); height: max(560px, 80svh); overflow: hidden; background: var(--ink); }
@media (max-width: 700px) { .hero { height: max(480px, 78svh); } }
.hero .slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.6s ease-in-out; overflow: hidden; }
.hero .slide.in { opacity: 1; }
.hero .slide img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  animation: kenburns 11s linear both; transform-origin: var(--origin, center);
}
@keyframes kenburns {
  from { transform: scale(1.02) translateX(0); }
  to   { transform: scale(1.12) translateX(var(--dx, 0)); }
}
.hero .shade { position: absolute; inset: 0; pointer-events: none; }
.hero .shade.left { background: linear-gradient(90deg, rgba(0,0,0,0.72), rgba(0,0,0,0.25) 50%, transparent); }
.hero .shade.bottom { background: linear-gradient(180deg, transparent 0%, transparent 50%, color-mix(in srgb, var(--bg) 60%, transparent) 78%, var(--bg) 100%); }
.hero .shade.top { background: linear-gradient(180deg, rgba(0,0,0,0.45), transparent 50%); }
@media (max-width: 700px) { .hero .shade.left { background: linear-gradient(90deg, rgba(0,0,0,0.55), rgba(0,0,0,0.2)); } }

.wordmark {
  position: absolute; z-index: 3; top: calc(38px + var(--safe-top)); left: calc(var(--pad) + var(--safe-left));
  font-family: var(--serif); font-size: 19px; letter-spacing: 0.35em; color: var(--ivory); white-space: nowrap;
}
.wordmark img { height: 30px; width: auto; }
/* Phones: the wordmark sits under the top buttons instead of beside them. */
@media (max-width: 700px) { .wordmark { top: calc(66px + var(--safe-top)); font-size: 13px; letter-spacing: 0.3em; } .wordmark img { height: 22px; } }

.hero-copy {
  position: absolute; z-index: 3; left: calc(var(--pad) + var(--safe-left)); right: var(--pad); bottom: 130px;
  color: var(--ivory);
}
@media (max-width: 700px) { .hero-copy { bottom: 70px; } }
.welcome { font-family: var(--serif); font-style: italic; font-size: 34px; margin: 0 0 26px; animation: rise 1s var(--ease) both; }
@media (max-width: 700px) { .welcome { font-size: 24px; margin-bottom: 16px; } }
.hero-text { animation: rise 1.2s var(--ease) both; }
.hero-text .label { color: var(--gold-fixed); }
.hero-title {
  font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 5.2vw, 60px); line-height: 1.08;
  margin: 14px 0 0; max-width: 820px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hero-sub { font-size: 16px; color: rgba(243, 237, 228, 0.78); margin-top: 14px; }
.hero-actions { display: flex; align-items: center; gap: 14px; margin-top: 30px; }
.dots { display: flex; align-items: center; gap: 8px; padding: 12px; }
.dots button { width: 6px; height: 2px; border-radius: 1px; background: rgba(243, 237, 228, 0.3); transition: width var(--t) var(--ease), background var(--t) var(--ease); }
.dots button.on { width: 22px; background: rgba(243, 237, 228, 0.9); }
.dots button::before { content: ""; display: block; margin: -12px -4px; height: 26px; }

.rows { position: relative; z-index: 2; margin-top: -60px; padding-bottom: 80px; display: flex; flex-direction: column; gap: var(--row-gap); }
@media (max-width: 700px) { .rows { margin-top: -30px; } }

.row-head { display: flex; align-items: center; gap: 14px; padding: 0 calc(var(--pad) + var(--safe-left)); }
.rule { width: 22px; height: 1px; background: var(--gold); flex: none; }
.row-head .label { font-size: 12px; color: color-mix(in srgb, var(--text) 82%, transparent); }
.row { position: relative; }
.scroller {
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity; scroll-padding-inline: var(--pad);
  overscroll-behavior-x: contain;
}
.scroller::-webkit-scrollbar { display: none; }
.track { display: flex; gap: calc(22px * var(--card-scale)); padding: 18px calc(var(--pad) + var(--safe-left)) 24px; width: max-content; align-items: flex-start; }
@media (max-width: 700px) { .track { gap: 12px; padding-top: 12px; padding-bottom: 14px; } }

.row-nav {
  position: absolute; top: 44px; bottom: 60px; width: 56px; z-index: 3; display: flex; align-items: center; justify-content: center;
  color: var(--ivory); opacity: 0; transition: opacity var(--t) var(--ease);
}
.row-nav span { width: 40px; height: 40px; border-radius: 50%; background: rgba(0,0,0,0.45); display: flex; align-items: center; justify-content: center; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.row-nav.prev { left: 8px; } .row-nav.next { right: 8px; }
@media (hover: hover) and (pointer: fine) { .row:hover .row-nav.can { opacity: 1; } }
.row-nav:not(.can) { pointer-events: none; }

/* Cards */
.card { display: block; flex: none; scroll-snap-align: start; width: calc(var(--w) * var(--card-scale)); color: var(--text); }
.card .frame {
  position: relative; width: 100%; height: calc(var(--h) * var(--card-scale)); border-radius: 4px; overflow: hidden;
  background: var(--surface); box-shadow: 0 6px 20px var(--shadow);
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.card .frame::after { content: ""; position: absolute; inset: 0; border-radius: 4px; box-shadow: inset 0 0 0 1px var(--card-edge); pointer-events: none; transition: box-shadow var(--t) var(--ease); }
.card .frame img { width: 100%; height: 100%; object-fit: cover; }
.card .meta { margin-top: 10px; transition: transform var(--t) var(--ease); }
.card .title { font-family: var(--serif); font-size: 17px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .sub { font-size: 12px; color: var(--secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 4px; opacity: 0.7; transition: opacity var(--t) var(--ease); }
.card .sub.custom { opacity: 1; }
@media (hover: hover) {
  .card:hover .frame, .card:focus-visible .frame { transform: scale(1.04); box-shadow: 0 14px 44px rgba(0,0,0,0.5); }
  .card:hover .frame::after { box-shadow: inset 0 0 0 1px rgba(255,255,255,0.14); }
  .card:hover .meta { transform: translateY(5px); }
  .card:hover .sub { opacity: 1; }
}
.card:focus-visible { outline: none; }
.card:focus-visible .frame::after { box-shadow: inset 0 0 0 1px rgba(200,169,106,0.9); }
.card:active .frame { transform: scale(0.985); }
@media (max-width: 700px) { .card .title { font-size: 15px; } .card .sub { font-size: 11px; } }

.k-youtube, .k-film, .k-teaser { --w: 348px; --h: 196px; }
.k-reel { --w: 196px; --h: 348px; }
.k-story, .k-prewedding { --w: 264px; --h: 348px; }
.k-album { --w: 348px; --h: 236px; }

.badge {
  position: absolute; top: 10px; right: 10px; z-index: 2; padding: 5px 9px; border-radius: 12px; background: rgba(0,0,0,0.6);
  color: var(--ivory); font-weight: 500; font-size: 9px; letter-spacing: 0.25em; text-transform: uppercase;
}
.badge.net { display: none; }
body.offline .badge.net { display: block; }
body.offline .card .play-mark { opacity: 0.4; }
.play-mark { position: absolute; left: 12px; bottom: 12px; width: 30px; height: 30px; border-radius: 50%; background: rgba(0,0,0,0.35); display: flex; align-items: center; justify-content: center; color: var(--ivory); opacity: 0.85; }
.play-mark svg { width: 11px; height: 11px; fill: currentColor; margin-left: 2px; }

/* Instagram strip */
.ig-track { align-items: center; gap: 14px; padding-top: 10px; padding-bottom: 10px; }
.ig-profile { display: flex; align-items: center; gap: 14px; padding-right: 18px; flex: none; }
.ig-profile img, .ig-story img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--surface); }
.ig-profile .name { font-family: var(--serif); font-size: 20px; }
.ig-profile .stats { font-size: 12px; color: var(--secondary); margin-top: 4px; }
.ig-story { flex: none; padding: 3px; border-radius: 50%; background: conic-gradient(#C8A96A, #E8D5A8, #C8A96A); }
.ig-story img { border: 2px solid var(--bg); }
.ig-sep { width: 1px; height: 60px; background: var(--hairline); margin: 0 6px; flex: none; }
.ig-post { position: relative; width: calc(180px * max(var(--card-scale), 0.7)); height: calc(180px * max(var(--card-scale), 0.7)); flex: none; border-radius: 3px; overflow: hidden; background: var(--surface); }
.ig-post img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t) var(--ease); }
.ig-post:hover img { transform: scale(1.04); }
.ig-post .kind { position: absolute; top: 8px; right: 8px; color: #fff; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.6)); }

.connect-banner { display: flex; align-items: center; gap: 28px; padding: 30px calc(var(--pad) + var(--safe-left)) 0; flex-wrap: wrap; }
.connect-banner .copy { flex: 1 1 300px; }
.connect-banner .label { color: var(--gold); }
.connect-banner p { font-family: var(--serif); font-style: italic; font-size: 26px; margin: 8px 0 0; }
@media (max-width: 700px) { .connect-banner p { font-size: 21px; } }

.empty-note { padding: 120px var(--pad) 40px; }
.empty-note h2 { font-family: var(--serif); font-weight: 400; font-size: 30px; margin: 0 0 10px; }
.empty-note p { color: var(--secondary); margin: 0; }

/* ---------- Overlays (story, album, player, search, connect) ---------- */

.overlay-host:empty { display: none; }
.view {
  position: fixed; inset: 0; z-index: 30; background: var(--bg); overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  animation: viewIn var(--t) var(--ease) backwards;   /* no transform left behind: fixed children stay fixed */
}
.view.leaving { animation: viewOut 0.35s var(--ease) both; pointer-events: none; }
@keyframes viewIn { from { opacity: 0; transform: scale(1.01); } to { opacity: 1; transform: none; } }
@keyframes viewOut { from { opacity: 1; } to { opacity: 0; } }
.view.dark { background: var(--ink); color: var(--ivory); }

/* Story */
.story-cover { position: relative; height: 100vh; height: 100svh; overflow: hidden; display: flex; align-items: flex-end; justify-content: center; }
.story-cover > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: drift 16s linear both; }
@keyframes drift { from { transform: scale(1); } to { transform: scale(1.08); } }
.story-cover .shade { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.15) 40%, color-mix(in srgb, var(--bg) 90%, transparent) 85%, var(--bg) 100%); }
.story-cover .copy { position: relative; z-index: 2; text-align: center; padding: 0 24px 70px; display: flex; flex-direction: column; align-items: center; gap: 16px; animation: rise 1.2s var(--ease) both; }
.story-cover .copy .label { color: var(--gold-fixed); }
.story-title { font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 6.4vw, 68px); line-height: 1.06; margin: 0; padding: 0 56px; color: var(--ivory); }
:root[data-theme="ivory"] .story-title { color: var(--text); }
.story-sub { font-size: 16px; color: var(--secondary); }
.scroll-cue { margin-top: 18px; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--secondary); }
.scroll-cue .label { color: var(--secondary); font-size: 10px; }
.scroll-cue svg { width: 18px; height: 18px; animation: nudge 2.4s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(4px); } }
@media (max-width: 700px) { .story-title { padding: 0 8px; } .story-cover .copy { padding-bottom: 48px; } }

.gallery { position: relative; padding: 20px calc(var(--pad) + var(--safe-left)) 100px; }
.gallery .grow { display: flex; margin-bottom: var(--gap); gap: var(--gap); }
.tile { position: relative; flex: none; overflow: hidden; border-radius: 2px; background: color-mix(in srgb, var(--text) 4%, transparent); cursor: zoom-in; }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t) var(--ease), opacity 0.6s var(--ease); }
.tile::after { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,0.06); transition: background var(--t) var(--ease); pointer-events: none; }
@media (hover: hover) { .tile:hover img { transform: scale(1.012); } .tile:hover::after { background: transparent; } }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 60; background: rgba(10, 9, 8, 0.985); color: var(--ivory);
  animation: fadeIn var(--t) var(--ease) both; touch-action: none; user-select: none; -webkit-user-select: none;
}
.lightbox .stage { position: absolute; inset: 0; padding: 64px; }
.lightbox.playing .stage { padding: 24px; }
@media (max-width: 700px) { .lightbox .stage { padding: 56px 0; } .lightbox.playing .stage { padding: 0; } }
.lightbox .stage img {
  position: absolute; inset: inherit; width: calc(100% - 128px); height: calc(100% - 128px); left: 64px; top: 64px;
  object-fit: contain; opacity: 0; transition: opacity var(--t) var(--ease), transform 0.3s var(--ease);
}
.lightbox.playing .stage img { width: calc(100% - 48px); height: calc(100% - 48px); left: 24px; top: 24px; transition-duration: 1.4s; }
@media (max-width: 700px) {
  .lightbox .stage img { width: 100%; height: calc(100% - 112px); left: 0; top: 56px; }
  .lightbox.playing .stage img { height: 100%; top: 0; }
}
.lightbox .stage img.shown { opacity: 1; }
.lightbox .bar { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; justify-content: space-between; padding: calc(16px + var(--safe-top)) calc(18px + var(--safe-right)) 0 calc(18px + var(--safe-left)); transition: opacity var(--t) var(--ease); z-index: 3; }
.lightbox .bar button { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; color: var(--ivory); border-radius: 50%; }
.lightbox .bar button:hover { background: rgba(255,255,255,0.06); }
.lightbox .count { color: rgba(243,237,228,0.7); font-size: 10px; }
.lightbox .caption { position: absolute; left: 0; right: 0; bottom: calc(22px + var(--safe-bottom)); text-align: center; font-family: var(--serif); font-size: 18px; color: rgba(243,237,228,0.6); transition: opacity var(--t) var(--ease); z-index: 3; pointer-events: none; }
.lightbox.playing .bar, .lightbox.playing .caption, body.idle .lightbox .bar, body.idle .lightbox .caption { opacity: 0; }
.lightbox.playing .bar:hover, body.idle .lightbox .bar:hover { opacity: 1; }
.lightbox .halves { position: absolute; inset: 0; display: flex; z-index: 2; }
.lightbox .halves div { flex: 1; }
.lightbox .halves .l { cursor: w-resize; } .lightbox .halves .r { cursor: e-resize; }
.lightbox.zoomed .halves { display: none; }
.lightbox.zoomed .stage img.shown { cursor: grab; }

/* Album */
.album-view { background: radial-gradient(circle at center, #24201D 0%, #0E0C0B 75%); color: var(--ivory); overflow: hidden; touch-action: pan-y; }
.album-view .album-top { position: absolute; z-index: 4; left: 0; right: 0; top: 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: calc(30px + var(--safe-top)) 36px 0; transition: opacity var(--t) var(--ease); }
.album-view .album-top .back { position: static; justify-self: start; }
.album-view .album-top .heading { text-align: center; }
.album-view .album-top .heading .label { color: var(--gold-fixed); font-size: 10px; }
.album-view .album-top .heading h1 { font-family: var(--serif); font-weight: 400; font-size: 22px; margin: 4px 0 0; }
.album-view .album-top .pages { justify-self: end; color: rgba(243,237,228,0.6); font-size: 10px; }
@media (max-width: 700px) {
  .album-view .album-top { grid-template-columns: auto 1fr; padding: calc(14px + var(--safe-top)) 14px 0; gap: 12px; }
  .album-view .album-top .heading { text-align: right; }
  .album-view .album-top .heading h1 { font-size: 17px; }
  .album-view .album-top .pages { display: none; }
}
.book-stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; perspective: 2600px; }
.book-zoom { transition: transform var(--t) var(--ease); transform-origin: center; transform-style: preserve-3d; }
.book-zoom.panning { transition: none; }
.book { position: relative; display: flex; box-shadow: 0 30px 60px rgba(0,0,0,0.55), 0 8px 20px rgba(0,0,0,0.35); transform-style: preserve-3d; background: #fff; }
.book.fade-swap { animation: bookIn 0.55s var(--ease) both; }
@keyframes bookIn { from { opacity: 0; transform: scale(0.985); } to { opacity: 1; transform: none; } }
.book .page { position: relative; overflow: hidden; background: #fff; }
.book .page img { width: 100%; height: 100%; object-fit: cover; }
.book .gutter { position: absolute; top: 0; bottom: 0; left: 50%; width: 80px; margin-left: -40px; pointer-events: none; z-index: 3;
  background: linear-gradient(90deg, transparent, rgba(0,0,0,0.10) 42%, rgba(0,0,0,0.22) 50%, rgba(0,0,0,0.10) 58%, transparent); }
.book .edge { position: absolute; inset: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08); pointer-events: none; }
.leaf { position: absolute; top: 0; height: 100%; transform-style: preserve-3d; z-index: 4; transition: transform 0.75s cubic-bezier(0.45, 0.05, 0.35, 1); }
.leaf.fwd { transform-origin: left center; }
.leaf.bwd { transform-origin: right center; }
.leaf .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; background: #fff; }
.leaf .face img { width: 100%; height: 100%; object-fit: cover; }
.leaf .face.back { transform: rotateY(180deg); }
.leaf .face::after { content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity 0.75s ease-in-out; pointer-events: none; }
.leaf.fwd .face.front::after { background: linear-gradient(90deg, rgba(0,0,0,0.25), transparent 40%); }
.leaf.fwd .face.back::after { background: linear-gradient(270deg, rgba(0,0,0,0.25), transparent 40%); }
.leaf.bwd .face.front::after { background: linear-gradient(270deg, rgba(0,0,0,0.25), transparent 40%); }
.leaf.bwd .face.back::after { background: linear-gradient(90deg, rgba(0,0,0,0.25), transparent 40%); }
.leaf.turning .face::after { opacity: 1; }
.leaf.fwd.turning { transform: rotateY(-180deg); }
.leaf.bwd.turning { transform: rotateY(180deg); }

.thumbs { position: absolute; z-index: 4; left: 0; right: 0; bottom: calc(18px + var(--safe-bottom)); display: flex; justify-content: center; transition: opacity var(--t) var(--ease); }
.thumbs .strip { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding: 8px 24px; max-width: 100%; }
.thumbs .strip::-webkit-scrollbar { display: none; }
.thumbs button { flex: none; display: flex; height: 64px; opacity: 0.45; transition: opacity var(--t) var(--ease), transform var(--t) var(--ease); box-shadow: 0 4px 12px rgba(0,0,0,0.4); }
.thumbs button img { height: 100%; width: auto; background: #fff; }
.thumbs button:hover { opacity: 0.85; }
.thumbs button.on { opacity: 1; box-shadow: 0 0 0 1px var(--gold-fixed), 0 4px 12px rgba(0,0,0,0.4); }
@media (max-width: 700px) { .thumbs button { height: 46px; } }
.album-view.chrome-off .album-top, .album-view.chrome-off .thumbs, body.idle .album-view .album-top, body.idle .album-view .thumbs { opacity: 0; }
body.idle .album-view .album-top:hover, body.idle .album-view .thumbs:hover { opacity: 1; }
.turn-hit { position: absolute; top: 15%; bottom: 15%; width: 22%; z-index: 3; }
.turn-hit.l { left: 0; cursor: w-resize; } .turn-hit.r { right: 0; cursor: e-resize; }

/* Player */
.player { background: #000; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.player .frame-wrap { position: relative; width: min(100vw, calc(100vh * 16 / 9)); height: min(100vh, calc(100vw * 9 / 16)); }
.player.portrait .frame-wrap { width: min(100vw, calc(100vh * 9 / 16)); height: min(100vh, calc(100vw * 16 / 9)); }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.player .loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: rgba(243,237,228,0.5); pointer-events: none; }
.player .back { opacity: 0.9; }
body.idle .player .back { opacity: 0; }
.notice { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 60px 28px; }
.notice > img { position: absolute; inset: -40px; width: calc(100% + 80px); height: calc(100% + 80px); object-fit: cover; opacity: 0.35; filter: blur(18px); }
.notice .copy { position: relative; display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 640px; }
.notice .label { color: var(--gold-fixed); }
.notice h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(28px, 4vw, 40px); margin: 0; color: var(--ivory); }
.notice p { color: rgba(243,237,228,0.6); margin: 0; font-size: 14px; }

/* Search */
.search-view { padding: calc(88px + var(--safe-top)) calc(var(--pad) + var(--safe-right)) 60px calc(var(--pad) + var(--safe-left)); }
.search-field { display: flex; align-items: center; gap: 18px; padding-bottom: 14px; border-bottom: 1px solid color-mix(in srgb, var(--gold) 55%, transparent); }
.search-field svg { width: 28px; height: 28px; stroke: var(--gold); stroke-width: 1; fill: none; flex: none; }
.search-field input {
  flex: 1; min-width: 0; background: transparent; border: 0; color: var(--text); font-family: var(--serif); font-size: clamp(26px, 3.4vw, 38px);
  padding: 4px 0; -webkit-appearance: none; appearance: none; border-radius: 0;
}
.search-field input::placeholder { color: var(--tertiary); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0 10px; }
.chip { padding: 7px 14px; border-radius: 16px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 22%, transparent); font-size: 13px; color: var(--secondary); transition: color var(--t-quick) var(--ease), box-shadow var(--t-quick) var(--ease); }
.chip:hover { color: var(--text); box-shadow: inset 0 0 0 1px var(--gold); }
.results { display: flex; flex-direction: column; gap: 36px; margin-top: 26px; }
.results .row-head, .results .track { padding-left: 0; padding-right: 0; }
.results .scroller { margin: 0 calc(-1 * var(--pad)); padding: 0 var(--pad); }
.moments { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 44vw), 1fr)); gap: 14px; margin-top: 16px; }
.moment { display: block; text-align: left; }
.moment .ph { aspect-ratio: 1.4; border-radius: 3px; overflow: hidden; background: var(--surface); }
.moment .ph img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t) var(--ease), opacity 0.6s var(--ease); }
.moment:hover .ph img { transform: scale(1.02); }
.moment .t { font-size: 12px; color: var(--secondary); margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nothing { font-family: var(--serif); font-style: italic; font-size: 22px; color: var(--secondary); }
.search-view .back { position: fixed; }

/* Let's Connect */
.connect-view { display: flex; flex-direction: column; align-items: center; text-align: center; padding: calc(90px + var(--safe-top)) 24px 60px; min-height: 100%; justify-content: center; }
.connect-view .wm { font-family: var(--serif); font-size: 17px; letter-spacing: 0.35em; color: var(--text); }
.connect-view .wm img { height: 28px; }
:root[data-theme="ivory"] .connect-view .wm img { filter: invert(0.88); }
.connect-view h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 6vw, 64px); margin: 26px 0 0; line-height: 1.1; }
.connect-view .thanks { font-family: var(--serif); font-style: italic; font-size: 24px; color: var(--secondary); margin-top: 8px; }
.connect-view .hint { color: var(--gold); margin-top: 18px; }
.qr-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 34px; margin-top: 50px; max-width: 1100px; }
.qr { width: 220px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.qr .code { width: 200px; height: 200px; border-radius: 6px; background: var(--ivory); padding: 16px; box-shadow: 0 10px 36px var(--shadow); transition: transform var(--t) var(--ease); }
.qr:hover .code { transform: translateY(-3px); }
.qr .code img { width: 100%; height: 100%; image-rendering: pixelated; }
.qr .label { color: color-mix(in srgb, var(--text) 85%, transparent); }
.qr .display { font-size: 13px; color: var(--secondary); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 700px) {
  .qr-grid { gap: 22px 16px; margin-top: 36px; }
  .qr { width: calc(50vw - 32px); }
  .qr .code { width: 100%; height: auto; aspect-ratio: 1; padding: 10px; }
}

/* Instagram viewer */
.ig-view { background: #0A0908; color: var(--ivory); display: flex; align-items: center; justify-content: center; }
.ig-view .post { display: flex; flex-direction: column; align-items: center; gap: 18px; max-width: min(92vw, 900px); }
.ig-view .post img { max-width: 100%; max-height: 74vh; object-fit: contain; border-radius: 3px; }
.ig-view .post p { color: rgba(243,237,228,0.7); font-size: 14px; max-width: 640px; text-align: center; margin: 0; white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.ig-view .nav { position: absolute; top: 50%; width: 48px; height: 48px; margin-top: -24px; border-radius: 50%; background: rgba(255,255,255,0.06); display: flex; align-items: center; justify-content: center; }
.ig-view .nav.prev { left: 20px; } .ig-view .nav.next { right: 20px; }

/* ---------- Save for offline panel & toast ---------- */

.sheet-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,0.45); animation: fadeIn 0.3s var(--ease) both; }
.sheet {
  position: fixed; z-index: 81; top: calc(76px + var(--safe-top)); right: calc(40px + var(--safe-right)); width: min(380px, calc(100vw - 28px));
  background: var(--surface); color: var(--text); border-radius: 10px; padding: 24px 24px 22px; box-shadow: 0 24px 60px rgba(0,0,0,0.45);
  animation: rise 0.45s var(--ease) both;
}
@media (max-width: 700px) { .sheet { right: 14px; top: calc(60px + var(--safe-top)); } }
.sheet h3 { font-family: var(--serif); font-weight: 400; font-size: 24px; margin: 6px 0 8px; }
.sheet .label { color: var(--gold); font-size: 10px; }
.sheet p { margin: 0 0 14px; color: var(--secondary); font-size: 14px; }
.sheet .progress { height: 2px; background: var(--hairline); border-radius: 1px; overflow: hidden; margin: 18px 0 8px; }
.sheet .progress div { height: 100%; width: 0; background: var(--gold); transition: width 0.3s linear; }
.sheet .status { font-size: 12px; color: var(--secondary); min-height: 18px; }
.sheet .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.sheet .btn { padding: 11px 18px; font-size: 11px; }
.sheet .btn.themed { color: var(--text); }
.sheet .btn.filled { background: var(--text); color: var(--bg); }
.sheet .btn.filled:hover { background: color-mix(in srgb, var(--text) 88%, var(--gold)); }
.sheet .btn[disabled] { opacity: 0.5; cursor: default; }
.search-field input:focus-visible { outline: none; }
.sheet .fineprint { font-size: 12px; color: var(--tertiary); margin: 14px 0 0; }
.sheet .done { color: var(--gold); }

.toast {
  position: fixed; z-index: 90; left: 50%; bottom: calc(26px + var(--safe-bottom)); transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  background: rgba(20, 18, 16, 0.92); color: var(--ivory); padding: 11px 18px; border-radius: 20px; font-size: 13px;
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease); max-width: calc(100vw - 32px); text-align: center;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

.noscript { padding: 40px; font-family: var(--serif); font-size: 22px; }
.boot-fail { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 30px; }
.boot-fail h1 { font-family: var(--serif); font-weight: 400; font-size: 32px; margin: 0; }
.boot-fail p { color: var(--secondary); margin: 0; }

@media (prefers-reduced-motion: reduce) {
  .hero .slide img, .story-cover > img { animation: none; }
  .view, .lightbox, .hero-text, .welcome { animation-duration: 0.01s; }
}
