@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Fraunces:opsz,wght@9..144,600;9..144,700&family=Caveat:wght@600&display=swap');

:root {
  --ink: #2f2928;
  --muted: #746b68;
  --paper: #fffdf9;
  --cream: #fff8f3;
  --accent: #ec836d;
  --accent-soft: #ffe4da;
  --accent-pale: #fff1ec;
  --line: rgba(71, 52, 47, 0.13);
  --shadow: 0 24px 70px rgba(86, 56, 47, 0.11);
  --sans: 'DM Sans', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --serif: 'Fraunces', Georgia, serif;
  --hand: 'Caveat', cursive;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); font-family: var(--sans); }
button, input, textarea, select { font: inherit; }
a { color: inherit; }

.page-body, .lock-body {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 10%, rgba(250, 199, 180, .4), transparent 30rem),
    radial-gradient(circle at 90% 40%, rgba(221, 207, 234, .42), transparent 28rem),
    var(--cream);
}

.theme-lavender { --accent: #8f77ad; --accent-soft: #e9def4; --accent-pale: #f6effb; --cream: #fbf8ff; }
.theme-sage { --accent: #668573; --accent-soft: #dbe9df; --accent-pale: #edf5ef; --cream: #f9fcf8; }

.ambient { position: fixed; border-radius: 999px; filter: blur(2px); pointer-events: none; z-index: -1; }
.ambient-one { width: 22rem; height: 22rem; top: -9rem; right: -6rem; background: rgba(255,255,255,.6); }
.ambient-two { width: 18rem; height: 18rem; left: -7rem; bottom: 10%; background: rgba(255,255,255,.45); }

.site-nav, .admin-nav {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  min-height: 78px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.mini-brand { font-weight: 700; letter-spacing: -.02em; }
.mini-brand span { color: var(--accent); }
.quiet-link, .admin-nav a, .back-link { color: var(--muted); text-decoration: none; font-size: .88rem; }
.quiet-link:hover, .admin-nav a:hover, .back-link:hover { color: var(--ink); }

.page-shell { width: min(860px, calc(100% - 32px)); margin: 38px auto 0; padding-bottom: 55px; }
.hero-card {
  position: relative;
  min-height: 600px;
  border: 1px solid rgba(255,255,255,.75);
  border-radius: 36px;
  padding: 110px 9% 75px;
  text-align: center;
  background: rgba(255,253,249,.84);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.tape { position: absolute; width: 110px; height: 34px; top: -13px; left: calc(50% - 55px); transform: rotate(-2deg); background: rgba(245, 210, 161, .57); }
.eyebrow { margin: 0 0 18px; font-size: .72rem; font-weight: 700; letter-spacing: .18em; color: var(--accent); }
h1, h2 { font-family: var(--serif); letter-spacing: -.045em; margin-top: 0; }
.hero-card h1 { font-size: clamp(3.2rem, 9vw, 6.3rem); line-height: .98; margin-bottom: 28px; max-width: 720px; }
.intro { max-width: 560px; color: var(--muted); font-size: clamp(1.05rem, 2.4vw, 1.28rem); line-height: 1.75; margin: 0; }
.countdown { margin-top: 46px; background: var(--accent-pale); border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent); padding: 15px 22px; border-radius: 16px; display: flex; gap: 9px; align-items: baseline; flex-wrap: wrap; justify-content: center; }
.count-number { color: var(--accent); font-weight: 700; }
.count-label { color: var(--muted); font-size: .84rem; }
.scroll-cue { margin-top: auto; padding-top: 48px; color: var(--accent); font-size: 1.3rem; animation: bounce 2s ease-in-out infinite; }

.note-card { position: relative; width: 88%; margin: 100px auto; padding: 78px 11% 68px; background: #fffdf6; box-shadow: 0 18px 55px rgba(72, 55, 45, .1); border: 1px solid rgba(91, 72, 57, .1); transform: rotate(-.6deg); }
.note-card::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(transparent 0, transparent 38px, rgba(120, 151, 174, .10) 39px, transparent 40px); }
.note-pin { position: absolute; width: 16px; height: 16px; border-radius: 50%; top: 24px; left: 50%; background: var(--accent); box-shadow: 0 3px 7px rgba(0,0,0,.2); }
.hand-label, .signature-doodle { position: relative; font-family: var(--hand); color: var(--accent); }
.hand-label { font-size: 1.6rem; margin: 0 0 30px; }
.message-copy { position: relative; font-family: var(--serif); font-size: clamp(1.25rem, 3vw, 1.65rem); line-height: 1.85; }
.closing-copy { position: relative; margin: 36px 0 0; font-weight: 600; }
.signature-doodle { text-align: right; font-size: 1.8rem; transform: rotate(-5deg); margin-top: 28px; }

.music-card { display: grid; grid-template-columns: 190px 1fr; gap: 46px; align-items: center; padding: 48px; border-radius: 28px; background: var(--ink); color: #fffaf6; box-shadow: var(--shadow); }
.record-art { aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: repeating-radial-gradient(circle, #282120 0, #282120 8px, #3b3230 9px, #3b3230 12px); box-shadow: 0 12px 30px rgba(0,0,0,.3); animation: spin 12s linear infinite; animation-play-state: paused; }
.music-card:hover .record-art { animation-play-state: running; }
.record-art::before { content: ''; width: 52px; height: 52px; border-radius: 50%; background: var(--accent); position: absolute; }
.record-art span { z-index: 1; font-size: 1.3rem; }
.music-content h2 { font-size: clamp(1.7rem, 4vw, 2.6rem); margin-bottom: 22px; }
.music-content iframe { width: 100%; border: 0; border-radius: 12px; height: 152px; display: block; }
.music-content audio { width: 100%; }
.player-fallback { display: inline-block; margin-top: 12px; color: rgba(255,250,246,.68); font-size: .75rem; text-decoration: none; }
.player-fallback:hover { color: #fffaf6; text-decoration: underline; }
.reply-card { position: relative; overflow: hidden; margin: 90px auto 0; padding: 54px 8%; text-align: center; border: 1px solid var(--line); border-radius: 28px; background: rgba(255,253,249,.88); box-shadow: var(--shadow); }
.reply-card h2 { font-size: clamp(2rem, 5vw, 3.2rem); margin-bottom: 10px; }
.reply-card .muted { margin: 0; }
.reply-doodle { position: absolute; right: 28px; top: 18px; color: var(--accent); opacity: .25; font-family: var(--hand); font-size: 4.2rem; transform: rotate(12deg); }
.reply-options { max-width: 570px; margin: 32px auto 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.reply-option { min-height: 104px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); border-radius: 18px; background: white; color: var(--ink); cursor: pointer; font-weight: 700; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease; }
.reply-option:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 10px 24px rgba(65,47,40,.09); }
.reply-option.selected { border-color: var(--accent); background: var(--accent-pale); box-shadow: 0 0 0 3px var(--accent-soft); }
.reply-icon { color: var(--accent); font-family: var(--serif); font-size: 1.8rem; line-height: 1; }
.reply-thanks { width: max-content; max-width: 100%; margin: 22px auto 0; padding: 10px 15px; border-radius: 999px; background: #edf7ef; color: #356d43; font-size: .84rem; font-weight: 600; }
.reply-change-note { margin: 16px 0 0; color: var(--muted); font-size: .76rem; }
.site-footer { text-align: center; padding: 100px 20px 30px; color: var(--muted); font-size: .85rem; }
.site-footer span { color: var(--accent); }

.floating-doodle { position: fixed; color: var(--accent); opacity: .45; pointer-events: none; font-family: var(--hand); }
.doodle-one { top: 18%; left: 4%; font-size: 2.5rem; transform: rotate(-12deg); }
.doodle-two { right: 4%; bottom: 17%; font-size: 3rem; transform: rotate(11deg); }
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.note-card.reveal { transform: translateY(20px) rotate(-.6deg); }
.note-card.reveal.is-visible { transform: translateY(0) rotate(-.6deg); }

.lock-body, .admin-body { min-height: 100vh; background: #f8f4ef; }
.lock-shell, .setup-shell { min-height: 100vh; display: grid; place-items: center; padding: 26px; }
.lock-card, .compact-card { width: min(480px, 100%); text-align: center; }
.lock-card { padding: 54px 44px; background: rgba(255,253,249,.9); border: 1px solid #fff; border-radius: 28px; box-shadow: var(--shadow); }
.lock-card h1, .compact-card h1 { font-size: clamp(2.2rem, 7vw, 3.4rem); margin-bottom: 14px; }
.envelope { width: 86px; height: 61px; margin: 0 auto 32px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); position: relative; color: var(--accent); }
.envelope::before { content: ''; position: absolute; inset: 0; clip-path: polygon(0 0, 50% 55%, 100% 0); background: rgba(255,255,255,.52); }
.envelope span { z-index: 1; }
.muted { color: var(--muted); line-height: 1.65; }
.unlock-form { margin-top: 30px; display: flex; gap: 10px; }
.unlock-form input { min-width: 0; flex: 1; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 0; border-radius: 12px; padding: 13px 20px; text-decoration: none; cursor: pointer; font-weight: 700; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: white; background: var(--ink); box-shadow: 0 8px 20px rgba(47,41,40,.18); }
.button.primary:hover { background: #1e1918; }
.button.secondary { color: var(--ink); background: white; border: 1px solid var(--line); }
input, textarea, select { width: 100%; border: 1px solid #ddd5ce; border-radius: 11px; background: white; color: var(--ink); padding: 13px 14px; outline: none; transition: border-color .2s, box-shadow .2s; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; line-height: 1.6; }

.admin-nav { width: min(1180px, calc(100% - 36px)); }
.admin-nav nav { display: flex; gap: 24px; }
.admin-shell { width: min(1180px, calc(100% - 32px)); margin: 40px auto 90px; }
.admin-heading { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 35px; }
.admin-heading h1 { font-size: clamp(2.4rem, 5vw, 4.2rem); margin-bottom: 6px; }
.admin-heading p { margin-bottom: 0; }
.admin-card { background: white; border: 1px solid var(--line); border-radius: 22px; padding: 30px; box-shadow: 0 12px 35px rgba(65,47,40,.05); }
.response-status-card { margin: 0 0 24px; padding: 27px 30px; display: flex; align-items: center; gap: 20px; border: 1px solid var(--line); border-radius: 22px; background: white; box-shadow: 0 12px 35px rgba(65,47,40,.05); }
.response-status-card h2 { margin: 0 0 6px; font-family: var(--sans); font-size: 1.25rem; letter-spacing: -.025em; }
.response-status-card p { margin: 0; color: var(--muted); font-size: .87rem; }
.response-status-card .eyebrow { margin-bottom: 8px; font-size: .64rem; }
.response-status-icon { width: 56px; height: 56px; flex: 0 0 56px; display: grid; place-items: center; border-radius: 50%; background: #f1eeeb; color: var(--muted); font-family: var(--serif); font-size: 1.6rem; }
.response-yes { border-color: #c8dfcd; background: #fbfffc; }
.response-yes .response-status-icon { background: #dff0e3; color: #397048; }
.response-no { border-color: #ead5d0; background: #fffdfc; }
.response-no .response-status-icon { background: #f5e8e5; color: #8c5b52; }
.response-time { display: inline-block; margin-top: 9px; color: #9a918c; font-size: .73rem; }
.compact-card { padding: 44px; }
.brand-mark { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 24px; background: var(--accent-soft); color: var(--accent); border-radius: 50%; }
.form-stack { display: grid; gap: 18px; margin-top: 28px; text-align: left; }
label { display: grid; gap: 8px; font-size: .85rem; font-weight: 700; }
label > span { font-size: .74rem; font-weight: 400; color: var(--muted); float: right; }
.form-stack .button { margin-top: 4px; }
.back-link { display: inline-block; margin-top: 28px; }

.editor-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); gap: 22px; align-items: start; }
.editor-main { display: grid; gap: 20px; }
.editor-side { display: grid; gap: 22px; }
.editor-side .admin-card { display: grid; gap: 18px; }
.section-heading { display: flex; gap: 13px; align-items: flex-start; border-bottom: 1px solid var(--line); padding-bottom: 18px; margin-bottom: 2px; }
.section-heading h2 { font-family: var(--sans); font-size: 1.05rem; letter-spacing: -.02em; margin: 0 0 3px; }
.section-heading p { color: var(--muted); font-size: .78rem; margin: 0; }
.step-number { color: var(--accent); font-size: .72rem; font-weight: 700; padding-top: 2px; }
.two-columns, .three-columns { display: grid; gap: 16px; }
.two-columns { grid-template-columns: 1fr 1fr; }
.three-columns { grid-template-columns: repeat(3, 1fr); }
.or-divider { display: flex; align-items: center; gap: 12px; color: #a49a94; font-size: .7rem; text-transform: uppercase; }
.or-divider::before, .or-divider::after { content: ''; height: 1px; background: var(--line); flex: 1; }
.check-label { display: flex; grid-template-columns: auto 1fr; align-items: center; font-weight: 500; }
.check-label input { width: auto; }
.file-status { margin: -8px 0 0; color: var(--muted); font-size: .75rem; word-break: break-all; }
.save-bar { grid-column: 1 / -1; position: sticky; bottom: 18px; z-index: 5; display: flex; justify-content: space-between; align-items: center; padding: 15px 18px 15px 24px; background: rgba(255,255,255,.92); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 14px 40px rgba(47,41,40,.14); backdrop-filter: blur(12px); }
.save-bar p { margin: 0; color: var(--muted); font-size: .85rem; }
.password-panel { margin-top: 40px; }
.password-panel summary { cursor: pointer; font-weight: 700; }
.password-form { margin-top: 24px; }
.password-form .button { width: max-content; }
.alert { border-radius: 12px; padding: 13px 16px; margin: 18px 0; font-size: .86rem; line-height: 1.55; }
.alert.error { background: #fff0ee; color: #983f35; border: 1px solid #f1c5bf; }
.alert.success { background: #edf7ef; color: #356d43; border: 1px solid #c4dfca; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 800px) {
  .editor-grid { grid-template-columns: 1fr; }
  .admin-heading { align-items: flex-start; flex-direction: column; }
  .three-columns { grid-template-columns: 1fr; }
  .music-card { grid-template-columns: 120px 1fr; gap: 26px; padding: 30px; }
  .note-card { width: 96%; padding-left: 8%; padding-right: 8%; }
}

@media (max-width: 560px) {
  .site-nav { min-height: 66px; }
  .page-shell { margin-top: 18px; }
  .hero-card { min-height: 570px; border-radius: 25px; padding: 90px 24px 55px; }
  .hero-card h1 { font-size: 3.25rem; }
  .note-card { margin: 72px auto; padding-top: 68px; }
  .music-card { grid-template-columns: 1fr; text-align: center; }
  .record-art { width: 130px; margin: 0 auto; }
  .reply-card { margin-top: 65px; padding: 42px 20px; }
  .reply-options { grid-template-columns: 1fr; }
  .unlock-form { flex-direction: column; }
  .lock-card, .compact-card { padding: 38px 24px; }
  .admin-nav { min-height: 65px; }
  .admin-nav nav a:first-child { display: none; }
  .admin-shell { margin-top: 25px; }
  .admin-card { padding: 23px; }
  .two-columns { grid-template-columns: 1fr; }
  .save-bar p { display: none; }
  .save-bar { justify-content: stretch; padding: 10px; }
  .save-bar .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none !important; }
}
