/* Sealed by Friends — midnight paper, wax and gold */
:root {
  --night: #11132a;
  --night-2: #1b1e3d;
  --night-3: #272b52;
  --ink: #1f1b2d;
  --ink-2: #3a3448;
  --muted: #6c6477;
  --paper: #f7f1e6;
  --paper-2: #efe4d1;
  --paper-3: #e5d6bd;
  --card: #fffcf6;
  --line: #e3d6c0;
  --wax: #b3271f;
  --wax-hi: #d4473b;
  --wax-deep: #7f1813;
  --gold: #c69c45;
  --gold-hi: #ecd294;
  --sage: #4f7464;
  --focus: #2f6fdd;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(31, 27, 45, .06), 0 2px 6px rgba(31, 27, 45, .06);
  --shadow: 0 2px 4px rgba(31, 27, 45, .05), 0 10px 28px rgba(31, 27, 45, .10);
  --shadow-lg: 0 18px 60px rgba(9, 10, 28, .35);
  --serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --hand: 'Caveat', 'Segoe Print', 'Bradley Hand', cursive;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .28 0 0 0 0 .2 0 0 0 .07 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; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper) var(--grain);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, canvas { max-width: 100%; display: block; }
a { color: inherit; text-decoration-color: rgba(179, 39, 31, .45); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--wax); }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

h1, h2, h3, .serif { font-family: var(--serif); font-optical-sizing: auto; letter-spacing: -.01em; font-weight: 600; }
h1 { font-size: clamp(2.3rem, 7vw, 4.2rem); line-height: 1.02; margin: 0 0 .5em; letter-spacing: -.025em; }
h2 { font-size: clamp(1.6rem, 4.2vw, 2.4rem); line-height: 1.1; margin: 0 0 .6em; }
h3 { font-size: 1.2rem; line-height: 1.25; margin: 0 0 .4em; }
p { margin: 0 0 1em; }
.eyebrow { font: 600 .74rem/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--wax); }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.center { text-align: center; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(720px, 100% - 32px); margin-inline: auto; }
.app { width: min(560px, 100% - 32px); margin-inline: auto; }

