:root {
  --white: #ffffff;
  --ivory: #e4dfdb;
  --cream: #fff5eb;
  --ink: #3a3533;
  --surface: var(--cream);
  --on-surface: var(--ink);
  --primary: var(--ink);
  --font-display: "Playfair Display", Georgia, serif;
  --font-body: "Montserrat", system-ui, sans-serif;
}

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

html {
  scroll-behavior: auto;
  scroll-snap-type: y mandatory;
  overscroll-behavior-y: none;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--surface);
  color: var(--on-surface);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0;
}

body {
  overflow-x: hidden;
}

body.is-locked {
  overflow: hidden;
}

button,
a {
  font: inherit;
}

.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 1px;
  width: 100%;
  z-index: 70;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: left;
}

/* Invitation gate */
.envelope-screen {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--cream);
  overflow: hidden;
  pointer-events: none;
}

.invite-landing,
.envelope-reveal {
  position: absolute;
  inset: 0;
}

.invite-landing {
  z-index: 2;
  pointer-events: auto;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.75rem 1.15rem 2rem;
  background: var(--cream);
  font-family: "Montserrat", system-ui, sans-serif;
  color: #2c2624;
  justify-content: center;
}

.invite-gate {
  width: min(400px, 100%);
  background: var(--white);
  border-radius: 20px;
  padding: 1.9rem 1.4rem 1.55rem;
  box-shadow: 0 18px 48px rgba(58, 53, 51, 0.08);
  text-align: center;
}

.gate-kicker,
.gate-guest-kicker {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #8a817b;
}

.gate-seal {
  display: grid;
  place-items: center;
  width: 148px;
  height: 148px;
  margin: 0.15rem auto 1rem;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 30%, #ffffff 0%, #fff5eb 32%, #f8e6e4 100%);
  box-shadow:
    inset 0 0 0 1px rgba(220, 216, 203, 0.9),
    inset 0 0 0 8px rgba(248, 230, 228, 0.45);
}

.gate-seal-letters {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 2.15rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: #b08a87;
}

.gate-guest {
  margin: 0 0 1.15rem;
  padding: 1.25rem 1rem 1.35rem;
  border-radius: 6px;
}

.gate-guest-kicker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-bottom: 0.55rem;
}

.gate-guest-kicker svg {
  display: block;
  flex: none;
}

.gate-guest-name {
  margin: 0 0 0.2rem;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.45rem;
  font-weight: 500;
  line-height: 1.2;
  color: #2c2624;
}

.gate-guest-invited {
  display: inline-block;
  margin: 0 0 0.7rem;
  padding: 0 0.2em 0.05em;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 0.95rem;
  font-style: italic;
  font-weight: 400;
  color: #6a5c56;
  background: linear-gradient(transparent 62%, #f0ddd8 62%);
}

.gate-guest-body {
  margin: 0 auto;
  max-width: 18.5rem;
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.7;
  color: #6f6863;
}

.gate-open {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  margin: 0 0 0.9rem;
  padding: 0.95rem 1.1rem;
  border: 0;
  border-radius: 8px;
  background: #2c2624;
  color: var(--white);
  cursor: pointer;
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.gate-open:hover {
  background: #3a3330;
}

.gate-open:active {
  transform: translateY(1px);
}

.gate-open-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f1d9d4;
  box-shadow: inset 0 0 0 5px #e8c4bd;
}

.gate-open-arrow {
  font-size: 0.95rem;
  letter-spacing: 0;
  font-weight: 400;
}

.envelope-reveal {
  z-index: 1;
  pointer-events: none;
}

.reveal-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  z-index: 20;
}

.reveal-panel--left {
  left: 0;
  background: var(--cream);
  box-shadow: inset -10px 0 30px rgba(58, 53, 51, 0.04);
}

.reveal-panel--right {
  right: 0;
  background: var(--cream);
  box-shadow: inset 10px 0 30px rgba(58, 53, 51, 0.04);
}

.reveal-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.12;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n2'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n2)'/%3E%3C/svg%3E");
}

body.js-on .invite-gate {
  opacity: 0;
}

#journey[hidden],
.tabbar[hidden] {
  display: none;
}

#journey {
  width: min(430px, 100%);
  margin: 0 auto;
  padding: 0;
  background: var(--cream);
  color: #2c2624;
}

.panels {
  position: relative;
}

.panel {
  box-sizing: border-box;
  height: 100svh;
  min-height: 100svh;
  max-height: 100svh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 1rem;
  padding: 4.5rem 1rem 5.75rem;
  background: var(--cream);
  scroll-snap-align: start;
}

.app-bar {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 40;
  width: min(430px, 100%);
  translate: -50% 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.15rem 0.75rem;
  background: var(--cream);
}

.app-bar-names {
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15rem;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.app-bar-actions {
  display: flex;
  gap: 0.45rem;
}

.icon-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #2c2624;
  text-decoration: none;
  cursor: pointer;
}

#home.panel,
#gifts.panel {
  display: grid;
  grid-template-rows: minmax(0, 4fr) minmax(0, 1fr);
  align-content: stretch;
}

.hero {
  min-height: 0;
  height: 100%;
  margin: 0;
  display: flex;
}

.hero-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 1.8rem 1.25rem 1.25rem;
  overflow: hidden;
  border-radius: 16px;
  text-align: center;
  color: #2c2624;
  box-shadow: inset 0 0 0 1px rgba(220, 216, 203, 0.7);
}

.hero-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 62%;
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 245, 235, 0.82) 0%, rgba(255, 245, 235, 0.28) 36%, rgba(255, 245, 235, 0) 58%);
}

.hero-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-ornament {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
  font-size: 0.5rem;
  color: #c4bbb3;
}

