/* Face Gallery — quiet, editorial, lots of air. */
:root {
  --bg: #f8f6f2;
  --paper: #ffffff;
  --ink: #1b1a18;
  --ink-2: #57534d;
  --muted: #8f8a82;
  --line: #e4dfd7;
  --accent: #1b1a18;
  --danger: #a5402d;
  --serif: 'Cormorant Garamond', 'Noto Serif Thai', Georgia, serif;
  --sans: 'Inter', 'IBM Plex Sans Thai', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 300 16px/1.75 var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- type ---------- */
.eyebrow {
  font: 500 11px/1.4 var(--sans);
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--muted);
}
.display {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(44px, 9vw, 104px);
  line-height: 1.02;
  letter-spacing: -.01em;
}
.title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(28px, 4.4vw, 44px);
  line-height: 1.15;
}
.lede { color: var(--ink-2); max-width: 34em; }
.small { font-size: 13px; color: var(--muted); line-height: 1.6; }

/* ---------- frame ---------- */
.topbar {
  display: flex; align-items: center; justify-content: center;
  height: 72px; padding: 0 var(--gutter);
}
.topbar a { text-decoration: none; }
.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 620px; margin: 0 auto; }
main { flex: 1; }
footer {
  padding: 72px var(--gutter) 40px;
  text-align: center;
}
.rule { height: 1px; background: var(--line); border: 0; margin: 0 auto; }

/* ---------- hero ---------- */
.hero { text-align: center; padding: 24px 0 0; }
.hero-cover {
  margin: 0 auto;
  width: 100%;
  max-width: 1240px;
  aspect-ratio: 3 / 2;
  background: #ebe6de;
  overflow: hidden;
}
.hero-cover img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.2s var(--ease); }
.hero-cover img.in { opacity: 1; }
.hero-text { padding: clamp(40px, 7vw, 88px) 0 clamp(32px, 5vw, 56px); }
.hero-text .display { margin: 18px 0 20px; }
@media (max-width: 640px) { .hero-cover { aspect-ratio: 4 / 5; } }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 30px;
  border: 1px solid var(--ink); border-radius: 0;
  background: var(--ink); color: var(--bg);
  font: 500 12px/1 var(--sans); letter-spacing: .2em; text-transform: uppercase;
  cursor: pointer; text-decoration: none;
  transition: background .25s var(--ease), color .25s var(--ease), opacity .25s;
}
.btn:hover { background: transparent; color: var(--ink); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--bg); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .35; pointer-events: none; }
.btn.block { width: 100%; }
.link {
  background: none; border: 0; cursor: pointer;
  font: 500 12px/1 var(--sans); letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink); border-bottom: 1px solid var(--ink); padding: 4px 0;
}
.link.muted { color: var(--muted); border-color: var(--line); }

.field { display: block; margin-bottom: 22px; text-align: left; }
.field > span { display: block; margin-bottom: 8px; }
.input {
  width: 100%; height: 50px; padding: 0 2px;
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  background: transparent; outline: none;
  font-size: 17px; font-weight: 300;
  transition: border-color .2s;
}
.input:focus { border-color: var(--ink); }
.input.center { text-align: center; letter-spacing: .3em; font-size: 22px; }

.check { display: flex; gap: 14px; align-items: flex-start; text-align: left; cursor: pointer; }
.check input { appearance: none; flex: none; width: 18px; height: 18px; margin-top: 4px; border: 1px solid var(--ink); background: transparent; cursor: pointer; display: grid; place-content: center; }
.check input:checked::after { content: ''; width: 10px; height: 10px; background: var(--ink); }

