/* ==========================================================================
   Shawn & Allie · The Morans: shared site styles
   Mobile first. Everything is full-bleed; only reading text is width-limited.
   ========================================================================== */

/* ---------- Fonts (self-hosted latin subsets) ---------- */
@font-face { font-family: "Rye"; src: url("/fonts/rye-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Pinyon Script"; src: url("/fonts/pinyon-script-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Bitter"; src: url("/fonts/bitter-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Bitter"; src: url("/fonts/bitter-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Bitter"; src: url("/fonts/bitter-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Bitter"; src: url("/fonts/bitter-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
  --saddle: #6B3E26;
  --saddle-dark: #4f2c1a;
  --rawhide: #C9A27E;
  --cream: #F5ECDD;
  --cream-2: #efe2cc;
  --clay: #B5532B;
  --clay-dark: #93401f;
  --gold: #E0A43A;
  --turquoise: #2E9C9A;
  --turquoise-dark: #237a78;
  --charcoal: #2B2420;
  --ink-soft: #5a4c43;
  --white: #fffaf2;

  --font-display: "Rye", "Rockwell", "Georgia", serif;
  --font-script: "Pinyon Script", "Snell Roundhand", "Brush Script MT", cursive;
  --font-body: "Bitter", "Georgia", "Cambria", serif;

  --gutter: clamp(12px, 3vw, 48px);
  --radius: 14px;
  --radius-sm: 9px;
  --tap: 48px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --shadow-1: 0 1px 2px rgb(43 36 32 / .12), 0 2px 8px rgb(43 36 32 / .08);
  --shadow-2: 0 6px 18px rgb(43 36 32 / .16), 0 2px 6px rgb(43 36 32 / .1);
  --shadow-3: 0 18px 50px rgb(43 36 32 / .28);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-bounce: cubic-bezier(.34, 1.56, .64, 1);

  /* Faint paper fibre + grain, cheap to paint (pure gradients). */
  --tex-paper:
    radial-gradient(circle at 20% 30%, rgb(107 62 38 / .035) 0 1px, transparent 1.5px) 0 0 / 7px 7px,
    radial-gradient(circle at 70% 60%, rgb(107 62 38 / .03) 0 1px, transparent 1.5px) 0 0 / 11px 11px,
    linear-gradient(180deg, var(--cream), var(--cream-2));
  --tex-leather:
    radial-gradient(circle at 30% 40%, rgb(0 0 0 / .08) 0 1px, transparent 2px) 0 0 / 5px 5px,
    radial-gradient(circle at 60% 70%, rgb(255 255 255 / .04) 0 1px, transparent 2px) 0 0 / 7px 7px,
    linear-gradient(160deg, #7a4730, var(--saddle) 45%, var(--saddle-dark));
  --tex-wood:
    repeating-linear-gradient(90deg, rgb(0 0 0 / .05) 0 2px, transparent 2px 9px, rgb(255 255 255 / .03) 9px 10px, transparent 10px 23px),
    repeating-linear-gradient(0deg, transparent 0 63px, rgb(0 0 0 / .18) 63px 65px),
    linear-gradient(180deg, #3a2e27, #2B2420);
  --rope:
    repeating-linear-gradient(-55deg, #b48a5c 0 5px, #8c6338 5px 7px, #d7b88e 7px 10px, #a57b4c 10px 12px);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
html.calm, html.calm * { scroll-behavior: auto !important; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: clamp(16px, 0.35vw + 15px, 19px);
  line-height: 1.55;
  color: var(--charcoal);
  background: var(--tex-paper);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
/* The ranch brand as a very faint watermark pattern behind everything. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .025;
  background-color: var(--saddle);
  -webkit-mask: url("/assets/brand/generated/brand-mask.png") 0 0 / 120px 120px repeat space;
  mask: url("/assets/brand/generated/brand-mask.png") 0 0 / 120px 120px repeat space;
}
img, video, canvas, svg { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--clay-dark); text-underline-offset: .18em; }
a:hover { color: var(--clay); }
h1, h2, h3 { line-height: 1.12; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--turquoise); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
::selection { background: var(--gold); color: var(--charcoal); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--gutter); top: -100px; z-index: 100;
  background: var(--charcoal); color: var(--cream); padding: .7em 1em; border-radius: var(--radius-sm);
}
.skip-link:focus { top: calc(8px + var(--safe-top)); }

.display { font-family: var(--font-display); font-weight: 400; letter-spacing: .01em; }
.script { font-family: var(--font-script); font-weight: 400; }
.hint { font-size: .88em; color: var(--ink-soft); }
.icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon .fill { fill: currentColor; stroke: none; }

.uploads-closed .uploads-only { display: none !important; }
.uploads-open .uploads-closed-only { display: none !important; }

/* ---------- Brand mark (CSS mask of the real ranch-brand artwork) ---------- */
.brand-mark {
  display: inline-block;
  width: 2rem;
  aspect-ratio: 1;
  background-color: currentColor;
  -webkit-mask: url("/assets/brand/generated/brand-mask.png") center / contain no-repeat;
  mask: url("/assets/brand/generated/brand-mask.png") center / contain no-repeat;
}
.brand-mark--sm { width: 30px; color: var(--saddle); }
.brand-mark--head { width: 64px; color: var(--clay); margin-bottom: .4rem; }
.brand-mark--footer { width: 58px; color: var(--gold); }
.brand-mark--divider { width: 42px; color: var(--saddle); flex: none; }
.brand-mark--burn {
  width: 110px;
  background: radial-gradient(circle at 50% 50%, #ffcf6b, var(--clay) 45%, var(--saddle-dark) 80%);
  filter: drop-shadow(0 0 10px rgb(224 164 58 / .55));
  animation: ember 2.6s ease-in-out infinite;
}
@keyframes ember {
  0%, 100% { filter: drop-shadow(0 0 6px rgb(224 164 58 / .35)); opacity: .9; }
  50% { filter: drop-shadow(0 0 16px rgb(224 164 58 / .8)); opacity: 1; }
}

/* ---------- Dividers ---------- */
.rope-divider { padding-block: clamp(18px, 3vw, 34px); }
.rope-divider span {
  display: block; height: 9px; width: 100%;
  border-radius: 9px;
  background: var(--rope);
  box-shadow: inset 0 -2px 2px rgb(0 0 0 / .2), 0 2px 3px rgb(0 0 0 / .12);
  transform-origin: left center;
}
.brand-divider { display: flex; align-items: center; gap: 16px; padding-block: clamp(18px, 3vw, 34px); }
.brand-divider__line {
  flex: 1; height: 2px;
  background: repeating-linear-gradient(90deg, var(--saddle) 0 10px, transparent 10px 16px);
  opacity: .6;
}
.brand-divider__line:first-child { transform-origin: right center; }
.brand-divider__line:last-child { transform-origin: left center; }

/* ---------- Buttons (leather press) ---------- */
.btn {
  --btn-bg: var(--cream);
  --btn-fg: var(--charcoal);
  --btn-edge: rgb(43 36 32 / .25);
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: var(--tap);
  padding: .7em 1.25em;
  border: 0;
  border-radius: var(--radius);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 3px 0 var(--btn-edge), var(--shadow-1);
  transition: transform .12s var(--ease-out), box-shadow .12s var(--ease-out), filter .2s;
  touch-action: manipulation;
  user-select: none;
}
.btn::after { /* stitched edge */
  content: ""; position: absolute; inset: 4px; border-radius: calc(var(--radius) - 4px);
  border: 1.5px dashed currentColor; opacity: .28; pointer-events: none;
}
.btn:hover { filter: brightness(1.05); color: var(--btn-fg); }
.btn:active { transform: translateY(3px) scale(.985); box-shadow: 0 0 0 var(--btn-edge), inset 0 2px 6px rgb(0 0 0 / .25); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; filter: grayscale(.3); }
.btn[disabled]:active { transform: none; }
.btn--primary { --btn-bg: var(--tex-leather); --btn-fg: var(--cream); --btn-edge: #3a2113; }
.btn--secondary { --btn-bg: linear-gradient(160deg, #c4643b, var(--clay) 50%, var(--clay-dark)); --btn-fg: #fff7ec; --btn-edge: #6e2f17; }
.btn--turq { --btn-bg: linear-gradient(160deg, #39b0ad, var(--turquoise) 50%, var(--turquoise-dark)); --btn-fg: #fff; --btn-edge: #175957; }
.btn--danger { --btn-bg: linear-gradient(160deg, #c44a3b, #a8331f); --btn-fg: #fff; --btn-edge: #5d1a0f; }
.btn--ghost { --btn-bg: rgb(255 250 242 / .7); --btn-edge: rgb(107 62 38 / .35); border: 1.5px solid rgb(107 62 38 / .35); }
.btn--ghost::after { display: none; }
.btn--sm { min-height: 40px; padding: .45em .9em; font-size: .92em; border-radius: var(--radius-sm); }
.btn--sm::after { inset: 3px; border-radius: calc(var(--radius-sm) - 3px); }
.btn--lg { min-height: 56px; padding: .85em 1.5em; font-size: 1.05em; }
.btn--xl { min-height: 64px; padding: 1em 1.6em; font-size: 1.12em; }
.btn--block { width: 100%; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(6px + var(--safe-top)) var(--gutter) 6px;
  background: rgb(245 236 221 / .86);
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  border-bottom: 1px solid rgb(107 62 38 / .12);
  transition: transform .3s var(--ease-out);
}
.topbar.is-hidden { transform: translateY(-100%); }
.topbar__home { display: flex; align-items: center; gap: 10px; min-height: var(--tap); text-decoration: none; color: var(--charcoal); }
.topbar__names { font-size: 1.75rem; line-height: 1; padding-top: .15em; }
.topbar__nav { display: flex; align-items: center; gap: clamp(6px, 2vw, 18px); }
.topbar__link { display: inline-flex; align-items: center; min-height: var(--tap); padding-inline: 6px; font-weight: 600; color: var(--saddle); text-decoration: none; }
.topbar__link[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .35em; }
.topbar__cta { display: none; }
@media (min-width: 700px) { .topbar__cta { display: inline-flex; } }
.page-admin .topbar, .page-qr-card .topbar { display: none; }

/* ---------- Sticky mobile action bar ---------- */
.actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  padding: 10px var(--gutter) calc(10px + var(--safe-bottom));
  background: linear-gradient(180deg, rgb(245 236 221 / 0), rgb(245 236 221 / .96) 35%);
  transition: transform .35s var(--ease-out), opacity .35s;
}
.actionbar.is-hidden { transform: translateY(110%); opacity: 0; pointer-events: none; }
.uploads-closed .actionbar { display: none; }
@media (min-width: 700px) { .actionbar { display: none; } }
@media (max-width: 699px) { body:has(.actionbar) .footer { padding-bottom: calc(96px + var(--safe-bottom)); } }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: min(100svh, 980px);
  display: grid;
  place-items: center;
  padding: clamp(24px, 6vw, 64px) var(--gutter) clamp(110px, 16vw, 170px);
  overflow: hidden;
  isolation: isolate;
  text-align: center;
}
.hero__sky {
  position: absolute; inset: 0; z-index: -3;
  background:
    radial-gradient(120% 70% at 50% 108%, rgb(224 164 58 / .65), transparent 60%),
    radial-gradient(90% 60% at 50% 100%, rgb(181 83 43 / .35), transparent 70%),
    linear-gradient(180deg, var(--cream) 0%, #f3e3c8 55%, #eecf9f 80%, #e7b77a 100%);
}
.hero__sun {
  position: absolute; z-index: -2; left: 50%; bottom: 9%;
  width: min(80vw, 720px); aspect-ratio: 1; translate: -50% 50%;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(255 214 140 / .9), rgb(224 164 58 / .45) 40%, transparent 68%);
  filter: blur(2px);
}
.hero__dust { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; }
html.intro .hero__logo, html.intro .hero__names, html.intro [data-hero-fade] { opacity: 0; }
.hero__content { display: flex; flex-direction: column; align-items: center; gap: .2rem; width: 100%; }
.hero__logo {
  width: min(84vw, 540px);
  height: auto;
  filter: drop-shadow(0 6px 14px rgb(107 62 38 / .18));
  will-change: transform;
}
.hero__names {
  display: flex; align-items: baseline; justify-content: center; gap: .18em;
  margin: .1em 0 .05em;
  font-size: clamp(3.4rem, 11vw, 6.2rem);
  line-height: 1.05;
  color: var(--saddle);
}
.hero__amp { color: var(--clay); font-size: .8em; }
.hero__name { display: inline-block; }
.hero__date {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.6vw, 1.45rem);
  letter-spacing: .06em;
  color: var(--charcoal);
}
.hero__place { margin: .1em 0 1.1em; font-size: clamp(1rem, 2.2vw, 1.25rem); color: var(--ink-soft); letter-spacing: .14em; text-transform: uppercase; font-weight: 600; }
.hero__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.hero__ground {
  position: absolute; left: 0; right: 0; bottom: 0; height: clamp(90px, 14vw, 150px); z-index: 0;
  background:
    radial-gradient(140% 100% at 50% 100%, #a8582f 0 40%, transparent 41%) bottom / 100% 100% no-repeat,
    linear-gradient(180deg, transparent 0 30%, rgb(181 83 43 / .55) 30% 100%);
}
.hero__fence {
  position: absolute; left: 0; right: 0; bottom: 38%; height: 46px; opacity: .55;
  background:
    linear-gradient(180deg, transparent 0 8px, var(--saddle-dark) 8px 13px, transparent 13px 28px, var(--saddle-dark) 28px 33px, transparent 33px) 0 0 / 100% 100%,
    repeating-linear-gradient(90deg, transparent 0 calc(12vw - 8px), var(--saddle-dark) calc(12vw - 8px) 12vw);
}
.tumbleweed-lane { position: absolute; left: 0; right: 0; bottom: 18%; height: 80px; pointer-events: none; overflow: visible; }
.tumbleweed { position: absolute; left: 0; bottom: 0; width: 64px; height: 64px; will-change: transform; }
.tumbleweed svg { width: 100%; height: 100%; overflow: visible; }
.tumbleweed__shadow { position: absolute; left: 8px; right: 8px; bottom: -4px; height: 8px; border-radius: 50%; background: rgb(43 36 32 / .25); filter: blur(2px); }

/* ---------- Sections ---------- */
.welcome, .gallery-section, .featured, .page-head, .mine, .lost { padding-inline: var(--gutter); }
.welcome { padding-block: 8px clamp(36px, 6vw, 80px); text-align: center; }
.section-title { font-size: clamp(1.9rem, 5.5vw, 3.4rem); color: var(--saddle); text-align: center; text-wrap: balance; }
.section-title--light { color: var(--cream); }
.section-intro { max-width: 62ch; margin: 0 auto 1.5em; text-align: center; color: var(--ink-soft); text-wrap: pretty; }
.welcome__letter {
  position: relative;
  max-width: 68ch; margin: 0 auto 2rem;
  padding: clamp(22px, 4vw, 44px) clamp(18px, 4vw, 52px);
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  text-align: left;
}
.welcome__letter::before { content: ""; position: absolute; inset: 10px; border: 2px dashed rgb(107 62 38 / .25); border-radius: calc(var(--radius) - 6px); pointer-events: none; }
.welcome__text { font-size: 1.06em; }
.welcome__text .signoff { margin: 0; font-family: var(--font-script); font-size: 1.9em; line-height: 1.2; color: var(--saddle); text-align: right; }
.welcome__cta { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.welcome__closed { max-width: 60ch; margin: 0 auto; font-style: italic; color: var(--ink-soft); }

.page-head { padding-block: clamp(26px, 6vw, 70px) 8px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.page-title { font-size: clamp(2.1rem, 7vw, 4.2rem); color: var(--saddle); margin-bottom: .3em; text-wrap: balance; }

/* ---------- Featured carousel ---------- */
.featured {
  padding-block: clamp(28px, 5vw, 60px);
  background: var(--tex-wood);
  color: var(--cream);
}
.featured--hero { padding-block: clamp(14px, 2.5vw, 28px); }
.featured__track {
  display: flex; gap: clamp(10px, 1.5vw, 20px);
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding-block: 6px 12px;
  margin-inline: calc(var(--gutter) * -1);
  padding-inline: var(--gutter);
  scroll-padding-inline: var(--gutter);
}
.featured__track::-webkit-scrollbar { display: none; }
.featured__item {
  position: relative; flex: none; scroll-snap-align: start;
  height: clamp(220px, 42vw, 440px);
  border-radius: var(--radius); overflow: hidden;
  border: 0; padding: 0; background: var(--charcoal);
  box-shadow: 0 10px 30px rgb(0 0 0 / .4), 0 0 0 3px rgb(201 162 126 / .5);
}
.featured--hero .featured__item { height: clamp(260px, 55vw, 620px); }
.featured__item img { width: auto; height: 100%; object-fit: cover; }

/* ---------- Gallery ---------- */
.gallery-section { padding-bottom: clamp(36px, 6vw, 80px); }
.gallery-section--page { padding-top: 12px; }
.gallery__toolbar {
  position: sticky; top: calc(60px + var(--safe-top)); z-index: 20;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  margin: 0 calc(var(--gutter) * -1) 14px;
  padding: 8px var(--gutter);
  background: rgb(245 236 221 / .9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: .45em;
  min-height: var(--tap); padding: .3em 1em .3em .5em;
  border-radius: 999px;
  border: 1.5px solid rgb(107 62 38 / .35);
  background: var(--white);
  font-weight: 600; color: var(--saddle);
  transition: background .2s, color .2s, border-color .2s;
}
.chip__rowel {
  width: 26px; height: 26px; flex: none; border-radius: 50%;
  background:
    radial-gradient(circle, currentColor 0 3px, transparent 3.5px),
    conic-gradient(from 0deg, currentColor 0 6deg, transparent 6deg 30deg, currentColor 30deg 36deg, transparent 36deg 60deg, currentColor 60deg 66deg, transparent 66deg 90deg, currentColor 90deg 96deg, transparent 96deg 120deg, currentColor 120deg 126deg, transparent 126deg 150deg, currentColor 150deg 156deg, transparent 156deg 180deg, currentColor 180deg 186deg, transparent 186deg 210deg, currentColor 210deg 216deg, transparent 216deg 240deg, currentColor 240deg 246deg, transparent 246deg 270deg, currentColor 270deg 276deg, transparent 276deg 300deg, currentColor 300deg 306deg, transparent 306deg 330deg, currentColor 330deg 336deg, transparent 336deg);
  -webkit-mask: radial-gradient(circle, #000 0 12px, transparent 12.5px);
  mask: radial-gradient(circle, #000 0 12px, transparent 12.5px);
  opacity: .55;
}
.chip__count { font-size: .82em; padding: .05em .55em; border-radius: 999px; background: rgb(107 62 38 / .1); font-variant-numeric: tabular-nums; }
.chip.is-active { background: var(--tex-leather); color: var(--cream); border-color: transparent; }
.chip.is-active .chip__rowel { opacity: 1; color: var(--gold); }
.chip.is-active .chip__count { background: rgb(245 236 221 / .2); }
.gallery__controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.select { position: relative; display: inline-flex; }
.select select {
  appearance: none; -webkit-appearance: none;
  min-height: var(--tap); padding: .4em 2.2em .4em .9em;
  border-radius: var(--radius-sm); border: 1.5px solid rgb(107 62 38 / .35);
  background: var(--white); font-weight: 600; color: var(--saddle);
  max-width: 60vw;
}
.select::after { content: ""; position: absolute; right: .9em; top: 50%; width: .5em; height: .5em; border-right: 2px solid var(--saddle); border-bottom: 2px solid var(--saddle); transform: translateY(-70%) rotate(45deg); pointer-events: none; }

.grid { position: relative; width: 100%; min-height: 200px; }
/* Hold a screen's worth of room for the first page so the footer doesn't jump. */
.grid[aria-busy="true"]:empty { min-height: 100vh; min-height: 100svh; }
.card {
  position: absolute; left: 0; top: 0;
  overflow: hidden;
  border: 0; padding: 0; margin: 0;
  border-radius: var(--radius-sm);
  background-color: var(--card-color, var(--rawhide));
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow-1);
  cursor: zoom-in;
  transform-style: preserve-3d;
  transition: box-shadow .25s var(--ease-out);
  contain: layout paint;
}
.card__lqip { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(14px) saturate(1.2); transform: scale(1.15); }
.card__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .5s var(--ease-out); }
.card__img.is-loaded { opacity: 1; }
.card__preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card__badge {
  position: absolute; left: 8px; bottom: 8px; z-index: 2;
  display: inline-flex; align-items: center; gap: .35em;
  padding: .2em .6em .2em .35em; border-radius: 999px;
  background: rgb(43 36 32 / .72); color: var(--cream);
  font-size: .8rem; font-weight: 600; font-variant-numeric: tabular-nums;
  backdrop-filter: blur(4px);
}
.card__badge .icon { width: 1.3em; height: 1.3em; }
.card__guest {
  position: absolute; right: 0; left: 0; top: 0; z-index: 2;
  padding: 8px 10px 24px; text-align: right;
  font-size: .78rem; font-weight: 600; color: var(--cream);
  background: linear-gradient(180deg, rgb(43 36 32 / .55), transparent);
  opacity: 0; transition: opacity .25s;
}
.card:hover .card__guest, .card:focus-visible .card__guest { opacity: 1; }
@media (hover: hover) and (pointer: fine) {
  .card:hover { box-shadow: var(--shadow-3); z-index: 3; }
}
.gallery__sentinel { height: 1px; }
.loader { display: flex; justify-content: center; padding: 26px 0 10px; }
.loader.is-done { display: none; }

/* Lasso loader: a spinning rope loop. */
.lasso { position: relative; display: block; width: 64px; height: 64px; }
.lasso__loop {
  position: absolute; inset: 6px 4px 18px;
  border-radius: 50%;
  border: 5px solid transparent;
  background: var(--rope) border-box;
  -webkit-mask: linear-gradient(#000 0 0) padding-box exclude, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) padding-box exclude, linear-gradient(#000 0 0);
  transform: rotateX(62deg);
  animation: lasso-spin 1.1s linear infinite;
}
.lasso__rope { position: absolute; left: 50%; bottom: 0; width: 5px; height: 24px; margin-left: -2px; border-radius: 3px; background: var(--rope); transform-origin: 50% 0; animation: lasso-sway 1.1s ease-in-out infinite; }
@keyframes lasso-spin { to { transform: rotateX(62deg) rotateZ(360deg); } }
@keyframes lasso-sway { 50% { transform: rotate(12deg); } }

/* Empty state */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: clamp(30px, 6vw, 70px) 0; }
.empty__art { position: relative; display: grid; place-items: center; width: 220px; height: 150px; margin-bottom: 10px; }
.empty__fence {
  position: absolute; left: 0; right: 0; bottom: 4px; height: 46px; opacity: .45;
  background:
    linear-gradient(180deg, transparent 0 8px, var(--saddle) 8px 13px, transparent 13px 28px, var(--saddle) 28px 33px, transparent 33px),
    repeating-linear-gradient(90deg, transparent 0 46px, var(--saddle) 46px 54px);
}
.empty__title { font-size: clamp(1.5rem, 4vw, 2.2rem); color: var(--saddle); }
.empty__text { max-width: 46ch; color: var(--ink-soft); }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 90;
  display: grid; grid-template-rows: auto 1fr auto;
  background: #161210;
  color: var(--cream);
  touch-action: none;
  overscroll-behavior: contain;
}
.lightbox__top, .lightbox__bottom {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(8px + var(--safe-top)) var(--gutter) 8px;
  z-index: 2;
}
.lightbox__bottom { padding: 8px var(--gutter) calc(10px + var(--safe-bottom)); }
.lightbox__counter { font-variant-numeric: tabular-nums; font-weight: 600; opacity: .85; }
.lightbox__credit { font-size: .95rem; opacity: .9; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lightbox__credit .script { font-size: 1.6em; color: var(--gold); line-height: 1; }
.lightbox__actions { display: flex; gap: 6px; flex: none; }
.icon-btn {
  display: inline-grid; place-items: center;
  width: var(--tap); height: var(--tap);
  border: 0; border-radius: 50%;
  background: rgb(245 236 221 / .1); color: var(--cream);
  text-decoration: none;
  transition: background .2s, transform .12s;
}
.icon-btn:hover { background: rgb(245 236 221 / .2); color: var(--cream); }
.icon-btn:active { transform: scale(.92); }
.lightbox__stage { position: relative; overflow: hidden; }
.lightbox__slide { position: absolute; inset: 0; display: grid; place-items: center; padding: 0 clamp(0px, 4vw, 80px); will-change: transform; }
.lightbox__slide img, .lightbox__slide video {
  max-width: 100%; max-height: 100%;
  width: auto; height: auto;
  object-fit: contain;
  user-select: none; -webkit-user-drag: none;
  transform-origin: 0 0;
}
.lightbox__slide img { background: var(--lb-color, transparent) center / contain no-repeat; }
.lightbox__slide video { width: 100%; height: 100%; background: #000; }
.lightbox__nav { position: absolute; top: 50%; translate: 0 -50%; z-index: 3; display: none; }
.lightbox__nav--prev { left: var(--gutter); }
.lightbox__nav--next { right: var(--gutter); }
@media (hover: hover) and (pointer: fine) { .lightbox__nav { display: inline-grid; } }

/* ---------- Slideshow ---------- */
.slideshow { position: fixed; inset: 0; z-index: 95; background: #0f0c0a; color: var(--cream); overflow: hidden; cursor: none; }
.slideshow.show-ui { cursor: default; }
.slideshow__frame { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transition: opacity 1.2s ease; }
.slideshow__frame.is-on { opacity: 1; }
.slideshow__bg { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(40px) brightness(.45) saturate(1.2); }
.slideshow__media { position: relative; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.slideshow__frame video.slideshow__media { width: 100%; height: 100%; }
.slideshow__frame.kenburns .slideshow__media { animation: kenburns var(--kb-dur, 8s) ease-in-out forwards; }
@keyframes kenburns {
  from { transform: scale(1.02) translate(var(--kb-x1, 0), var(--kb-y1, 0)); }
  to { transform: scale(1.14) translate(var(--kb-x2, 0), var(--kb-y2, 0)); }
}
.slideshow__ui {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 18px var(--gutter) calc(18px + var(--safe-bottom));
  background: linear-gradient(0deg, rgb(0 0 0 / .65), transparent);
  opacity: 0; transition: opacity .4s;
}
.slideshow.show-ui .slideshow__ui { opacity: 1; }
.slideshow__credit { font-family: var(--font-script); font-size: clamp(1.6rem, 3vw, 2.6rem); color: var(--gold); text-shadow: 0 2px 8px rgb(0 0 0 / .6); }
.slideshow__brand { position: absolute; right: var(--gutter); top: calc(var(--gutter) + var(--safe-top)); width: clamp(40px, 5vw, 80px); color: rgb(245 236 221 / .55); }

/* ---------- Upload page ---------- */
.upload-page { padding-bottom: clamp(30px, 6vw, 80px); }
.uploader, .progress-card, .success-card, .closed-card, .resume-banner {
  margin-inline: var(--gutter);
  border-radius: calc(var(--radius) + 4px);
}
.uploader {
  display: grid; gap: 18px;
  padding: clamp(16px, 3vw, 36px);
  background: var(--white);
  box-shadow: var(--shadow-2);
}
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; color: var(--saddle); }
.optional { font-weight: 400; color: var(--ink-soft); font-size: .9em; }
.field input, .field textarea, .field select {
  width: 100%; min-height: var(--tap);
  padding: .65em .85em;
  border: 1.5px solid rgb(107 62 38 / .3);
  border-radius: var(--radius-sm);
  background: #fffdf8;
  font-size: max(16px, 1em); /* no iOS zoom on focus */
}
.field textarea { resize: vertical; min-height: 96px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--turquoise); box-shadow: 0 0 0 3px rgb(46 156 154 / .22); }
.pickers { display: grid; gap: 12px; }
.picker { cursor: pointer; }
.picker:focus-within { outline: 3px solid var(--turquoise); outline-offset: 3px; }
.dropzone {
  display: none;
  position: relative;
  flex-direction: column; align-items: center; text-align: center;
  padding: clamp(28px, 5vw, 64px) 20px;
  border-radius: var(--radius);
  border: 3px dashed rgb(107 62 38 / .35);
  background:
    radial-gradient(60% 80% at 50% 0%, rgb(224 164 58 / .12), transparent),
    #fffcf5;
  transition: border-color .25s, background-color .25s, transform .25s var(--ease-out);
}
.dropzone.is-over { border-color: var(--turquoise); background-color: #f1faf8; transform: scale(1.01); }
.dropzone__art { width: 96px; height: 96px; margin-bottom: 8px; display: grid; place-items: center; }
.dropzone__shoe {
  width: 82px; height: 82px; color: var(--saddle);
  background: currentColor;
  -webkit-mask: url("/assets/brand/generated/brand-mask.png") center / contain no-repeat;
  mask: url("/assets/brand/generated/brand-mask.png") center / contain no-repeat;
  animation: bob 2.4s ease-in-out infinite;
}
.dropzone.is-over .dropzone__shoe { color: var(--turquoise); animation-duration: .7s; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-4deg); } }
.dropzone__title { font-size: clamp(1.3rem, 2.4vw, 1.9rem); color: var(--saddle); margin-bottom: .2em; }
.dropzone__sub { color: var(--ink-soft); }
.dropzone__buttons { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
/* Desktop gets the drop zone, phones get the two big buttons. */
@media (hover: hover) and (pointer: fine) and (min-width: 820px) {
  .pickers { display: none; }
  .dropzone { display: flex; }
}
.selection__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.selection__summary { margin: 0; font-weight: 600; }
.previews {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(30%, 120px), 1fr)); gap: 8px;
}
@media (min-width: 900px) { .previews { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); } }
.preview {
  position: relative; aspect-ratio: 1; overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--cream-2) center / cover no-repeat;
  box-shadow: var(--shadow-1);
}
.preview img, .preview canvas { width: 100%; height: 100%; object-fit: cover; }
.preview__name { position: absolute; inset: auto 0 0; padding: 18px 6px 5px; font-size: .7rem; color: var(--cream); background: linear-gradient(transparent, rgb(43 36 32 / .75)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview__placeholder { display: grid; place-items: center; height: 100%; color: var(--saddle); font-weight: 700; font-size: .8rem; letter-spacing: .1em; }
.preview__remove {
  position: absolute; top: 4px; right: 4px;
  width: 36px; height: 36px; border-radius: 50%;
  border: 0; display: grid; place-items: center;
  background: rgb(43 36 32 / .72); color: #fff; font-size: 20px; line-height: 1;
}
.preview__remove::before { content: ""; position: absolute; inset: -6px; } /* bigger hit area */
.preview__badge { position: absolute; left: 5px; bottom: 5px; padding: .1em .45em; border-radius: 999px; background: rgb(43 36 32 / .75); color: var(--cream); font-size: .72rem; font-weight: 600; }
.preview.is-invalid { outline: 3px solid var(--clay); }
.preview__warn { position: absolute; inset: 0; display: grid; place-items: center; padding: 8px; background: rgb(181 83 43 / .85); color: #fff; font-size: .75rem; font-weight: 600; text-align: center; }
.form-error { margin: 8px 0 0; color: var(--clay-dark); font-weight: 600; }
.resume-banner { margin-bottom: 14px; padding: 14px 18px; background: #e6f4f3; border: 1.5px solid rgb(46 156 154 / .45); }
.closed-card, .success-card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: clamp(30px, 6vw, 70px) clamp(18px, 4vw, 48px);
  background: var(--white); box-shadow: var(--shadow-2);
}
.closed-card h2, .success-card h2 { color: var(--saddle); font-size: clamp(1.8rem, 5vw, 3rem); }

/* Progress: a horseshoe gallops along a fence rail that fills. */
.progress-card { padding: clamp(18px, 3vw, 36px); background: var(--white); box-shadow: var(--shadow-2); }
.progress-card__title { color: var(--saddle); font-size: clamp(1.4rem, 3.4vw, 2.2rem); text-align: center; }
.trail { position: relative; height: 86px; margin: 10px 0 4px; }
.trail__fence { position: absolute; left: 0; right: 0; bottom: 12px; height: 44px; }
.trail__rail { position: absolute; left: 0; right: 0; height: 7px; border-radius: 4px; background: rgb(107 62 38 / .18); }
.trail__rail--top { top: 6px; }
.trail__rail--bottom { top: 26px; }
.trail__fence::before {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, rgb(107 62 38 / .25) 0 7px, transparent 7px 70px);
  border-radius: 3px;
}
.trail__fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 100%;
  transform: scaleX(var(--p, 0)); transform-origin: left center;
  transition: transform .5s var(--ease-out);
  background:
    linear-gradient(180deg, transparent 0 6px, var(--saddle) 6px 13px, transparent 13px 26px, var(--saddle) 26px 33px, transparent 33px),
    repeating-linear-gradient(90deg, var(--saddle-dark) 0 7px, transparent 7px 70px);
}
.trail__rider {
  position: absolute; left: 0; bottom: 50px; width: 46px; height: 46px; margin-left: -23px;
  transform: translateX(calc(var(--p, 0) * var(--trail-w, 300px)));
  transition: transform .5s var(--ease-out);
}
.trail__shoe {
  position: absolute; inset: 0; width: 100%; height: 100%;
  filter: drop-shadow(0 3px 2px rgb(43 36 32 / .3));
  animation: gallop .42s ease-in-out infinite;
  transform-origin: 50% 90%;
}
.trail__dust {
  position: absolute; left: -16px; bottom: -4px; width: 22px; height: 10px; border-radius: 50%;
  background: radial-gradient(circle, rgb(201 162 126 / .7), transparent 70%);
  animation: puff .42s ease-out infinite;
}
.progress-card.is-paused .trail__shoe, .progress-card.is-paused .trail__dust, .progress-card.is-done .trail__shoe, .progress-card.is-done .trail__dust { animation-play-state: paused; }
@keyframes gallop { 0%, 100% { transform: translateY(0) rotate(-8deg); } 50% { transform: translateY(-12px) rotate(10deg); } }
@keyframes puff { from { opacity: .9; transform: scale(.6); } to { opacity: 0; transform: translate(-14px, -4px) scale(1.5); } }
.progress-card__stats { display: flex; justify-content: space-between; gap: 10px; font-weight: 600; font-variant-numeric: tabular-nums; }
[data-progress-percent] { font-family: var(--font-display); font-size: 1.6rem; color: var(--clay); }
.progress-native { height: 0; overflow: hidden; }
.file-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; max-height: 50vh; overflow: auto; }
.file-row { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 10px; padding: 6px; border-radius: var(--radius-sm); background: var(--cream); }
.file-row__thumb { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; background: var(--cream-2); }
.file-row__name { font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-row__bar { height: 6px; border-radius: 3px; background: rgb(107 62 38 / .15); overflow: hidden; margin-top: 4px; }
.file-row__bar span { display: block; height: 100%; width: 100%; transform: scaleX(var(--p, 0)); transform-origin: left; background: var(--turquoise); transition: transform .3s; }
.file-row__state { font-size: .82rem; font-weight: 700; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.file-row.is-done .file-row__state { color: var(--turquoise-dark); }
.file-row.is-error { background: #f8e3da; }
.file-row.is-error .file-row__state { color: var(--clay-dark); }
.progress-card__actions { display: flex; justify-content: center; margin-top: 10px; }

.confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.success-card__title { font-size: clamp(3rem, 12vw, 6.5rem) !important; color: var(--clay) !important; margin-bottom: .1em; }
.success-card__text { max-width: 48ch; font-size: 1.1em; }
.success-card__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; position: relative; }

.mine { padding-top: 10px; }
.mine__grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(46%, 170px), 1fr)); gap: 10px; }
.mine__item { position: relative; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; background: var(--rawhide) center / cover; box-shadow: var(--shadow-1); }
.mine__item img { width: 100%; height: 100%; object-fit: cover; }
.mine__status { position: absolute; left: 6px; right: 6px; bottom: 6px; padding: .3em .55em; border-radius: 8px; font-size: .74rem; font-weight: 700; line-height: 1.25; background: rgb(43 36 32 / .78); color: var(--cream); }
.mine__status.is-approved { background: rgb(35 122 120 / .9); }

/* ---------- Footer ---------- */
.footer { padding: 0 var(--gutter) calc(30px + var(--safe-bottom)); background: transparent; }
.footer__inner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 10px 0; }
.footer__names { font-size: 2.6rem; line-height: 1.1; color: var(--saddle); margin: 6px 0 0; }
.footer__date { color: var(--ink-soft); font-size: .92em; }
.footer__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; }
.footer__links a { display: inline-flex; align-items: center; min-height: var(--tap); font-weight: 600; }
.footer__fine { font-size: .8em; color: var(--ink-soft); margin-top: 8px; }
.calm-toggle { display: inline-flex; align-items: center; gap: 10px; min-height: var(--tap); padding: 0 8px; border: 0; background: none; font-weight: 600; color: var(--saddle); }
.calm-toggle__hint { font-weight: 400; color: var(--ink-soft); }
.calm-toggle__track { position: relative; width: 44px; height: 26px; border-radius: 13px; background: rgb(107 62 38 / .25); transition: background .2s; }
.calm-toggle__thumb { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-1); transition: transform .2s var(--ease-out); }
.calm-toggle[aria-pressed="true"] .calm-toggle__track { background: var(--turquoise); }
.calm-toggle[aria-pressed="true"] .calm-toggle__thumb { transform: translateX(18px); }

/* ---------- 404 / error ---------- */
.lost { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding-block: 40px; position: relative; overflow: hidden; }
.lost__scene { position: relative; width: 100%; height: 170px; margin-bottom: 12px; }
.lost__sign {
  position: absolute; left: 50%; top: 10px; translate: -50% 0; rotate: -6deg;
  display: flex; gap: 10px; align-items: center;
  padding: 10px 22px; border-radius: 6px;
  background: var(--tex-wood); color: var(--cream);
  font-family: var(--font-display); font-size: 1.3rem; letter-spacing: .08em;
  box-shadow: var(--shadow-2);
}
.lost__post { position: absolute; left: 50%; top: 52px; width: 12px; height: 110px; margin-left: -6px; background: var(--saddle-dark); border-radius: 3px; z-index: -1; }
.lost__title { font-size: clamp(1.8rem, 5.5vw, 3.4rem); color: var(--saddle); max-width: 22ch; text-wrap: balance; }
.lost__text { color: var(--ink-soft); }
.lost__actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.tumbleweed-lane--always { bottom: 0; }

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .15s !important; scroll-behavior: auto !important; }
  .hero__dust, .tumbleweed-lane, .trail__dust { display: none !important; }
  .slideshow__frame.kenburns .slideshow__media { animation: none !important; }
}
html.calm *, html.calm *::before, html.calm *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
html.calm .hero__dust, html.calm .tumbleweed-lane, html.calm .trail__dust { display: none !important; }
html.calm .slideshow__frame.kenburns .slideshow__media { animation: none !important; }

/* Small phones: keep the three filter chips on one line. */
@media (max-width: 600px) {
  .chips { flex-wrap: nowrap; gap: 6px; }
  .chip { min-height: 44px; padding: .2em .7em .2em .35em; gap: .35em; font-size: .92rem; }
  .chip__rowel { width: 20px; height: 20px; -webkit-mask: radial-gradient(circle, #000 0 9.5px, transparent 10px); mask: radial-gradient(circle, #000 0 9.5px, transparent 10px); }
  .gallery__controls { width: 100%; }
  .gallery__controls .select { flex: 1; min-width: 0; }
  .gallery__controls .select select { width: 100%; max-width: none; padding-left: .7em; padding-right: 2em; text-overflow: ellipsis; }
  /* Icon-only so both dropdowns have room to show their text. */
  .gallery__controls [data-slideshow] { flex: none; width: var(--tap); padding: 0; justify-content: center; }
  .gallery__controls [data-slideshow] span { display: none; }
}
