/* ==========================================================================
   James & Charice — shared styles
   Mobile-first. Warm neutral paper, ink text, a single clay accent.
   ========================================================================== */

:root:lang(zh), :root[lang^="zh"] {
  --serif: "Cormorant Garamond", "Songti SC", "Noto Serif SC", serif;
}

:root[lang^="zh"] .eyebrow,
:root[lang^="zh"] .cover__dates,
:root[lang^="zh"] .tile__name { letter-spacing: 0.08em; }

:root[lang^="zh"] body { line-height: 1.8; }

:root {
  --paper: #faf6f0;
  --paper-raised: #fffdfa;
  --paper-sunk: #f2ece3;
  --ink: #2f2a26;
  --ink-soft: #6d6258;
  --ink-faint: #a2968a;
  --rule: #e3d9cc;
  --clay: #b07a5e;
  --clay-deep: #8e5f47;
  --sage: #7f8b76;
  --danger: #a6462f;

  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --shadow-sm: 0 1px 2px rgba(47, 42, 38, 0.06), 0 4px 14px rgba(47, 42, 38, 0.05);
  --shadow-md: 0 2px 6px rgba(47, 42, 38, 0.08), 0 18px 40px rgba(47, 42, 38, 0.1);

  --gutter: 20px;
  --measure: 62ch;
  --radius: 3px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
[hidden] { display: none !important; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: 0.005em;
  margin: 0 0 0.4em;
}

h1 { font-size: clamp(2.4rem, 9vw, 4.2rem); }
h2 { font-size: clamp(1.7rem, 5.5vw, 2.5rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--clay-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }

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

.wrap {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.wrap--narrow { max-width: 680px; }

.eyebrow {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 1.1em;
}

.script {
  font-family: var(--serif);
  font-style: italic;
  color: var(--clay-deep);
}

.rule {
  width: 46px;
  height: 1px;
  background: var(--clay);
  border: 0;
  margin: 0 0 1.6rem;
}
.rule--center { margin-inline: auto; }

.center { text-align: center; }
.muted { color: var(--ink-soft); }
.small { font-size: 0.86rem; }

/* ------------------------------------------------------------- site chrome */

.site-head {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 246, 240, 0.9);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--rule);
}

.site-head__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
}

.site-head__mark {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex: 0 0 auto;
}
.site-head__mark img {
  height: 32px;
  width: auto;
  display: block;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 0.78rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  padding-block: 6px;
  border-bottom: 1px solid transparent;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--clay); }

/* The language switch sits first in the nav so it is found before anything is
   read, not after. */
.site-nav__lang {
  appearance: none;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 6px 12px;
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  cursor: pointer;
  line-height: 1.4;
  transition: border-color 140ms ease, color 140ms ease;
}
.site-nav__lang:hover { border-color: var(--ink-faint); color: var(--ink); }

/* Reads as a button, not a link, so it is findable from across a banquet hall. */
.site-nav__cta,
.site-nav a.site-nav__cta {
  background: var(--clay);
  color: #fffdfa;
  border: 1px solid var(--clay);
  border-bottom-color: var(--clay);
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 500;
}
.site-nav a.site-nav__cta:hover,
.site-nav a.site-nav__cta[aria-current="page"] {
  background: var(--clay-deep);
  border-color: var(--clay-deep);
  color: #fffdfa;
}

/* Three links plus the monogram wrap to a second line on a narrow phone. The
   least load-bearing one steps out; the section is still a scroll away. */
@media (max-width: 639px) {
  .site-nav { gap: 12px; font-size: 0.68rem; letter-spacing: 0.08em; }
  .site-nav a[data-nav-optional] { display: none; }
}

/* Narrower still: keep only the button. Everything else is a scroll away. */
@media (max-width: 430px) {
  .site-nav a:not(.site-nav__cta) { display: none; }
  .site-nav__cta { padding: 9px 16px; }
  .site-nav__lang { padding: 6px 10px; }
}

