
:root {
  --cream: #FBF3E4;
  --cream-deep: #F1E3C8;
  --paper: #FFFDF9;
  --espresso: #4A3728;
  --espresso-80: rgba(74,55,40,0.8);
  --espresso-60: rgba(74,55,40,0.6);
  --espresso-40: rgba(74,55,40,0.4);
  --espresso-15: rgba(74,55,40,0.15);

  --coral: #E2775A;
  --coral-deep: #C6603F;
  --sky: #6F9CB5;
  --sage: #7E9A66;
  --marigold: #E7A93C;

  --font-display: 'Fredoka', system-ui, sans-serif;
  --font-body: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-hand: 'Caveat', cursive;

  --gutter: 1.1rem;
  --radius: 10px;

  color-scheme: light;
}

[data-theme="dark"] {
  --cream: #221B15;
  --cream-deep: #170F0A;
  --paper: #2C231C;
  --espresso: #F1E6D6;
  --espresso-80: rgba(241,230,214,0.85);
  --espresso-60: rgba(241,230,214,0.62);
  --espresso-40: rgba(241,230,214,0.4);
  --espresso-15: rgba(241,230,214,0.16);

  --coral: #E2825F;
  --coral-deep: #F0956C;
  --sky: #85B7D1;
  --sage: #96B87A;
  --marigold: #EFC066;

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--espresso);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, figure { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; color: inherit; }
a { color: var(--coral-deep); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

.wrap { max-width: 720px; margin: 0 auto; padding: 0 var(--gutter); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem var(--gutter);
  background: var(--cream-deep);
  border-bottom: 2px dashed var(--espresso-15);
}
.site-header .mark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--espresso);
}
.site-nav { display: flex; align-items: center; gap: 0.5rem; }
.shrine-link {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.72rem;
  text-decoration: none;
  color: var(--espresso-80);
  background: var(--paper);
  border: 1.5px solid var(--espresso-15);
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  white-space: nowrap;
  transition: transform 0.15s, border-color 0.15s;
}
.shrine-link:hover, .shrine-link:focus-visible { border-color: var(--coral); transform: translateY(-1px); }

.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  border: 1.5px solid var(--espresso-15);
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.95rem;
  transition: transform 0.15s, border-color 0.15s;
}
.icon-btn:hover, .icon-btn:focus-visible { border-color: var(--coral); transform: translateY(-1px); }
.icon-btn:active { transform: scale(0.94); }

.hero {
  padding: 0.9rem var(--gutter) 1.1rem;
  text-align: center;
}
.hero-caption {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--espresso-60);
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}
.hero-caption strong {
  color: var(--coral-deep);
  text-transform: none;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.photo-strip {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0.6rem 0 0.2rem;
}
.photo-frame {
  width: 64px;
  background: #fff;
  padding: 5px 5px 12px;
  margin: 0 -7px 12px;
  box-shadow: 0 5px 12px rgba(60,40,20,0.18), 0 1px 3px rgba(60,40,20,0.12);
  position: relative;
}
.photo-frame:nth-child(5n+1) { transform: rotate(-6deg); }
.photo-frame:nth-child(5n+2) { transform: rotate(4deg); }
.photo-frame:nth-child(5n+3) { transform: rotate(-2deg); }
.photo-frame:nth-child(5n+4) { transform: rotate(5deg); }
.photo-frame:nth-child(5n+5) { transform: rotate(-4deg); }
.photo-frame-inner {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: linear-gradient(135deg, #e7ded0, #d8cbb4);
}
.photo-frame img { width: 100%; height: 100%; object-fit: cover; }
.photo-frame::before {
  content: '';
  position: absolute;
  top: -7px;
  left: 50%;
  width: 26px;
  height: 13px;
  transform: translateX(-50%) rotate(-4deg);
  background: var(--coral);
  opacity: 0.75;
}
.photo-frame:nth-child(3n)::before { background: var(--sky); transform: translateX(-50%) rotate(3deg); }
.photo-frame:nth-child(4n)::before { background: var(--sage); transform: translateX(-50%) rotate(-2deg); }
.photo-frame:nth-child(7n)::before { background: var(--marigold); }
.photo-frame--empty .photo-frame-inner { display: flex; align-items: center; justify-content: center; }
.photo-frame--empty .photo-frame-inner::after {
  content: '+';
  font-size: 1.3rem;
  color: var(--espresso-40);
  font-family: var(--font-display);
}

.countdown-card {
  max-width: 420px;
  margin: 0.6rem auto 0;
  background: var(--paper);
  border: 2px solid var(--espresso-15);
  border-radius: var(--radius);
  box-shadow: 0 6px 18px rgba(60,40,20,0.10);
  padding: 0.7rem 0.35rem;
}
.countdown { display: grid; grid-template-columns: repeat(6, 1fr); }
.countdown-unit { padding: 0 2px; }
.countdown-unit .value {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.05rem, 5vw, 1.5rem);
  font-variant-numeric: tabular-nums;
  color: var(--espresso);
}
.countdown-unit .label {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.54rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--espresso-40);
  font-weight: 700;
}

