:root {
  --bg: #FBF5EC;
  --surface: #FFFDF7;
  --cream: #F3E0D0;
  --ink: #2B2118;
  --muted: #6B5B4B;
  --hint: #A08B6F;
  --red: #C23B3B;
  --red-dark: #A93131;
  --green: #2E5D43;
  --green-dark: #264C37;
  --gold: #C89B3C;
  --gold-dark: #B08730;
  --border: #E7D2BC;
  --radius: 12px;
  --font-title: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--red); }
h1, h2, h3 { font-family: var(--font-title); font-weight: 700; line-height: 1.2; color: var(--ink); }
h1 { font-size: 44px; margin: 0 0 16px; }
h2 { font-size: 30px; margin: 0 0 12px; }
h3 { font-size: 20px; margin: 0 0 8px; }
p { margin: 0 0 16px; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251,245,236,.94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--green); }
.brand .gf-site-icon { border-radius: 8px; }
.brand-name { font-family: var(--font-title); font-size: 22px; font-weight: 700; }
.nav { display: flex; align-items: center; gap: 24px; font-size: 15px; }
.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover { color: var(--ink); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 46px; padding: 0 24px;
  border-radius: 999px;
  font-size: 16px; font-weight: 600;
  cursor: pointer; text-decoration: none;
  border: 1px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-secondary { background: transparent; color: var(--red); border-color: var(--red); }
.btn-secondary:hover { background: rgba(194,59,59,.08); }
.btn-gold { background: var(--gold); color: #2B2118; }
.btn-gold:hover { background: var(--gold-dark); }
.btn:focus-visible { outline: 3px solid rgba(194,59,59,.4); outline-offset: 2px; }

.hero { text-align: center; padding: 72px 0 48px; }
.hero h1 { max-width: 720px; margin: 0 auto 16px; }
.hero .lede { font-size: 18px; color: var(--muted); max-width: 560px; margin: 0 auto 24px; }
.hero .pills { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 28px; }
.pill { background: var(--cream); color: var(--red-dark); font-size: 13px; font-weight: 600; padding: 6px 14px; border-radius: 999px; }

.create-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 28px;
  max-width: 620px;
  margin: 0 auto 48px;
  text-align: left;
}
.create-panel label { display: block; font-size: 14px; font-weight: 600; color: var(--muted); margin: 0 0 8px; }
.create-panel input[type=text] {
  width: 100%; height: 48px; padding: 0 16px;
  border: 1px solid var(--border); border-radius: 10px;
  font-size: 16px; font-family: var(--font-body);
  background: #fff; color: var(--ink);
}
.create-panel input[type=text]:focus { outline: 2px solid rgba(194,59,59,.4); border-color: var(--red); }
.theme-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 20px 0 24px; }
.theme-option {
  position: relative; border: 2px solid var(--border); border-radius: 12px;
  padding: 14px 12px; cursor: pointer; text-align: center;
  background: #fff; transition: border-color .15s, background .15s;
}
.theme-option:hover { border-color: var(--gold); }
.theme-option input { position: absolute; opacity: 0; pointer-events: none; }
.theme-option.selected { border-color: var(--red); background: #FDF1F1; }
.theme-option .swatch { height: 34px; border-radius: 8px; margin-bottom: 8px; }
.theme-option .tname { font-size: 14px; font-weight: 600; }

.create-panel .create-btn { width: 100%; }
.create-panel .hint { font-size: 13px; color: var(--hint); margin: 12px 0 0; text-align: center; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; padding: 32px 0 48px; }
.step { text-align: center; }
.step .step-num {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--green); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-title); font-size: 18px; margin-bottom: 12px;
}
.step h3 { font-size: 19px; }
.step p { font-size: 15px; color: var(--muted); margin: 0; }

.section { padding: 48px 0; border-top: 1px solid var(--border); }
.section-narrow { max-width: 760px; }
.section h2 { text-align: center; margin-bottom: 24px; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.feature-card h3 { font-size: 19px; margin-bottom: 8px; }
.feature-card p { font-size: 15px; color: var(--muted); margin: 0; }

.prose { max-width: 720px; margin: 0 auto; }
.prose h2 { text-align: left; margin-top: 40px; }
.prose p, .prose li { color: var(--ink); }
.prose ul, .prose ol { padding-left: 22px; }

.faq-list { max-width: 720px; margin: 0 auto; }
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px; margin-bottom: 12px; }
.faq-item h3 { font-size: 17px; margin-bottom: 6px; }
.faq-item p { margin: 0; color: var(--muted); }

