/*
 * 12 Days of Christmas advent calendar.
 *
 * Everything is scoped under .stadv so nothing leaks into the site header or
 * footer, which the calendar sits between. Keyframes are prefixed st- for the
 * same reason.
 *
 * The prototype carried all of this as inline styles. It is a stylesheet here
 * because the same door is rendered twelve times in five states, and the one
 * thing worse than a long stylesheet is the same declaration pasted sixty times.
 */

.stadv {
  --adv-page: #0B1A15;
  --adv-surface: #10231D;
  --adv-card: #12261F;
  --adv-ink: #F6EFE2;
  --adv-body: #D5DAD2;
  --adv-muted: #C3CBC1;
  --adv-faint: #8A968F;
  --adv-disabled: #5E6B65;
  --adv-gold: #D9B26A;
  --adv-gold-light: #F1DDA8;
  --adv-gold-num: #E9D29B;
  --adv-gold-high: #F6E6B8;
  --adv-frost: linear-gradient(160deg, rgba(246,239,226,.10), rgba(246,239,226,.03)), #10231D;
  --adv-goldface: linear-gradient(145deg,#F6E6B8 0%,#DDB86F 38%,#B98A3E 72%,#EBCF8C 100%);

  position: relative;
  isolation: isolate;
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(217,178,106,.16), transparent 62%),
    radial-gradient(800px 600px at 95% 5%, rgba(46,104,82,.38), transparent 60%),
    var(--adv-page);
  color: var(--adv-ink);
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  overflow: hidden;
}

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

/* The calendar sits between the live site's header and footer, so the site's
   own stylesheet is in play on every element inside it. An element selector
   beats inheritance, which is how the headline came out near-black on dark
   green (style.css has `.h2, h1 { color: #292627 }`), and the site's label
   rule was adding 20px above every form label.

   :where() contributes NO specificity, so each of these is worth exactly the
   .stadv class alone. That is enough to beat the site's bare element selectors
   and still lose to every .stadv__thing rule below, which is the point - the
   first attempt used .stadv p and quietly repainted the body copy and the
   legal line in the headline's colour. */
.stadv :where(h1, h2, h3, h4, h5, h6),
.stadv-overlay :where(h1, h2, h3, h4, h5, h6) {
  color: inherit;
  margin: 0;
  font-weight: inherit;
  line-height: inherit;
}

.stadv :where(p),
.stadv-overlay :where(p) { color: inherit; margin: 0; }

.stadv :where(label),
.stadv-overlay :where(label) { margin: 0; }

.stadv :where(ul, ol),
.stadv-overlay :where(ul, ol) { margin: 0; padding: 0; list-style: none; }

.stadv :where(a) { text-decoration: none; }

.stadv__inner {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(28px,5vw,64px) clamp(16px,4vw,40px) 48px;
}

.stadv h1, .stadv h2, .stadv h3, .stadv p { margin: 0; }

/* ---------------------------------------------------------- decoration */

.stadv__decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.stadv__flake {
  position: absolute;
  top: 0;
  border-radius: 50%;
  background: rgba(246,239,226,.5);
}

.stadv__bokeh {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217,178,106,.22), transparent 70%);
  filter: blur(18px);
}

@keyframes st-fall {
  0%   { transform: translate3d(0,-20px,0); }
  100% { transform: translate3d(40px,1500px,0); }
}

@keyframes st-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(217,178,106,.55), 0 0 28px rgba(217,178,106,.25); }
  50%      { box-shadow: 0 0 0 9px rgba(217,178,106,0), 0 0 44px rgba(217,178,106,.45); }
}

@keyframes st-fade {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------- hero */

.stadv__hero {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(28px,4vw,56px);
  align-items: flex-start;
}

.stadv__heroMain { flex: 1 1 520px; display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.stadv--live .stadv__heroMain { gap: 18px; }
.stadv__heroAside { flex: 1 1 340px; max-width: 460px; min-width: 0; }

.stadv__eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--adv-gold);
}

