:root {
  color-scheme: dark;
  --bg: #120b0e;
  --text: #fbf4ec;
  --muted: rgba(251, 244, 236, .68);
  --faint: rgba(251, 244, 236, .16);
  --gold: #e7c07c;
  --gold-deep: #c99a4f;
  --rose: #ff5d7a;
  --glass: rgba(22, 13, 17, .58);
  --glass-strong: rgba(22, 13, 17, .78);
  --display: "Cormorant Garamond", Georgia, serif;
  --ui: Manrope, "Helvetica Neue", Arial, sans-serif;
  --top: 64px;
  --bottom: 92px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; overflow: hidden; background: var(--bg); color: var(--text); font: 15px/1.45 var(--ui); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
img { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: 8px; z-index: 20; transform: translateY(-160%); padding: 10px 14px; border-radius: 10px; background: var(--gold); color: #1a0f0a; }
.skip:focus { transform: none; }

/* The screen takes on the colours of the piece in view. */
.ambient { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: radial-gradient(120% 90% at 50% 10%, #2a1520, var(--bg)); }
.ambient-image { position: absolute; inset: -12%; background: center / cover no-repeat; filter: blur(70px) saturate(1.5) brightness(.5); opacity: 0; transition: opacity .7s ease; }
.ambient-image.on { opacity: 1; }
.ambient::before { content: ""; position: absolute; inset: 0; z-index: 1; background: radial-gradient(70% 55% at 25% 25%, rgba(150, 52, 92, .6), transparent 70%), radial-gradient(60% 55% at 85% 85%, rgba(205, 150, 70, .4), transparent 70%); mix-blend-mode: overlay; }
.ambient::after { content: ""; position: absolute; inset: 0; background: radial-gradient(90% 70% at 50% 40%, transparent, rgba(10, 5, 8, .7)), linear-gradient(transparent 55%, rgba(10, 5, 8, .55)); }

.topbar {
  position: fixed; inset: 0 0 auto; z-index: 6; height: var(--top);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 max(18px, env(safe-area-inset-left)) 0 max(18px, env(safe-area-inset-right));
  background: linear-gradient(rgba(10, 5, 8, .55), transparent);
}
.logo { font: 600 30px/1 var(--display); letter-spacing: -.02em; text-decoration: none; }
.logo span { color: var(--gold); font-style: italic; }
.tabs { display: flex; gap: 22px; }
.tabs button { position: relative; min-height: 44px; padding: 0; border: 0; background: none; color: var(--muted); font-size: 14px; font-weight: 600; transition: color .2s; }
.tabs button::after { content: ""; position: absolute; left: 50%; bottom: 7px; width: 0; height: 2px; border-radius: 2px; background: var(--gold); transform: translateX(-50%); transition: width .25s ease; }
.tabs button[aria-pressed="true"] { color: var(--text); }
.tabs button[aria-pressed="true"]::after { width: 22px; }
.saved-button { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 14px; border: 1px solid var(--faint); border-radius: 999px; background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); font-size: 13px; font-weight: 600; }
.heart { width: 15px; height: 14px; background: var(--rose); clip-path: path("M7.5 14S0 9.4 0 4.4C0 1.9 1.9 0 4.2 0c1.4 0 2.6.7 3.3 1.8C8.2.7 9.4 0 10.8 0 13.1 0 15 1.9 15 4.4 15 9.4 7.5 14 7.5 14z"); }

.feed { position: fixed; inset: 0; z-index: 1; overflow-y: auto; overscroll-behavior: contain; scroll-snap-type: y mandatory; scrollbar-width: none; }
.feed::-webkit-scrollbar { display: none; }
.slide { position: relative; height: 100dvh; scroll-snap-align: start; scroll-snap-stop: always; overflow: hidden; }

/* Piece slides: photo, actions and story. */
.piece { display: grid; grid-template-rows: var(--top) minmax(0, 1fr) auto calc(var(--bottom) + var(--safe-bottom)); content-visibility: auto; contain-intrinsic-size: auto 100dvh; }
body.searching .piece { grid-template-rows: calc(var(--top) + 44px) minmax(0, 1fr) auto calc(var(--bottom) + var(--safe-bottom)); }
.stage { grid-row: 2; position: relative; display: grid; place-items: center; min-height: 0; padding: 0 12px; }
.frame { position: relative; height: 100%; max-width: 100%; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 22px; background: #2a1a20; box-shadow: 0 30px 90px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .06); touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.frame img { width: 100%; height: 100%; object-fit: cover; transform-origin: 50% 40%; -webkit-user-drag: none; }
.frame.contain img, img.contain { object-fit: contain; }
.frame.contain img { padding: 6%; }
.slide.active .frame img { animation: drift 18s ease-out forwards; }
@keyframes drift { from { transform: scale(1); } to { transform: scale(1.08) translateY(-1.2%); } }

.actions { position: absolute; right: 22px; bottom: 14px; display: grid; gap: 12px; }
.action { display: grid; justify-items: center; gap: 3px; padding: 0; border: 0; background: none; font-size: 11px; font-weight: 600; text-shadow: 0 1px 6px rgba(0, 0, 0, .6); }
.action svg { width: 46px; height: 46px; padding: 12px; border-radius: 50%; fill: var(--text); stroke: var(--text); background: rgba(14, 8, 11, .62); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid rgba(255, 255, 255, .12); transition: transform .15s ease, background .2s; }
.action svg path[fill="none"] { fill: none; }
.action:hover svg { background: var(--glass-strong); }
.action:active svg { transform: scale(.9); }
.action[aria-pressed="true"] svg { fill: var(--rose); stroke: var(--rose); animation: pop .35s ease; }
@keyframes pop { 40% { transform: scale(1.25); } }
.burst { position: absolute; width: 110px; height: 110px; margin: -55px 0 0 -55px; pointer-events: none; animation: burst .8s ease-out forwards; }
.burst svg { width: 100%; height: 100%; fill: var(--rose); filter: drop-shadow(0 6px 24px rgba(255, 93, 122, .6)); }
@keyframes burst { 0% { transform: scale(.2); opacity: 0; } 25% { transform: scale(1.1); opacity: 1; } 60% { transform: scale(.95); opacity: 1; } 100% { transform: scale(1.3) translateY(-30px); opacity: 0; } }

.info { grid-row: 3; display: grid; gap: 8px; width: min(100%, 640px); justify-self: center; padding: 14px 20px 0; }
.info > * { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s cubic-bezier(.2, .8, .2, 1); }
.slide.active .info > * { opacity: 1; transform: none; }
.slide.active .info > :nth-child(2) { transition-delay: .06s; }
.slide.active .info > :nth-child(3) { transition-delay: .12s; }
.slide.active .info > :nth-child(4) { transition-delay: .18s; }
.slide.active .info > :nth-child(5) { transition-delay: .24s; }
.reason { justify-self: start; padding: 4px 11px; border-radius: 999px; background: rgba(231, 192, 124, .15); color: var(--gold); font-size: 12px; font-weight: 600; }
.reason::before { content: "✦ "; }
.label-link { justify-self: start; display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0; border: 0; background: none; text-align: left; }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #f3d9a4, var(--gold-deep)); color: #2a1709; font-size: 13px; font-weight: 600; box-shadow: 0 0 0 2px rgba(18, 11, 14, .9), 0 0 0 3.5px var(--gold); }
.label-link strong { display: block; font-size: 14px; }
.label-link small { display: block; color: var(--muted); font-size: 12px; }
.label-link:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.info h2 { font: 600 clamp(26px, 6.6vw, 34px)/1.04 var(--display); letter-spacing: -.01em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.price { color: var(--gold); font-size: 18px; font-weight: 600; }
.kicker { color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.cta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.pill { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border: 1px solid rgba(255, 255, 255, .26); border-radius: 999px; background: rgba(255, 255, 255, .06); font-size: 14px; font-weight: 600; text-decoration: none; transition: background .2s, transform .15s; }
.pill:hover { background: rgba(255, 255, 255, .14); }
.pill:active { transform: scale(.97); }
.pill-solid { border-color: transparent; background: linear-gradient(135deg, #f3d9a4, var(--gold) 45%, var(--gold-deep)); color: #22130a; }
.pill-solid:hover { background: linear-gradient(135deg, #f7e2b8, #ecca8e 45%, #d4a75d); }

/* Opening slide. */
.intro { display: grid; align-items: end; }
.intro-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: drift 24s ease-out forwards; filter: brightness(.62) saturate(1.1); }
.intro::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(10, 5, 8, .3), transparent 30%, rgba(10, 5, 8, .5) 60%, rgba(10, 5, 8, .92)); }
.intro-copy { position: relative; z-index: 1; display: grid; gap: 16px; width: min(100%, 760px); padding: 0 22px calc(var(--bottom) + var(--safe-bottom) + 16px); }
.eyebrow { color: var(--gold); font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }
.intro h1 { font: 600 clamp(46px, 11vw, 104px)/.92 var(--display); letter-spacing: -.025em; }
.intro h1 em { color: var(--gold); font-weight: 500; }
.intro-lede { max-width: 470px; color: var(--muted); font-size: 16px; }
.intro-prompts { display: flex; flex-wrap: wrap; gap: 8px; }
.intro-prompts button { min-height: 40px; padding: 0 15px; border: 1px solid rgba(255, 255, 255, .22); border-radius: 999px; background: rgba(255, 255, 255, .08); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-size: 13px; font-weight: 500; }
.intro-prompts button:hover { border-color: var(--gold); color: var(--gold); }
.swipe-cue { justify-self: start; display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0; border: 0; background: none; color: var(--muted); font-size: 13px; font-weight: 600; }
.swipe-cue span { width: 26px; height: 40px; border: 1.5px solid var(--muted); border-radius: 14px; position: relative; }
.swipe-cue span::after { content: ""; position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--gold); animation: cue 1.8s ease-in-out infinite; }
@keyframes cue { 0% { transform: translateY(12px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(-2px); opacity: 0; } }

.interlude { display: grid; place-content: center; gap: 10px; padding: 0 28px; text-align: center; }
.interlude h2 { font: 600 clamp(34px, 8vw, 60px)/1 var(--display); }
.interlude p { color: var(--muted); }

/* Ask bar, search summary and toast. */
.ask {
  position: fixed; left: 50%; bottom: calc(14px + var(--safe-bottom)); z-index: 7; transform: translateX(-50%);
  display: flex; align-items: center; gap: 6px; width: min(660px, calc(100% - 24px)); min-height: 58px; padding: 6px;
  border: 1px solid rgba(255, 255, 255, .16); border-radius: 999px; background: var(--glass-strong);
  backdrop-filter: blur(22px) saturate(1.4); -webkit-backdrop-filter: blur(22px) saturate(1.4);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .45); transition: border-color .2s, box-shadow .2s;
}
.ask:focus-within { border-color: rgba(231, 192, 124, .6); box-shadow: 0 18px 50px rgba(0, 0, 0, .45), 0 0 0 4px rgba(231, 192, 124, .12); }
.ask input { flex: 1; min-width: 0; height: 44px; padding: 0 6px; border: 0; outline: 0; background: none; font-size: 15px; }
.ask input::placeholder { color: var(--muted); }
.ask-photo, .ask-send { flex: 0 0 auto; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; }
.ask-photo { background: rgba(255, 255, 255, .08); }
.ask-photo:hover { background: rgba(255, 255, 255, .16); }
.ask.has-photo .ask-photo::after { content: "×"; font-size: 20px; }
.ask.has-photo .ask-photo .camera { display: none; }
.ask-thumb { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--gold); }
.ask-send { background: linear-gradient(135deg, #f3d9a4, var(--gold) 45%, var(--gold-deep)); color: #22130a; font-size: 22px; font-weight: 600; }
.camera { position: relative; display: inline-block; width: 18px; height: 14px; border: 1.6px solid currentColor; border-radius: 4px; }
.camera::before { content: ""; position: absolute; inset: 0; width: 6px; height: 6px; margin: auto; border: 1.5px solid currentColor; border-radius: 50%; }
.camera::after { content: ""; position: absolute; top: -4px; left: 4px; width: 6px; border-top: 1.6px solid currentColor; }

.query-bar { position: fixed; top: calc(var(--top) - 4px); left: 50%; z-index: 6; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; max-width: calc(100% - 24px); min-height: 40px; padding: 0 6px 0 16px; border: 1px solid rgba(231, 192, 124, .35); border-radius: 999px; background: var(--glass-strong); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); font-size: 13px; animation: rise .35s ease; }
.query-label { color: var(--muted); }
.query-summary { overflow: hidden; color: var(--gold); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.query-clear { flex: 0 0 auto; width: 32px; height: 32px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .1); font-size: 18px; line-height: 1; }
@keyframes rise { from { opacity: 0; transform: translate(-50%, -8px); } }

.toast { position: fixed; left: 50%; top: calc(var(--top) + 6px); z-index: 8; max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 14px; background: rgba(251, 244, 236, .95); color: #1d1115; font-size: 13px; font-weight: 600; text-align: center; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); opacity: 0; transform: translate(-50%, -10px); pointer-events: none; transition: opacity .25s, transform .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Detail and saved sheets: bottom sheet on phones, side drawer on larger screens. */
.sheet { position: fixed; inset: auto 0 0; width: 100%; max-width: 100%; max-height: 90dvh; margin: 0; padding: 0; border: 0; border-radius: 26px 26px 0 0; background: #1b1015; color: var(--text); box-shadow: 0 -20px 60px rgba(0, 0, 0, .5); overflow: hidden; }
.sheet[open] { display: grid; animation: sheet-up .38s cubic-bezier(.2, .8, .2, 1); }
.sheet::backdrop { background: rgba(8, 4, 6, .6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
@keyframes sheet-up { from { transform: translateY(100%); } }
.sheet-body { display: grid; align-content: start; gap: 18px; max-height: 90dvh; overflow-y: auto; padding: 22px 20px calc(28px + var(--safe-bottom)); overscroll-behavior: contain; }
.sheet-close { position: absolute; top: 12px; right: 12px; z-index: 1; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .45); backdrop-filter: blur(10px); font-size: 22px; line-height: 1; }
.detail-image { width: 100%; max-height: 54dvh; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 18px; }
.detail-copy { display: grid; gap: 8px; }
.detail-copy .kicker { color: var(--gold); }
.detail-copy h2, .sheet h2 { font: 600 32px/1.05 var(--display); }
.detail-price { color: var(--gold); font-size: 20px; font-weight: 600; }
.detail-meta, .saved-note { color: var(--muted); font-size: 14px; }
.detail-actions, .saved-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.detail-credit { color: var(--muted); font-size: 12px; }
.rail-section { display: grid; gap: 10px; }
.rail-section h3 { font: 600 22px/1.1 var(--display); }
.strip { display: flex; gap: 10px; overflow-x: auto; margin: 0 -20px; padding: 0 20px 4px; scroll-snap-type: x proximity; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.strip-tile { flex: 0 0 132px; display: grid; gap: 6px; padding: 0; border: 0; background: none; text-align: left; scroll-snap-align: start; }
.strip-tile img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 12px; background: #2a1a20; transition: transform .2s; }
.strip-tile:hover img { transform: scale(1.03); }
.strip-tile .strip-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 12px; line-height: 1.3; }
.strip-tile small { display: block; color: var(--gold); font-weight: 600; }
.saved-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.saved-grid .strip-tile { flex: none; }

@media (max-width: 899px) {
  .action span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .action svg { width: 44px; height: 44px; padding: 11px; }
  .actions { right: 22px; bottom: 12px; gap: 10px; }
}
body.searching .toast { top: calc(var(--top) + 48px); }

@media (max-width: 420px) {
  .topbar { padding-inline: 14px; gap: 8px; }
  .logo { font-size: 26px; }
  .tabs { gap: 14px; }
  .tabs button { font-size: 13px; }
  .saved-button { padding: 0 11px; }
}

@media (min-width: 900px) {
  :root { --top: 76px; --bottom: 104px; }
  .topbar { padding-inline: 32px; }
  .logo { font-size: 34px; }
  .tabs { position: absolute; left: 50%; transform: translateX(-50%); }
  .piece {
    grid-template-columns: minmax(0, 1fr) auto minmax(300px, 400px) minmax(0, 1fr);
    grid-template-rows: var(--top) minmax(0, 1fr) var(--bottom);
    column-gap: 104px;
  }
  body.searching .piece { grid-template-rows: calc(var(--top) + 40px) minmax(0, 1fr) var(--bottom); }
  .stage { grid-column: 2; padding: 0; }
  .actions { right: -78px; bottom: 0; }
  .info { grid-column: 3; grid-row: 2; align-self: end; width: 100%; padding: 0 0 8px; gap: 12px; }
  .info h2 { font-size: clamp(36px, 3.4vw, 50px); -webkit-line-clamp: 3; }
  .price { font-size: 21px; }
  .intro-copy { padding: 0 6vw 150px; }
  .intro-lede { font-size: 18px; }
  .sheet { inset: 0 0 0 auto; width: min(480px, 100%); height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .sheet[open] { animation-name: sheet-in; }
  .sheet-body { max-height: 100dvh; padding: 28px 28px 40px; }
  .strip { margin: 0 -28px; padding: 0 28px 4px; }
  .detail-image { max-height: 60dvh; }
  @keyframes sheet-in { from { transform: translateX(100%); } }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .info > * { opacity: 1; transform: none; }
}
