:root {
  --bg-top: #f6e7de;
  --bg-bottom: #fdf7f1;
  --surface: rgba(255, 250, 246, 0.82);
  --surface-strong: rgba(255, 248, 243, 0.95);
  --line: rgba(112, 64, 49, 0.12);
  --text-main: #38231d;
  --text-soft: #7b5a4e;
  --accent: #b85f4a;
  --accent-dark: #8b3f30;
  --accent-pale: #eed3c7;
  --shadow: 0 30px 60px rgba(109, 64, 47, 0.15);
}

body[data-theme='summer'] {
  --bg-top: #f6e7c2;
  --bg-bottom: #fff8e8;
  --surface: rgba(255, 251, 238, 0.84);
  --surface-strong: rgba(255, 252, 242, 0.95);
  --accent: #c26b2d;
  --accent-dark: #8c4d20;
  --accent-pale: #f3debe;
}

body[data-theme='autumn'] {
  --bg-top: #ead3c2;
  --bg-bottom: #f7ece1;
  --surface: rgba(251, 242, 234, 0.84);
  --surface-strong: rgba(255, 247, 240, 0.95);
  --accent: #ad5b34;
  --accent-dark: #7c3e22;
  --accent-pale: #efd0bf;
}

body[data-theme='winter'] {
  --bg-top: #e8edf7;
  --bg-bottom: #f8f5fb;
  --surface: rgba(249, 247, 253, 0.88);
  --surface-strong: rgba(255, 252, 255, 0.96);
  --text-main: #2f3748;
  --text-soft: #6f7a92;
  --accent: #7d92bd;
  --accent-dark: #5f739d;
  --accent-pale: #dfe6f7;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.78), transparent 32%),
    radial-gradient(circle at bottom right, rgba(232, 197, 180, 0.45), transparent 28%),
    linear-gradient(160deg, var(--bg-top), var(--bg-bottom));
}

body::selection {
  background: rgba(184, 95, 74, 0.28);
}

body::before,
body::after {
  content: '';
  position: fixed;
  inset: auto;
  width: 22rem;
  height: 22rem;
  border-radius: 999px;
  filter: blur(10px);
  opacity: 0.45;
  pointer-events: none;
}

body::before {
  top: -8rem;
  right: -5rem;
  background: rgba(228, 171, 152, 0.35);
}

body::after {
  bottom: -10rem;
  left: -4rem;
  background: rgba(248, 231, 219, 0.9);
}

.page-shell::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image:
    repeating-linear-gradient(
      33deg,
      rgba(90, 64, 48, 0.07) 0,
      rgba(90, 64, 48, 0.07) 1px,
      transparent 1px,
      transparent 8px
    ),
    repeating-linear-gradient(
      -47deg,
      rgba(255, 255, 255, 0.35) 0,
      rgba(255, 255, 255, 0.35) 1px,
      transparent 1px,
      transparent 12px
    );
  z-index: -1;
}

.celebration-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 20;
  opacity: 0;
  transition: opacity 220ms ease;
}

.celebration-layer.active {
  opacity: 1;
}

.floating-emoji {
  position: absolute;
  bottom: -2.2rem;
  filter: drop-shadow(0 6px 10px rgba(56, 35, 29, 0.2));
  animation: float-up 4.8s ease-in forwards;
  will-change: transform, opacity;
}

@keyframes float-up {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(0deg) scale(0.9);
  }

  12% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate3d(-12px, -115vh, 0) rotate(12deg) scale(1.15);
  }
}