/* ---------- Buttons ---------- */
.btn {
  --bg: var(--ink); --fg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 52px; padding: .8em 1.4em; border-radius: 999px; border: 0;
  background: var(--bg); color: var(--fg); font-weight: 600; font-size: 1.02rem; letter-spacing: .005em;
  cursor: pointer; text-decoration: none; transition: transform .12s ease, box-shadow .2s ease, background .2s ease;
  box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 6px 18px rgba(31, 27, 45, .18);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.btn.wax { --bg: linear-gradient(180deg, var(--wax-hi), var(--wax) 55%, var(--wax-deep)); box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 8px 22px rgba(179, 39, 31, .35); }
.btn.gold { --bg: linear-gradient(180deg, #f3dc9f, var(--gold)); --fg: #2a1f08; box-shadow: 0 1px 0 rgba(255,255,255,.5) inset, 0 8px 22px rgba(198, 156, 69, .35); }
.btn.ghost { --bg: transparent; --fg: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.ghost:hover { box-shadow: inset 0 0 0 1.5px var(--ink-2); }
.btn.light { --bg: rgba(255,255,255,.1); --fg: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.28); }
.btn.block { width: 100%; }
.btn.sm { min-height: 40px; padding: .5em 1em; font-size: .92rem; }
.linkish { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: .9rem; }

/* ---------- Header / footer ---------- */
.top { position: relative; z-index: 5; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-family: var(--serif); font-weight: 600; font-size: 1.12rem; text-decoration: none; letter-spacing: -.01em; }
.brand .mark { width: 30px; height: 30px; }
.top nav { display: flex; gap: 1.2rem; align-items: center; font-size: .93rem; }
.top nav a { text-decoration: none; opacity: .85; }
.top nav a:hover { opacity: 1; }
.on-night { color: #f4ecdd; }

.foot { margin-top: 80px; padding: 48px 0 56px; border-top: 1px solid var(--line); font-size: .9rem; color: var(--muted); }
.foot .wrap { display: grid; gap: 24px; grid-template-columns: 1.4fr repeat(2, 1fr); }
.foot h4 { margin: 0 0 .6em; font: 600 .78rem/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .45em; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--ink); }
@media (max-width: 720px) { .foot .wrap { grid-template-columns: 1fr 1fr; } .foot .about { grid-column: 1 / -1; } }

/* ---------- Night hero ---------- */
.night {
  position: relative; color: #f4ecdd; overflow: hidden; isolation: isolate;
  background: radial-gradient(1200px 600px at 75% -10%, #343a78 0%, transparent 60%), radial-gradient(900px 500px at 0% 110%, #2a1d48 0%, transparent 55%), linear-gradient(180deg, var(--night) 0%, var(--night-2) 100%);
}
.night::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .9;
  background-image:
    radial-gradient(1.2px 1.2px at 12% 18%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 28% 62%, #fff 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 41% 26%, #ffe9b8 50%, transparent 51%), radial-gradient(1px 1px at 57% 74%, #fff 50%, transparent 51%),
    radial-gradient(1.6px 1.6px at 68% 14%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 79% 48%, #ffe9b8 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 91% 30%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 7% 82%, #fff 50%, transparent 51%),
    radial-gradient(1.3px 1.3px at 35% 90%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 86% 86%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 50% 45%, #fff 50%, transparent 51%), radial-gradient(1.1px 1.1px at 22% 40%, #ffe9b8 50%, transparent 51%);
  animation: twinkle 7s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: .55; } to { opacity: 1; } }
.night a { text-decoration-color: rgba(236, 210, 148, .5); }

.hero { padding: 36px 0 96px; }
.hero-grid { display: grid; grid-template-columns: 1.08fr .92fr; gap: 56px; align-items: center; }
.hero h1 em { font-style: italic; color: var(--gold-hi); font-weight: 500; }
.hero .lede { font-size: clamp(1.06rem, 2.2vw, 1.25rem); color: #d9cfe0; max-width: 34em; margin-bottom: 1.6em; }
.hero .ticks { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; margin-top: 1.4rem; font-size: .92rem; color: #c3b9cf; list-style: none; padding: 0; }
.hero .ticks li::before { content: "✦"; color: var(--gold); margin-right: .45em; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; gap: 36px; } .hero { padding-bottom: 64px; } }

/* ---------- Create card ---------- */
.create {
  background: var(--card) var(--grain); color: var(--ink); border-radius: 22px; padding: 26px; box-shadow: var(--shadow-lg);
  position: relative;
}
.create h2 { font-size: 1.5rem; margin-bottom: .2em; }
.create .sub { color: var(--muted); font-size: .95rem; margin-bottom: 1.1em; }
.field { display: grid; gap: .4rem; margin-bottom: 1rem; }
.field label, .label { font-weight: 600; font-size: .9rem; color: var(--ink-2); }
.input, .textarea {
  width: 100%; border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: .8em .95em; font-size: 1.05rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, .textarea:focus { outline: none; border-color: var(--ink-2); box-shadow: 0 0 0 4px rgba(31, 27, 45, .08); }
.textarea { min-height: 128px; resize: vertical; font-family: var(--hand); font-size: 1.55rem; line-height: 1.3; }
.emoji-row { display: flex; flex-wrap: wrap; gap: .4rem; }
.emoji-row button {
  width: 44px; height: 44px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; font-size: 1.3rem; cursor: pointer;
  transition: transform .1s ease, border-color .15s ease;
}
.emoji-row button[aria-pressed="true"] { border-color: var(--wax); box-shadow: 0 0 0 3px rgba(179, 39, 31, .15); transform: scale(1.06); }
.check { display: flex; gap: .6rem; align-items: flex-start; font-size: .93rem; color: var(--ink-2); margin: .2rem 0 1rem; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--wax); flex: none; }
.form-error { color: var(--wax-deep); background: #fbe9e5; border-radius: 10px; padding: .6em .8em; font-size: .92rem; margin-bottom: .8rem; }
.tzline { font-size: .82rem; color: var(--muted); margin-top: .7rem; text-align: center; }

/* ---------- Envelope (shared) ---------- */
.envelope {
  --w: 100%;
  position: relative; width: var(--w); aspect-ratio: 1.45; border-radius: 10px;
  background: linear-gradient(180deg, #fffaf1, var(--paper-2));
  box-shadow: 0 1px 0 rgba(255,255,255,.8) inset, 0 1px 2px rgba(60, 40, 20, .12), 0 8px 22px rgba(60, 40, 20, .12);
  overflow: hidden;
}
.envelope::before { /* back pocket diagonals */
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(to top right, transparent calc(50% - .6px), rgba(150, 120, 80, .22) 50%, transparent calc(50% + .6px)) left bottom / 50% 62% no-repeat,
    linear-gradient(to top left, transparent calc(50% - .6px), rgba(150, 120, 80, .22) 50%, transparent calc(50% + .6px)) right bottom / 50% 62% no-repeat;
}
.envelope .flap {
  position: absolute; left: 0; right: 0; top: 0; height: 62%;
  background: linear-gradient(180deg, #f3e8d5, #e8d9bf);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center; transition: transform .7s cubic-bezier(.3, .7, .2, 1);
  filter: drop-shadow(0 2px 2px rgba(60, 40, 20, .15));
}
.seal {
  position: absolute; left: 50%; top: 62%; width: 30%; aspect-ratio: 1; translate: -50% -50%;
  border-radius: 47% 53% 50% 50% / 52% 46% 54% 48%;
  background: radial-gradient(circle at 35% 30%, var(--wax-hi) 0%, var(--wax) 45%, var(--wax-deep) 100%);
  box-shadow: 0 2px 0 rgba(255,255,255,.18) inset, 0 -2px 4px rgba(0,0,0,.25) inset, 0 3px 6px rgba(80, 10, 5, .35);
  display: grid; place-items: center; color: #ffe8d9; font-family: var(--serif); font-weight: 700;
  font-size: clamp(.95rem, 4vw, 1.35rem); text-shadow: 0 -1px 0 rgba(0,0,0,.35);
}
.seal::after {
  content: ""; position: absolute; inset: 14%; border-radius: 50%;
  border: 1.5px solid rgba(255, 220, 200, .35); box-shadow: 0 1px 1px rgba(0,0,0,.25) inset;
}
.seal.empty { background: transparent; border: 2px dashed rgba(150, 120, 80, .45); box-shadow: none; color: rgba(110, 90, 70, .7); font-weight: 500; font-size: .9rem; text-shadow: none; }
.seal.empty::after { display: none; }
.seal.gold { background: radial-gradient(circle at 35% 30%, #fff1c4 0%, var(--gold) 50%, #8a6624 100%); color: #3b2a07; text-shadow: 0 1px 0 rgba(255,255,255,.4); }

.envelope.open .flap { transform: rotateX(180deg) translateY(-2px); }
.envelope .letter {
  position: absolute; left: 9%; right: 9%; top: 12%; height: 70%; background: #fffefa; border-radius: 4px;
  box-shadow: 0 1px 3px rgba(60, 40, 20, .18); transform: translateY(40%); transition: transform .6s .25s ease;
  background-image: repeating-linear-gradient(180deg, transparent 0 13px, rgba(120, 140, 190, .18) 13px 14px);
}
.envelope.open .letter { transform: translateY(-6%); }
.envelope.open .seal { opacity: 0; transform: scale(.6); transition: opacity .3s ease, transform .3s ease; }

/* ---------- Landing sections ---------- */
.hero-env { position: relative; max-width: 440px; margin-inline: auto; }
.hero-env .envelope { transform: rotate(-4deg); }
.hero-env .envelope.back { position: absolute; inset: 0; transform: rotate(6deg) translate(18px, -14px); opacity: .7; filter: saturate(.8); }
.hero-env .tag {
  position: absolute; right: -6px; bottom: -18px; background: var(--card); color: var(--ink); border-radius: 12px; padding: .5em .8em;
  font: 600 .85rem/1.2 var(--sans); box-shadow: var(--shadow); transform: rotate(3deg);
}
.hero-env .tag b { font-family: var(--serif); color: var(--wax); }

.section { padding: 84px 0 0; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; counter-reset: step; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 24px; position: relative; box-shadow: var(--shadow-sm); }
.step::before { counter-increment: step; content: counter(step); position: absolute; top: -14px; left: 20px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--wax); color: #fff; font: 700 .9rem/1 var(--serif); }
.step p { color: var(--muted); margin: 0; }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr; } }

.year-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; }
.year-strip .mini { display: grid; gap: 6px; text-align: center; font-size: .78rem; color: var(--muted); }
.year-strip .mini b { color: var(--ink); font-family: var(--serif); font-size: .95rem; font-weight: 600; }
@media (max-width: 700px) { .year-strip { grid-template-columns: repeat(4, 1fr); } }
.example-label { display: inline-block; font: 600 .72rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; background: var(--paper-2); color: var(--ink-2); padding: .5em .75em; border-radius: 999px; margin-bottom: 14px; }

.prompts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.prompt-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; }
.prompt-card .m { font: 600 .74rem/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--wax); }
.prompt-card .t { font-family: var(--hand); font-size: 1.6rem; line-height: 1.15; margin-top: .35em; }
@media (max-width: 820px) { .prompts { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .prompts { grid-template-columns: 1fr; } }

.faq details { border-bottom: 1px solid var(--line); padding: 18px 0; }
.faq summary { cursor: pointer; font-family: var(--serif); font-weight: 600; font-size: 1.15rem; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--sans); font-weight: 400; color: var(--wax); font-size: 1.4rem; line-height: 1; transition: transform .2s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: .8em 0 0; color: var(--ink-2); }

.cta-band { margin-top: 84px; border-radius: 28px; padding: 48px 28px; text-align: center; }
.cta-band p { color: #d9cfe0; }

/* ---------- Board app ---------- */
.board-head { padding: 22px 0 8px; text-align: center; }
.board-head .who { font-size: 2.7rem; line-height: 1; margin-bottom: .2em; }
.board-head h1 { font-size: clamp(2rem, 8vw, 2.9rem); margin-bottom: .2em; }
.board-head .sub { color: var(--muted); max-width: 30em; margin-inline: auto; }
.pill { display: inline-flex; align-items: center; gap: .4em; padding: .38em .8em; border-radius: 999px; background: var(--paper-2); color: var(--ink-2); font-size: .82rem; font-weight: 600; }
.pill.dark { background: var(--night-2); color: #efe6d6; }
.pill.ok { background: #e3efe8; color: #24543f; }
.countdown { margin: 14px auto 0; display: inline-flex; align-items: center; gap: .6em; background: var(--night); color: #f1e8d8; border-radius: 999px; padding: .55em 1.05em; font-size: .9rem; box-shadow: var(--shadow); }
.countdown b { font-family: var(--serif); color: var(--gold-hi); font-weight: 600; font-variant-numeric: tabular-nums; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 20px; box-shadow: var(--shadow-sm); margin-top: 18px; }
.panel h3 { margin-bottom: .3em; }
.panel .row { display: flex; gap: 10px; flex-wrap: wrap; }
.panel .row .btn { flex: 1 1 auto; }
.codebox { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding: 10px 10px 10px 16px; border-radius: 14px; background: var(--paper); border: 1px dashed var(--paper-3); }
.codebox .code { font: 700 1.45rem/1 ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: .18em; color: var(--ink); }
.codebox small { display: block; color: var(--muted); font-size: .76rem; margin-bottom: 4px; letter-spacing: .02em; }
.notice { border-radius: 16px; padding: 14px 16px; background: #fff6df; border: 1px solid #efd99a; font-size: .93rem; margin-top: 16px; }
.notice b { font-weight: 600; }

.grid-env { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 14px; margin-top: 22px; }
@media (min-width: 520px) { .grid-env { grid-template-columns: repeat(3, 1fr); } }
.env-tile { appearance: none; border: 0; background: none; padding: 0; text-align: center; cursor: pointer; color: inherit; -webkit-tap-highlight-color: transparent; }
.env-tile .envelope { transition: transform .2s ease, box-shadow .2s ease; }
.env-tile:hover .envelope { transform: translateY(-2px) rotate(-.6deg); }
.env-tile .name { font-family: var(--serif); font-weight: 600; font-size: 1.02rem; margin-top: 9px; }
.env-tile .when { font-size: .78rem; color: var(--muted); }
.env-tile.is-open .when { color: var(--sage); font-weight: 600; }
.env-tile.is-new .envelope { box-shadow: 0 0 0 3px var(--gold), 0 10px 30px rgba(198, 156, 69, .45); animation: glow 1.6s ease-in-out infinite alternate; }
@keyframes glow { to { box-shadow: 0 0 0 3px var(--gold-hi), 0 12px 38px rgba(198, 156, 69, .7); } }
.env-tile.is-full .when::after { content: " · full"; color: var(--wax); }
.env-tile[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.env-tile.featured { grid-column: 1 / -1; }
.env-tile.featured .envelope { max-width: 330px; margin-inline: auto; }

.mine { margin-top: 18px; font-size: .9rem; color: var(--ink-2); text-align: center; }

/* ---------- Sheet & modal ---------- */
.scrim { position: fixed; inset: 0; background: rgba(14, 12, 30, .55); backdrop-filter: blur(3px); z-index: 40; opacity: 0; transition: opacity .2s ease; }
.scrim.show { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 92vh; overflow: auto; overscroll-behavior: contain;
  background: var(--paper) var(--grain); border-radius: 24px 24px 0 0; padding: 10px 20px calc(24px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 40px rgba(0,0,0,.25); transform: translateY(102%); transition: transform .32s cubic-bezier(.2, .8, .2, 1);
}
.sheet.show { transform: translateY(0); }
.sheet .grab { width: 42px; height: 5px; border-radius: 3px; background: var(--paper-3); margin: 4px auto 14px; }
.sheet .close { position: absolute; top: 12px; right: 14px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--paper-2); font-size: 1.3rem; cursor: pointer; }
@media (min-width: 640px) {
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: min(540px, 100% - 32px); border-radius: 24px; transform: translate(-50%, -46%) scale(.98); opacity: 0; transition: transform .25s ease, opacity .2s ease; max-height: 90vh; }
  .sheet.show { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
.sheet h2 { font-size: 1.6rem; margin: 0 0 .2em; padding-right: 40px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; scroll-snap-type: x proximity; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; scroll-snap-align: start; border: 1.5px solid var(--line); background: var(--card); border-radius: 999px;
  padding: .5em .95em; font-size: .9rem; font-weight: 600; cursor: pointer; white-space: nowrap; color: var(--ink-2);
}
.chip small { font-weight: 500; color: var(--muted); margin-left: .3em; }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip[aria-pressed="true"] small { color: #cfc6dc; }
.chip[disabled] { opacity: .45; cursor: not-allowed; }
.starter { display: grid; gap: 8px; margin: 6px 0 12px; }
.starter button {
  text-align: left; border: 1px dashed var(--paper-3); background: rgba(255,255,255,.6); border-radius: 12px; padding: .55em .85em;
  font-family: var(--hand); font-size: 1.35rem; line-height: 1.2; cursor: pointer; color: var(--ink-2);
}
.starter button:hover { border-style: solid; background: #fff; }
.counter { text-align: right; font-size: .8rem; color: var(--muted); margin-top: -.6rem; margin-bottom: .6rem; }
.counter.warn { color: var(--wax); }

.sealed-anim { display: grid; place-items: center; padding: 8px 0 4px; }
.stamp { width: 96px; aspect-ratio: 1; animation: stamp .55s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes stamp { 0% { transform: scale(2.2) rotate(-18deg); opacity: 0; } 60% { opacity: 1; } 100% { transform: scale(1) rotate(-6deg); } }
.success h2 { text-align: center; }
.success .lead { text-align: center; color: var(--ink-2); }
.own-card { margin-top: 18px; background: var(--night) ; color: #f4ecdd; border-radius: 20px; padding: 20px; position: relative; overflow: hidden; }
.own-card::before { content: ""; position: absolute; inset: 0; opacity: .5; background-image: radial-gradient(1px 1px at 20% 30%, #fff 50%, transparent 51%), radial-gradient(1.2px 1.2px at 70% 20%, #ffe9b8 50%, transparent 51%), radial-gradient(1px 1px at 85% 70%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 40% 80%, #fff 50%, transparent 51%); }
.own-card > * { position: relative; }
.own-card h3 { color: #fff; font-size: 1.35rem; }
.own-card p { color: #cfc5da; font-size: .95rem; }
.own-card .input { background: rgba(255,255,255,.95); }
.own-card .check { color: #d9d0e3; }

.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal .box { position: relative; width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--paper) var(--grain); border-radius: 24px; padding: 22px; box-shadow: var(--shadow-lg); }
.modal .close { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--paper-2); font-size: 1.3rem; cursor: pointer; z-index: 2; }
.preview-img { width: min(300px, 100%); margin: 8px auto 14px; border-radius: 16px; box-shadow: var(--shadow); }

/* Reveal */
.reveal { position: fixed; inset: 0; z-index: 60; background: radial-gradient(800px 500px at 50% 0%, #2c3168, transparent 70%), var(--night); color: #f4ecdd; overflow: auto; }
.reveal canvas.fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.reveal .inner { position: relative; z-index: 1; width: min(560px, 100% - 32px); margin: 0 auto; padding: 56px 0 60px; text-align: center; }
.reveal .close { position: fixed; top: 14px; right: 14px; z-index: 3; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.12); color: #fff; font-size: 1.4rem; cursor: pointer; }
.reveal h2 { color: #fff; }
.reveal .big-env { width: min(360px, 86%); margin: 26px auto 12px; cursor: pointer; perspective: 900px; }
.reveal .big-env .seal { width: 28%; font-size: 1.1rem; }
.reveal .hint { color: #c3b9cf; font-size: .95rem; }
.reveal .crack { animation: crack .5s ease forwards; }
@keyframes crack { 40% { transform: scale(1.12) rotate(8deg); } 100% { transform: scale(.2) rotate(-30deg); opacity: 0; } }
.notes { display: grid; gap: 16px; margin-top: 24px; text-align: left; }
.note {
  background: #fffdf7; color: var(--ink); border-radius: 6px; padding: 22px 22px 14px; position: relative;
  background-image: repeating-linear-gradient(180deg, transparent 0 33px, rgba(120, 140, 190, .16) 33px 34px);
  background-position: 0 10px; box-shadow: 0 2px 4px rgba(0,0,0,.12), 0 12px 30px rgba(0,0,0,.22);
  animation: rise .6s cubic-bezier(.2, .8, .2, 1) both;
}
.note:nth-child(odd) { transform: rotate(-.6deg); }
.note:nth-child(even) { transform: rotate(.5deg); }
@keyframes rise { from { opacity: 0; translate: 0 30px; } to { opacity: 1; translate: 0 0; } }
.note .text { font-family: var(--hand); font-size: 1.75rem; line-height: 34px; white-space: pre-wrap; word-break: break-word; }
.note .from { font-family: var(--hand); font-size: 1.45rem; color: var(--wax-deep); text-align: right; margin-top: 4px; }
.note .tools { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 10px; }
.note .tools button { background: none; border: 0; color: var(--muted); font-size: .85rem; cursor: pointer; padding: 4px 2px; }
.note .tools button:hover { color: var(--ink); }
.empty-note { color: #c3b9cf; padding: 28px 0; }

.toast { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); translate: -50% 0; z-index: 90; background: var(--ink); color: #fff; padding: .75em 1.15em; border-radius: 999px; font-size: .93rem; box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); transition: all .2s ease; pointer-events: none; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translateY(0); }

.loader { display: grid; place-items: center; min-height: 50vh; color: var(--muted); }
.loader .seal { position: static; translate: none; width: 64px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.9); opacity: .7; } }

/* Article */
.article { padding-top: 24px; }
.article h1 { font-size: clamp(2.1rem, 6vw, 3.3rem); }
.article h2 { margin-top: 1.8em; font-size: clamp(1.45rem, 3.6vw, 1.9rem); }
.article p, .article li { font-size: 1.07rem; color: var(--ink-2); }
.article ul { padding-left: 1.2em; }
.article li { margin-bottom: .45em; }
.article .meta { color: var(--muted); font-size: .9rem; }
.article .callout { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--wax); border-radius: 12px; padding: 16px 18px; margin: 1.6em 0; }
.toc { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px 20px; margin: 1.2em 0 2em; }
.toc ol { margin: .4em 0 0; padding-left: 1.2em; columns: 2; column-gap: 28px; }
@media (max-width: 560px) { .toc ol { columns: 1; } }
.legal h2 { font-size: 1.35rem; margin-top: 1.6em; }
.legal p, .legal li { color: var(--ink-2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* closed envelopes hide the letter; small-screen header and hero */
.envelope:not(.open) .letter { opacity: 0; }
.brand { white-space: nowrap; }
@media (max-width: 860px) {
  .hero .hero-env { display: none; }
  .hero { padding-top: 12px; }
}
@media (max-width: 620px) {
  .top nav a:not(.keep) { display: none; }
  .top nav { gap: .6rem; }
}
.own-card .input { color: var(--ink); }
