/* Lofn photos: an invitation-style card on cotton paper, with pampas behind it.
   Single light theme on purpose: paper stays paper. Tokens keep the old
   names (--bg, --surface, --muted, --accent ...) because admin.html uses them. */
:root {
  color-scheme: light;
  --bg: #efe7da;           /* kraft-cotton page */
  --surface: #fbf7f0;      /* the invitation card */
  --ink: #2f2924;          /* walnut ink */
  --muted: #6f6458;
  --accent: #9a4a2e;       /* wax sienna */
  --accent-deep: #7d3a22;
  --accent-ink: #fbf7f0;
  --sage: #737b60;
  --tan: #b39670;          /* kraft foil hairlines */
  --line: #e3d7c5;
  --ok: #5a6e4c;
  --err: #9e3f2a;
  --radius: 4px;
  --script: "Pinyon Script", "Snell Roundhand", "Apple Chancery", cursive;
  --caps: "Marcellus SC", "Trajan Pro", Georgia, serif;
  --serif: "Cormorant Garamond", "Cormorant", Georgia, serif;
  --sans: var(--serif);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .42 0 0 0 0 .33 0 0 0 0 .22 0 0 0 .08 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg) var(--grain);
  color: var(--ink);
  font: 500 19px/1.5 var(--serif);
  overflow-x: hidden;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.page {
  max-width: 600px;

  margin: 0 auto;
  padding-inline: 16px;
  padding-block: max(76px, env(safe-area-inset-top)) max(28px, env(safe-area-inset-bottom));
  display: grid;
  gap: 44px;
}

/* ---------- the invitation ---------- */

.suite { position: relative; isolation: isolate; }
.sprig { position: absolute; width: 230px; height: auto; z-index: -1; pointer-events: none; }
.sprig-tl { top: -96px; left: -54px; transform: rotate(-4deg); }
.sprig-br { bottom: -92px; right: -52px; transform: rotate(176deg); }

.invite {
  position: relative;
  background: var(--surface) var(--grain);
  border-radius: var(--radius);
  padding: 40px 24px 30px;
  box-shadow:
    0 1px 1px rgba(60, 40, 22, .06),
    0 6px 12px -6px rgba(60, 40, 22, .14),
    0 28px 50px -26px rgba(60, 40, 22, .38);
  display: grid;
  gap: 26px;
}
/* double foil frame */
.invite::before {
  content: ""; position: absolute; pointer-events: none; border-radius: 2px;
}
.invite::before { inset: 10px; border: 1px solid var(--tan); opacity: .75; }


