:root {
  --mahogany: #3b0f0f;
  --mahogany-deep: #2a0a0a;
  --gold: #c9a24b;
  --cream: #f3e9dc;
  --cobalt-blue: #0047ab;
  --cobalt-blue-rgb: 0, 71, 171;
  --navy-blue: #00152e;
  --striking-orange: #ff6a00;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: linear-gradient(180deg, var(--mahogany) 0%, var(--mahogany-deep) 100%);
  color: var(--cream);
  font-family: 'Cormorant Garamond', serif;
  min-height: 100vh;
}

footer {
  text-align: center;
  padding: 2rem 1rem 3rem;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  color: rgba(243, 233, 220, 0.4);
}

/* ================= Password gate (page 1) ================= */

#site-content {
  display: none;
}

#password-gate {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  background: #fdfcf9;
  overflow: hidden;
  z-index: 10;
  font-family: 'DM Sans', 'Poppins', sans-serif;
}

/* Custom dot cursor only makes sense on devices with a real mouse/trackpad.
   On touch devices (phones, tablets/iPad) this stays as the normal cursor. */
@media (hover: hover) and (pointer: fine) {
  #password-gate,
  #password-gate * {
    cursor: none;
  }
}

.gate-cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--cobalt-blue);
  pointer-events: none;
  transform: translate(-50%, -50%);
  opacity: 0;
  z-index: 20;
  transition: opacity 0.2s ease;
}

.water-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 160px;
  height: 160px;
  transform: translate(-50%, -50%);
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.gate-heading {
  position: relative;
  z-index: 2;
  width: 100%;
  text-align: center;
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: #111;
  margin: 0 0 2.5rem;
  min-height: 1.5em;
  letter-spacing: 0.01em;
}

.gate-form {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.password-input-wrapper {
  position: relative;
  width: 340px;
  height: 3.5rem;
  border: none;
  background: transparent;
}

.password-real-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  color: transparent;
  /* Real caret hidden: emoji glyphs render far wider than the actual typed
     characters, so the native caret can't stay aligned with them. A custom
     caret is rendered instead, right after the last emoji, in .fake-caret. */
  caret-color: transparent;
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  text-align: center;
  outline: none;
  padding: 0 1rem;
}

.password-display {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: #111;
  pointer-events: none;
  overflow: hidden;
  padding: 0 1rem;
}

.fake-caret {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  margin-left: 0.15rem;
  background: var(--cobalt-blue);
  animation: caret-blink 1s step-end infinite;
}

@keyframes caret-blink {
  0%, 50% { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

.gate-error {
  position: relative;
  z-index: 2;
  margin-top: 1rem;
  color: #c0392b;
  font-size: 0.95rem;
  min-height: 1.2rem;
  font-family: 'DM Sans', sans-serif;
}

/* ================= Nav, shared ================= */

.site-nav {
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.95rem;
}

.site-nav a {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.site-nav a:hover {
  border-bottom: 1px solid var(--gold);
}

/* ================= Music toggle ================= */

.music-toggle-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: rgba(201, 162, 75, 0.15);
  color: var(--gold);
  font-size: 1.3rem;
  cursor: pointer;
  z-index: 5;
}

.page2-cobalt .music-toggle-btn {
  border-color: var(--cobalt-blue);
  background: rgba(0, 71, 171, 0.1);
  color: var(--cobalt-blue);
}

.page3-cobalt .music-toggle-btn {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* ================= Homepage (page 2) ================= */

.page2-cobalt {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #fdfcf9;
  overflow: hidden;
}

@media (hover: hover) and (pointer: fine) {
  .page2-cobalt {
    cursor: none;
  }
}

.page2-cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--striking-orange);
  pointer-events: none;
  transform: translate(-50%, -50%);
  opacity: 0;
  z-index: 20;
  transition: opacity 0.2s ease;
}

.page2-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 3;
  padding: 2rem;
  text-align: center;
}

.pre-cta {
  font-family: 'Alex Brush', cursive;
  font-style: normal;
  text-transform: lowercase;
  font-size: 1.3rem;
  color: #000;
  margin: 0 0 0.25rem;
}

@keyframes loud-intro {
  0% { transform: scale(3.4); opacity: 0; }
  12% { opacity: 1; }
  55% { transform: scale(0.94); }
  75% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes cta-buzz {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  20% { transform: translateX(-3px) rotate(-1.5deg); }
  40% { transform: translateX(3px) rotate(1.5deg); }
  60% { transform: translateX(-3px) rotate(-1.5deg); }
  80% { transform: translateX(3px) rotate(1.5deg); }
}

.share-info-cta {
  display: inline-block;
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  text-transform: lowercase;
  font-size: clamp(3.25rem, 9vw, 4.65rem);
  letter-spacing: 0.01em;
  color: var(--cobalt-blue);
  text-decoration: none;
  border-bottom: 2px dashed transparent;
  padding-bottom: 0.4rem;
  transition: border-color 0.2s ease;
  /* No animation here by default, the one-time intro is added and removed
     by JS via .cta-intro so leaving :hover can't accidentally re-trigger it. */
}

/* Added by JS on load, removed again after it finishes, runs exactly once. */
.share-info-cta.cta-intro {
  animation: loud-intro 3s cubic-bezier(0.25, 0.8, 0.3, 1) both;
}

.share-info-cta:hover {
  border-bottom-color: var(--cobalt-blue);
}

/* Excludes .cta-intro so hovering during the first 3s (the "loud" intro)
   can't collide with it and glitch between the two animations. */
.share-info-cta:hover:not(.cta-intro) {
  animation: cta-buzz 0.3s linear infinite;
}

/* Mobile-only periodic jiggle (added/removed via JS on a timer, since touch
   devices have no :hover to trigger .cta-buzz). */
.share-info-cta.cta-jiggle {
  animation: cta-buzz 0.3s linear 3;
}

.couple-photos {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin-bottom: -30px;
}

.couple-photos img {
  max-height: 220px;
  width: auto;
  display: block;
}

.photo-iris {
  z-index: 4;
}

.photo-nick {
  margin-left: 14px;
  z-index: 3;
}

.site-footer-bar {
  position: relative;
  z-index: 5;
  background: var(--navy-blue);
  padding: 0.3rem 1rem;
  text-align: center;
  cursor: pointer;
}

.calendar-menu {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  padding: 0.4rem;
  display: none;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 200px;
  z-index: 30;
  cursor: default;
}

.calendar-menu.open {
  display: flex;
}

.calendar-hint {
  position: absolute;
  top: 50%;
  left: 100%;
  margin-left: 16px;
  background: #fff;
  color: #111;
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) translateX(8px) scale(0.85);
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 25;
}

