/* ============================================================
   Minimal Luxury — Video Invite Template
   ============================================================ */

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

:root {
  --cream:       #f5f2ec;
  --cream-deep:  #ede9e0;
  --cream-white: #fdfbf8;
  --charcoal:    #1a1714;
  --warm-mid:    #7a7268;
  --warm-light:  #b8afa5;

  --border:      rgba(26, 23, 20, 0.1);
  --border-mid:  rgba(26, 23, 20, 0.18);

  --font-serif: 'Lora', Georgia, 'Times New Roman', serif;
  --font-sans:  'DM Sans', system-ui, -apple-system, sans-serif;

  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--cream);
  color: var(--charcoal);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   Page Shell
   ============================================================ */

.page {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 480px;
  margin: 0 auto;
  background: var(--cream);
}

/* ============================================================
   Site Header
   ============================================================ */

.site-header {
  flex-shrink: 0;
  text-align: center;
  padding: 38px 24px 16px;
}

.names {
  font-family: var(--font-serif);
  font-size: clamp(1.45rem, 5.5vw, 2rem);
  font-weight: 400;
  font-style: italic;
  color: var(--charcoal);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.name {
  /* inherits italic */
}

.amp {
  font-style: normal;
  font-weight: 300;
  color: var(--warm-light);
  font-size: 0.85em;
}

.date-label {
  margin-top: 5px;
  font-family: var(--font-sans);
  font-size: 0.63rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--warm-mid);
}

/* ============================================================
   Video Section
   ============================================================ */

.video-section {
  flex: 1;
  min-height: 0;
  padding: 0 14px;
  display: flex;
  flex-direction: column;
}

.video-frame {
  flex: 1;
  min-height: 0;
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #0c0c0c;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.09),
    0 10px 36px rgba(0, 0, 0, 0.13);
}

.video-el {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* DejaCast player injects a video.js tree (not a native <video>), so
   object-fit on .video-el has no effect. Force the injected elements
   to absolutely fill the frame and cover-crop the clip. */
.video-frame .dejacast-embed,
.video-frame .dejacast-embed .video-js,
.video-frame .dejacast-embed .video-js .vjs-tech,
.video-frame .dejacast-embed .video-js video,
.video-frame .dejacast-embed .video-js .vjs-poster {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  padding-top: 0 !important;
}

.video-frame .dejacast-embed .video-js .vjs-tech,
.video-frame .dejacast-embed .video-js video {
  object-fit: cover;
}

.video-frame .dejacast-embed .video-js .vjs-poster {
  background-size: cover !important;
}

/* Bottom veil for overlay readability */
.video-veil {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 42%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.36) 0%, transparent 100%);
  pointer-events: none;
  z-index: 1;
}

/* ============================================================
   Start Overlay
   ============================================================ */

.ovl-start {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.18);
  z-index: 10;
  cursor: pointer;
  transition: opacity 0.4s ease;
}

.ovl-start.fade-out {
  opacity: 0;
  pointer-events: none;
}

.play-btn {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
}

.play-btn svg {
  width: 22px;
  height: 22px;
  margin-left: 3px;
}

.play-btn:hover,
.play-btn:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.88);
  transform: scale(1.06);
  outline: none;
}

.play-btn:active {
  transform: scale(0.95);
}

/* ============================================================
   Sound Overlay
   ============================================================ */

.ovl-sound {
  position: absolute;
  bottom: 13px;
  right: 12px;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.ovl-sound.visible {
  opacity: 1;
  pointer-events: all;
}

.sound-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 100px;
  color: rgba(255, 255, 255, 0.88);
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.2s ease;
}

.sound-btn:hover {
  background: rgba(0, 0, 0, 0.62);
}

/* ============================================================
   End Screen Overlay
   ============================================================ */

