/* ==========================================================================
   Wedding site — all styling (SPEC §9)

   THE DESIGN IS NOT FINAL. Every colour, font, size, and spacing value lives
   in the token block below. Restyle the whole site by editing this block;
   nothing further down contains a raw hex value.
   ========================================================================== */

:root {
  /* ---- Palette (SPEC §9) ---- */
  --olive:        #6F7A45;   /* curtain */
  --olive-dark:   #565F33;
  --olive-light:  #7E8A52;   /* curtain highlight fold */
  --olive-shade:  #5D6739;   /* curtain shadow fold */
  --oak:          #B98A5E;
  --oak-dark:     #9C7149;
  --oak-ink:      #7A5532;   /* oak dark enough for small text on cream (6:1) */
  --mustard:      #E3B23C;
  --cream:        #F7F3EA;   /* page / panelled wall */
  --paper:        #FAF6EE;   /* printed cards */
  --paper-bright: #FFFDF8;   /* inputs, photo borders */
  --sign:         #F3E9D2;   /* the PHOTOS panel */
  --sign-edge:    #D8CCB0;
  --booth-frame:  #8A8C86;
  --booth-frame-dark: #6E706B;
  --booth-frame-light: #A9ABA5;
  --cabin:        #FBF8F1;   /* inside the booth */
  --black:        #1B1B1B;   /* keys, header strip, floor checks */
  --black-soft:   #3A3A3A;
  --ink:          #1F2622;   /* body text */
  --ink-soft:     #3F4A43;
  --ink-mute:     #5E6A62;
  --rule:         #C9B48A;   /* card keyline */
  --error:        #8A2B1D;
  --error-bg:     #FBEAE4;
  --ok:           #3F5A2A;
  --flash:        #FFFFFF;
  --tape:         rgba(237, 212, 154, 0.74);
  --tape-b:       rgba(191, 227, 224, 0.80);
  --line-soft:    rgba(31, 38, 34, 0.06);   /* wall panel seams */
  --grain-dark:   rgba(0, 0, 0, 0.05);
  --grain-light:  rgba(255, 255, 255, 0.06);

  /* ---- Type ---- */
  --font-display: "Bodoni Moda", Georgia, serif;                       /* names, wall heading */
  --font-serif:   "Cormorant Garamond", Georgia, serif;                /* headings, prose */
  --font-sans:    "Jost", "Helvetica Neue", Arial, sans-serif;         /* labels, UI */
  --font-hand:    "Reenie Beanie", "Bradley Hand", cursive;            /* captions */
  --font-script:  "Pinyon Script", "Snell Roundhand", cursive;         /* flourishes */

  --text-xs:   0.75rem;    /* 12px small caps labels */
  --text-sm:   0.875rem;
  --text-base: 1.0625rem;  /* 17px UI */
  --text-prose: 1.1875rem; /* 19px serif prose */
  --text-lg:   1.375rem;
  --text-h2:   clamp(1.875rem, 1.3rem + 2.6vw, 2.5rem);
  --text-names: clamp(1.75rem, 1rem + 6vw, 4.25rem);
  --text-names-phone: clamp(1.5rem, 0.5rem + 5.4vw, 2.5rem);   /* names beside the strip on a phone */
  --text-hand: 1.625rem;
  --text-script: clamp(2.25rem, 1.6rem + 3vw, 3rem);
  --track-caps: 0.2em;
  --track-wide: 0.26em;

  /* ---- Space ---- */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4.5rem;
  --gutter: 1rem;
  --measure: 47.5rem;        /* card column */
  --measure-wide: 61.25rem;
  --touch: 2.75rem;          /* 44px minimum touch target */

  /* ---- Shape & depth ---- */
  --radius: 4px;
  --radius-lg: 6px;
  --border: 1.5px solid var(--ink);
  --shadow-card: 0 16px 32px rgba(31, 38, 34, 0.22);
  --shadow-hero: 0 30px 60px rgba(0, 0, 0, 0.5);
  --shadow-booth: 0 30px 50px rgba(31, 38, 34, 0.28);
  --shadow-strip: 0 10px 22px rgba(31, 38, 34, 0.28);
  --shadow-photo: 0 6px 14px rgba(31, 38, 34, 0.22);
  --shadow-drape: 0 0 10px rgba(0, 0, 0, 0.25);
  --shadow-key: inset 0 -3px 0 rgb(0, 0, 0);
  --focus: 3px solid var(--ink);
  --focus-on-dark: 3px solid var(--paper);

  /* ---- The booth ---- */
  --booth-max-w: 47.5rem;                                /* 760px, same as a card */
  --booth-ratio: 1.3;                                    /* width ÷ height */
  --sign-h-open: 16rem;                                  /* the PHOTOS panel once unlocked (wide booth) */
  --strip-max-h-booth: 26rem;                            /* a strip on the card printed inside the booth */
  /* Locked: shrink so the password field stays above the fold on a phone.
     booth.js refines this by measuring; this is the no-JS estimate. */
  --booth-h-locked: clamp(9.5rem, calc(100svh - 27rem), 26rem);
  --key-size: 2.75rem;
  --hero-strip-ratio: 360 / 1124;                        /* shape of the hero strip image */
  --strip-max-h: min(44rem, 85svh);                      /* a taped strip never outgrows the screen */

  /* ---- Motion (all disabled under prefers-reduced-motion) ---- */
  --curtain-ms: 620ms;
  --flash-ms: 800ms;
  --print-ms: 1700ms;
  --ease-curtain: cubic-bezier(0.6, 0, 0.3, 1);
}