.site-foot {
  border-top: 1px solid var(--rule);
  margin-top: 72px;
  padding-block: 42px 48px;
  text-align: center;
  color: var(--ink-faint);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
}
.site-foot__mark {
  height: 84px;
  width: auto;
  margin: 0 auto 14px;
  opacity: 0.85;
}

/* ------------------------------------------------------------------- cover */

/* The cover frames are exactly 16:9 and carry the monogram and the names inside
   the artwork, so the page never crops them and never sets the names in type on
   top. `contain` plus a matching aspect-ratio means an exact fit at almost every
   size, and slim warm margins rather than a crop on the rest. */
.cover__frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 84svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 10%, #fdf9f4 0%, #f1e7da 55%, #e6d7c6 100%);
}

.cover__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 900ms ease;
}
.cover.has-cover .cover__img {
  opacity: 1;
  /* The frame is `contain` and the cover art carries the monogram and the
     names baked in, so it must sit uncropped at rest. A pan would crop it for
     as long as it ran; this settles *to* 1 instead, ending exactly where the
     design says it should be, and only overreaching for the two seconds after
     the photograph lands. */
  animation: cover-settle 2600ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes cover-settle {
  from { transform: scale(1.035); }
  to   { transform: scale(1); }
}

/* Stands in until the manifest exists, so a fresh deploy still reads as finished. */
.cover__fallback { padding: 32px 20px; text-align: center; }

.cover__names {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.6rem, 11vw, 5.4rem);
  line-height: 1.02;
}
.cover__amp {
  display: block;
  font-style: italic;
  font-size: 0.44em;
  color: var(--clay);
  margin-block: 0.1em;
}

.cover__caption {
  position: relative;
  text-align: center;
  padding-block: 28px 40px;
}

@media (min-width: 720px) {
  .cover__caption { padding-block: 34px 60px; }
}
.cover__caption .eyebrow { margin-bottom: 14px; }
.cover__caption .rule { margin-bottom: 18px; }

.cover__dates {
  margin: 0;
  font-size: clamp(0.76rem, 2.6vw, 0.88rem);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.cover__actions {
  margin-top: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
}

/* A QR is useless on the device you are already holding, so it only appears
   where it can be scanned from — the screen in the hall, or a laptop. */
.cover__qr { display: none; }

@media (min-width: 900px) {
  /* A fixed-width column: the code and its caption share one centre line, and
     the caption cannot stretch the figure wider than the code and throw the
     button beside it off balance. */
  .cover__qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 150px;
    margin: 0;
    animation: qr-in 700ms ease both;
  }

  .cover__qr img {
    width: 132px;
    height: 132px;
    display: block;
    padding: 8px;
    background: #fffdfa;
    border: 1px solid var(--rule);
    border-radius: 4px;
    box-shadow: var(--shadow-sm);
  }

  .cover__qr-label {
    width: 100%;
    margin-top: 10px;
    text-align: center;
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-faint);
    line-height: 1.65;
  }
  .cover__qr-label > span { display: block; }
  :root[lang^="zh"] .cover__qr-label { letter-spacing: 0.06em; text-transform: none; font-size: 0.74rem; }

  /* With ?e=oct-3 the code carries the passcode, so say which evening it opens. */
  .cover__qr.is-event img { border-color: var(--clay); }
  .cover__qr [data-hero-qr-event] {
    color: var(--clay-deep);
    font-weight: 500;
  }
}

/* The hero sits over a photograph, so the label needs to survive that. */
.cover.has-cover .cover__qr-label { color: var(--ink-soft); }

@keyframes qr-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.cover__scroll {
  display: inline-block;
  margin-top: 26px;
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-decoration: none;
}
.cover__scroll::after {
  content: "";
  display: block;
  width: 1px;
  height: 26px;
  margin: 10px auto 0;
  background: linear-gradient(var(--ink-faint), transparent);
}
.cover__scroll:hover { color: var(--ink); }

