/* greygoose.baby — Apple Invites layout (huge full-bleed invite, blurred-photo ambient hero,
   frosted glass sheets) dressed in Grey Goose colours: icy blue, glacier white, brushed silver,
   deep navy ink. Playful, not a nightclub. Phone first, /events and /gallery reuse every token
   below. Everything under "theme" flips for prefers-color-scheme: dark ("night mode"). */

:root {
  /* type */
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter Tight", "Helvetica Neue", sans-serif;
  --serif: "Instrument Serif", ui-serif, Georgia, serif; /* the French-luxe accent, used in italics */
  --mono: ui-monospace, "SF Mono", Menlo, monospace;

  /* motion */
  --ease: cubic-bezier(.16, 1, .3, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1); /* the "springy" press/hover feel */

  /* radius scale — every sheet in the app uses one of these */
  --r-pill: 999px;
  --r-xl: 30px;   /* sheet dialog, pretend-checkout paper, about blurb */
  --r-lg: 28px;   /* the hero invite card */
  --r-md: 26px;   /* pass, cards */
  --r-sm: 22px;   /* trow, past-card */
  --r-xs: 18px;   /* strip items, stepper */
  --r-2xs: 16px;  /* fields, gallery tiles, pass photo */

  /* shadow scale */
  --shadow-card: 0 30px 70px -30px rgba(16, 29, 51, .35), inset 0 0 0 1px rgba(255, 255, 255, .5);
  --shadow-pop: 0 20px 50px -14px rgba(16, 29, 51, .45);
  --shadow-soft: 0 14px 30px -14px rgba(16, 29, 51, .3);
  --shadow-press: 0 6px 14px -8px rgba(16, 29, 51, .35);
}

/* ---------- colour themes ----------
   Four blue themes, picked with `?theme=`/a cookie/env THEME (see app/ui.php) and set as
   [data-theme] on <html>. Each theme sets the same "brand constant" tokens (same value in day
   and night) plus a light "day" set and a `prefers-color-scheme: dark` "night" set of semantic
   tokens, exactly like the single theme this replaces. Every pair used for text-on-fill (page vs
   page-fg, navy vs glacier for buttons) is checked for WCAG AA (4.5:1). */

:root, [data-theme="glacier"] {
  /* glacier — pale icy blue + white + silver, Grey Goose bottle-like */
  --goose: #1d5fc9;
  --ice: #d9ecf8;
  --ice-deep: #a7cdea;
  --peach: #ffc9a6;
  --glacier: #f8fbfd;
  --silver-1: #eef2f6;
  --silver-2: #d7dfe6;
  --navy: #101d33;
  --navy-2: #1a2c4a;
  --silver-sheen: linear-gradient(135deg, var(--silver-1) 0%, #ffffff 42%, var(--ice) 130%);

  --page: var(--glacier);
  --page-fg: var(--navy);
  --dim: rgba(16, 29, 51, .58);
  --line: rgba(16, 29, 51, .12);
  --glass: rgba(255, 255, 255, .6);
  --glass-line: rgba(255, 255, 255, .7);
  --glass-strong: rgba(255, 255, 255, .82);
  --coal: var(--silver-2); /* neutral placeholder for photos still loading */
  --on-ambient: rgba(255, 255, 255, .96);   /* text sitting directly on the blurred cover photo */
  --on-ambient-dim: rgba(255, 255, 255, .76);
  --ambient-filter: blur(90px) saturate(1.5) brightness(.62);
  --theme-color: #f8fbfd;
  --cta: #1d5fc9;       /* the loud "i'm in" pill + its ink, 6:1 */
  --cta-ink: #ffffff;
  --solid: var(--navy);      /* filled buttons, active tabs/chips; flips light at night */
  --solid-ink: var(--glacier);
  --solid-hover: var(--navy-2);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]), [data-theme="glacier"] {
    --page: var(--navy);
    --page-fg: var(--glacier);
    --dim: rgba(248, 251, 253, .6);
    --line: rgba(248, 251, 253, .14);
    --glass: rgba(26, 44, 74, .55);
    --glass-line: rgba(248, 251, 253, .14);
    --glass-strong: rgba(26, 44, 74, .8);
    --coal: var(--navy-2);
    --ambient-filter: blur(90px) saturate(1.6) brightness(.5);
    --theme-color: #101d33;
    --cta: #8ec5ff;
    --cta-ink: #101d33;
    --solid: var(--glacier);
    --solid-ink: var(--navy);
    --solid-hover: var(--silver-1);
  }
}