/* ==========================================================================
   Base
   ========================================================================== */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--s-4); }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: var(--text-prose);
  line-height: 1.55;
  overflow-x: clip;
}

h1, h2, h3, p, dl, dd, figure { margin: 0; }
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }

a { color: var(--ink); text-underline-offset: 4px; }
a:hover { color: var(--oak-ink); }

:focus-visible { outline: var(--focus); outline-offset: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: var(--s-3); top: -6rem; z-index: 20;
  padding: var(--s-3) var(--s-4); background: var(--paper); color: var(--ink);
  font-family: var(--font-sans); font-size: var(--text-base);
}
.skip:focus { top: var(--s-3); }

.noscript { padding: var(--s-5) var(--gutter); text-align: center; font-family: var(--font-sans); font-size: var(--text-base); }

/* textures */
.grain, .paper { position: relative; isolation: isolate; }
.grain::before, .paper::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: url("/assets/img/grain.png"); background-size: 320px 320px;
}
.wood {
  background-color: var(--oak);
  background-image:
    repeating-linear-gradient(90deg, var(--grain-dark) 0 1px, transparent 1px 9px),
    repeating-linear-gradient(90deg, var(--grain-light) 0 2px, transparent 2px 23px);
}

.hand { font-family: var(--font-hand); font-size: var(--text-hand); line-height: 1; color: var(--ink-soft); }
.script { font-family: var(--font-script); font-size: var(--text-script); line-height: 1; color: var(--oak-ink); }

/* ==========================================================================
   Controls
   ========================================================================== */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--touch); padding: var(--s-2) var(--s-5);
  border: var(--border); border-radius: var(--radius);
  background: var(--paper-bright); color: var(--ink);
  font-family: var(--font-sans); font-size: var(--text-sm); font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase; text-decoration: none; text-align: center;
  cursor: pointer;
}
.btn:hover { color: var(--ink); filter: brightness(0.96); }
.btn--accent { background: var(--mustard); }
.btn--ink { background: var(--ink); color: var(--paper); }
.btn--ink:hover { color: var(--paper); filter: brightness(1.25); }
.btn--quiet { border-color: transparent; background: transparent; text-decoration: underline; text-underline-offset: 4px; letter-spacing: 0.08em; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.6; cursor: progress; }

.linkbtn {
  min-height: var(--touch); padding: var(--s-2) 0; border: 0; background: none; color: var(--ink-soft);
  font-family: var(--font-sans); font-size: var(--text-base); text-decoration: underline; text-underline-offset: 4px; cursor: pointer;
  text-align: left;
}
.linkbtn:hover { color: var(--oak-ink); }

.field { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.label, .facts dt, legend.label {
  font-family: var(--font-sans); font-size: var(--text-xs); font-weight: 500;
  letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--ink-mute);
}
.help { font-family: var(--font-sans); font-size: var(--text-sm); color: var(--ink-mute); }

.input, .textarea, .select {
  width: 100%; min-height: 3rem; padding: var(--s-2) var(--s-3);
  border: var(--border); border-radius: var(--radius);
  background: var(--paper-bright); color: var(--ink);
  font-family: var(--font-sans); font-size: var(--text-base); /* ≥16px: no iOS zoom */
}
.textarea { resize: vertical; min-height: 5.5rem; line-height: 1.45; }
.input[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--error); box-shadow: 0 0 0 1px var(--error); }

.error {
  font-family: var(--font-sans); font-size: var(--text-sm); font-weight: 500; color: var(--error);
}
.error--box { padding: var(--s-3) var(--s-4); border: 1.5px solid var(--error); border-radius: var(--radius); background: var(--error-bg); }

/* Two-option answer: real radios, drawn as a pair of buttons. */
.seg { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.seg__opt { flex: 1 1 8.5rem; position: relative; }
.seg__opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg__opt span {
  display: flex; align-items: center; justify-content: center; min-height: 3rem; padding: var(--s-2) var(--s-3);
  border: var(--border); border-radius: var(--radius); background: var(--paper-bright);
  font-family: var(--font-sans); font-size: var(--text-base); font-weight: 500;
}
.seg__opt input:checked + span { background: var(--ink); color: var(--paper); }
.seg__opt input:focus-visible + span { outline: var(--focus); outline-offset: 2px; }
.seg__opt input:disabled { cursor: default; }
.seg__opt input:disabled + span { opacity: 0.75; }

/* ==========================================================================
   The fold: olive band, hero card, booth, and the way in
   ========================================================================== */

.fold { display: flex; flex-direction: column; }
.is-locked .fold { min-height: 100svh; }

.band {
  display: flex; flex-direction: column; align-items: center;
  padding: 0 var(--gutter) var(--s-4);
  background: radial-gradient(ellipse at 50% 30%, var(--olive) 0%, var(--olive-dark) 78%);
  border-bottom: 8px solid var(--oak);
}
.band__bar {
  width: calc(100% + 2 * var(--gutter)); margin: 0 calc(-1 * var(--gutter)) var(--s-4);
  padding: var(--s-2) var(--gutter);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-1) var(--s-5);
  background: var(--olive-dark); color: var(--paper);   /* cream on olive-dark: 6.3:1 */
  font-family: var(--font-sans); font-size: var(--text-xs); font-weight: 500;
  letter-spacing: var(--track-caps); text-transform: uppercase;
}

