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

:root {
  --cream: #f5f0e8;
  --ink: #1a1410;
  --dust: #c9b99a;
  --rust: #c0392b;
  --fog: #e8e0d0;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  background: var(--cream);
  color: var(--ink);
  font-family: 'Cormorant Garamond', Georgia, serif;
  overflow-x: hidden;
  min-height: 100vh;
}

.wrapper {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ── TOP RIBBON ── */
.top-ribbon {
  width: 100%;
  padding: 2.5rem 0 0.5rem;
  display: flex;
  align-items: center;
  gap: 0;
  overflow: visible;
}

.top-ribbon__line {
  flex: 1;
  height: 40px;
  min-width: 0;
}

.top-ribbon__line svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.top-ribbon__heart {
  flex-shrink: 0;
  width: 58px;
  height: 46px;
  margin: 0 -16px;
}

.top-ribbon__heart svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

/* ── PHOTO ── */
.hero {
  text-align: center;
  padding-bottom: 1rem;
}

.photo-frame {
  width: 210px;
  height: 260px;
  margin: 0 auto 2rem;
  border-radius: 105px 105px 18px 18px;
  overflow: hidden;
  border: 2px solid var(--fog);
  box-shadow: 0 12px 40px rgba(26, 20, 16, 0.1);
  background: linear-gradient(135deg, var(--fog), var(--dust));
}

.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── TITLE ── */
.pre-title {
  font-family: 'Marck Script', cursive;
  font-size: 1.5rem;
  color: var(--dust);
  margin-bottom: 0.1rem;
}

.main-title {
  font-family: 'Unbounded', sans-serif;
  font-weight: 500;
  font-size: clamp(2rem, 10vw, 4.5rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.hero-subtitle {
  font-family: 'Marck Script', cursive;
  font-size: 1rem;
  color: var(--dust);
  margin-top: 0.8rem;
  line-height: 1.4;
}

/* ── OUR PHOTO ── */
.our-photo {
  text-align: center;
  padding: 9rem 0 0;
}

.our-photo img {
  max-width: 320px;
  width: 80%;
  height: auto;
  display: block;
  margin: 0 auto;
  scale: 2.5;
  translate: 8% -75%;
}

/* ── INVITE STRIP ── */
.invite-strip {
  width: 100%;
  background: var(--rust);
  padding: 0.8rem 0;
  overflow: hidden;
}

.invite-track {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  white-space: nowrap;
  animation: marquee 15s linear infinite;
  width: max-content;
}

.invite-track span {
  font-family: 'Unbounded', sans-serif;
  font-weight: 300;
  font-size: clamp(0.6rem, 2vw, 0.8rem);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cream);
}

.invite-sep {
  font-size: 0.5rem;
  opacity: 0.5;
}

@keyframes marquee {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

/* ── STORY + CALENDAR ── */
.story-calendar {
  padding: 2.5rem 0 1.5rem;
  text-align: center;
  position: relative;
}

/* Vertical line connecting items */
.story-calendar::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 3.5rem;
  bottom: 2rem;
  width: 1px;
  background: linear-gradient(to bottom, var(--dust), var(--rust), var(--dust));
  transform: translateX(-50%);
  z-index: 0;
}

.sc-item {
  position: relative;
  z-index: 1;
  margin-bottom: 1.5rem;
}

.sc-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--rust);
  margin: 0 auto 0.7rem;
}

.sc-year {
  font-family: 'Unbounded', sans-serif;
  font-weight: 400;
  font-size: 1.8rem;
  color: var(--rust);
  margin-bottom: 0.4rem;
}

.sc-text {
  font-size: 1.1rem;
  font-weight: 400;
  line-height: 1.7;
  color: #5a4e42;
  max-width: 40ch;
  margin: 0 auto;
  background: var(--cream);
  padding: 0 0.5rem;
}

.sc-heart {
  position: relative;
  z-index: 1;
  margin: 0.5rem auto 1rem;
  width: 30px;
}

.sc-heart svg {
  width: 100%;
  height: auto;
  display: block;
}

.sc-calendar {
  position: relative;
  z-index: 1;
  background: var(--fog);
  border-radius: 16px;
  padding: 1.2rem 1rem;
  margin-top: 1rem;
}

.sc-cal-header {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
}

