html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@font-face { font-family: "Pinyon Script"; src: url("/fonts/pinyon-script.woff2") format("woff2"); font-display: block; }
:root {
  --ink: #120d0a;
  --ink-2: #1d1510;
  --parchment: #efe3c8;
  --parchment-2: #e4d3ae;
  --text-dark: #2a1d14;
  --text-soft: #5b4532;
  --gold: #d9a441;
  --gold-soft: #f0c46a;
  --wax: #8e2b22;
  --wax-dark: #5a1812;
  --cream: #f3e6cc;
  --muted: #b9a483;
  --stage-w: min(100vw, calc(100dvh * 9 / 16));
  --stage-h: min(100dvh, calc(100vw * 16 / 9));
  --display: 'Cormorant Garamond', Georgia, serif;
  --body: 'Lora', Georgia, serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--cream); font-family: var(--body); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold-soft); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- stage ---------- */
.room { min-height: 100dvh; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 40%, #2a1b10 0%, var(--ink) 70%); }
.stage { position: relative; width: var(--stage-w); height: var(--stage-h); overflow: hidden; background: #000; container-type: size; }
@media (max-aspect-ratio: 9/16) { .stage { width: 100vw; height: 100dvh; } }
.stage video, .stage .hands { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.stage .talk { opacity: 0; transition: opacity .28s ease; }
.stage .talk.on { opacity: 1; }
.stage .hands { top: auto; bottom: 0; height: auto; aspect-ratio: 720 / 308; opacity: 0; transition: opacity 1.2s ease; pointer-events: none; }
.stage .hands.on { opacity: 1; }
@media (max-aspect-ratio: 9/16) {
  /* object-fit: cover crops the sides on tall phones; keep the hands aligned to the video width */
  .room .stage .hands { width: calc(100dvh * 9 / 16); left: 50%; transform: translateX(-50%); }
}
.vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(0,0,0,.55) 100%); }

.ui { position: absolute; inset: 0; pointer-events: none; }
.ui > * { pointer-events: auto; }

/* captions */
.caption { position: absolute; left: 6%; right: 6%; top: 3.5%; text-align: center; font-family: var(--display); font-style: italic; font-size: clamp(17px, 4.6cqw, 24px); line-height: 1.35; color: var(--cream); text-shadow: 0 2px 10px #000, 0 0 2px #000; opacity: 0; transition: opacity .4s; pointer-events: none; }
.caption.on { opacity: 1; }

/* top controls */
.controls { position: absolute; top: 10px; right: 10px; display: flex; gap: 8px; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(240,196,106,.35); background: rgba(18,13,10,.55); color: var(--cream); display: grid; place-items: center; backdrop-filter: blur(4px); }
.icon-btn svg { width: 20px; height: 20px; }
.skip { position: absolute; bottom: calc(var(--stage-h) * .02); right: 12px; min-height: 40px; padding: 0 14px; border-radius: 20px; border: 1px solid rgba(240,196,106,.35); background: rgba(18,13,10,.55); color: var(--muted); font-size: 14px; opacity: 0; transition: opacity .3s; pointer-events: none; }
.skip.on { opacity: 1; pointer-events: auto; }

/* ---------- intro ---------- */
.intro { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 14px; padding: 0 8% 14%; text-align: center; background: linear-gradient(to bottom, rgba(18,13,10,.35) 0%, rgba(18,13,10,.15) 35%, rgba(18,13,10,.85) 70%, rgba(18,13,10,.95) 100%); transition: opacity .8s; }
.intro.gone { opacity: 0; pointer-events: none; }
.eyebrow { margin: 0; font-size: 12px; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); }
.intro h1 { margin: 0; font-family: var(--display); font-weight: 600; font-size: clamp(38px, 11cqw, 56px); line-height: 1.02; color: var(--cream); }
.intro p.lede { margin: 0; color: #d8c6a3; font-size: clamp(15px, 4cqw, 18px); line-height: 1.55; max-width: 34ch; }
.note { margin: 0; font-size: 12.5px; color: var(--muted); }

.btn { min-height: 54px; padding: 0 26px; border: none; border-radius: 14px; background: var(--gold); color: #1a120c; font-family: var(--display); font-size: 21px; font-weight: 700; letter-spacing: .01em; box-shadow: 0 4px 0 #9c7024, 0 10px 30px rgba(217,164,65,.25); transition: transform .12s, box-shadow .12s; }
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #9c7024; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.wide { width: 100%; }
.btn.ghost { background: transparent; color: var(--cream); border: 1px solid rgba(240,196,106,.5); box-shadow: none; font-family: var(--body); font-size: 16px; font-weight: 500; min-height: 48px; }
.link { background: none; border: none; color: var(--muted); text-decoration: underline; min-height: 44px; font-size: 14px; }

/* ---------- parchment cards on the table ---------- */
.card { position: absolute; left: 7%; right: 7%; bottom: 25%; padding: 20px 20px 18px; border-radius: 6px; background: linear-gradient(180deg, var(--parchment) 0%, var(--parchment-2) 100%); color: var(--text-dark); box-shadow: 0 18px 40px rgba(0,0,0,.6), inset 0 0 40px rgba(120,80,30,.18); transform: translateY(16px) rotate(-.6deg); opacity: 0; transition: transform .5s cubic-bezier(.2,.8,.2,1), opacity .4s; }
.card.on { transform: translateY(0) rotate(-.6deg); opacity: 1; }
.card h2 { margin: 0 0 4px; font-family: var(--display); font-weight: 700; font-size: 24px; line-height: 1.1; }
.card p { margin: 0 0 12px; color: var(--text-soft); font-size: 14.5px; line-height: 1.5; }
.card label { display: block; font-size: 13px; color: var(--text-soft); margin: 0 0 6px; }
.field { width: 100%; min-height: 50px; padding: 10px 12px; border-radius: 8px; border: 1px solid #b89f70; background: #fbf5e6; color: var(--text-dark); font-size: 17px; }
.dob { display: grid; grid-template-columns: 1fr 1.6fr 1.2fr; gap: 8px; margin-bottom: 14px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.err { min-height: 18px; margin: 6px 0 0; color: var(--wax); font-size: 13px; }

/* hand choice */
.choice { position: absolute; left: 8%; right: 8%; bottom: 8%; display: flex; flex-direction: column; gap: 10px; opacity: 0; transform: translateY(12px); transition: .5s; }
.choice.on { opacity: 1; transform: none; }
.choice .btn { white-space: nowrap; padding: 0 12px; font-size: 20px; }
.choice .q { text-align: center; font-family: var(--display); font-size: 22px; color: var(--cream); text-shadow: 0 2px 10px #000; margin: 0 0 4px; }

/* calculation slip */
.slip { position: absolute; left: 14%; right: 14%; top: 54%; padding: 16px; text-align: center; background: rgba(239,227,200,.94); color: var(--text-dark); border-radius: 4px; box-shadow: 0 12px 30px rgba(0,0,0,.6); opacity: 0; transition: opacity .6s; font-family: var(--display); }
.slip.on { opacity: 1; }
.slip .line { font-size: 22px; letter-spacing: .04em; opacity: 0; animation: ink .9s forwards; }
.slip .big { font-size: 64px; font-weight: 700; color: var(--wax); line-height: 1; margin-top: 6px; opacity: 0; animation: ink 1.2s forwards; }
.slip .lbl { font-size: 13px; letter-spacing: .25em; text-transform: uppercase; color: var(--text-soft); font-family: var(--body); }
@keyframes ink { from { opacity: 0; filter: blur(4px); transform: translateY(4px); } to { opacity: 1; filter: none; transform: none; } }

/* envelopes */
.envelopes { position: absolute; left: 10%; right: 10%; bottom: 22%; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; opacity: 0; transform: translateY(14px); transition: .6s; }
.envelopes.on { opacity: 1; transform: none; }
.env { position: relative; aspect-ratio: 1.45; border: none; border-radius: 4px; background: linear-gradient(160deg, #e9dbb9, #cdb88c); color: var(--text-dark); box-shadow: 0 8px 18px rgba(0,0,0,.55); display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 6px 4px 7px; overflow: hidden; transition: transform .2s; }
.env::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 58%; background: linear-gradient(160deg, #dcc9a0, #c4ad7f); clip-path: polygon(0 0, 100% 0, 50% 100%); }
.env:hover:not(:disabled) { transform: translateY(-3px); }
.env .seal { position: absolute; top: 34%; left: 50%; width: 30%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle at 35% 35%, #b4443a, var(--wax) 60%, var(--wax-dark)); box-shadow: 0 2px 4px rgba(0,0,0,.5); display: grid; place-items: center; color: #f3d9c7; font-family: var(--display); font-weight: 700; font-size: clamp(11px, 3.3cqw, 16px); }
.env .name { position: relative; font-family: var(--display); font-weight: 700; font-size: clamp(13px, 3.7cqw, 17px); line-height: 1.05; text-align: center; }
.env.locked { grid-column: span 2; aspect-ratio: auto; height: 54px; flex-direction: row; justify-content: center; gap: 8px; background: linear-gradient(160deg, #6b5a40, #4c3e2b); color: #e5d3ae; opacity: .9; cursor: not-allowed; }
.env.locked::before { display: none; }
.env.locked svg { width: 18px; height: 18px; }
.env.chosen { animation: lift .8s forwards; }
@keyframes lift { to { transform: translateY(-30px) scale(1.06); opacity: 0; } }

/* full letter */
.letter-wrap { position: absolute; inset: 0; background: rgba(10,7,5,.72); backdrop-filter: blur(3px); display: flex; align-items: flex-end; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .4s; }
.letter-wrap.on { opacity: 1; pointer-events: auto; }
.letter { width: 92%; max-height: 90%; overflow-y: auto; margin-bottom: 4%; padding: 28px 24px 22px; background: linear-gradient(180deg, #f3e8cf, #e7d6b2); color: var(--text-dark); border-radius: 4px; box-shadow: 0 30px 60px rgba(0,0,0,.7), inset 0 0 60px rgba(120,80,30,.2); transform: translateY(30px) scaleY(.96); transform-origin: bottom; transition: transform .6s cubic-bezier(.2,.8,.2,1); }
.letter-wrap.on .letter { transform: none; }
.letter .kicker { margin: 0; font-size: 11.5px; letter-spacing: .24em; text-transform: uppercase; color: var(--wax); }
.letter h2 { margin: 4px 0 14px; font-family: var(--display); font-weight: 700; font-size: 32px; line-height: 1.05; }
.letter p { margin: 0 0 14px; font-size: 16px; line-height: 1.7; }
.letter h3 { font-family: "Cormorant Garamond", serif; font-size: 21px; font-weight: 600; color: #8e2b22; margin: 22px 0 8px; letter-spacing: .01em; }
.letter .opening { font-style: italic; }
.letter .reflection { margin-top: 18px; padding: 12px 14px; border-left: 3px solid var(--gold); background: rgba(217,164,65,.12); font-style: italic; }
.letter .sign { text-align: right; font-family: var(--display); font-style: italic; font-size: 24px; color: var(--wax); margin: 6px 0 12px; }
.letter .teaser { font-size: 14px; color: var(--text-soft); }
.loading { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 30px 0; font-family: var(--display); font-style: italic; font-size: 20px; color: var(--text-soft); }
.quill { width: 46px; height: 46px; animation: write 1.4s ease-in-out infinite; }
@keyframes write { 0%,100% { transform: translateX(-8px) rotate(-8deg); } 50% { transform: translateX(8px) rotate(4deg); } }

/* offer */
.offer { top: auto; bottom: 2.5%; max-height: calc(100% - 64px); overflow-y: auto; overscroll-behavior: contain; padding: 16px 18px 14px; }
.offer h2 { font-size: 22px; }
.offer ul { margin: 0 0 12px; padding: 0; list-style: none; display: grid; gap: 6px; }
.offer li { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; line-height: 1.32; color: var(--text-dark); }
.offer li span { flex: 1; }
.offer li svg { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--wax); }
.fine { margin: 10px 0 0 !important; font-size: 11.5px !important; line-height: 1.45 !important; color: #7a634a !important; text-align: center; }

.toast { position: absolute; left: 50%; bottom: 3%; transform: translateX(-50%); padding: 10px 16px; border-radius: 10px; background: #2b1d14; color: var(--cream); border: 1px solid var(--wax); font-size: 14px; opacity: 0; transition: opacity .3s; max-width: 90%; pointer-events: none; }
.toast.on { opacity: 1; }
.demo-badge { position: absolute; top: 14px; left: 12px; padding: 4px 8px; border-radius: 6px; font-size: 11px; letter-spacing: .08em; background: rgba(142,43,34,.85); color: #fff; }

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

/* ---------- reading page ---------- */
.reading-page { background: var(--ink); }
.hero { position: relative; height: min(62dvh, 640px); overflow: hidden; display: grid; place-items: center; background: #000; }
.hero .stage { height: 100%; width: auto; aspect-ratio: 9 / 16; }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 55%, var(--ink) 100%); pointer-events: none; }
.status { max-width: 640px; margin: -60px auto 0; position: relative; z-index: 2; padding: 0 20px 40px; text-align: center; }
.status h1 { font-family: var(--display); font-weight: 600; font-size: clamp(30px, 7vw, 44px); margin: 0 0 8px; }
.status p { color: #d4c19d; line-height: 1.6; margin: 0 0 10px; }
.doc { max-width: 720px; margin: 0 auto; padding: 0 16px 60px; }
.sheet { background: linear-gradient(180deg, #f3e8cf, #e9d9b6); color: var(--text-dark); border-radius: 4px; padding: clamp(22px, 5vw, 44px); box-shadow: 0 30px 70px rgba(0,0,0,.6), inset 0 0 70px rgba(120,80,30,.16); margin-bottom: 22px; }
.sheet h2 { font-family: var(--display); font-weight: 700; font-size: clamp(28px, 6vw, 38px); line-height: 1.05; margin: 2px 0 14px; }
.sheet h3 { font-family: var(--display); font-weight: 700; font-size: 22px; margin: 0 0 6px; }
.sheet p { font-size: 16.5px; line-height: 1.75; margin: 0 0 14px; }
.sheet .kicker { margin: 0; font-size: 11.5px; letter-spacing: .24em; text-transform: uppercase; color: var(--wax); }
.profile { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.pcard { border: 1px solid #c9b07c; border-radius: 6px; padding: 14px; background: rgba(255,250,235,.45); }
.pcard .num { font-family: var(--display); font-weight: 700; font-size: 40px; color: var(--wax); line-height: 1; }
.pcard .k { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--text-soft); }
.pcard p { font-size: 14.5px; line-height: 1.55; margin: 6px 0 0; }
.pcard strong { display: block; font-family: var(--display); font-size: 18px; margin-top: 4px; }
.months { display: grid; gap: 14px; }
.month { border-left: 3px solid var(--gold); padding: 4px 0 4px 16px; }
.month ul { margin: 6px 0 0; padding-left: 18px; }
.month li { margin-bottom: 6px; line-height: 1.55; }
.reflection { padding: 12px 14px; border-left: 3px solid var(--gold); background: rgba(217,164,65,.12); font-style: italic; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 10px 0 24px; }
.compat { background: linear-gradient(180deg, #2a1c13, #1d140e); border: 1px solid rgba(217,164,65,.35); border-radius: 8px; padding: 24px; color: var(--cream); }
.compat h2 { color: var(--cream); font-family: var(--display); font-size: 30px; margin: 0 0 8px; }
.compat p { color: #d4c19d; line-height: 1.6; }
.compat .field { background: #fbf5e6; }
.compat label { color: #d4c19d; font-size: 13px; display: block; margin: 0 0 6px; }

@media print {
  body { background: #fff !important; color: #000; }
  .hero, .actions, .compat, .no-print { display: none !important; }
  .sheet { box-shadow: none; background: #fff; break-inside: avoid-page; padding: 0 0 20px; }
  .doc { max-width: none; padding: 0; }
}

/* 12-month forecast */
.forecast h3 { font-family: var(--display); font-size: 22px; color: #8e2b22; margin: 22px 0 8px; }
.forecast h4 { font-family: var(--display); font-size: 18px; margin: 0 0 4px; color: #5a3b22; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin: 14px 0 6px; }
.fgrid > div { background: rgba(142,43,34,.05); border: 1px solid rgba(90,59,34,.18); border-radius: 10px; padding: 12px 14px; }
.fgrid p { font-size: 15px; margin: 0; }
.fmonths { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 18px; }
.fmonth { border: 1px solid rgba(90,59,34,.2); border-radius: 10px; padding: 14px; break-inside: avoid; }
.fmonth.hl { border-color: #b8862f; box-shadow: inset 0 0 0 1px rgba(184,134,47,.5); background: rgba(184,134,47,.07); }
.fhead { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.fhead strong { display: block; font-family: var(--display); font-size: 19px; }
.fhead em { font-size: 13px; color: #7a634a; }
.fnum { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #8e2b22; color: #f6ead2; font-family: var(--display); font-size: 18px; }
.fhead .star { margin-left: auto; color: #b8862f; font-size: 18px; }
.fmonth p { font-size: 14.5px; line-height: 1.6; margin: 0 0 8px; }
.fmonth .fl { font-size: 13.5px; color: #4e3a28; }

/* No blinking text cursor outside form fields (letters, envelopes, buttons). */
body { caret-color: transparent; }
input, textarea, select, [contenteditable="true"] { caret-color: auto; }
.env, .btn, .stage, .hands-choice { -webkit-user-select: none; user-select: none; }

/* Self-writing quill */
.quillscene { display: flex; flex-direction: column; align-items: center; padding: 8px 0 4px; }
.quillscene svg { width: 100%; max-width: 360px; height: auto; overflow: visible; }
.quillscene .ink { fill: none; stroke: #2e1c10; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.quillscene .lines { transition: opacity .9s ease; }
.quillscene .lines.fade { opacity: 0; }
.quillscene .spark { fill: #e9b955; animation: spark 1.2s ease-out forwards; }
@keyframes spark { from { opacity: .95; transform: translateY(0); } to { opacity: 0; transform: translateY(-14px); } }
.quillscene .q-body { filter: drop-shadow(2px 4px 3px rgba(40,24,10,.35)); }
.quillcap { margin: 6px 0 0; font-family: var(--display); font-style: italic; font-size: 20px; color: var(--text-soft); text-align: center; transition: opacity .25s; }
.quillcap.swap { opacity: 0; }
.status .quillscene { background: linear-gradient(180deg, var(--parchment) 0%, var(--parchment-2) 100%); border-radius: 6px; padding: 14px 10px 12px; margin: 18px auto 0; max-width: 420px; box-shadow: 0 14px 34px rgba(0,0,0,.5); }

/* the quill at the end of the ink while the letter is being written */
.pen-caret { display: inline-block; width: 38px; height: 38px; margin: -26px 0 0 2px; vertical-align: baseline; animation: pen 0.5s ease-in-out infinite alternate; transform-origin: 10% 90%; filter: drop-shadow(1px 3px 2px rgba(40,24,10,.3)); }
@keyframes pen { from { transform: rotate(-6deg) translateY(0); } to { transform: rotate(5deg) translateY(-2px); } }
h2 .pen-caret, h3 .pen-caret { width: 26px; height: 26px; }

/* the letter's title, handwritten by the quill */
.title-host { margin: 2px 0 10px; min-height: 64px; }
.title-svg { display: block; overflow: visible; }
.title-ink { fill: #2a170c; }
.title-ink-static { font-family: "Pinyon Script", "Snell Roundhand", cursive; font-size: 46px; line-height: 1.25; color: #2a170c; padding: 4px 4px 2px; }
.letter-body { transition: opacity .7s ease, transform .7s ease; }
.letter-body.waiting { opacity: 0; transform: translateY(8px); }
.letter .ink-wait { font-family: var(--display); font-style: italic; color: var(--text-soft); font-size: 18px; text-align: center; padding: 18px 0; }

.choice .row.col { flex-direction: column; }
.heart-choice .btn { font-size: 19px; min-height: 48px; }

/* a returning guest's already-opened letter */
.env.opened .seal { background: radial-gradient(circle at 35% 30%, #c79a4a, #8a6324); }
.env.opened::after { content: 'Opened'; position: absolute; top: 8px; right: 10px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--wax); }
.env.sealed { filter: grayscale(.7) brightness(.62); cursor: not-allowed; }
.env.sealed::after { content: 'Sealed'; position: absolute; top: 8px; right: 10px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #3b2a1c; }

/* the chart's strongest patterns, at the top of a letter */
.patterns { margin: 4px 0 18px; padding: 14px 16px 6px; border: 1px solid rgba(142,43,34,.28); border-radius: 8px; background: rgba(142,43,34,.05); }
.patterns-k { margin: 0 0 8px !important; font-size: 11.5px !important; letter-spacing: .2em; text-transform: uppercase; color: var(--wax); }
.patterns ul { margin: 0; padding-left: 18px; }
.patterns li { margin: 0 0 9px; font-size: 15px; line-height: 1.55; }
.patterns li strong { color: #3a2416; }