.hero {
  width: 100%; max-width: 48.75rem;
  display: flex; align-items: center; justify-content: center; gap: var(--s-4);
  padding: var(--s-4) var(--s-5);
  background: var(--paper); box-shadow: var(--shadow-hero);
  outline: 1px solid var(--rule); outline-offset: -10px;
  transform: rotate(-1deg);
}
.hero__text { min-width: 0; display: flex; flex-direction: column; gap: var(--s-2); text-align: left; align-items: flex-start; }
/* The hooked strip. On a phone (and a short laptop window) it is as tall as
   the text beside it, so it never adds height to the card and never pushes
   the password field below the fold. booth.js measures the text and sets
   --hero-strip-w; the value here is the no-JS estimate. The whole strip
   shows. Wider screens give it a fixed, larger size below. */
.hero__strip {
  flex: 0 0 min(var(--hero-strip-w, 2.75rem), 16vw); align-self: center; aspect-ratio: var(--hero-strip-ratio);
  transform: rotate(-2deg);
}
.hero__strip img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero__names {
  font-family: var(--font-display); font-weight: 400; font-size: var(--text-names);
  letter-spacing: 0.1em; line-height: 1.02; overflow-wrap: anywhere;
  display: flex; flex-direction: column; align-items: inherit;
}
.hero__names .amp { font-family: var(--font-script); color: var(--oak-ink); letter-spacing: 0; font-size: 0.8em; line-height: 0.9; transform: rotate(-4deg); }
.hero__names.is-placeholder { font-size: clamp(1.25rem, 0.6rem + 4.2vw, 2.75rem); letter-spacing: 0.06em; }
.hero__kicker { font-family: var(--font-sans); font-size: var(--text-sm); font-weight: 500; letter-spacing: var(--track-wide); text-transform: uppercase; }
.hero__facts {
  display: flex; flex-direction: column; gap: 2px;
  font-family: var(--font-sans); font-size: var(--text-xs); font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-soft);
}
.hero__date { font-size: var(--text-sm); color: var(--ink); }

/* strips with the folded corner */
.strip { position: relative; box-shadow: var(--shadow-strip); }
.strip img { width: 100%; height: auto; }
.strip::after {
  content: ""; position: absolute; top: 0; right: 0; width: min(26px, 30%); aspect-ratio: 1;
  background: var(--paper); clip-path: polygon(0 0, 100% 0, 100% 100%);
}

.stage {
  flex: 1 1 auto;
  display: flex; flex-direction: column; align-items: center;
  padding: var(--s-4) var(--gutter) var(--s-3);
  /* cream panelled wall */
  background-image: repeating-linear-gradient(90deg, transparent 0 159px, var(--line-soft) 159px 161px);
}
.stage__intro { display: none; flex-direction: column; align-items: center; gap: var(--s-3); padding: var(--s-6) 0 var(--s-6); text-align: center; }
.stage__blurb { font-style: italic; font-size: var(--text-lg); color: var(--ink-soft); max-width: 35rem; }
.is-open .stage__intro { display: flex; }

/* ---- the booth ---- */
.booth {
  --h: var(--booth-h-locked);
  height: var(--h);
  width: min(100%, calc(var(--h) * var(--booth-ratio)), var(--booth-max-w));
  flex: 0 0 auto;
  display: flex; flex-direction: column;
  container-type: size;
  --key: clamp(1.125rem, 11cqh, var(--key-size));
  --pad: clamp(4px, 2.4cqh, 10px);
}

.booth__shell {
  flex: 1 1 auto; min-height: 0; display: flex; gap: var(--pad); padding: var(--pad);
  background: var(--booth-frame); border: 3px solid var(--booth-frame-dark); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-booth), inset 0 0 0 2px var(--booth-frame-light);
}
.booth__left { flex: 0 0 clamp(4.5rem, 34%, 13.5rem); min-width: 0; display: flex; flex-direction: column; gap: var(--pad); }

.booth__sign {
  flex: 1 1 auto; min-height: 0; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: clamp(4px, 3cqh, 20px) clamp(6px, 2.5cqw, 18px);
  background: var(--sign); border: 2px solid var(--sign-edge);
}
.booth__bolt { position: absolute; right: 8%; top: 5%; z-index: 1; width: clamp(10px, 5.5cqh, 22px); height: auto; }
.booth__bolt path { fill: var(--mustard); stroke: var(--oak-dark); stroke-width: 0.8; stroke-linejoin: round; }
.booth__letters {
  display: flex; flex-direction: column; gap: 0.08em;
  font-family: var(--font-serif); font-size: clamp(0.6875rem, 4.5cqh, 2.6rem); line-height: 1.02; color: var(--oak-ink);
}
.booth__signsub { display: none; font-family: var(--font-sans); font-size: 0.625rem; letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--oak-ink); }
.booth__panelstrip { display: none; position: absolute; right: 12%; top: 7%; bottom: 6%; width: 50%; transform: rotate(2.5deg); justify-content: flex-end; }
.booth__panelstrip img { height: 100%; width: auto; max-width: 100%; object-fit: cover; border: 3px solid var(--paper-bright); box-shadow: var(--shadow-photo); }
.booth__panelstrip::before { content: ""; position: absolute; top: -9px; right: 10%; width: 44px; height: 16px; background: var(--tape); transform: rotate(-6deg); z-index: 1; }

