/* =====================================================================
   MyDearLy — design system
   Warm ivory & parchment paper, deep ink, oxblood accents, antique gold.
   ===================================================================== */

@font-face { font-family: "Cormorant Garamond"; src: url("../fonts/cormorant.woff2") format("woff2"); font-weight: 400 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("../fonts/cormorant-italic.woff2") format("woff2"); font-weight: 400 600; font-style: italic; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter.woff2") format("woff2"); font-weight: 400 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Caveat"; src: url("../fonts/caveat.woff2") format("woff2"); font-weight: 400 600; font-style: normal; font-display: swap; }

:root {
  --ivory: #F7F2E9;
  --ivory-2: #FBF8F2;
  --parchment: #E8DDC9;
  --parchment-deep: #D9CBB1;
  --ink: #29251F;
  --ink-2: #3A342B;
  --muted: #5C5346;          /* 6.9:1 on ivory */
  --burgundy: #642C35;
  --burgundy-deep: #4A1F27;
  --gold: #AC9162;           /* decorative only on light grounds */
  --gold-light: #D3BF93;     /* text on dark grounds */
  --taupe: #B8AA98;
  --taupe-soft: #CFC4B4;
  --line: rgba(41, 37, 31, .16);
  --error: #9B1C2C;

  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --hand: "Caveat", "Segoe Script", "Bradley Hand", cursive;

  --gutter: clamp(20px, 5vw, 56px);
  --max: 1200px;
  --header-h: 64px;
  --ease: cubic-bezier(.22, .61, .36, 1);

  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .36 0 0 0 0 .29 0 0 0 0 .2 0 0 0 .1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0; background: var(--ivory); color: var(--ink);
  font-family: var(--sans); font-size: 1rem; line-height: 1.65;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; line-height: 1.08; margin: 0; letter-spacing: -.01em; overflow-wrap: break-word; }
