*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

@font-face {
  font-family: 'Willsyard';
  src: url('/static/fonts/Willsyard.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'LaMonarchie';
  src: url('/static/fonts/La Monarchie de Saint Ombre.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'Tempting';
  src: url('/static/fonts/Tempting.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

:root {
  --night:      #080312;
  --warm-dark:  #110716;
  --gold:       #b8965a;
  --gold-light: #d4b478;
  --cream:      #f0e5d4;
  --muted:      rgba(240,229,212,0.45);
  --divider:    rgba(184,150,90,0.18);
  --radius:     8px;
}

body {
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  font-weight: 300;
  background: var(--night);
  color: var(--cream);
  min-height: 100vh;
}

/* ─────────────────────────────────────────
   Login
───────────────────────────────────────── */
.login-page {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  overflow: hidden;
}

.login-page .hero-bg {
  position: absolute;
  inset: -30px;
  background-size: cover;
  background-position: center 20%;
  filter: blur(16px) saturate(0.6) brightness(0.55);
  transform: scale(1.06);
  z-index: 0;
}

.login-page .hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 4, 20, 0.28);
  z-index: 1;
}

.login-box {
  position: relative;
  z-index: 2;
  text-align: center;
  width: min(320px, 90vw);
}

.login-label {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 300;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--cream);
  margin-bottom: 2.5rem;
}

.login-box input[type="password"] {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(184,150,90,0.3);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
  text-align: center;
  letter-spacing: 0.25em;
  color: var(--cream);
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.login-box input[type="password"]::placeholder { color: var(--muted); }
.login-box input[type="password"]:focus {
  border-color: var(--gold);
  background: rgba(255,255,255,0.09);
}

.login-box button {
  margin-top: 1rem;
  width: 100%;
  padding: 0.8rem;
  background: transparent;
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  color: var(--gold);
  font-family: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.login-box button:hover {
  background: var(--gold);
  color: var(--night);
}

.error {
  margin-top: 0.75rem;
  font-size: 0.83rem;
  color: #d08080;
}

/* ─────────────────────────────────────────
   Hero — Save the Date (one full screen)
───────────────────────────────────────── */
.save-the-date {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: -30px;
  background-size: cover;
  background-position: center 20%;
  filter: blur(14px) saturate(0.68) brightness(0.6);
  transform: scale(1.06);
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 4, 20, 0.22);
  z-index: 1;
}

/* centered name + date */
.std-inner {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5rem 1.5rem 2rem;
  text-align: center;
}

.std-eyebrow {
  font-family: 'LaMonarchie', cursive;
  font-size: clamp(2rem, 5.5vw, 3.5rem);
  font-style: normal;
  letter-spacing: 0.12em;
  color: var(--gold-light);
  margin-bottom: 1.25rem;
  line-height: 1.2;
}

.std-names {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(3.5rem, 13vw, 8.5rem);
  font-weight: 300;
  letter-spacing: 0.04em;
  color: var(--cream);
  text-shadow: 0 2px 12px rgba(0,0,0,0.55), 0 8px 40px rgba(0,0,0,0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.std-names > span { line-height: 0.88; }
.std-amp {
  font-family: 'Willsyard', cursive;
  font-size: 0.55em;
  color: var(--gold-light);
  line-height: 0.95;
  margin-top: 0.15em;
  margin-bottom: -0.62em;
}

.std-date {
  margin-top: 1.75rem;
  font-size: clamp(0.8rem, 2.2vw, 1.05rem);
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: var(--cream);
  opacity: 0.7;
}

/* info strip pinned at bottom of hero */
.hero-info {
  position: relative;
  z-index: 2;
  padding: 1.75rem 1rem 2rem;
  border-top: 1px solid var(--divider);
  background: rgba(5, 2, 12, 0.52);
  backdrop-filter: blur(8px);
  text-align: center;
}

.info-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 680px;
  margin: 0 auto;
}

.info-item {
  flex: 1;
  min-width: 140px;
  padding: 0.75rem 1.5rem;
}

.info-divider {
  width: 1px;
  height: 44px;
  background: var(--divider);
  flex-shrink: 0;
}

.info-label {
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.info-value {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--cream);
}

.hero-note {
  margin-top: 1.25rem;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  color: var(--muted);
}

@media (max-width: 460px) {
  .info-divider { width: 50px; height: 1px; }
  .info-grid { flex-direction: column; }
}

/* ─────────────────────────────────────────
   Memory game
───────────────────────────────────────── */
.memory-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 5rem 1.5rem;
  text-align: center;
}

.memory-section h2 {
  font-family: 'Inter', sans-serif;
  font-size: 1.4rem;
  font-weight: 300;
  letter-spacing: 0.15em;
  letter-spacing: 0.08em;
  color: var(--cream);
  margin-bottom: 0.5rem;
}

.memory-subtitle {
  color: var(--muted);
  font-size: 0.83rem;
  letter-spacing: 0.06em;
  margin-bottom: 2.5rem;
}

.memory-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.memory-controls button {
  padding: 0.5rem 1.4rem;
  background: transparent;
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  color: var(--gold);
  font-family: inherit;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.memory-controls button:hover {
  background: var(--gold);
  color: var(--night);
}

#move-counter {
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.memory-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

@media (max-width: 600px) {
  .memory-board {
    grid-template-columns: repeat(4, 1fr);
    gap: 7px;
  }
  .memory-section {
    padding: 3rem 1rem 4rem;
  }
}

.memory-card {
  aspect-ratio: 3/4;
  cursor: pointer;
  perspective: 800px;
}

.memory-card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.4s ease;
  border-radius: var(--radius);
}

.memory-card.flipped .memory-card-inner,
.memory-card.matched .memory-card-inner {
  transform: rotateY(180deg);
}

.memory-card-front,
.memory-card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: var(--radius);
  overflow: hidden;
}

.memory-card-front {
  background: linear-gradient(145deg, #1a0830, #3a1428, #6a2e18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: rgba(184,150,90,0.55);
  user-select: none;
}

.memory-card-back {
  transform: rotateY(180deg);
  background: var(--warm-dark);
}
.memory-card-back img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.memory-card.matched .memory-card-inner {
  box-shadow: 0 0 0 2px var(--gold);
}

.no-images {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.8;
}
.no-images code {
  background: rgba(255,255,255,0.05);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-size: 0.84em;
  color: var(--gold-light);
}

/* ─────────────────────────────────────────
   Countdown
───────────────────────────────────────── */
.countdown-section {
  padding: 5rem 1rem 6rem;
  text-align: center;
  border-top: 1px solid rgba(184,150,90,0.1);
}

.countdown-label {
  font-size: 0.62rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 2.5rem;
}

.countdown-sublabel {
  margin-top: 2.5rem;
  font-size: 0.62rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
}

.countdown {
  display: flex;
  gap: clamp(1.5rem, 5vw, 4rem);
  justify-content: center;
  flex-wrap: wrap;
}

.countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
}
.countdown-unit .num {
  font-family: 'Josefin Sans', sans-serif;
  font-size: clamp(2.8rem, 8vw, 5rem);
  font-weight: 300;
  line-height: 1;
  color: var(--gold-light);
}
.countdown-unit .lbl {
  font-size: 0.56rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ─────────────────────────────────────────
   Closing photo
───────────────────────────────────────── */
.closing-section {
  padding: 0;
}

.closing-photo {
  position: relative;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
}

.closing-photo img {
  width: 100%;
  height: 100%;
  max-height: 90vh;
  object-fit: cover;
  object-position: center 25%;
  display: block;
}

.closing-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top right, rgba(8,3,18,0.55) 0%, transparent 60%);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 3rem 3rem 0 0;
  text-align: right;
}

.closing-script {
  font-family: 'LaMonarchie', cursive;
  font-size: clamp(2.2rem, 7vw, 5rem);
  font-style: normal;
  letter-spacing: 0.1em;
  color: var(--cream);
  text-shadow: 0 2px 20px rgba(0,0,0,0.5);
  line-height: 1.1;
}

.closing-date {
  margin-top: 0.6rem;
  font-size: clamp(0.85rem, 2vw, 1.1rem);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--white);
  opacity: 0.9;
}

/* ─────────────────────────────────────────
   Footer
───────────────────────────────────────── */
footer {
  text-align: center;
  padding: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.04);
  font-size: 0.7rem;
}
footer a {
  color: rgba(240,229,212,0.25);
  text-decoration: none;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition: color 0.2s;
}
footer a:hover { color: var(--gold); }