.era-line {
  margin-top: 0.65rem;
  font-family: var(--font-hand);
  font-weight: 600;
  font-size: clamp(1.25rem, 5vw, 1.55rem);
  color: var(--espresso-80);
}
.era-line strong { color: var(--coral-deep); font-size: 1.15em; padding: 0 0.1em; }

.section-eyebrow {
  display: block;
  text-align: center;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--coral-deep);
  margin-bottom: 0.3rem;
}
.section-heading {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.3rem, 5vw, 1.7rem);
  text-align: center;
  color: var(--espresso);
  margin-bottom: 1.3rem;
}

.timeline-section { padding: 1.4rem 0 3rem; }
.timeline {
  position: relative;
  min-height: 400px;
}
.timeline-track {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: linear-gradient(to bottom, transparent, var(--espresso-15) 4%, var(--espresso-15) 96%, transparent);
}
.timeline-track::before, .timeline-track::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--coral);
}
.timeline-track::before { top: -4px; }
.timeline-track::after { bottom: -4px; }

.timeline-entry {
  position: absolute;
  left: 0;
  right: 0;
  transform: translateY(-50%);
}
.timeline-dot-wrap {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
}
.timeline-dot-wrap:has(.timeline-tooltip.is-visible) {
  z-index: 60;
}
.timeline-dot {
  display: block;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 3px solid var(--paper);
  border-radius: 50%;
  cursor: pointer;
  background: linear-gradient(135deg, var(--coral), var(--coral-deep));
  box-shadow: 0 0 0 2px var(--espresso-15), 0 4px 10px rgba(60,40,20,0.25);
  overflow: hidden;
  transition: transform 0.15s;
}
.timeline-dot img { width: 100%; height: 100%; object-fit: cover; }
.timeline-dot:hover, .timeline-dot:focus-visible { transform: scale(1.18); }

.timeline-entry--right .timeline-date {
  position: absolute;
  left: 50%;
  margin-left: 26px;
  width: 44vw;
  max-width: 220px;
  text-align: left;
}
.timeline-entry--left .timeline-date {
  position: absolute;
  right: 50%;
  margin-right: 26px;
  width: 44vw;
  max-width: 220px;
  text-align: right;
}
.timeline-date {
  display: block;
  padding: 6px 0;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--espresso-60);
  white-space: normal;
}

.timeline-date-desc {
  display: block;
  margin-top: 2px;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--espresso-40);
  white-space: normal;
  line-height: 1.3;
}

.timeline-tooltip {
  position: absolute;
  top: 50%;
  left: calc(100% + 12px);
  transform: translateY(-50%);
  width: 210px;
  padding: 0.7rem;
  background: var(--paper);
  border: 2px solid var(--espresso-15);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(60,40,20,0.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 15;
  text-align: left;
}
.timeline-tooltip.is-visible { opacity: 1; }
.timeline-tooltip img { width: 100%; aspect-ratio: 16/9; object-fit: cover; margin-bottom: 0.45rem; border-radius: 6px; }
.timeline-tooltip-title { font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; color: var(--espresso); }
.timeline-tooltip-desc { margin-top: 0.2rem; font-size: 0.78rem; color: var(--espresso-60); line-height: 1.4; }

.site-footer {
  text-align: center;
  padding: 1.6rem var(--gutter) 2.4rem;
  border-top: 2px dashed var(--espresso-15);
  color: var(--espresso-40);
  font-size: 0.78rem;
}

.fab-stack {
  position: fixed;
  right: var(--gutter);
  bottom: var(--gutter);
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.fab {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--espresso-15);
  background: var(--paper);
  box-shadow: 0 6px 16px rgba(60,40,20,0.22);
  font-size: 1.05rem;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}
.fab:hover, .fab:focus-visible { transform: translateY(-2px); border-color: var(--coral); }
.fab:active { transform: scale(0.94); }

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(40, 28, 18, 0.55);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal {
  width: 100%;
  max-width: 540px;
  max-height: min(88dvh, 88vh);
  overflow-y: auto;
  background: var(--paper);
  border: 2px solid var(--espresso-15);
  border-bottom: none;
  border-radius: 16px 16px 0 0;
  padding: 1.6rem 1.35rem 1.85rem;
  position: relative;
  transform: translateY(24px);
  transition: transform 0.28s ease;
}
.modal-overlay.open .modal { transform: translateY(0); }
@media (min-width: 640px) {
  .modal-overlay { align-items: center; }
  .modal { border-radius: 16px; border-bottom: 2px solid var(--espresso-15); }
}

.modal-close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--espresso-15);
  background: var(--cream);
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--espresso-60);
  transition: color 0.15s, border-color 0.15s;
}
.modal-close:hover, .modal-close:focus-visible { color: var(--coral-deep); border-color: var(--coral); }