.booth__keys {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: var(--pad);
  padding: var(--pad); border: 2px solid var(--oak-dark);
}
.booth__keygrid { display: grid; grid-template-columns: repeat(2, var(--key)); gap: clamp(4px, 2.4cqh, 12px); }
.key {
  width: var(--key); height: var(--key); padding: 0;
  border: 3px solid var(--paper); background: var(--black); color: var(--paper);
  font-family: var(--font-sans); font-size: clamp(0.5rem, 3.4cqh, 0.8125rem); font-weight: 500;
  box-shadow: var(--shadow-key); cursor: pointer;
}
.key { display: flex; align-items: center; justify-content: center; }
.key__label { display: none; }
.key:disabled { cursor: default; }

/* Unlocked: every key carries its section's title beside the number. */
.is-open .booth__keygrid { grid-template-columns: 1fr 1fr; width: 100%; gap: 6px; }
.is-open .key {
  width: 100%; height: auto; min-height: 2.375rem; padding: 2px var(--s-2);
  justify-content: flex-start; gap: var(--s-2); text-align: left; border-width: 2px;
}
.is-open .key__n { flex: 0 0 auto; font-size: 0.8125rem; }
.is-open .key__label {
  display: block; min-width: 0; font-size: 0.625rem; font-weight: 500; line-height: 1.15;
  letter-spacing: 0.08em; text-transform: uppercase; overflow-wrap: anywhere;
}
.key[aria-current="true"] { border-color: var(--mustard); }
.key:focus-visible { outline: var(--focus-on-dark); }
.booth__keyslabel { display: none; font-family: var(--font-sans); font-size: 0.5625rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--paper); text-align: center; }
.booth__slot { width: 70%; height: clamp(3px, 1.6cqh, 8px); background: var(--black); border-radius: 4px; }

.booth__right { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.booth__header { flex: 0 0 clamp(8px, 4cqh, 18px); background: var(--black); border-bottom: 3px solid var(--black-soft); }
.booth__cabin { position: relative; flex: 1 1 auto; min-height: 0; background: var(--cabin); overflow: hidden; }
.booth__rail { position: absolute; left: 0; right: 0; top: 6px; height: 4px; background: var(--booth-frame); z-index: 3; }
.booth__stool { position: absolute; left: 12%; bottom: 8%; width: 76%; height: auto; max-height: 40%; }
.stool-cushion { fill: var(--olive); stroke: var(--olive-dark); stroke-width: 2; }
.stool-tuft { fill: none; stroke: var(--olive-dark); stroke-width: 1.5; }
.stool-seat { fill: var(--oak); stroke: var(--oak-dark); stroke-width: 2; }
.stool-edge { fill: var(--oak-dark); }
.booth__floor {
  position: absolute; left: 0; right: 0; bottom: 0; height: 11%;
  background-color: var(--cream);
  background-image: repeating-conic-gradient(var(--black) 0% 25%, transparent 0% 50%); background-size: 24px 24px;
}
.booth__base { flex: 0 0 clamp(14px, 12cqh, 62px); margin-top: var(--pad); border: 2px solid var(--oak-dark); }
.booth__feet { flex: 0 0 auto; display: flex; justify-content: space-between; padding: 0 18px; }
.booth__feet span { width: 14px; height: 10px; background: var(--black-soft); border-radius: 0 0 50% 50%; }

.drape {
  position: absolute; top: 10px; bottom: 0; width: 51%; z-index: 2;
  background: repeating-linear-gradient(90deg, var(--olive) 0, var(--olive-shade) 9px, var(--olive-light) 16px, var(--olive) 24px);
  box-shadow: var(--shadow-drape);
  transition: transform var(--curtain-ms) var(--ease-curtain);
}
.drape--l { left: 0; border-radius: 0 0 40% 0 / 0 0 8% 0; }
.drape--r { right: 0; border-radius: 0 0 0 40% / 0 0 0 8%; }
.is-curtain-open .drape--l { transform: translateX(-80%); }
.is-curtain-open .drape--r { transform: translateX(80%); }

.booth__flash { position: absolute; inset: 0; z-index: 4; background: var(--flash); opacity: 0; pointer-events: none; }
.booth__flash.is-firing { animation: blinkOut var(--flash-ms) ease-out both; }
@keyframes blinkOut { 0% { opacity: 0; } 8% { opacity: 1; } 28% { opacity: 0; } 52% { opacity: 1; } 100% { opacity: 0; } }

/* the oak floor the booth stands on */
.stage__floor { align-self: stretch; height: 12px; margin: 0 calc(-1 * var(--gutter)); border-top: 2px solid var(--oak-dark); }

/* A very short booth (phone, locked): the sign reads across instead of down */
@container (max-height: 279px) {
  .booth__sign { justify-content: flex-end; }
  .booth__letters { flex-direction: row; gap: 0.14em; font-size: clamp(0.5625rem, 5.4cqw, 1rem); }
  .booth__bolt { top: 12%; }
}

/* A narrow booth (phone, unlocked): the sign column is slim, so drop the small print */
@container (max-width: 519px) {
  .booth__sign { justify-content: flex-end; }
  .booth__letters { flex-direction: row; gap: 0.14em; font-size: clamp(0.5625rem, 5.4cqw, 1.125rem); }
  .booth__signsub, .booth__panelstrip, .booth__keyslabel { display: none !important; }
}

/* A wide booth */
@container (min-width: 520px) {
  .booth__bolt { right: 44%; }   /* clear of the taped strip */
  .is-open .booth__keygrid { gap: var(--s-2); }
  .is-open .key { min-height: var(--key-size); }
  .is-open .booth__signsub, .is-open .booth__keyslabel { display: block; }
  .is-open .booth__panelstrip { display: flex; }
}

/* Roomier booth furniture once there's height for it */
@container (min-height: 280px) {
  .booth__signsub, .booth__keyslabel { display: block; }
  .booth__panelstrip { display: flex; }
}

/* ---- the booth, unlocked ----
   It grows as tall as it needs to: the chosen card prints INSIDE the cabin,
   above the chair. Height is automatic, so nothing here may use the
   height-based (cqh) sizes the locked booth relies on. */
.booth__print { position: relative; z-index: 3; }   /* in front of the curtains */
.is-locked .booth__print { display: none; }

.is-open .booth {
  height: auto; width: min(100%, var(--booth-max-w));
  container-type: inline-size; --pad: 10px;
}
.is-open .booth__left { flex-basis: clamp(8.5rem, 36%, 16rem); }
.is-open .booth__sign { flex: 0 0 var(--sign-h-open); padding: 18px 16px; }
.is-open .booth__bolt { width: 22px; }
.is-open .booth__letters { font-size: 1.625rem; }
.is-open .booth__keys { flex: 1 1 auto; justify-content: flex-start; }   /* oak panel runs to the floor */
.is-open .booth__slot { height: 8px; }
.is-open .booth__header { flex-basis: 18px; }
.is-open .booth__base { flex-basis: 48px; }
.is-open .booth__cabin { --cabin-pad: 24px; display: flex; flex-direction: column; min-height: 22rem; padding: 26px var(--cabin-pad) 0; }   /* side padding lets the curtains show beside the card */
.is-open .booth__print { flex: 1 0 auto; margin-bottom: var(--s-5); }
.is-open .booth__stool {
  position: relative; left: auto; bottom: auto; z-index: 1; align-self: center;
  flex: 0 0 auto; width: min(76%, 20rem); max-height: none; margin-bottom: -14px;
}
.is-open .booth__floor { position: relative; flex: 0 0 48px; height: 48px; margin: 0 calc(-1 * var(--cabin-pad)); }

/* the printed card is narrow: words first, strip after, the whole strip shown */
.booth__print .card { padding: var(--s-5) var(--s-4); box-shadow: var(--shadow-photo); }
.booth__print .card__row { flex-direction: column; align-items: stretch; gap: var(--s-4); }
.booth__print .card__body { flex: 0 0 auto; }
.booth__print .card h2:focus { outline: none; }
.booth__print .taped { order: 2; align-self: center; width: 7rem; }
.booth__print .taped img { max-height: var(--strip-max-h-booth); }
.booth__print .facts { grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); }