.stadv__h1 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  color: var(--adv-ink);
  font-size: clamp(52px,8.5vw,112px);
  line-height: .92;
  letter-spacing: -.01em;
}

.stadv--live .stadv__h1 { font-size: clamp(48px,7.5vw,96px); }
.stadv__h1 em { font-style: italic; color: #E9D29B; }

.stadv__intro {
  font-size: clamp(16px,1.4vw,18px);
  line-height: 1.6;
  color: var(--adv-body);
  max-width: 500px;
  text-wrap: pretty;
}

/* ----------------------------------------------------------- countdown */

.stadv__countdown {
  max-width: 480px;
  border-radius: 18px;
  padding: clamp(16px,2.4vw,22px);
  background: linear-gradient(160deg, rgba(246,239,226,.09), rgba(246,239,226,.03)), var(--adv-surface);
  border: 1px solid rgba(241,221,168,.24);
}

.stadv__countdownTop {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.stadv__countdownLabel {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--adv-gold-num);
}

.stadv__countdownWhen { font-size: 13px; color: var(--adv-muted); }

.stadv__countdownGrid { display: grid; grid-template-columns: repeat(4, 1fr); }

.stadv__unit { padding: 0 clamp(6px,1.2vw,14px); text-align: left; }
.stadv__unit + .stadv__unit { border-left: 1px solid rgba(241,221,168,.2); }

.stadv__unitNum {
  display: block;
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: clamp(44px,5vw,60px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
  color: var(--adv-ink);
}

.stadv__unitLabel {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--adv-muted);
}

/* -------------------------------------------------------------- brands */

.stadv__brands { max-width: 480px; }
.stadv__brandsLabel {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--adv-gold-num);
  margin-bottom: 8px;
}

.stadv__brandsGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  column-gap: clamp(16px,3vw,32px);
  border-top: 1px solid rgba(241,221,168,.18);
}

.stadv__brand {
  padding: 12px 0;
  border-bottom: 1px solid rgba(241,221,168,.18);
  font-size: 15px;
  font-weight: 600;
}

/* ------------------------------------------------------ live: progress */

.stadv__pending {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--adv-gold);
  background: rgba(217,178,106,.12);
  border-radius: 14px;
  padding: 14px 16px;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

.stadv__pendingTitle { font-weight: 800; font-size: 15px; }
.stadv__pendingSub { font-size: 13px; color: var(--adv-muted); margin-top: 2px; }

