
:root {
  --bg-1: #090e21;
  --bg-2: #121b3d;
  --card-bg: #fffaf0;
  --card-ink: #1a1924;
  --card-sub: #5b586b;
  --accent: #f5c451;
  --accent-deep: #c9921e;
  --cta-1: #e53955;
  --cta-2: #c41d3c;
  --board-bg: rgba(12, 20, 48, 0.72);
  --board-border: rgba(245, 196, 81, 0.35);
  --ink: #f7f4eb;
  --muted: rgba(247, 244, 235, 0.74);
  --radius: 18px;
}

body[data-theme="pine"] {
  --bg-1: #071b16;
  --bg-2: #103329;
  --accent: #f4c152;
  --cta-1: #d93848;
  --cta-2: #a81c2c;
  --board-bg: rgba(11, 38, 30, 0.78);
  --board-border: rgba(244, 193, 82, 0.36);
}

body[data-theme="champagne"] {
  --bg-1: #110f17;
  --bg-2: #241b2e;
  --accent: #f5c6a5;
  --accent-deep: #d48c6a;
  --cta-1: #d94c7a;
  --cta-2: #a82856;
  --board-bg: rgba(26, 19, 36, 0.78);
  --board-border: rgba(245, 198, 165, 0.36);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 20% 0%, var(--bg-2) 0%, var(--bg-1) 65%);
  background-attachment: fixed;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Festive string lights along top */
.lights {
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  height: 22px;
  overflow: hidden;
  padding: 0 8px;
  border-top: 2px solid rgba(255,255,255,0.16);
}
.lights span {
  width: 9px;
  height: 13px;
  border-radius: 50% 50% 60% 60%;
  margin-top: 2px;
  animation: twinkle 2.8s infinite alternate;
}
.lights span:nth-child(4n+1) { background: #ff5d73; box-shadow: 0 0 12px #ff5d73; animation-delay: 0s; }
.lights span:nth-child(4n+2) { background: #ffd166; box-shadow: 0 0 12px #ffd166; animation-delay: .6s; }
.lights span:nth-child(4n+3) { background: #4cc9f0; box-shadow: 0 0 12px #4cc9f0; animation-delay: 1.2s; }
.lights span:nth-child(4n+4) { background: #52d681; box-shadow: 0 0 12px #52d681; animation-delay: 1.8s; }
@keyframes twinkle { from { opacity: .55; transform: scale(.92); } to { opacity: 1; transform: scale(1.06); } }

/* Ambient stars/snow */
.snow-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(2px 2px at 14% 22%, rgba(255,255,255,.45), transparent),
    radial-gradient(2px 2px at 42% 11%, rgba(255,235,180,.4), transparent),
    radial-gradient(1.5px 1.5px at 78% 18%, rgba(255,255,255,.45), transparent),
    radial-gradient(2px 2px at 88% 58%, rgba(255,235,180,.35), transparent),
    radial-gradient(1.5px 1.5px at 25% 74%, rgba(255,255,255,.35), transparent),
    radial-gradient(2px 2px at 62% 84%, rgba(255,255,255,.3), transparent);
}

.wrap { position: relative; z-index: 1; max-width: 1120px; margin: 0 auto; padding: 14px 18px 56px; }

/* Header nav */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0 18px;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--ink);
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 800;
  font-size: 21px;
  letter-spacing: -0.02em;
}
.brand-badge {
  background: linear-gradient(135deg, var(--accent), #ffdf8e);
  color: #16141f;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 99px;
}
.nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.nav a:hover { color: var(--accent); }

/* Hero + 2-col app layout */
.app-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 410px);
  gap: 26px;
  align-items: start;
}
@media (max-width: 880px) {
  .app-grid { grid-template-columns: 1fr; }
}

.hero-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(28px, 4.4vw, 44px);
  line-height: 1.1;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}
.hero-sub { color: var(--muted); font-size: 16px; margin: 0 0 18px; max-width: 560px; }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  padding: 5px 11px; border-radius: 99px;
  color: var(--ink);
}