/* A narrow booth, unlocked (phone): sign and keys across the top, cabin below */
@container (max-width: 519px) {
  .is-open .booth__shell { flex-direction: column; }
  .is-open .booth__left { flex-basis: auto; }
  .is-open .booth__sign { flex-basis: auto; padding: 10px 14px; }
  .is-open .booth__letters { font-size: 1.125rem; }
  .is-open .booth__bolt { width: 13px; top: 50%; right: 14px; transform: translateY(-50%); }
  .is-open .booth__keys { flex: 0 0 auto; }
  .is-open .booth__cabin { --cabin-pad: 10px; }
}

.status {
  min-height: 1.5em; padding-top: var(--s-3);
  font-family: var(--font-sans); font-size: var(--text-xs); font-weight: 500;
  letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--ink-soft);
}
.is-locked .status:empty { display: none; }

/* ---- the gate ---- */
.gate { width: 100%; max-width: 30rem; display: flex; flex-direction: column; align-items: center; gap: var(--s-2); padding-top: var(--s-3); text-align: center; }
.gate__form { width: 100%; display: flex; gap: var(--s-2); }
.gate__form .input { flex: 1 1 8rem; min-width: 0; text-align: center; }
.gate__form .btn { flex: 0 0 auto; letter-spacing: 0.1em; padding-inline: var(--s-4); }
.gate__links {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0 var(--s-5);
  font-family: var(--font-sans); font-size: var(--text-sm);
}
.gate__links a, .gate__links .link-pending { display: inline-flex; align-items: center; min-height: var(--touch); }
.link-pending { color: var(--ink-soft); }

.opened { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-3); padding-top: var(--s-4); }

/* Phones, locked: the hero card already says everything the top bar does */
@media (max-width: 39.99rem) {
  /* the strip shares the card with the text, so the text sets a little tighter */
  .hero { padding: var(--s-4); gap: var(--s-3); }
  .hero__names { font-size: var(--text-names-phone); }
  .hero__kicker { letter-spacing: 0.14em; }
  .hero__facts { letter-spacing: 0.08em; }
  .hero__date { font-size: var(--text-xs); }
  .is-locked .band__bar { display: none; }
  .is-locked .band { padding-top: var(--s-4); }
  .gate__links { gap: 0 var(--s-4); }
}

@media (max-width: 22rem) {
  .gate__form { flex-wrap: wrap; }
  .gate__form .btn { flex: 1 1 100%; }
}