/* -------------------------------------------------------------------- band */

/* Full-bleed breathing room between sections. The source frames are 16:9, so a
   16:9 box crops nothing at any width. */
.band {
  margin: 0;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--paper-sunk);
  overflow: hidden;
}
.band__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 700ms ease;
}
.band__img.is-loaded { opacity: 1; }

/* Unlike the cover, the bands are `object-fit: cover` — already cropped by
   design — so there is nothing to lose by drifting across them. Paused until
   the band is on screen, because a phone left on this page should not be
   compositing a photograph nobody is looking at. */
.band__img {
  animation: band-drift 26s ease-in-out infinite alternate;
  animation-play-state: paused;
  will-change: transform;
}
.band.is-onscreen .band__img { animation-play-state: running; }

@keyframes band-drift {
  from { transform: scale(1.005) translate3d(0, 0, 0); }
  to   { transform: scale(1.075) translate3d(0, -1.4%, 0); }
}

/* ---------------------------------------------------------- album sections */

.album-section { padding-block: 64px 60px; }
.album-section + .band { margin-top: 4px; }

.album-section__head { text-align: center; margin-bottom: 30px; }

.album-section__title {
  font-size: clamp(1.9rem, 6.5vw, 3rem);
  margin-bottom: 0.25em;
}

.album-section__blurb {
  max-width: 46ch;
  margin-inline: auto;
  font-size: 1.02rem;
}

