@font-face {
  font-family: "Playfair Display";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/playfair-display-500.woff2") format("woff2");
}

@font-face {
  font-family: "Playfair Display";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/playfair-display-700.woff2") format("woff2");
}

:root {
  --color-bg-deep: #1A0F1C;
  --color-wine: #4A1C2B;
  --color-coral: #E8B4A2;
  --color-gold: #D4B78F;
  --color-cream: #F5EDE4;
  --text-secondary: rgba(245, 237, 228, 0.75);
  --text-tertiary: rgba(245, 237, 228, 0.65);
  --text-quiet: rgba(245, 237, 228, 0.55);
  --color-moon: #8FB4D9;
  --color-moonlight: #DCEAF7;
  --font-display: "Playfair Display", "Noto Serif SC", serif;
  --font-body: -apple-system, "Segoe UI", "PingFang SC", "Noto Sans", "Noto Sans Thai", "Noto Sans JP", "Noto Sans KR", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--color-bg-deep);
  color: var(--color-cream);
  font-family: var(--font-body);
}

#app { min-height: 100vh; position: relative; overflow: hidden; }

#app::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.5rem;
  background: radial-gradient(circle at 50% 20%, rgba(74, 28, 43, 0.2) 0%, var(--color-bg-deep) 65%);
  animation: screen-reveal 0.6s ease;
}

@keyframes screen-reveal {
  from { opacity: 0; }
  to { opacity: 1; }
}

.screen[hidden] { display: none; }

/* Brand screen gets the strongest "reveal" glow — this is the one moment the
   wine tone is allowed to dominate instead of just tinting the edges. */
#screen-brand {
  background: radial-gradient(circle at 50% 25%, var(--color-wine) 0%, var(--color-bg-deep) 75%);
}

/* Age gate: a "spotlight at the entrance" — a deep, saturated wine glow
   pooling behind the invite card, with a hard vignette at the edges so the
   card reads as the one lit thing in the room, not a flat dark rectangle. */
#age-gate {
  background:
    radial-gradient(ellipse 70% 55% at 50% 38%, rgba(74, 28, 43, 0.65) 0%, transparent 60%),
    radial-gradient(circle at 50% 50%, var(--color-bg-deep) 30%, #0d0810 100%);
}

#screen-progress {
  background: radial-gradient(circle at 50% 30%, rgba(74, 28, 43, 0.15) 0%, var(--color-bg-deep) 70%);
}

.lang-switcher {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 100;
}

.lang-current {
  background: rgba(245, 237, 228, 0.08);
  border: 1px solid var(--color-gold);
  color: var(--color-cream);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  cursor: pointer;
}

.lang-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0.4rem 0;
  background: var(--color-bg-deep);
  border: 1px solid var(--color-gold);
  border-radius: 0.75rem;
  max-height: 60vh;
  overflow-y: auto;
  min-width: 9rem;
}

.lang-list[hidden] { display: none; }

.lang-list li {
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.lang-list li:hover,
.lang-list li:focus {
  background: rgba(212, 183, 143, 0.15);
}

.btn {
  font-family: var(--font-body);
  font-size: 1rem;
  border-radius: 999px;
  padding: 0.75rem 1.5rem;
  border: 1px solid transparent;
  cursor: pointer;
  width: 100%;
}

.btn-primary {
  background: linear-gradient(180deg, #E6CBA3 0%, var(--color-gold) 55%, #BE9E71 100%);
  color: var(--color-bg-deep);
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.btn-secondary {
  background: transparent;
  color: rgba(245, 237, 228, 0.6);
  border-color: rgba(245, 237, 228, 0.3);
}

.btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

.age-gate {
  backdrop-filter: blur(20px);
  z-index: 50;
  transition: opacity 0.5s ease, filter 0.5s ease;
}

.age-gate.age-gate-exiting {
  opacity: 0;
  filter: blur(10px);
  pointer-events: none;
}

/* The invitation card: a framed, faintly frosted surface so the age-gate
   content reads as something handed to you, not text floating on a void. */
.invite-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 22rem;
  padding: 2.5rem 1.75rem 2rem;
  border: 1px solid rgba(212, 183, 143, 0.35);
  border-radius: 1.25rem;
  background: linear-gradient(180deg, rgba(245, 237, 228, 0.05), rgba(245, 237, 228, 0.02));
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.4), inset 0 0 40px rgba(74, 28, 43, 0.25);
  backdrop-filter: blur(6px);
}

.invite-divider {
  width: 2.5rem;
  height: 1px;
  background: var(--color-gold);
  opacity: 0.6;
  margin: 0.25rem 0 1.5rem;
}

/* Logo mark: a thin double ring (medallion), a crescent moon (after hours),
   and a small spark. Rendered in a cool moonlit blue instead of the site's
   warm gold/wine palette on purpose — everything else in the UI is warm,
   so the one cool-toned mark is what the eye lands on first. */
.logo-mark {
  width: 4.5rem;
  height: 4.5rem;
  margin-bottom: 1.1rem;
  filter: drop-shadow(0 0 14px rgba(143, 180, 217, 0.55));
}

.logo-mark--brand {
  width: 5.5rem;
  height: 5.5rem;
  margin-bottom: 1.4rem;
}

.logo-ring-outer {
  fill: none;
  stroke: var(--color-moon);
  stroke-width: 1.1;
  opacity: 0.9;
}

.logo-ring-inner {
  fill: none;
  stroke: var(--color-moon);
  stroke-width: 0.5;
  opacity: 0.4;
}

.logo-crescent {
  fill: var(--color-moonlight);
}

.logo-spark {
  fill: var(--color-coral);
}

.brand-mark {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.2em;
  color: var(--color-gold);
  text-transform: uppercase;
  margin-bottom: 1.75rem;
  text-shadow: 0 0 20px rgba(212, 183, 143, 0.5);
  animation: breathe 3s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

.title-serif {
  font-family: var(--font-display);
  font-size: 1.6rem;
  line-height: 1.4;
  max-width: 22rem;
  margin: 0 0 0.75rem;
}

.subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 22rem;
  margin: 0 0 2rem;
}

.invite-card .title-serif {
  font-size: 1.5rem;
  letter-spacing: 0.01em;
}

.invite-card .subtitle {
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  line-height: 1.7;
  margin-bottom: 0;
}

.age-gate-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: 18rem;
}