.masthead { text-align: center; display: grid; gap: 6px; justify-items: center; }
.kicker {
  font: 400 12px/1.5 var(--caps); letter-spacing: .2em; text-transform: uppercase;
  color: var(--muted); margin: 0; text-wrap: balance;
}
.kicker span { display: block; }
.kicker span + span { color: var(--tan); }
.tagline {
  font: 400 clamp(46px, 13vw, 68px)/1.08 var(--script);
  margin: 2px 0 0; color: var(--ink); text-wrap: balance;
}
.rule { width: 200px; height: 16px; margin: 8px 0 4px; overflow: visible; }
.rule line { stroke: var(--tan); stroke-width: 1; }
.rule .leaf { fill: var(--sage); }
.rule .leaf2 { fill: #8d957a; }
.rule .berry { fill: var(--accent); }
.lede {
  font: italic 500 20px/1.45 var(--serif); color: var(--muted);
  margin: 0; max-width: 30ch; text-wrap: balance;
}

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

.upload { display: grid; gap: 18px; }
.field { display: grid; gap: 2px; }
.field-label {
  font: 400 11px/1.2 var(--caps); letter-spacing: .24em; text-transform: uppercase; color: var(--muted);
}
.field em { font-style: normal; letter-spacing: .08em; text-transform: none; font-family: var(--serif); font-size: 14px; }
.field input {
  width: 100%; font: italic 500 21px/1.3 var(--serif); color: var(--ink);
  padding: 8px 2px 7px; border: 0; border-bottom: 1px solid var(--tan); border-radius: 0;
  background: transparent; -webkit-appearance: none; appearance: none;
}
.field input::placeholder { color: #a3968a; }
.field input:focus { outline: none; border-bottom-color: var(--accent); box-shadow: 0 1px 0 var(--accent); }

.big-button {
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 58px; padding: 14px 20px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font: 600 20px/1 var(--serif); letter-spacing: .01em;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  box-shadow: inset 0 1px 0 rgba(255, 220, 200, .18), 0 10px 18px -12px rgba(110, 45, 25, .7);
  transition: background .2s ease, transform .12s ease;
}
.big-button:hover { background: var(--accent-deep); }
.big-button:active { transform: translateY(1px); }
.big-button:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.big-button input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
button.big-button { border: 0; width: 100%; }

.hint { font-size: 16px; color: var(--muted); margin: -6px 0 0; text-align: center; }

.summary { font: 400 13px/1.4 var(--caps); letter-spacing: .14em; text-align: center; color: var(--ink); }
.queue { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.queue:empty { display: none; }
.queue li { display: grid; grid-template-columns: 46px 1fr auto; gap: 12px; align-items: center; font-size: 16px; }
.queue img, .queue .ph {
  width: 46px; height: 46px; object-fit: cover; background: var(--line);
  border: 3px solid #fff; box-shadow: 0 2px 5px -2px rgba(60, 40, 22, .35);
}
.queue .name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.bar { height: 2px; background: var(--line); margin-top: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.queue .state { font: 400 11px/1 var(--caps); letter-spacing: .14em; color: var(--muted); }
.queue .done .state { color: var(--ok); }
.queue .failed .state { color: var(--err); }
.retry { font: inherit; color: var(--err); background: none; border: 0; text-decoration: underline; padding: 0; cursor: pointer; }

.notice { text-align: center; display: grid; gap: 6px; }
.notice h2 { font: 400 40px/1.1 var(--script); margin: 0; }
.notice p { margin: 0; color: var(--muted); }

/* ---------- the album ---------- */

.album { display: grid; gap: 18px; }
.album-head { text-align: center; display: grid; gap: 4px; }
.album-head h2 { font: 400 48px/1 var(--script); margin: 0; color: var(--ink); }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 560px) { .gallery { grid-template-columns: repeat(4, 1fr); } }
.tile {
  position: relative; aspect-ratio: 1; padding: 0; margin: 0; cursor: pointer; max-width: 100%;
  background: var(--line); border: 4px solid #fff; border-radius: 1px; overflow: hidden;
  box-shadow: 0 1px 1px rgba(60, 40, 22, .08), 0 8px 14px -10px rgba(60, 40, 22, .5);
  transition: transform .2s ease;
}
.tile:hover { transform: translateY(-2px); }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .play {
  position: absolute; inset: auto 5px 5px auto; width: 24px; height: 24px; border-radius: 50%;
  background: rgba(47, 41, 36, .6); color: #fff; display: grid; place-items: center; font-size: 10px;
}
.link-button {
  justify-self: center; font: 400 13px/1 var(--caps); letter-spacing: .2em; text-transform: uppercase;
  color: var(--accent); background: none; border: 1px solid var(--tan); border-radius: 2px;
  padding: 13px 24px; cursor: pointer;
}
.album .hint { margin: 0; }

/* ---------- viewer ---------- */

.viewer {
  border: 0; padding: 0; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100dvh;
  background: rgba(30, 25, 21, .95); color: #f3ece1;
}
.viewer::backdrop { background: rgba(30, 25, 21, .95); }
.viewer-body { width: 100%; height: calc(100% - 52px); display: grid; place-items: center; padding: 14px; }
.viewer-body img, .viewer-body video { max-width: 100%; max-height: 100%; object-fit: contain; border: 6px solid #fbf7f0; }
.viewer-caption { text-align: center; margin: 0; font: 400 26px var(--script); opacity: .9; }
.viewer-close {
  position: absolute; top: max(10px, env(safe-area-inset-top)); right: 12px; z-index: 2;
  width: 44px; height: 44px; border-radius: 50%; border: 0; font-size: 28px; line-height: 1;
  background: rgba(251, 247, 240, .14); color: #fbf7f0; cursor: pointer;
}

.foot { text-align: center; font: 400 12px/1.6 var(--caps); letter-spacing: .24em; text-transform: uppercase; color: var(--muted); }
.foot span { display: block; font: 400 30px/1.2 var(--script); letter-spacing: 0; text-transform: none; color: var(--ink); }

/* ---------- admin page (shares this stylesheet) ---------- */

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 18px; margin: 8px 0 24px; box-shadow: 0 10px 30px -18px rgba(60, 40, 22, .35);
}
.section-title { font: 400 40px/1.1 var(--script); text-align: center; margin: 0 0 14px; }
.center { text-align: center; }

@media (prefers-reduced-motion: reduce) {
  .tile, .big-button { transition: none; }
}
body > main { max-width: 640px; margin: 0 auto; padding-inline: 16px; padding-block: 0 40px; }
