/* =============================================================================
   Celebrate - design system
   Hand-written CSS, no build step: shared hosting has no Node process, and a
   single cached stylesheet beats a framework for Core Web Vitals (spec 68).
   ========================================================================== */

/* ----------------------------------------------------------------- tokens */
:root {
  /* Ink and paper. Warm neutrals, not grey - the product is celebratory. */
  --ink: #1c1a17;
  --ink-soft: #4a443c;
  --muted: #8a8177;
  --faint: #b3aba0;
  --line: #e8e1d6;
  --line-soft: #f1ebe2;
  --paper: #faf6ef;
  --paper-2: #f4ece0;
  --paper-3: #ebe0d1;
  --white: #fff;

  /* The primary action colour. Deliberately separate from --ink, because the
     buttons are evergreen while the text stays near-black; admin brand
     settings override --ink, --gold and --rose, and must not repaint these. */
  --evergreen: #1f3b2c;
  --evergreen-soft: #2b503b;
  --evergreen-tint: #eef2ec;

  /* The warm wash behind the hero and other feature panels. */
  --cream: #f7efe4;
  --cream-deep: #f0e3d2;
  --blush: #f7e7e4;

  /* Brand accents. Overridden per install from admin settings. */
  --gold: #c8a27a;
  --gold-deep: #a8815c;
  --rose: #d8697a;
  --sage: #7e9a7a;
  --ocean: #6a87a8;

  --ok: #4c7a5a;
  --warn: #b2803a;
  --danger: #b4483f;
  --info: #5b7c9a;

  /* Type */
  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Radii */
  --r-xs: 8px;
  --r-sm: 12px;
  --r: 18px;
  --r-lg: 26px;
  --r-xl: 36px;
  --r-pill: 999px;

  /* Elevation - barely there, never a drop shadow for its own sake */
  --shadow-xs: 0 1px 2px rgba(28, 26, 23, .04);
  --shadow-sm: 0 2px 8px rgba(28, 26, 23, .05);
  --shadow: 0 8px 28px -10px rgba(28, 26, 23, .16);
  --shadow-lg: 0 24px 60px -24px rgba(28, 26, 23, .28);

  /* Layout */
  --page: 1240px;
  --page-narrow: 820px;
  --gutter: 24px;
  --nav-h: 74px;

  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

@media (min-width: 900px) {
  :root { --gutter: 40px; }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* clip, not hidden: hidden would make body a scroll container and break
     every position:sticky element on the page. */
  overflow-x: clip;
}

h1, h2, h3, h4, h5 { margin: 0; font-weight: 500; line-height: 1.15; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
img, svg, video { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
ul, ol { margin: 0; padding: 0; }
li { list-style: none; }
table { border-collapse: collapse; width: 100%; }

a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, currentColor 30%, transparent);
  text-underline-offset: 3px;
  transition: text-decoration-color .2s var(--ease), color .2s var(--ease);
}
a:hover { text-decoration-color: currentColor; }

/* Visible focus everywhere, for keyboard users (spec 52). */
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 4px;
}
:focus:not(:focus-visible) { outline: none; }

::selection { background: color-mix(in srgb, var(--gold) 40%, transparent); }