.album-section__more { margin-top: 26px; text-align: center; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.feature-grid .tile--feature { grid-column: span 2; }
.feature-grid .tile--feature .tile__btn { aspect-ratio: 4 / 3; }

/* Six photos tile evenly in three columns once the feature block is 2x2; below
   that the sixth would leave an orphan on its own row, so it sits out. */
@media (max-width: 719px) {
  .feature-grid .tile:nth-child(6) { display: none; }
}

@media (min-width: 720px) {
  .feature-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .feature-grid .tile--feature { grid-column: span 2; grid-row: span 2; }
  /* Two columns wide and two rows tall is a square, so the square aspect from
     .tile__btn is exactly right here — overriding it to `auto` would let a
     portrait photo stretch the rows and strand empty space beside it. */
  .feature-grid .tile--feature .tile__btn { aspect-ratio: 1 / 1; }
}

/* ----------------------------------------------------------------- closing */

.closing .band { margin-bottom: 0; }
.closing .section { padding-block: 58px 24px; }

/* ----------------------------------------------------------------- section */

.section { padding-block: 68px; }
/* Both of these are narrower than .wrap, so they need the auto margins too —
   without them the block sits at the left edge and its centred text reads as
   misaligned against everything else on the page. */
.section__lede {
  max-width: var(--measure);
  margin-inline: auto;
}

.story {
  max-width: var(--measure);
  margin-inline: auto;
}
.story p { font-size: 1.05rem; }

/* ------------------------------------------------------------------ reveal */

/* Scoped to `js-reveal`, which `reveal.js` sets on the root element. If that
   script never runs, none of this applies and every photograph is simply
   there — the failure mode is no animation, never an empty page. */
.js-reveal [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 14px, 0);
  transition:
    opacity 700ms ease,
    transform 700ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.js-reveal [data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}


/* ---------------------------------------------------------------- the photos */

/* The laptop half of this is in `protect.js`; this is the phone half, and the
   more important one. `-webkit-touch-callout` is what suppresses the iOS
   press-and-hold sheet with **Save to Photos** on it — one gesture, otherwise
   the default on every photograph here. None of it stops a screenshot, and it
   is not meant to. */
img {
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  user-select: none;
}

/* The one exception: the admin page saves photos as part of moderating them. */
.admin img {
  -webkit-touch-callout: default;
  -webkit-user-drag: auto;
  user-select: auto;
}

/* ----------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 28px;
  border-radius: 999px;
  border: 1px solid var(--clay);
  background: var(--clay);
  color: #fffdfa;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}
.btn:hover { background: var(--clay-deep); border-color: var(--clay-deep); color: #fffdfa; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn--ghost { background: transparent; color: var(--clay-deep); }
.btn--ghost:hover { background: var(--clay); color: #fffdfa; }

.btn--quiet {
  background: transparent;
  border-color: var(--rule);
  color: var(--ink-soft);
}
.btn--quiet:hover { background: var(--paper-sunk); border-color: var(--ink-faint); color: var(--ink); }

.btn--small { min-height: 38px; padding: 8px 12px; font-size: 0.66rem; letter-spacing: 0.1em; }

/* Destructive, and it should look it — but not so loud that the admin page
   turns into a wall of red. */
.btn--danger {
  background: transparent;
  border-color: #dcc0b6;
  color: var(--danger);
}
.btn--danger:hover { background: var(--danger); border-color: var(--danger); color: #fffdfa; }

/* The one thing a guest is here to do at the reception. */
.btn--lg {
  min-height: 56px;
  padding: 16px 36px;
  font-size: 0.84rem;
  letter-spacing: 0.18em;
  box-shadow: 0 6px 18px rgba(176, 122, 94, 0.22);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
}
.btn-row--center { justify-content: center; }

/* ------------------------------------------------------------------- forms */

.field { display: block; margin-bottom: 18px; }
.field__label {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 8px;
}

.input {
  width: 100%;
  min-height: 52px;
  padding: 13px 16px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.input:focus {
  border-color: var(--clay);
  box-shadow: 0 0 0 3px rgba(176, 122, 94, 0.16);
  outline: none;
}
.input::placeholder { color: var(--ink-faint); }

.input--note {
  min-height: 0;
  resize: vertical;
  font-size: 0.95rem;
  line-height: 1.45;
  padding: 11px 14px;
}

.input--code {
  text-align: center;
  font-family: var(--serif);
  font-size: 1.9rem;
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  min-height: 68px;
}

.note {
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 0.9rem;
  margin-bottom: 18px;
}
.note--error { background: #f7e7e1; color: #7d3323; border: 1px solid #e4c4b8; }
.note--ok { background: #e9efe6; color: #46583d; border: 1px solid #cfdcc8; }

/* --------------------------------------------------------------- gate card */

.gate {
  min-height: calc(100vh - 58px);
  display: grid;
  place-items: center;
  padding-block: 48px 72px;
}

.card {
  width: 100%;
  max-width: 440px;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 38px 28px 34px;
  box-shadow: var(--shadow-md);
}

/* -------------------------------------------------------------- album tabs */

.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--rule);
  scroll-snap-type: x proximity;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  flex: 0 0 auto;
  scroll-snap-align: start;
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 10px 14px;
  margin-bottom: -1px;
  font-family: var(--sans);
  font-size: 0.74rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-soft);
  cursor: pointer;
  white-space: nowrap;
  transition: color 140ms ease, border-color 140ms ease;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--clay); }
.tab__count { color: var(--ink-faint); margin-left: 6px; font-size: 0.9em; }

/* ------------------------------------------------------------------- grids */

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (min-width: 620px) {
  .grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
}
@media (min-width: 960px) {
  .grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
}

.tile {
  position: relative;
  margin: 0;
  background: var(--paper-sunk);
  border-radius: var(--radius);
  overflow: hidden;
}

.tile__btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  aspect-ratio: 1 / 1;
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 500ms ease, transform 600ms ease;
}
.tile img.is-loaded { opacity: 1; }
.tile__btn:hover img { transform: scale(1.035); }

