@font-face {
  font-family: "Jimmy Script";
  src: url("assets/fonts/JimmyScript-Regular.otf") format("opentype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Agrandir";
  src: url("assets/fonts/Agrandir-Regular.otf") format("opentype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Agrandir";
  src: url("assets/fonts/Agrandir-TextBold.otf") format("opentype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #fbf7f2;
  --bg-soft: #f4ede4;
  --bg-bless: #f6efe8;
  --text: #2e2a26;
  --muted: #6f6862;
  --accent: #8a7a8c;
  --border: #e9ddd3;
  --container: 1120px;
  --narrow: 760px;
  --radius: 12px;
  --font-display: "Jimmy Script", cursive;
  --font-body: "Agrandir", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.78;
}

img {
  width: 100%;
  display: block;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  top: -3rem;
  left: 1rem;
  z-index: 1000;
  background: var(--text);
  color: #fff;
  padding: 0.55rem 0.9rem;
  border-radius: 8px;
}

.skip-link:focus {
  top: 1rem;
}

.music-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 40;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(35, 34, 33, 0.58);
  color: #fff;
  border-radius: 999px;
  width: 42px;
  height: 42px;
  padding: 0;
  font-family: var(--font-body);
  font-size: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(3px);
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.music-toggle:hover {
  transform: translateY(-1px);
  background: rgba(24, 23, 22, 0.68);
}

.music-toggle.is-muted {
  background: rgba(35, 34, 33, 0.58);
  border-color: rgba(255, 255, 255, 0.55);
}

.music-toggle.is-unmuted {
  background: rgba(122, 106, 86, 0.84);
  border-color: rgba(255, 255, 255, 0.68);
}

.music-toggle.is-disabled {
  opacity: 0.75;
  cursor: not-allowed;
}

.music-toggle svg {
  width: 19px;
  height: 19px;
  stroke: #fff;
  stroke-width: 1.9;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.container {
  width: min(var(--container), 92vw);
  margin-inline: auto;
}

.narrow {
  width: min(var(--narrow), 92vw);
  margin-inline: auto;
}

.hero-page {
  overflow-x: hidden;
  background: #e7e8df;
}

.hero {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.hero-page .hero-collage {
  min-height: 145svh;
  isolation: isolate;
}

.hero-page.hero-locked .hero-collage {
  min-height: 100svh;
}

.hero-sticky-wrap {
  position: sticky;
  top: 0;
  height: 100svh;
  display: grid;
  place-items: center;
}

.hero-page .hero-stage {
  position: relative;
  z-index: 2;
  width: min(760px, 94vw);
  height: 100svh;
  margin: 0 auto;
  display: grid;
  place-items: center;
}

.envelope-scene {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  width: min(640px, 94vw);
  min-height: 86svh;
}

.frame-player {
  width: min(500px, 92vw);
  border-radius: 2px;
  position: relative;
  transform-origin: center top;
  will-change: transform, opacity;
  transition: transform 0.2s linear, opacity 0.2s linear;
}

.envelope-scene.sequence-done .frame-player {
  width: min(94vw, 520px);
}

.hero-frame-image {
  width: 100%;
  height: auto;
  display: block;
  opacity: 1;
  user-select: none;
  -webkit-user-drag: none;
}

.open-invitation {
  position: absolute;
  left: 50%;
  top: 58%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
  color: #1f293d;
  text-decoration: none;
  padding: 0.6rem 1rem;
  border: 0;
  border-radius: 999px;
  background: rgba(249, 247, 240, 0.94);
  box-shadow: 0 8px 20px rgba(24, 23, 22, 0.12);
  white-space: nowrap;
  letter-spacing: 0.02em;
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.open-invitation:hover {
  transform: translate(-50%, -50%) translateY(-1px);
}

.envelope-scene.sequence-ready .open-invitation {
  opacity: 1;
  pointer-events: auto;
}

.envelope-scene.sequence-running .open-invitation {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.9);
}

.envelope-scene.sequence-done .open-invitation {
  opacity: 0;
  pointer-events: none;
}

.scroll-hint {
  margin: 0.8rem 0 0;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  color: rgba(31, 41, 61, 0.82);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.envelope-scene.sequence-done .scroll-hint {
  opacity: 1;
  transform: translateY(0);
}

.hero-page.hero-locked {
  overflow: hidden;
  height: 100svh;
}

.invitation-opened #jemputan-content.section {
  padding-top: clamp(1.5rem, 3vw, 2.5rem);
}

.hero-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 5rem 0;
}

.label {
  margin: 0 0 1rem;
  font-size: 0.74rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.center {
  text-align: center;
}

.hero-inner h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 12vw, 5.6rem);
  line-height: 1.02;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.hero-inner h1 span {
  font-size: 0.64em;
  color: var(--accent);
}

.hero-date {
  margin: 1.1rem 0 0;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.hero-line {
  margin: 1rem auto 1.6rem;
  max-width: 34ch;
  color: var(--muted);
}

.section {
  padding: clamp(4.4rem, 8vw, 7rem) 0;
}

.section-plain {
  background: var(--bg);
}

.section-soft {
  background: var(--bg-soft);
}

.title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.15rem);
  font-weight: 400;
  line-height: 1.1;
}

.line {
  border: none;
  border-top: 1px solid var(--border);
  width: min(180px, 40vw);
  margin: 1.3rem auto 1.8rem;
}

.invitation-text {
  margin: 0 auto;
  max-width: 56ch;
  color: var(--text);
}

.couple {
  margin: 1.4rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 6vw, 2.6rem);
  line-height: 1.18;
}

.details-row {
  margin-top: 1.5rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.details-item {
  padding: 1.2rem 0.8rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.details-item:last-child {
  border-bottom: 0;
}

.details-item h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.42rem;
  font-weight: 400;
}

.details-item p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.countdown-wrap {
  margin-top: 1.3rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.count-number {
  text-align: center;
  padding: 0.75rem 0.4rem;
  border-bottom: 1px solid var(--border);
}

.count-number span {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2rem, 10vw, 3.6rem);
  font-weight: 400;
  line-height: 1;
}

.count-number small {
  color: var(--muted);
  letter-spacing: 0.04em;
}

.countdown-status {
  margin: 0.9rem 0 0;
  text-align: center;
  color: var(--muted);
  min-height: 1.3rem;
}

.schedule {
  margin: 1.5rem 0 0;
  padding: 0 0 0 1.15rem;
  list-style: none;
  border-left: 1px solid var(--border);
}

.schedule li {
  position: relative;
  margin-bottom: 1.35rem;
  padding-left: 0.95rem;
}

.schedule li:last-child {
  margin-bottom: 0;
}

.schedule li::before {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  left: -1.46rem;
  top: 0.5rem;
}

.schedule time {
  display: inline-block;
  margin-bottom: 0.2rem;
  font-weight: 700;
}

.schedule p {
  margin: 0;
  color: var(--muted);
}

.location-copy {
  margin-top: 1rem;
}

.location-copy h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 400;
}

.location-copy p {
  margin: 0.5rem 0 1rem;
  color: var(--muted);
}

.map-frame {
  margin-top: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 320px;
}

.map-frame iframe {
  width: 100%;
  height: 100%;
  min-height: 320px;
  border: 0;
}

.contact-text {
  margin: 1rem auto 0;
  max-width: 52ch;
  color: var(--muted);
}

.contact-actions {
  margin-top: 1.25rem;
  display: grid;
  gap: 0.7rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.8rem 1.35rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 0.94rem;
  font-weight: 700;
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-solid {
  background: var(--accent);
  color: #fff;
}

.btn-solid:hover,
.btn-solid:focus-visible {
  background: #78697a;
}

.btn-outline {
  border-color: var(--border);
  color: var(--text);
  background: transparent;
}

.btn-outline:hover,
.btn-outline:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.contact-note {
  display: inline-block;
  margin-top: 1.2rem;
  color: var(--muted);
}

[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 760px) {
  .details-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .details-item {
    border-bottom: 0;
    border-right: 1px solid var(--border);
  }

  .details-item:last-child {
    border-right: 0;
  }

  .countdown-wrap {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .contact-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .hero-page .hero-stage {
    width: 100vw;
  }

  .envelope-scene {
    width: min(470px, 93vw);
    gap: 0.9rem;
  }

  .frame-player {
    width: min(430px, 92vw);
  }

  .open-invitation {
    font-size: 0.86rem;
    top: 58%;
    padding: 0.56rem 0.92rem;
  }
}

@media (max-width: 460px) {
  .music-toggle {
    top: 0.75rem;
    right: 0.75rem;
    width: 40px;
    height: 40px;
  }

  .frame-player {
    width: min(398px, 92vw);
  }

  .open-invitation {
    font-size: 0.82rem;
    padding: 0.5rem 0.84rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
