/* =====================================================
   TEMA 1 — MINIMALIST EARTHY
   ===================================================== */

:root {
  --cream: #F8F4ED;
  --paper: #FDFBF8;
  --sand: #E4D5C3;
  --beige: #CDB9A2;
  --earthy: #9A7657;
  --terracotta: #B56F55;
  --olive: #74785F;
  --brown: #554236;
  --ink: #302A26;
  --gold: #B49A6C;
  --mobile-nav-height: 62px;
}

/* =====================================================
   GLOBAL
   ===================================================== */

html {
  scroll-behavior: smooth;
  scroll-padding-top: 20px;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: Inter, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.locked {
  overflow: hidden;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.serif {
  font-family: "Cormorant Garamond", serif;
}

/* =====================================================
   COVER
   ===================================================== */

#cover {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--brown);
  color: white;
  transition: opacity 1s ease, visibility 1s ease;
}

#cover.hide {
  opacity: 0;
  visibility: hidden;
}

.cover-inner {
  min-height: 100svh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.cover-monogram {
  position: relative;
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
}

.cover-monogram::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
}

/* =====================================================
   REVEAL
   ===================================================== */

.reveal {
  opacity: 0;
  transform: translateY(25px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.show {
  opacity: 1;
  transform: translateY(0);
}

/* =====================================================
   MONOGRAM
   ===================================================== */

.monogram {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(180, 154, 108, 0.6);
  border-radius: 50%;
  color: var(--earthy);
  font-family: "Cormorant Garamond", serif;
  font-size: 17px;
}

/* =====================================================
   DECORATIVE LINE
   ===================================================== */

.line {
  width: 45px;
  height: 1px;
  background: var(--gold);
}

/* =====================================================
   IMAGE FRAME
   ===================================================== */

.image-frame {
  position: relative;
}

.image-frame::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(180, 154, 108, 0.55);
  pointer-events: none;
}

.hero-photo {
  position: relative;
}

/* =====================================================
   EVENT CARD
   ===================================================== */

.event-card {
  position: relative;
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid #E3D7C9;
}

.event-card::before {
  content: "";
  position: absolute;
  top: 18px;
  left: 18px;
  width: 18px;
  height: 18px;
  border-top: 1px solid var(--gold);
  border-left: 1px solid var(--gold);
}

/* =====================================================
   GALLERY
   ===================================================== */

.gallery-item {
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  transition: transform 0.6s ease;
}

.gallery-item:hover img {
  transform: scale(1.04);
}

/* =====================================================
   INPUT
   ===================================================== */

.input {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 13px 14px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid #DED1C2;
  border-radius: 0;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  transition: 0.25s;
}

textarea.input {
  min-height: 130px;
  resize: none;
}

.input:focus {
  border-color: var(--earthy);
  box-shadow: 0 0 0 3px rgba(154, 118, 87, 0.08);
}

/* =====================================================
   RSVP FORM
   ===================================================== */

.rsvp-form {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.rsvp-form > * {
  max-width: 100%;
  min-width: 0;
}

.rsvp-form input,
.rsvp-form select,
.rsvp-form textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

/* =====================================================
   WISH CAROUSEL
   ===================================================== */

#wishViewport {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
  touch-action: pan-y;
}

#wishList {
  display: flex;
  width: 100%;
  min-width: 0;
  gap: 16px;
  transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: transform;
}

.wish-card {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  min-height: 170px;
  overflow: hidden;
  box-sizing: border-box;
}

.wish-card > * {
  max-width: 100%;
  min-width: 0;
}

.wish-card-text {
  width: 100%;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  display: -webkit-box;
  overflow: hidden;
  line-clamp: 4;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

.wish-card strong {
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wish-dot {
  width: 6px;
  height: 6px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #D8C7B4;
  transition: all 0.3s ease;
}

.wish-dot.active {
  width: 20px;
  background: var(--earthy);
}

.wish-nav {
  flex-shrink: 0;
  transition: all 0.25s ease;
}

.wish-nav:hover {
  color: white;
  background: var(--brown);
}

/* =====================================================
   LIGHTBOX
   ===================================================== */

#lightbox {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
}

#lightbox.show {
  opacity: 1;
  visibility: visible;
}

#lightboxImg {
  max-width: 100%;
  max-height: 82vh;
  object-fit: contain;
}

/* =====================================================
   MUSIC
   ===================================================== */