.tile__caption {
  padding: 8px 4px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* The guest's own words lead; the name signs them. Clamped so one long note
   cannot push the row out of line with its neighbours. */
.tile__message {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.94rem;
  line-height: 1.35;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.tile__name {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 0 2px 2px;
}

/* Clearing a note is rarer than hiding, so it sits on its own row above. */
.tile__actions--wide { grid-column: 1 / -1; }

.tile__flag {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(47, 42, 38, 0.78);
  color: #fffdfa;
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
}

.tile.is-hidden .tile__btn { opacity: 0.32; filter: grayscale(0.8); }

/* --------------------------------------------------------------- skeletons */

.skeleton {
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  background: linear-gradient(100deg, var(--paper-sunk) 30%, #ece3d7 50%, var(--paper-sunk) 70%);
  background-size: 220% 100%;
  animation: shimmer 1.4s infinite linear;
}
@keyframes shimmer { to { background-position: -220% 0; } }

.empty {
  border: 1px dashed var(--rule);
  border-radius: var(--radius);
  padding: 54px 24px;
  text-align: center;
  color: var(--ink-soft);
}

/* ---------------------------------------------------------------- lightbox */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  border: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  background: rgba(26, 22, 19, 0.95);
  color: #fffdfa;
}
.lightbox::backdrop { background: rgba(26, 22, 19, 0.9); }

.lightbox__stage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 56px 12px 74px;
}
.lightbox__stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 2px;
}

.lightbox__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22px;
  text-align: center;
  font-size: 0.82rem;
  color: rgba(255, 253, 250, 0.75);
  padding-inline: 60px;
}

.lightbox__btn {
  position: absolute;
  appearance: none;
  background: rgba(255, 253, 250, 0.1);
  border: 1px solid rgba(255, 253, 250, 0.22);
  color: #fffdfa;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 140ms ease;
}
.lightbox__btn:hover { background: rgba(255, 253, 250, 0.22); }
.lightbox__btn--close { top: 14px; right: 14px; }
.lightbox__btn--prev { top: 50%; left: 10px; transform: translateY(-50%); }
.lightbox__btn--next { top: 50%; right: 10px; transform: translateY(-50%); }

@media (min-width: 720px) {
  .lightbox__btn--prev { left: 24px; }
  .lightbox__btn--next { right: 24px; }
}

/* ------------------------------------------------------------------ upload */

.uploader {
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 24px 20px;
  box-shadow: var(--shadow-sm);
}

/* This is the one thing a guest came here to tap, so it reads as a target
   rather than a polite dashed outline. */
.dropzone {
  border: 1.5px dashed var(--clay);
  border-radius: var(--radius);
  background: #fbf1e9;
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}
.dropzone:hover { background: #f7e8dc; }
.dropzone:active { transform: translateY(1px); }
.dropzone.is-over { border-style: solid; background: #f4e2d3; }

.dropzone__icon {
  display: block;
  width: 42px;
  height: 42px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--clay);
  color: #fffdfa;
  font-size: 1.5rem;
  line-height: 42px;
}

.dropzone__title {
  font-family: var(--serif);
  font-size: 1.5rem;
  color: var(--clay-deep);
  margin-bottom: 4px;
}
.dropzone__hint { font-size: 0.82rem; color: var(--ink-soft); margin: 0; }

.queue { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 9px; }

.queue-item {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
  font-size: 0.86rem;
}

.queue-item__thumb {
  width: 42px;
  height: 42px;
  border-radius: 2px;
  object-fit: cover;
  background: var(--paper-sunk);
}
.queue-item__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.queue-item__bar {
  height: 3px;
  margin-top: 6px;
  border-radius: 999px;
  background: var(--paper-sunk);
  overflow: hidden;
}
.queue-item__fill {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--clay);
  transition: width 220ms ease;
}
.queue-item__state { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); white-space: nowrap; }
.queue-item.is-done .queue-item__state { color: var(--sage); }
.queue-item.is-done .queue-item__fill { background: var(--sage); }
.queue-item.is-error .queue-item__state { color: var(--danger); }
.queue-item.is-error .queue-item__fill { background: var(--danger); }
.queue-item__error { grid-column: 2 / -1; font-size: 0.78rem; color: var(--danger); }