/* ---- wider screens: the hooked strip appears, text aligns left ---- */
@media (min-width: 40rem) {
  .hero { padding: var(--s-6) var(--s-7); }
  .hero { gap: var(--s-5) var(--s-7); }
  .hero__strip { flex: 0 0 8.5rem; }
  .hero__text { gap: var(--s-3); }
  .band { padding-bottom: var(--s-6); }
  :root { --booth-h-locked: clamp(11rem, calc(100svh - 34rem), 26rem); }
}
@media (min-width: 40rem) and (max-height: 50rem) {
  /* short laptop windows: shrink the hooked strip rather than lose the password field */
  .is-locked .hero { gap: var(--s-5); }
  .is-locked .hero__strip { flex: 0 0 var(--hero-strip-w, 2.75rem); }
  :root { --booth-h-locked: clamp(11rem, calc(100svh - 27rem), 26rem); }
}

/* ==========================================================================
   Printed cards (the sections)
   ========================================================================== */

.strips { display: flex; flex-direction: column; align-items: center; padding: var(--s-4) 0 0; }
.slot { width: 100%; max-width: var(--measure); padding: var(--s-4) var(--s-3) var(--s-6); }

.card {
  padding: var(--s-6) var(--s-5) var(--s-6);
  background: var(--paper); color: var(--ink);
  outline: 1px solid var(--rule); outline-offset: -10px;
  box-shadow: var(--shadow-card);
}
.card:focus { outline: 1px solid var(--rule); }
.card__label { padding-bottom: var(--s-4); font-family: var(--font-sans); font-size: var(--text-xs); font-weight: 500; letter-spacing: 0.24em; text-transform: uppercase; color: var(--oak-ink); }
.card__row { display: flex; flex-wrap: wrap; gap: var(--s-5) var(--s-7); align-items: flex-start; justify-content: center; }
.card__body { flex: 1 1 18rem; min-width: 0; display: flex; flex-direction: column; gap: var(--s-4); }
.card h2, .rsvp h3 { font-family: var(--font-serif); font-weight: 500; font-size: var(--text-h2); line-height: 1.08; }
.rsvp h3 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 1.875rem); }
.rsvp h3:focus { outline: none; }
.prose { color: var(--ink-soft); overflow-wrap: anywhere; }

.taped { position: relative; flex: 0 0 auto; width: 10rem; max-width: 100%; margin-top: var(--s-4); display: flex; flex-direction: column; align-items: center; gap: var(--s-2); transform: rotate(-2.2deg); }
.taped--narrow { width: 7.5rem; }
.taped:nth-of-type(1).taped--b, .taped--b { transform: rotate(1.8deg); }
.taped::before {
  content: ""; position: absolute; top: -12px; left: 50%; width: 74px; height: 24px; margin-left: -37px; z-index: 2;
  background: var(--tape); transform: rotate(-5deg);
  clip-path: polygon(3% 0%, 3% 18%, 6% 35%, 3% 52%, 3% 70%, 4% 86%, 1% 100%, 97% 100%, 98% 84%, 99% 66%, 95% 50%, 96% 33%, 95% 16%, 99% 0%);
}
.taped--b::before { background: var(--tape-b); transform: rotate(5deg); }
/* The whole strip, never cropped. A very tall strip is scaled down (narrower)
   until it fits on one screen rather than being cut off. */
.taped img { width: auto; max-width: 100%; height: auto; max-height: var(--strip-max-h); box-shadow: var(--shadow-photo); }
.taped figcaption { font-family: var(--font-hand); font-size: var(--text-hand); line-height: 1; color: var(--ink-soft); text-align: center; overflow-wrap: anywhere; }

@media (max-width: 34rem) {
  .card { padding: var(--s-6) var(--s-4); }
  /* On a phone the strip is garnish. Words first, strip after — nobody should
     have to scroll past a photo to reach the details or the RSVP form. */
  .card__row { flex-direction: column; align-items: stretch; }
  .card__body { flex: 0 0 auto; }
  .taped, .taped--narrow { order: 2; align-self: center; width: 6.5rem; }
  .taped figcaption { font-size: 1.25rem; }
  .welcome .welcome__photo { flex-basis: 5.5rem; margin-left: var(--s-2); }
}

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: var(--s-4) var(--s-4); }
.facts div { display: flex; flex-direction: column; gap: var(--s-1); min-width: 0; }
.facts dd { font-size: var(--text-prose); line-height: 1.4; overflow-wrap: anywhere; }

.faq { border-top: 1px solid var(--ink); }
.faq__item { border-bottom: 1px solid var(--ink); }
.faq__q {
  width: 100%; min-height: 3.5rem; display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  padding: var(--s-3) 0; border: 0; background: transparent; color: var(--ink);
  font-family: var(--font-sans); font-size: var(--text-base); font-weight: 600; text-align: left; cursor: pointer;
}
.faq__icon { font-size: 1.6rem; line-height: 1; color: var(--oak-ink); }
.faq__a { padding-bottom: var(--s-4); color: var(--ink-soft); }
.linklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.linklist a { display: inline-flex; align-items: center; min-height: var(--touch); }

/* The print animation — charm only. The card waits just above the cabin
   (.is-queued) while the page glides to the booth, then feeds down. booth.js
   removes both classes on any scroll, tap, or key. */
.print.is-queued { transform: translateY(-102%); }
.print.is-printing-card { animation: printDown var(--print-ms) steps(40, end) both; }
@keyframes printDown { from { transform: translateY(-102%); } to { transform: translateY(0); } }

/* ==========================================================================
   RSVP
   ========================================================================== */

