
/* ---------- Base and colour palette ---------- */

:root {
  --cream: #c9ab5f;
  --paper: #ffffff;
  --pink: #f5f2df;
  --pink-deep: #e1ac00;
  --rose: #e7d785;
  --wine: #e1ac00;
  --text: #492f00;
  --muted: #492f00;
  --line: #f0e4e3;
  --shadow: 0 18px 60px rgba(99, 61, 73, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--cream);
  scroll-behaviour: smooth;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(ellipse at 10% 5%, #fcfbe9 0, transparent 35%),
    radial-gradient(ellipse at 95% 40%, #fcfbe9 0, transparent 30%),
    var(--cream);
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
}

button:focus-visible {
  outline: 3px solid var(--rose);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.page {
  width: min(100%, 620px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 30px 18px 22px;
}

/* ---------- Hero ---------- */

.hero {
  text-align: center;
  padding: 20px 4px 32px;
  animation: fade-up 0.8s ease both;
}

.eyebrow,
.month-label,
.modal-kicker {
  font-size: 10px;
  letter-spacing: 3px;
  font-weight: 700;
  color: var(--rose);
}

.hero-anchor {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 21px;
  color: var(--pink);
}

.hero-anchor svg {
  width: 25px;
  height: 25px;
  display: block;
}

.hero h1 {
  margin: 10px 0 14px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(43px, 11vw, 64px);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -2.5px;
  color: var(--wine);
}

.hero h1 em {
  color: var(--rose);
  font-weight: 400;
}

.intro {
  max-width: 290px;
  margin: 0 auto;
  color: var(--muted);
  font-family: Georgia, serif;
  font-size: 15px;
  line-height: 1.8;
}

.countdown {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 86px;
  height: 86px;
  margin: 24px auto 0;
  border: 1px solid #eacbd0;
  border-radius: 50%;
  background: rgba(255, 253, 251, 0.75);
}

.countdown-number {
  font-family: Georgia, serif;
  color: var(--wine);
  font-size: 29px;
  line-height: 1.1;
}

.countdown-label {
  margin-top: 5px;
  color: var(--rose);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-align: center;
}

.hint {
  margin: 17px 0 0;
  font-size: 11px;
  color: var(--muted);
}

/* ---------- Calendar ---------- */

.calendar-section {
  padding: 22px 13px 20px;
  border: 1px solid rgba(231, 185, 193, 0.45);
  border-radius: 2px;
  background: rgba(255, 253, 251, 0.88);
  box-shadow: 0 10px 36px rgba(99, 61, 73, 0.045);
  animation: fade-up 0.8s 0.12s ease both;
}

.calendar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 3px 20px;
}

.month-label {
  font-size: 8px;
  letter-spacing: 2px;
}

.calendar-heading h2 {
  margin: 6px 0 0;
  font-family: Georgia, serif;
  font-size: 26px;
  font-weight: 400;
  color: var(--wine);
}

.calendar-heading h2 span {
  font-size: 15px;
  color: var(--muted);
}

.calendar-flower {
  padding-right: 5px;
  color: var(--pink-deep);
  font-size: 35px;
}

/* Seven equal columns always fit the phone */

.calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px 3px;
}

.weekday {
  display: grid;
  place-items: center;
  min-height: 27px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.day,
.day-empty {
  min-width: 0;
  aspect-ratio: 1 / 1;
}

.day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 11px;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.day-number {
  font-family: Georgia, serif;
  font-size: clamp(13px, 3.7vw, 18px);
  line-height: 1;
}

.day-mark {
  min-height: 6px;
  color: var(--rose);
  font-size: 9px;
  line-height: 1;
}

.day.has-surprise {
  background: #fff7f6;
  border-color: #f5e6e6;
}

.day.has-surprise .day-mark {
  color: var(--rose);
}

.day.special {
  color: white;
  background: var(--rose);
  border-color: var(--rose);
  box-shadow: 0 4px 12px rgba(183, 110, 126, 0.2);
}

.day.special .day-mark {
  color: white;
}

.day:active {
  transform: scale(0.93);
}

@media (hover: hover) {
  .day:hover {
    background: var(--pink);
    border-color: var(--pink-deep);
    transform: translateY(-2px);
  }

  .day.special:hover {
    background: var(--wine);
  }
}

.calendar-note {
  margin: 19px 0 0;
  text-align: center;
  font-family: Georgia, serif;
  font-size: 12px;
  font-style: italic;
  color: var(--muted);
}

/* ---------- Footer ---------- */

.footer {
  padding: 28px 0 10px;
  text-align: center;
  color: var(--rose);
}

.footer > span {
  font-size: 23px;
}

.footer p {
  margin: 5px 0;
  color: var(--muted);
  font-family: Georgia, serif;
  font-size: 12px;
  font-style: italic;
}

/* ---------- Modal and backdrop ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  visibility: hidden;
  pointer-events: none;
}

.modal.is-open {
  visibility: visible;
  pointer-events: auto;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(47, 27, 35, 0.45);
  opacity: 0;
  transition: opacity 0.25s ease;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.modal.is-open .modal-backdrop {
  opacity: 1;
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(100%, 410px);
  max-height: min(86dvh, 780px);
  overflow-y: auto;
  overscroll-behaviour: contain;
  border-radius: 2px;
  background: var(--paper);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(18px) scale(0.98);
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
  scrollbar-width: thin;
  scrollbar-color: var(--pink-deep) transparent;
}

.modal.is-open .modal-card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.close-button {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  color: var(--wine);
  background: rgba(255, 253, 251, 0.94);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.modal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 23px 22px 15px;
}

.modal-date {
  color: var(--rose);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
}

.modal-heart {
  color: var(--pink-deep);
  font-size: 23px;
}

.modal-media {
  margin: 0 15px;
  overflow: hidden;
  border-radius: 15px;
  background: #f8eeee;
}

.modal-media img,
.modal-media video {
  display: block;
  width: 100%;
  max-height: 43dvh;
  object-fit: cover;
  background: #f8eeee;
}

.modal-media video {
  aspect-ratio: 4 / 3;
}

.modal-copy {
  padding: 23px 23px 16px;
}

.modal-kicker {
  font-size: 8px;
  letter-spacing: 2px;
}

.modal-copy h2 {
  margin: 10px 0 13px;
  color: var(--wine);
  font-family: Georgia, serif;
  font-size: clamp(25px, 7vw, 33px);
  font-weight: 400;
  line-height: 1.2;
}

.modal-copy > p:not(.modal-signoff) {
  margin: 0;
  color: #79666b;
  font-family: Georgia, serif;
  font-size: 15px;
  line-height: 1.85;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.modal-signoff {
  margin: 18px 0 0;
  color: var(--rose);
  font-family: Georgia, serif;
  font-size: 13px;
  font-style: italic;
}

.modal-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 20px 19px;
  border-top: 1px solid var(--line);
}

.modal-navigation button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--wine);
  background: white;
  font-size: 19px;
  cursor: pointer;
}

.modal-navigation button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.modal-navigation span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
}

/* ---------- Small-screen refinements ---------- */

@media (max-width: 380px) {
  .page {
    padding: 22px 11px 18px;
  }

  .hero {
    padding-bottom: 25px;
  }

  .calendar-section {
    padding: 18px 9px;
  }

  .calendar {
    gap: 4px 2px;
  }

  .day {
    border-radius: 9px;
  }

  .day-number {
    font-size: 13px;
  }

  .modal {
    padding: 10px;
  }
}

/* ---------- Reduced motion accessibility ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behaviour: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* Day 8 surprise button */

.day-eight-button {
  display: block;
  width: 100%;
  margin-top: 20px;
  padding: 14px 12px;
  border-radius: 5px;
  background: #fff7f6;
  color: #492f00;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.day-eight-button:hover {
  background: #492f00;
  color: white;
}

/* Second popup */

.mini-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  visibility: hidden;
  pointer-events: none;
}

.mini-modal.is-open {
  visibility: visible;
  pointer-events: auto;
}

.mini-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(47, 27, 35, 0.5);
  backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.mini-modal.is-open .mini-backdrop {
  opacity: 1;
}

.mini-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 340px;
  padding: 36px 24px 28px;
  border-radius: 22px;
  background: #fffdfb;
  text-align: center;
  box-shadow: 0 18px 60px rgba(99, 61, 73, 0.16);
  opacity: 0;
  transform: translateY(12px) scale(0.97);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.mini-modal.is-open .mini-card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.mini-close {
  position: absolute;
  top: 9px;
  right: 12px;
  border: 0;
  background: transparent;
  color: var(--wine);
  font-size: 27px;
  cursor: pointer;
}

.mini-anchor {
  margin-bottom: 14px;
  color: var(--rose);
  font-size: 24px;
}

.mini-kicker {
  color: var(--rose);
  font-family: Arial, sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
}

.mini-card h2 {
  margin: 13px 0 8px;
  color: var(--wine);
  font-family: Georgia, serif;
  font-size: 28px;
  font-weight: 400;
  line-height: 1.3;
}

.mini-message {
  margin: 0 0 24px;
  color: var(--muted);
  font-family: Georgia, serif;
  font-size: 16px;
  line-height: 1.8;
}

.mini-continue {
  width: 100%;
  min-height: 48px;
  border: none;
  border-radius: 5px;
  background: var(--rose);
  color: white;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  cursor: pointer;
}

.mini-continue:active {
  transform: scale(0.98);
}

body.mini-modal-open {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .mini-card,
  .mini-backdrop,
  .day-eight-button {
    transition: none;
  }
}