/* --------------------------------------------------------------- page head */

.page-head {
  padding-block: 40px 26px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 34px;
}
.page-head h1 { font-size: clamp(2rem, 7vw, 3.1rem); margin-bottom: 6px; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}
.toolbar__spacer { flex: 1 1 auto; }

.filters { display: flex; gap: 6px; flex-wrap: wrap; }

.chip {
  appearance: none;
  border: 1px solid var(--rule);
  background: var(--paper-raised);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 7px 15px;
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.load-more { display: grid; place-items: center; padding-block: 34px; }

/* ------------------------------------------------------------------ music */

.music {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 60;
  width: 54px;
  height: 54px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  -webkit-tap-highlight-color: transparent;
}

@media (min-width: 720px) {
  .music { left: 24px; bottom: 24px; width: 60px; height: 60px; }
}

/* A record: dark vinyl, fine grooves, a paper label in the middle. */
.music__disc {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle at 50% 50%,
      rgba(255, 253, 250, 0.05) 0 1px,
      rgba(0, 0, 0, 0) 1px 4px),
    radial-gradient(circle at 35% 30%, #4a423b 0%, #2b2521 55%, #1c1815 100%);
  box-shadow:
    0 2px 6px rgba(47, 42, 38, 0.28),
    0 10px 24px rgba(47, 42, 38, 0.22);
  display: grid;
  place-items: center;
  animation: music-spin 7s linear infinite;
  animation-play-state: paused;
  transition: transform 200ms ease;
}

.music:hover .music__disc { transform: scale(1.05); }
.music.is-playing .music__disc { animation-play-state: running; }

.music__label {
  width: 46%;
  height: 46%;
  border-radius: 50%;
  background: var(--paper);
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px rgba(47, 42, 38, 0.18);
}
.music__label img { width: 56%; height: auto; opacity: 0.85; }

/* A soft ring that breathes while the track is on — the cue that survives
   `prefers-reduced-motion`, where the record itself stops turning. */
.music__pulse {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1px solid var(--clay);
  opacity: 0;
  transition: opacity 300ms ease;
}
.music.is-playing .music__pulse {
  opacity: 0.5;
  animation: music-pulse 2.4s ease-out infinite;
}

@keyframes music-spin { to { transform: rotate(360deg); } }

@keyframes music-pulse {
  0%   { transform: scale(1);    opacity: 0.5; }
  70%  { transform: scale(1.22); opacity: 0; }
  100% { transform: scale(1.22); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .music.is-playing .music__disc { animation-play-state: paused; }
  .music.is-playing .music__pulse { animation: none; opacity: 0.6; }
}

/* ------------------------------------------------------------------ kiosk */

/* A screen standing in a banquet hall: read from across the room, never
   scrolled, never touched, running all evening on its own. */
.kiosk-body {
  overflow: hidden;
  background: #1c1815;
  height: 100vh;
  height: 100dvh;
}

.kiosk {
  display: grid;
  grid-template-columns: 1fr minmax(300px, 26vw);
  height: 100vh;
  height: 100dvh;
}

.kiosk__stage {
  position: relative;
  overflow: hidden;
  background: #1c1815;
}

.kiosk__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.kiosk__photo.is-in { opacity: 1; }

/* A wash at the foot so a message stays readable over a bright photo. */
.kiosk__stage::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 40%;
  background: linear-gradient(transparent, rgba(20, 17, 14, 0.72));
  pointer-events: none;
  z-index: 1;
}

.kiosk__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 5vh 5vw;
  text-align: center;
  color: #fffdfa;
}

.kiosk__message {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.6rem, 3vw, 3rem);
  line-height: 1.3;
  margin: 0 0 0.4em;
  text-shadow: 0 2px 20px rgba(20, 17, 14, 0.6);
}