#musicBtn {
  bottom: calc(var(--mobile-nav-height) + 14px);
  transition: bottom 0.3s ease;
}

#musicBtn.playing .disc {
  animation: rotateDisc 4s linear infinite;
}

@keyframes rotateDisc {
  to {
    transform: rotate(360deg);
  }
}

/* =====================================================
   TOAST
   ===================================================== */

#toast {
  opacity: 0;
  transform: translate(-50%, 15px);
  transition: 0.3s;
  pointer-events: none;
}

#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* =====================================================
   MOBILE NAV
   ===================================================== */

.mobile-nav {
  height: var(--mobile-nav-height);
  padding-bottom: env(safe-area-inset-bottom);
}

/* =====================================================
   BACKGROUND INITIAL ORNAMENT
   ===================================================== */

.initial-bg {
  position: relative;
  overflow: hidden;
}

.initial-bg::before,
.initial-bg::after {
  content: "A&R";
  position: absolute;
  z-index: 0;
  pointer-events: none;
  color: rgba(138, 115, 88, 0.045);
  font-family: "Cormorant Garamond", serif;
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 1;
  white-space: nowrap;
}

.initial-bg::before {
  top: 8%;
  left: -18px;
  font-size: clamp(90px, 16vw, 155px);
  transform: rotate(-7deg);
}

.initial-bg::after {
  right: -22px;
  bottom: 8%;
  font-size: clamp(80px, 15vw, 145px);
  transform: rotate(7deg);
}

.initial-bg > * {
  position: relative;
  z-index: 1;
}

/* =====================================================
   LUCIDE
   ===================================================== */

[data-lucide] {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  stroke-width: 1.5;
}

/* =====================================================
   MOBILE
   ===================================================== */

