/* ============================================================
   Wedding site styles — warm, minimal, mobile-first.
   ============================================================ */

:root {
  --bg: #FAF7F2;
  --ink: #1A1A1A;
  --ink-soft: #4a4a4a;
  --muted: #8a8a8a;
  --border: #e6e0d5;
  --border-strong: #d6cdbe;
  --accent: #6B9B96;
  --accent-hover: #4F7B77;
  --accent-tint: rgba(107, 155, 150, 0.10);
  --error: #B23A48;
  --white: #ffffff;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 16px rgba(26,26,26,0.04);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* ============================================================
   Layout
   ============================================================ */

.screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px 64px;
}

/* HTML's `hidden` attribute must beat `.screen { display: flex }` */
.screen[hidden] {
  display: none;
}

.container {
  width: 100%;
  max-width: 640px;
}

.container-narrow {
  max-width: 440px;
  text-align: center;
}

/* ============================================================
   Language toggle
   ============================================================ */

.lang-toggle {
  position: fixed;
  top: 18px;
  right: 18px;
  display: flex;
  gap: 4px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  box-shadow: var(--shadow);
  z-index: 10;
}

.lang-toggle button {
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.06em;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 160ms ease;
}

.lang-toggle button:hover {
  color: var(--ink);
}

.lang-toggle button.active {
  background: var(--ink);
  color: var(--white);
}

/* ============================================================
   Logo + typography
   ============================================================ */

.logo-frame {
  width: 96px;
  height: 96px;
  margin: 0 auto 28px;
}

.logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
/* (Logo motion now lives inside logo.svg via <animateTransform>) */

.display {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 400;
  font-size: clamp(36px, 7vw, 56px);
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin: 0 0 16px;
  color: var(--ink);
}

.subtitle {
  font-size: 16px;
  color: var(--ink-soft);
  margin: 0 0 40px;
}

.eyebrow {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 16px;
}

.hero {
  text-align: center;
  margin: 0 0 56px;
}

.hero .display {
  margin-bottom: 8px;
}

.section-title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 400;
  font-size: 28px;
  line-height: 1.2;
  margin: 0 0 8px;
  color: var(--ink);
}

.section-sub {
  font-size: 15px;
  color: var(--ink-soft);
  margin: 0 0 32px;
}

/* ============================================================
   Wedding details block
   ============================================================ */

.details {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 24px;
  margin-bottom: 48px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--muted);
  flex-shrink: 0;
}

.detail-value {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 18px;
  color: var(--ink);
  text-align: right;
}

.map-link {
  display: block;
  margin-top: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.map-link::after {
  content: " →";
}

.map-link:hover {
  color: var(--accent-hover);
}

.divider {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 56px 0 48px;
}

/* ============================================================
   Forms — shared
   ============================================================ */

input[type="text"],
input[type="password"],
input[type="email"] {
  width: 100%;
  padding: 14px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}

input::placeholder {
  color: var(--muted);
}

.btn-primary,
.btn-ghost {
  display: inline-block;
  width: 100%;
  padding: 14px 20px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 160ms ease;
  text-align: center;
}

.btn-primary {
  background: var(--ink);
  color: var(--white);
  border: 1px solid var(--ink);
}

.btn-primary:hover {
  background: #000;
}

.btn-primary:disabled {
  background: var(--muted);
  border-color: var(--muted);
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px dashed var(--border-strong);
  margin: 16px 0 24px;
}

.btn-ghost:hover {
  border-color: var(--ink);
  background: var(--white);
}

.error-msg {
  font-size: 14px;
  color: var(--error);
  margin: 12px 0 0;
  text-align: center;
}

/* ============================================================
   Password screen
   ============================================================ */

#password-form input {
  margin-bottom: 12px;
}

/* ============================================================
   RSVP form
   ============================================================ */

.attending-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 32px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
}

.radio-pill {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 160ms ease;
}

.radio-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.radio-pill:hover {
  color: var(--ink);
}

.radio-pill:has(input:checked) {
  background: var(--ink);
  color: var(--white);
}

/* Person row */