.sc-cal-month {
  font-family: 'Unbounded', sans-serif;
  font-weight: 400;
  font-size: 1rem;
  color: var(--ink);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.sc-cal-year-tag {
  font-family: 'Unbounded', sans-serif;
  font-weight: 200;
  font-size: 0.65rem;
  color: var(--dust);
  letter-spacing: 0.1em;
}

.sc-cal-time {
  margin-top: 0.8rem;
  font-family: 'Marck Script', cursive;
  font-size: 1.3rem;
  color: var(--rust);
}

/* ── TOGGLE BUTTONS ── */
.toggle-row {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}

.toggle-btn {
  padding: 0.4rem 1rem;
  border: 1px solid var(--dust);
  border-radius: 20px;
  background: transparent;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.8rem;
  font-style: italic;
  color: var(--dust);
  cursor: pointer;
  transition: all 0.3s;
}

.toggle-btn.active,
.toggle-btn:hover {
  background: var(--rust);
  border-color: var(--rust);
  color: var(--cream);
}

/* ── INVITATION TEXT ── */
.invitation {
  text-align: center;
  padding: 1.5rem 0;
}

.invitation p {
  font-size: 1.15rem;
  font-weight: 400;
  line-height: 1.8;
  color: #5a4e42;
}

/* ── DATE BLOCK ── */
.date-block {
  text-align: center;
  padding: 1rem 0.8rem;
  background: var(--fog);
  border-radius: 16px;
  margin: 0.5rem 0 2rem;
}

.date-heading {
  text-align: center;
  padding: 1rem 0 1rem;
}

.date-main {
  font-family: 'Unbounded', sans-serif;
  font-weight: 300;
  font-size: clamp(1.3rem, 5vw, 1.7rem);
  color: var(--ink);
}

.date-main span {
  color: var(--rust);
}

/* ── CALENDAR ── */
.calendar {
  margin: 0 auto;
}

.calendar-month {
  font-family: 'Unbounded', sans-serif;
  font-weight: 300;
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink);
  text-align: center;
  margin-bottom: 0.5rem;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
  font-size: 0.78rem;
}

.calendar-grid .dh {
  font-family: 'Unbounded', sans-serif;
  font-weight: 300;
  font-size: 0.65rem;
  color: var(--dust);
  padding: 6px 0;
  text-transform: uppercase;
}

.calendar-grid .d {
  padding: 6px 2px;
  border-radius: 50%;
  font-weight: 400;
  color: #7a6e62;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
}

.calendar-grid .d.e {
  visibility: hidden;
}

.calendar-grid .d.a {
  background: var(--rust);
  color: var(--cream);
  font-weight: 600;
  box-shadow: 0 3px 12px rgba(192, 57, 43, 0.35);
  width: 36px;
  height: 36px;
  margin: 0 auto;
  padding-top: 2px;
}

/* ── SECTION HEADING ── */
.section-heading {
  font-family: 'Unbounded', sans-serif;
  font-weight: 300;
  font-size: clamp(1.1rem, 4vw, 1.4rem);
  text-align: center;
  color: var(--rust);
  margin-bottom: 1.5rem;
}

/* ── TIMELINE ── */
.timeline-section {
  padding: 2.5rem 0 2rem;
}

.tl-fancy {
  position: relative;
  max-width: 320px;
  margin: 0 auto;
}

.tl-svg {
  display: block;
  margin: 0 auto;
  width: 80px;
  height: auto;
  overflow: visible;
}

.tl-labels {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10% 0 12%;
}

.tl-label {
  text-align: center;
}

.tl-time {
  font-family: 'Unbounded', sans-serif;
  font-weight: 400;
  font-size: 1.4rem;
  color: var(--ink);
}

.tl-desc {
  font-family: 'Marck Script', cursive;
  font-size: 1.1rem;
  color: var(--dust);
}

/* ── DRESS CODE ── */
.dresscode {
  padding: 2rem 0;
  text-align: center;
}

.dresscode-text {
  font-size: 1.1rem;
  font-weight: 400;
  line-height: 1.7;
  color: #5a4e42;
  max-width: 32ch;
  margin: 0 auto 1.5rem;
}

.dresscode-colors {
  display: flex;
  justify-content: center;
  gap: 0.7rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  background: var(--fog);
  padding: 1.2rem 1.5rem;
  border-radius: 12px;
}

.color-dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--cream);
  box-shadow: 0 2px 8px rgba(26, 20, 16, 0.12);
  transition: transform 0.3s;
}

.color-dot:hover {
  transform: scale(1.15);
}

