:root {
  --gold: #C9A962;
  --gold-light: #E8D5A3;
  --gold-dim: rgba(201, 169, 98, 0.15);
  --bg: #0F0E0C;
  --bg-surface: #1A1814;
  --bg-elevated: #242019;
  --text-primary: #F5F0E8;
  --text-secondary: #A89F8F;
  --text-tertiary: #6B6358;
  --border: rgba(201, 169, 98, 0.2);
  --radius: 14px;
  --radius-lg: 20px;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-ui: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --bottom-nav-height: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html, body {
  width: 100%;
  min-height: 100%;
  min-height: 100dvh;
  background: var(--bg);
}

body {
  font-family: var(--font-ui);
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.5;
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  max-width: 600px;
  margin: 0 auto;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(201, 169, 98, 0.08), transparent),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(201, 169, 98, 0.05), transparent);
  pointer-events: none;
  z-index: 0;
}

.page {
  display: none;
  min-height: 100vh;
  padding-bottom: 100px;
  position: relative;
  z-index: 1;
}

.page.active {
  display: block;
  animation: pageEnter 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.page.active.page-await-reveal {
  animation: none;
  opacity: 0;
}

.page.active.page-welcome-reveal {
  animation: pageWelcomeReveal 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  opacity: 0;
}

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

.page.page-exit {
  animation: pageExit 0.3s ease forwards;
}

@keyframes pageEnter {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pageExit {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(-12px); }
}

@media (prefers-reduced-motion: reduce) {
  .page.active { animation: none; }
  .page.active.page-welcome-reveal { animation: none; }
  .page.page-exit { animation: none; }
  .hero-section { animation: none !important; }
  .menu-card { animation: none !important; opacity: 1 !important; transform: none !important; }
  .welcome-overlay { animation: none !important; }
  .floating-orb { animation: none !important; }
  .carousel-item { transition: none !important; }
}

/* Verify page */
.verify-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.floating-orbs {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.floating-orb {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 169, 98, 0.12), transparent 70%);
  animation: floatOrb 12s ease-in-out infinite;
}

.floating-orb:nth-child(1) { width: 200px; height: 200px; top: 10%; left: -20%; animation-delay: 0s; }
.floating-orb:nth-child(2) { width: 150px; height: 150px; top: 60%; right: -10%; animation-delay: -4s; }
.floating-orb:nth-child(3) { width: 100px; height: 100px; bottom: 20%; left: 30%; animation-delay: -8s; }

@keyframes floatOrb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(20px, -30px) scale(1.05); }
  66% { transform: translate(-15px, 15px) scale(0.95); }
}

.verify-card {
  max-width: 400px;
  width: 100%;
  text-align: center;
  position: relative;
  z-index: 2;
}

.verify-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 28px;
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  color: var(--gold);
}

.verify-title {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.verify-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 36px;
  line-height: 1.6;
}

.form-input {
  width: 100%;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-dim);
}

.form-input::placeholder { color: var(--text-tertiary); }

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--gold) 0%, #A8863E 100%);
  color: #0F0E0C;
  border: none;
  border-radius: var(--radius);
  padding: 16px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
  margin-top: 12px;
}

.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.verify-note {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 24px;
}

.error-text {
  color: #E57373;
  font-size: 14px;
  text-align: center;
  margin-top: 8px;
}

/* Welcome overlay */
.welcome-overlay {
  position: fixed;
  inset: 0;
  max-width: 600px;
  margin: 0 auto;
  background: var(--bg);
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.welcome-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.welcome-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.welcome-label {
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
}

.welcome-name {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 500;
  color: var(--text-primary);
}

.welcome-name .letter {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px);
  animation: letterIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes letterIn {
  to { opacity: 1; transform: translateY(0); }
}

.welcome-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.welcome-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--gold);
  border-radius: 50%;
  opacity: 0;
  animation: particleDrift 2s ease-out forwards;
}

@keyframes particleDrift {
  0% { opacity: 0.8; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-120px) scale(0); }
}

/* Header */
.page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: rgba(26, 24, 20, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.back-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  transition: transform 0.2s, background 0.2s;
}

.back-btn:active { transform: scale(0.95); }
.page-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
}

/* Hero */
.hero-section {
  width: 100%;
  height: 340px;
  background: var(--bg-surface);
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
  animation: heroZoom 20s ease-in-out infinite alternate;
}

@keyframes heroZoom {
  from { background-size: 100%; }
  to { background-size: 110%; }
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(15, 14, 12, 0.2) 0%, rgba(15, 14, 12, 0.85) 100%);
}

.hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px 24px 24px;
}

.location-tag {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}

.property-title {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 500;
  line-height: 1.15;
  margin-bottom: 8px;
}

.property-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
}

.guest-greeting {
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-secondary);
}

.guest-greeting span { color: var(--gold-light); }

/* Gallery */
.gallery-label {
  padding: 0 20px;
  margin-top: 24px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 12px;
}

.photo-carousel {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 4px 20px 24px;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.photo-carousel::-webkit-scrollbar { display: none; }

.carousel-item {
  flex-shrink: 0;
  width: 168px;
  height: 168px;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  scroll-snap-align: center;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s;
  transform: scale(0.92);
  opacity: 0.7;
}

.carousel-item.in-view {
  transform: scale(1);
  opacity: 1;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* CTA */
.cta-section { padding: 0 20px 20px; }

.cta-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-surface) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  text-align: left;
  color: inherit;
}