.stadv__pendingPill {
  flex: none;
  padding: 8px 14px;
  border-radius: 999px;
  background: linear-gradient(180deg,#E7C987,#C99A4E);
  color: #1E1606;
  font-weight: 800;
  font-size: 13px;
  white-space: nowrap;
}

.stadv__progressRow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.stadv__progressCount { font-size: 15px; color: var(--adv-body); }
.stadv__progressCount b {
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  font-size: 28px;
  color: var(--adv-gold-light);
}

.stadv__catchupLink {
  font-size: 13px;
  color: var(--adv-gold-light);
  text-decoration: underline;
}

/* ------------------------------------------------------------- baubles */

.stadv__baubles {
  display: flex;
  align-items: flex-start;
  gap: clamp(6px,1.4vw,14px);
  padding: 6px 0 2px;
}

.stadv__bauble {
  width: clamp(14px,2.4vw,20px);
  height: clamp(14px,2.4vw,20px);
  border-radius: 50%;
  flex: none;
  border: 1px solid rgba(241,221,168,.4);
}

.stadv__bauble--opened {
  background: radial-gradient(circle at 35% 30%,#FFF1C9,#D9B26A 55%,#8E6A2C);
  border: 1px solid var(--adv-gold-light);
  box-shadow: 0 0 12px rgba(217,178,106,.45);
}

.stadv__bauble--today {
  background: rgba(217,178,106,.2);
  border: 2px solid var(--adv-gold-light);
  box-shadow: 0 0 16px rgba(241,221,168,.6);
}

.stadv__bauble--missed { border: 1px solid var(--adv-disabled); }

/* ---------------------------------------------------------------- grid */

.stadv__grid {
  display: grid;
  grid-auto-flow: dense;
  gap: clamp(10px,1.4vw,16px);
  margin-top: clamp(36px,5vw,64px);
  /* Desktop: four columns. The row height formula is the design's, expressed
     as a clamp so it needs no JavaScript to measure the viewport. */
  grid-template-columns: repeat(4, minmax(0,1fr));
  grid-auto-rows: clamp(150px, calc((min(100vw, 1240px) - 80px) / 4 * .66), 200px);
}

/* The sequence comes from a custom property, never an inline order. An
   inline style beats a stylesheet rule, so setting order inline silently
   pinned the desktop sequence at every width. */
.stadv__cell { position: relative; perspective: 1200px; order: var(--adv-d-order, 0); }
.stadv__cell--wide { grid-column: span 2; }
.stadv__cell--golden { grid-column: span 2; grid-row: span 2; }

.stadv__door {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  margin: 0;
  background: transparent;
  border-radius: 16px;
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.stadv__door[data-status="locked"],
.stadv__door[data-status="missed"] { cursor: default; }

.stadv__door:focus-visible { outline: 2px solid var(--adv-gold-light); outline-offset: 3px; }

/* The layer behind the door, seen while it is swung open. */
.stadv__reveal {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: radial-gradient(circle at 50% 55%, rgba(255,226,160,.95), rgba(217,178,106,.55) 35%, #1A1206 80%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  opacity: 0;
  transition: opacity .3s;
}

.stadv__revealText {
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic;
  font-size: clamp(18px,2vw,24px);
  color: #2A1E08;
}

.stadv__face {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  overflow: hidden;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transform-origin: left center;
  transform: rotateY(0deg);
  transition: transform .7s cubic-bezier(.3,.7,.3,1);
  box-shadow: 0 18px 40px rgba(0,0,0,.28);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(10px,1.4vw,18px);
  background: var(--adv-frost);
  border: 1px solid rgba(241,221,168,.16);
}

/* The swing. Driven by a class the JS adds, so the states stay in CSS. */
.stadv__cell.is-open .stadv__face {
  transform: rotateY(-108deg);
  transition: transform 1.3s cubic-bezier(.65,0,.25,1) .25s;
}
.stadv__cell.is-open .stadv__reveal { opacity: 1; }

.stadv__doorTop {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px;
}

.stadv__num {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: clamp(34px,4.6vw,60px);
  line-height: .9;
  color: var(--adv-gold-num);
}

.stadv__date {
  font-size: clamp(9px,1vw,11px);
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--adv-muted);
  text-align: right;
  white-space: nowrap;
}

.stadv__doorBottom {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

.stadv__pill {
  padding: clamp(6px,.8vw,9px) clamp(10px,1.2vw,16px);
  border-radius: 999px;
  background: linear-gradient(180deg,#E7C987,#C99A4E);
  color: #1E1606;
  font-weight: 800;
  font-size: clamp(11px,1.1vw,14px);
  letter-spacing: .02em;
  white-space: nowrap;
}

.stadv__badge {
  padding: 5px 9px;
  border-radius: 6px;
  border: 1px solid var(--adv-gold);
  color: var(--adv-gold-light);
  font-weight: 800;
  font-size: clamp(9px,1vw,12px);
  letter-spacing: .08em;
  white-space: nowrap;
}

.stadv__line {
  font-size: clamp(11px,1.15vw,14px);
  line-height: 1.3;
  color: var(--adv-muted);
  font-weight: 500;
  text-wrap: pretty;
}

/* ------------------------------------------------- door status variants */

.stadv__cell[data-status="locked"] .stadv__line { font-style: italic; }

.stadv__cell[data-status="today"] .stadv__face {
  background: linear-gradient(160deg,#21463A,#122A22);
  border: 1.5px solid var(--adv-gold);
}
.stadv__cell[data-status="today"] .stadv__num { color: var(--adv-gold-high); }

.stadv__glow {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  pointer-events: none;
  box-shadow: 0 0 36px rgba(217,178,106,.4);
  animation: st-pulse 2.4s ease-in-out infinite;
}

.stadv__cell[data-status="catchup"] .stadv__face {
  border: 1.5px dashed rgba(217,178,106,.75);
}
.stadv__cell[data-status="catchup"] .stadv__line { color: var(--adv-gold-light); font-weight: 700; }

.stadv__cell[data-status="opened"] .stadv__face {
  background: linear-gradient(160deg,#132B23,#0E201A);
  border: 1px solid rgba(217,178,106,.32);
}

.stadv__cell[data-status="missed"] .stadv__face {
  background: linear-gradient(rgba(255,255,255,.025),rgba(255,255,255,.025)), #0D1D18;
  border: 1px solid rgba(255,255,255,.07);
}
.stadv__cell[data-status="missed"] .stadv__num { color: var(--adv-disabled); }
.stadv__cell[data-status="missed"] .stadv__date { color: #6F7C76; }
.stadv__cell[data-status="missed"] .stadv__line { color: var(--adv-faint); }

/* ---------------------------------------------------------- the golden */

.stadv__cell--golden .stadv__face {
  background: var(--adv-goldface);
  border: 1px solid #F4E2B0;
}
.stadv__cell--golden .stadv__num { color: #2A1E08; font-size: clamp(64px,8vw,104px); }
.stadv__cell--golden .stadv__date { color: #3A2A0C; }
.stadv__cell--golden .stadv__doorBottom { align-items: flex-end; }
.stadv__cell--golden .stadv__pill { background: #1A140A; color: var(--adv-gold-light); }
.stadv__cell--golden .stadv__badge { border-color: #2A1E08; color: #2A1E08; }

.stadv__ribbonV {
  position: absolute;
  top: 0; bottom: 0; left: 58%;
  width: clamp(14px,2vw,26px);
  background: linear-gradient(90deg,#A87F3A,#E9CB85,#A87F3A);
  opacity: .55;
}

.stadv__ribbonH {
  position: absolute;
  left: 0; right: 0; top: 44%;
  height: clamp(14px,2vw,26px);
  background: linear-gradient(180deg,#A87F3A,#E9CB85,#A87F3A);
  opacity: .55;
}

.stadv__sheen {
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg,transparent 30%,rgba(255,255,255,.45) 45%,transparent 60%);
}

.stadv__plate {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255,248,230,.72);
  align-self: flex-start;
  max-width: 90%;
}

.stadv__plateTitle {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: clamp(24px,3.4vw,44px);
  line-height: 1;
  color: #2A1E08;
}

.stadv__plateSub { font-size: clamp(11px,1.1vw,13px); font-weight: 700; color: #4A3610; }

/* -------------------------------------------------------- how it works */

.stadv__how { margin-top: clamp(48px,7vw,88px); display: flex; flex-direction: column; gap: 28px; }

.stadv__h2 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  color: var(--adv-ink);
  font-size: clamp(34px,4.5vw,52px);
  line-height: 1;
}

.stadv__howGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px,1fr));
  gap: clamp(16px,2vw,28px);
}

.stadv__step {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid rgba(241,221,168,.3);
}

.stadv__stepNum {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 44px;
  line-height: 1;
  color: var(--adv-gold-num);
}

.stadv__stepTitle { font-weight: 700; font-size: 17px; }
.stadv__stepBody { font-size: 15px; color: var(--adv-muted); line-height: 1.6; text-wrap: pretty; }

/* -------------------------------------------------------------- footer */

.stadv__footer {
  margin-top: clamp(48px,7vw,80px);
  padding-top: 24px;
  border-top: 1px solid rgba(241,221,168,.18);
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
  align-items: flex-start;
}

.stadv__legal { font-size: 12px; color: var(--adv-faint); max-width: 640px; line-height: 1.6; }
.stadv__footerLinks { display: flex; gap: 20px; flex-wrap: wrap; }
.stadv__footerLinks a { font-size: 13px; color: var(--adv-gold-light); text-decoration: underline; }

/* --------------------------------------------------------------- toast */

.stadv-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(8px);
  z-index: 60;
  padding: 12px 20px;
  border-radius: 999px;
  background: #F6EFE2;
  color: #0B1A15;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 14px 40px rgba(0,0,0,.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  max-width: calc(100vw - 32px);
  text-align: center;
}

.stadv-toast.is-shown { opacity: 1; transform: translateX(-50%) translateY(0); }

/* -------------------------------------------------------------- mobile */

@media (max-width: 699px) {
  .stadv__grid {
    grid-template-columns: repeat(3, minmax(0,1fr));
    grid-auto-rows: clamp(118px, calc((100vw - 32px) / 3 * 1.12), 150px);
  }

  /* The Golden Door goes full width and last. */
  .stadv__cell--golden { grid-column: span 3; grid-row: span 2; }
  .stadv__cell--golden .stadv__num { font-size: clamp(34px,4.6vw,60px); }

  /* KNOWN FIX 1. On a one-column tile the date was clipped to "THU 10 D",
     because it sat beside a very large number with nowrap. Stacking it under
     the number gives it the full tile width. */
  .stadv__doorTop { flex-direction: column; align-items: flex-start; gap: 2px; }
  .stadv__date { text-align: left; font-size: 9px; }

  /* KNOWN FIX 2. "Open me" wrapped onto two lines at this width. */
  .stadv__pill { padding: 6px 10px; font-size: 11px; }

  /* A wide tile has room for the original side-by-side arrangement. */
  .stadv__cell--wide .stadv__doorTop,
  .stadv__cell--golden .stadv__doorTop {
    flex-direction: row;
    align-items: flex-start;
    gap: 6px;
  }
  .stadv__cell--wide .stadv__date,
  .stadv__cell--golden .stadv__date { text-align: right; font-size: 10px; }
}

/* ------------------------------------------------------ reduced motion */

@media (prefers-reduced-motion: reduce) {
  .stadv__decor { display: none; }
  .stadv__glow { animation: none; }
  .stadv__face,
  .stadv__cell.is-open .stadv__face { transition: none; }
  .stadv-toast { transition: none; }
}

/* ---------------------------------------------------------------- cards */

.stadv__card {
  border-radius: 20px;
  padding: clamp(20px,3vw,28px);
  background: var(--adv-card);
  border: 1px solid rgba(241,221,168,.26);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stadv__card + .stadv__card { margin-top: clamp(14px,2vw,18px); }
.stadv__card--join { box-shadow: 0 30px 60px rgba(0,0,0,.35); }

.stadv__card--in {
  background: linear-gradient(160deg,#1B3A2F,#12261F);
  border: 1px solid var(--adv-gold);
}

.stadv__card--soft {
  background: rgba(246,239,226,.05);
  border: 1px solid rgba(241,221,168,.2);
  padding: 22px 24px;
}

.stadv__cardTitle {
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  color: var(--adv-ink);
  font-size: clamp(26px,3vw,34px);
  line-height: 1.05;
}

.stadv__cardBody { font-size: 15px; line-height: 1.6; color: var(--adv-body); text-wrap: pretty; }
.stadv__cardNote { font-size: 12px; line-height: 1.6; color: var(--adv-faint); }
.stadv__cardNote a, .stadv__cardBody a { color: var(--adv-gold-light); }

.stadv__cardLabel {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--adv-gold-num);
}

.stadv__cardLead { font-size: 17px; font-weight: 700; }

/* ----------------------------------------------------------- checklist */

.stadv__checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }

.stadv__checklist li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 15px;
  color: var(--adv-muted);
  line-height: 1.5;
}

.stadv__checklist li.is-done { color: var(--adv-ink); }
.stadv__tick { flex: none; width: 18px; color: var(--adv-gold-light); font-weight: 800; }
.stadv__checkCount { color: var(--adv-faint); font-size: 13px; }

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

.stadv__tabs { display: flex; gap: 8px; }

.stadv__tab {
  flex: 1 1 0;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(241,221,168,.3);
  background: transparent;
  color: var(--adv-muted);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.stadv__tab.is-on { background: rgba(217,178,106,.16); color: var(--adv-ink); border-color: var(--adv-gold); }

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

.stadv__form { display: flex; flex-direction: column; gap: 14px; }
.stadv__pair { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 12px; }
.stadv__field { display: flex; flex-direction: column; min-width: 0; }

.stadv__field label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--adv-muted);
  margin-bottom: 6px;
}

.stadv__field input {
  height: 48px;
  border-radius: 10px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(241,221,168,.22);
  color: var(--adv-ink);
  font: inherit;
  font-size: 15px;
  padding: 0 14px;
  min-width: 0;
}

.stadv__field input::placeholder { color: #7F8C85; }
.stadv__field input:focus-visible { outline: 2px solid var(--adv-gold-light); outline-offset: 2px; }
.stadv__hint { font-size: 12px; color: var(--adv-faint); margin-top: 6px; }

.stadv__check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 44px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--adv-body);
  cursor: pointer;
}

.stadv__check input {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--adv-gold);
}

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

.stadv__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 22px;
  border-radius: 999px;
  border: none;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}

.stadv__btn--primary { background: linear-gradient(180deg,#E7C987,#C99A4E); color: #1E1606; }

.stadv__btn--secondary {
  background: transparent;
  border: 1px solid rgba(241,221,168,.5);
  color: var(--adv-gold-light);
  font-weight: 700;
}

.stadv__btn--light { background: #F6EFE2; color: #0B1A15; }
.stadv__btn--dark { background: #1A140A; color: var(--adv-gold-light); }

/* -------------------------------------------------------- code boxes */

.stadv__codeBox {
  border: 2px dashed var(--adv-gold);
  border-radius: 14px;
  padding: 14px 16px;
  text-align: center;
  overflow-wrap: anywhere;
}

.stadv__codeText {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: clamp(20px,2.4vw,26px);
  letter-spacing: .06em;
  color: var(--adv-ink);
}

.stadv__codeBox--link .stadv__codeText { font-size: 13px; letter-spacing: 0; }

/* The mobile grid scatters the doors differently from desktop. One DOM order,
   re-sequenced here, so a door can only be wrong in one place. */
@media (max-width: 699px) {
  .stadv__cell { order: var(--adv-m-order); }
}

/* --------------------------------------------------------------- modals */

@keyframes st-burst {
  0%   { transform: translate(0,0) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; }
}

.stadv-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(4,10,8,.74);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}

.stadv-overlay[hidden] { display: none; }

.stadv-modal {
  position: relative;
  width: 100%;
  max-width: 480px;
  border-radius: 22px;
  padding: clamp(24px,4vw,36px);
  background: linear-gradient(170deg,#173229,#10231D);
  border: 1px solid rgba(217,178,106,.3);
  color: #F6EFE2;
  box-shadow: 0 40px 100px rgba(0,0,0,.55);
  animation: st-fade .35s cubic-bezier(.2,.7,.3,1);
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-family: 'Manrope', system-ui, sans-serif;
}

.stadv-modal--wide { max-width: 880px; }

.stadv-modal--gold {
  background: linear-gradient(145deg,#F6E6B8 0%,#DDB86F 38%,#B98A3E 72%,#EBCF8C 100%);
  border: 1px solid #F6E6B8;
  color: #2A1E08;
}

.stadv-modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  color: inherit;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
}

.stadv-modal__close:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

.stadv-modal__eyebrow {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: #D9B26A;
}

.stadv-modal--gold .stadv-modal__eyebrow { color: #4A3610; }

.stadv-modal__title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  font-size: clamp(34px,5vw,46px);
  line-height: 1.02;
  margin: 0;
}

.stadv-modal__title em { font-style: italic; color: #E9D29B; }
.stadv-modal--gold .stadv-modal__title em { color: #4A3610; }

.stadv-modal__body { font-size: 15px; line-height: 1.6; color: #D5DAD2; text-wrap: pretty; }
.stadv-modal--gold .stadv-modal__body { color: #3A2A0C; }

.stadv-modal__prize { font-size: 17px; font-weight: 700; }
.stadv-modal__note { font-size: 12px; color: #8A968F; }
.stadv-modal--gold .stadv-modal__note { color: #4A3610; }

.stadv-modal__img {
  width: 100%;
  max-width: 260px;
  aspect-ratio: 1;
  border-radius: 16px;
  object-fit: cover;
  align-self: center;
  background: repeating-linear-gradient(135deg, rgba(241,221,168,.08) 0 10px, rgba(241,221,168,.03) 10px 20px);
  border: 1px solid rgba(241,221,168,.25);
}

.stadv-modal__img--wide { max-width: 100%; aspect-ratio: 16/9; }

.stadv-modal__video {
  width: 100%;
  aspect-ratio: 16/9;
  border: none;
  border-radius: 12px;
  background: #000;
}

.stadv-modal__points {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: clamp(84px,14vw,120px);
  line-height: .9;
  color: #F1DDA8;
}

.stadv-modal__pointsLabel {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #C3CBC1;
}

.stadv-modal__balance {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(246,239,226,.06);
  border: 1px solid rgba(241,221,168,.2);
  font-size: 14px;
}

.stadv-modal__balance b { font-size: 20px; font-weight: 800; }

.stadv-modal__plate {
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255,248,230,.5);
  color: #2A1E08;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 15px;
}

.stadv-modal__plate .is-no { color: #6B2A14; }

.stadv-modal__actions { display: flex; flex-direction: column; gap: 10px; }

.stadv-confetti { position: absolute; top: 0; left: 50%; pointer-events: none; }
.stadv-confetti span { position: absolute; }

@media (max-width: 699px) {
  .stadv-overlay { padding: 0; align-items: flex-end; }
  .stadv-modal {
    max-width: none;
    border-radius: 22px 22px 0 0;
    max-height: 92vh;
    overflow-y: auto;
  }
  .stadv-modal--wide { border-radius: 0; max-height: 100vh; height: 100vh; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .stadv-modal { animation: none; }
  .stadv-confetti { display: none; }
}

/* ------------------------------------------------------- claim & share */

.stadv-modal__tick {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(180deg,#E7C987,#C99A4E);
  color: #1E1606;
  font-size: 30px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
}

/* Town takes the room, the postcode only needs enough for "G72 7AB". */
.stadv__pair--town { grid-template-columns: 1.4fr 1fr; }

.stadv-modal__shareRow { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.stadv-modal__shareRow .stadv__btn { min-height: 44px; padding: 10px 8px; font-size: 13px; }

/* ------------------------------------------------------------ winners */

.stadv__winners { display: flex; flex-direction: column; margin-top: clamp(28px,4vw,44px); }

.stadv__winRow {
  display: flex;
  gap: clamp(14px,2.5vw,28px);
  padding: clamp(18px,2.4vw,26px) 0;
  border-top: 1px solid rgba(241,221,168,.18);
}

.stadv__winRow:last-child { border-bottom: 1px solid rgba(241,221,168,.18); }

.stadv__winDoor {
  flex: none;
  width: clamp(44px,6vw,72px);
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: clamp(34px,4.6vw,56px);
  line-height: .9;
  color: var(--adv-gold-num);
}

.stadv__winBody { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.stadv__winPrize { font-size: clamp(16px,1.6vw,19px); font-weight: 700; }

.stadv__winMeta {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--adv-gold-num);
}

.stadv__winNames { font-size: 15px; line-height: 1.7; color: var(--adv-body); text-wrap: pretty; }

/* --------------------------------------------------------------- prose */

.stadv__prose { max-width: 760px; margin-top: clamp(28px,4vw,44px); }
.stadv__prose .stadv__h2 { font-size: clamp(22px,2.6vw,30px); margin-top: clamp(28px,4vw,40px); }

.stadv__prose p {
  font-size: 15px;
  line-height: 1.75;
  color: var(--adv-body);
  margin-top: 12px;
  text-wrap: pretty;
}

.stadv__prose ul { margin: 12px 0 0 0; padding-left: 22px; list-style: disc; }

.stadv__prose li {
  font-size: 15px;
  line-height: 1.75;
  color: var(--adv-body);
  margin-top: 8px;
}

.stadv__prose a { color: var(--adv-gold-light); text-decoration: underline; }
.stadv__prose b { color: var(--adv-ink); }

/* The terms and winners pages are plain documents, not the hero's flex
   column, so the spacing the hero gets from its gap has to be stated. */
.stadv--terms .stadv__h1,
.stadv--winners .stadv__h1 { margin-top: 12px; }

.stadv--terms .stadv__intro,
.stadv--winners .stadv__intro { margin-top: 20px; }


/* ------------------------------------------------------- link hover

   The shop's style.css sits between header and foot and sets
   `a:hover, a:active, a:focus { color: #0f0d0e }` at assets/css/style.css:411.
   On the calendar's dark green that is invisible: the link vanishes under the
   cursor, which looks broken. One class of extra specificity fixes every link
   on all three advent pages. */

.stadv a:hover,
.stadv a:focus,
.stadv a:active {
  color: var(--adv-gold-high);
  text-decoration: underline;
}

/* ------------------------------------------------------------- alert

   What join.php redirected back with, shown in the card and left there. The
   2.6 second toast it replaces was gone before anyone had read it. */

.stadv__alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid;
  font-size: 14px;
  line-height: 1.55;
  text-wrap: pretty;
  margin-bottom: clamp(14px,2vw,18px);
  border-left-width: 4px;
}

.stadv__alert:focus-visible { outline: 2px solid var(--adv-gold-light); outline-offset: 2px; }

.stadv__alert--bad {
  background: rgba(214,106,86,.22);
  border-color: rgba(238,150,130,.75);
  color: #FFE4DC;
}

/* Solid, not a tint. At .14 over this green the whole thing read as a note
   rather than as a refusal, which is the complaint it exists to answer. */
.stadv__alert--bad .stadv__alertIcon { background: #D66A56; color: #2A0E08; }

.stadv__alert--ok {
  background: rgba(217,178,106,.14);
  border-color: rgba(241,221,168,.45);
  color: var(--adv-gold-light);
}

.stadv__alertIcon {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  background: rgba(0,0,0,.22);
}

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

.stadv__pw { position: relative; display: flex; min-width: 0; }
.stadv__pw input { flex: 1 1 auto; padding-right: 48px; }

.stadv__eye {
  position: absolute;
  top: 0;
  right: 0;
  width: 46px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--adv-faint);
  cursor: pointer;
}

.stadv__eye:hover { color: var(--adv-gold-light); }
.stadv__eye:focus-visible { outline: 2px solid var(--adv-gold-light); outline-offset: 2px; }

/* The slash is in the markup either way, so the button needs no second icon
   and no JavaScript beyond flipping aria-pressed. Struck through by default,
   because that is the state the field is actually in: hidden, click to see. */
.stadv__eye[aria-pressed="true"] { color: var(--adv-gold-light); }
.stadv__eye[aria-pressed="true"] .stadv__eyeShut { display: none; }

/* ------------------------------------------------------- submitting

   Sign-up waits on an email send and a Turnstile call, so the button has to
   say it is busy or people press it again. */

.stadv__btn.is-working {
  position: relative;
  padding-right: 48px;
  opacity: .9;
  cursor: progress;
}

.stadv__btn.is-working::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 20px;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: stadv-spin .7s linear infinite;
}

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

/* Still moving, so it still reads as busy, just not as a spin. */
@media (prefers-reduced-motion: reduce) {
  .stadv__btn.is-working::after { animation-duration: 2.4s; }
}
