/* December Doors - warm, paper-and-pine Christmas styling, mobile first */
:root {
  --pine: #14342a;
  --pine-deep: #0d271e;
  --pine-soft: #1d4a3a;
  --cream: #faf5ea;
  --paper: #fffdf6;
  --ink: #2c2620;
  --muted: #7a6f5f;
  --red: #a62b25;
  --red-deep: #8c211c;
  --gold: #c19a3d;
  --gold-soft: #e8d9ae;
  --line: #e4dcc8;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(20, 52, 42, 0.14);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.55;
}
h1, h2, h3 {
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  line-height: 1.15;
  color: var(--pine-deep);
}
a { color: var(--red); }
.muted { color: var(--muted); font-weight: 400; }
.fineprint { font-size: 0.85rem; color: var(--muted); margin: 0.6rem 0 0; }
.eyebrow {
  letter-spacing: 0.14em; text-transform: uppercase; font-size: 0.78rem;
  font-weight: 700; color: var(--gold); margin: 0 0 0.4rem;
}

/* top bar */
.topbar {
  display: flex; align-items: baseline; gap: 0.45rem;
  padding: 0.85rem 1.1rem; background: var(--pine-deep); color: var(--cream);
}
.topbar .brand { color: var(--cream); text-decoration: none; font-weight: 700; }
.topbar .brand-sep { color: var(--gold); }
.topbar .brand-sub { font-family: "Playfair Display", Georgia, serif; color: var(--gold-soft); }