[data-theme="cobalt"] {
  /* cobalt — saturated electric/klein blue with white, bold and playful */
  --goose: #1533d1;
  --ice: #8fa0ff;
  --ice-deep: #3348d6;
  --peach: #ffca3a;
  --glacier: #ffffff;
  --silver-1: #eef1ff;
  --silver-2: #d7defb;
  --navy: #0a1442;
  --navy-2: #14205e;
  --silver-sheen: linear-gradient(135deg, var(--silver-1) 0%, #ffffff 42%, var(--ice) 130%);

  --page: #f7f9ff;
  --page-fg: var(--navy);
  --dim: rgba(10, 20, 66, .6);
  --line: rgba(10, 20, 66, .12);
  --glass: rgba(255, 255, 255, .6);
  --glass-line: rgba(255, 255, 255, .7);
  --glass-strong: rgba(255, 255, 255, .85);
  --coal: var(--silver-2);
  --on-ambient: rgba(255, 255, 255, .96);
  --on-ambient-dim: rgba(255, 255, 255, .78);
  --ambient-filter: blur(90px) saturate(1.7) brightness(.6);
  --theme-color: #f7f9ff;
  --cta: #ffca3a;
  --cta-ink: #0a1442;
}
@media (prefers-color-scheme: dark) {
  [data-theme="cobalt"] {
    --page: var(--navy);
    --page-fg: var(--glacier);
    --dim: rgba(255, 255, 255, .6);
    --line: rgba(255, 255, 255, .14);
    --glass: rgba(20, 32, 94, .55);
    --glass-line: rgba(255, 255, 255, .14);
    --glass-strong: rgba(20, 32, 94, .82);
    --coal: var(--navy-2);
    --ambient-filter: blur(90px) saturate(1.8) brightness(.5);
    --theme-color: #0a1442;
    --cta: #ffca3a;
    --cta-ink: #0a1442;
    --solid: var(--glacier);
    --solid-ink: var(--navy);
    --solid-hover: var(--silver-1);
  }
}

[data-theme="midnight"] {
  /* midnight — deep navy night mode with neon sky-blue accents. Always dark: no OS-dark override. */
  --goose: #4dd9ff;
  --ice: #dff4ff;
  --ice-deep: #9fd9f2;
  --peach: #ffb84d;
  --glacier: #eef8ff;
  --silver-1: #eef2f8;
  --silver-2: #d7dfe9;
  --navy: #060b1f;
  --navy-2: #0c1836;
  --silver-sheen: linear-gradient(135deg, var(--silver-1) 0%, #ffffff 42%, var(--ice) 130%);

  --page: #0a1128;
  --page-fg: var(--glacier);
  --dim: rgba(238, 248, 255, .62);
  --line: rgba(238, 248, 255, .14);
  --glass: rgba(12, 24, 54, .55);
  --glass-line: rgba(238, 248, 255, .14);
  --glass-strong: rgba(12, 24, 54, .82);
  --coal: var(--navy-2);
  --on-ambient: rgba(255, 255, 255, .96);
  --on-ambient-dim: rgba(255, 255, 255, .78);
  --ambient-filter: blur(90px) saturate(1.6) brightness(.48);
  --theme-color: #0a1128;
  --cta: #4dd9ff;
  --cta-ink: #060b1f;
  --solid: var(--glacier);
  --solid-ink: var(--navy);
  --solid-hover: var(--silver-1);
}

[data-theme="periwinkle"] {
  /* periwinkle — soft lavender-blue with a warm cream, dreamy Apple Invites-ish */
  --goose: #5a5fd0;
  --ice: #cfd3f5;
  --ice-deep: #a6acec;
  --peach: #f3d9b1;
  --glacier: #fff8ef;
  --silver-1: #f4efe6;
  --silver-2: #e4dcca;
  --navy: #332b66;
  --navy-2: #241d4d;
  --silver-sheen: linear-gradient(135deg, var(--silver-1) 0%, #ffffff 42%, var(--ice) 130%);

  --page: var(--glacier);
  --page-fg: var(--navy);
  --dim: rgba(51, 43, 102, .7);
  --line: rgba(51, 43, 102, .12);
  --glass: rgba(255, 255, 255, .6);
  --glass-line: rgba(255, 255, 255, .72);
  --glass-strong: rgba(255, 255, 255, .86);
  --coal: var(--silver-2);
  --on-ambient: rgba(255, 255, 255, .96);
  --on-ambient-dim: rgba(255, 255, 255, .8);
  --ambient-filter: blur(90px) saturate(1.4) brightness(.64);
  --theme-color: #fff8ef;
  --cta: #5a5fd0;
  --cta-ink: #ffffff;
}
@media (prefers-color-scheme: dark) {
  [data-theme="periwinkle"] {
    --page: var(--navy);
    --page-fg: var(--glacier);
    --dim: rgba(255, 248, 239, .65);
    --line: rgba(255, 248, 239, .14);
    --glass: rgba(36, 29, 77, .55);
    --glass-line: rgba(255, 248, 239, .14);
    --glass-strong: rgba(36, 29, 77, .82);
    --coal: var(--navy-2);
    --ambient-filter: blur(90px) saturate(1.5) brightness(.5);
    --theme-color: #332b66;
    --cta: #f3d9b1;
    --cta-ink: #241d4d;
    --solid: var(--glacier);
    --solid-ink: var(--navy);
    --solid-hover: var(--silver-1);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--page); color-scheme: light dark; -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100svh; background: var(--page); color: var(--page-fg); font: 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; overflow-x: clip; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }
::selection { background: var(--ice); color: var(--navy); }
.i { width: 22px; height: 22px; flex-shrink: 0; }
.mono { font-family: var(--mono); letter-spacing: .06em; }
.dim { color: var(--dim); }
.center { text-align: center; justify-content: center; }

/* faint grain, just enough to feel like a photo print, not a moody club floor */
body::after {
  content: ""; position: fixed; inset: -50%; z-index: 200; pointer-events: none; opacity: .025; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Apple Invites: the page opens on a big, softly blurred wash of the next cover photo,
   which fades into the icy/navy page below it. It scrolls away with the hero (a fixed one sat
   behind everything, so dark type that scrolled up into it vanished). */
/* the body paints its own background over a z-index:-1 child, so ambient pages hand the fill to <html> */
body.on-ambient { background: transparent; }
/* the outer box clips the overhang sideways, otherwise the page scrolls horizontally on phones */
.ambient { position: absolute; top: -12%; left: 0; right: 0; height: 124%; z-index: -1; overflow: hidden; pointer-events: none; }
.ambient > div {
  position: absolute; inset: 0 -12%; background: center / cover no-repeat;
  filter: var(--ambient-filter); transform: scale(1.1);
}
.ambient > div::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(16, 29, 51, .1), rgba(16, 29, 51, .55) 46%, var(--page) 78%); }

/* ---------- Grey Goose details ---------- */
.caps { font-size: .68rem; font-weight: 500; letter-spacing: .3em; text-transform: uppercase; }
.rule { display: inline-block; width: 34px; height: 1px; background: currentColor; transform: skewY(-18deg); vertical-align: middle; margin-right: 12px; opacity: .7; }
.gg-lines {
  background-image: repeating-linear-gradient(62deg, rgba(16, 29, 51, .07) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(-62deg, rgba(16, 29, 51, .05) 0 1px, transparent 1px 22px);
}
.gg-blue { background: var(--silver-sheen); color: var(--navy); }
/* surfaces that stay light at night keep navy fills */
.gg-blue, .paper, .pass { --solid: var(--navy); --solid-ink: var(--glacier); --solid-hover: var(--navy-2); }

.wordmark { display: inline-flex; align-items: baseline; font-weight: 600; letter-spacing: -.04em; font-size: 21px; line-height: 1; }
.wordmark .slash { display: inline-block; width: .09em; height: .95em; margin: 0 .13em; background: var(--goose); transform: translateY(.14em) skewX(-28deg); border-radius: 1px; }
.wordmark small {
  display: inline-block; margin-left: .35em; padding: .18em .5em .12em; border-radius: var(--r-pill);
  background: var(--ice); color: var(--navy); font: 700 italic .46em/1.3 var(--serif); letter-spacing: 0;
  transform: rotate(-7deg); transition: transform .3s var(--spring);
}
a.wordmark:hover small, .wordmark:has(:hover) small { transform: rotate(0deg) scale(1.06); }
.wordmark.small { font-size: 17px; }

/* ---------- glass ---------- */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid var(--glass-line);
}

/* ---------- shell ---------- */
.wrap { max-width: 1120px; margin: 0 auto; padding: 84px 18px 40px; }
.wrap.narrow { max-width: 520px; }
.topbar {
  /* --bar-over: glass that carries on above the viewport, so ios can't reveal the page above the bar mid-scroll */
  --bar-h: 48px; --bar-over: 28px;
  position: fixed; top: calc(var(--bar-over) * -1); left: 0; right: 0; z-index: 50;
  height: calc(var(--bar-h) + var(--bar-over) + env(safe-area-inset-top));
  padding: calc(var(--bar-over) + env(safe-area-inset-top)) 18px 0;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--glass-strong); -webkit-backdrop-filter: blur(22px) saturate(160%); backdrop-filter: blur(22px) saturate(160%);
  border-bottom: 1px solid var(--glass-line);
}
.topnav { display: none; gap: 30px; font-size: 15px; }
.topnav a { color: var(--dim); transition: color .2s; }
.topnav a:hover, .topnav a.on { color: var(--page-fg); }

.tabbar {
  position: fixed; left: 50%; bottom: max(env(safe-area-inset-bottom), 14px); z-index: 60; transform: translateX(-50%);
  display: flex; gap: 4px; padding: 6px; border-radius: var(--r-pill);
  background: var(--glass-strong); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-line); box-shadow: var(--shadow-pop);
}
.tabbar a { display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 18px; border-radius: var(--r-pill); color: var(--dim); font-size: 14px; font-weight: 500; transition: background .4s var(--spring), color .3s; }
.tabbar a span { display: none; }
.tabbar a.on { background: var(--solid); color: var(--solid-ink); }
.tabbar a.on span { display: inline; }

