:root {
  --ink: #3a2631;
  --rose: #d76a7c;
  --rose-dark: #b94d61;
  --cream: #fff9f4;
  --paper: #fffdf9;
  --line: #ecd8d2;
  --shadow: 0 18px 50px rgba(81, 41, 54, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
  background:
    radial-gradient(circle at 7% 12%, rgba(230, 175, 159, .27), transparent 24rem),
    radial-gradient(circle at 90% 35%, rgba(225, 121, 143, .12), transparent 25rem),
    var(--cream);
}

main { width: min(1120px, calc(100% - 36px)); margin: 0 auto; padding: 74px 0 88px; }

.hero { text-align: center; max-width: 620px; margin: 0 auto 52px; }
.eyebrow, .memory-day { color: var(--rose-dark); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-size: .73rem; }
h1, h2 { font-family: "Playfair Display", Georgia, serif; }
h1 { font-size: clamp(3.1rem, 8vw, 5.7rem); line-height: .94; letter-spacing: -.06em; margin: 14px 0 24px; }
h1 em { color: var(--rose); font-weight: 600; }
.intro { color: #735b62; line-height: 1.65; font-size: 1.04rem; margin: 0 auto; max-width: 470px; }
.countdown { font-size: .88rem; min-height: 1.3em; margin: 22px 0 0; color: #9b7078; }

.calendar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.day {
  aspect-ratio: 1 / .88; position: relative; overflow: hidden; cursor: pointer;
  border: 1px solid var(--line); border-radius: 18px; color: var(--ink); background: rgba(255,255,255,.68);
  box-shadow: 0 3px 0 rgba(100, 49, 62, .03); transition: transform .22s ease, box-shadow .22s ease, background .22s ease;
}
.day:hover:not(:disabled), .day:focus-visible:not(:disabled) { transform: translateY(-5px) rotate(-1deg); box-shadow: var(--shadow); background: var(--paper); outline: none; }
.day:focus-visible { outline: 3px solid rgba(215,106,124,.42); outline-offset: 3px; }
.day-number { position: absolute; top: 13px; left: 15px; font-family: "Playfair Display", Georgia, serif; font-size: 1.55rem; font-weight: 700; }
.day-icon { color: #e8a1ab; font-size: 1.2rem; position: absolute; bottom: 14px; right: 15px; }
.day-status { display: none; }
.day.locked { color: #ad969b; cursor: not-allowed; background: rgba(250, 242, 238, .75); }
.day.locked .day-icon { color: #d8c8c3; }
.day.locked .day-status { display: grid; place-items: center; position: absolute; inset: 0; background: rgba(255, 251, 248, .58); font-size: .75rem; color: #a38b91; }
.day.opened { background: linear-gradient(145deg, #fff7f3, #f6e1df); border-color: #e7b1b7; }
.day.opened .day-icon { color: var(--rose); }

.memory-modal { width: min(940px, calc(100% - 32px)); max-height: min(680px, calc(100dvh - 40px)); padding: 0; border: 0; border-radius: 28px; overflow: hidden; color: var(--ink); background: var(--paper); box-shadow: 0 28px 100px rgba(49, 25, 34, .42); }
.memory-modal::backdrop { background: rgba(48, 29, 38, .68); backdrop-filter: blur(7px); }
.memory-content { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(280px, .88fr); min-height: 510px; }
.memory-image-wrap { min-height: 100%; position: relative; overflow: hidden; background: linear-gradient(135deg, #ecc1bd, #f4ddd2); display: grid; place-items: center; }
.memory-image-wrap::after { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, transparent 45%, rgba(37, 20, 27, .15)); pointer-events: none; }
.memory-image-wrap img { height: 100%; width: 100%; object-fit: cover; display: none; }
.image-placeholder { color: rgba(92, 53, 63, .72); font-family: "Playfair Display", Georgia, serif; font-style: italic; font-size: 1.5rem; }
.memory-copy { align-self: center; padding: clamp(36px, 6vw, 74px) clamp(30px, 5vw, 62px); }
.memory-modal h2 { margin: 8px 0 20px; font-size: clamp(2rem, 4.1vw, 3.35rem); line-height: 1; letter-spacing: -.055em; }
.memory-day { margin: 0; color: var(--rose-dark); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-size: .73rem; }
.memory-text { margin: 0; color: #624b53; font-size: 1rem; line-height: 1.75; }
.close { position: absolute; right: 18px; top: 18px; z-index: 2; width: 42px; height: 42px; border: 0; border-radius: 50%; cursor: pointer; color: #39262e; background: rgba(255,255,255,.94); box-shadow: 0 3px 16px rgba(30, 17, 22, .17); font-size: 1.85rem; line-height: .9; }
.close:hover, .close:focus-visible { background: white; transform: scale(1.06); }

@media (max-width: 680px) { main { padding-top: 52px; } .calendar { grid-template-columns: repeat(3, 1fr); gap: 10px; } .day { border-radius: 14px; } }
@media (max-width: 390px) { .calendar { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 680px) { .memory-modal { max-height: calc(100dvh - 24px); border-radius: 22px; } .memory-content { grid-template-columns: 1fr; min-height: 0; } .memory-image-wrap { min-height: 40dvh; max-height: 48dvh; } .memory-copy { padding: 32px 30px 38px; } .memory-modal h2 { font-size: 2.3rem; } .close { right: 12px; top: 12px; } }
