:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --ink: #1f1b17;
  --muted: #8a8178;
  --line: #e9e3dc;
  --accent: #9c7e5b;
  --accent-ink: #ffffff;
  --overlay: rgba(20, 17, 14, .55);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Jost", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 10px;
  --gap: 8px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
body.no-scroll { overflow: hidden; }

/* ------------------------------------------------ centered screens */
.center-screen {
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center; padding: 24px 16px;
  background: linear-gradient(160deg, #fbfaf8 0%, #efebe5 100%);
}
.card {
  width: min(400px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 36px 28px 28px;
  text-align: center;
  box-shadow: 0 20px 50px -30px rgba(40, 30, 20, .35);
}
.brand-mark {
  font: 500 11px/1 var(--sans); letter-spacing: .32em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 22px;
}
.card .lock {
  width: 48px; height: 48px; border-radius: 50%; margin: 0 auto 14px;
  display: grid; place-items: center; background: #f2eee8; color: var(--ink);
}
.card h1 { font: 500 30px/1.15 var(--serif); margin: 0 0 6px; }
.card p { margin: 0 0 22px; color: var(--muted); font-size: 14px; }
.field { position: relative; margin-bottom: 12px; }
.field input {
  width: 100%; height: 48px; padding: 0 46px 0 16px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
  font: 400 16px var(--sans); color: var(--ink); text-align: center;
}
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(156, 126, 91, .18); }
.field .toggle-pw { position: absolute; right: 8px; top: 8px; width: 32px; height: 32px; display: grid; place-items: center; color: var(--muted); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 22px; border-radius: 999px;
  background: var(--ink); color: #fff; font-weight: 500; letter-spacing: .02em;
  transition: opacity .15s, transform .15s; text-decoration: none;
}
.btn:hover { opacity: .9; }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .45; cursor: default; }
.btn.block { width: 100%; }
.btn.accent { background: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.form-error { color: #a4442f; font-size: 14px; margin: 12px 0 0; min-height: 1em; }

/* ------------------------------------------------ hero */
.hero {
  position: relative; height: 100vh; height: 100svh; min-height: 480px;
  display: grid; place-items: center; text-align: center; color: #fff;
  background: #2b2621 center/cover no-repeat; overflow: hidden;
}
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.25) 0%, rgba(0,0,0,.35) 60%, rgba(0,0,0,.55) 100%); }
.hero-inner { position: relative; z-index: 1; padding: 0 20px; animation: rise .9s ease both; }
.hero .rule { width: 64px; height: 1px; background: rgba(255,255,255,.7); margin: 0 auto; }
.hero h1 { font: italic 400 clamp(40px, 7vw, 76px)/1.05 var(--serif); margin: 22px 0 16px; text-shadow: 0 2px 30px rgba(0,0,0,.3); }
.hero .date { font: 400 12px/1 var(--sans); letter-spacing: .3em; text-transform: uppercase; margin: 0 0 22px; opacity: .92; }
.hero .scroll {
  position: absolute; z-index: 1; bottom: 86px; left: 50%; transform: translateX(-50%);
  width: 44px; height: 44px; display: grid; place-items: center; color: #fff;
  animation: bob 2.4s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translate(-50%, 6px); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* ------------------------------------------------ toolbar */
.toolbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  height: 60px; padding: 0 max(16px, env(safe-area-inset-left)) 0 max(16px, env(safe-area-inset-right));
  background: rgba(250, 248, 245, .92); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.toolbar .title { flex: 1; min-width: 0; }
.toolbar .title strong { display: block; font: italic 500 20px/1.1 var(--serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toolbar .title span { display: block; font-size: 10px; letter-spacing: .28em; text-transform: uppercase; color: var(--muted); }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; transition: background .15s; }
.icon-btn:hover { background: rgba(0,0,0,.05); }

/* ------------------------------------------------ content */
main { max-width: 1600px; margin: 0 auto; padding: 24px 16px 120px; min-height: 60vh; }
.section-head { display: flex; align-items: center; gap: 10px; margin: 4px 0 18px; }
.section-head h2 { font: 500 28px/1.1 var(--serif); margin: 0; }
.section-head .count { color: var(--muted); font-size: 13px; margin-left: 4px; }
.section-head .spacer { flex: 1; }
.empty { text-align: center; padding: 70px 16px; color: var(--muted); }
.empty h3 { font: 500 26px var(--serif); color: var(--ink); margin: 0 0 6px; }

.scenes { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.scene-card {
  position: relative; aspect-ratio: 1 / 1; border-radius: var(--radius); overflow: hidden;
  background: #e8e2da; text-align: left; color: #fff;
}
.scene-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.scene-card:hover img { transform: scale(1.035); }
.scene-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,.55)); }
.scene-card .label { position: absolute; z-index: 1; left: 16px; bottom: 14px; }
.scene-card .label strong { display: block; font: 500 24px/1.1 var(--serif); }
.scene-card .label span { font-size: 12px; opacity: .9; letter-spacing: .04em; }

.masonry { display: flex; gap: var(--gap); align-items: flex-start; }
.masonry .col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--gap); }
.tile { position: relative; display: block; width: 100%; border-radius: 4px; overflow: hidden; background: #ebe6df; }
.tile img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s; }
.tile img.loaded { opacity: 1; }
.tile .badge {
  position: absolute; right: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px 3px 6px; border-radius: 999px; background: rgba(0,0,0,.55); color: #fff; font-size: 11px;
}
.tile .badge svg { width: 12px; height: 12px; }
.tile .fav {
  position: absolute; right: 6px; top: 6px; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; opacity: 0; transition: opacity .2s;
  filter: drop-shadow(0 1px 4px rgba(0,0,0,.45));
}
.tile:hover .fav, .tile .fav.on, .tile .fav:focus-visible { opacity: 1; }
@media (hover: none) { .tile .fav { opacity: .9; } }