@media (max-width: 767px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body {
    position: relative;
  }

  main,
  section,
  footer {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  /* Cover */
  .cover-monogram {
    width: 62px;
    height: 62px;
  }

  .cover-title {
    font-size: clamp(64px, 20vw, 88px);
  }

  /* Home */
  #home {
    width: 100%;
    max-width: 100%;
    min-height: auto;
    padding-top: 90px;
    padding-bottom: 70px;
  }

  #home > div {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  /* Monogram mobile: tetap bulat dan tengah */
  #home > .monogram {
    position: absolute;
    top: 28px;
    left: 50%;
    right: auto;
    z-index: 20;
    width: 52px;
    height: 52px;
    min-width: 52px;
    min-height: 52px;
    max-width: 52px;
    max-height: 52px;
    border-radius: 50%;
    transform: translateX(-50%);
  }

  .hero-title {
    max-width: 100%;
    font-size: clamp(64px, 22vw, 94px);
    line-height: 0.72;
    letter-spacing: -0.025em;
  }

  .hero-title span {
    font-size: clamp(38px, 12vw, 52px);
  }

  .hero-description {
    width: 100%;
    max-width: 100%;
    font-size: 13px;
    line-height: 1.8;
    overflow-wrap: break-word;
  }

  .hero-photo {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .hero-photo img {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
  }

  /* Intro */
  .intro-section {
    width: 100%;
    padding-top: 80px;
    padding-bottom: 80px;
  }

  .intro-title {
    max-width: 100%;
    font-size: clamp(42px, 13vw, 60px);
    line-height: 0.92;
  }

  /* Countdown */
  .countdown-section {
    width: 100%;
    padding-top: 60px;
    padding-bottom: 60px;
  }

  .countdown-title {
    max-width: 100%;
    font-size: clamp(42px, 13vw, 58px);
  }

  .countdown-box {
    width: 100%;
    min-width: 0;
    padding-top: 20px;
    padding-bottom: 20px;
  }

  .countdown-number {
    font-size: clamp(34px, 10vw, 50px);
  }

  /* Story */
  .story-section {
    width: 100%;
    padding-top: 80px;
    padding-bottom: 80px;
  }

  .story-number {
    font-size: 76px;
  }

  .story-title {
    max-width: 100%;
    font-size: clamp(48px, 15vw, 70px);
  }

  .story-quote {
    max-width: 100%;
    font-size: 28px;
    line-height: 1.15;
    overflow-wrap: break-word;
  }

  .story-images {
    width: 100%;
    max-width: 100%;
    gap: 8px;
    margin-top: 50px;
  }

  .story-images > div {
    min-width: 0;
    max-width: 100%;
  }

  .story-images img {
    width: 100%;
    max-width: 100%;
    margin-top: 20px;
  }

  /* Quote */
  .quote-section {
    width: 100%;
  }

  /* Event */
  .event-section {
    width: 100%;
    padding-top: 80px;
    padding-bottom: 80px;
  }

  .event-title {
    max-width: 100%;
    font-size: clamp(48px, 15vw, 70px);
  }

  .event-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 28px 22px;
    overflow: hidden;
  }

  .event-card > * {
    max-width: 100%;
    min-width: 0;
  }

  /* Gallery */
  .gallery-section {
    width: 100%;
    padding-top: 80px;
    padding-bottom: 80px;
  }

  .gallery-title {
    max-width: 100%;
    font-size: clamp(48px, 15vw, 70px);
  }

  .gallery-grid {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .gallery-item {
    min-width: 0;
    max-width: 100%;
  }

  /* RSVP */
  .rsvp-section {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding-top: 80px;
    padding-bottom: 100px;
    overflow-x: hidden;
  }

  .rsvp-section > div {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .rsvp-section > div > * {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .rsvp-title {
    max-width: 100%;
    font-size: clamp(48px, 15vw, 70px);
  }

  .rsvp-form {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 24px;
    overflow: hidden;
  }

  .rsvp-form * {
    box-sizing: border-box;
  }

  .rsvp-form input,
  .rsvp-form select,
  .rsvp-form textarea {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .rsvp-form .grid {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-left: 0;
    margin-right: 0;
  }

  .rsvp-form .grid > div {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .rsvp-form-title {
    max-width: 100%;
    overflow-wrap: break-word;
  }

  /* Wish carousel */
  #wishViewport {
    display: block;
    position: relative;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    box-sizing: border-box;
  }

  #wishList {
    display: flex;
    width: 100%;
    min-width: 0;
    max-width: none;
    gap: 16px;
    margin: 0;
    padding: 0;
  }

  .wish-card {
    flex: 0 0 100%;
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    min-height: 170px;
    padding: 18px;
    box-sizing: border-box;
    overflow: hidden;
  }

  .wish-card > div {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .wish-card strong {
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .wish-card-text {
    display: -webkit-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    line-clamp: 4;
    overflow-wrap: anywhere;
    word-break: break-word;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
  }

  #wishPrev,
  #wishNext {
    width: 36px;
    height: 36px;
    min-width: 36px;
    max-width: 36px;
    flex-shrink: 0;
  }

  #wishDots {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  /* Gift */
  .gift-section {
    width: 100%;
    padding-top: 80px;
    padding-bottom: 90px;
  }

  .gift-section > div {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .gift-section article {
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  /* Footer */
  footer {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  /* Music */
  #musicBtn {
    right: 16px;
    bottom: calc(var(--mobile-nav-height) + 14px);
  }

  /* Mobile nav */
  .mobile-nav {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .mobile-nav a {
    min-width: 0;
    max-width: 100%;
    font-size: 7px;
  }

  /* Background initials */
  .initial-bg::before {
    top: 7%;
    left: -28px;
    font-size: 92px;
  }

  .initial-bg::after {
    right: -28px;
    bottom: 7%;
    font-size: 82px;
  }
}

/* =====================================================
   VERY SMALL PHONE
   ===================================================== */

@media (max-width: 374px) {
  #home > .monogram {
    left: 50%;
    right: auto;
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    max-width: 48px;
    max-height: 48px;
    transform: translateX(-50%);
  }

  .hero-title {
    font-size: 61px;
  }

  .hero-title span {
    font-size: 35px;
  }

  .monogram {
    width: 46px;
    height: 46px;
    font-size: 15px;
  }

  .countdown-number {
    font-size: 30px;
  }

  .countdown-label {
    font-size: 7px;
  }

  .event-card {
    padding: 28px 18px;
  }

  .wish-card {
    padding: 18px;
  }

  .rsvp-form {
    padding: 20px 16px;
  }

  .mobile-nav a {
    font-size: 7px;
  }
}

/* =====================================================
   LANDSCAPE PHONE
   ===================================================== */

@media (max-width: 767px) and (orientation: landscape) {
  #home {
    padding-top: 70px;
  }

  .hero-photo img {
    aspect-ratio: 16 / 10;
  }

  .cover-inner {
    padding: 20px;
  }
}

/* =====================================================
   REDUCED MOTION
   ===================================================== */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}