.cta-btn:active { transform: scale(0.98); }
.cta-btn:hover { border-color: var(--gold); box-shadow: 0 4px 24px rgba(201, 169, 98, 0.1); }

.cta-time {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}

.cta-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  margin-bottom: 4px;
}

.cta-subtitle { font-size: 13px; color: var(--text-secondary); }

.cta-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gold-dim);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  flex-shrink: 0;
}

/* Menu grid */
.grid-section { padding: 0 20px 20px; }

.menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.menu-card {
  background: rgba(26, 24, 20, 0.6);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 148px;
  text-align: left;
  color: inherit;
  opacity: 0;
  transform: translateY(16px);
}

.menu-card.animate-in {
  animation: cardStagger 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes cardStagger {
  to { opacity: 1; transform: translateY(0); }
}

.menu-card:active { transform: scale(0.97); }
.menu-card:hover { border-color: rgba(201, 169, 98, 0.4); }

.card-icon {
  width: 36px;
  height: 36px;
  margin-bottom: 14px;
  color: var(--gold);
}

.card-label {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.card-sublabel {
  font-size: 12px;
  color: var(--text-secondary);
}

.card-arrow {
  font-size: 18px;
  color: var(--gold);
  margin-top: 12px;
  opacity: 0.6;
}

/* Content sections */
.section { padding: 20px; }

.section-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 500;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.content-block {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}

.block-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 10px;
}

.block-title { font-size: 16px; font-weight: 500; }

.info-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}

.info-text:last-child { margin-bottom: 0; }

.text-link {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Code box */
.code-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: center;
  margin-bottom: 16px;
  position: relative;
}

.code-value {
  font-size: 36px;
  font-weight: 600;
  font-family: 'SF Mono', 'Courier New', monospace;
  letter-spacing: 6px;
  margin: 20px 0;
  color: var(--gold-light);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.code-value.revealed {
  animation: codeReveal 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes codeReveal {
  0% { transform: rotateX(90deg); opacity: 0; }
  100% { transform: rotateX(0); opacity: 1; }
}

.code-value.code-hidden { letter-spacing: 8px; }

.reveal-btn {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  position: absolute;
  top: 16px;
  right: 16px;
}

.reveal-btn:hover { background: var(--gold-dim); border-color: var(--gold); }
.reveal-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.2s;
}

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

.btn-gold {
  background: linear-gradient(135deg, var(--gold), #A8863E);
  color: #0F0E0C;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

/* Steps */
.step-item {
  display: flex;
  gap: 16px;
  margin-bottom: 14px;
  padding: 18px;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.step-number {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: var(--gold-dim);
  border: 1px solid var(--border);
  color: var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
}

.step-title { font-weight: 600; margin-bottom: 4px; }
.step-desc { font-size: 14px; color: var(--text-secondary); margin-top: 6px; }

/* Images */
.image-placeholder {
  width: 100%;
  height: 200px;
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  font-size: 14px;
  overflow: hidden;
}

.image-placeholder img { width: 100%; height: 100%; object-fit: cover; }

.map-frame {
  border: none;
  border-radius: var(--radius-lg);
  margin-top: 16px;
  filter: invert(0.92) hue-rotate(180deg) saturate(0.8);
}

/* Host */
.host-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gold-dim);
  border: 1px solid var(--border);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 500;
  flex-shrink: 0;
}

.host-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.host-actions button { flex: 1; padding: 14px; font-weight: 600; cursor: pointer; border-radius: var(--radius); }

.footer-text {
  text-align: center;
  font-size: 12px;
  color: var(--text-tertiary);
  padding: 24px 20px 80px;
  letter-spacing: 0.02em;
}

/* Bottom nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 600px;
  background: rgba(15, 14, 12, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 10px 0 max(10px, env(safe-area-inset-bottom));
  z-index: 100;
}

.nav-btn {
  flex: 1;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px;
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.25s;
  position: relative;
}

.nav-btn.active { color: var(--gold); }

.nav-btn.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 2px;
  background: var(--gold);
  border-radius: 1px;
}

.nav-icon {
  width: 24px;
  height: 24px;
  transition: transform 0.25s;
}

.nav-btn.active .nav-icon { transform: scale(1.1); }

.bottom-nav.hidden { display: none; }

@media (max-width: 768px) {
  /* Lock viewport; scroll inside active page so bottom nav stays flush (iOS Safari) */
  body:has(.bottom-nav:not(.hidden)) {
    overflow: hidden;
    height: 100dvh;
    max-height: 100dvh;
    width: 100%;
    display: flex;
    flex-direction: column;
  }

  body:has(.bottom-nav:not(.hidden)) .page.active {
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-bottom: 16px;
  }

  body:has(.bottom-nav:not(.hidden)) .bottom-nav {
    position: relative;
    flex-shrink: 0;
    bottom: auto;
    left: auto;
    transform: none;
    min-height: var(--bottom-nav-height);
    padding:
      10px max(8px, env(safe-area-inset-right))
      calc(10px + var(--safe-bottom))
      max(8px, env(safe-area-inset-left));
  }
}