.rsvp { display: flex; flex-direction: column; gap: var(--s-4); }
.rsvp__step { display: flex; flex-direction: column; gap: var(--s-4); }
.rsvp__note { font-family: var(--font-sans); font-size: var(--text-base); color: var(--ink-soft); }
.rsvp__row { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.rsvp__row > * { flex: 1 1 10rem; }
.rsvp__choices { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.rsvp__choices .btn { width: 100%; justify-content: flex-start; text-transform: none; letter-spacing: 0; font-size: var(--text-base); }
.rsvp__confirm { font-size: var(--text-lg); line-height: 1.4; }
.rsvp form { display: flex; flex-direction: column; gap: var(--s-5); }

.person { margin: 0; padding: var(--s-4); border: 1px solid var(--rule); border-radius: var(--radius-lg); background: var(--paper-bright); display: flex; flex-direction: column; gap: var(--s-3); min-width: 0; }
.person legend { padding: 0 var(--s-2); font-family: var(--font-serif); font-size: var(--text-lg); font-weight: 600; }

.panel { display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-5); border: var(--border); border-radius: var(--radius-lg); background: var(--paper-bright); }
.panel__big { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2rem); line-height: 1.15; }
.summary { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-1); font-family: var(--font-sans); font-size: var(--text-base); }
.summary li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 var(--s-4); padding: var(--s-2) 0; border-bottom: 1px solid var(--rule); }
.summary span:last-child { color: var(--ink-soft); }

/* §6.6 personal welcome. The photo frame only exists when there is a photo,
   and has a fixed aspect so nothing shifts when it loads. */
.welcome { display: flex; flex-wrap: wrap; gap: var(--s-5); align-items: flex-start; }
.welcome__photo { flex: 0 0 8.5rem; aspect-ratio: 9 / 28; padding: 6px; background: var(--paper-bright); box-shadow: var(--shadow-strip); transform: rotate(-2deg); }
.welcome__photo img { width: 100%; height: 100%; object-fit: cover; }
.welcome__text { flex: 1 1 14rem; min-width: 0; display: flex; flex-direction: column; gap: var(--s-3); }
.welcome__note { font-style: italic; font-size: var(--text-lg); line-height: 1.45; color: var(--ink-soft); white-space: pre-line; }

/* ==========================================================================
   Strip wall and footer
   ========================================================================== */

.wall { max-width: var(--measure-wide); margin: 0 auto; padding: var(--s-7) var(--gutter) 0; display: flex; flex-direction: column; align-items: center; gap: var(--s-3); text-align: center; }
.wall__kicker { font-family: var(--font-sans); font-size: var(--text-xs); font-weight: 500; letter-spacing: 0.3em; text-transform: uppercase; color: var(--oak-ink); }
.wall h2 { font-family: var(--font-display); font-weight: 400; font-size: var(--text-h2); letter-spacing: 0.08em; text-transform: uppercase; line-height: 1.1; }
.wall__blurb { font-style: italic; font-size: var(--text-lg); color: var(--ink-soft); max-width: 32rem; }
.wall__grid { display: flex; flex-wrap: wrap; gap: var(--s-6) var(--s-6); justify-content: center; align-items: flex-start; padding-top: var(--s-6); }
.wall__item { display: flex; flex-direction: column; align-items: center; gap: var(--s-3); width: 7rem; }
.wall__item:nth-child(odd) .strip { transform: rotate(-2deg); }
.wall__item:nth-child(even) .strip { transform: rotate(2deg); }
.wall__item figcaption { font-family: var(--font-sans); font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft); overflow-wrap: anywhere; }
.wall__cta { padding-top: var(--s-6); }

.footer { padding: var(--s-7) var(--gutter) var(--s-7); text-align: center; font-family: var(--font-sans); font-size: var(--text-xs); font-weight: 500; letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--ink-soft); overflow-wrap: anywhere; }

/* ==========================================================================
   /address page
   ========================================================================== */

.page { min-height: 100svh; display: flex; flex-direction: column; }
.page .band { padding-bottom: 0; border-bottom-width: 8px; }
.page .band__bar { margin-bottom: 0; }
.page__main { flex: 1 1 auto; width: 100%; max-width: 36rem; margin: 0 auto; padding: var(--s-5) var(--s-3) var(--s-7); }
.page__main .card { display: flex; flex-direction: column; gap: var(--s-4); }
.page__main h1 { font-family: var(--font-serif); font-weight: 500; font-size: var(--text-h2); line-height: 1.08; }
.page__main h1:focus { outline: none; }
.form { display: flex; flex-direction: column; gap: var(--s-4); }
.form__pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: var(--s-4) var(--s-3); }

/* ==========================================================================
   Admin
   ========================================================================== */