.ovl-end {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.ovl-end.visible {
  opacity: 1;
  pointer-events: all;
}

.end-wrap {
  text-align: center;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.end-names {
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 5.5vw, 1.9rem);
  font-weight: 400;
  font-style: italic;
  color: #fff;
  letter-spacing: -0.01em;
}

.end-date {
  font-family: var(--font-sans);
  font-size: 0.63rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 16px;
}

.end-btns {
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: 100%;
  max-width: 256px;
}

.btn-end-primary {
  width: 100%;
  padding: 13px 16px;
  background: rgba(245, 242, 236, 0.9);
  color: var(--charcoal);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: none;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.12s ease;
}

.btn-end-primary:hover  { background: #fff; }
.btn-end-primary:active { transform: scale(0.97); }

.btn-end-secondary {
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.12s ease;
}

.btn-end-secondary:hover  { background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.46); }
.btn-end-secondary:active { transform: scale(0.97); }

.btn-replay {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.34);
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 100px;
  transition: color 0.2s ease;
}

.btn-replay:hover { color: rgba(255, 255, 255, 0.68); }

/* ============================================================
   Action Area — below video
   ============================================================ */

.action-area {
  flex-shrink: 0;
  padding: 13px 14px;
  padding-bottom: calc(13px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-primary {
  width: 100%;
  padding: 16px;
  background: var(--charcoal);
  color: var(--cream);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.12s ease;
}

.btn-primary:hover  { background: #2d2a26; }
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
  width: 100%;
  padding: 15px;
  background: transparent;
  color: var(--charcoal);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--border-mid);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.12s ease;
}

.btn-secondary:hover  { background: rgba(26, 23, 20, 0.04); border-color: rgba(26, 23, 20, 0.3); }
.btn-secondary:active { transform: scale(0.98); }

/* ============================================================
   Backdrop
   ============================================================ */

.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.backdrop.visible {
  opacity: 1;
  pointer-events: all;
}

/* ============================================================
   Drawers — Bottom Sheets
   ============================================================ */

.drawer {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 100%;
  max-width: 480px;
  background: var(--cream-white);
  border-radius: 20px 20px 0 0;
  z-index: 40;
  transition: transform 0.36s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 90dvh;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.drawer.open {
  transform: translateX(-50%) translateY(0);
}

.drawer-handle {
  width: 32px;
  height: 3px;
  background: var(--border-mid);
  border-radius: 2px;
  margin: 13px auto 0;
  flex-shrink: 0;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 10px;
  flex-shrink: 0;
}

.drawer-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 400;
  font-style: italic;
  color: var(--charcoal);
  letter-spacing: -0.01em;
}

.drawer-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream-deep);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--warm-mid);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.drawer-close:hover         { background: #e3ddd3; color: var(--charcoal); border-color: var(--border-mid); }
.drawer-close:focus-visible { outline: 1px solid var(--charcoal); outline-offset: 2px; }

.drawer-body {
  padding: 4px 20px;
  padding-bottom: calc(26px + var(--safe-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ============================================================
   When & Where — Event Sections
   ============================================================ */

.event-section {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.event-section:last-of-type {
  border-bottom: none;
}

.event-name {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 400;
  font-style: italic;
  color: var(--charcoal);
}

.event-meta {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--warm-mid);
  letter-spacing: 0.01em;
}

.event-address {
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 400;
  color: var(--warm-light);
}

.link-maps {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 9px;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--charcoal);
  text-decoration: none;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--border-mid);
  padding-bottom: 1px;
  align-self: flex-start;
  transition: border-color 0.2s ease;
}

.link-maps:hover {
  border-color: var(--charcoal);
}

.rsvp-note {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--warm-light);
  text-align: center;
  padding: 18px 0 4px;
  letter-spacing: 0.02em;
}

/* ============================================================
   Events (shared partial)
   ============================================================ */

.event-block {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 0;
}

.event-block-icon {
  width: 40px;
  height: 40px;
  background: var(--surface-alt, #f0ebe3);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
}

.event-block-info { flex: 1; min-width: 0; }

.event-block-label {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.event-block-location {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.event-block-datetime {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 3px;
}

.event-block-address {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.event-divider {
  height: 1px;
  background: var(--border);
}

.btn-maps {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 13px;
  background: var(--surface-alt, #f0ebe3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.74rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.2s ease, border-color 0.2s ease;
}

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

/* ============================================================
   RSVP Form
   ============================================================ */

.form-group {
  margin-bottom: 20px;
}

.form-group.hidden {
  display: none;
}

.form-label {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--warm-mid);
  margin-bottom: 9px;
}

.form-hint {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.7rem;
  color: var(--warm-light);
}

/* Segmented control — Apple-style */
.segment-control {
  display: flex;
  background: var(--cream-deep);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
}

.segment-option {
  flex: 1;
  cursor: pointer;
}

.segment-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segment-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 11px;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--warm-mid);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.segment-option input[type="radio"]:checked + .segment-btn {
  background: var(--cream-white);
  color: var(--charcoal);
  font-weight: 500;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.segment-option input[type="radio"]:focus-visible + .segment-btn {
  outline: 1px solid var(--charcoal);
  outline-offset: 1px;
}

/* Number stepper */
.stepper {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border-mid);
  border-radius: 10px;
  overflow: hidden;
}

.stepper-btn {
  width: 54px;
  height: 52px;
  background: var(--cream-deep);
  border: none;
  color: var(--charcoal);
  font-size: 1.35rem;
  font-weight: 300;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
  transition: background 0.15s ease;
}

.stepper-btn:hover  { background: #e3ddd3; }
.stepper-btn:active { background: #dad4c9; }

.stepper-value {
  flex: 1;
  text-align: center;
  font-family: var(--font-sans);
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--charcoal);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  justify-content: center;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  background: var(--cream-white);
  border: 1px solid var(--border-mid);
  border-radius: 10px;
  color: var(--charcoal);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 400;
  outline: none;
  -webkit-appearance: none;
  transition: border-color 0.2s ease;
}

.form-input::placeholder {
  color: var(--warm-light);
}

.form-input:focus {
  border-color: rgba(26, 23, 20, 0.4);
}

.btn-submit {
  width: 100%;
  padding: 16px;
  background: var(--charcoal);
  color: var(--cream);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.12s ease;
}

.btn-submit:hover  { background: #2d2a26; }
.btn-submit:active { transform: scale(0.98); }

.optional {
  text-transform: none;
  font-size: 0.74rem;
  letter-spacing: 0;
  font-weight: 400;
  opacity: 0.5;
}

.radio-pills {
  display: flex;
  gap: 8px;
}

.radio-pill {
  flex: 1;
  cursor: pointer;
}

.radio-pill input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.radio-pill span {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 13px;
  background: var(--cream-white);
  border: 1.5px solid var(--border-mid);
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--warm-mid);
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
  cursor: pointer;
}

.radio-pill input[type="radio"]:checked + span {
  border-color: var(--charcoal);
  color: var(--charcoal);
  background: var(--cream-deep);
}

.radio-pill input[type="radio"]:focus-visible + span {
  outline: 2px solid var(--charcoal);
  outline-offset: 2px;
}

.number-stepper {
  display: flex;
  align-items: center;
  background: var(--cream-white);
  border: 1px solid var(--border-mid);
  border-radius: 10px;
  overflow: hidden;
}

.number-stepper .stepper-btn {
  width: 50px;
  height: 50px;
  background: transparent;
  border: none;
  color: var(--charcoal);
  font-size: 1.5rem;
  font-weight: 300;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
  line-height: 1;
  flex-shrink: 0;
}

.number-stepper .stepper-btn:hover  { background: var(--cream-deep); }
.number-stepper .stepper-btn:active { background: var(--cream); }

.number-stepper input[type="number"] {
  flex: 1;
  text-align: center;
  background: transparent;
  border: none;
  color: var(--charcoal);
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 500;
  padding: 0;
  outline: none;
  -moz-appearance: textfield;
}

.number-stepper input[type="number"]::-webkit-inner-spin-button,
.number-stepper input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

.form-textarea {
  resize: vertical;
  min-height: 70px;
}

.rsvp-deadline {
  font-size: 0.74rem;
  color: var(--warm-mid);
  text-align: center;
  margin-bottom: 18px;
  letter-spacing: 0.02em;
}

/* ============================================================
   Toast
   ============================================================ */

.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--cream-white);
  border: 1px solid var(--border-mid);
  color: var(--charcoal);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 11px 22px;
  border-radius: 100px;
  white-space: nowrap;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.09);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================================
   Desktop
   ============================================================ */

@media (min-width: 481px) {
  body {
    background: var(--cream-deep);
    display: flex;
    justify-content: center;
  }

  .page {
    width: 100%;
    flex-shrink: 0;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.06);
  }
}