/* Warm Cream Control Panel */
.panel {
  background: var(--card-bg);
  color: var(--card-ink);
  border-radius: 22px;
  padding: 22px;
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.36);
  border: 1px solid rgba(255, 255, 255, 0.7);
}
.panel h2, .panel h3 {
  font-family: 'Fraunces', Georgia, serif;
  margin: 0 0 6px;
  line-height: 1.2;
}
.sub { font-size: 13.5px; color: var(--card-sub); margin: 0 0 12px; }

/* Form fields */
.field { display: block; margin-bottom: 14px; }
.field-label { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; margin-bottom: 6px; color: #2b2838; }
.input, .textarea {
  width: 100%;
  font: inherit;
  font-size: 15px;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1.5px solid #dfd7c7;
  background: #fff;
  color: #161522;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .textarea:focus {
  border-color: var(--cta-1);
  box-shadow: 0 0 0 3px rgba(229, 57, 85, 0.14);
}
.textarea { resize: vertical; min-height: 86px; }

/* Mode & theme cards */
.mode-list { display: grid; gap: 8px; margin-bottom: 14px; }
.mode-btn {
  text-align: left;
  width: 100%;
  background: #fff;
  border: 1.5px solid #e3dacb;
  border-radius: 14px;
  padding: 11px 13px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  transition: all .15s;
  color: #1a1924;
}
.mode-btn strong { display: block; font-size: 14.5px; }
.mode-btn small { display: block; font-size: 12px; color: #676278; margin-top: 2px; }
.mode-btn[aria-pressed="true"] {
  border-color: var(--cta-1);
  background: #fff4f6;
  box-shadow: 0 0 0 2px rgba(229, 57, 85, 0.12);
}
.mode-tag {
  font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 99px;
  background: #f3ecdd; color: #5b451c; white-space: nowrap;
}
.mode-btn[aria-pressed="true"] .mode-tag { background: var(--cta-1); color: #fff; }

.theme-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.theme-btn {
  background: #fff; border: 1.5px solid #e3dacb; border-radius: 12px; padding: 9px 6px;
  cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 700; color: #1a1924;
  text-align: center; transition: all .15s;
}
.theme-btn[aria-pressed="true"] { border-color: #1a1924; background: #1a1924; color: #f5c451; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  padding: 12px 16px;
  border-radius: 13px;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  transition: transform .12s, opacity .15s, box-shadow .15s;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-wide { width: 100%; }
.btn-primary {
  background: linear-gradient(135deg, var(--cta-1), var(--cta-2));
  color: #fff;
  box-shadow: 0 8px 20px rgba(229, 57, 85, 0.34);
}
.btn-gold {
  background: linear-gradient(135deg, #f6cf65, #d4961b);
  color: #1c1404;
  box-shadow: 0 8px 20px rgba(212, 150, 27, 0.32);
}
.btn-dark { background: #15192e; color: #fff; }
.btn-soft { background: #f2ebe0; color: #262334; border: 1px solid #e2d8c5; }
.btn-sm { padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.link-btn {
  background: none; border: 0; padding: 2px 4px; font: inherit;
  font-size: 13px; font-weight: 700; color: #b52440; text-decoration: underline; cursor: pointer;
}

/* Gift Box Board */
.board-shell {
  background: var(--board-bg);
  border: 2px solid var(--board-border);
  border-radius: 24px;
  padding: 20px;
  backdrop-filter: blur(8px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
}
.board-shell[data-golden="1"] {
  border-color: #ffd875;
  box-shadow: 0 0 0 2px rgba(255, 216, 117, 0.45), 0 24px 65px rgba(212, 150, 27, 0.35);
}
.board-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.board-title { font-family: 'Fraunces', Georgia, serif; font-size: clamp(24px, 3.6vw, 34px); margin: 0; line-height: 1.15; }
.board-meta { font-size: 14px; color: var(--accent); font-weight: 700; margin-top: 4px; }

.box-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.box-grid[data-count="7"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.box-grid[data-count="24"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 520px) {
  .box-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
  .board-shell { padding: 14px; border-radius: 18px; }
}

.gbox {
  position: relative;
  aspect-ratio: 1 / 1.08;
  border-radius: 16px;
  border: 2px dashed rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 6px;
  cursor: pointer;
  text-align: center;
  transition: transform .16s, border-color .16s, box-shadow .16s;
  overflow: hidden;
}
.gbox:hover { transform: translateY(-3px); border-color: var(--accent); }
.gbox.selected { border: 2px solid var(--accent); box-shadow: 0 0 0 3px rgba(245, 196, 81, 0.35); }
.gbox-num { font-family: 'Fraunces', Georgia, serif; font-size: 24px; font-weight: 800; line-height: 1; }
.gbox-day { font-size: 11px; color: var(--muted); margin-top: 4px; font-weight: 600; }

/* Filled box styles */
.gbox.filled {
  border-style: solid;
  border-color: rgba(255,255,255,0.28);
  background: linear-gradient(155deg, #253363, #172044);
  box-shadow: 0 8px 20px rgba(0,0,0,0.28);
}
.gbox.filled::before, .gbox.filled::after {
  content: ''; position: absolute; pointer-events: none; opacity: .22;
}
.gbox.filled::before { top: 0; bottom: 0; left: 50%; width: 10px; transform: translateX(-50%); background: #ff5d73; }
.gbox.filled::after { left: 0; right: 0; top: 50%; height: 10px; transform: translateY(-50%); background: #ff5d73; }

.gbox.filled.wrap-gold, .board-shell[data-golden="1"] .gbox.filled {
  background: linear-gradient(145deg, #8a5c0d, #f5cf67 48%, #b37a14);
  border-color: #ffe8a3;
  color: #1f1503;
}
.gbox.filled.wrap-gold .gbox-day, .board-shell[data-golden="1"] .gbox.filled .gbox-day { color: #3d2a06; }
.gbox.filled.wrap-aurora {
  background: linear-gradient(145deg, #0d3b4c, #247881 50%, #63449e);
  border-color: #7df9d6;
}
.gbox.filled.wrap-velvet {
  background: linear-gradient(145deg, #5c1028, #9c2046 55%, #470a1f);
  border-color: #ff9eb5;
}
.gbox.opened {
  background: #fffaf0 !important;
  color: #1c1926 !important;
  border-color: #e6d7b9 !important;
}
.gbox.opened::before, .gbox.opened::after { display: none; }
.gbox.opened .gbox-day { color: #756d82 !important; }

.gbox-emoji { font-size: 24px; line-height: 1; position: relative; z-index: 1; }
.gbox-from {
  position: relative; z-index: 1;
  font-size: 11.5px; font-weight: 700; margin-top: 5px;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gbox-badges {
  position: absolute; top: 5px; right: 6px; z-index: 2;
  display: flex; gap: 2px; font-size: 11px;
}
.gbox-corner {
  position: absolute; top: 5px; left: 7px; z-index: 2;
  font-size: 11px; font-weight: 800; opacity: .75;
}
.gbox-ready {
  position: relative; z-index: 1;
  font-size: 10px; font-weight: 800; margin-top: 4px;
  background: rgba(0,0,0,0.34); color: #ffe799; padding: 2px 7px; border-radius: 99px;
}
.gbox.opened .gbox-ready { background: #e8f6ec; color: #176b37; }
.gbox.can-open:not(.opened) { animation: pulseBox 2.2s infinite; }
@keyframes pulseBox {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 196, 81, 0.45); }
  50% { box-shadow: 0 0 0 7px rgba(245, 196, 81, 0); }
}

/* Share & Upsell Cards inside Panel */
.box-card {
  background: #fff;
  border: 1.5px solid #ece3d2;
  border-radius: 15px;
  padding: 14px;
  margin-top: 13px;
}
.box-card.gold-card {
  background: linear-gradient(150deg, #fffdf4, #fff2cc);
  border-color: #ecc45b;
}
.box-card.peek-card {
  background: linear-gradient(150deg, #f6f4ff, #eae4ff);
  border-color: #c5b4f9;
}
.box-card.bundle-card {
  background: linear-gradient(145deg, #161b36, #251d3f);
  border-color: #f5c451;
  color: #fff;
}
.box-card.bundle-card .sub { color: rgba(255,255,255,0.78); }

.share-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-top: 10px; }
.share-mini {
  background: #fff; border: 1.5px solid #e5dccb; border-radius: 11px;
  padding: 8px 4px; font-size: 12px; font-weight: 700; color: #242130;
  cursor: pointer; text-align: center;
}
.share-mini:hover { border-color: #242130; }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip {
  background: #f5efe3; border: 1.5px solid #e4d9c5; border-radius: 99px;
  padding: 5px 10px; font-size: 12.5px; font-weight: 600; color: #272335; cursor: pointer;
}
.chip[aria-pressed="true"] { background: #1a1924; border-color: #1a1924; color: #f5c451; }

/* Media upload & voice recorder */
.media-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.media-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: #fff; border: 1.5px dashed #cfc5b0; border-radius: 12px;
  padding: 10px 8px; font: inherit; font-size: 13px; font-weight: 700; color: #2b2738;
  cursor: pointer;
}
.media-btn.recording { border-style: solid; border-color: #e53955; background: #fff0f3; color: #c41d3c; }
.media-preview {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: #f8f4ea; border: 1px solid #e3dac8; border-radius: 12px; padding: 8px 10px;
  margin-bottom: 10px; font-size: 13px;
}
.media-preview img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.14); }
.media-preview audio { height: 34px; max-width: 210px; }

/* Polaroid inside Unbox modal */
.polaroid {
  background: #fff;
  padding: 10px 10px 26px;
  border-radius: 6px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
  transform: rotate(-1.5deg);
  margin: 12px auto 16px;
  max-width: 300px;
}
.polaroid img { width: 100%; display: block; border-radius: 3px; max-height: 300px; object-fit: cover; }

.voice-box {
  background: #141933; color: #fff; border-radius: 14px; padding: 12px 14px; margin: 12px 0;
}
.voice-box audio { width: 100%; margin-top: 8px; height: 38px; }

.clue-box {
  background: linear-gradient(145deg, #f3efff, #e8e0ff);
  border: 1.5px solid #c3b0fa;
  border-radius: 14px;
  padding: 13px;
  margin-top: 14px;
}
.clue-blur { filter: blur(5px); user-select: none; pointer-events: none; opacity: .75; }

/* Modal */
.modal-back {
  position: fixed; inset: 0; background: rgba(7, 10, 24, 0.78);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px; z-index: 90;
}
.modal-card {
  background: #fffaf0; color: #1a1924;
  border-radius: 22px; padding: 22px; max-width: 460px; width: 100%;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 28px 70px rgba(0,0,0,0.5);
  position: relative;
}
.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px; border-radius: 99px; border: 0;
  background: #efe7d8; color: #2b2738; font-weight: 800; cursor: pointer;
}

/* Info sections below fold */
.section { margin-top: 46px; }
.section h2 { font-family: 'Fraunces', Georgia, serif; font-size: 26px; margin: 0 0 14px; }
.steps-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 760px) { .steps-grid { grid-template-columns: repeat(2, 1fr); } }
.step-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px; padding: 16px;
}
.step-card strong { display: block; font-size: 15px; margin: 6px 0 4px; color: var(--accent); }
.step-card p { margin: 0; font-size: 13.5px; color: var(--muted); }

.faq-list { display: grid; gap: 10px; }
.faq-item {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px; padding: 14px 16px;
}
.faq-item summary { font-weight: 700; cursor: pointer; }
.faq-item p { margin: 8px 0 0; font-size: 14px; color: var(--muted); }

/* Legal prose pages */
.prose-card {
  background: #fffaf0; color: #1c1a27; border-radius: 22px; padding: 28px;
  max-width: 780px; margin: 0 auto;
}
.prose-card h1 { font-family: 'Fraunces', Georgia, serif; margin-top: 0; }
.prose-card h2 { font-family: 'Fraunces', Georgia, serif; margin-top: 24px; font-size: 20px; }
.prose-card table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 14px; }
.prose-card th, .prose-card td { border: 1px solid #dfd6c3; padding: 9px 10px; text-align: left; }
.prose-card th { background: #f5eee0; }

/* Footer */
.footer {
  margin-top: 56px;
  padding-top: 22px;
  border-top: 1px solid rgba(255,255,255,0.12);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}
.footer a { color: var(--muted); text-decoration: none; margin-right: 14px; }
.footer a:hover { color: var(--accent); }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: #161b33; color: #ffe79a; border: 1px solid #f5c451;
  padding: 10px 18px; border-radius: 99px; font-weight: 700; font-size: 14px;
  z-index: 120; box-shadow: 0 10px 30px rgba(0,0,0,0.45);
}
.hide { display: none !important; }
.confetti-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 110; }