.brand-hero-title {
  font-size: 2.2rem;
  color: var(--color-cream);
}

.hint-text {
  font-size: 0.85rem;
  color: var(--color-coral);
  margin-bottom: 2rem;
}

.brand-cta {
  max-width: 20rem;
  animation: pulse-glow 2.5s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 rgba(212, 183, 143, 0); }
  50% { box-shadow: 0 0 16px rgba(212, 183, 143, 0.6); }
}

.timeline-toggle {
  background: none;
  border: none;
  color: var(--text-quiet);
  font-size: 0.75rem;
  text-decoration: underline;
  cursor: pointer;
  margin-top: 1rem;
}

.timeline-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  max-width: 20rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: left;
}

.timeline-list[hidden] { display: none; }

.timeline-list li { margin-bottom: 0.4rem; }

.preference-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  width: 100%;
  max-width: 24rem;
  margin-bottom: 1.5rem;
}

.pref-card {
  background: rgba(245, 237, 228, 0.06);
  border: 1px solid rgba(212, 183, 143, 0.4);
  border-radius: 0.9rem;
  padding: 0.9rem 0.6rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.pref-card .pref-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.pref-card .pref-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

/* Selected cards get a wine underglow (the "intimate" tone) framed by a
   gold rim (the "this is chosen" signal) — the two colors stay separate,
   wine never appears on text or buttons. */
.pref-card.selected {
  border-color: var(--color-gold);
  transform: scale(1.04);
  box-shadow: 0 0 22px rgba(74, 28, 43, 0.7), 0 0 12px rgba(212, 183, 143, 0.45);
  background: rgba(212, 183, 143, 0.12);
}

.pref-card.disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.affinity-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

/* Donut shape, not a filled pie: the inner ~70% stays solid dark so the
   gold percentage label is readable no matter how full the ring gets —
   a filled disc turns solid gold at high percentages and swallows gold text. */
.affinity-ring {
  --percent: 0;
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-gold);
  background:
    radial-gradient(closest-side, var(--color-bg-deep) 72%, transparent 73% 100%),
    conic-gradient(var(--color-gold) calc(var(--percent) * 1%), rgba(245, 237, 228, 0.12) 0);
  transition: background 0.4s ease;
}

.affinity-copy {
  display: flex;
  flex-direction: column;
  text-align: left;
  font-size: 0.85rem;
}

.preview-text {
  min-height: 2.5rem;
  font-style: italic;
  color: var(--color-coral);
  max-width: 22rem;
  margin-bottom: 1.5rem;
}

#preferences-confirm {
  max-width: 20rem;
}

/* Same donut treatment as .affinity-ring — at 100% a filled disc would be
   solid gold and hide the gold "100%" label; the dark center keeps it visible. */
.progress-ring {
  --percent: 0;
  width: 8rem;
  height: 8rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--color-gold);
  margin-bottom: 1.5rem;
  background:
    radial-gradient(closest-side, var(--color-bg-deep) 78%, transparent 79% 100%),
    conic-gradient(var(--color-gold) calc(var(--percent) * 1%), rgba(245, 237, 228, 0.12) 0);
  transition: background 0.3s linear;
}

.progress-phase-text {
  font-size: 1.2rem;
  min-height: 2.4rem;
}

.scarcity-text {
  font-size: 0.85rem;
  color: var(--color-coral);
  margin-bottom: 1rem;
  animation: breathe 2s ease-in-out infinite;
}

.scarcity-text[hidden] { display: none; }

/* This burst fires once (not a loop, unlike breathe/pulse-glow elsewhere) —
   it marks "this moment is different" from the rest of the waiting state. */
.unlock-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  max-width: 20rem;
  animation: unlock-burst 0.8s ease-out;
}

@keyframes unlock-burst {
  0% { opacity: 0; transform: scale(0.9); }
  60% { opacity: 1; transform: scale(1.03); }
  100% { opacity: 1; transform: scale(1); }
}

.progress-ring.unlocked {
  animation: ring-burst 0.8s ease-out;
}

@keyframes ring-burst {
  0% { box-shadow: 0 0 0 rgba(212, 183, 143, 0); }
  40% { box-shadow: 0 0 32px rgba(212, 183, 143, 0.85); }
  100% { box-shadow: 0 0 16px rgba(212, 183, 143, 0.5); }
}

.unlock-panel[hidden] { display: none; }
