/* Base — design tokens (Classical DS), resets, keyframes, phone frame. */

:root {
  --color-bg: #f3f2f2;
  --color-surface: #eae9e9;
  --color-text: #201f1d;
  --color-accent: #b68235;
  --color-divider: color-mix(in srgb, #201f1d 16%, transparent);

  --color-accent-100: #fff3e4;
  --color-accent-200: #ffe3bf;
  --color-accent-300: #facb8d;
  --color-accent-400: #e1ad66;
  --color-accent-500: #c28d41;
  --color-accent-600: #a06f24;
  --color-accent-700: #7d5411;
  --color-accent-800: #5a3b0a;

  /* Dark "night" sections used by hero and finale. */
  --ink-900: #120e0b;
  --ink-800: #241d15;
  --cream: #f4ead6;
  --gold-grad: linear-gradient(90deg, #e9c987, #fff4dc, #c08f43, #e9c987);

  --font-heading: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Lora', Georgia, serif;

  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 7px;

  --shadow-sm: 0 1px 2px color-mix(in srgb, #2d2b2b 14%, transparent);
  --shadow-md: 0 3px 10px color-mix(in srgb, #2d2b2b 16%, transparent);
  --shadow-lg: 0 12px 32px color-mix(in srgb, #2d2b2b 22%, transparent);

  --muted: color-mix(in srgb, var(--color-text) 74%, transparent);
  --muted-soft: color-mix(in srgb, var(--color-text) 62%, transparent);
}

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

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: #17130f;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

::selection {
  background: color-mix(in srgb, var(--color-accent) 30%, transparent);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.inv-num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
}

/* ── Phone frame ─────────────────────────────────────────────────────── */
#stage {
  height: 100dvh;
  display: grid;
  place-items: center;
}

#frame {
  position: relative;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  background: var(--color-bg);
}

@media (min-width: 560px) {
  body {
    background:
      radial-gradient(90% 70% at 50% 0%, #2a221a, transparent),
      #17130f;
  }
  #frame {
    width: 430px;
    height: min(880px, 94dvh);
    border-radius: 30px;
    border: 1px solid color-mix(in srgb, #fff 12%, transparent);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  }
}

#intro-layer {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: #bcdff2;
}

#intro-layer[hidden] {
  display: none;
}

#invitation {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

#invitation::-webkit-scrollbar {
  display: none;
}

#invitation[hidden] {
  display: none;
}

#invitation.enter {
  animation: cardRise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

/* ── Buttons (Classical DS) ──────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  text-decoration: none;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  color: var(--color-text);
  background: transparent;
  border: 1px solid transparent;
  padding: 13px 20px;
  min-height: 46px;
  border-radius: var(--radius-md);
  transition: background 0.2s ease, transform 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.btn-primary:hover {
  background: color-mix(in srgb, var(--color-accent) 12%, transparent);
}

.btn-secondary {
  border-color: var(--color-divider);
}

.btn-secondary:hover {
  background: color-mix(in srgb, var(--color-text) 7%, transparent);
}

.btn-ghost {
  color: var(--color-accent);
  min-height: 40px;
  padding: 8px 12px;
}

.btn-ghost:hover {
  background: color-mix(in srgb, var(--color-accent) 10%, transparent);
}

.btn-block {
  width: 100%;
}

.input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  color: var(--color-text);
  caret-color: var(--color-accent);
  background: transparent;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
}

.input:hover {
  border-color: color-mix(in srgb, var(--color-text) 45%, transparent);
}

.input:focus-visible {
  border-color: var(--color-accent);
  outline-offset: 0;
}

/* ── Keyframes ───────────────────────────────────────────────────────── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes growX {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes petalFall {
  0% {
    transform: translateY(-30px) translateX(0) rotate(0);
  }
  100% {
    transform: translateY(940px) translateX(48px) rotate(400deg);
  }
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.12;
  }
  50% {
    opacity: 0.95;
  }
}

@keyframes ringPulse {
  0% {
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0.75;
  }
  100% {
    transform: translate(-50%, -50%) scale(2.6);
    opacity: 0;
  }
}

@keyframes shimmer {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: -200% 50%;
  }
}

@keyframes riseGlow {
  0%,
  100% {
    opacity: 0.35;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes cardRise {
  0% {
    opacity: 0;
    transform: translateY(80px) scale(0.92);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

@keyframes hintBob {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.55;
  }
  50% {
    transform: translateY(7px);
    opacity: 1;
  }
}

@keyframes digitTick {
  0% {
    transform: translateY(-0.55em);
    opacity: 0;
  }
  100% {
    transform: none;
    opacity: 1;
  }
}

@keyframes skeleton {
  0% {
    background-position: 120% 0;
  }
  100% {
    background-position: -120% 0;
  }
}

@keyframes popIn {
  0% {
    opacity: 0;
    transform: scale(0.94) translateY(10px);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

/* ── Scroll-reveal system ────────────────────────────────────────────── */
[data-reveal] {
  opacity: 0;
}

.slide.active [data-reveal] {
  animation: fadeUp 0.8s ease both;
  animation-delay: calc(var(--ri, 0) * 140ms + 150ms);
}

.slide.active [data-reveal='fade'] {
  animation-name: fadeIn;
}

.slide.active [data-reveal='grow'] {
  animation-name: growX;
  transform-origin: center;
}

/* ── Reduced motion ──────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  #invitation {
    scroll-behavior: auto;
  }
  [data-reveal] {
    opacity: 1;
  }
}

/* ── Background music toggle ─────────────────────────────────────────── */
.music-btn {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 30;
  width: 44px;
  height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #fff;
  background: rgba(20, 16, 12, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.music-btn:hover {
  background: rgba(20, 16, 12, 0.5);
}