.hero-ornament::before,
.hero-ornament::after {
  content: "";
  width: 28px;
  height: 1px;
  background: #ddd6cf;
}

.hero-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #b08a87;
}

.hero-names {
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 2.15rem;
  line-height: 1.05;
}

.hero-date {
  margin: 0.55rem 0 0;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #8a817b;
}

#home .player {
  align-self: center;
  width: 100%;
}

.player {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  padding: 0.7rem 0.85rem;
  background: var(--white);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(58, 53, 51, 0.06);
}

.player-play,
.player-pause {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.player-play {
  background: #f3ddd8;
  color: #9a6f6a;
}

.player-pause {
  background: transparent;
  color: #8a817b;
}

body.is-playing .player-play .icon-play,
body:not(.is-playing) .player-play .icon-pause {
  display: none;
}

.player-meta {
  min-width: 0;
}

.player-kicker {
  margin: 0;
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #b08a87;
}

.player-marquee {
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

.player-title {
  display: flex;
  width: max-content;
  margin: 0.1rem 0 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.92rem;
  white-space: nowrap;
}

.player-title.is-marquee {
  animation: player-marquee 14s linear infinite;
}

body:not(.is-playing) .player-title {
  animation-play-state: paused;
}

.player-title span {
  flex: none;
  padding-right: 2.5rem;
}

.player-title.is-marquee {
  will-change: transform;
}

@keyframes player-marquee {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-50%, 0, 0);
  }
}

.quote-block {
  padding: 0 0.35rem;
  text-align: center;
}

.quote-text {
  margin: 0 auto 0.85rem;
  max-width: 20rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.2rem;
  font-weight: 400;
  line-height: 1.45;
  color: #2c2624;
}

.quote-body {
  margin: 0 auto;
  max-width: 18.5rem;
  font-size: 0.78rem;
  line-height: 1.7;
  color: #8a817b;
}

.count-card,
.details,
.gift-card {
  margin: 0;
  padding: 1.2rem 1.05rem 1.15rem;
  background: #f7f1ea;
  border-radius: 16px;
}

.section-kicker {
  margin: 0 0 0.2rem;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #b08a87;
}

.section-title {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.45rem;
  font-weight: 400;
  line-height: 1.15;
}

.count-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.count-box {
  background: var(--white);
  border-radius: 10px;
  padding: 0.7rem 0.2rem 0.55rem;
  text-align: center;
}

.count-box strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 500;
  line-height: 1;
}

.count-box span {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.55rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8a817b;
}

.count-note {
  margin: 0.85rem 0 0;
  text-align: center;
  font-size: 0.72rem;
  color: #8a817b;
}

.details {
  background: transparent;
  padding: 0.15rem 0.15rem 0;
}

.details-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.event-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  align-items: start;
  padding: 0.85rem 0;
}

.event-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f3ddd8;
  color: #9a6f6a;
}

.event-label {
  margin: 0 0 0.15rem;
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #b08a87;
}

.event-time {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.3;
}

.event-place {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #8a817b;
}

.map-card {
  position: relative;
  overflow: hidden;
  margin: 0;
  min-height: 0;
  height: 100%;
  border-radius: 16px;
  background: var(--ivory);
}

.map-card iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  max-width: none;
  pointer-events: none;
}

.map-pill {
  position: absolute;
  left: 50%;
  bottom: 12px;
  translate: -50% 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #2c2624;
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 500;
  box-shadow: 0 6px 18px rgba(58, 53, 51, 0.12);
}

.couple-photo {
  flex: 1;
  min-height: 0;
  margin: 0;
  border-radius: 16px;
  overflow: hidden;
}

.couple-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 62%;
}

.couple-names {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  margin: 0;
  text-align: center;
}

.couple-names p {
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.02rem;
  line-height: 1.25;
  color: #2c2624;
}

.couple-names span {
  display: block;
  margin-bottom: 0.15rem;
  font-family: var(--font-body);
  font-style: normal;
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #b08a87;
}

.closing {
  padding: 0 0.35rem;
  text-align: center;
}

.closing-quote {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.25rem;
}

.closing-note {
  margin: 0;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #8a817b;
}

.gift-card {
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.gift-note {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.7;
  color: #6f6863;
}

.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 50;
  translate: -50% 0;
  width: min(430px, 100%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 0.45rem 0.4rem 0.7rem;
  background: #fffcf9;
  border-top: 1px solid rgba(228, 223, 219, 0.8);
}

.tab {
  display: grid;
  justify-items: center;
  gap: 0.15rem;
  color: #b0a8a2;
  text-decoration: none;
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tab.is-active {
  color: #2c2624;
}

body.js-on .app-bar,
body.js-on .tabbar,
body.js-on #home .hero-ornament,
body.js-on #home .hero-kicker,
body.js-on #home .hero-names,
body.js-on #home .hero-date,
body.js-on #home .player {
  opacity: 0;
}

@media (max-height: 780px) {
  .hero-panel {
    padding: 1.4rem 1rem;
  }

  .hero-names {
    font-size: 1.85rem;
  }

  .quote-text {
    font-size: 1.05rem;
  }

  .section-title {
    margin-bottom: 0.65rem;
  }

  .event-row {
    padding: 0.5rem 0;
  }

  .couple-names p {
    font-size: 0.92rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .player-title.is-marquee {
    animation: none;
  }

  body.js-on .invite-gate,
  body.js-on .app-bar,
  body.js-on .tabbar,
  body.js-on #home .hero-ornament,
  body.js-on #home .hero-kicker,
  body.js-on #home .hero-names,
  body.js-on #home .hero-date,
  body.js-on #home .player {
    opacity: 1;
  }
}