.calendar-hint::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 100%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-right-color: #fff;
}

.calendar-hint.show {
  opacity: 1;
  transform: translateY(-50%) translateX(0) scale(1);
  animation: hint-jiggle 0.55s ease-in-out 0.3s 3;
}

@keyframes hint-jiggle {
  0%, 100% { transform: translateY(-50%) translateX(0) rotate(0deg); }
  20% { transform: translateY(-50%) translateX(0) rotate(-7deg); }
  40% { transform: translateY(-50%) translateX(0) rotate(7deg); }
  60% { transform: translateY(-50%) translateX(0) rotate(-5deg); }
  80% { transform: translateY(-50%) translateX(0) rotate(5deg); }
}

.calendar-menu a {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  text-decoration: none;
  color: #111;
  font-family: 'Manrope', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: left;
}

.calendar-menu a:hover {
  background: #f0f0f0;
}

.site-footer-bar span {
  display: inline-block;
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
}

@keyframes footer-shake {
  0%, 100% { transform: rotate(-10deg); }
  50% { transform: rotate(10deg); }
}

/* Each letter shakes independently (built by footer-letters.js) instead of
   the whole line rotating as one rigid block, which was swinging the ends
   outside the thin footer bar. */
.footer-letter {
  display: inline-block;
  animation: footer-shake 2.6s ease-in-out infinite;
}

/* ================= Info-form page (page 3) ================= */

.page3-cobalt {
  position: relative;
  min-height: 100vh;
  background: var(--cobalt-blue);
}

@media (hover: hover) and (pointer: fine) {
  .page3-cobalt {
    cursor: none;
  }
}

.page3-cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  pointer-events: none;
  transform: translate(-50%, -50%);
  opacity: 0;
  z-index: 20;
  transition: opacity 0.2s ease;
}

.rsvp-section {
  max-width: 720px;
  margin: 0 auto;
  padding: 4rem 1.5rem 6rem;
  text-align: center;
}

.rsvp-heading {
  font-family: 'Work Sans', sans-serif;
  font-weight: 700;
  font-size: 2rem;
  color: #fff;
  margin-bottom: 0.5rem;
}

.rsvp-note {
  font-family: 'Work Sans', sans-serif;
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 2.5rem;
}

.form-wrapper {
  background: #fff;
  border: none;
  border-radius: 6px;
  padding: 1rem;
}

.page3-footer {
  text-align: center;
  padding: 1rem;
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  text-transform: lowercase;
  color: #fff;
  font-size: 1rem;
  letter-spacing: 0.05em;
}

iframe {
  width: 100%;
  height: 2160px;
  border: none;
  border-radius: 4px;
  background: var(--cream);
}

/* ================= Hotels page ================= */

.hotels-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 1.5rem 6rem;
}

.hotels-heading {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  text-align: center;
  color: var(--cream);
  margin-bottom: 0.5rem;
}

.hotels-note {
  font-size: 1.1rem;
  text-align: center;
  color: rgba(243, 233, 220, 0.75);
  margin-bottom: 3rem;
}

.hotel-block {
  display: flex;
  align-items: stretch;
  gap: 1.5rem;
  border: 1px solid rgba(201, 162, 75, 0.35);
  border-radius: 6px;
  background: rgba(243, 233, 220, 0.03);
  margin-bottom: 2rem;
  overflow: hidden;
}

.hotel-image {
  flex: 0 0 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, rgba(201, 162, 75, 0.25), rgba(59, 15, 15, 0.6));
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 2.6rem;
  color: var(--gold);
}

.hotel-details {
  flex: 1;
  padding: 1.5rem 1.5rem 1.5rem 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: left;
}

.hotel-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  color: var(--cream);
  margin: 0 0 0.5rem;
}

.hotel-desc {
  font-size: 1.1rem;
  line-height: 1.4;
  color: rgba(243, 233, 220, 0.8);
  margin: 0 0 1rem;
}

.hotel-link {
  align-self: flex-start;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mahogany-deep);
  background: var(--gold);
  padding: 0.5rem 1.2rem;
  border-radius: 4px;
  text-decoration: none;
}

@media (max-width: 560px) {
  .hotel-block {
    flex-direction: column;
  }

  .hotel-image {
    flex-basis: 140px;
    width: 100%;
  }

  .hotel-details {
    padding: 1.5rem;
  }
}

/* ================= Touch devices (mobile / iPad / tablet) ================= */

/* No custom dot cursor on touch-primary devices, they have no mouse pointer
   to track, and cursor: none would just leave nothing visible at all. */
@media (pointer: coarse) {
  .gate-cursor-dot,
  .page2-cursor-dot,
  .page3-cursor-dot {
    display: none !important;
  }
}
