/* Reference: a hardcover advent calendar -- deep pine cover, cream paper doors with big serif numbers,
   no gradients, no glows; stamp red is the only accent and it is reserved for the one primary button. */
:root {
  --pine: #17382e;
  --pine-deep: #102a22;
  --pine-line: #2a5245;
  --cream: #f3ead6;
  --paper: #fbf6ea;
  --ink: #1d2a24;
  --ink-soft: #4f5d55;
  --red: #c23b2a;
  --red-deep: #a32f20;
  --gold: #d4ae55;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--pine); color: var(--cream); font: 16px/1.55 var(--sans); }
a { color: inherit; }
img { max-width: 100%; height: auto; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 680px; }

/* header / logo */
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 600 19px/1 var(--serif); color: var(--cream); }
.logo svg { width: 30px; height: 30px; flex: none; }
.logo small { font: 400 13px/1 var(--sans); opacity: .55; margin-left: 1px; }
.header-link { font-size: 15px; color: var(--cream); opacity: .85; text-decoration: none; border-bottom: 1px solid rgba(243,234,214,.35); }

/* buttons & fields */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 26px; border: 0; border-radius: var(--radius);
  background: var(--red); color: #fff; font: 600 17px/1 var(--sans); text-decoration: none; cursor: pointer; width: 100%; }