.modal-thumbnail { width: 100%; aspect-ratio: 16/9; object-fit: cover; margin-bottom: 1rem; border-radius: 8px; }
.modal-thumbnail[hidden] { display: none; }
#modal-title { font-family: var(--font-display); font-weight: 600; font-size: 1.4rem; color: var(--espresso); padding-right: 1.8rem; }
.modal-date { margin-top: 0.3rem; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--coral-deep); }
.modal-description { margin-top: 0.55rem; font-family: var(--font-hand); font-size: 1.15rem; color: var(--espresso-80); line-height: 1.3; }
.modal-content { margin-top: 1rem; color: var(--espresso-80); line-height: 1.65; }
.modal-content p + p { margin-top: 0.8rem; }

.modal-photos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 1.1rem;
}
.modal-photos[hidden] { display: none; }
.modal-photos img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid var(--espresso-15);
}

.settings-panel h3, .chat-panel h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--espresso);
  padding-right: 1.8rem;
  margin-bottom: 1.1rem;
}
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0;
  border-top: 1.5px dashed var(--espresso-15);
  font-size: 0.88rem;
  font-weight: 600;
}
.setting-row:first-of-type { border-top: none; }
.setting-row input[type="range"] { width: 120px; accent-color: var(--coral); }
.setting-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--coral); }

.chat-panel { display: flex; flex-direction: column; }
#chat-name-gate { display: flex; flex-direction: column; gap: 0.7rem; }
#chat-name-gate p { color: var(--espresso-60); font-size: 0.85rem; }
#chat-status { font-size: 0.8rem; color: var(--espresso-60); margin-bottom: 0.7rem; }
.text-input {
  width: 100%;
  padding: 0.65rem 0.8rem;
  background: var(--cream);
  border: 1.5px solid var(--espresso-15);
  color: var(--espresso);
  font-family: var(--font-body);
  font-size: 0.9rem;
  border-radius: 8px;
}
.text-input:focus-visible { outline: none; border-color: var(--coral); }
.btn {
  padding: 0.65rem 1.05rem;
  background: var(--coral);
  border: 2px solid var(--coral);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  border-radius: 999px;
  transition: transform 0.15s, background 0.15s;
}
.btn:hover, .btn:focus-visible { background: var(--coral-deep); transform: translateY(-1px); }

#chat-room { display: flex; flex-direction: column; min-height: 0; }
.chat-messages {
  height: 250px;
  overflow-y: auto;
  padding: 0.7rem 0.6rem;
  margin-top: 10px;
  margin-bottom: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: var(--cream);
  border: 1.5px solid var(--espresso-15);
  border-radius: 10px;
  box-shadow: inset 0 2px 6px rgba(60,40,20,0.08);
}
.chat-message { font-size: 0.85rem; line-height: 1.4; }
.chat-message-name { color: var(--coral-deep); font-weight: 700; margin-right: 0.4em; }
.chat-message-text { color: var(--espresso); word-break: break-word; }
.chat-message-time { color: var(--espresso-40); font-size: 0.65rem; margin-left: 0.4em; }
.chat-empty, .chat-error, .chat-status { color: var(--espresso-40); font-size: 0.8rem; font-style: italic; }
.chat-error { color: var(--coral-deep); }
#chat-form { display: flex; gap: 0.5rem; }
#chat-form .text-input { flex: 1; }

@media (min-width: 700px) {
  :root { --gutter: 1.75rem; }
  .hero { padding-top: 1.4rem; padding-bottom: 1.6rem; }
  .photo-frame { width: 78px; }
  .countdown-card { max-width: 520px; padding: 1rem 0.8rem; }
  .countdown-unit .value { font-size: clamp(1.3rem, 3vw, 1.75rem); }

  .timeline-dot { width: 40px; height: 40px; }
  .timeline-entry--right .timeline-date,
  .timeline-entry--left .timeline-date {
    width: 220px;
    max-width: none;
  }
  .timeline-entry--right .timeline-date { margin-left: 32px; }
  .timeline-entry--left .timeline-date { margin-right: 32px; }
  .timeline-entry--left .timeline-tooltip { left: auto; right: calc(100% + 12px); }
}

@media (min-width: 1000px) {
  .wrap { max-width: 820px; }
  .hero { max-width: 820px; margin: 0 auto; }
}