.admin { font-family: var(--font-sans); font-size: 1rem; line-height: 1.45; background: var(--cream); }
.admin__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-3) var(--gutter); background: var(--olive-dark); color: var(--paper); }
.admin__top h1 { font-family: var(--font-sans); font-size: var(--text-sm); font-weight: 500; letter-spacing: var(--track-caps); text-transform: uppercase; }
.admin__top .btn { min-height: 2.25rem; }
.admin__tabs { display: flex; flex-wrap: wrap; gap: var(--s-1); padding: var(--s-3) var(--gutter) 0; border-bottom: 1.5px solid var(--ink); }
.admin__tab { min-height: var(--touch); padding: var(--s-2) var(--s-4); border: var(--border); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; background: var(--paper); color: var(--ink); font: inherit; font-weight: 500; cursor: pointer; }
.admin__tab[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.admin__panel { max-width: 70rem; margin: 0 auto; padding: var(--s-5) var(--gutter) var(--s-8); display: flex; flex-direction: column; gap: var(--s-5); }
.admin__panel:focus { outline: none; }
.admin h2 { font-family: var(--font-serif); font-size: 1.75rem; font-weight: 500; line-height: 1.1; }
.admin h3 { font-family: var(--font-sans); font-size: var(--text-xs); font-weight: 600; letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--ink-mute); }
.admin__login { max-width: 24rem; margin: var(--s-8) auto; padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-4); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: var(--s-3); }
.tile { padding: var(--s-4); background: var(--paper-bright); border: 1px solid var(--rule); border-radius: var(--radius-lg); display: flex; flex-direction: column; gap: var(--s-1); }
.tile__n { font-family: var(--font-serif); font-size: 2.5rem; line-height: 1; font-weight: 600; }
.tile__l { font-size: var(--text-xs); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-mute); }
button.tile { font: inherit; color: inherit; text-align: left; cursor: pointer; }
button.tile:hover { border-color: var(--oak-ink); }
.tile__go { margin-top: var(--s-1); font-size: var(--text-sm); color: var(--ink-soft); text-decoration: underline; text-underline-offset: 4px; }
.linkbtn--danger:hover { color: var(--error); }
.tablewrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius-lg); background: var(--paper-bright); }
.table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.table th, .table td { padding: var(--s-2) var(--s-3); text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
.table th { font-size: var(--text-xs); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-mute); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.tag { display: inline-block; padding: 1px var(--s-2); border-radius: 999px; border: 1px solid currentColor; font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
.tag--yes { color: var(--ok); }
.tag--no { color: var(--error); }
.tag--wait { color: var(--oak-ink); }
.admin .panel { border-width: 1px; border-color: var(--rule); }
.admin .btn { letter-spacing: 0.08em; }
.admin__actions { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.admin__note { color: var(--ink-mute); font-size: var(--text-sm); }
.admin__ok { color: var(--ok); font-weight: 500; }
.editor { display: flex; flex-direction: column; gap: var(--s-4); }
.editor__members { display: flex; flex-direction: column; gap: var(--s-2); }
.editor__member { display: grid; grid-template-columns: minmax(8rem, 2fr) minmax(7rem, 1fr) minmax(8rem, 1.4fr) auto; gap: var(--s-2); align-items: end; }
.addrow { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: var(--s-3); align-items: center; }
.addrow label { display: inline-flex; align-items: center; gap: var(--s-1); min-height: var(--touch); white-space: nowrap; }
/* Site content editor (admin) */
.copy__bar { position: sticky; top: 0; z-index: 2; padding: var(--s-2) 0; background: var(--cream); }
.copy__rows { display: flex; flex-direction: column; gap: var(--s-3); }
.copy__link { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: var(--s-2); align-items: center; }
.copy__faq { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-2); padding-bottom: var(--s-3); border-bottom: 1px solid var(--rule); }
.copy__set { display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-4); border: 1px solid var(--rule); border-radius: var(--radius-lg); min-width: 0; }
.copy__group { border-top: 1px solid var(--rule); padding: var(--s-3) 0; }
.copy__group > summary { cursor: pointer; min-height: var(--touch); display: flex; align-items: center; gap: var(--s-2); font-weight: 600; }
.copy__group[open] > summary { margin-bottom: var(--s-3); }
.copy__field { margin-bottom: var(--s-4); }
.copy__field[hidden], .copy__group[hidden] { display: none; }
.copy__was { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 34rem) { .copy__link { grid-template-columns: 1fr; } }
@media (max-width: 34rem) { .editor__member { grid-template-columns: 1fr; padding-bottom: var(--s-3); border-bottom: 1px solid var(--rule); } }

/* ==========================================================================
   Mock-mode dev bar (never rendered when dataMode is "live")
   ========================================================================== */

.devbar { position: fixed; left: var(--s-2); bottom: var(--s-2); z-index: 50; max-width: calc(100vw - 1rem); font-family: var(--font-sans); font-size: 0.8125rem; }
.devbar summary { display: inline-flex; align-items: center; min-height: 2rem; padding: 0 var(--s-3); border-radius: 999px; background: var(--ink); color: var(--paper); cursor: pointer; list-style: none; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.6875rem; }
.devbar summary::-webkit-details-marker { display: none; }
.devbar summary:focus-visible { outline: var(--focus-on-dark); outline-offset: -5px; }
.devbar__body { margin-top: var(--s-1); padding: var(--s-3); display: flex; flex-direction: column; gap: var(--s-2); background: var(--ink); color: var(--paper); border-radius: var(--radius-lg); }
.devbar__body label { display: flex; align-items: center; gap: var(--s-2); min-height: 1.75rem; }
.devbar__body button { min-height: 2rem; border: 1px solid var(--paper); border-radius: var(--radius); background: transparent; color: var(--paper); font: inherit; cursor: pointer; }
.devbar__body button:focus-visible, .devbar__body input:focus-visible { outline: var(--focus-on-dark); }
.devbar code { font-size: 0.875rem; color: var(--mustard); }

/* ==========================================================================
   Reduced motion: no curtain travel, no flash, no printing, no smooth scroll
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .drape { transition: none; }
  .booth__flash.is-firing { animation: none; opacity: 0; }
  .print.is-queued { transform: none; }
  .print.is-printing-card { animation: none; }
}

@media print {
  .band, .booth, .gate, .opened, .devbar, .stage__floor { display: none !important; }
}