.person-row {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 14px;
  animation: fadeIn 240ms ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.person-row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.person-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.remove-person {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 160ms ease;
}

.remove-person:hover {
  color: var(--error);
  background: rgba(178, 58, 72, 0.08);
}

.person-row .name-input,
.person-row .email-input {
  margin-bottom: 14px;
}

.food-select-wrap {
  margin-top: 8px;
}

.food-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.food-options {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.food-option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 160ms ease;
  text-align: center;
}

.food-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.food-emoji {
  font-size: 24px;
  line-height: 1;
  transition: transform 200ms ease;
}

.food-text {
  display: block;
}

.food-option:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.food-option:has(input:checked) {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(26, 26, 26, 0.15);
}

.food-option:has(input:checked) .food-emoji {
  transform: scale(1.1);
}

/* Hide food + "Add another person" button when not attending */

#rsvp-form[data-attending="no"] .food-select-wrap,
#rsvp-form[data-attending="no"] #add-person {
  display: none;
}

/* Hide remove button on the first person row */

.person-row:first-child .remove-person {
  visibility: hidden;
}

/* ============================================================
   Hover — subtle lift + soft shadow on interactive elements
   ============================================================ */

.btn-primary,
.btn-ghost,
.btn-ghost-inline,
.lang-toggle button,
.radio-pill,
.food-option,
.remove-person,
.map-link,
.person-row,
.lead-email {
  transition-property: background, color, border-color, box-shadow, transform;
  transition-duration: 200ms;
  transition-timing-function: ease;
}

.btn-primary:hover,
.btn-ghost:hover,
.btn-ghost-inline:hover,
.lang-toggle button:hover,
.radio-pill:hover,
.food-option:hover {
  transform: translateY(-2px);
  box-shadow:
    0 6px 14px rgba(26, 26, 26, 0.08),
    0 2px 4px rgba(26, 26, 26, 0.04);
}

/* Primary button already has its own bg change on hover — keep it */
.btn-primary:hover {
  background: #000;
}

/* Selected pill/food card has solid dark bg — give it a slightly stronger shadow */
.radio-pill:has(input:checked):hover,
.food-option:has(input:checked):hover {
  box-shadow:
    0 8px 18px rgba(26, 26, 26, 0.18),
    0 2px 4px rgba(26, 26, 26, 0.10);
}

/* Person row — softer lift since the card is bigger */
.person-row:hover {
  transform: translateY(-1px);
  box-shadow:
    0 6px 18px rgba(26, 26, 26, 0.06),
    0 1px 2px rgba(26, 26, 26, 0.03);
  border-color: var(--border-strong);
}

/* Remove-person stays inline-styled (red on hover) — no lift, would feel busy */

/* Map link is text — accent color shift + a small "→" nudge */
.map-link {
  position: relative;
  transition: color 200ms ease, padding-left 200ms ease;
}
.map-link:hover {
  color: var(--accent-hover);
  padding-left: 2px;
}

/* ============================================================
   Reveal animations — fade + slide up, triggered when visible
   ============================================================ */

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 700ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.reveal.in-view {
  opacity: 1;
  transform: none;
}

/* Stagger: each delay is +100ms */
.reveal-d1 { transition-delay: 100ms; }
.reveal-d2 { transition-delay: 200ms; }
.reveal-d3 { transition-delay: 300ms; }
.reveal-d4 { transition-delay: 400ms; }
.reveal-d5 { transition-delay: 500ms; }
.reveal-d6 { transition-delay: 600ms; }
.reveal-d7 { transition-delay: 700ms; }

/* Respect users who prefer no motion */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ============================================================
   Mobile tweaks
   ============================================================ */

@media (max-width: 480px) {
  .screen {
    padding: 32px 16px 48px;
  }

  .details {
    padding: 4px 18px;
  }

  .detail-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .detail-value {
    text-align: left;
  }

  .food-options {
    grid-template-columns: 1fr;
  }

  .food-option {
    padding: 12px;
  }

  .lang-toggle {
    top: 12px;
    right: 12px;
  }
}