p { margin: 0 0 1em; }
a { color: var(--burgundy); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--burgundy); outline-offset: 3px; border-radius: 2px; }
.on-dark :focus-visible, .footer :focus-visible { outline-color: var(--gold-light); }
::selection { background: var(--parchment-deep); }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; background: var(--ink); color: var(--ivory); padding: .7rem 1rem; z-index: 100; border-radius: 2px; }
.skip-link:focus { top: 12px; }
.container { width: 100%; max-width: calc(var(--max) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: 760px; }
mark.tbc { background: rgba(172, 145, 98, .22); color: var(--ink); padding: .05em .4em; border-radius: 2px; font-style: normal; border-bottom: 1px dashed var(--gold); }

/* ---------- Type ---------- */
.eyebrow { font-family: var(--sans); font-size: .78rem; letter-spacing: .18em; text-transform: uppercase; font-weight: 600; color: var(--burgundy); display: inline-flex; align-items: center; gap: .8rem; margin: 0 0 1.1rem; }
.eyebrow::before { content: ""; width: 28px; height: 1px; background: var(--gold); }
.on-dark .eyebrow { color: var(--gold-light); }
.display { font-size: clamp(2.6rem, 8.4vw, 5.6rem); line-height: .98; letter-spacing: -.02em; }
.display em, .h2 em { font-style: italic; color: var(--burgundy); }
.on-dark .h2 em, .on-dark .display em { color: var(--gold-light); }
.h2 { font-size: clamp(2.1rem, 5.4vw, 3.6rem); line-height: 1.02; }
.h3 { font-size: clamp(1.5rem, 3vw, 1.9rem); }
.lead { font-size: clamp(1.05rem, 2.2vw, 1.25rem); color: var(--muted); max-width: 34em; }
.on-dark .lead { color: var(--taupe-soft); }
.hand { font-family: var(--hand); font-weight: 500; }

/* ---------- Buttons ---------- */
.btn {
  --bg: var(--burgundy); --fg: var(--ivory); --bd: var(--burgundy);
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  min-height: 52px; padding: .85rem 1.7rem; border: 1px solid var(--bd); border-radius: 2px;
  background: var(--bg); color: var(--fg); font: 600 .95rem/1.2 var(--sans); letter-spacing: .03em;
  text-decoration: none; cursor: pointer; transition: background .25s var(--ease), color .25s var(--ease), transform .25s var(--ease), border-color .25s;
}
.btn:hover { --bg: var(--burgundy-deep); --bd: var(--burgundy-deep); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn .arrow { transition: transform .25s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }
.btn-ghost { --bg: transparent; --fg: var(--ink); --bd: var(--ink); }
.btn-ghost:hover { --bg: var(--ink); --fg: var(--ivory); --bd: var(--ink); }
.btn-light { --bg: var(--ivory); --fg: var(--burgundy-deep); --bd: var(--ivory); }
.btn-light:hover { --bg: var(--parchment); --fg: var(--burgundy-deep); --bd: var(--parchment); }
.btn-ghost-light { --bg: transparent; --fg: var(--ivory); --bd: rgba(247, 242, 233, .55); }
.btn-ghost-light:hover { --bg: var(--ivory); --fg: var(--ink); --bd: var(--ivory); }
.btn-sm { min-height: 44px; padding: .55rem 1.1rem; font-size: .88rem; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.link-quiet { color: inherit; text-decoration: underline; text-decoration-color: var(--gold); }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--ivory); border-bottom: 1px solid var(--line); }
.header-inner { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.wordmark { font-family: var(--serif); font-size: 1.75rem; font-weight: 600; letter-spacing: -.01em; color: var(--ink); text-decoration: none; line-height: 1; padding: .3rem 0; }
.wordmark em { font-weight: 500; color: var(--burgundy); margin: 0 .02em; }
.wordmark:hover { text-decoration: none; }
.nav-desktop { display: none; }
.nav-desktop ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: clamp(1rem, 2.4vw, 2.2rem); }
.nav-desktop a:not(.btn) { color: var(--ink); text-decoration: none; font-size: .92rem; font-weight: 500; padding: .5rem 0; background: linear-gradient(var(--gold), var(--gold)) 0 100% / 0 1px no-repeat; transition: background-size .3s var(--ease); }
.nav-desktop a:not(.btn):hover, .nav-desktop a[aria-current="page"] { background-size: 100% 1px; }
.menu-btn { display: inline-flex; align-items: center; gap: .6rem; min-height: 44px; padding: 0 .9rem; background: none; border: 1px solid var(--line); border-radius: 2px; font: 600 .88rem var(--sans); color: var(--ink); cursor: pointer; }
.menu-icon, .menu-icon::before, .menu-icon::after { display: block; width: 18px; height: 1.5px; background: currentColor; transition: transform .25s var(--ease), background .2s; }
.menu-icon { position: relative; }
.menu-icon::before, .menu-icon::after { content: ""; position: absolute; left: 0; }
.menu-icon::before { top: -6px; } .menu-icon::after { top: 6px; }
.menu-btn[aria-expanded="true"] .menu-icon { background: transparent; }
.menu-btn[aria-expanded="true"] .menu-icon::before { transform: translateY(6px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .menu-icon::after { transform: translateY(-6px) rotate(-45deg); }
.nav-mobile { position: absolute; left: 0; right: 0; top: 100%; background: var(--ivory); border-bottom: 1px solid var(--line); box-shadow: 0 20px 40px -24px rgba(41, 37, 31, .35); padding: .5rem var(--gutter) 1.4rem; max-height: calc(100dvh - var(--header-h)); overflow-y: auto; }
.nav-mobile[hidden] { display: none; }
.nav-mobile ul { list-style: none; margin: 0 0 1rem; padding: 0; }
.nav-mobile li + li { border-top: 1px solid var(--line); }
.nav-mobile a:not(.btn) { display: flex; align-items: center; min-height: 54px; font-family: var(--serif); font-size: 1.6rem; color: var(--ink); text-decoration: none; }
.nav-mobile .btn { width: 100%; }
@media (min-width: 900px) {
  :root { --header-h: 76px; }
  .nav-desktop { display: block; } .menu-btn, .nav-mobile { display: none !important; }
}
.header-cta { display: none; }
@media (min-width: 420px) and (max-width: 899px) { .header-cta { display: inline-flex; } }

/* ---------- Paper & texture ---------- */
.paper { position: relative; background-color: var(--ivory-2); background-image: var(--grain); box-shadow: 0 1px 1px rgba(41, 37, 31, .08), 0 14px 30px -14px rgba(41, 37, 31, .35), 0 36px 60px -34px rgba(41, 37, 31, .3); }
.section { padding-block: clamp(4rem, 9vw, 8rem); position: relative; }
.section-parchment { background: var(--parchment) var(--grain); }
.section-ivory2 { background: var(--ivory-2) var(--grain); }
.section-ink { background: var(--ink); color: var(--ivory); }
.section-burgundy { background: var(--burgundy); color: var(--ivory); }
.on-dark { color: var(--ivory); }
.rule-gold { width: 64px; height: 1px; background: var(--gold); border: 0; margin: 1.6rem 0; }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(2.2rem, 6vw, 5rem) clamp(3rem, 7vw, 6rem); overflow: hidden; background: radial-gradient(120% 80% at 85% 20%, #fbf8f0 0, transparent 60%), var(--ivory); }
.hero-grid { display: grid; gap: 2.4rem; align-items: center; }
.hero-copy .lead { margin: 1.6rem 0 2rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: .9rem; }
.hero-note { margin: 1.8rem 0 0; display: flex; align-items: center; gap: 1rem; font-family: var(--serif); font-style: italic; font-size: 1.25rem; color: var(--ink-2); }
.hero-note::before { content: ""; flex: none; width: 40px; height: 1px; background: var(--gold); }
.hero-handnote { font-family: var(--hand); font-size: 1.7rem; color: var(--burgundy); transform: rotate(-3deg); display: inline-block; margin-top: .4rem; line-height: 1; }

.hero-stage { position: relative; }
.hero-art { position: relative; aspect-ratio: 1 / 0.98; width: 100%; max-width: 560px; margin-inline: auto; }
.art-sheet { position: absolute; top: 0; left: 3%; width: 64%; aspect-ratio: 3 / 4; padding: 9% 9% 6%; transform: rotate(-5deg); transform-origin: 30% 80%; }
.art-sheet p { font-family: var(--hand); font-size: clamp(1.05rem, 3.2vw, 1.5rem); line-height: 1.55; margin: 0; color: #2c2a4a; }
.art-sheet p + p { margin-top: .55em; }
.art-sheet::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(transparent 0 calc(1.55em - 1px), rgba(184, 170, 152, .35) calc(1.55em - 1px) 1.55em); opacity: 0; }
.art-env { position: absolute; right: 0; bottom: 5%; width: 76%; aspect-ratio: 10 / 6.8; filter: drop-shadow(0 22px 22px rgba(41, 37, 31, .28)); }
.art-env > * { position: absolute; }
.env-back { inset: 0; background: var(--parchment-deep) var(--grain); z-index: 0; }
.env-card { z-index: 2; left: 8%; right: 8%; top: 12%; height: 84%; background: var(--ivory-2) var(--grain); padding: 6% 7%; transition: transform .8s var(--ease) .3s; box-shadow: 0 -2px 10px rgba(41, 37, 31, .12); }
.env-card .hand { font-size: clamp(1.1rem, 3.4vw, 1.6rem); color: var(--burgundy); margin: 0; line-height: 1.3; }
.env-card .hand + .hand { color: #2c2a4a; font-size: clamp(.95rem, 2.8vw, 1.25rem); margin-top: .5em; }
.env-front { inset: 0; z-index: 3; background: linear-gradient(160deg, #eee4d1, var(--parchment)) ; clip-path: polygon(0 0, 50% 56%, 100% 0, 100% 100%, 0 100%); }
.env-front::after { content: ""; position: absolute; inset: 0; background: var(--grain); }
.env-flap { z-index: 4; left: 0; right: 0; top: 0; height: 56%; background: linear-gradient(180deg, #efe6d4, #e4d8c0); clip-path: polygon(0 0, 100% 0, 50% 100%); transform-origin: 50% 0; transform: perspective(800px) rotateX(0deg); transition: transform .7s var(--ease), z-index 0s .35s; backface-visibility: visible; }
.env-flap::after { content: ""; position: absolute; inset: 0; background: var(--grain); }
.env-seal { z-index: 5; left: 50%; top: 56%; width: 17%; transform: translate(-50%, -58%); transition: opacity .3s, transform .5s var(--ease); }
.art-env.is-open .env-flap { transform: perspective(800px) rotateX(180deg); z-index: 1; background: linear-gradient(0deg, #e9dec9, #d9cbb1); }
.art-env.is-open .env-card { transform: translateY(-46%); }
.art-env.is-open .env-seal { opacity: 0; transform: translate(-50%, -58%) scale(.6) rotate(25deg); }
.art-toggle { position: absolute; left: 0; bottom: 0; z-index: 6; display: inline-flex; align-items: center; gap: .55rem; min-height: 44px; padding: .5rem 1rem; background: var(--ivory); border: 1px solid var(--line); border-radius: 2px; font: 500 .85rem var(--sans); color: var(--ink); cursor: pointer; }
.art-toggle:hover { border-color: var(--burgundy); color: var(--burgundy); }
.art-caption { position: absolute; right: 0; bottom: -2.2rem; font-size: .74rem; color: var(--muted); letter-spacing: .04em; }
@media (min-width: 960px) {
  .hero-grid { grid-template-columns: 1.08fr .92fr; gap: 3rem; }
  .art-caption { bottom: -1.9rem; }
}
@media (max-width: 959px) { .hero-art { max-width: 460px; margin-bottom: 2.4rem; } }

/* ---------- Occasions ---------- */
.section-head { max-width: 46rem; margin-bottom: clamp(2.2rem, 5vw, 3.6rem); }
.section-head .lead { margin-top: 1.1rem; }
.occ-grid { display: grid; gap: 14px; grid-template-columns: 1fr; list-style: none; padding: 0; margin: 0; }
.occ { position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 220px; padding: clamp(1.3rem, 2.4vw, 2rem); text-decoration: none; color: var(--ink); overflow: hidden; isolation: isolate; transition: transform .35s var(--ease), box-shadow .35s var(--ease); height: 100%; }
.occ:hover { text-decoration: none; transform: translateY(-3px); box-shadow: 0 24px 40px -24px rgba(41, 37, 31, .45); }
.occ-no { position: absolute; top: 1.1rem; left: clamp(1.3rem, 2.4vw, 2rem); font: 600 .72rem var(--sans); letter-spacing: .2em; opacity: .75; }
.occ-name { font-size: clamp(1.6rem, 3vw, 2.3rem); margin-bottom: .35rem; }
.occ-blurb { font-size: .95rem; margin: 0 0 .9rem; max-width: 26em; opacity: .9; }
.occ-line { font-family: var(--hand); font-size: 1.45rem; line-height: 1.2; margin: 0 0 1rem; max-width: 22em; }
.occ-go { font: 600 .8rem var(--sans); letter-spacing: .12em; text-transform: uppercase; display: inline-flex; align-items: center; gap: .6rem; }
.occ-go::after { content: ""; width: 28px; height: 1px; background: currentColor; transition: width .3s var(--ease); }
.occ:hover .occ-go::after { width: 48px; }
.tone-paper { background: var(--ivory-2) var(--grain); box-shadow: inset 0 0 0 1px var(--line); }
.tone-parchment { background: var(--parchment) var(--grain); }
.tone-taupe { background: var(--taupe) var(--grain); color: var(--ink); }
.tone-taupe .occ-line { color: #3b1218; }
.tone-ink { background: var(--ink); color: var(--ivory); }
.tone-ink .occ-line { color: var(--gold-light); }
.tone-burgundy { background: var(--burgundy); color: var(--ivory); }
.tone-burgundy .occ-line { color: #f1d9c2; }
.tone-paper .occ-line, .tone-parchment .occ-line { color: var(--burgundy); }
.occ::before { content: ""; position: absolute; z-index: -1; pointer-events: none; }
/* Per-tone motifs, drawn only with CSS */
.tone-paper::before { inset: auto 0 0 0; height: 55%; background: repeating-linear-gradient(transparent 0 27px, rgba(184, 170, 152, .35) 27px 28px); opacity: .7; }
.tone-parchment::before { right: -30px; top: -30px; width: 120px; height: 120px; border: 1px solid rgba(100, 44, 53, .25); border-radius: 50%; box-shadow: 0 0 0 10px rgba(172, 145, 98, .1), 0 0 0 11px rgba(100, 44, 53, .15); }
.tone-ink::before { right: 1.4rem; top: 1.4rem; width: 54px; height: 70px; border: 1px solid rgba(211, 191, 147, .5); outline: 1px solid rgba(211, 191, 147, .25); outline-offset: 5px; }
.tone-burgundy::before { right: -40px; top: -40px; width: 150px; height: 150px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .13), transparent 60%); box-shadow: inset 0 0 0 1px rgba(247, 242, 233, .2); }
.tone-taupe::before { right: 1.4rem; top: 1.4rem; width: 56px; height: 66px; border: 2px dashed rgba(41, 37, 31, .35); }
@media (min-width: 640px) { .occ-grid { grid-template-columns: repeat(2, 1fr); } .occ:nth-child(1), .occ:nth-child(8), .occ:nth-child(10) { grid-column: 1 / -1; } }
@media (min-width: 960px) {
  .occ-grid { grid-template-columns: repeat(12, 1fr); grid-auto-rows: minmax(120px, auto); }
  .occ-grid > li { grid-column: span 4; grid-row: span 2; }
  .occ-grid > li:nth-child(1) { grid-column: 1 / 7; grid-row: 1 / 4; }
  .occ-grid > li:nth-child(2) { grid-column: 7 / 13; grid-row: 1 / 2; }
  .occ-grid > li:nth-child(3) { grid-column: 7 / 10; grid-row: 2 / 4; }
  .occ-grid > li:nth-child(4) { grid-column: 10 / 13; grid-row: 2 / 4; }
  .occ-grid > li:nth-child(5) { grid-column: 1 / 5; grid-row: 4 / 6; }
  .occ-grid > li:nth-child(6) { grid-column: 5 / 9; grid-row: 4 / 6; }
  .occ-grid > li:nth-child(7) { grid-column: 9 / 13; grid-row: 4 / 6; }
  .occ-grid > li:nth-child(8) { grid-column: 1 / 8; grid-row: 6 / 8; }
  .occ-grid > li:nth-child(9) { grid-column: 8 / 13; grid-row: 6 / 8; }
  .occ-grid > li:nth-child(10) { grid-column: 1 / 13; grid-row: 8 / 9; }
  .occ-grid > li:nth-child(1) .occ-name { font-size: clamp(2.4rem, 4vw, 3.4rem); }
  .occ-grid > li:nth-child(1) .occ-line { font-size: 1.9rem; }
  .occ-grid > li:nth-child(10) .occ { flex-direction: row; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap; min-height: 0; }
}
.occ-foot { margin-top: 2rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; color: var(--muted); }

/* ---------- How it works ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 2.6rem; counter-reset: step; }
.step { position: relative; padding-top: 1.4rem; border-top: 1px solid rgba(211, 191, 147, .4); }
.step-no { font-family: var(--serif); font-style: italic; font-size: clamp(4rem, 9vw, 6.5rem); line-height: .85; color: var(--gold-light); display: block; margin-bottom: 1rem; }
.step h3 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin-bottom: .7rem; }
.step p { color: var(--taupe-soft); max-width: 24em; }
.after { margin-top: clamp(3rem, 6vw, 4.5rem); padding: clamp(1.4rem, 3vw, 2.4rem); border: 1px solid rgba(211, 191, 147, .35); display: grid; gap: 1.2rem; }
.after h3 { font-size: 1.6rem; }
.after ol { margin: 0; padding-left: 1.2rem; color: var(--taupe-soft); display: grid; gap: .6rem; }
.after ol li::marker { color: var(--gold-light); font-weight: 600; }
@media (min-width: 860px) {
  .steps { grid-template-columns: repeat(3, 1fr); gap: 2.4rem; }
  .step:nth-child(2) { margin-top: 3rem; } .step:nth-child(3) { margin-top: 6rem; }
  .after { grid-template-columns: 1fr 1.6fr; align-items: start; gap: 3rem; }
}

/* ---------- Craft ---------- */
.craft-grid { display: grid; gap: 3rem; align-items: center; }
.craft-visual { position: relative; min-height: 420px; max-width: 520px; width: 100%; margin-inline: auto; }
.craft-sheet-a, .craft-sheet-b { position: absolute; }
.craft-sheet-a { inset: 4% 14% 8% 0; transform: rotate(-3deg); padding: 12% 11%; background-color: var(--ivory-2); }
.craft-sheet-b { inset: 12% 0 0 22%; transform: rotate(4deg); background-color: var(--parchment); z-index: -1; }
.craft-sheet-a .hand { font-size: clamp(1.7rem, 5vw, 2.4rem); line-height: 1.35; color: #2c2a4a; margin: 0; }
.craft-sheet-a .hand + .hand { margin-top: .8rem; font-size: clamp(1.3rem, 4vw, 1.8rem); color: var(--burgundy); }
.craft-seal { position: absolute; right: 6%; bottom: 2%; width: 92px; z-index: 3; transform: rotate(8deg); }
.craft-copy blockquote { margin: 1.6rem 0 0; padding-left: 1.3rem; border-left: 2px solid var(--gold); font-family: var(--serif); font-style: italic; font-size: clamp(1.35rem, 2.6vw, 1.8rem); line-height: 1.25; color: var(--ink-2); }
.principles { display: grid; gap: 1.6rem; margin-top: 2.4rem; }
.principle h3 { font-family: var(--sans); font-size: .85rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: var(--burgundy); margin-bottom: .4rem; }
.principle p { margin: 0; color: var(--muted); }
@media (min-width: 900px) { .craft-grid { grid-template-columns: .95fr 1.05fr; gap: clamp(3rem, 7vw, 6rem); } }
@media (min-width: 640px) and (max-width: 899px) { .principles { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Facts / pricing ---------- */
.facts { display: grid; gap: 0; border-top: 1px solid var(--ink); }
.fact { display: grid; gap: .2rem 2rem; padding: 1.3rem 0; border-bottom: 1px solid var(--line); }
.fact dt { font: 600 .78rem var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--burgundy); }
.fact dd { margin: 0; font-family: var(--serif); font-size: 1.4rem; line-height: 1.3; }
.fact dd .sub { display: block; font: 400 .9rem var(--sans); color: var(--muted); margin-top: .2rem; }
@media (min-width: 720px) { .fact { grid-template-columns: 14rem 1fr; align-items: baseline; } }
.pricing-grid { display: grid; gap: 3rem; }
@media (min-width: 960px) { .pricing-grid { grid-template-columns: .8fr 1.2fr; gap: 6rem; } }

/* ---------- FAQ ---------- */
.faq { border-top: 1px solid var(--ink); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 1.4rem; padding: 1.3rem 0; min-height: 64px; font-family: var(--serif); font-size: clamp(1.3rem, 2.6vw, 1.65rem); line-height: 1.2; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; font: 400 1.3rem/1 var(--sans); color: var(--burgundy); transition: transform .3s var(--ease), background .2s; }
.faq details[open] summary::after { content: "−"; background: var(--burgundy); color: var(--ivory); border-color: var(--burgundy); }
.faq summary:hover { color: var(--burgundy); }
.faq .answer { padding: 0 3rem 1.6rem 0; color: var(--muted); max-width: 46rem; animation: fade-in .35s var(--ease); }
.faq .answer p { margin: 0; }
.split { display: grid; gap: 2.4rem; }
@media (min-width: 960px) { .split { grid-template-columns: .7fr 1.3fr; gap: 6rem; } .split .sticky { position: sticky; top: calc(var(--header-h) + 24px); align-self: start; } }

/* ---------- Closing CTA ---------- */
.cta-final { text-align: left; position: relative; overflow: hidden; }
.cta-final .h2 { max-width: 14em; }
.cta-final p.lead { color: #ead9d3; }
.cta-seal { position: absolute; right: max(var(--gutter), 6%); top: 50%; width: clamp(110px, 18vw, 200px); transform: translateY(-50%) rotate(10deg); opacity: .95; display: none; }
@media (min-width: 760px) { .cta-seal { display: block; } }

/* ---------- Footer ---------- */
.footer { background: var(--ink); color: var(--taupe-soft); padding-block: clamp(3rem, 6vw, 5rem) 2rem; font-size: .93rem; }
.footer a { color: var(--ivory); text-decoration-color: rgba(211, 191, 147, .5); }
.footer .wordmark { color: var(--ivory); font-size: 2rem; }
.footer .wordmark em { color: var(--gold-light); }
.footer-grid { display: grid; gap: 2.4rem; }
.footer h2 { font: 600 .74rem var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--gold-light); margin-bottom: 1rem; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.footer li a { display: inline-block; padding: .6rem 0; text-decoration: none; }
.footer li a:hover { text-decoration: underline; }
.footer-brand p { max-width: 24em; margin-top: 1rem; font-family: var(--serif); font-style: italic; font-size: 1.25rem; color: var(--taupe-soft); }
.footer-base { margin-top: 3rem; padding-top: 1.4rem; border-top: 1px solid rgba(184, 170, 152, .25); display: flex; flex-wrap: wrap; gap: .6rem 2rem; justify-content: space-between; font-size: .84rem; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; } }

/* ---------- Page header (inner pages) ---------- */
.page-head { padding-block: clamp(3rem, 7vw, 5.5rem) clamp(2rem, 4vw, 3rem); border-bottom: 1px solid var(--line); background: var(--ivory-2) var(--grain); }
.page-head .lead { margin-top: 1.2rem; }
.policy { padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(4rem, 8vw, 7rem); }
.policy h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin: 2.6rem 0 .8rem; }
.policy p { max-width: 42rem; color: var(--ink-2); }
.notice { border: 1px solid var(--gold); background: rgba(172, 145, 98, .12); padding: 1rem 1.2rem; margin: 0 0 2rem; font-size: .93rem; max-width: 42rem; }
.notice strong { color: var(--burgundy-deep); }
.notice.error { border-color: var(--error); background: rgba(155, 28, 44, .07); }
.notice.ok { border-color: #4b6b46; background: rgba(75, 107, 70, .1); }
.policy-nav { display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; margin-top: 1.4rem; font-size: .9rem; }

/* ---------- Forms ---------- */
.field { margin-bottom: 1.4rem; }
.field > label, .legend { display: block; font-weight: 600; font-size: .95rem; margin-bottom: .4rem; color: var(--ink); }
.opt { font-weight: 400; color: var(--muted); font-size: .85rem; margin-left: .35rem; }
.hint { display: block; font-size: .87rem; color: var(--muted); margin-bottom: .55rem; line-height: 1.45; }
input[type="text"], input[type="email"], input[type="tel"], select, textarea {
  width: 100%; min-height: 52px; padding: .8rem 1rem; font: 400 1rem/1.5 var(--sans); color: var(--ink);
  background: #fffdf9; border: 1px solid var(--taupe); border-radius: 2px; appearance: none; -webkit-appearance: none;
  transition: border-color .2s, box-shadow .2s;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 2.6rem; }
textarea { resize: vertical; min-height: 120px; }
input:hover, select:hover, textarea:hover { border-color: var(--ink-2); }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--burgundy); box-shadow: 0 0 0 3px rgba(100, 44, 53, .22); }
[aria-invalid="true"] { border-color: var(--error) !important; border-width: 2px; background-color: #fff8f7; }
.field-error { display: none; margin: .45rem 0 0; font-size: .88rem; font-weight: 500; color: var(--error); }
.field-error::before { content: "⚠ Error: "; font-weight: 600; }
.field.has-error .field-error, fieldset.has-error .field-error { display: block; }
.row { display: grid; gap: 0 1.2rem; }
@media (min-width: 640px) { .row.two { grid-template-columns: 1fr 1fr; } .row.three { grid-template-columns: 1fr 1fr 1fr; } }
fieldset { border: 0; padding: 0; margin: 0 0 1.4rem; min-width: 0; }
.check { display: flex; gap: .8rem; align-items: flex-start; font-size: .93rem; }
.check input { flex: none; width: 24px; height: 24px; margin: .1rem 0 0; accent-color: var(--burgundy); }
.check label { margin: 0; font-weight: 400; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Choice cards (radio) */
.choices { display: grid; gap: 10px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.choice-body { display: block; padding: 1rem 1.1rem 1rem 3.1rem; background: #fffdf9; border: 1px solid var(--taupe); border-radius: 2px; position: relative; transition: border-color .2s, background .2s, transform .2s var(--ease); }
.choice-body::before { content: ""; position: absolute; left: 1.05rem; top: 1.2rem; width: 20px; height: 20px; border: 1.5px solid var(--ink-2); border-radius: 50%; background: #fff; }
.choice-body::after { content: ""; position: absolute; left: calc(1.05rem + 5px); top: calc(1.2rem + 5px); width: 10px; height: 10px; border-radius: 50%; background: var(--burgundy); transform: scale(0); transition: transform .2s var(--ease); }
.choice input:checked + .choice-body { border-color: var(--burgundy); border-width: 2px; background: #fbf3ee; padding: calc(1rem - 1px) calc(1.1rem - 1px) calc(1rem - 1px) calc(3.1rem - 1px); }
.choice input:checked + .choice-body::before { border-color: var(--burgundy); }
.choice input:checked + .choice-body::after { transform: scale(1); }
.choice input:focus-visible + .choice-body { outline: 3px solid var(--burgundy); outline-offset: 2px; }
.choice input:hover + .choice-body { border-color: var(--ink); }
.choice-title { display: block; font-weight: 600; }
.choice-title .tick { display: none; }
.choice input:checked + .choice-body .choice-title .tick { display: inline; color: var(--burgundy); font-weight: 600; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; margin-left: .5rem; }
.choice-sub { display: block; font-size: .88rem; color: var(--muted); margin-top: .15rem; }
.choice-sub.hand-line { font-family: var(--hand); font-size: 1.25rem; color: var(--burgundy); line-height: 1.2; }
.choices.cols { grid-template-columns: 1fr; }
@media (min-width: 560px) { .choices.cols { grid-template-columns: 1fr 1fr; } }
.choices.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.choices.chips .choice-body { padding: .6rem 1rem; }
.choices.chips .choice-body::before, .choices.chips .choice-body::after { display: none; }
.choices.chips .choice input:checked + .choice-body { padding: calc(.6rem - 1px) calc(1rem - 1px); background: var(--burgundy); color: var(--ivory); border-color: var(--burgundy); }
.choices.chips .choice input:checked + .choice-body .choice-title .tick { display: none; }

/* ---------- Create layout ---------- */
.create-wrap { padding-block: clamp(1.6rem, 4vw, 3.5rem) clamp(4rem, 8vw, 6rem); }
.create-grid { display: grid; gap: 2rem; align-items: start; }
@media (min-width: 1020px) { .create-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 3.5rem; } .preview-col { position: sticky; top: calc(var(--header-h) + 20px); } }
.form-card { background: var(--ivory-2) var(--grain); border: 1px solid var(--line); padding: clamp(1.3rem, 3.5vw, 2.4rem); }
.stepper { list-style: none; margin: 0 0 1.8rem; padding: 0; display: flex; gap: 6px; }
.stepper li { flex: 1; min-width: 0; }
.stepper button { all: unset; box-sizing: border-box; display: block; width: 100%; cursor: pointer; padding: .6rem 0 0; border-top: 3px solid var(--taupe-soft); font: 600 .72rem/1.2 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.stepper button:focus-visible { outline: 3px solid var(--burgundy); outline-offset: 2px; }
.stepper .done button { border-top-color: var(--gold); color: var(--ink); }
.stepper [aria-current="step"] button { border-top-color: var(--burgundy); color: var(--burgundy); }
.stepper button[disabled] { cursor: default; }
.stepper .lbl { display: none; }
@media (min-width: 640px) { .stepper .lbl { display: block; margin-top: .15rem; } }
.stepper .num { display: block; }
.step-panel { animation: step-in .45s var(--ease); }
.step-panel[hidden] { display: none; }
.step-panel > h2 { font-size: clamp(1.9rem, 4.6vw, 2.6rem); margin-bottom: .5rem; }
.step-panel > h2:focus { outline: 0; }
.step-intro { color: var(--muted); margin-bottom: 1.8rem; max-width: 36em; }
.error-summary { border: 2px solid var(--error); background: #fff4f2; padding: 1rem 1.2rem; margin-bottom: 1.4rem; }
.error-summary h3 { font: 600 1rem var(--sans); margin-bottom: .4rem; color: var(--error); }
.error-summary ul { margin: 0; padding-left: 1.2rem; }
.error-summary a { color: var(--error); font-weight: 500; }
.error-summary[hidden] { display: none; }
.actions { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: space-between; align-items: center; margin-top: 2rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.actions .btn { flex: 1 1 160px; }
@media (min-width: 560px) { .actions .btn { flex: 0 0 auto; } }
.pill { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .6rem; padding: .35rem .5rem .35rem 1rem; border: 1px solid var(--gold); background: rgba(172, 145, 98, .12); font-size: .9rem; margin-bottom: 1.4rem; }
.pill button { background: none; border: 0; text-decoration: underline; color: var(--burgundy); font: 600 .85rem var(--sans); cursor: pointer; min-height: 36px; padding: 0 .6rem; }
.count { display: flex; justify-content: space-between; gap: 1rem; font-size: .88rem; color: var(--muted); margin-top: .5rem; flex-wrap: wrap; }
.count .over { color: var(--error); font-weight: 600; }
textarea.message { min-height: 240px; font-family: var(--serif); font-size: 1.28rem; line-height: 1.55; overflow: hidden; resize: none; }
.ideas { margin-top: 1.4rem; padding: 1.1rem 1.2rem; background: rgba(232, 221, 201, .55); border-left: 2px solid var(--gold); }
.ideas h3 { font: 600 .78rem var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--burgundy); margin-bottom: .6rem; }
.ideas ul { margin: 0 0 .8rem; padding-left: 1.1rem; color: var(--ink-2); font-size: .94rem; }
details.more { margin: 1.4rem 0; border: 1px solid var(--line); background: #fffdf9; }
details.more summary { cursor: pointer; padding: .9rem 1.1rem; font-weight: 600; min-height: 48px; display: flex; align-items: center; }
details.more > div { padding: .2rem 1.1rem 1rem; }
.draft-box { margin: 0 0 1.6rem; padding: .9rem 1rem; border: 1px dashed var(--taupe); font-size: .88rem; color: var(--muted); }
.draft-box .check { align-items: center; }
.draft-box button { margin-top: .5rem; background: none; border: 0; color: var(--burgundy); text-decoration: underline; cursor: pointer; font: 500 .88rem var(--sans); min-height: 40px; padding: 0; }
.why { font-size: .88rem; color: var(--muted); background: rgba(232, 221, 201, .45); padding: .8rem 1rem; margin-bottom: 1.4rem; }

/* Review */
.review { border-top: 1px solid var(--ink); margin: 0; }
.review-item { display: grid; gap: .3rem 1rem; padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.review-item dt { font: 600 .74rem var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--burgundy); display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.review-item dd { margin: 0; overflow-wrap: anywhere; }
.review-item dd.pre { white-space: pre-wrap; font-family: var(--serif); font-size: 1.15rem; max-height: 12rem; overflow: auto; }
.review-item .edit { background: none; border: 0; color: var(--burgundy); text-decoration: underline; font: 500 .85rem var(--sans); cursor: pointer; min-height: 40px; padding: 0 .3rem; letter-spacing: 0; text-transform: none; }
.price { width: 100%; border-collapse: collapse; margin: 1.6rem 0 1rem; font-size: .96rem; }
.price th { font-weight: 400; text-align: left; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.price td { text-align: right; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.price tr.total th, .price tr.total td { font-weight: 600; font-size: 1.05rem; border-bottom: 2px solid var(--ink); }
.tbc-text { color: var(--muted); font-style: italic; }
.status-box { margin-top: 1.4rem; }
.spinner { width: 18px; height: 18px; border: 2px solid rgba(247, 242, 233, .4); border-top-color: var(--ivory); border-radius: 50%; animation: spin .8s linear infinite; }
.summary-pre { white-space: pre-wrap; font: .85rem/1.5 ui-monospace, Menlo, monospace; background: #fffdf9; border: 1px solid var(--line); padding: 1rem; max-height: 260px; overflow: auto; overflow-wrap: anywhere; }

/* ---------- Letter preview ---------- */
.preview-wrap > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; min-height: 52px; padding: 0 1.1rem; border: 1px solid var(--ink); font-weight: 600; background: var(--ivory-2); }
.preview-wrap > summary::-webkit-details-marker { display: none; }
.preview-wrap > summary::after { content: "Show"; font: 500 .85rem var(--sans); color: var(--burgundy); }
.preview-wrap[open] > summary::after { content: "Hide"; }
@media (min-width: 1020px) { .preview-wrap > summary { display: none; } }
.preview-inner { padding-top: 1.2rem; }
.preview-bar { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.preview-bar h2 { font-size: 1.5rem; }
.seg { display: inline-flex; border: 1px solid var(--ink); border-radius: 2px; overflow: hidden; }
.seg label { position: relative; margin: 0; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: block; padding: .55rem .9rem; font-size: .84rem; font-weight: 500; min-height: 40px; display: flex; align-items: center; }
.seg input:checked + span { background: var(--ink); color: var(--ivory); }
.seg input:checked + span::before { content: "✓ "; margin-right: .3em; }
.seg input:focus-visible + span { outline: 3px solid var(--burgundy); outline-offset: -3px; }
.desk { background: var(--parchment) var(--grain); padding: clamp(14px, 3.4vw, 34px); }
.letter { background-color: var(--ivory-2); background-image: var(--grain); padding: clamp(1.4rem, 6vw, 3rem) clamp(1.3rem, 6vw, 3.2rem) clamp(1.6rem, 6vw, 3rem); min-height: 380px; box-shadow: 0 1px 1px rgba(41, 37, 31, .1), 0 18px 30px -16px rgba(41, 37, 31, .45); position: relative; overflow: hidden; transform: rotate(-.4deg); transition: transform .5s var(--ease); }
.letter-greeting, .letter-body, .letter-closing, .letter-sign { overflow-wrap: anywhere; word-break: break-word; }
.letter-body { white-space: pre-wrap; margin: 0; }
.letter-greeting { margin: 0 0 .8em; }
.letter-closing { margin: 1.2em 0 0; }
.letter-sign { margin: .2em 0 0; }
.letter.is-empty .letter-body { color: #8a7f6d; font-style: italic; }
.letter--classic { font-family: var(--serif); font-size: clamp(1.1rem, 3.4vw, 1.35rem); line-height: 1.7; color: #2b2723; }
.letter--handwritten { font-family: var(--hand); font-size: clamp(1.3rem, 4.6vw, 1.7rem); line-height: 2rem; color: #2c2a4a; padding-top: calc(clamp(1.4rem, 6vw, 3rem) + .5rem); background-image: repeating-linear-gradient(transparent 0 calc(2rem - 1px), rgba(172, 145, 98, .3) calc(2rem - 1px) 2rem), var(--grain); background-position: 0 calc(clamp(1.4rem, 6vw, 3rem) + 1.4rem), 0 0; background-repeat: repeat-y, repeat; }
.letter--handwritten p { margin-block: 0; }
.letter--handwritten .letter-greeting, .letter--handwritten .letter-closing { margin-block: 0; }
.letter--handwritten .letter-greeting { margin-bottom: 2rem; }
.letter--handwritten .letter-closing { margin-top: 2rem; }
.letter--handwritten .letter-sign { color: var(--burgundy); }
.letter .letter-mark { position: absolute; top: .9rem; right: 1rem; font: 600 .62rem var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
.env-mini { margin: 1.4rem auto 0; width: min(100%, 360px); aspect-ratio: 10 / 6.4; background: var(--parchment-deep) var(--grain); position: relative; box-shadow: 0 14px 22px -14px rgba(41, 37, 31, .5); overflow: hidden; }
.env-mini::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom right, transparent 49.5%, rgba(41, 37, 31, .12) 50%) , linear-gradient(to bottom left, transparent 49.5%, rgba(41, 37, 31, .12) 50%); clip-path: polygon(0 0, 100% 0, 50% 58%); background: #eadfca; }
.env-mini .to { position: absolute; left: 9%; right: 9%; bottom: 14%; font-family: var(--hand); font-size: clamp(1.15rem, 4.4vw, 1.5rem); line-height: 1.15; color: #2c2a4a; overflow-wrap: anywhere; }
.env-mini .to small { display: block; font: 600 .6rem var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-bottom: .1rem; }
.env-mini img { position: absolute; width: 17%; left: 50%; top: 58%; transform: translate(-50%, -58%); }
.preview-note { font-size: .82rem; color: var(--muted); margin-top: 1rem; }
.preview-tools { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .9rem; }
@media (min-width: 1020px) { .only-mobile { display: none; } }

/* ---------- Contact ---------- */
.contact-grid { display: grid; gap: 3rem; }
@media (min-width: 900px) { .contact-grid { grid-template-columns: 1.2fr .8fr; gap: 5rem; } }
.contact-list { list-style: none; padding: 0; margin: 1.2rem 0 0; display: grid; gap: .9rem; }
.contact-list dt { font: 600 .74rem var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--burgundy); }
.contact-list dd { margin: 0 0 1rem; }

/* ---------- Reveal & motion ---------- */
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes step-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- Print: letter preview only ---------- */
@media print {
  body.print-letter > *:not(main), body.print-letter .site-header, body.print-letter .footer, body.print-letter .form-card, body.print-letter .page-head, body.print-letter .preview-bar, body.print-letter .preview-tools, body.print-letter .preview-note, body.print-letter .env-mini, body.print-letter summary { display: none !important; }
  body.print-letter .create-grid { display: block; }
  body.print-letter .desk { background: none; padding: 0; }
  body.print-letter .letter { box-shadow: none; transform: none; border: 1px solid #ccc; min-height: 0; }
  body.print-letter .preview-wrap { display: block; }
  body.print-letter::after { content: "Digital preview of wording and layout — not the finished handwritten letter."; display: block; font: 12px var(--sans); margin-top: 12px; color: #555; }
  .site-header, .footer, .hero-art { display: none !important; }
}

/* =====================================================================
   Vintage paper — aged, fibrous stationery (overrides the flat ivory)
   ===================================================================== */
:root {
  --aged: #ecdcb8;
  --aged-light: #f3e8cb;
  --sepia-ink: #34261a;
  --fibers: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='520' height='520'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.035 .22' numOctaves='3' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .42 0 0 0 0 .3 0 0 0 0 .16 0 0 0 .13 -.02'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
  --grain-strong: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .2 0 0 0 0 .1 0 0 0 .2 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --age:
    radial-gradient(ellipse 60% 45% at 18% 12%, rgba(255, 250, 228, .6), transparent 70%),
    radial-gradient(circle at 88% 92%, rgba(150, 100, 45, .22), transparent 38%),
    radial-gradient(circle at 8% 78%, rgba(140, 90, 40, .16), transparent 26%),
    radial-gradient(circle 5px at 72% 22%, rgba(130, 85, 35, .22), transparent 100%),
    radial-gradient(circle 3px at 24% 62%, rgba(120, 75, 30, .2), transparent 100%),
    radial-gradient(circle 7px at 90% 48%, rgba(135, 90, 40, .14), transparent 100%);
}
.paper, .letter, .art-sheet, .craft-sheet-a, .env-card, .tone-paper {
  background-color: var(--aged-light);
  background-image: var(--age), var(--fibers), var(--grain-strong);
  background-repeat: no-repeat, repeat, repeat;
  box-shadow:
    inset 0 0 38px rgba(125, 82, 34, .30),
    inset 0 0 5px rgba(95, 58, 24, .42),
    0 1px 1px rgba(41, 37, 31, .1), 0 16px 28px -14px rgba(41, 37, 31, .45), 0 34px 56px -34px rgba(41, 37, 31, .35);
}
.craft-sheet-b, .env-back { background-color: #d9c49a; background-image: var(--fibers), var(--grain-strong); }
.env-front, .env-flap { background: linear-gradient(160deg, #ead9b4, #dcc79b); }
.env-front::after, .env-flap::after { background: var(--fibers), var(--grain-strong); }
.env-mini { background: #d4bd8f var(--fibers); }
.env-mini::before { background: #e3d0a6; }
.desk { background-image: var(--fibers), var(--grain); }
.section-parchment { background-color: #e4d3ae; }
.art-sheet p, .craft-sheet-a .hand, .env-card .hand + .hand, .env-mini .to, .letter--handwritten { color: var(--sepia-ink); }
.letter--classic { color: #30241a; }
.letter--handwritten { background-image: var(--age), var(--fibers), var(--grain-strong); background-position: 0 0; background-repeat: no-repeat, repeat, repeat; }
.letter--handwritten::before { content: ""; position: absolute; z-index: -1; left: 0; right: 0; bottom: 0; top: calc(clamp(1.4rem, 6vw, 3rem) + 1.4rem); background: repeating-linear-gradient(transparent 0 calc(2rem - 1px), rgba(125, 82, 34, .28) calc(2rem - 1px) 2rem); pointer-events: none; }
.letter.is-empty .letter-body { color: #8a7456; }
.letter--handwritten .letter-sign { color: var(--burgundy); }

/* ---------- Falling leaves (hero) — decorative, CSS-only ---------- */
.hero { position: relative; }
.hero .container { position: relative; z-index: 1; }
.leaves { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.leaf { position: absolute; top: -40px; left: var(--x); width: calc(var(--s) * 1.6); height: calc(var(--s) * 2.13); opacity: 0; will-change: transform, opacity; animation: leaf-fall var(--fall) linear var(--delay) infinite; }
.leaf::before { content: ""; position: absolute; inset: 0; background: center / contain no-repeat; animation: leaf-sway var(--sway) ease-in-out var(--delay) infinite alternate; filter: drop-shadow(0 2px 2px rgba(41, 37, 31, .18)); }
.leaf.l1::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 32'%3E%3Cpath d='M12 1C21 8 21 20 12 31 3 20 3 8 12 1Z' fill='%23A8562B'/%3E%3Cpath d='M12 5v26M12 12l-4-3M12 17l5-4M12 22l-5-3' stroke='%233b1d0e' stroke-width='.9' fill='none' opacity='.55'/%3E%3C/svg%3E"); }
.leaf.l2::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 32'%3E%3Cpath d='M12 1C21 8 21 20 12 31 3 20 3 8 12 1Z' fill='%23C79A3B'/%3E%3Cpath d='M12 5v26M12 12l-4-3M12 17l5-4M12 22l-5-3' stroke='%235a3b0c' stroke-width='.9' fill='none' opacity='.55'/%3E%3C/svg%3E"); }
.leaf.l3::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 32'%3E%3Cpath d='M12 1C21 8 21 20 12 31 3 20 3 8 12 1Z' fill='%237C3B2A'/%3E%3Cpath d='M12 5v26M12 12l-4-3M12 17l5-4M12 22l-5-3' stroke='%232c140c' stroke-width='.9' fill='none' opacity='.55'/%3E%3C/svg%3E"); }
@keyframes leaf-fall {
  0% { transform: translate3d(0, -4vh, 0); opacity: 0; }
  8% { opacity: .85; }
  88% { opacity: .85; }
  100% { transform: translate3d(var(--drift), 105vh, 0); opacity: 0; }
}
@keyframes leaf-sway {
  from { transform: translateX(-18px) rotate(calc(var(--spin) * -1)); }
  to { transform: translateX(18px) rotate(var(--spin)) rotateY(32deg); }
}
@media (max-width: 600px) { .leaf:nth-child(n+5) { display: none; } }
@media (prefers-reduced-motion: reduce) { .leaves { display: none; } }
@media print { .leaves { display: none; } }

/* Reserve the header's height before site.js injects it (prevents layout shift) */
#site-header { min-height: var(--header-h); }

/* Create page: reserve space for script-built parts so nothing jumps */
.stepper { min-height: 3rem; }
#occasion-choices { min-height: 790px; }
@media (min-width: 560px) { #occasion-choices { min-height: 420px; } }
@media (min-width: 1020px) { .preview-col { min-height: 640px; } }
.prefill .step-panel[data-step="1"] { display: none; }
@media (min-width: 1020px) { .form-card { min-height: 720px; } }

/* Print preview: show only the letter (fixes draft box and form leaking into print) */
@media print {
  body.print-letter .form-col, body.print-letter .draft-box, body.print-letter .create-wrap > .container > :not(.create-grid),
  body.print-letter #site-header, body.print-letter #site-footer, body.print-letter .skip-link { display: none !important; }
  body.print-letter .create-grid { display: block !important; }
  body.print-letter .preview-col { position: static; min-height: 0; width: 100%; }
  body.print-letter .preview-inner { padding: 0; }
  body.print-letter .preview-wrap > summary { display: none !important; }
  body.print-letter .letter { max-width: 100%; page-break-inside: avoid; }
  body.print-letter .letter, body.print-letter .desk { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@media print {
  body.print-letter .letter-mark { display: none; }
  body.print-letter::after { padding: 0 1rem; }
  body.print-letter .create-wrap { padding: 1rem; }
}

/* =====================================================================
   App-style mobile experience (phones and small tablets)
   ===================================================================== */
a, button, summary, label { -webkit-tap-highlight-color: transparent; }
html { overscroll-behavior-y: none; }
.swipe-hint { display: none; }
.tabbar { display: none; }

@media (max-width: 899px) {
  :root { --header-h: 56px; --tab-h: 64px; }
  .site-header { padding-top: env(safe-area-inset-top); background: rgba(247, 242, 233, .96); }
  .header-inner { height: var(--header-h); }
  .wordmark { font-size: 1.55rem; }
  .menu-btn { border-color: transparent; padding: 0 .6rem; }
  .nav-mobile { top: calc(100% ); }

  /* Bottom tab bar */
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: rgba(251, 248, 242, .97); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); transition: transform .25s var(--ease); view-transition-name: tabbar; }
  body.kb-open .tabbar { transform: translateY(110%); }
  .tab { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; min-height: 52px; padding: 4px 2px; color: var(--muted); text-decoration: none; font: 500 .75rem/1.1 var(--sans); border-radius: 10px; transition: color .2s, transform .15s var(--ease); }
  .tab svg { transition: transform .25s var(--ease); }
  .tab[aria-current="page"] { color: var(--burgundy); font-weight: 600; }
  .tab[aria-current="page"] svg { transform: translateY(-1px) scale(1.08); }
  .tab:active { transform: scale(.94); }
  .tab-create { color: var(--burgundy); }
  .tab-create svg { box-sizing: content-box; width: 26px; height: 26px; padding: 13px; margin-top: -26px; border-radius: 50%; background: var(--burgundy); color: var(--ivory); stroke-width: 2; box-shadow: 0 8px 18px -6px rgba(100, 44, 53, .6), 0 0 0 5px var(--ivory-2); }
  .tab-create[aria-current="page"] svg, .tab-create:active svg { transform: scale(.96); }
  .has-tabbar .footer { padding-bottom: calc(var(--tab-h) + 2.5rem + env(safe-area-inset-bottom)); }
  .has-tabbar .footer-base span:last-child { display: none; }
  html { scroll-padding-top: calc(var(--header-h) + 12px); }

  /* Tighter, card-like rhythm */
  .section { padding-block: clamp(2.6rem, 9vw, 4rem); }
  .hero { padding-block: 1.4rem 2rem; }
  .btn { border-radius: 14px; min-height: 54px; }
  .btn-sm { border-radius: 12px; }
  .cta-row .btn { flex: 1 1 100%; }
  .page-head { padding-block: 1.8rem 1.4rem; }
  .faq summary { min-height: 60px; }

  /* Occasions become a swipeable carousel */
  .occ-grid { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; margin-inline: calc(var(--gutter) * -1); padding: 4px var(--gutter) 14px; scroll-padding-inline: var(--gutter); scrollbar-width: none; overscroll-behavior-x: contain; }
  .occ-grid::-webkit-scrollbar { display: none; }
  .occ-grid > li { flex: 0 0 78%; max-width: 330px; scroll-snap-align: start; grid-column: auto !important; grid-row: auto !important; }
  .occ { min-height: 340px; border-radius: 18px; }
  .occ::before { border-radius: inherit; }
  .swipe-hint { display: flex; align-items: center; gap: .5rem; margin: .2rem 0 0; font: 600 .78rem var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
  .swipe-hint span { display: inline-block; animation: nudge 1.6s ease-in-out infinite; }

  /* Rounded, app-style surfaces */
  .paper, .letter, .after, .ideas, details.more, .notice, .desk { border-radius: 14px; }
  .art-sheet, .env-card, .craft-sheet-a, .craft-sheet-b { border-radius: 6px; }

  /* Create flow: full-bleed screens with a sticky action bar */
  .create-wrap { padding-top: .6rem; }
  .form-card { margin-inline: calc(var(--gutter) * -1); border-inline: 0; border-radius: 0; padding: 1.2rem var(--gutter) 0; background-color: var(--ivory-2); }
  .actions { position: sticky; bottom: 0; z-index: 40; margin: 1.6rem calc(var(--gutter) * -1) 0; padding: .8rem var(--gutter) calc(.8rem + env(safe-area-inset-bottom)); background: rgba(251, 248, 242, .97); border-top: 1px solid var(--line); box-shadow: 0 -10px 24px -18px rgba(41, 37, 31, .5); flex-wrap: nowrap; gap: .6rem; }
  .actions .btn { flex: 1 1 0; min-width: 0; padding-inline: .8rem; }
  .actions #back { flex: 0 0 auto; padding-inline: 1.1rem; }
  .stepper { position: sticky; top: calc(var(--header-h) + env(safe-area-inset-top)); z-index: 30; margin-inline: calc(var(--gutter) * -1); padding: .5rem var(--gutter) .6rem; background: rgba(251, 248, 242, .97); }
  .choice-body { border-radius: 14px; }
  input[type="text"], input[type="email"], input[type="tel"], select, textarea { border-radius: 12px; }
  .step-panel { animation: step-slide .35s var(--ease); }
  .draft-box { margin-bottom: 1rem; }
  .create-wrap .container > .create-grid { gap: 1rem; }
  .preview-wrap > summary { border-radius: 14px; }
}
@keyframes nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(6px); } }
@keyframes step-slide { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@media (hover: none) {
  .btn:active { transform: scale(.98); }
  .occ:active { transform: scale(.985); }
  .choice-body:active { transform: scale(.99); }
}
@media (prefers-reduced-motion: reduce) { .swipe-hint span { animation: none; } }

/* Smooth cross-page transitions where supported (Chrome/Edge/Safari 18+) */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  .site-header { view-transition-name: site-header; }
}
@media print { .tabbar, .swipe-hint { display: none !important; } }

/* =====================================================================
   Burnt vintage paper, lit envelope and animated hero
   ===================================================================== */
.burnt {
  background-color: #e6d2a2;
  background-image:
    radial-gradient(circle at 100% 0, rgba(18, 7, 2, .96) 0, rgba(38, 16, 6, .9) 6%, rgba(100, 50, 16, .6) 14%, transparent 32%),
    radial-gradient(circle at 0 100%, rgba(18, 7, 2, .9) 0, rgba(80, 40, 14, .55) 9%, transparent 27%),
    radial-gradient(circle at 100% 100%, rgba(28, 11, 4, .85) 0, rgba(100, 52, 18, .5) 9%, transparent 24%),
    radial-gradient(ellipse 60% 45% at 22% 14%, rgba(255, 246, 215, .55), transparent 70%),
    var(--fibers), var(--grain-strong);
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, repeat, repeat;
  box-shadow:
    inset 0 0 0 2px rgba(22, 10, 4, .65), inset 0 0 12px 3px rgba(34, 15, 6, .8),
    inset 0 0 34px 10px rgba(110, 58, 20, .55), inset 0 0 70px 18px rgba(150, 95, 40, .25),
    0 18px 30px -16px rgba(41, 37, 31, .55);
  border-radius: 2px !important;
}
/* Scorched preview edge (kept lighter so the text stays easy to read) */
.letter { box-shadow: inset 0 0 0 1px rgba(22, 10, 4, .5), inset 0 0 14px 2px rgba(34, 15, 6, .55), inset 0 0 42px 8px rgba(120, 64, 22, .32), 0 18px 30px -16px rgba(41, 37, 31, .45); }

/* Hero stage lighting: a warm, softly flickering glow behind the art */
.hero-stage::before { content: ""; position: absolute; z-index: 0; inset: -8% -12% -4% -8%; pointer-events: none; background: radial-gradient(closest-side at 60% 56%, rgba(255, 186, 104, .6), rgba(255, 156, 66, .22) 55%, transparent 78%); animation: candle 5.5s ease-in-out infinite alternate; }
.hero-art { z-index: 1; }
@keyframes candle { 0% { opacity: .72; transform: scale(.97); } 35% { opacity: 1; } 65% { opacity: .84; } 100% { opacity: 1; transform: scale(1.04); } }

/* The scorched letter: entrance, then a slow sway (animated wrapper; the ragged-edge filter stays static inside) */
.sheet-wrap { position: absolute; top: 0; left: 3%; width: 64%; aspect-ratio: 3 / 4; transform-origin: 30% 80%; transform: rotate(-5deg); will-change: transform; animation: sheet-in 1s var(--ease) backwards, sheet-sway 9s ease-in-out 1.2s infinite alternate; }
.art-sheet { position: absolute; inset: 0; top: 0; left: 0; width: 100%; height: 100%; aspect-ratio: auto; transform: none; filter: url(#burnt-edge); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(-30px) rotate(-14deg); } to { opacity: 1; transform: rotate(-5deg); } }
@keyframes sheet-sway { from { transform: rotate(-5.8deg) translateY(0); } to { transform: rotate(-4.2deg) translateY(-5px); } }

/* Smouldering corner and rising embers */
.ember-glow { position: absolute; top: -9%; right: -9%; width: 40%; aspect-ratio: 1; pointer-events: none; background: radial-gradient(circle, rgba(255, 176, 64, .95) 0, rgba(255, 112, 22, .55) 16%, rgba(255, 84, 10, .18) 38%, transparent 62%); animation: ember-flicker 2.4s ease-in-out infinite; }
@keyframes ember-flicker { 0%, 100% { opacity: .55; transform: scale(.9); } 30% { opacity: 1; transform: scale(1.05); } 55% { opacity: .7; transform: scale(.95); } 80% { opacity: .95; transform: scale(1.02); } }
.ember { position: absolute; top: 2%; right: 4%; width: 4px; height: 4px; border-radius: 50%; background: #ffb04a; box-shadow: 0 0 6px 2px rgba(255, 140, 40, .8); opacity: 0; pointer-events: none; animation: ember-rise 4.6s ease-out infinite; }
.ember.e1 { --dx: 26px; animation-delay: .4s; } .ember.e2 { --dx: -18px; animation-delay: 1.4s; right: 9%; } .ember.e3 { --dx: 40px; animation-delay: 2.3s; width: 3px; height: 3px; }
.ember.e4 { --dx: -34px; animation-delay: 3.1s; right: 1%; } .ember.e5 { --dx: 14px; animation-delay: 3.9s; width: 5px; height: 5px; right: 7%; }
@keyframes ember-rise { 0% { opacity: 0; transform: translate(0, 0) scale(1); } 12% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx, 20px), -150px) scale(.2); } }

/* The envelope: aged, charred rim, lit from the top-left, sliding in and gently floating */
.art-env { will-change: transform; animation: env-in 1s var(--ease) .25s backwards, env-float 7s ease-in-out 1.4s infinite alternate; filter: drop-shadow(0 26px 22px rgba(41, 37, 31, .38)) drop-shadow(0 2px 3px rgba(41, 37, 31, .3)); }
@keyframes env-in { from { opacity: 0; transform: translateY(70px) rotate(5deg); } to { opacity: 1; transform: none; } }
@keyframes env-float { from { transform: translateY(0) rotate(0deg); } to { transform: translateY(-7px) rotate(-.7deg); } }
.env-back { background: #c9ad78 var(--fibers); box-shadow: inset 0 0 0 2px rgba(22, 10, 4, .6), inset 0 0 26px 6px rgba(40, 18, 6, .7), inset 0 0 60px 14px rgba(120, 66, 24, .4); }
.env-front {
  background: radial-gradient(circle at 100% 100%, rgba(25, 10, 4, .88) 0, rgba(95, 48, 16, .5) 10%, transparent 27%), radial-gradient(circle at 0 100%, rgba(25, 10, 4, .75) 0, rgba(95, 48, 16, .4) 8%, transparent 21%), linear-gradient(155deg, #ead8aa 0%, #dcc490 55%, #c6a76f 100%);
  box-shadow: inset 0 0 0 2px rgba(22, 10, 4, .6), inset 0 0 24px 5px rgba(40, 18, 6, .65), inset 0 0 56px 12px rgba(120, 66, 24, .35);
}
.env-flap { background: linear-gradient(180deg, #f1e2bd, #d8bf8c); }
.art-env.is-open .env-flap { background: linear-gradient(0deg, #dcc593, #bfa370); }
.art-env.is-open .env-card { transform: translateY(-46%) rotate(-2.2deg); }
.env-card { padding: 8% 8% 6%; }
.env-seal { z-index: 7; filter: drop-shadow(0 3px 4px rgba(20, 8, 3, .55)); animation: seal-stamp .6s cubic-bezier(.3, 1.7, .5, 1) 1.2s backwards; }
@keyframes seal-stamp { from { opacity: 0; transform: translate(-50%, -58%) scale(2.3); } to { opacity: 1; transform: translate(-50%, -58%) scale(1); } }

/* Vintage details on the envelope front */
.env-stamp { z-index: 4; right: 7%; top: 31%; width: 13%; aspect-ratio: 3 / 4; transform: rotate(4deg); background: radial-gradient(circle at 50% 46%, #7b2d38 0 34%, transparent 36%), repeating-linear-gradient(transparent 0 4px, rgba(60, 30, 12, .2) 4px 5px), #ead7ab; border: 2px dashed rgba(60, 30, 12, .55); outline: 1px solid rgba(60, 30, 12, .22); box-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.env-stamp::after { content: ""; position: absolute; left: -85%; top: 42%; width: 150%; aspect-ratio: 1; border-radius: 50%; border: 1.5px solid rgba(46, 24, 10, .45); background: repeating-linear-gradient(transparent 0 5px, rgba(46, 24, 10, .28) 5px 6.5px); -webkit-mask: radial-gradient(circle, transparent 62%, #000 64%); mask: radial-gradient(circle, transparent 62%, #000 64%); }
.env-address { z-index: 4; left: 9%; bottom: 13%; font-size: clamp(1.1rem, 3.4vw, 1.55rem); line-height: 1; color: #3a2a1c; transform: rotate(-2deg); opacity: .88; }
.env-sheen { z-index: 6; inset: 0; pointer-events: none; background:
  linear-gradient(105deg, transparent 38%, rgba(255, 240, 200, .38) 50%, transparent 62%) 120% 0 / 250% 100% no-repeat,
  linear-gradient(115deg, rgba(255, 244, 214, .36) 0, rgba(255, 244, 214, .1) 24%, transparent 44%, transparent 66%, rgba(30, 12, 3, .32) 100%);
  animation: glint 7s ease-in-out 2.2s infinite; }
@keyframes glint { 0% { background-position: 120% 0, 0 0; } 45%, 100% { background-position: -40% 0, 0 0; } }

/* Craft section sheets get the same ragged edge */
.craft-sheet-a, .craft-sheet-b { filter: url(#burnt-edge); }

@media (prefers-reduced-motion: reduce) {
  .ember { display: none; }
  .ember-glow { opacity: .8; }
}
@media (max-width: 899px) { .art-sheet, .env-card, .craft-sheet-a, .craft-sheet-b { border-radius: 2px; } }

/* Paper layer carries the ragged burnt edge; the handwriting above it stays crisp */
.art-paper, .paper-bg { position: absolute; inset: 0; filter: url(#burnt-edge); }
.art-sheet { background: none !important; box-shadow: none !important; filter: none; z-index: 1; }
.craft-sheet-a, .craft-sheet-b { filter: none; background: none !important; box-shadow: none !important; }
.craft-sheet-a > p { position: relative; z-index: 1; }

/* Lighter burn: softer corners and rims (overrides the stronger values above) */
.burnt {
  background-color: #ead9ae;
  background-image:
    radial-gradient(circle at 100% 0, rgba(40, 18, 7, .7) 0, rgba(80, 40, 14, .5) 5%, rgba(120, 66, 24, .3) 12%, transparent 26%),
    radial-gradient(circle at 0 100%, rgba(40, 18, 7, .5) 0, rgba(100, 52, 18, .3) 8%, transparent 21%),
    radial-gradient(circle at 100% 100%, rgba(50, 22, 8, .5) 0, rgba(110, 58, 20, .3) 8%, transparent 19%),
    radial-gradient(ellipse 60% 45% at 22% 14%, rgba(255, 248, 222, .6), transparent 70%),
    var(--fibers), var(--grain-strong);
  box-shadow:
    inset 0 0 0 1px rgba(40, 18, 7, .45), inset 0 0 8px 2px rgba(50, 24, 9, .5),
    inset 0 0 26px 7px rgba(125, 70, 26, .36), inset 0 0 56px 12px rgba(160, 105, 46, .16),
    0 18px 30px -16px rgba(41, 37, 31, .5);
}
.env-back { box-shadow: inset 0 0 0 1px rgba(40, 18, 7, .45), inset 0 0 18px 4px rgba(50, 24, 9, .45), inset 0 0 46px 10px rgba(125, 70, 26, .28); }
.env-front {
  background: radial-gradient(circle at 100% 100%, rgba(40, 18, 7, .6) 0, rgba(110, 58, 20, .32) 9%, transparent 22%), radial-gradient(circle at 0 100%, rgba(40, 18, 7, .45) 0, rgba(110, 58, 20, .25) 7%, transparent 17%), linear-gradient(155deg, #eedcb2 0%, #e1cb9a 55%, #cfb17a 100%);
  box-shadow: inset 0 0 0 1px rgba(40, 18, 7, .45), inset 0 0 16px 3px rgba(50, 24, 9, .42), inset 0 0 42px 9px rgba(125, 70, 26, .24);
}
.ember-glow { opacity: .8; }
.ember-glow { background: radial-gradient(circle, rgba(255, 180, 74, .8) 0, rgba(255, 118, 28, .42) 16%, rgba(255, 90, 14, .12) 38%, transparent 60%); }
.letter { box-shadow: inset 0 0 0 1px rgba(40, 18, 7, .38), inset 0 0 10px 1px rgba(50, 24, 9, .4), inset 0 0 32px 6px rgba(125, 70, 26, .24), 0 18px 30px -16px rgba(41, 37, 31, .42); }

/* Card inside the envelope: ragged burnt shape on its own paper layer, text stays crisp */
.env-card { background: none !important; box-shadow: none !important; }
.env-card > p { position: relative; z-index: 1; }

/* The letter writes itself when the envelope opens */
.env-card { text-align: center; padding: 9% 6% 4%; }
.art-env.is-open .env-card { transform: translateY(-56%) rotate(-2.2deg); }
.env-type { margin: 0; font-size: clamp(1.02rem, 3.1vw, 1.38rem); line-height: 1.38; color: var(--sepia-ink); }
.type-line { display: block; white-space: pre; min-height: 1.38em; }
.type-line > span { opacity: 0; }
.type-line > span.on { opacity: 1; }
.type-line:first-child, .type-line:last-child { color: var(--burgundy); }
.caret { display: inline-block; width: 0; height: 1em; position: relative; }
.caret::after { content: ""; position: absolute; left: 1px; top: .1em; width: 2px; height: 1.05em; background: var(--burgundy); animation: caret-blink .9s steps(1) infinite; }
@keyframes caret-blink { 50% { opacity: 0; } }
.env-card .env-type { color: var(--sepia-ink); }
.env-card .env-type .type-line:first-child, .env-card .env-type .type-line:last-child { color: var(--burgundy); }

/* Craft-section letter */
.craft-sheet-a .hand.craft-type { font-size: clamp(1.05rem, 2.4vw, 1.45rem); line-height: 1.55; color: var(--sepia-ink); margin: 0; }
.craft-sheet-a .hand.craft-type + .hand { margin: 0; }
.craft-type .type-line:last-child { margin-top: .5em; text-align: right; padding-right: 6%; }

/* =====================================================================
   Occasion cards: animated line illustrations and livelier hover
   ===================================================================== */
.tone-parchment::before, .tone-ink::before, .tone-burgundy::before, .tone-taupe::before { display: none; }
.occ-icon { position: absolute; top: .9rem; right: 1.1rem; width: 76px; height: 76px; overflow: visible; opacity: .92; transition: transform .5s var(--ease); pointer-events: none; }
.tone-paper .occ-icon, .tone-parchment .occ-icon { color: var(--burgundy); }
.tone-taupe .occ-icon { color: #3b1218; }
.tone-ink .occ-icon, .tone-burgundy .occ-icon { color: var(--gold-light); }
.occ:hover, .occ:focus-visible { transform: translateY(-5px) rotate(-.5deg); }
.occ:hover .occ-icon, .occ:focus-visible .occ-icon { transform: scale(1.16) rotate(-5deg); }
.occ-line { width: fit-content; max-width: 100%; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat; padding-bottom: 2px; transition: background-size .6s var(--ease); }
.occ:hover .occ-line, .occ:focus-visible .occ-line { background-size: 100% 1.5px; }
@media (min-width: 960px) {
  .occ-grid > li:nth-child(1) .occ-icon, .occ-grid > li:nth-child(8) .occ-icon { width: 118px; height: 118px; top: 1.3rem; right: 1.6rem; }
}
@media (max-width: 639px) { .occ-icon { width: 84px; height: 84px; } }

.draw { stroke-dasharray: 1; stroke-dashoffset: 0; }
.occ-icon g, .occ-icon .flame { transform-box: fill-box; transform-origin: center; }
.occ.live .draw { animation: draw 1.7s var(--ease) both; }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

.occ.live .beat { animation: beat 2.2s ease-in-out 1.7s infinite; }
@keyframes beat { 0%, 40%, 100% { transform: scale(1); } 10% { transform: scale(1.09); } 22% { transform: scale(1.02); } 30% { transform: scale(1.07); } }
.occ.live .flame { transform-origin: 50% 90%; animation: flicker 1.3s ease-in-out infinite; }
@keyframes flicker { 0%, 100% { transform: scale(1, 1) rotate(0); } 25% { transform: scale(.92, 1.08) rotate(-3deg); } 55% { transform: scale(1.05, .94) rotate(2deg); } 80% { transform: scale(.96, 1.05) rotate(-1deg); } }
.occ.live .sway { transform-origin: 20% 90%; animation: sway 3.4s ease-in-out infinite alternate; }
@keyframes sway { from { transform: rotate(-3deg); } to { transform: rotate(3.5deg); } }
.occ.live .bloom { animation: bloom 5s ease-in-out infinite alternate; }
@keyframes bloom { from { transform: rotate(-6deg) scale(.96); } to { transform: rotate(8deg) scale(1.05); } }
.occ.live .steam path { animation: steam 3s ease-in-out infinite; }
.occ.live .steam path:nth-child(2) { animation-delay: .7s; } .occ.live .steam path:nth-child(3) { animation-delay: 1.4s; }
@keyframes steam { 0% { transform: translateY(5px); opacity: 0; } 35% { opacity: .95; } 100% { transform: translateY(-5px); opacity: 0; } }
.occ.live .twinkle { animation: twinkle 2.6s ease-in-out infinite; }
.occ.live .twinkle.t2 { animation-delay: .9s; } .occ.live .twinkle.t3 { animation-delay: 1.6s; }
@keyframes twinkle { 0%, 100% { transform: scale(1) rotate(0); opacity: 1; } 50% { transform: scale(.78) rotate(14deg); opacity: .55; } }
.occ.live .plane { animation: glide 4s ease-in-out infinite alternate; }
@keyframes glide { from { transform: translate(-2px, 3px) rotate(-2deg); } to { transform: translate(5px, -5px) rotate(3deg); } }
.occ.live .ring-a { animation: drift 4s ease-in-out infinite alternate; }
.occ.live .ring-b { animation: drift 4s ease-in-out infinite alternate-reverse; }
@keyframes drift { from { transform: translateX(-1.5px); } to { transform: translateX(1.5px); } }
.occ.live .sunrise { animation: sunrise 2s var(--ease) both; }
@keyframes sunrise { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.occ.live .rays { transform-origin: 50% 100%; animation: rays 5s ease-in-out 2s infinite alternate; }
@keyframes rays { from { transform: rotate(-5deg); } to { transform: rotate(5deg); } }
.occ.live .gem { animation: twinkle 3.2s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .occ:hover, .occ:focus-visible { transform: none; } }
/* keep titles clear of the illustration */
.occ-name { padding-right: 5.6rem; }
@media (min-width: 960px) {
  .occ-grid > li:nth-child(1) .occ-icon { width: 170px; height: 170px; }
  .occ-grid > li:nth-child(8) .occ-icon { width: 130px; height: 130px; }
  .occ-grid > li:nth-child(1) .occ-name, .occ-grid > li:nth-child(8) .occ-name { padding-right: 9rem; }
  .occ-grid > li:nth-child(1) .occ-name { padding-right: 0; }
}
@media (max-width: 639px) { .occ-name { padding-right: 5.8rem; } }
/* Illustration sits above the title (no side-by-side collisions, no broken words) */
.occ-name, .occ-grid > li:nth-child(1) .occ-name, .occ-grid > li:nth-child(8) .occ-name { padding-right: 0; }
.occ { padding-top: 5.8rem; }
@media (max-width: 639px) { .occ-name { padding-right: 0; } .occ { padding-top: 6.2rem; } }
@media (min-width: 960px) {
  .occ-grid > li:nth-child(1) .occ, .occ-grid > li:nth-child(8) .occ, .occ-grid > li:nth-child(10) .occ { padding-top: clamp(1.3rem, 2.4vw, 2rem); }
}

/* Confetti burst on occasion tap */
.confetti { position: fixed; inset: 0; z-index: 200; pointer-events: none; overflow: hidden; }
.confetti-bit { position: absolute; left: 0; top: 0; display: block; will-change: transform, opacity; }
.confetti-bit { box-shadow: none; outline: 1px solid rgba(41, 37, 31, .3); outline-offset: -1px; backface-visibility: hidden; }
.confetti-bit.dot { border-radius: 50%; }
.confetti-bit.scrap { border-radius: 1px 3px 2px 4px; }
.confetti-bit.star { outline: 0; }
.confetti-bit.star { clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }

/* Smoothness while the burst plays and the page hands off */
.confetti { contain: layout paint; }
body.bursting .leaf, body.bursting .ember, body.bursting .ember-glow, body.bursting .sheet-wrap, body.bursting .art-env, body.bursting .hero-stage::before, body.bursting .occ-icon *, body.bursting .occ-icon { animation-play-state: paused !important; }
body > main { transition: opacity .34s ease, transform .34s ease; }
body.leaving > main { opacity: 0; transform: translateY(-8px); }
@media (prefers-reduced-motion: reduce) { body > main { transition: none; } }