.btn:hover { background: var(--red-deep); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-plain { background: none; border: 0; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 6px 2px; opacity: .85; }
.field { display: block; width: 100%; min-height: 52px; padding: 12px 14px; border: 2px solid transparent; border-radius: var(--radius);
  background: var(--paper); color: var(--ink); font: 17px/1.4 var(--sans); }
.field:focus { outline: none; border-color: var(--gold); }
textarea.field { min-height: 120px; resize: vertical; }
label.lbl { display: block; font-size: 14px; font-weight: 600; margin: 14px 0 6px; }
.hint { font-size: 14px; opacity: .7; margin: 10px 0 0; }

/* home hero */
.hero { display: grid; gap: 36px; padding: 28px 0 56px; align-items: center; }
.hero h1 { font: 600 clamp(40px, 8vw, 64px)/1.02 var(--serif); margin: 0 0 14px; letter-spacing: -.01em; }
.hero .lede { font-size: 19px; margin: 0 0 24px; max-width: 30em; opacity: .9; }
.start { display: grid; gap: 10px; max-width: 420px; }
.mini-cal { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; max-width: 460px; justify-self: center; width: 100%; }
.mini-cal span { aspect-ratio: 1; display: grid; place-items: center; border-radius: 8px; background: var(--cream); color: var(--ink);
  font: 600 22px/1 var(--serif); position: relative; }
.mini-cal span.f::after { content: attr(data-s); position: absolute; right: 4px; bottom: 2px; font-size: 13px; }
.mini-cal span.o { background: var(--paper); outline: 2px solid var(--gold); outline-offset: -2px; }
@media (min-width: 860px) { .hero { grid-template-columns: 1.1fr 1fr; padding: 48px 0 80px; } }

/* paper content sections */
.paper { background: var(--paper); color: var(--ink); }
.paper section { padding: 56px 0; border-top: 1px solid #e5dcc6; }
.paper section:first-child { border-top: 0; }
.paper h2 { font: 600 32px/1.15 var(--serif); margin: 0 0 18px; }
.paper h3 { font: 600 20px/1.3 var(--serif); margin: 22px 0 6px; }
.paper p, .paper li { color: var(--ink-soft); font-size: 17px; }
.paper a { color: var(--red-deep); }
.steps { display: grid; gap: 20px; counter-reset: s; padding: 0; list-style: none; }
.steps li { counter-increment: s; padding-left: 56px; position: relative; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 40px; height: 40px; border-radius: 8px; background: var(--pine);
  color: var(--cream); display: grid; place-items: center; font: 600 20px/1 var(--serif); }
.steps h3 { margin-top: 6px; }
.cols { display: grid; gap: 8px 32px; }
@media (min-width: 760px) { .cols { grid-template-columns: 1fr 1fr; } .steps { grid-template-columns: repeat(2, 1fr); } }
.faq details { border-bottom: 1px solid #e5dcc6; padding: 14px 0; }
.faq summary { cursor: pointer; font: 600 18px/1.4 var(--serif); color: var(--ink); }
.faq details p { margin: 10px 0 0; }
.ideas { columns: 2 280px; column-gap: 32px; padding-left: 20px; }
.ideas li { break-inside: avoid; margin-bottom: 8px; }
.cta-band { background: var(--pine); color: var(--cream); text-align: center; padding: 56px 20px; }
.cta-band h2 { font: 600 32px/1.15 var(--serif); margin: 0 0 18px; color: var(--cream); }
.cta-band .btn { width: auto; }

/* footer */
.site-footer { padding: 36px 0 48px; font-size: 14px; color: rgba(243,234,214,.7); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 14px; }
.site-footer a { color: rgba(243,234,214,.85); }

/* calendar page */
.cal-head { padding: 8px 0 18px; }
.cal-head h1 { font: 600 clamp(30px, 7vw, 46px)/1.08 var(--serif); margin: 0 0 10px; }
.status { font-size: 17px; margin: 0 0 12px; }
.bar { height: 8px; border-radius: 4px; background: var(--pine-line); overflow: hidden; margin: 0 0 18px; }
.bar i { display: block; height: 100%; background: var(--gold); }
.actions { display: grid; gap: 6px; max-width: 440px; }
.actions .sub { font-size: 14px; opacity: .75; margin: 2px 0 0; text-align: center; }
.doors { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 8px 0 28px; }
@media (min-width: 640px) { .doors { grid-template-columns: repeat(6, 1fr); gap: 12px; } }
.door { position: relative; aspect-ratio: 1 / 1.08; border: 0; border-radius: 8px; padding: 6px; cursor: pointer; text-align: left;
  background: var(--cream); color: var(--ink); display: flex; flex-direction: column; justify-content: space-between; font-family: var(--sans); }
.door .n { font: 600 clamp(24px, 6vw, 34px)/1 var(--serif); }
.door .who { font-size: 11px; line-height: 1.2; opacity: .75; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.door .st { position: absolute; top: 6px; right: 6px; font-size: 18px; line-height: 1; }
.door.empty { background: transparent; color: var(--cream); border: 2px dashed rgba(243,234,214,.4); }
.door.empty .who { opacity: .6; }
.door.ready { outline: 3px solid var(--red); outline-offset: -3px; }
.door.opened { background: var(--paper); }
.door.mine { outline: 2px solid var(--gold); outline-offset: -2px; }
.door.today { box-shadow: 0 0 0 2px var(--pine), 0 0 0 4px var(--cream); }
.gold .door.filled { background: var(--gold); }
.gold .door.filled.opened { background: #e6cb88; }
.side { display: grid; gap: 14px; padding-bottom: 28px; }
.card { background: var(--pine-deep); border: 1px solid var(--pine-line); border-radius: var(--radius); padding: 16px 18px; }
.card h2 { font: 600 19px/1.3 var(--serif); margin: 0 0 8px; }
.card p { margin: 0 0 6px; font-size: 15px; opacity: .85; }
.card ul { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 8px; }
.card li a { color: var(--cream); font-weight: 600; }
.owner-tools { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 14px; }
.loading { padding: 80px 0; text-align: center; opacity: .7; }

/* sheet (dialog) */
dialog.sheet { border: 0; padding: 0; width: min(520px, 100%); max-height: 92vh; margin: auto auto 0; border-radius: 16px 16px 0 0;
  background: var(--paper); color: var(--ink); }
@media (min-width: 640px) { dialog.sheet { margin: auto; border-radius: 16px; } }
dialog.sheet::backdrop { background: rgba(8, 22, 17, .6); }
.sheet-in { padding: 22px 20px 24px; }
.sheet h2 { font: 600 26px/1.15 var(--serif); margin: 0 0 6px; }
.sheet .meta { color: var(--ink-soft); font-size: 15px; margin: 0 0 6px; }
.sheet .x { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border: 0; background: none; font-size: 26px; cursor: pointer; color: var(--ink-soft); }
.sheet .btn { margin-top: 18px; }
.sheet .btn-plain { display: block; margin: 10px auto 0; color: var(--ink-soft); }
.stickers { display: flex; gap: 8px; }
.stickers button { flex: 1; height: 48px; border-radius: 8px; border: 2px solid #e5dcc6; background: #fff; font-size: 22px; cursor: pointer; }
.stickers button[aria-pressed="true"] { border-color: var(--red); }
.check { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 15px; color: var(--ink-soft); }
.check input { width: 20px; height: 20px; }
.count { text-align: right; font-size: 13px; color: var(--ink-soft); margin-top: 4px; }
.note-paper { background: #fff; border-radius: 8px; padding: 18px; margin: 14px 0 4px; font: 19px/1.5 var(--serif); color: var(--ink);
  background-image: repeating-linear-gradient(transparent 0 27px, #eee3cb 27px 28px); white-space: pre-wrap; word-wrap: break-word; }
.err { color: var(--red-deep); font-size: 15px; margin: 10px 0 0; min-height: 1em; }
.big-st { font-size: 44px; line-height: 1; margin-bottom: 10px; }
.divider { border: 0; border-top: 1px solid #e5dcc6; margin: 22px 0 16px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--cream); padding: 12px 18px;
  border-radius: 10px; font-size: 15px; z-index: 20; max-width: calc(100% - 40px); text-align: center; }

/* milestone: snowfall from 5 notes */
.snow { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.snow i { position: absolute; top: -10px; width: 6px; height: 6px; border-radius: 50%; background: rgba(251,246,234,.75); animation: fall linear infinite; }
@keyframes fall { to { transform: translateY(110vh); } }
@media (prefers-reduced-motion: reduce) { .snow { display: none; } }
main, .site-header, .site-footer { position: relative; z-index: 1; }

/* prose pages */
.prose { padding: 48px 0 64px; }
.prose h1 { font: 600 clamp(34px, 6vw, 48px)/1.08 var(--serif); margin: 0 0 16px; color: var(--ink); }
.prose .lede { font-size: 19px; }
.notice { font-size: 13px; opacity: .65; }
.actions .btn-plain { justify-self: center; font-size: 15px; }