.status { min-height: 1.6em; color: var(--ink-2); font-size: 14px; }
.status.error { color: var(--danger); }
.spinner { display: inline-block; width: 12px; height: 12px; border: 1px solid var(--muted); border-top-color: var(--ink); border-radius: 50%; animation: spin .9s linear infinite; vertical-align: -1px; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- finder ---------- */
.panel { text-align: center; padding-top: 8px; padding-bottom: 24px; }
.panel .title { margin: 14px 0 14px; }
.panel .lede { margin: 0 auto 36px; }
.actions { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; margin: 32px 0 18px; }
@media (max-width: 520px) { .actions { grid-template-columns: 1fr; } }
.consent { padding: 22px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }

.selfie-row { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 0 0 18px; flex-wrap: wrap; }
.selfie-row img { width: 56px; height: 56px; object-fit: cover; border-radius: 50%; filter: grayscale(.2); }

/* ---------- results ---------- */
.results-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 56px 0 28px; border-bottom: 1px solid var(--line); margin-bottom: 28px;
}
.results-head .tools { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.grid { columns: 3 280px; column-gap: 14px; }
.grid figure {
  break-inside: avoid; margin: 0 0 14px; cursor: zoom-in; background: #ebe6de; overflow: hidden;
}
.grid img { width: 100%; height: auto; opacity: 0; transform: scale(1.015); transition: opacity .8s var(--ease), transform 1.2s var(--ease); }
.grid img.in { opacity: 1; transform: none; }
.grid figure:hover img.in { transform: scale(1.02); }
@media (max-width: 520px) { .grid { columns: 2; column-gap: 8px; } .grid figure { margin-bottom: 8px; } }

.empty { text-align: center; padding: 64px 0; color: var(--ink-2); }

.pixieset { text-align: center; padding-top: 72px; }
.pixieset .title { margin: 12px 0 24px; }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 50;
  background: var(--bg);
  display: grid; grid-template-rows: 64px 1fr 72px;
  opacity: 0; pointer-events: none; transition: opacity .35s var(--ease);
}
.lightbox.open { opacity: 1; pointer-events: auto; }
.lb-top, .lb-bottom { display: flex; align-items: center; justify-content: space-between; padding: 0 var(--gutter); }
.lb-stage { position: relative; display: grid; place-items: center; padding: 0 var(--gutter); min-height: 0; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 30px 60px -30px rgba(0,0,0,.25); }
.lb-nav {
  position: absolute; top: 0; bottom: 0; width: 22%; border: 0; background: none; cursor: pointer;
  font: 300 34px/1 var(--serif); color: var(--ink-2);
}
.lb-nav.prev { left: 0; text-align: left; padding-left: var(--gutter); }
.lb-nav.next { right: 0; text-align: right; padding-right: var(--gutter); }
.icon-btn { background: none; border: 0; cursor: pointer; font: 300 28px/1 var(--sans); color: var(--ink); padding: 8px; }

/* ---------- admin ---------- */
.admin main { padding-bottom: 80px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; }
@media (max-width: 720px) { .cols { grid-template-columns: 1fr; } }
.card { background: var(--paper); border: 1px solid var(--line); padding: clamp(22px, 4vw, 40px); margin-bottom: 28px; }
.card h2 { margin-bottom: 26px; }
.drop {
  border: 1px dashed var(--muted); padding: 34px 20px; text-align: center; cursor: pointer;
  transition: border-color .2s, background .2s;
}
.drop:hover, .drop.over { border-color: var(--ink); background: #fbfaf8; }
.progress { height: 2px; background: var(--line); margin: 18px 0 10px; overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--ink); transition: width .3s var(--ease); }
.log { font: 12px/1.6 ui-monospace, Menlo, monospace; color: var(--ink-2); max-height: 160px; overflow: auto; white-space: pre-wrap; }
.events { list-style: none; }
.events li { display: flex; align-items: center; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.events li:last-child { border-bottom: 0; }
.events .ev-main { flex: 1; min-width: 200px; }
.events .ev-title { font-family: var(--serif); font-size: 24px; line-height: 1.2; }
.events .ev-actions { display: flex; gap: 18px; }
.done { text-align: center; }
.done .qr { width: 200px; margin: 24px auto; }
.done .qr svg { width: 100%; height: auto; }
.urlbox { font-size: 14px; word-break: break-all; padding: 12px; background: var(--bg); margin: 10px 0 18px; }
.inline { display: flex; gap: 12px; align-items: center; }
.toggle { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--ink-2); cursor: pointer; }