.foot { max-width: 1120px; margin: 40px auto 0; padding: 30px 18px 130px; text-align: center; color: var(--dim); font-size: 14px; border-top: 1px solid var(--line); }
.foot-mark { font-weight: 600; letter-spacing: -.05em; line-height: 1; font-size: 22vw; color: transparent; -webkit-text-stroke: 1px rgba(43, 63, 214, .22); user-select: none; }
.foot p { margin-top: 14px; }
.foot a { color: var(--page-fg); }

.toast {
  position: fixed; top: calc(70px + env(safe-area-inset-top)); left: 50%; z-index: 90; transform: translateX(-50%);
  max-width: calc(100% - 36px); padding: 12px 20px; border-radius: var(--r-pill); background: var(--glacier); color: var(--navy); font-weight: 500; font-size: 15px;
  box-shadow: var(--shadow-pop); animation: drop .6s var(--spring) both, fade .4s 4s forwards;
}
@keyframes drop { from { opacity: 0; transform: translate(-50%, -16px); } }
@keyframes fade { to { opacity: 0; visibility: hidden; } }

/* ---------- type ---------- */
/* white type is only readable over the blurred cover photo; plain pages use the page ink (body.on-ambient) */
.hello { padding: 18px 0 26px; color: var(--page-fg); }
.hello .dim, .lede { color: var(--dim); }
.hello-title { margin-top: 14px; font-size: clamp(56px, 17vw, 120px); font-weight: 600; letter-spacing: -.055em; line-height: .9; }
.hello-title em, .section-title em { font: italic 400 1.02em var(--serif); letter-spacing: -.02em; color: var(--goose); }
.lede { margin-top: 16px; max-width: 30em; font-size: 17px; }
.on-ambient .hello { color: var(--on-ambient); }
.on-ambient .hello .dim, .on-ambient .hello .lede { color: var(--on-ambient-dim); }
.on-ambient .hello-title { text-shadow: 0 2px 30px rgba(16, 29, 51, .3); }
.on-ambient .hello-title em { color: var(--ice); }
/* headings that still sit on the dark wash right under the hero */
.on-ambient .strip-wrap .section-title.small, .on-ambient .strip-wrap .link, .on-ambient .hello + .ev-sec > .section-title { color: var(--on-ambient); }
.hello.center .lede { margin-inline: auto; }
.section-title { font-size: 30px; font-weight: 600; letter-spacing: -.04em; line-height: 1.05; }
.section-title.small { margin: 40px 0 14px; font-size: 13px; font-weight: 500; letter-spacing: .3em; text-transform: uppercase; color: var(--dim); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.link { color: var(--dim); font-size: 14px; white-space: nowrap; }
.link:hover { color: var(--page-fg); }
.link.center { display: block; margin-top: 14px; text-align: center; }

/* ---------- buttons + fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 52px; padding: 0 24px; border-radius: var(--r-pill);
  font-weight: 600; font-size: 16px; letter-spacing: -.01em; white-space: nowrap; transition: transform .3s var(--spring), background .2s, opacity .2s, box-shadow .2s;
}
.btn:active, .round:active { transform: scale(.94); }
.btn.primary { background: var(--solid); color: var(--solid-ink); box-shadow: var(--shadow-soft); }
.btn.primary:hover { background: var(--solid-hover); transform: translateY(-1px); }
.btn.dark { background: var(--solid); color: var(--solid-ink); width: 100%; }
.btn.big { height: 58px; width: 100%; font-size: 17px; }
.btn.grow { flex: 1; }
.btn[aria-disabled] { opacity: .6; cursor: default; }
.btn.file { position: relative; overflow: hidden; flex-shrink: 0; }
.btn.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.btn.file.has { background: var(--ice); color: var(--navy); }
.round { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0; transition: transform .3s var(--spring), background .2s; }
.round.glass:hover { background: var(--glass-strong); }
.field {
  width: 100%; height: 54px; padding: 0 18px; border-radius: var(--r-2xs); font-size: 16px;
  background: var(--glass); border: 1px solid var(--line); color: var(--page-fg); transition: border-color .2s, background .2s;
}
textarea.field { height: auto; min-height: 120px; padding: 14px 18px; line-height: 1.5; resize: vertical; }
.field:focus { outline: none; border-color: var(--goose); background: var(--glass-strong); }
.field::placeholder { color: var(--dim); }
.chip { display: inline-flex; align-items: center; height: 30px; padding: 0 13px; border-radius: var(--r-pill); font-size: 12px; font-weight: 600; letter-spacing: .02em; white-space: nowrap; }
.chip.dark { background: var(--solid); color: var(--solid-ink); }

/* ---------- segmented control (Invites' upcoming / past) ---------- */
.seg { display: inline-flex; padding: 4px; margin-bottom: 22px; border-radius: var(--r-pill); background: var(--glass-strong); border: 1px solid var(--line); box-shadow: var(--shadow-soft); }
.seg button { height: 40px; padding: 0 18px; border-radius: var(--r-pill); color: var(--dim); font-size: 15px; font-weight: 500; transition: background .4s var(--spring), color .2s; }
.seg button b { margin-left: 4px; font-weight: 500; opacity: .6; }
.seg button[aria-selected="true"] { background: var(--solid); color: var(--solid-ink); }
.js [data-pane][hidden] { display: none; }
.js .only-nojs { display: none; }
html:not(.js) .seg { display: none; }
html:not(.js) #past { margin-top: 50px; }
.only-nojs { margin-bottom: 16px; }

/* ---------- the invite card ---------- */
.invites { display: grid; gap: 18px; }
.invite {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden;
  aspect-ratio: 4 / 5; border-radius: var(--r-lg); background: var(--coal); isolation: isolate;
  box-shadow: var(--shadow-card);
  transition: transform .5s var(--spring);
}
a.invite:hover { transform: translateY(-4px) rotate(-.3deg); }
a.invite:active { transform: scale(.985); }
.invite.big { aspect-ratio: 3 / 4; }
.invite-photo { position: absolute; inset: 0; z-index: -1; }
.invite-photo img, .invite-photo .nocover { width: 100%; height: 100%; object-fit: cover; transition: transform 1.4s var(--ease); }
a.invite:hover .invite-photo img { transform: scale(1.04); }
.invite-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(16, 29, 51, .3) 0%, transparent 22%, transparent 42%, rgba(16, 29, 51, .78) 82%, rgba(16, 29, 51, .92)); }
.nocover { background: linear-gradient(135deg, var(--goose), var(--navy-2)); }
.invite-top { position: absolute; top: 16px; left: 16px; right: 16px; display: flex; align-items: center; justify-content: space-between; }
.invite-top .chip { background: var(--bg); color: var(--fg); }
.invite-no { font: 500 12px var(--mono); color: rgba(255, 255, 255, .85); }
.invite-body { padding: 22px 22px 24px; color: #fff; text-shadow: 0 1px 20px rgba(16, 29, 51, .4); }
.invite-body .caps { color: rgba(255, 255, 255, .76); font-size: .62rem; }
.invite-title { margin-top: 8px; font: italic 400 clamp(46px, 13vw, 64px)/.92 var(--serif); letter-spacing: -.02em; }
.invite.big .invite-title { font-size: clamp(56px, 16vw, 84px); }
.invite-when { margin-top: 10px; font-weight: 500; font-size: 16px; }
.invite-guests { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.invite.past .invite-photo img { filter: saturate(.75); }

.avatars { display: inline-flex; }
.av {
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; margin-left: -8px; border-radius: 50%;
  font-size: 12px; font-weight: 700; color: #fff; text-shadow: none;
  background: linear-gradient(140deg, hsl(var(--h) 55% 62%), hsl(calc(var(--h) + 40) 55% 42%)); box-shadow: 0 0 0 2px var(--page);
}
.av:first-child { margin-left: 0; }
.av-count { font-size: 14px; font-weight: 500; color: rgba(255, 255, 255, .9); }

/* ---------- past parties ---------- */
.past-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.past-card { position: relative; aspect-ratio: 3 / 4; overflow: hidden; border-radius: var(--r-sm); background: var(--coal); box-shadow: var(--shadow-soft); transition: transform .4s var(--spring); }
.past-card:hover { transform: translateY(-3px); }
.past-card img, .past-card .nocover { width: 100%; height: 100%; object-fit: cover; filter: saturate(.75); transition: filter .6s, transform 1.2s var(--ease); }
.past-card:hover img { filter: none; transform: scale(1.04); }
.past-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 45%, rgba(16, 29, 51, .88)); }
.past-no { position: absolute; top: 12px; left: 14px; z-index: 1; font: 12px var(--mono); color: rgba(255, 255, 255, .85); }
.past-info { position: absolute; left: 14px; right: 14px; bottom: 14px; z-index: 1; display: grid; }
.past-info b { font: italic 400 30px/1 var(--serif); color: #fff; }
.past-info small { margin-top: 6px; font-size: 12px; color: rgba(255, 255, 255, .75); }

/* ---------- camera roll strip: slightly tilted polaroid tiles ---------- */
.strip-wrap { margin-top: 56px; }
.strip { display: flex; gap: 14px; margin: 0 -18px; padding: 14px 22px 20px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.strip-item {
  flex: 0 0 38%; aspect-ratio: 3 / 4; overflow: hidden; border-radius: var(--r-xs); scroll-snap-align: start;
  background: var(--glacier); padding: 8px 8px 22px; box-shadow: var(--shadow-soft);
  transform: rotate(var(--tilt, -3deg)); transition: transform .35s var(--spring), box-shadow .35s;
}
.strip-item:nth-child(3n+2) { flex-basis: 56%; aspect-ratio: 4 / 4.2; --tilt: 2deg; }
.strip-item:nth-child(3n+3) { --tilt: 3deg; }
.strip-item:hover { transform: rotate(0deg) translateY(-4px); box-shadow: var(--shadow-pop); }
.strip-item img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }

.about { margin-top: 30px; padding: 30px 24px; border-radius: var(--r-xl); box-shadow: var(--shadow-soft); }
.about p { margin-top: 14px; font-size: 22px; line-height: 1.3; font-weight: 400; letter-spacing: -.02em; }
.about a { text-decoration: underline; text-underline-offset: 4px; }

.empty { padding: 28px; border-radius: var(--r-sm); color: var(--dim); text-align: center; }
.empty a { color: var(--page-fg); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- party page ---------- */
.party { position: relative; padding-top: 72px; }
.back { position: absolute; top: 84px; left: 30px; z-index: 5; width: 44px; height: 44px; }
.party .invite { animation: rise 1s var(--ease) both; }
.party .invite-top { left: 70px; }
.tagline { margin-top: 18px; text-align: center; font: italic 400 24px/1.2 var(--serif); color: var(--dim); }
.actions { display: flex; gap: 10px; margin-top: 12px; }
.actions.center { justify-content: center; flex-wrap: wrap; }

/* the "i'm in" pill (im_in_button() in app/ui.php): the loudest thing on the page, in the theme's --cta */
.im-in-wrap { margin-top: 16px; text-align: center; }
.im-in {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 52px; padding: 0 24px;
  border-radius: var(--r-pill); background: var(--cta); color: var(--cta-ink);
  font-size: 18px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap;
  box-shadow: 0 6px 18px -10px color-mix(in srgb, var(--cta) 60%, transparent);
  transition: transform .35s var(--spring), box-shadow .25s;
}
.im-in:hover { transform: translateY(-1px); }
.im-in:active { transform: scale(.97); box-shadow: var(--shadow-press); }
.im-in-glyph { font-size: 1.05em; line-height: 1; }
.im-in-price { font-size: 13px; font-weight: 600; opacity: .72; letter-spacing: 0; }
.im-in-price::before { content: "·"; margin-right: 10px; }
.im-in[disabled] { background: var(--glass-strong); color: var(--dim); box-shadow: none; cursor: default; animation: none; transform: none; }
.im-in-proof { margin-top: 8px; font-size: 13px; font-weight: 500; color: var(--dim); }
.im-in-wrap.is-card .im-in { height: 46px; font-size: 16px; }
.im-in-wrap.is-card { margin-top: 10px; }
/* upcoming invite + its pill, kept together in the .invites grid */
.invite-slot { display: grid; align-content: start; }
/* the docked copy on phones: sticks above the tab bar, hidden while the hero pill is on screen */
.im-in-dock { position: sticky; z-index: 40; bottom: calc(80px + env(safe-area-inset-bottom)); margin-top: 22px; transition: opacity .25s, transform .35s var(--ease); }
.im-in-dock .im-in-proof { display: inline-block; padding: 2px 10px; border-radius: var(--r-pill); background: var(--glass-strong); }
.im-in-dock.away { opacity: 0; transform: translateY(16px); pointer-events: none; }
.card { margin-top: 14px; padding: 20px; border-radius: var(--r-md); }
.note p { margin-top: 12px; font-size: 17px; line-height: 1.55; color: var(--page-fg); }
.sig { margin-top: 16px; font: italic 20px var(--serif); color: var(--goose); }
.details { display: grid; gap: 18px; }
.drow { display: flex; gap: 14px; align-items: flex-start; }
.drow .i { margin-top: 1px; color: var(--goose); }
.drow b { display: block; font-weight: 600; }
.drow small { display: block; font-size: 14px; color: var(--dim); }
.drow small:empty { display: none; }
.names { font-size: 15px; color: var(--dim); }
.album-sec { margin-top: 30px; }
.album-sec > .caps { margin-bottom: 14px; }
.addpics { display: grid; gap: 10px; }
.addpics small { color: var(--dim); margin-top: -6px; }
.addpics .row { display: flex; gap: 8px; }

/* ---------- gallery + viewer ---------- */
.gallery { columns: 2; column-gap: 8px; }
.gal-item { display: block; margin-bottom: 8px; overflow: hidden; border-radius: var(--r-2xs); background: var(--coal); break-inside: avoid; box-shadow: var(--shadow-soft); transition: transform .3s var(--spring); }
.gal-item:hover { transform: translateY(-2px); }
.gal-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.gal-item:hover img { transform: scale(1.04); }
.viewer { position: fixed; inset: 0; z-index: 150; display: flex; flex-direction: column; background: rgba(16, 29, 51, .96); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); animation: fadein .3s; }
@keyframes fadein { from { opacity: 0; } }
.viewer-top { display: flex; justify-content: space-between; align-items: center; padding: max(env(safe-area-inset-top), 14px) 16px 10px; color: #fff; }
.viewer-top .dim { color: rgba(255, 255, 255, .7); }
.viewer-track { flex: 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.viewer-track::-webkit-scrollbar { display: none; }
.viewer-slide { flex: 0 0 100%; display: flex; align-items: center; justify-content: center; padding: 0 10px; scroll-snap-align: center; }
.viewer-slide img { max-height: 100%; max-width: 100%; object-fit: contain; border-radius: var(--r-2xs); }
.viewer-cap { padding: 14px 20px max(env(safe-area-inset-bottom), 22px); text-align: center; min-height: 80px; color: #fff; }
.viewer-cap small { display: block; margin-top: 4px; color: rgba(255, 255, 255, .6); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; }

/* ---------- join sheet ---------- */
.sheet { margin: auto auto 0; padding: 0; width: 100%; max-width: 520px; max-height: 92svh; border: 0; border-radius: var(--r-xl) var(--r-xl) 0 0; background: var(--glass-strong); -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%); color: var(--page-fg); box-shadow: 0 -20px 60px rgba(16, 29, 51, .3); }
.sheet[open] { animation: up .5s var(--spring); }
.sheet::backdrop { background: rgba(16, 29, 51, .45); }
@keyframes up { from { transform: translateY(100%); } }
.sheet-body { display: grid; gap: 12px; padding: 10px 20px max(env(safe-area-inset-bottom), 22px); }
.grabber { width: 40px; height: 5px; margin: 0 auto 6px; border-radius: 3px; background: var(--line); }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; }
.sheet-head h2 { margin-top: 6px; font: italic 400 40px/1 var(--serif); }
.sheet-head .round { width: 40px; height: 40px; }
.stepper { display: flex; align-items: center; justify-content: space-between; padding: 6px 6px 6px 18px; border-radius: var(--r-xs); background: var(--glass); }
.stepper > div { display: flex; align-items: center; }
.stepper .round { width: 44px; height: 44px; background: var(--glass-strong); }
.stepper .round:disabled { opacity: .3; }
.stepper input { width: 44px; border: 0; background: none; text-align: center; font-size: 20px; font-weight: 600; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { display: none; }
.fine { text-align: center; font-size: 13px; color: var(--dim); }
.pay-pick { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: var(--r-xs); background: var(--glass); }
.pay-pick input { position: absolute; opacity: 0; pointer-events: none; }
.pay-pick span { display: grid; place-items: center; min-height: 44px; padding: 6px 10px; border-radius: calc(var(--r-xs) - 4px); text-align: center; font-size: 15px; font-weight: 500; color: var(--dim); cursor: pointer; transition: background .3s var(--spring), color .2s; }
.pay-pick input:checked + span { background: var(--solid); color: var(--solid-ink); }
.pay-pick input:focus-visible + span { outline: 2px solid var(--page-fg); outline-offset: 2px; }
/* the held-cash pass sits on its own frosted card so it reads with or without a cover behind it */
.cash-hold { margin-top: 18px; padding: 26px 20px; border-radius: var(--r-xl); background: var(--glass-strong); border: 1px solid var(--line); box-shadow: var(--shadow-soft); }
/* doubled up to beat .on-ambient .hello, which would paint it white over the cover */
.hello.cash-hold { color: var(--page-fg); }
.hello.cash-hold .dim, .hello.cash-hold .lede { color: var(--dim); }
.cash-hold .amount { margin-top: 18px; font: italic 400 48px/1 var(--serif); }

/* ---------- ticket pass ---------- */
.pass-wrap { padding: 8px 0 10px; animation: rise 1s .1s var(--ease) both; }
.pass {
  --notch: 13px; --at: 76%;
  max-width: 380px; margin: 0 auto; overflow: hidden; border-radius: var(--r-md); background: var(--bg); color: var(--fg);
  box-shadow: var(--shadow-card);
  -webkit-mask: radial-gradient(circle var(--notch) at 0 var(--at), #0000 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle var(--notch) at 100% var(--at), #0000 98%, #000) right / 51% 100% no-repeat;
  mask: radial-gradient(circle var(--notch) at 0 var(--at), #0000 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle var(--notch) at 100% var(--at), #0000 98%, #000) right / 51% 100% no-repeat;
}
.pass .wordmark small { background: none; color: inherit; opacity: .55; transform: none; padding: 0; }
.pass .wordmark .slash { background: currentColor; }
.pass-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px 14px; }
.pass-no { font: 12px var(--mono); opacity: .6; }
.pass-photo { margin: 0 12px; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--r-2xs); }
.pass-photo img { width: 100%; height: 100%; object-fit: cover; }
.pass-row { padding: 14px 20px 0; }
.pass-row.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pass .k { font-size: 10px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; opacity: .55; }
.pass .v { margin-top: 2px; font-weight: 600; font-size: 16px; }
.pass .v.big { font: italic 400 40px/1 var(--serif); }
.pass .v.dim { font-weight: 400; font-size: 14px; opacity: .65; color: inherit; }
.pass-perf { margin: 20px 20px 0; border-top: 2px dashed currentColor; opacity: .18; }
.pass-foot { display: flex; justify-content: space-between; gap: 12px; padding: 16px 20px 22px; }
.pass-code { text-align: right; }
.pass-code .v { font-size: min(18px, 4.4vw); white-space: nowrap; }
/* copy sits under the code so a long one like "velvety-dolphin-43" never breaks at a hyphen */
.pass-code .copy-row { flex-direction: column; align-items: flex-end; gap: 6px; }

/* copy-to-clipboard button, used on pass codes wherever they show up */
.copy-row { display: inline-flex; align-items: center; gap: 8px; }
.copy-row.center { justify-content: center; margin-top: 10px; }
.big-code { font-size: 28px; font-weight: 600; }
.copy-btn {
  height: 30px; padding: 0 12px; border-radius: var(--r-pill); font-size: 12px; font-weight: 600;
  background: var(--glass); border: 1px solid var(--line); color: inherit; cursor: pointer; flex-shrink: 0;
  transition: transform .3s var(--spring), background .2s;
}
.copy-btn:active { transform: scale(.94); }

/* my tickets rows */
.trows { display: grid; gap: 12px; }
.trows.faded { opacity: .6; }
.trow-item { display: grid; gap: 4px; }
.trow-code { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 0 6px; }
.trow-code .mono { font-size: 13px; opacity: .7; }
.trow {
  --notch: 10px; display: flex; align-items: center; gap: 0; overflow: hidden; border-radius: var(--r-sm); background: var(--bg); color: var(--fg); padding-right: 18px;
  box-shadow: var(--shadow-soft);
  -webkit-mask: radial-gradient(circle var(--notch) at 84px 0, #0000 98%, #000) top / 100% 51% no-repeat, radial-gradient(circle var(--notch) at 84px 100%, #0000 98%, #000) bottom / 100% 51% no-repeat;
  mask: radial-gradient(circle var(--notch) at 84px 0, #0000 98%, #000) top / 100% 51% no-repeat, radial-gradient(circle var(--notch) at 84px 100%, #0000 98%, #000) bottom / 100% 51% no-repeat;
}
.trow-date { display: grid; place-items: center; width: 84px; padding: 18px 0; border-right: 2px dashed rgba(16, 29, 51, .15); }
.trow-date b { font-size: 30px; line-height: 1; letter-spacing: -.04em; }
.trow-date small { font-size: 12px; font-weight: 600; letter-spacing: .15em; }
.trow-main { flex: 1; display: grid; min-width: 0; padding: 14px 16px; }
.trow-main b { font: italic 400 28px/1.05 var(--serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow-main small { font-size: 13px; opacity: .65; }
.addcode { display: flex; gap: 8px; margin-top: 36px; }

/* album page */
.chips { position: sticky; top: 60px; z-index: 30; display: flex; gap: 8px; margin: 0 -18px 10px; padding: 8px 18px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips .chip { height: 36px; font-weight: 500; font-size: 14px; background: var(--glass-strong); border: 1px solid var(--line); }
.album-group { margin-top: 36px; scroll-margin-top: 120px; }

/* pretend checkout */
.center-page { min-height: 100svh; display: flex; align-items: center; justify-content: center; padding: 30px 18px; }
.paper { width: 100%; max-width: 420px; padding: 24px; border-radius: var(--r-xl); background: var(--glacier); color: var(--navy); box-shadow: var(--shadow-card); animation: rise .8s var(--ease) both; }
.paper .dim { color: rgba(16, 29, 51, .55); }
.paper p { margin-top: 14px; font-size: 14px; }
.paper-head { display: flex; justify-content: space-between; align-items: center; }
.paper-line { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; }
.paper-line:first-of-type { margin-top: 20px; padding-top: 18px; border-top: 1px solid rgba(16, 29, 51, .1); }
.paper-total { display: flex; justify-content: space-between; margin: 18px 0; padding-top: 16px; border-top: 1px solid rgba(16, 29, 51, .1); font-size: 22px; font-weight: 600; }
.paper .link { color: rgba(16, 29, 51, .5); }

@keyframes rise { from { opacity: 0; transform: translateY(26px); } }
.hello { animation: rise 1s var(--ease) both; }

/* ---------- bigger screens ---------- */
@media (min-width: 720px) {
  .wrap { padding: 110px 32px 60px; }
  .topbar { --bar-h: 60px; padding-left: 32px; padding-right: 32px; }
  .topnav { display: flex; }
  .tabbar { display: none; }
  .foot { padding-bottom: 50px; }
  .foot-mark { font-size: 15vw; }
  .invites { grid-template-columns: repeat(3, 1fr); gap: 22px; align-items: start; }
  .invites .invite.big { grid-column: span 2; grid-row: span 2; aspect-ratio: 4 / 4.4; }
  .invites .invite-slot.big { grid-column: span 2; grid-row: span 2; }
  .invites .invite-slot .invite.big { grid-column: auto; grid-row: auto; }
  .past-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; }
  .strip-item { flex-basis: 22%; }
  .strip-item:nth-child(3n+2) { flex-basis: 30%; }
  .gallery { columns: 3; column-gap: 12px; }
  .gal-item { margin-bottom: 12px; }
  .album-group .gallery { columns: 4; }
  .about { padding: 56px; }
  .about p { font-size: 36px; max-width: 22em; }
  .party { padding-top: 100px; }
  .back { top: 112px; left: 46px; }
  .im-in-dock { display: none; }
  .im-in-wrap.is-hero .im-in { height: 56px; font-size: 19px; }
  .sheet { margin: auto; border-radius: var(--r-xl); }
  .viewer-slide { padding: 0 60px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- "try a colour" preview pill (owner-only, see theme_preview_active()) ---------- */
.theme-pill {
  position: fixed; z-index: 500; top: calc(12px + env(safe-area-inset-top)); right: 12px;
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px 7px 14px;
  border-radius: var(--r-pill); background: var(--glass-strong); border: 1px solid var(--glass-line);
  box-shadow: var(--shadow-pop); backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4);
}
.theme-pill-label { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--dim); white-space: nowrap; }
.theme-swatch {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .55); transition: transform .25s var(--spring), box-shadow .2s;
}
.theme-swatch:hover { transform: scale(1.15); }
.theme-swatch.on { box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .8), 0 0 0 2px var(--glass-strong), 0 0 0 4px var(--page-fg); }
.theme-swatch[data-theme-swatch="glacier"] { background: linear-gradient(135deg, #eef2f6, #d9ecf8 55%, #101d33); }
.theme-swatch[data-theme-swatch="cobalt"] { background: linear-gradient(135deg, #eef1ff, #8fa0ff 55%, #0a1442); }
.theme-swatch[data-theme-swatch="midnight"] { background: linear-gradient(135deg, #0a1128, #4dd9ff 65%, #eef8ff); }
.theme-swatch[data-theme-swatch="periwinkle"] { background: linear-gradient(135deg, #fff8ef, #cfd3f5 55%, #332b66); }