/* ------------------------------------------------ bottom switch */
.switch {
  position: fixed; z-index: 25; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; gap: 4px; padding: 4px; border-radius: 999px;
  background: rgba(255,255,255,.94); border: 1px solid var(--line); box-shadow: 0 10px 30px -12px rgba(0,0,0,.3);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.switch button { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 16px; border-radius: 999px; font-size: 14px; color: var(--muted); }
.switch button svg { width: 16px; height: 16px; }
.switch button.on { background: var(--accent); color: #fff; }

/* ------------------------------------------------ drawers & modals */
.scrim { position: fixed; inset: 0; z-index: 50; background: var(--overlay); animation: fade .2s ease both; }
@keyframes fade { from { opacity: 0; } }
.drawer {
  position: fixed; z-index: 51; top: 0; bottom: 0; left: 0; width: min(380px, 92vw);
  background: var(--surface); overflow-y: auto; padding: 22px 24px 32px;
  animation: slide .25s ease both; box-shadow: 10px 0 40px -20px rgba(0,0,0,.4);
}
@keyframes slide { from { transform: translateX(-100%); } }
.drawer header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.drawer header h2 { flex: 1; font: 500 26px/1.15 var(--serif); margin: 4px 0 0; }
.drawer .sub { color: var(--muted); font-size: 13px; margin: -10px 0 18px; }
.menu-list { list-style: none; margin: 0; padding: 0; }
.menu-list li { border-bottom: 1px solid var(--line); }
.menu-list button, .menu-list a {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 2px; text-align: left; text-decoration: none; font-size: 15px;
}
.menu-list .meta { margin-left: auto; color: var(--muted); font-size: 13px; }
.menu-list .indent { padding-left: 32px; font-size: 14px; }
.drawer .foot { margin-top: 28px; font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.note { background: #f4f0ea; border-radius: 8px; padding: 12px 14px; font-size: 13px; color: #5d554c; margin: 0 0 18px; }
.dl-group h3 { font: 500 13px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 24px 0 8px; }
.dl-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.dl-row .t { flex: 1; min-width: 0; }
.dl-row .t strong { display: block; font-weight: 500; }
.dl-row .t span { color: var(--muted); font-size: 13px; }
.dl-row .btn { height: 36px; padding: 0 16px; font-size: 13px; }

.modal-wrap { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: var(--overlay); animation: fade .2s ease both; }
.modal { width: min(420px, 100%); background: var(--surface); border-radius: 14px; padding: 30px 26px 24px; animation: rise .3s ease both; }
.modal h2 { font: 500 30px/1.1 var(--serif); text-align: center; margin: 0 0 20px; }
.modal ul { list-style: none; margin: 0 0 24px; padding: 0; }
.modal li { display: flex; gap: 12px; align-items: center; padding: 8px 0; }
.modal li svg { color: var(--accent); flex: none; }

/* ------------------------------------------------ lightbox */
.lightbox { position: fixed; inset: 0; z-index: 70; background: #0d0c0b; color: #fff; display: flex; flex-direction: column; animation: fade .2s ease both; touch-action: pan-y; }
.lb-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; font-size: 13px; letter-spacing: .06em; }
.lb-top .name { opacity: .6; margin-left: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-stage { position: relative; flex: 1; min-height: 0; }
.lb-media { position: absolute; inset: 0 60px; display: flex; align-items: center; justify-content: center; }
.lb-stage img, .lb-stage video { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.lb-stage video { width: 100%; height: 100%; background: #000; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(255,255,255,.08); }
.lb-nav:hover { background: rgba(255,255,255,.16); }
.lb-nav.prev { left: 6px; } .lb-nav.next { right: 6px; }
.lb-bottom { display: flex; justify-content: center; align-items: center; gap: 10px; padding: 12px 16px max(14px, env(safe-area-inset-bottom)); }
.lb-bottom .icon-btn { color: #fff; }
.lb-bottom .icon-btn:hover { background: rgba(255,255,255,.1); }
.lb-bottom .icon-btn.on { color: #e7a6a0; }
.lb-hint { text-align: center; font-size: 11px; opacity: .45; padding-bottom: max(8px, env(safe-area-inset-bottom)); letter-spacing: .04em; }
.lb-spinner { position: absolute; width: 28px; height: 28px; border: 2px solid rgba(255,255,255,.2); border-top-color: #fff; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 640px) {
  .lb-media { inset: 0; }
  .lb-nav { display: none; }
}

.toast {
  position: fixed; z-index: 80; left: 50%; bottom: 90px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px;
  animation: rise .25s ease both; max-width: calc(100% - 32px); text-align: center;
}

footer.site { text-align: center; padding: 30px 16px 110px; color: var(--muted); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; }
footer.site a { text-decoration: none; }

@media (max-width: 600px) {
  :root { --gap: 4px; }
  main { padding: 16px 8px 110px; }
  .scenes { grid-template-columns: 1fr 1fr; gap: 8px; }
  .scene-card .label strong { font-size: 19px; }
  .section-head h2 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