.dresscode-carousel {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  border-radius: 12px;
  cursor: grab;
}

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

.dc-track {
  display: flex;
  gap: 0.8rem;
}

.dc-slide {
  flex: 0 0 auto;
  scroll-snap-align: center;
  border-radius: 12px;
  overflow: hidden;
}

.dc-slide img {
  height: 375px;
  width: auto;
  display: block;
}

.dresscode-hint {
  margin-top: 0.8rem;
  font-family: 'Marck Script', cursive;
  font-size: 1rem;
  color: var(--dust);
}

/* ── LOCATION ── */
.location-section {
  padding: 1rem 0 2.5rem;
}

.location-flip {
  perspective: 1000px;
  cursor: pointer;
  border-radius: 16px;
  height: 350px;
}

.location-flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.7s cubic-bezier(.4, .2, .2, 1);
  transform-style: preserve-3d;
}

.location-flip.flipped .location-flip-inner {
  transform: rotateY(180deg);
}

.location-front,
.location-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 16px;
  overflow: hidden;
}

.location-front {
  background: var(--fog);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.location-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.location-front-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem;
  background: linear-gradient(to top, rgba(26, 20, 16, 0.75) 0%, transparent 100%);
  text-align: center;
}

.location-name {
  font-family: 'Unbounded', sans-serif;
  font-weight: 300;
  font-size: 0.85rem;
  color: var(--cream);
  margin-bottom: 0.2rem;
}

.location-address {
  font-size: 0.95rem;
  font-style: italic;
  color: var(--fog);
}

/* Map toggle button */
.location-toggle {
  position: absolute;
  top: 1rem;
  right: 1rem;
  opacity: 1;
  transition: opacity 0.2s;
  padding: 0.5rem 1.2rem;
  background: var(--rust);
  color: var(--cream);
  font-family: 'Unbounded', sans-serif;
  font-weight: 300;
  font-size: 0.55rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  z-index: 2;
  transition: background 0.3s, transform 0.2s;
  box-shadow: 0 4px 12px rgba(26, 20, 16, 0.3);
}

.location-toggle:hover {
  background: var(--ink);
  transform: translateY(-1px);
}

.location-back {
  transform: rotateY(180deg);
  background: var(--fog);
}

.location-back iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.location-flip-wrap {
  position: relative;
}

.location-back-btn {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 20;
  padding: 0.5rem 1.2rem;
  background: var(--rust);
  color: var(--cream);
  font-family: 'Unbounded', sans-serif;
  font-weight: 300;
  font-size: 0.55rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(26, 20, 16, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease 0.6s, background 0.3s;
}

.location-back-btn:hover {
  background: var(--ink);
}

.location-flip-wrap:has(.flipped) .location-back-btn {
  opacity: 1;
  pointer-events: auto;
}

.location-flip-wrap:not(:has(.flipped)) .location-back-btn {
  transition: opacity 0.2s ease 0s;
}

/* Hide front button when flipped */
.location-flip.flipped .location-front .location-toggle {
  opacity: 0;
  pointer-events: none;
}


/* ── FOOTER ── */
.footer {
  text-align: center;
  padding: 2.5rem 0 3rem;
  border-top: 1px solid var(--fog);
}

.footer-names {
  font-family: 'Marck Script', cursive;
  font-size: 1.5rem;
  color: var(--dust);
}

.footer-names span {
  color: var(--rust);
}

.footer-copy {
  font-family: 'Unbounded', sans-serif;
  font-weight: 300;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--ink);
  opacity: 0.4;
  margin-top: 0.3rem;
}

/* ── REVEAL ── */
.reveal {
  opacity: 0;
  transform: translateY(25px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

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

.anim {
  opacity: 0;
  animation: fadeUp 0.8s ease forwards;
}

.anim-d1 {
  animation-delay: 0.15s;
}

.anim-d2 {
  animation-delay: 0.3s;
}

.anim-d3 {
  animation-delay: 0.45s;
}

.anim-d4 {
  animation-delay: 0.6s;
}

.anim-d5 {
  animation-delay: 0.75s;
}

@media (min-width: 768px) {
  .wrapper {
    max-width: 520px;
  }

  .photo-frame {
    width: 240px;
    height: 290px;
  }

  .top-ribbon__line {
    height: 80px;
  }

  .top-ribbon__heart {
    width: 100px;
    height: 86px;
    margin: 0 -30px;
  }
}