/* Kelvin & Cindy · the cube */

@font-face {
  font-family: 'Bodoni Moda';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('../fonts/bodoni-moda.woff2') format('woff2');
}
@font-face {
  font-family: 'Bodoni Moda';
  font-style: italic;
  font-weight: 400 900;
  font-display: swap;
  src: url('../fonts/bodoni-moda-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Josefin Sans';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/josefin-sans.woff2') format('woff2');
}

@font-face { font-family: 'Spirequal Light'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/spirequal-light.ttf') format('truetype'); }
@font-face { font-family: 'Roue Stand-in'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/roue-standin.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('../fonts/montserrat.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/montserrat-semibold.woff2') format('woff2'); }
@font-face { font-family: 'Pinyon Script'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/pinyon-script.woff2') format('woff2'); }
/* Kelvin's original reference faces. Once licensed, add files and uncomment. To replace
   Spirequal Light with La Roue, also change the display role in themes.js and :root below.
@font-face { font-family: 'La Roue'; font-weight: 400; font-display: swap; src: url('../fonts/la-roue.woff2') format('woff2'); }
@font-face { font-family: 'Eleven Eleven'; font-weight: 500; font-display: swap; src: url('../fonts/eleven-eleven.woff2') format('woff2'); }
@font-face { font-family: 'Altesse Std'; font-weight: 400; font-display: swap; src: url('../fonts/altesse-std.woff2') format('woff2'); }
*/
/* candidates for the lettering: only the faces a chosen pairing uses are ever downloaded */
@font-face { font-family: 'Libre Caslon Display'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/libre-caslon-display.woff2') format('woff2'); }
@font-face { font-family: 'Libre Caslon Text'; font-style: italic; font-weight: 400; font-display: swap; src: url('../fonts/libre-caslon-text-italic-400.woff2') format('woff2'); }
@font-face { font-family: 'Libre Caslon Text'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/libre-caslon-text-400.woff2') format('woff2'); }
@font-face { font-family: 'Libre Caslon Text'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/libre-caslon-text-700.woff2') format('woff2'); }
@font-face { font-family: 'Marcellus'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/marcellus.woff2') format('woff2'); }
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 300 900; font-display: swap; src: url('../fonts/figtree.woff2') format('woff2'); }
@font-face { font-family: 'Gloock'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/gloock.woff2') format('woff2'); }
@font-face { font-family: 'Hanken Grotesk'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('../fonts/hanken-grotesk.woff2') format('woff2'); }
@font-face { font-family: 'Young Serif'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/young-serif.woff2') format('woff2'); }
@font-face { font-family: 'Karla'; font-style: normal; font-weight: 200 800; font-display: swap; src: url('../fonts/karla.woff2') format('woff2'); }
@font-face { font-family: 'Literata'; font-style: italic; font-weight: 200 900; font-display: swap; src: url('../fonts/literata-italic.woff2') format('woff2'); }
@font-face { font-family: 'Literata'; font-style: normal; font-weight: 200 900; font-display: swap; src: url('../fonts/literata.woff2') format('woff2'); }

:root {
  /* Match the ivory linen room before JavaScript paints it. */
  --ground: #D7CAB9;
  --fg: #2A1416;
  --fg-soft: #4B3739;
  --fg-faint: #6B5759;
  --metal: #6E2A2F;
  --metal-line: rgba(110, 42, 47, 0.42);
  --btn-core: #FBF8F2;
  --btn-core-label: #2A1416;
  --btn-primary: #3E0507;
  --btn-primary-lift: #5B090B;
  --btn-primary-label: #F6F1EA;
  --sheen: rgba(255, 214, 204, 0.11);
  --btn-shadow: rgba(40, 0, 6, 0.22);

  /* the lettering roles: also set from js/themes.js */
  --display: 'Spirequal Light', 'Roue Stand-in', Georgia, serif;
  --display-weight: 400;
  --display-case: uppercase;
  --voice: 'Spirequal Light', 'Roue Stand-in', Georgia, serif;
  --voice-weight: 400;
  --voice-style: normal;
  --script: 'Altesse Std', 'Pinyon Script', Georgia, serif;
  --script-weight: 400;
  --script-style: normal;
  --script-scale: 1.32;
  --text: 'Spirequal Light', 'Roue Stand-in', Georgia, serif;
  --text-weight: 400;
  --caps: 'Eleven Eleven', 'Montserrat', system-ui, sans-serif;
  --caps-weight: 600;
  --btn-font: var(--display);
  --btn-weight: 400;
  --btn-style: normal;
  --btn-case: uppercase;
  --btn-track: 0.1em;
  --btn-size: 19px;

  --wine: #3E0507;
  --wine-lit: #5B090B;
  --card: #FBF8F3;
  --card-ink: #2A1214;
  --card-mute: #7A6466;
  --card-line: #DCD1CC;

  --paper: cubic-bezier(.22, .8, .24, 1);
  --gutter: max(16px, env(safe-area-inset-left));
  --safe-top: max(14px, env(safe-area-inset-top));
  --safe-bottom: max(16px, env(safe-area-inset-bottom));

  color-scheme: dark;
}
:root[data-light="false"] { color-scheme: dark; }
:root[data-light="true"] { color-scheme: light; --btn-shadow: rgba(60, 40, 30, 0.22); }

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

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--ground);
  color: var(--fg);
  font-family: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

/* A real paper surface with broad photographic light, visible through the 3D canvas. */
:root[data-studio="true"] body,
:root[data-studio="true"] .loader {
  background-image:
    linear-gradient(to bottom, rgba(24, 0, 3, .40) 0%, rgba(24, 0, 3, .33) 30%, rgba(24, 0, 3, .24) 65%),
    url('../assets/materials/red-studio-backdrop-v2.webp');
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
}

::selection { background: var(--wine-lit); color: var(--card); }

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

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

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

#scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  display: block;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

/* ---------- the overlay ---------- */

.ui {
  position: fixed;
  inset: 0;
  height: 100dvh;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}
.ui button, .ui a, .ui .caption { pointer-events: auto; }

.bar {
  position: absolute;
  top: var(--safe-top);
  left: var(--gutter);
  right: var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 3;
  max-width: 680px;
  margin-inline: auto;
}
.bar__actions { display: flex; align-items: center; gap: 2px; }
.bar__rsvp { min-height: 44px; padding: 0 12px; border: 0; background: none; color: var(--fg); font-family: var(--caps); font-weight: var(--caps-weight); font-size: 11px; letter-spacing: .12em; }
.bar__rsvp[hidden] { display: none; }
.gesture-note { margin: 8px 0 0; font-size: 15px; line-height: 1.4; color: var(--fg-faint); }

/* the couple's monogram, Kelvin's own (2026-10-10), cut from its paper so the linen shows through */
.mark { display: block; width: auto; height: 46px; user-select: none; -webkit-user-drag: none; }
.mark--large { height: 112px; animation: mark-in 1s var(--paper) both; }
@keyframes mark-in { from { opacity: 0; transform: scale(.97); } }

.icon-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--metal);
  padding: 0;
  transition: border-color .2s, color .2s, background-color .2s;
}
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn--sound .mute { display: none; }
.icon-btn--sound[aria-pressed="false"] .wave { display: none; }
.icon-btn--sound[aria-pressed="false"] .mute { display: inline; }
.icon-btn--sound[aria-pressed="false"] { color: var(--fg-faint); }
@media (hover: hover) {
  .icon-btn:hover { border-color: var(--metal-line); color: var(--fg); }
}

/* stages: one visible at a time, set by data-state */

.stage {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: calc(var(--safe-top) + 58px) var(--gutter) var(--safe-bottom);
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .5s var(--paper), visibility 0s linear .5s;
}
.stage__top, .stage__bottom { width: 100%; max-width: 460px; }
.stage button { pointer-events: none; }

.ui[data-state="box"] .boxed,
.ui[data-state="puzzle"] .puzzle,
.ui[data-state="solved"] .puzzle,
.ui[data-state="explore"] .explore {
  opacity: 1;
  visibility: visible;
  transition: opacity .6s var(--paper) .1s, visibility 0s;
}
/* while the cube comes down out of the case, the puzzle's words wait */
.ui[data-settling] .puzzle { opacity: 0; visibility: hidden; transition: opacity .3s, visibility 0s linear .3s; }
.ui[data-state="box"] .boxed button,
.ui[data-state="puzzle"] .puzzle button,
.ui[data-state="explore"] .explore button { pointer-events: auto; }

.greet {
  margin: 0;
  font-family: var(--script);
  font-style: var(--script-style);
  font-weight: var(--script-weight);
  font-size: calc(clamp(26px, 7.6vw, 36px) * var(--script-scale));
  line-height: 1.1;
  color: var(--fg);
  text-wrap: balance;
}
.greet--small { font-size: calc(clamp(19px, 5.2vw, 24px) * var(--script-scale)); color: var(--fg-soft); }
/* the address sits a little below the bar, not tucked under it */
.boxed .greet, .puzzle .greet { margin-top: 22px; }

.lede {
  margin: 8px 0 0;
  font-size: clamp(20px, 5.4vw, 23px);
  font-weight: var(--text-weight);
  line-height: 1.4;
  color: var(--fg-soft);
  text-wrap: balance;
}

.fine {
  margin: 12px 0 0;
  font-family: var(--caps);
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-faint);
}

/* title: the greeting settles in once the cube lands */
.boxed .stage__top, .boxed .stage__bottom {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .9s var(--paper), transform .9s var(--paper);
}
.boxed.is-in .stage__top, .boxed.is-in .stage__bottom { opacity: 1; transform: none; }
.boxed.is-in .stage__bottom { transition-delay: .4s; }

.lift {
  display: inline-grid;
  justify-items: center;
  gap: 6px;
  min-height: 56px;
  padding: 6px 20px;
  border: 0;
  background: none;
  color: var(--fg-soft);
  font-family: var(--caps);
  font-weight: var(--caps-weight);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.boxed .stage__bottom, .lift { touch-action: none; }
.lift svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.boxed.is-in .lift svg { animation: lift-cue 2.4s var(--paper) infinite 1.2s; }
@keyframes lift-cue {
  0%, 60%, 100% { transform: none; }
  25% { transform: translateY(-5px); }
}

/* ---------- buttons: lacquer tiles off the cube, each with the faces' notched Deco frame ---------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 30px;
  border: 0;
  border-radius: 10px;
  background:
    radial-gradient(140% 110% at 26% -12%, var(--sheen), transparent 58%),
    var(--btn-core);
  box-shadow: inset 0 1px 0 rgba(255, 226, 218, 0.15), inset 0 -2px 2px rgba(0, 0, 0, 0.35), 0 2px 5px var(--btn-shadow);
  color: var(--btn-core-label);
  text-decoration: none;
  font-family: var(--btn-font);
  font-style: var(--btn-style);
  font-weight: var(--btn-weight);
  font-size: var(--btn-size);
  letter-spacing: var(--btn-track);
  text-transform: var(--btn-case);
  transition: transform .12s, box-shadow .12s, background-color .2s;
}
.btn__label { display: inline-flex; align-items: center; gap: 12px; }
.btn__label::before, .btn__label::after {
  content: '';
  width: 4px;
  height: 4px;
  background: var(--diamond, var(--metal));
  transform: rotate(45deg);
  opacity: .8;
}
.btn:active {
  transform: translateY(1px);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.65), inset 0 -1px 0 rgba(255, 226, 218, 0.06), 0 1px 2px rgba(0, 0, 0, 0.5);
}
.btn--primary {
  --diamond: var(--btn-primary-diamond, #D4D5DA);
  background:
    radial-gradient(140% 110% at 26% -12%, rgba(255, 214, 204, 0.16), transparent 58%),
    var(--btn-primary);
  color: var(--btn-primary-label);
}
.btn--wide { width: min(100%, 300px); }
.btn--wide .btn__label { font-size: calc(var(--btn-size) + 2px); }
.btn[disabled] { opacity: .6; cursor: progress; }
@media (hover: hover) {
  .btn:not(.btn--primary):hover { background-color: color-mix(in srgb, var(--btn-core) 93%, var(--metal)); }
  .btn--primary:hover { background-color: var(--btn-primary-lift); }
}

.link-btn {
  margin: 14px auto 0;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  background: none;
  font-family: var(--caps);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--metal);
  text-decoration: underline;
  text-decoration-color: var(--metal-line);
  text-underline-offset: 6px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .6s var(--paper), transform .6s var(--paper);
}
.link-btn.is-offered, .link-btn:focus-visible { opacity: 1; transform: none; }

/* ---------- the puzzle ---------- */

.hint {
  margin: 0;
  min-height: 2.6em;
  font-family: var(--voice);
  font-style: var(--voice-style);
  font-weight: var(--voice-weight);
  font-size: clamp(21px, 5.8vw, 24px);
  line-height: 1.25;
  color: var(--fg);
  opacity: 0;
  transition: opacity .4s var(--paper);
  text-wrap: balance;
}
.hint.is-in { opacity: 1; }
.assist-turn { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 44px; padding: 0 18px; border: 1px solid var(--metal-line); border-radius: 10px; background: color-mix(in srgb, var(--btn-core) 78%, transparent); color: var(--fg); font-size: 18px; transition: background-color .2s, transform .15s; }
.assist-turn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.assist-turn:active { transform: translateY(1px); }
.assist-turn:disabled { opacity: .55; cursor: progress; }
.puzzle .link-btn { display: block; margin-top: 8px; font-size: 11px; letter-spacing: .08em; }
/* how many turns are left, read with the instruction it belongs to */
.puzzle__count { margin: 0 0 6px; }
@media (hover: hover) { .assist-turn:hover { background-color: var(--btn-core); } }

.finger {
  position: fixed;
  left: 0;
  top: 0;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--fg) 85%, transparent);
  background: radial-gradient(circle, color-mix(in srgb, var(--fg) 32%, transparent) 0 22%, color-mix(in srgb, var(--fg) 8%, transparent) 23% 100%);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  opacity: 0;
  z-index: 4;
  display: none;
}
.finger.is-on { display: block; }

/* which way to swipe for the next face: the lift arrow again, turned to point the way, over the cube */
.cue {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--fg-soft);
  font-size: 16px;
  letter-spacing: .02em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .45s var(--paper);
}
.cue.is-on { opacity: 1; }
.cue__arrow { display: grid; color: var(--metal); transition: transform .5s var(--paper); }
.cue svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.cue[data-way="left"] .cue__arrow { transform: rotate(-90deg); }
.cue[data-way="right"] .cue__arrow { transform: rotate(90deg); }
.cue[data-way="down"] .cue__arrow { transform: rotate(180deg); }
.cue.is-pointing svg { animation: lift-cue 2.4s var(--paper) 3 .5s; }

/* ---------- reading the faces ---------- */

.explore { justify-content: flex-end; padding-top: 0; }

/* every caption keeps the longest one's height (set from js): words from the top, the button at the
   foot, so text and buttons sit at one height on every face */
.caption {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 460px;
  max-height: calc(100dvh * 0.36);
  overflow-y: auto;
  scrollbar-width: none;
  padding: 0 4px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .5s var(--paper), transform .5s var(--paper);
}
.caption::-webkit-scrollbar { display: none; }
.caption.is-in { opacity: 1; transform: none; }
.caption.is-in.is-swapping { opacity: 0; transform: translateY(4px); transition-duration: .2s; }

.cap__title {
  margin: 0;
  font-family: var(--display);
  font-weight: var(--display-weight);
  text-transform: var(--display-case);
  font-size: clamp(26px, 7.2vw, 32px);
  line-height: 1.12;
  letter-spacing: -0.005em;
  color: var(--fg);
  text-wrap: balance;
}
/* the greeting beneath the names face, in the couple's script */
.cap__title--script {
  font-family: var(--script);
  font-style: var(--script-style);
  font-weight: var(--script-weight);
  text-transform: none;
  letter-spacing: 0;
  font-size: calc(clamp(24px, 6.4vw, 30px) * var(--script-scale));
  line-height: 1.15;
}
.cap__body p {
  margin: 8px auto 0;
  max-width: 42ch;
  font-size: clamp(19px, 5.1vw, 21px);
  font-weight: var(--text-weight);
  line-height: 1.3;
  letter-spacing: 0.005em;
  color: var(--fg-soft);
  text-wrap: pretty;
}
/* separate lines keep the rhythm of one wrapped paragraph: every caption reads at the same spacing */
.cap__body p + p { margin-top: 0; }
/* the place and dress code captions: small print */
.cap__body--fine p {
  max-width: none;
  text-wrap: balance;
  font-size: clamp(15.5px, 4.15vw, 17px);
  line-height: 1.12;
  letter-spacing: 0.015em;
}
.cap__actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
  padding-top: 16px;
}
.cap__actions[hidden] { display: none; }
/* "Directions" and its choice share one place: the two stack, and the tile crossfades between them */
.ways { display: grid; justify-items: center; }
.ways > * { grid-area: 1 / 1; transition: opacity .28s var(--paper), transform .28s var(--paper), visibility 0s; }
.ways__pick {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  padding: 0 12px;
  opacity: 0;
  visibility: hidden;
  transform: scale(.96);
  transition-delay: 0s, 0s, .28s;
}
.ways.is-open .ways__open { opacity: 0; visibility: hidden; transform: scale(.96); transition-delay: 0s, 0s, .28s; }
.ways.is-open .ways__pick { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.ways__to {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  margin: 11px 4px;
  padding: 0 18px;
  border-radius: 6px;
  color: inherit;
  text-decoration: none;
  position: relative;
  transition: background-color .15s, color .15s, opacity .35s var(--paper), transform .35s var(--paper);
}
/* each half is its own key: it darkens under the finger */
.ways__to:active { background: color-mix(in srgb, var(--metal) 13%, transparent); color: var(--metal); }
@media (hover: hover) { .ways__to:hover { background: color-mix(in srgb, var(--metal) 8%, transparent); color: var(--metal); } }
/* the words arrive one after the other, so the tile reads as two choices */
.ways:not(.is-open) .ways__to { opacity: 0; transform: translateY(3px); }
.ways.is-open .ways__to:last-child { transition-delay: 0s, 0s, .12s, .12s; }
/* the split: a ruled line down the middle with the buttons' diamond on it */
.ways__rule { position: relative; width: 1px; margin: 12px 0; background: color-mix(in srgb, var(--metal) 45%, transparent); }
.ways__rule::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 5px;
  background: var(--diamond, var(--metal));
  transform: translate(-50%, -50%) rotate(45deg);
}
.ways__to:focus-visible { outline: 2px solid var(--metal); outline-offset: -6px; border-radius: 6px; }

.dial {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 14px;
  width: min(100%, 460px);
  padding-top: 12px;
  border-top: 1px solid var(--metal-line);
}
#next.is-nudging svg { animation: nudge 1.6s var(--paper) 2; }
@keyframes nudge {
  0%, 100% { transform: none; }
  30% { transform: translateX(5px); }
  60% { transform: none; }
}
.pips { display: flex; flex: 1; }
.pip {
  flex: 1;
  min-width: 44px;
  height: 56px;
  border: 0;
  padding: 0;
  background: none;
  display: grid;
  grid-template-rows: 16px 20px;
  align-content: center;
  gap: 3px;
  place-items: center;
  color: var(--fg-faint);
  font-family: var(--text);
  font-size: 15px;
  letter-spacing: .02em;
  border-radius: 10px;
  transition: background-color .2s;
}
.pip[aria-current="true"] { color: var(--fg); background: color-mix(in srgb, var(--fg) 8%, transparent); }
@media (hover: hover) { .pip:hover { background: color-mix(in srgb, var(--fg) 6%, transparent); } }
@media (max-width: 400px) { .dial > .icon-btn { display: none; } }
@media (max-width: 360px) { .bar__rsvp { padding: 0 5px; } }
.pip::before {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 2.5px;
  background: color-mix(in srgb, var(--metal) 32%, transparent);
  transition: transform .35s var(--paper), background-color .35s, box-shadow .35s;
}
.pip[aria-current="true"]::before {
  background: var(--metal);
  box-shadow: 0 0 0 1px var(--metal);
  transform: scale(1.35);
}

/* ---------- the style switcher (?lab links only) ---------- */

.lab__toggle {
  position: fixed;
  top: calc(var(--safe-top) + 6px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 7;
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid var(--metal-line);
  border-radius: 10px;
  background: var(--ground);
  color: var(--metal);
  font-family: var(--caps);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.lab__panel {
  position: fixed;
  top: calc(var(--safe-top) + 48px);
  left: 0;
  right: 0;
  margin: 0 auto;
  max-width: 460px;
  z-index: 7;
  padding: 12px 0 14px;
  background: var(--ground);
  border-bottom: 1px solid var(--metal-line);
  box-shadow: 0 12px 24px -12px rgba(0, 0, 0, 0.6);
}
.lab__panel[hidden] { display: none; }
.lab__group + .lab__group { margin-top: 10px; }
.lab__label {
  margin: 0 var(--gutter) 6px;
  font-family: var(--caps);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.lab__chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px var(--gutter);
  scrollbar-width: none;
}
.lab__chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 6px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: none;
  color: var(--fg-soft);
}
.chip[aria-pressed="true"] { border-color: var(--metal); color: var(--fg); }
.chip__tile {
  position: relative;
  width: 58px;
  height: 40px;
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.chip__cube {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 3px;
  background: linear-gradient(160deg, #F2F3F5, #A9AAAF);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.35);
}
.chip__gem {
  position: absolute;
  right: 7px;
  top: 7px;
  width: 5px;
  height: 5px;
  transform: rotate(45deg);
}
.chip__name {
  font-family: var(--caps);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.chip--type { min-width: 88px; }
.chip__aa { font-size: 26px; line-height: 1; color: var(--fg); }
.chip__sample { font-size: 12px; color: var(--fg-soft); }
.chip--finish {
  min-width: 76px;
  min-height: 36px;
  place-items: center;
  font-family: var(--caps);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ---------- loader ---------- */

.loader {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  background: var(--ground);
  z-index: 10;
  transition: opacity .8s var(--paper), visibility 0s linear .8s;
}
.loader.is-gone { opacity: 0; visibility: hidden; }
.loader__line {
  width: 96px;
  height: 1px;
  background: color-mix(in srgb, var(--metal) 20%, transparent);
  position: relative;
  overflow: hidden;
}
.loader__line::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--metal);
  transform-origin: left;
  transform: scaleX(var(--p, 0));
  transition: transform .5s var(--paper);
}

/* ---------- text version: screen readers always, everyone without WebGL ---------- */

.text-version {
  text-align: left;
  padding-top: 14px;
}
.sheet--details { scrollbar-width: thin; scrollbar-color: var(--card-line) var(--card); }
.sheet--details .text-version { --fg: var(--card-ink); --fg-soft: var(--card-ink); --fg-faint: var(--card-mute); --metal: var(--wine); }
.sheet--details .tv__title { padding-right: 34px; }
.no-3d body { overflow: auto; }
.no-3d html, .no-3d body { overflow: auto; height: auto; }
.no-3d #scene, .no-3d .ui, .no-3d .finger { display: none; }
.no-3d #details { position: relative; inset: auto; max-height: none; border-radius: 0; box-shadow: none; transform: none; }
.no-3d .text-version {
  position: static;
  width: auto; height: auto;
  clip: auto;
  white-space: normal;
  max-width: 460px;
  margin: 0 auto;
  padding: calc(var(--safe-top) + 24px) var(--gutter) calc(var(--safe-bottom) + 24px);
  text-align: center;
}
.tv__title { font-family: var(--script); font-style: var(--script-style); font-weight: var(--script-weight); font-size: 30px; margin: 0 0 18px; }
.text-version h3 { font-family: var(--display); font-weight: var(--display-weight); font-size: 22px; margin: 28px 0 4px; color: var(--fg); }
.text-version p { margin: 4px 0; color: var(--fg-soft); font-size: 17px; line-height: 1.45; }
.text-version .tv__greet { font-family: var(--voice); font-style: var(--voice-style); color: var(--fg); }
.tv__link { display: inline-flex; align-items: center; min-height: 44px; margin: 8px 12px 0 0; color: var(--metal); text-underline-offset: 5px; font-family: var(--caps); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.tv__reply { margin-top: 28px; }

.noscript { max-width: 460px; margin: 40px auto; padding: 0 16px; text-align: center; line-height: 1.5; }

/* ---------- the reply card ---------- */

.sheet {
  position: fixed;
  inset: auto 0 0 0;
  margin: 0 auto;
  width: min(100%, 460px);
  max-width: 100%;
  max-height: min(92dvh, 760px);
  padding: 0;
  border: 0;
  border-radius: 22px 22px 0 0;
  background: var(--card);
  color: var(--card-ink);
  color-scheme: light;
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateY(104%);
  transition: transform .42s var(--paper);
  box-shadow: 0 -20px 50px -20px rgba(0, 0, 0, 0.8);
}
.sheet.is-open { transform: none; }
.sheet::backdrop { background: rgba(8, 0, 1, 0.6); }
.sheet ::selection { background: var(--wine); color: var(--card); }
.sheet :focus-visible { outline-color: var(--wine); }
.sheet__inner { position: relative; padding: 28px 22px calc(var(--safe-bottom) + 18px); }
.sheet__close { position: absolute; top: 12px; right: 10px; }
.icon-btn--card { color: var(--card-mute); }
@media (hover: hover) { .icon-btn--card:hover { color: var(--card-ink); border-color: var(--card-line); } }

.sheet__title {
  margin: 0;
  font-family: var(--display);
  font-weight: var(--display-weight);
  text-transform: var(--display-case);
  font-size: 30px;
  line-height: 1.1;
  color: var(--wine);
}
.sheet__title:focus { outline: none; }
.sheet__note { margin: 10px 0 0; font-size: 15.5px; line-height: 1.4; letter-spacing: 0.015em; color: var(--card-mute); }
.sheet__sub { margin: 6px 0 0; font-family: var(--voice); font-style: var(--voice-style); font-weight: var(--voice-weight); font-size: 19px; color: var(--card-mute); }

.field { display: block; margin-top: 22px; }
.field[hidden], .party[hidden] { display: none; }
.field__label {
  display: block;
  font-family: var(--caps);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--card-mute);
  padding: 0;
}
.field__hint { display: block; margin-top: 6px; font-family: var(--voice); font-size: 15.5px; line-height: 1.4; letter-spacing: 0.015em; color: var(--card-mute); }
.field__opt { letter-spacing: 0.1em; font-weight: 400; }
.field__input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid var(--card-line);
  border-radius: 0;
  background: transparent;
  font-family: var(--text);
  font-size: 21px;
  color: var(--card-ink);
  caret-color: var(--wine);
  transition: border-color .2s;
}
.field__input:focus { outline: none; border-bottom-color: var(--wine); }
.field__input[aria-invalid="true"] { border-bottom-color: var(--wine); }
.field__input--note { font-size: 19px; line-height: 1.3; resize: none; }

fieldset { border: 0; margin: 22px 0 0; padding: 0; min-width: 0; }

.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice legend { grid-column: 1 / -1; margin-bottom: 10px; }
.choice__opt { position: relative; display: block; }
.choice__opt input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}
.choice__tile {
  display: grid;
  place-items: center;
  min-height: 86px;
  padding: 10px;
  border: 1px solid var(--card-line);
  border-radius: 14px;
  background: #fff;
  font-family: var(--voice);
  font-style: var(--voice-style);
  font-weight: var(--voice-weight);
  font-size: 20px;
  line-height: 1.2;
  text-align: center;
  color: var(--card-ink);
  transition: background-color .25s, color .25s, border-color .25s, box-shadow .25s;
}
.choice__opt input:checked + .choice__tile {
  background: var(--wine);
  border-color: var(--wine);
  color: var(--card);
  box-shadow: inset 0 1px 0 rgba(255, 228, 222, 0.18), 0 6px 12px -8px rgba(42, 18, 20, 0.55);
}
.choice__opt input:focus-visible + .choice__tile { outline: 2px solid var(--wine); outline-offset: 3px; }

/* the guests attending: a numbered list like a place-card plan, one hairline per place held */
.party__help { margin: 6px 0 0; font-family: var(--voice); font-style: var(--voice-style); font-size: 15.5px; line-height: 1.4; letter-spacing: 0.015em; color: var(--card-mute); }
.party__list { margin: 4px 0 0; padding: 0; list-style: none; }
.party__row { display: grid; grid-template-columns: 26px 1fr; align-items: baseline; }
.party__num {
  font-family: var(--text);
  font-size: 18px;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--wine);
}
.party__row .field__input { margin-top: 0; padding: 12px 0 9px; }

.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.answer__error { margin: 18px 0 0; font-family: var(--voice); font-style: var(--voice-style); font-size: 18px; color: var(--wine); }
.btn--card { margin-top: 22px; width: 100%; color: var(--card); }
.btn--card-ghost {
  background: #fff;
  box-shadow: inset 0 -2px 2px rgba(42, 18, 20, 0.07), 0 1px 3px rgba(42, 18, 20, 0.14);
  color: var(--card-ink);
}
.btn--card-ghost .btn__label::before, .btn--card-ghost .btn__label::after { background: var(--wine); }
.btn--card-ghost:active { box-shadow: inset 0 2px 3px rgba(42, 18, 20, 0.16); }

.done__line { margin: 12px 0 0; font-size: 20px; line-height: 1.35; }
.done__mock { margin: 12px 0 0; font-family: var(--voice); font-style: var(--voice-style); font-size: 16.5px; color: var(--card-mute); }
.done__actions { display: grid; gap: 10px; margin-top: 22px; }
.done__actions .btn--card { margin-top: 0; }

/* ---------- small and short screens ---------- */

@media (max-height: 700px) {
  .stage { padding-top: calc(var(--safe-top) + 50px); }
  .caption { max-height: calc(100dvh * 0.38); }
  .cap__title { font-size: 25px; }
  .cap__title--script { font-size: calc(23px * var(--script-scale)); }
  .cap__body p { font-size: 17px; margin-top: 6px; }
  .cap__actions { padding-top: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ---------- every word in capitals ---------- */

/* All the text is set in capitals (Kelvin, 2026-10-10), as La Roue is shown in the reference
   pairing, tracked a little open as capitals want. Two things keep their own case: the script
   greetings ("Dear …", which in capitals would no longer read as handwriting), what a guest
   types, shown exactly as typed, and the reply card's guidance sentences. */
body, button { text-transform: uppercase; }
.greet, .cap__title--script, .field__input, .noscript { text-transform: none; }
/* the reply card's longer guidance reads as sentences (Kelvin, 2026-10-10) */
.sheet__note, .party__help, .field__hint { text-transform: none; }
.lede, .hint, .gesture-note, .cue, .pip, .cap__body p, .assist-turn, .sheet__sub,
.party__num, .choice__tile, .answer__error, .done__line, .done__mock,
.text-version p { letter-spacing: 0.045em; }

/* ---------- a little more ink ---------- */

/* La Roue's light cut and the Pinyon script come in one weight, too thin to read easily on a phone
   (Kelvin, 2026-10-10): every line off the cube is drawn with a hairline of its own colour round it,
   about a fiftieth of its size, which thickens the strokes without changing the letters. The wide
   Montserrat capitals take a real step up in weight instead. */
body { -webkit-text-stroke: 0.02em currentColor; }
.fine, .link-btn, .bar__rsvp, .field__label, .field__opt, .tv__link, .lift span, .lab { -webkit-text-stroke: 0; }