/* ------------------------------------------------------------- utilities */
.wrap {
  width: 100%;
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap--narrow { max-width: var(--page-narrow); }
.wrap--wide { max-width: 1440px; }

.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-link {
  position: absolute;
  left: 12px; top: -60px;
  z-index: 200;
  padding: 12px 20px;
  background: var(--ink);
  color: var(--white);
  border-radius: var(--r-sm);
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 12px; }

.stack > * + * { margin-top: var(--gap, 16px); }
.row { display: flex; align-items: center; gap: 12px; }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.center { text-align: center; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.hide { display: none !important; }

@media (max-width: 719px) { .hide-sm { display: none !important; } }
@media (min-width: 720px) { .show-sm { display: none !important; } }
@media (max-width: 1023px) { .hide-md { display: none !important; } }
@media (min-width: 1024px) { .show-md { display: none !important; } }

/* ------------------------------------------------------------ typography */
.display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -.015em;
  line-height: 1.04;
}
.d1 { font-size: clamp(2.7rem, 7.2vw, 5.4rem); }
.d2 { font-size: clamp(2.1rem, 4.8vw, 3.5rem); }
.d3 { font-size: clamp(1.6rem, 3.2vw, 2.35rem); }
.d4 { font-size: clamp(1.28rem, 2.2vw, 1.6rem); }

.eyebrow {
  font-size: .72rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.eyebrow--accent { color: var(--gold-deep); }

.lede {
  font-size: clamp(1.02rem, 1.6vw, 1.2rem);
  line-height: 1.62;
  color: var(--ink-soft);
}

.small { font-size: .86rem; }
.tiny { font-size: .78rem; }
.strong { font-weight: 600; }

.serif { font-family: var(--font-display); }

/* --------------------------------------------------------------- buttons */
.btn {
  --btn-bg: var(--evergreen);
  --btn-fg: var(--white);
  --btn-border: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 26px;
  border: 1px solid var(--btn-border);
  border-radius: var(--r-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: .94rem;
  font-weight: 550;
  letter-spacing: .005em;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .18s var(--ease-out), box-shadow .22s var(--ease),
              background-color .2s var(--ease), color .2s var(--ease), opacity .2s;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); box-shadow: var(--shadow-xs); }
.btn[disabled], .btn[aria-disabled="true"] {
  opacity: .5;
  pointer-events: none;
}

.btn--ghost {
  --btn-bg: var(--white);
  --btn-fg: var(--ink);
  --btn-border: var(--line);
}
.btn--ghost:hover { --btn-bg: var(--white); --btn-border: var(--evergreen); --btn-fg: var(--evergreen); }

.btn--quiet {
  --btn-bg: transparent;
  --btn-fg: var(--ink-soft);
  padding-inline: 14px;
}
.btn--quiet:hover { --btn-bg: var(--paper-2); --btn-fg: var(--ink); box-shadow: none; transform: none; }

.btn--gold { --btn-bg: var(--gold); --btn-fg: #241d14; }
.btn--danger { --btn-bg: transparent; --btn-fg: var(--danger); --btn-border: color-mix(in srgb, var(--danger) 30%, transparent); }
.btn--danger:hover { --btn-bg: var(--danger); --btn-fg: var(--white); }
.btn--white { --btn-bg: var(--white); --btn-fg: var(--ink); }

.btn--lg { padding: 17px 34px; font-size: 1rem; }
.btn--sm { padding: 9px 17px; font-size: .84rem; }
.btn--block { width: 100%; }
.btn--icon { padding: 10px; border-radius: var(--r-pill); }
.btn svg { width: 1.05em; height: 1.05em; flex: none; }

/* ----------------------------------------------------------------- forms */
.field { display: block; margin-bottom: 18px; }
.field__label {
  display: block;
  margin-bottom: 7px;
  font-size: .82rem;
  font-weight: 550;
  letter-spacing: .01em;
  color: var(--ink);
}
.field__hint { margin-top: 6px; font-size: .78rem; color: var(--muted); }
.field__error { margin-top: 6px; font-size: .8rem; color: var(--danger); font-weight: 500; }

.input, .select, .textarea {
  width: 100%;
  padding: 12px 15px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: .95rem;
  color: var(--ink);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--paper-3); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 9%, transparent);
}
.input[aria-invalid="true"], .textarea[aria-invalid="true"], .select[aria-invalid="true"] {
  border-color: var(--danger);
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.55; }

.select {
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%238a8177' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  background-size: 12px;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 11px 0;
  cursor: pointer;
  font-size: .92rem;
}
.check input[type="checkbox"], .check input[type="radio"] {
  width: 19px; height: 19px;
  margin: 1px 0 0;
  accent-color: var(--ink);
  flex: none;
  cursor: pointer;
}
.check__text { color: var(--ink-soft); }
.check__text strong { display: block; color: var(--ink); font-weight: 550; }

.field-row {
  display: grid;
  gap: 0 16px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .field-row--2 { grid-template-columns: 1fr 1fr; }
  .field-row--3 { grid-template-columns: repeat(3, 1fr); }
  .field-row--21 { grid-template-columns: 2fr 1fr; }
}

fieldset { margin: 0 0 20px; padding: 0; border: 0; }
legend {
  padding: 0;
  margin-bottom: 10px;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .01em;
}

/* ----------------------------------------------------------- surfaces */
.card {
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
}
.card__body { padding: clamp(20px, 3.2vw, 32px); }
.card__head {
  padding: 20px clamp(20px, 3.2vw, 32px);
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.card__foot {
  padding: 16px clamp(20px, 3.2vw, 32px);
  border-top: 1px solid var(--line-soft);
  background: var(--paper);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}

.panel {
  background: var(--paper-2);
  border-radius: var(--r);
  padding: clamp(16px, 2.4vw, 24px);
}

.divider { height: 1px; background: var(--line-soft); border: 0; margin: 28px 0; }

/* -------------------------------------------------------------- badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: var(--r-pill);
  background: var(--paper-2);
  color: var(--ink-soft);
  font-size: .74rem;
  font-weight: 550;
  letter-spacing: .02em;
  white-space: nowrap;
}
.badge--pro { background: linear-gradient(135deg, #f2e2cc, #e4c79f); color: #4d3a20; }
.badge--free { background: color-mix(in srgb, var(--sage) 16%, var(--white)); color: #3c5240; }
.badge--going { background: color-mix(in srgb, var(--ok) 15%, var(--white)); color: #2f5a3d; }
.badge--maybe { background: color-mix(in srgb, var(--warn) 18%, var(--white)); color: #6e4d18; }
.badge--no { background: color-mix(in srgb, var(--danger) 13%, var(--white)); color: #7e2f28; }
.badge--pending { background: var(--paper-2); color: var(--muted); }
.badge--live { background: color-mix(in srgb, var(--ok) 15%, var(--white)); color: #2f5a3d; }
.badge--draft { background: var(--paper-3); color: var(--ink-soft); }
.badge--dot::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: .8;
}

/* -------------------------------------------------------------- alerts */
.alert {
  display: flex;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--r-sm);
  font-size: .9rem;
  border: 1px solid transparent;
  margin-bottom: 18px;
}
.alert--success { background: color-mix(in srgb, var(--ok) 10%, var(--white)); border-color: color-mix(in srgb, var(--ok) 24%, transparent); color: #2c523a; }
.alert--danger { background: color-mix(in srgb, var(--danger) 8%, var(--white)); border-color: color-mix(in srgb, var(--danger) 22%, transparent); color: #7c3129; }
.alert--info { background: color-mix(in srgb, var(--info) 9%, var(--white)); border-color: color-mix(in srgb, var(--info) 22%, transparent); color: #3c5468; }
.alert--warn { background: color-mix(in srgb, var(--warn) 11%, var(--white)); border-color: color-mix(in srgb, var(--warn) 26%, transparent); color: #6e4d18; }

.flash-stack {
  position: fixed;
  right: 16px; bottom: 16px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(380px, calc(100vw - 32px));
}
.flash {
  padding: 13px 18px;
  border-radius: var(--r-sm);
  background: var(--ink);
  color: var(--white);
  font-size: .89rem;
  box-shadow: var(--shadow);
  animation: flash-in .32s var(--ease-out) both;
}
.flash--success { background: #2e5b41; }
.flash--danger { background: #8e3830; }
.flash--info { background: #34506a; }

@keyframes flash-in {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: none; }
}

/* =========================================================================
   Site chrome
   ====================================================================== */
.site-head {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background-color .3s var(--ease);
}
.site-head.is-stuck { border-bottom-color: var(--line-soft); }

.site-head__bar {
  display: flex;
  align-items: center;
  gap: 18px;
  height: var(--nav-h);
}

.logo {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  font-family: var(--font-display);
  font-size: 1.32rem;
  letter-spacing: .01em;
  text-decoration: none;
  flex: none;
}
.logo__dot { color: var(--rose); }
.logo img { height: 30px; width: auto; }

/* Search sits in the header itself rather than behind an icon, because
   finding a design is the first thing most visitors want to do. */
.head-search {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 16px;
  height: 42px;
  /* Shrinks before the navigation does, since it is the only thing in the
     bar that stays usable at any width. */
  flex: 0 1 230px;
  min-width: 150px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--white);
  color: var(--muted);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.head-search:focus-within {
  border-color: var(--evergreen);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--evergreen) 12%, transparent);
}
.head-search svg { flex: none; }
.head-search input {
  border: 0;
  background: none;
  outline: none;
  width: 100%;
  font: inherit;
  font-size: .88rem;
  color: var(--ink);
}
.head-search input::placeholder { color: var(--muted); }
.head-search input::-webkit-search-cancel-button { appearance: none; }

.head-tag {
  margin: 0;
  flex: none;
  font-size: .62rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
  white-space: nowrap;
}
/* The bar is already busy at this width; the line is the first thing to go. */
@media (max-width: 1280px) { .head-tag { display: none; } }

.nav { display: flex; align-items: center; gap: 2px; }
/* Never squeezed: the `grow` utility on it lets flexbox shrink it past its
   content, which silently clipped the last link off the end of the bar. */
.nav--main { flex: 0 0 auto; }
.nav__link {
  padding: 9px 13px;
  border-radius: var(--r-pill);
  font-size: .9rem;
  color: var(--ink-soft);
  text-decoration: none;
  /* Without this a squeezed bar breaks "Greeting cards" over two lines and
     doubles the height of the whole header. */
  white-space: nowrap;
  transition: background-color .18s var(--ease), color .18s var(--ease);
}
.nav__link:hover, .nav__link:focus-visible { background: var(--paper-2); color: var(--ink); }
.nav__link[aria-current="page"] { color: var(--ink); font-weight: 550; }

/* Dropdown menus open on hover and on focus, so they work by keyboard. */
.nav__item { position: relative; }
.nav__panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  translate: -50% 0;
  min-width: 250px;
  padding: 10px;
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .18s var(--ease), transform .18s var(--ease-out), visibility .18s;
}
.nav__item:hover .nav__panel,
.nav__item:focus-within .nav__panel {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.nav__panel a {
  display: block;
  padding: 9px 12px;
  border-radius: var(--r-xs);
  font-size: .89rem;
  text-decoration: none;
  color: var(--ink-soft);
}
.nav__panel a:hover { background: var(--paper); color: var(--ink); }

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: var(--r-pill);
  padding: 9px 11px;
  cursor: pointer;
}
.nav-toggle svg { width: 20px; height: 20px; }

@media (max-width: 1023px) {
  .nav--main { display: none; }
  .nav-toggle { display: inline-flex; }
}

.mobile-nav {
  position: fixed;
  inset: var(--nav-h) 0 0;
  z-index: 55;
  background: var(--paper);
  padding: 22px var(--gutter) 40px;
  overflow-y: auto;
  transform: translateY(-8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s var(--ease), transform .26s var(--ease-out), visibility .22s;
}
.mobile-nav[data-open="true"] { opacity: 1; visibility: visible; transform: none; }
.mobile-nav a {
  display: block;
  padding: 13px 4px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 1.05rem;
  text-decoration: none;
}
.mobile-nav .btn { margin-top: 18px; }

.site-foot {
  margin-top: 90px;
  padding: 64px 0 40px;
  background: var(--paper-2);
  border-top: 1px solid var(--line-soft);
}
.site-foot__grid {
  display: grid;
  gap: 36px;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) { .site-foot__grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.site-foot h3 {
  font-size: .78rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
  font-weight: 600;
}
.site-foot a { display: block; padding: 5px 0; font-size: .9rem; color: var(--ink-soft); text-decoration: none; }
.site-foot a:hover { color: var(--ink); }
.site-foot__base {
  margin-top: 44px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: .82rem;
  color: var(--muted);
}

/* =========================================================================
   Invitation canvas (spec 11)

   One custom property does all the scaling: `--u` is one design pixel
   expressed in container-query units, so coordinates from the JSON are used
   verbatim and the card resizes with its container without any JavaScript.
   ====================================================================== */
.cv {
  position: relative;
  width: 100%;
  container-type: inline-size;
  overflow: hidden;
  border-radius: inherit;
  background: var(--paper-2);
}
.cv-stage {
  position: absolute;
  inset: 0;
  --u: calc(100cqw / var(--cv-w));
  overflow: hidden;
}
.cv-layer {
  position: absolute;
  transform-origin: center center;
  will-change: transform;
}
.cv-text {
  display: flex;
  align-items: center;
  width: 100%;
  height: 100%;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: break-word;
}
.cv-photo, .cv-shape-inner, .cv-graphic {
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.cv-img { width: 100%; height: 100%; object-fit: cover; }
.cv-graphic svg { width: 100%; height: 100%; }
.cv-photo-empty {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: repeating-linear-gradient(45deg, #efe9e0, #efe9e0 10px, #e7dfd3 10px, #e7dfd3 20px);
  color: #8d8478;
  font-family: var(--font-body);
  font-size: calc(var(--u) * 26);
  text-align: center;
  padding: calc(var(--u) * 16);
}
.cv-bg { position: absolute; inset: 0; }
.cv-bg img { width: 100%; height: 100%; }
.cv-bg-overlay { position: absolute; inset: 0; }
.cv-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Card frame used wherever an invitation is shown as an object. */
.invite-frame {
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--white);
}
.invite-frame--lg { border-radius: var(--r-lg); box-shadow: var(--shadow-lg); }

/* =========================================================================
   Reveal animations (spec 33)
   All CSS, no video, and every one is disabled under reduced motion.
   ====================================================================== */
.cv--anim .cv-stage { animation: cv-fade .8s var(--ease-out) both; }
.cv--anim-card-reveal .cv-stage { animation: cv-card .95s var(--ease-out) both; }
.cv--anim-photo-reveal .cv-photo img { animation: cv-zoom 1.5s var(--ease-out) both; }

@keyframes cv-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cv-card {
  from { opacity: 0; transform: translateY(2.5%) scale(.965); }
  to { opacity: 1; transform: none; }
}
@keyframes cv-zoom { from { transform: scale(1.12); } to { transform: scale(1); } }

.cv-in { animation-fill-mode: both; animation-timing-function: var(--ease-out); }
.cv-in-fade { animation-name: cv-fade; }
.cv-in-rise { animation-name: cv-rise; }
.cv-in-scale { animation-name: cv-scale; }
.cv-in-blur { animation-name: cv-blur; }
.cv-in-float { animation-name: cv-float; animation-iteration-count: infinite; animation-direction: alternate; }

@keyframes cv-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes cv-scale { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: none; } }
@keyframes cv-blur { from { opacity: 0; filter: blur(8px); } to { opacity: 1; filter: none; } }
@keyframes cv-float { from { transform: translateY(-4px); } to { transform: translateY(4px); } }

/* Particle overlays: a handful of absolutely positioned dots, no images. */
.fx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.fx i {
  position: absolute;
  top: -8%;
  width: 9px; height: 13px;
  border-radius: 2px;
  opacity: 0;
  animation: fx-fall linear infinite;
}
.fx--sparkle i {
  width: 7px; height: 7px;
  border-radius: 50%;
  animation-name: fx-twinkle;
  top: auto;
}
.fx--petals i {
  width: 11px; height: 11px;
  border-radius: 50% 0 50% 0;
  animation-name: fx-drift;
}

@keyframes fx-fall {
  0% { opacity: 0; transform: translateY(-10%) rotate(0deg); }
  8% { opacity: 1; }
  100% { opacity: .1; transform: translateY(1100%) rotate(540deg); }
}
@keyframes fx-drift {
  0% { opacity: 0; transform: translate(0, -10%) rotate(0deg); }
  10% { opacity: .9; }
  100% { opacity: 0; transform: translate(40px, 1100%) rotate(300deg); }
}
@keyframes fx-twinkle {
  0%, 100% { opacity: 0; transform: scale(.4); }
  50% { opacity: .95; transform: scale(1); }
}

/* =========================================================================
   Digital envelope (spec 34) - CSS only, never a rendered video
   ====================================================================== */
.envelope {
  position: relative;
  width: min(560px, 100%);
  margin-inline: auto;
  aspect-ratio: 5 / 3.4;
  cursor: pointer;
  perspective: 1400px;
}
.envelope__body {
  position: absolute;
  inset: 0;
  background: var(--env-color, #e8dfd2);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.envelope__liner {
  position: absolute;
  inset: 0;
  background: var(--env-liner, #f6efe4);
  clip-path: polygon(0 0, 100% 0, 50% 58%);
}
.envelope__flap {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 58%;
  background: var(--env-color, #e8dfd2);
  filter: brightness(1.04);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center;
  transition: transform .85s var(--ease-out);
  z-index: 3;
}
.envelope__pocket {
  position: absolute;
  inset: 0;
  background: var(--env-color, #e8dfd2);
  filter: brightness(.97);
  clip-path: polygon(0 32%, 50% 68%, 100% 32%, 100% 100%, 0 100%);
  z-index: 4;
}
.envelope__seal {
  position: absolute;
  top: 46%; left: 50%;
  translate: -50% -50%;
  width: 68px; height: 68px;
  border-radius: 50%;
  background: var(--env-seal, #b4553f);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.35rem;
  z-index: 5;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .18);
  transition: opacity .4s var(--ease), transform .5s var(--ease-out);
}
.envelope__stamp {
  position: absolute;
  top: 6%; right: 7%;
  width: 62px; height: 76px;
  background: var(--white);
  border-radius: 3px;
  padding: 5px;
  z-index: 6;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
}
.envelope__stamp svg { width: 100%; height: 100%; }
.envelope__card {
  position: absolute;
  left: 6%; right: 6%;
  bottom: 6%;
  z-index: 2;
  transform: translateY(6%);
  transition: transform 1s var(--ease-out);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 -4px 18px rgba(0, 0, 0, .1);
}
.envelope__hint {
  position: absolute;
  left: 50%; bottom: -46px;
  translate: -50% 0;
  z-index: 7;
  font-size: .82rem;
  color: var(--muted);
  white-space: nowrap;
}

.envelope.is-open .envelope__flap { transform: rotateX(-172deg); }
.envelope.is-open .envelope__seal { opacity: 0; transform: translate(-50%, -50%) scale(.6); }
.envelope.is-open .envelope__card { transform: translateY(-92%); }
.envelope.is-open .envelope__hint { opacity: 0; }

/* =========================================================================
   Reduced motion (spec 52)
   ====================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .fx { display: none; }
  .envelope__flap, .envelope__card { transition: none; }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* Scroll reveal, applied by a tiny IntersectionObserver. */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .7s var(--ease-out), transform .7s var(--ease-out);
}
.reveal.is-in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .07s; }
.reveal[data-delay="2"] { transition-delay: .14s; }
.reveal[data-delay="3"] { transition-delay: .21s; }
.reveal[data-delay="4"] { transition-delay: .28s; }
.reveal[data-delay="5"] { transition-delay: .35s; }

/* Inline icons inside links and labels must not break onto their own line -
   the global `svg { display: block }` reset would otherwise do exactly that. */
.nav__link, .logo, .tabs a, .badge, .chip, .occasion, .registry-link, .share-btn,
.dash__nav a, .table td a, .plan__list li, .btn {
  display: inline-flex;
  align-items: center;
}
.nav__link { gap: 5px; }
.nav__link svg, .tabs a svg, .chip svg { display: inline-block; }