.page-shell {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.topbar,
.hero-grid,
.section-heading,
.hero-footer,
.admin-header,
.button-row,
.checkbox-row {
  display: flex;
}

.topbar,
.section-heading,
.admin-header,
.button-row {
  justify-content: space-between;
  align-items: center;
}

.topbar {
  margin-bottom: 2rem;
}

.creator-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin: -0.8rem 0 1.1rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.theme-switch {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 251, 248, 0.72);
  border: 1px solid rgba(112, 64, 49, 0.18);
  border-radius: 999px;
  padding: 0.62rem 0.9rem;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.brand-mark,
.eyebrow,
.footer-label,
.muted,
.countdown-unit,
.status-text {
  color: var(--text-soft);
}

.brand-mark,
.eyebrow,
.footer-label {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.73rem;
}

.brand-copy,
.lead,
.muted,
.status-text,
label span,
input,
textarea,
button {
  font-size: 0.98rem;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: 'Cormorant Garamond', serif;
  line-height: 0.95;
  overflow-wrap: anywhere;
}

h1 {
  font-size: clamp(3.5rem, 7vw, 6.6rem);
  max-width: 11ch;
}

h2 {
  font-size: clamp(2.2rem, 4.8vw, 4rem);
}

h3 {
  font-size: 2rem;
}

p {
  margin: 0;
}

.hero-grid {
  gap: 1.25rem;
  align-items: stretch;
}

.hero-card,
.upcoming-card,
.admin-panel,
.card-surface {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-card,
.upcoming-card,
.card-surface,
.queue-item,
.admin-date-card,
.milestone-item,
.meeting-card,
.bucket-item {
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.hero-card:hover,
.upcoming-card:hover,
.card-surface:hover,
.queue-item:hover,
.admin-date-card:hover,
.milestone-item:hover,
.meeting-card:hover,
.bucket-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 34px 64px rgba(92, 55, 41, 0.2);
}

.hero-card {
  border-radius: 32px;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.hero-card-main {
  flex: 1.6;
}

.hero-card-side {
  flex: 1;
  justify-content: space-between;
  display: flex;
  flex-direction: column;
}

.hero-card-main::after {
  content: '';
  position: absolute;
  right: -4rem;
  bottom: -5rem;
  width: 16rem;
  height: 16rem;
  background: radial-gradient(circle, rgba(184, 95, 74, 0.22), transparent 65%);
}

.hero-card-main.is-together-period {
  background: linear-gradient(145deg, rgba(230, 250, 240, 0.95), rgba(248, 255, 251, 0.94));
  border-color: rgba(76, 150, 112, 0.26);
}

.hero-card-main.is-together-period::after {
  background: radial-gradient(circle, rgba(76, 150, 112, 0.24), transparent 65%);
}

.lead {
  max-width: 40rem;
  line-height: 1.7;
  margin-top: 1rem;
  overflow-wrap: anywhere;
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
  margin: 2rem 0;
}

.countdown-grid article,
.queue-item,
.admin-date-card,
.meeting-card,
.milestone-item {
  background: var(--surface-strong);
  border: 1px solid rgba(112, 64, 49, 0.08);
}

.countdown-grid article {
  border-radius: 24px;
  padding: 1rem;
}

.countdown-value {
  display: block;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
}

.countdown-unit {
  font-size: 0.9rem;
}

.hero-footer {
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-footer div {
  min-width: 12rem;
}

.timeline-accent {
  height: 12rem;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(184, 95, 74, 0.05), rgba(184, 95, 74, 0.28)),
    repeating-linear-gradient(
      180deg,
      transparent 0,
      transparent 10px,
      rgba(139, 63, 48, 0.08) 10px,
      rgba(139, 63, 48, 0.08) 11px
    );
  margin-top: 2rem;
}

.milestone-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.anniversary-split {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.milestone-item,
.meeting-card {
  border-radius: 24px;
  padding: 1rem;
}

.milestone-item {
  display: grid;
  gap: 0.25rem;
}

.milestone-item strong,
.milestone-item span {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
}

.milestone-item strong {
  font-size: 0.82rem;
  line-height: 1.25;
}

.milestone-item span {
  font-size: 0.75rem;
  line-height: 1.3;
}

.meeting-card {
  display: grid;
  gap: 0.45rem;
  margin-top: 1rem;
}

#days-together {
  line-height: 0.98;
}

.upcoming-card {
  border-radius: 32px;
  padding: 2rem;
  margin-top: 1.25rem;
}

.queue-list,
.admin-date-list {
  display: grid;
  gap: 0.85rem;
  margin-top: 1.25rem;
}

.queue-list {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.queue-item,
.admin-date-card {
  border-radius: 24px;
  padding: 1rem;
}

.queue-item h3,
.admin-date-card h4 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  line-height: 1.3;
  font-size: 1rem;
  margin-bottom: 0.55rem;
}

.queue-title-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.4rem;
}

.timeline-mini-icon {
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(184, 95, 74, 0.1);
  border: 1px solid rgba(184, 95, 74, 0.26);
  font-size: 0.9rem;
}

.dual-panel article {
  width: 100%;
}

.bucket-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.quick-event-form {
  margin-top: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: end;
}

.quick-event-form label:last-of-type,
.quick-event-form .button-row,
.quick-event-form button {
  grid-column: 1 / -1;
}

.quick-event-list-head {
  margin-top: 1.2rem;
}

.bucket-item {
  border-radius: 24px;
  border: 1px solid rgba(112, 64, 49, 0.08);
  background: var(--surface-strong);
  padding: 1rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.8rem;
}

.bucket-item.is-completed {
  border-color: rgba(83, 145, 108, 0.35);
  background: linear-gradient(145deg, rgba(234, 248, 239, 0.94), rgba(251, 255, 252, 0.94));
}

.bucket-toggle {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 999px;
  border: 1px solid rgba(112, 64, 49, 0.24);
  background: rgba(255, 255, 255, 0.82);
  color: var(--accent-dark);
  font-weight: 700;
  align-self: start;
}

.bucket-milestone {
  margin-top: 0.35rem;
  font-size: 0.84rem;
  color: var(--text-soft);
}

.mail-indicator {
  position: relative;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 999px;
  border: 1px solid rgba(112, 64, 49, 0.18);
  background: rgba(255, 251, 248, 0.72);
  color: var(--text-main);
}

.mail-glyph {
  font-size: 1.05rem;
}

.mail-badge {
  position: absolute;
  top: -0.2rem;
  right: -0.15rem;
  min-width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-dark);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0 0.2rem;
}

.mail-indicator.has-unread {
  box-shadow: 0 0 0 3px rgba(184, 95, 74, 0.16);
}

.letter-stage {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(39, 21, 14, 0.45);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 240ms ease;
}

.letter-stage.is-visible {
  opacity: 1;
}

.letter-envelope {
  width: min(300px, 75vw);
  aspect-ratio: 1.45;
  position: relative;
  border-radius: 14px;
  background: linear-gradient(140deg, #e2c9ac, #cfa17b);
  box-shadow: 0 18px 42px rgba(42, 24, 16, 0.28);
  transform-origin: center;
  transition: transform 420ms ease;
}

.letter-envelope .flap {
  position: absolute;
  inset: 0;
  clip-path: polygon(0 0, 100% 0, 50% 52%);
  background: linear-gradient(145deg, #d7b391, #c18f64);
  transform-origin: top;
  transition: transform 420ms ease;
}

.letter-envelope .sheet-glow {
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 12%;
  height: 62%;
  border-radius: 8px;
  background: rgba(255, 247, 233, 0.48);
}

.letter-envelope.is-opened {
  transform: translateY(-26px) scale(0.96);
}

.letter-envelope.is-opened .flap {
  transform: rotateX(165deg);
}

.letter-card {
  position: absolute;
  width: min(620px, calc(100vw - 2rem));
  max-height: 78vh;
  overflow: auto;
  padding: 1.4rem;
  border-radius: 18px;
  border: 1px solid rgba(99, 66, 41, 0.35);
  background:
    linear-gradient(180deg, rgba(255, 244, 217, 0.94), rgba(248, 228, 191, 0.94)),
    repeating-linear-gradient(
      0deg,
      rgba(152, 113, 72, 0.08) 0,
      rgba(152, 113, 72, 0.08) 1px,
      transparent 1px,
      transparent 14px
    );
  box-shadow: 0 30px 70px rgba(48, 29, 18, 0.3);
  transform: translateY(36px) scale(0.95);
  opacity: 0;
  transition: transform 320ms ease, opacity 320ms ease;
}

.letter-card p {
  line-height: 1.6;
  white-space: pre-wrap;
}

.letter-card.is-shown {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.queue-item p,
.admin-date-card p {
  line-height: 1.6;
}

.queue-item.active {
  border-color: rgba(184, 95, 74, 0.36);
  box-shadow: inset 0 0 0 1px rgba(184, 95, 74, 0.24);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.admin-entry,
.primary-button,
.secondary-button,
.danger-button,
.modal-close {
  border-radius: 999px;
  transition: transform 180ms ease, opacity 180ms ease, background-color 180ms ease;
}

.admin-entry,
.secondary-button,
.danger-button {
  border: 1px solid rgba(112, 64, 49, 0.18);
  background: rgba(255, 251, 248, 0.72);
  color: var(--text-main);
}

.admin-entry,
.primary-button,
.secondary-button,
.danger-button {
  padding: 0.85rem 1.2rem;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: white;
}

.danger-button {
  color: var(--accent-dark);
}

.admin-entry:hover,
.primary-button:hover,
.secondary-button:hover,
.danger-button:hover,
.modal-close:hover {
  transform: translateY(-1px);
}

.admin-modal {
  width: min(960px, calc(100% - 1rem));
  border: 0;
  background: transparent;
  padding: 1rem;
}

.admin-modal::backdrop {
  background: rgba(34, 20, 17, 0.35);
  backdrop-filter: blur(6px);
}

.admin-panel {
  position: relative;
  border-radius: 32px;
  padding: 2rem;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.4rem;
  height: 2.4rem;
  background: rgba(255, 247, 242, 0.9);
  color: var(--text-main);
}

.stack-form,
.admin-columns {
  display: grid;
  gap: 1rem;
}

.admin-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 1.5rem 0;
}

.card-surface {
  border-radius: 28px;
  padding: 1.25rem;
}

label {
  display: grid;
  gap: 0.45rem;
}

input,
textarea,
select {
  width: 100%;
  border-radius: 18px;
  border: 1px solid rgba(112, 64, 49, 0.15);
  background: rgba(255, 255, 255, 0.8);
  padding: 0.9rem 1rem;
  color: var(--text-main);
}

textarea {
  resize: vertical;
}

.checkbox-row {
  gap: 0.75rem;
  align-items: center;
}

.checkbox-row input {
  width: auto;
}

.section-heading.compact {
  align-items: end;
}

.admin-date-card {
  display: grid;
  gap: 0.6rem;
}

.admin-date-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.status-text {
  min-height: 1.5rem;
  margin-top: 1rem;
}

[hidden] {
  display: none !important;
}

@media (max-width: 860px) {
  .hero-grid,
  .admin-columns {
    grid-template-columns: 1fr;
    display: grid;
  }

  .countdown-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .anniversary-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .page-shell {
    width: min(100% - 1rem, 100%);
    padding-top: 1rem;
    padding-bottom: 2rem;
  }

  .topbar,
  .section-heading,
  .admin-header,
  .button-row,
  .topbar-actions {
    gap: 1rem;
    align-items: start;
    flex-direction: column;
  }

  .hero-card,
  .upcoming-card,
  .admin-panel {
    padding: 1.25rem;
    border-radius: 26px;
  }

  h1 {
    font-size: clamp(2.4rem, 10vw, 3.3rem);
  }

  h2 {
    font-size: clamp(1.9rem, 10vw, 2.7rem);
  }

  h3 {
    font-size: clamp(1.9rem, 8.2vw, 2.4rem);
  }

  #days-together {
    font-size: clamp(2.1rem, 14vw, 3.3rem);
  }

  .brand-copy,
  .lead,
  .muted,
  .status-text,
  label span,
  input,
  textarea,
  button,
  select {
    font-size: 0.95rem;
  }

  .anniversary-split {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .milestone-item {
    padding: 0.9rem;
  }

  .milestone-item strong {
    font-size: 0.95rem;
  }

  .milestone-item span {
    font-size: 0.84rem;
  }

  .meeting-card {
    margin-top: 0.85rem;
    padding: 1rem;
  }

  .queue-list {
    grid-template-columns: 1fr;
  }

  .bucket-list {
    grid-template-columns: 1fr;
  }

  .queue-item,
  .admin-date-card {
    padding: 0.9rem;
  }

  .countdown-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin: 1.25rem 0;
  }

  .countdown-grid article {
    padding: 0.75rem;
    border-radius: 18px;
  }

  .countdown-value {
    font-size: clamp(1.65rem, 9vw, 2.1rem);
  }

  .mail-indicator {
    width: 2.6rem;
    height: 2.6rem;
  }

  .letter-card {
    padding: 1rem;
    border-radius: 14px;
  }
}