.kiosk__name {
  margin: 0;
  font-size: clamp(0.8rem, 1.1vw, 1rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 253, 250, 0.82);
}

.kiosk__empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  text-align: center;
  color: rgba(255, 253, 250, 0.75);
  font-size: clamp(1rem, 1.6vw, 1.4rem);
}
.kiosk__empty p { margin: 0; }
.kiosk__mark { height: 22vh; width: auto; margin-bottom: 3vh; filter: invert(1) brightness(1.6); opacity: 0.8; }

/* A quiet nudge when something lands, so the screen feels alive. */
.kiosk__new {
  position: absolute;
  top: 3vh;
  right: 3vh;
  z-index: 3;
  display: grid;
  place-items: center;
  min-width: 3.4rem;
  height: 3.4rem;
  padding-inline: 0.8rem;
  border-radius: 999px;
  background: var(--clay);
  color: #fffdfa;
  font-size: 1.5rem;
  font-weight: 500;
  box-shadow: 0 6px 24px rgba(20, 17, 14, 0.45);
  animation: kiosk-pop 500ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

@keyframes kiosk-pop {
  from { transform: scale(0.4); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

/* ---- the panel ---- */

.kiosk__panel {
  background: var(--paper);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2vh;
  padding: 4vh 2vw;
  text-align: center;
}

.kiosk__panel-mark { height: 7vh; width: auto; margin-bottom: 1vh; opacity: 0.9; }

.kiosk__title {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 2.4vw, 2.6rem);
  margin: 0;
  line-height: 1.1;
}
.kiosk__title-zh {
  margin: 0 0 1vh;
  font-size: clamp(1rem, 1.5vw, 1.5rem);
  color: var(--ink-soft);
}

.kiosk__qr {
  width: min(17vw, 30vh);
  height: auto;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: #fff;
  padding: 1.2%;
}

.kiosk__step {
  margin: 1.2vh 0 0;
  font-size: clamp(0.72rem, 0.95vw, 0.95rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.kiosk__step-zh { margin: 0.3vh 0 0; font-size: clamp(0.8rem, 1.05vw, 1.05rem); color: var(--ink-soft); }

.kiosk__fallback {
  margin-top: 2vh;
  padding-top: 2vh;
  border-top: 1px solid var(--rule);
  width: 80%;
}
.kiosk__fallback-label {
  margin: 0;
  font-size: clamp(0.7rem, 0.9vw, 0.9rem);
  color: var(--ink-faint);
}
.kiosk__fallback-label strong { color: var(--ink); font-weight: 500; }
.kiosk__fallback-label span { display: block; }

/* The passcode, set big enough to read and type from a seat at the back. */
.kiosk__code {
  margin: 0.6vh 0 0;
  font-family: var(--serif);
  font-size: clamp(2.4rem, 4.5vw, 4.5rem);
  line-height: 1;
  letter-spacing: 0.16em;
  color: var(--clay-deep);
  font-variant-numeric: lining-nums;
  font-feature-settings: "lnum" 1;
}

.kiosk__count {
  margin: 2vh 0 0;
  font-size: clamp(1.4rem, 2vw, 2.2rem);
  font-family: var(--serif);
  color: var(--ink);
  font-variant-numeric: lining-nums;
}
.kiosk__count-label {
  display: block;
  font-family: var(--sans);
  font-size: clamp(0.65rem, 0.85vw, 0.85rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* A tablet stood upright, or a phone propped on the table. */
@media (max-aspect-ratio: 1/1) {
  .kiosk { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .kiosk__panel { padding: 3vh 6vw; gap: 0.8vh; }
  .kiosk__qr { width: min(42vw, 26vh); }
  .kiosk__panel-mark { display: none; }
  .kiosk__caption { padding: 3vh 6vw; }
}


@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