.site-footer { background: var(--green); color: #FBF5EC; margin-top: 64px; }
.site-footer a { color: #EAD9C4; }
.footer-inner { display: flex; justify-content: space-between; gap: 32px; padding: 48px 24px 24px; flex-wrap: wrap; }
.footer-brand .brand-name { font-size: 20px; }
.footer-brand p { margin: 8px 0 0; color: #C9D8CE; font-size: 14px; }
.footer-links { display: flex; gap: 24px; align-items: flex-start; font-size: 14px; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.footer-copy { padding: 16px 24px 32px; font-size: 13px; color: #C9D8CE; border-top: 1px solid rgba(255,255,255,.12); }
.footer-copy p { margin: 0; }

@media (max-width: 640px) {
  h1 { font-size: 30px; }
  h2 { font-size: 25px; }
  .container { padding: 0 16px; }
  .nav { gap: 14px; font-size: 14px; }
  .nav-cta { padding: 0 14px; height: 40px; }
  .hero { padding: 48px 0 32px; }
  .steps, .feature-grid { grid-template-columns: 1fr; }
  .theme-row { grid-template-columns: 1fr; }
  .create-panel { padding: 20px; }
  .btn { width: 100%; }
}


.calendar-page { padding: 40px 0 64px; }
.cal-header { text-align: center; margin-bottom: 32px; }
.cal-header h1 { font-size: 36px; margin-bottom: 8px; }
.cal-header .cal-sub { color: var(--muted); font-size: 16px; }

.door-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; max-width: 720px; margin: 0 auto; }
.door {
  position: relative; aspect-ratio: 1 / 1;
  border-radius: 12px; border: 1px solid var(--border);
  background: var(--cream);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; transition: transform .12s, box-shadow .12s;
  padding: 8px; overflow: hidden;
}
.door:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.door-num { font-family: var(--font-title); font-size: 22px; font-weight: 700; color: var(--red); }
.door.is-filled { background: var(--red); border-color: var(--red-dark); }
.door.is-filled .door-num { color: #fff; }
.door.is-open { background: var(--surface); border-color: var(--gold); }
.door.is-open .door-num { color: var(--gold); }
.door.is-locked { background: #ECE3D4; cursor: not-allowed; opacity: .7; }
.door.is-locked .door-num { color: var(--hint); }
.door .door-emoji { font-size: 20px; line-height: 1; margin-top: 2px; }
.door .door-state { position: absolute; bottom: 5px; font-size: 12px; color: inherit; opacity: .85; }

.share-bar { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 28px 0 8px; }
.share-bar .share-link { flex: 1 1 280px; max-width: 420px; }
.share-bar input {
  width: 100%; height: 46px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: 10px;
  font-size: 14px; background: #fff; color: var(--ink);
}
.back-link { display: inline-block; margin-top: 16px; font-size: 14px; }

.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(43,33,24,.5);
  display: none; align-items: center; justify-content: center; padding: 16px;
}
.modal-mask.open { display: flex; }
.modal {
  background: var(--surface); border-radius: 16px; max-width: 480px; width: 100%;
  padding: 28px; box-shadow: var(--shadow-lg); max-height: 90vh; overflow: auto;
}
.modal h2 { font-size: 24px; margin-bottom: 4px; }
.modal .modal-sub { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.modal label { display: block; font-size: 14px; font-weight: 600; color: var(--muted); margin: 0 0 6px; }
.modal textarea {
  width: 100%; min-height: 96px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 10px;
  font-size: 15px; font-family: var(--font-body); resize: vertical; background: #fff; color: var(--ink);
}
.modal textarea:focus { outline: 2px solid rgba(194,59,59,.4); border-color: var(--red); }
.sticker-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.sticker { width: 40px; height: 40px; border-radius: 10px; border: 2px solid var(--border); background: #fff; cursor: pointer; font-size: 20px; display: inline-flex; align-items: center; justify-content: center; }
.sticker.selected { border-color: var(--red); background: #FDF1F1; }
.modal .modal-actions { display: flex; gap: 12px; margin-top: 8px; }
.modal .modal-actions .btn { flex: 1; }
.anon-row { display: flex; align-items: center; gap: 8px; margin: 14px 0 4px; font-size: 14px; color: var(--muted); }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--green); color: #fff; padding: 12px 20px; border-radius: 999px;
  font-size: 14px; z-index: 200; display: none; box-shadow: var(--shadow-lg);
}
.toast.show { display: block; }

@media (max-width: 640px) {
  .door-grid { grid-template-columns: repeat(4, 1fr); gap: 10px; }
  .door-num { font-size: 19px; }
  .cal-header h1 { font-size: 28px; }
}


.comment-box { max-width: 720px; margin: 40px auto 0; }
.comment-box h2 { text-align: left; }
.comment-box > p { color: var(--muted); font-size: 15px; }
.comment-form { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.comment-form input, .comment-form textarea {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 10px;
  font-size: 15px; font-family: var(--font-body); background: #fff; color: var(--ink);
}
.comment-form textarea { min-height: 88px; resize: vertical; }
.comment-form input:focus, .comment-form textarea:focus { outline: 2px solid rgba(194,59,59,.4); border-color: var(--red); }
.comment-form .btn { align-self: flex-start; }
.comment { border-bottom: 1px solid var(--border); padding: 12px 0; }
.comment strong { font-size: 14px; }
.comment p { margin: 4px 0; }
.comment small { color: var(--hint); font-size: 12px; }
.owner-box { background: var(--cream); border-radius: 12px; padding: 16px; margin-top: 8px; }
.owner-box p { font-size: 14px; color: var(--muted); margin: 0 0 10px; }
.owner-box .share-link { margin-bottom: 10px; }
.owner-box .btn { margin-right: 8px; }