/* hero */
.hero {
  background:
    radial-gradient(1100px 480px at 85% -10%, rgba(193, 154, 61, 0.25), transparent 60%),
    linear-gradient(160deg, var(--pine) 0%, var(--pine-deep) 78%);
  color: var(--cream);
  padding: 2.6rem 1.1rem 3rem;
}
.hero-inner { max-width: 680px; margin: 0 auto; }
.hero h1 { color: #fff; font-size: 2.9rem; margin: 0 0 0.7rem; font-weight: 800; }
.hero .bluf { font-size: 1.13rem; color: #f1e9d7; margin: 0 0 1.6rem; }
.hero .bluf strong { color: var(--gold-soft); }

/* cards & forms */
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.3rem 1.2rem; color: var(--ink);
}
.create-card h2 { margin-top: 0; }
.field { display: block; margin: 0 0 0.9rem; }
.field > span:first-child { display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 0.35rem; }
.field input[type="text"], .field input[type="url"], .field input[type="email"], .field textarea {
  width: 100%; padding: 0.68rem 0.8rem; font: inherit; color: var(--ink);
  background: #fff; border: 1.5px solid var(--line); border-radius: 10px;
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--gold-soft); border-color: var(--gold); }
.linkrow { display: flex; gap: 0.5rem; }
.linkrow input { flex: 1; font-size: 0.9rem; background: var(--cream); }
.btn {
  font: inherit; font-weight: 700; cursor: pointer; border-radius: 999px;
  border: 1.5px solid transparent; padding: 0.72rem 1.5rem; text-decoration: none;
  display: inline-block; text-align: center;
}
.btn-primary { background: var(--red); color: #fff; box-shadow: 0 6px 16px rgba(166, 43, 37, 0.35); }
.btn-primary:hover { background: var(--red-deep); }
.btn-ghost { background: transparent; color: var(--pine); border-color: var(--pine-soft); }
.btn-small { padding: 0.55rem 1rem; background: var(--pine); color: #fff; }
.btn-small:hover { background: var(--pine-soft); }
.btn[disabled] { opacity: 0.55; cursor: default; }
.row { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.8rem; }
.poster-cta { text-align: center; margin: 1.1rem 0 0.2rem; }
.poster-row { align-items: center; }
.form-error { color: var(--red); font-weight: 600; margin: 0.6rem 0 0; }
.success-note { font-weight: 700; color: var(--pine); }
#create-result .btn-primary { margin-top: 0.4rem; }

/* sections */
.section { max-width: 880px; margin: 0 auto; padding: 2.2rem 1.1rem 0.4rem; }
.section h2 { font-size: 1.75rem; margin: 0 0 1rem; }
.section.alt { max-width: none; background: #f3ecda; padding-bottom: 2rem; margin-top: 2.2rem; }
.section.alt > * { max-width: 880px; margin-left: auto; margin-right: auto; }
.steps { padding-left: 1.3rem; margin: 0; }
.steps li { margin-bottom: 0.85rem; }
.diff-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.diff { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.05rem 1.1rem; }
.diff h3 { margin: 0 0 0.4rem; font-size: 1.15rem; }
.diff p { margin: 0; }
@media (min-width: 720px) { .diff-grid { grid-template-columns: 1fr 1fr; } }

/* FAQ */
.faq details { border-bottom: 1px solid var(--line); padding: 0.75rem 0; }
.faq summary { font-weight: 700; cursor: pointer; color: var(--pine-deep); font-size: 1.02rem; }
.faq details p { margin: 0.5rem 0 0.2rem; color: #453b2f; }

.footer { max-width: 880px; margin: 2.4rem auto 0; padding: 1.4rem 1.1rem 2.4rem; color: var(--muted); font-size: 0.92rem; border-top: 1px solid var(--line); }

/* app views */
.app-head { max-width: 880px; margin: 0 auto; padding: 1.8rem 1.1rem 0.4rem; }
.app-title { font-size: 2.1rem; margin: 0 0 0.5rem; }
.bluf.small { font-size: 1.02rem; color: #453b2f; }
.stat-line { font-weight: 700; color: var(--pine); }
.share-card { margin-top: 1rem; }
.door-wrap { max-width: 880px; margin: 0 auto; padding: 1rem 1.1rem 0.4rem; }
.door-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.6rem; }
@media (min-width: 720px) { .door-grid { grid-template-columns: repeat(8, 1fr); gap: 0.7rem; } }
.door {
  position: relative; aspect-ratio: 0.8; border-radius: 10px; border: 1.5px solid rgba(0,0,0,0.08);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.1rem;
  font-family: "Playfair Display", Georgia, serif; cursor: pointer; user-select: none;
  background: linear-gradient(165deg, #b23a30, var(--red-deep)); color: #fdf6e3;
  box-shadow: inset 0 0 0 3px rgba(232, 217, 174, 0.35), 0 4px 10px rgba(20, 52, 42, 0.18);
  transition: transform 0.15s ease;
}
.door:nth-child(even) { background: linear-gradient(165deg, var(--pine-soft), var(--pine)); }
.door:hover { transform: translateY(-2px); }
.door .num { font-size: 1.55rem; font-weight: 800; line-height: 1; }
.door .dlabel { font-family: "Source Sans 3", system-ui, sans-serif; font-size: 0.62rem; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.85; }
.door .badge {
  font-family: "Source Sans 3", system-ui, sans-serif; font-size: 0.68rem; font-weight: 700;
  background: rgba(250, 245, 234, 0.92); color: var(--pine-deep); border-radius: 999px; padding: 0.08rem 0.45rem;
}
.door.ny { outline: 2px dashed var(--gold); outline-offset: -6px; }
.door.today { box-shadow: 0 0 0 3px var(--gold), 0 6px 14px rgba(193, 154, 61, 0.45); }
.door.locked { filter: saturate(0.55) brightness(0.82); cursor: default; }
.door.locked:hover { transform: none; }
.door.openable { cursor: pointer; }
.door.opening { animation: swing 0.7s ease; }
@keyframes swing {
  0% { transform: rotateY(0deg); } 40% { transform: rotateY(52deg) scale(1.04); }
  100% { transform: rotateY(0deg); }
}
.door .lock { font-size: 0.8rem; opacity: 0.9; }

/* composer / panels */
.composer, .sealed-card, .door-panel, .finale-card { max-width: 680px; margin: 1.2rem auto; }
.composer h2, .door-panel h2, .finale-card h2 { margin-top: 0; }
.type-pills { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 1rem; }
.pill {
  font: inherit; font-size: 0.92rem; font-weight: 600; cursor: pointer;
  border: 1.5px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 999px; padding: 0.42rem 0.85rem;
}
.pill.active { background: var(--pine); color: var(--cream); border-color: var(--pine); }
.sealed-card { text-align: center; }
.sealed-big { font-family: "Playfair Display", Georgia, serif; font-size: 1.8rem; color: var(--pine); margin: 0.2rem 0; }
.note-item { border: 1px solid var(--line); border-radius: 10px; padding: 0.8rem 0.9rem; margin-bottom: 0.7rem; background: #fff; }
.note-item .ntype { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--gold); }
.note-item .ncontent { margin: 0.3rem 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-item .nauthor { color: var(--muted); font-size: 0.88rem; }
.note-item.is-hidden { opacity: 0.55; }
.note-item .hide-btn { margin-top: 0.45rem; }
#finale-canvas { width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); background: var(--pine-deep); }
.app-head .card { box-shadow: var(--shadow); }
main[hidden] { display: none !important; }

/* v4: email backup + link recovery */
.recover-card { margin-top: 1.4rem; }
#recover-msg { color: var(--pine); font-weight: 600; }
#create-email-note { color: var(--pine); font-weight: 600; }

/* ================= v3: link recovery (welcome back, save trio, save hint) ================= */
.welcome-card { border: 2px solid var(--gold); margin-bottom: 1.4rem; }
.welcome-big {
  font-family: "Playfair Display", Georgia, serif; font-size: 1.55rem;
  color: var(--pine-deep); margin: 0 0 0.3rem; line-height: 1.2;
}
.welcome-card .btn-primary { margin-top: 0.5rem; }
.writing-back { margin-top: 1.4rem; }
.wb-label { font-weight: 700; color: var(--gold-soft); margin: 0 0 0.45rem; }
.wb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.45rem; align-items: flex-start; }
.wb-list a {
  display: inline-block; color: var(--cream); text-decoration: none; font-weight: 600;
  background: rgba(250, 245, 234, 0.10); border: 1px solid rgba(232, 217, 174, 0.45);
  border-radius: 999px; padding: 0.45rem 1rem;
}
.wb-list a:hover { background: rgba(250, 245, 234, 0.22); }
.save-box {
  border: 1.5px dashed var(--gold); border-radius: 12px; background: #fdf6de;
  padding: 0.95rem 1rem; margin: 0.4rem 0 1rem;
}
.save-title { font-weight: 800; color: var(--pine-deep); margin: 0 0 0.3rem; font-size: 1.02rem; }
.save-box .muted { margin: 0; }
.save-actions { margin-top: 0.7rem; }
#create-result .save-box .btn-primary { margin-top: 0; }
.save-hint {
  margin-top: 1rem; display: flex; align-items: center; justify-content: space-between; gap: 0.8rem;
  background: #fdf3d8; border: 1.5px solid var(--gold); border-radius: var(--radius);
  padding: 0.8rem 1rem; font-size: 0.95rem; color: #5d4a17;
}
.save-hint .btn { flex: none; white-space: nowrap; }

/* ================= v2: festive system, owner hero, door motifs ================= */
#snow {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 60; transition: opacity 0.6s ease;
}

/* garland of lights */
.garland { display: block; width: 100%; height: 40px; margin-bottom: 0.4rem; overflow: visible; }
.garland .bulb circle:first-child { stroke: none; }
.garland .b1 circle:first-child { fill: #e8b84b; filter: drop-shadow(0 0 6px rgba(232,184,75,0.9)); }
.garland .b2 circle:first-child { fill: #e0655a; filter: drop-shadow(0 0 6px rgba(224,101,90,0.9)); }
.garland .b3 circle:first-child { fill: #f3ead2; filter: drop-shadow(0 0 6px rgba(243,234,210,0.9)); }
.garland .cap { fill: #8a6d2f; }
.garland .b2 { animation: twinkle 2.6s ease-in-out infinite alternate; }
.garland .b3 { animation: twinkle 3.4s ease-in-out 0.7s infinite alternate; }
@keyframes twinkle { from { opacity: 0.55; } to { opacity: 1; } }

/* doors v2: deep pine / burgundy, gold motif, lit vs sealed */
.door {
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(232, 217, 174, 0.20), transparent 55%),
    linear-gradient(168deg, #20503c, var(--pine-deep));
  border: 1.5px solid rgba(193, 154, 61, 0.55);
  box-shadow: inset 0 0 0 3px rgba(232, 217, 174, 0.16), inset 0 -14px 22px rgba(0,0,0,0.28), 0 4px 10px rgba(20, 52, 42, 0.20);
  gap: 0.05rem; padding: 0.3rem 0.1rem;
}
.door:nth-child(even) {
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(232, 217, 174, 0.18), transparent 55%),
    linear-gradient(168deg, #7e241d, #4d130e);
}
.door .dicon { display: block; width: 30px; height: 30px; color: var(--gold-soft); opacity: 0.95; }
.door .dicon svg { width: 100%; height: 100%; display: block; }
.door .num { font-size: 1.35rem; }
.door.ny { outline: none; box-shadow: inset 0 0 0 3px rgba(193,154,61,0.5), inset 0 0 0 6px rgba(13,39,30,0.35), inset 0 -14px 22px rgba(0,0,0,0.28), 0 4px 10px rgba(20,52,42,0.20); }
.door.lit {
  background:
    radial-gradient(130% 100% at 50% 8%, rgba(255, 196, 86, 0.38), transparent 60%),
    linear-gradient(168deg, #2a5f47, var(--pine));
}
.door.lit .dicon { color: #ffe9a8; }
.door.locked { filter: saturate(0.45) brightness(0.72); }
.door .seal {
  position: absolute; top: -7px; right: -7px; width: 21px; height: 21px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #e8c96a, var(--gold));
  color: #4d130e; font-size: 0.72rem; font-weight: 800; line-height: 21px; text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35); font-family: "Source Sans 3", system-ui, sans-serif;
}
.door.today {
  box-shadow: 0 0 0 3px var(--gold), 0 0 22px 4px rgba(232, 184, 75, 0.55), 0 6px 14px rgba(193, 154, 61, 0.45);
  animation: breathe 2.2s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { box-shadow: 0 0 0 3px var(--gold), 0 0 14px 2px rgba(232,184,75,0.40), 0 6px 14px rgba(193,154,61,0.4); }
  50% { box-shadow: 0 0 0 3px var(--gold), 0 0 30px 9px rgba(232,184,75,0.75), 0 6px 14px rgba(193,154,61,0.5); }
}
.door.opening { animation: swing 0.8s ease; }
@keyframes swing {
  0% { transform: rotateY(0deg); filter: brightness(1); }
  35% { transform: rotateY(58deg) scale(1.05); filter: brightness(1.65); }
  100% { transform: rotateY(0deg); filter: brightness(1); }
}

/* landing preview */
.preview-wrap { margin: 0 0 1.6rem; }
.door-grid.preview { grid-template-columns: repeat(6, 1fr); gap: 0.45rem; }
@media (min-width: 720px) { .door-grid.preview { grid-template-columns: repeat(8, 1fr); } }
.door.mini { cursor: default; aspect-ratio: 0.86; }
.door.mini:hover { transform: none; }
.door.mini .dicon { width: 22px; height: 22px; }
.door.mini .num { font-size: 1.02rem; }
.door.mini .dlabel { display: none; }
.preview-caption { text-align: center; color: var(--gold-soft); font-size: 0.95rem; margin: 0.7rem 0 0; font-style: italic; }

/* owner hero card */
.owner-hero {
  position: relative; border-radius: var(--radius); color: var(--cream);
  background:
    radial-gradient(900px 380px at 85% -10%, rgba(193, 154, 61, 0.28), transparent 60%),
    linear-gradient(160deg, var(--pine) 0%, var(--pine-deep) 80%);
  padding: 1.1rem 1.2rem 1.3rem; box-shadow: var(--shadow); overflow: hidden;
}
.owner-hero .garland { height: 34px; margin-bottom: 0.1rem; }
.app-title.light { color: #fff; margin-bottom: 0.7rem; }
.eyebrow.light { color: var(--gold-soft); }
.progress-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.2rem 0 0.6rem; }
.pchip {
  background: rgba(250, 245, 234, 0.12); border: 1px solid rgba(232, 217, 174, 0.4);
  border-radius: 999px; padding: 0.34rem 0.85rem; font-size: 0.94rem; color: var(--cream);
}
.pchip strong { color: var(--gold-soft); font-size: 1.08rem; margin-right: 0.2rem; }
.countdown { font-family: "Playfair Display", Georgia, serif; font-style: italic; color: var(--gold-soft); font-size: 1.06rem; margin: 0.3rem 0; min-height: 1.4em; }
.stat-line.light { color: #d9cfb4; font-weight: 600; margin: 0.2rem 0 0; }

/* today's door banner */
.today-banner {
  margin-top: 1rem; display: flex; align-items: center; justify-content: space-between; gap: 0.8rem;
  background: linear-gradient(120deg, var(--red), var(--red-deep)); color: #fff;
  border-radius: var(--radius); padding: 0.85rem 1.1rem; box-shadow: 0 8px 20px rgba(166, 43, 37, 0.35);
  font-size: 1.02rem;
}
.btn-gold { background: var(--gold); color: #2c1e05; border: none; }
.btn-gold:hover { background: #d4ab4e; }
.owner-actions { margin-top: 0.2rem; }
.empty-hint {
  background: #fdf3d8; border: 1.5px dashed var(--gold); border-radius: 10px;
  padding: 0.65rem 0.85rem; font-size: 0.94rem; margin: 0.9rem 0 0; color: #5d4a17;
}

/* invite head + composer v2 */
.leave-for { font-family: "Playfair Display", Georgia, serif; font-size: 1.4rem; color: var(--pine); margin: 0.1rem 0 0.45rem; }
.type-pills { display: grid; grid-template-columns: repeat(auto-fit, minmax(98px, 1fr)); gap: 0.55rem; }
.pill {
  display: flex; flex-direction: column; align-items: center; gap: 0.25rem;
  border-radius: 12px; padding: 0.65rem 0.4rem 0.55rem; text-align: center;
}
.pill-icon { font-size: 1.45rem; line-height: 1; color: var(--gold); }
.pill-label { font-size: 0.86rem; line-height: 1.2; }
.pill.active .pill-icon { color: var(--gold-soft); }
.char-meter { float: right; color: var(--muted); font-weight: 700; font-size: 0.86rem; }
.char-meter.warn { color: #b07d2b; }
.char-meter.full { color: var(--red); }
.char-hint { display: block; color: var(--red); font-weight: 600; font-size: 0.86rem; margin-top: 0.3rem; }

/* sealed celebration */
.sealed-card { position: relative; }
.celebrate { position: absolute; inset: 0; overflow: visible; pointer-events: none; }
.flake-bit { position: absolute; top: -8px; opacity: 0; animation-name: fallbit; animation-timing-function: ease-in; animation-fill-mode: forwards; }
@keyframes fallbit {
  0% { opacity: 0; transform: translateY(0) rotate(0deg); }
  12% { opacity: 1; }
  100% { opacity: 0; transform: translateY(150px) rotate(320deg); }
}
.sealed-actions { justify-content: center; }
.finale-count { font-weight: 700; color: var(--red); font-size: 1.02rem; }
.today-banner .btn { white-space: nowrap; flex: none; }
.today-banner span { min-width: 0; }
.type-pills { grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); }
.pill { padding-left: 0.25rem; padding-right: 0.25rem; }
.pill-label { font-size: 0.8rem; overflow-wrap: anywhere; }
[hidden] { display: none !important; }

/* pattern-fix additions 2026-12-03: note ideas / what's new */
.ideas{list-style:none;margin:0;padding:0}
.ideas li{margin:0 0 10px}
.ideas .kind{font-weight:700}
.news-list{list-style:none;margin:0;padding:0}
.news-list li{margin:0 0 12px}
.news-date{font-weight:700}

/* tracka additions 2026-12-04: note example library */
.examples { margin: 0 0 0.9rem; }
.examples-label { font-size: 0.88rem; font-weight: 600; color: var(--muted); margin: 0 0 0.45rem; }
.examples-list { display: flex; flex-direction: column; gap: 0.4rem; }
.example-chip {
  font: inherit; font-size: 0.9rem; line-height: 1.4; text-align: left; cursor: pointer;
  background: #fff; color: var(--ink); border: 1.5px solid var(--line);
  border-radius: 10px; padding: 0.55rem 0.75rem;
}
.example-chip:hover, .example-chip:focus-visible { border-color: var(--gold); outline: none; }
