:root {
  color-scheme: light;
  --paper: #f7f4eb;
  --ink: #192d26;
  --soft: #4e6359;
  --line: #d6dbca;
  --mint: #dbe9d7;
  --green: #234c3a;
  --serif: Georgia, "Times New Roman", serif;
  font: 16px/1.55 system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; }
button, input, textarea { font: inherit; }
button, summary { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
:focus-visible { outline: 3px solid #a04c34; outline-offset: 4px; }
.frame { width: min(1080px, calc(100% - 48px)); margin-inline: auto; }
.site-header, .site-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.site-header { min-height: 80px; border-bottom: 1px solid var(--line); }
.site-header a, .site-footer a { text-decoration: none; }
.site-header nav { font-size: .9rem; }
.wordmark { display: inline-flex; align-items: center; gap: 8px; font: 700 1.35rem/1 var(--serif); }
.mark { background: var(--green); color: #fefcf3; border-radius: 50%; width: 28px; height: 28px; display: grid; place-items: center; }
.site-footer { border-top: 1px solid var(--line); padding-block: 26px; margin-top: 70px; color: var(--soft); font-size: .88rem; }

.hero { display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: clamp(24px, 5vw, 72px); padding-block: 76px 62px; }
.eyebrow { font-size: .72rem; font-weight: 750; letter-spacing: .13em; color: var(--green); }
.eyebrow span { display: inline-block; width: .55em; height: .55em; background: #a74734; border-radius: 50%; margin-right: 6px; vertical-align: .12em; }
h1, h2, p { margin: 0; }
h1, h2 { font-family: var(--serif); font-weight: 500; }
.hero h1 { margin: 18px 0 20px; font-size: clamp(3.4rem, 7vw, 6.25rem); line-height: .97; letter-spacing: -.065em; }
.hero h1 em { font-weight: inherit; color: var(--green); }
.intro > p { max-width: 40ch; color: var(--soft); font-size: 1.06rem; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 16px 20px; margin-top: 26px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 14px; min-height: 46px; border: 1px solid var(--green); border-radius: 8px; padding: 10px 16px; background: var(--green); color: #fffdf4; font-weight: 650; font-size: .92rem; text-decoration: none; }
.button:hover { background: #163729; }
.button.secondary { background: transparent; color: var(--green); }
.button.secondary:hover { background: var(--mint); }
.quiet-link { display: inline-block; text-underline-offset: .24em; font-size: .9rem; }

.art { position: relative; isolation: isolate; display: grid; place-items: center; height: clamp(310px, 39vw, 430px); overflow: hidden; border: 1px solid #c9dbc7; border-radius: 24px; background: #e0ebd9; text-decoration: none; }
.art::before { position: absolute; inset: 12px; border: 1px dashed #a1b59e; border-radius: 17px; content: ''; }
.sample-sheet { position: absolute; top: 15%; left: 22%; right: 18%; height: 61%; background: #fffaf0; border: 1px solid #dfd2bb; border-radius: 4px; padding: clamp(15px, 3vw, 32px); transform: rotate(-9deg); box-shadow: 0 9px 25px #39534022; transition: transform 180ms ease; }
.art:hover .sample-sheet { transform: translateY(-9px) rotate(-9deg); }
.sample-sheet span { display: block; }
.sample-to { color: #8a4938; font-size: .64rem; font-weight: 750; letter-spacing: .16em; }
.sample-salutation { font: italic clamp(1.65rem, 4vw, 3.35rem)/1.1 var(--serif); margin: .32em 0 .25em; }
.sample-from { color: var(--soft); font-size: .72rem; }
.sample-sheet .stamp { position: absolute; right: 8%; top: 13%; color: #a74734; border: 1px dashed #a74734; padding: 0 5px; }
.envelope { position: absolute; top: 54%; left: 19%; width: 65%; height: 31%; transform: rotate(7deg); border-radius: 5px; background: linear-gradient(to top right, #afc8a7 49.5%, transparent 50%) left / 50% 100% no-repeat, linear-gradient(to top left, #bad1b1 49.5%, transparent 50%) right / 50% 100% no-repeat, #9cb995; box-shadow: 0 14px 24px #39534036; }
.seal { position: absolute; inset: 40% auto auto 44%; display: grid; place-items: center; width: 36px; aspect-ratio: 1; border-radius: 50%; background: #91442f; color: #fff6e9; }
.spark { position: absolute; color: #476b50; font-size: 1.55rem; }
.spark-left { left: 11%; top: 25%; }
.spark-right { right: 9%; bottom: 21%; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; border-block: 1px solid var(--line); padding-block: 24px; }
.steps h2 { font-size: 1.35rem; margin-block: 3px 5px; }
.steps p { color: var(--soft); font-size: .9rem; }

.panel { background: #fffcf4; border: 1px solid var(--line); border-radius: 16px; padding: clamp(22px, 5vw, 48px); }
.create-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-top: 55px; scroll-margin-top: 18px; }
.create-panel h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 8px; }
.panel .description, .create-panel > div p { color: var(--soft); }
form { display: grid; gap: 14px; }
form .button { justify-self: start; }
label { display: grid; gap: 5px; font-size: .88rem; font-weight: 670; }
input, textarea { min-width: 0; width: 100%; color: var(--ink); background: white; border: 1px solid #9eaa9b; padding: 10px 12px; border-radius: 6px; }
textarea { resize: vertical; }
.hint { color: var(--soft); font-size: .8rem; font-weight: 400; }
.error { color: #8b3827; font-size: .88rem; }
.error:empty, .hint:empty { display: none; }
.page-panel { margin: 55px auto 0; max-width: 740px; }
.page-panel h1 { overflow-wrap: anywhere; font-size: clamp(2.25rem, 6vw, 3.85rem); line-height: 1.05; margin-block: .22em .28em; letter-spacing: -.043em; }
.page-panel > form, .page-panel > a, .page-panel > button, .page-panel > .count, .page-panel > p:not(:first-child) { margin-top: 12px; }
.page-panel > a + a, .page-panel > button + a { margin-left: 10px; }
.count { font-variant-numeric: tabular-nums; font-size: 1.15rem; font-weight: 700; }
.timer { letter-spacing: .1em; }
.share-block { margin-top: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; }
.share-block .button { margin-top: 8px; }
.text-button { color: #8b3827; border: 0; padding: 6px 0; text-decoration: underline; background: transparent; }
.notes-grid { display: grid; gap: 10px; margin-block: 22px 8px; }
.note { background: #edf1e4; padding: 13px 16px; border: 1px solid var(--line); border-radius: 8px; overflow-wrap: anywhere; }
.note summary { font-weight: 650; }
.note p { margin-block: 10px; white-space: pre-wrap; }
.note-author { font-size: .85rem; color: var(--soft); }

/* Forms: 16px inputs avoid iOS zoom; comfortable touch targets. */
input, textarea { font-size: 1rem; font-weight: 400; min-height: 46px; }
input[type="datetime-local"] { display: block; -webkit-appearance: none; appearance: none; }
.field { display: grid; gap: 5px; }
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 3px; }
.presets[hidden] { display: none; }
.chip { min-height: 38px; padding: 6px 12px; border: 1px solid #9eaa9b; border-radius: 999px; background: #fffdf4; color: var(--green); font-size: .84rem; font-weight: 600; }
.chip:hover { background: var(--mint); }
.hint.invalid { color: #8b3827; }
.field-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: -8px; }
.counter { flex: none; font-variant-numeric: tabular-nums; }
.counter.low { color: #8b3827; font-weight: 650; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
form[aria-busy="true"] .button, .button:disabled { cursor: progress; }
.page-panel h1:focus { outline: none; }

/* Status and feedback */
.meta { color: var(--soft); font-size: .92rem; }
.callout { padding: 12px 14px; border: 1px solid #c9dbc7; border-left: 4px solid var(--green); border-radius: 8px; background: var(--mint); }
.tally { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; margin-top: 12px; }
.text-button.quiet { color: var(--green); font-size: .88rem; }
.section-title { font-size: 1.35rem; margin-top: 26px; }

/* Organizer links: invitation is primary, recipient and private links read differently. */
.share-block { display: grid; gap: 6px; }
.share-block label { font-size: .95rem; }
.share-block input { font-family: ui-monospace, Menlo, monospace; font-size: .9rem; color: var(--soft); background: var(--paper); text-overflow: ellipsis; }
.share-block .hint { font-size: .84rem; }
.share-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 4px; }
.share-block .share-actions .button { margin-top: 0; }
.share-invite { border-color: #9cb995; background: #f1f6ec; }
.share-recipient { border-color: #dfc2b5; background: #fdf5ee; }
.share-recipient label::before { content: '✳ '; color: #a74734; }
.share-private { border-style: dashed; }
.share-status:empty { display: none; }
.danger-zone { margin-top: 26px; padding-top: 14px; border-top: 1px solid var(--line); }

/* Countdown */
.timer { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; letter-spacing: normal; }
.timer-unit { display: grid; justify-items: center; min-width: 72px; padding: 10px 8px; border: 1px solid var(--line); border-radius: 8px; background: #edf1e4; }
.timer-unit strong { font: 500 clamp(1.7rem, 6vw, 2.4rem)/1 var(--serif); font-variant-numeric: tabular-nums; }
.timer-unit small { color: var(--soft); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; }

/* Reveal */
.reveal-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-top: 18px; }
.reveal-tools .meta { flex: 1 1 100%; font-variant-numeric: tabular-nums; }
.note summary { display: flex; align-items: center; gap: 10px; min-height: 30px; list-style: none; }
.note summary::-webkit-details-marker { display: none; }
.note summary::after { content: 'Open'; content: 'Open' / ''; margin-left: auto; color: var(--green); font-size: .8rem; font-weight: 650; }
.note[open] summary::after { content: 'Close'; content: 'Close' / ''; }
.seal-badge { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #91442f; color: #fff6e9; font-size: .85rem; }
.note.read { background: #fffaf0; border-color: #dfd2bb; }
.note.read .seal-badge { background: transparent; color: #a74734; border: 1px dashed #a74734; }
.note[open] > p, .note[open] > .note-author { animation: unfold 260ms ease-out; }
.note[open] > p { font: 1.12rem/1.55 var(--serif); }
.sealed-preview { margin-top: 18px; position: relative; background: #fffaf0; border-color: #dfd2bb; padding-right: 52px; }
.sealed-preview .seal-badge { position: absolute; top: 12px; right: 12px; }
.sealed-preview p { font: italic 1.05rem/1.55 var(--serif); }
@keyframes unfold { from { opacity: 0; transform: translateY(-4px); } }

@media (max-width: 680px) {
  .frame { width: calc(100% - 32px); }
  .hero, .create-panel { grid-template-columns: 1fr; }
  .hero { padding-block: 38px 28px; }
  .steps { grid-template-columns: 1fr; gap: 16px; }
  .art { height: 290px; }
  .page-panel { margin-top: 26px; }
  .site-footer { margin-top: 44px; }
  .create-panel { gap: 20px; }
  form .button, .page-panel > .button, .reveal-tools .button { justify-self: stretch; width: 100%; }
  .page-panel > a + a, .page-panel > button + a { margin-left: 0; margin-top: 16px; display: block; }
  .share-actions .button { flex: 1 1 auto; }
  .timer { gap: 6px; }
  .timer-unit { flex: 1 1 0; min-width: 0; }
  .field-foot { flex-direction: column; gap: 2px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
