/* ==========================================================
   Wedding invitation cover — mobile first
   Image files expected in /images :
     couple.jpg     (background photo)
     corner.png     (ornament, top-left version, transparent)
     monogram.png   (oval frame + monogram, transparent)
   ========================================================== */

:root {
  --cream: #fffcf3;
  /* BACKGROUND COLOR: change these two together (same color, hex and rgb) */
  --paper: #d8d2b6;
  --veil-rgb: 216, 210, 182;
  --gold: #b8935a;
  --gold-dark: #7d5b2a;
  --gold-gradient: linear-gradient(
    105deg,
    #8a6128 0%,
    #c19a5b 25%,
    #f4e2a8 45%,
    #c19a5b 60%,
    #8a6128 100%
  );
  --ease: cubic-bezier(0.22, 0.72, 0.18, 1);

  /* quick tuning knobs */
  /* --title-width: min(84vw, 410px); */
  --title-width: min(84vw, 410px, 40svh * 2.7);
  --corner-width: 38%;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: #c4bd9d;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  justify-content: center;
  font-family: "Noto Serif Khmer", serif;
  color: var(--gold);
  -webkit-font-smoothing: antialiased;
}

/* ---------- The cover (phone-sized, centered on desktop) ---------- */

.cover {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;  /* fallback */
  overflow-x: clip;
  background: var(--paper);
  box-shadow: 0 0 60px rgba(90, 70, 30, 0.18);
}

/* ---------- Background photo + cream veil ---------- */

.bg {
  position: absolute;
  inset: 0;
  z-index: -3;
  background: url("images/couple.jpg") center / cover no-repeat;
  animation: bgIn 2.4s ease both, drift 20s ease-out both;
}

.veil {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: linear-gradient(
    180deg,
    rgba(var(--veil-rgb), 0.82),
    rgba(var(--veil-rgb), 0.72) 55%,
    rgba(var(--veil-rgb), 0.84)
  );
}

/* ---------- Corner ornaments ---------- */
/* The corner itself is flipped; the ::before inside is animated. */

/* fixed layer above everything (same size/position as the .stage) */
.frame {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100%;
  max-width: 480px;
  transform: translateX(-50%);
  pointer-events: none; /* taps go through to buttons underneath */
  z-index: 100;         /* higher than every other layer */
}

.corner {
  position: absolute;
  width: var(--corner-width);
  aspect-ratio: 4 / 5;
  pointer-events: none;
}

.corner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("images/corner.png") top left / contain no-repeat;
  transform-origin: top left;
  animation: cornerIn 1.8s var(--ease) 0.2s both,
             sway 8s ease-in-out 2.2s infinite;
}

.corner--tl { top: 0;    left: 0; }
.corner--tr { top: 0;    right: 0;  transform: scaleX(-1); }
.corner--bl { bottom: 0; left: 0;   transform: scaleY(-1); }
.corner--br { bottom: 0; right: 0;  transform: scale(-1, -1); }

.corner--tr::before { animation-delay: 0.35s, 2.4s; }
.corner--bl::before { animation-delay: 0.5s, 2.6s; }
.corner--br::before { animation-delay: 0.65s, 2.8s; }

/* ---------- Gold dust ---------- */

.sparkles {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.sparkles span {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  background: radial-gradient(
    circle,
    #fffbe6 0 25%,
    rgba(235, 200, 120, 0.9) 45%,
    transparent 72%
  );
  opacity: 0;
  animation: twinkle var(--t) ease-in-out var(--d) infinite;
}

/* ---------- Content column ---------- */

.content {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2.2svh, 26px);
  padding: 6svh 6vw;
  text-align: center;
}

/* Title: image lettering, "written" in, then a light sweep passes over it */

.title__art {
  position: relative;
  margin: 0;
  width: var(--title-width);
  filter: drop-shadow(0 4px 8px rgba(90, 70, 20, 0.25));
  animation: titleReveal 2s var(--ease) 0.9s both;
}

.title__art img {
  display: block;
  width: 100%;
  height: auto;
}

/* light sweep, shaped by the title image itself */
.title__art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 42%,
    rgba(255, 255, 255, 0.9) 50%,
    transparent 58%
  );
  background-size: 300% 100%;
  background-position: 100% 0;
  -webkit-mask: url("images/title.png") center / 100% 100% no-repeat;
  mask: url("images/title.png") center / 100% 100% no-repeat;
  animation: sheen 6s linear 3.4s infinite;
}

/* Monogram */

.monogram {
  height: min(28svh, 66vw);
  aspect-ratio: 700 / 500;
  margin-top: -55px; /* move up: more negative = higher */
  background: url("images/monogram.png") center / contain no-repeat;
  animation: monoIn 1.6s var(--ease) 1.8s both,
             glow 4.5s ease-in-out 3.6s infinite;
}

/* Guest area */

.guest {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(8px, 1.4svh, 14px);
}

.label {
  margin: 0;
  font-weight: 700;
  font-size: clamp(18px, 5.2vw, 24px);
  line-height: 1.8;
  color: var(--gold);
  text-shadow: 0 1px 0 rgba(125, 91, 42, 0.35);
  animation: fadeUp 1s var(--ease) 2.8s both;
}

.name-box {
  width: min(63vw, 300px);
  min-height: 56px;
  padding: 10px 14px;
  display: grid;
  place-items: center;
  background: var(--cream);
  border: 2px solid var(--gold);
  box-shadow: inset 0 0 0 4px var(--cream),
              inset 0 0 0 5px var(--gold),
              0 8px 22px rgba(120, 90, 40, 0.15);
  animation: boxIn 1.4s var(--ease) 2.9s both;
}

.name-box span {
  display: block;
  font-weight: 700;
  font-size: clamp(11px, 4.6vw, 15px);
  line-height: 1.7;
  color: var(--gold);
  overflow-wrap: anywhere;
  animation: fadeUp 1s var(--ease) 3.6s both;
}

/* Open button */

.open {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  margin-top: 4px;
  font: inherit;
  color: var(--gold);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  -webkit-tap-highlight-color: transparent;
  animation: fadeUp 1s var(--ease) 3.9s both;
}

.open__label {
  font-weight: 700;
  font-size: clamp(14px, 4vw, 17px);
  line-height: 1.8;
  text-shadow: 0 1px 0 rgba(125, 91, 42, 0.3);
}

.open__icon {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: var(--cream);
  display: grid;
  place-items: center;
  transition: transform 0.35s var(--ease);
}

/* play triangle */
.open__icon::before {
  content: "";
  margin-left: 4px;
  border-left: 15px solid var(--gold);
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
}

/* pulsing ring */
.open__icon::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  animation: ring 2.4s ease-out 4.6s infinite;
}

.open:hover .open__icon { transform: scale(1.08); }
.open:active .open__icon { transform: scale(0.94); }

.open:focus-visible {
  outline: 2px solid var(--gold-dark);
  outline-offset: 8px;
  border-radius: 12px;
}

/* ==========================================================
   Keyframes
   ========================================================== */

@keyframes bgIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes drift {
  from { transform: scale(1.18); }
  to   { transform: scale(1.04); }
}

@keyframes cornerIn {
  from { opacity: 0; transform: scale(0.7) rotate(-6deg); }
  to   { opacity: 1; transform: none; }
}

@keyframes sway {
  0%, 100% { transform: rotate(0) scale(1); }
  50%      { transform: rotate(1.2deg) scale(1.025); }
}

@keyframes twinkle {
  0%, 100% { opacity: 0; transform: translateY(0) scale(0.4); }
  50%      { opacity: 1; transform: translateY(-14px) scale(1); }
}

@keyframes titleReveal {
  from {
    opacity: 0;
    transform: translateY(14px);
    clip-path: inset(-40% 100% -40% 0);
    filter: blur(6px) drop-shadow(0 4px 8px rgba(90, 70, 20, 0.25));
  }
  to {
    opacity: 1;
    transform: none;
    clip-path: inset(-40% -10% -40% -10%);
    filter: blur(0) drop-shadow(0 4px 8px rgba(90, 70, 20, 0.25));
  }
}

@keyframes sheen {
  0%   { background-position: 100% 0; }
  45%  { background-position: 0% 0; }
  100% { background-position: 0% 0; }
}

@keyframes monoIn {
  from { opacity: 0; transform: scale(0.82) translateY(10px); }
  to   { opacity: 1; transform: none; }
}

@keyframes glow {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(214, 174, 100, 0.25)); }
  50%      { filter: drop-shadow(0 0 16px rgba(230, 190, 110, 0.75)); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

@keyframes boxIn {
  from { opacity: 0; clip-path: inset(-30px 50% -30px 50%); }
  to   { opacity: 1; clip-path: inset(-30px -30px -30px -30px); }
}

@keyframes ring {
  from { transform: scale(1);   opacity: 0.7; }
  to   { transform: scale(1.9); opacity: 0; }
}

/* ==========================================================
   Opening transition (cover -> photo page)
   JS adds the class "is-open" to .cover when the button is tapped.
   ========================================================== */

/* date line under the title: hidden until opened */
.title { position: relative; }

.date-line {
  position: absolute;
  left: 0;
  right: 0;
  /* title.png is square with empty space; the lettering ends at ~64% of its height */
  top: 65%;                /* bigger % = lower */
  margin: 0;
  padding-left: 12%;       /* centers it under the 2nd line of the title */
  display: flex;
  justify-content: center;
  gap: 0.5em;
  font-weight: 700;
  font-size: clamp(15px, 4.3vw, 19px);
  line-height: 1.8;
  color: #f1d995;
  text-shadow: 0 1px 3px rgba(50, 32, 8, 0.75);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.date-line i {
  font-style: normal;
  opacity: 0.8;
}

/* 1. cream veil melts away -> the photo shows in full color */
.veil {
  transition: opacity 1.8s ease 0.2s;
}

.is-open .veil {
  opacity: 0;
}

/* 1b. background photo zooms in slowly.
   Uses the separate "scale" property so it adds on top of the
   running "drift" animation instead of making it jump. */
.bg {
  transform-origin: 47% 90%;  /* zoom point: 1st = left/right (couple's center), 2nd = up/down (their feet) */
  transition: scale 3.5s var(--ease);
}

.is-open .bg {
  scale: 1.2;                 /* bigger number = stronger zoom */
}

/* 2. cover items float up and fade out (they keep their space, so the title stays put) */
.is-open .monogram { animation: leave 0.9s var(--ease) both; }
.is-open .guest    { animation: leave 0.9s var(--ease) 0.1s both; }
.is-open .open     { animation: leave 0.7s var(--ease) both; pointer-events: none; }

/* 3. the title fades and is written again */
.is-open .title__art {
  animation: titleRewrite 2.2s var(--ease) 0.5s both;
}

/* 4. the date line appears under the title */
.is-open .date-line {
  visibility: visible;
  animation: fadeUp 1.2s var(--ease) 1.9s both;
}

@keyframes leave {
  to {
    opacity: 0;
    transform: translateY(-14px) scale(0.96);
    visibility: hidden;
  }
}

@keyframes titleRewrite {
  0%   { opacity: 1; clip-path: inset(-40% -10% -40% -10%); }
  15%  { opacity: 0; clip-path: inset(-40% -10% -40% -10%); }
  16%  { opacity: 0; clip-path: inset(-40% 100% -40% 0); }
  100% { opacity: 1; clip-path: inset(-40% -10% -40% -10%); }
}

/* ==========================================================
   Scrolling story (appears automatically after the photo screen)
   ========================================================== */

:root {
  --ink: #f6efd9;
  --gold-light: #f1d995;
}

[hidden] { display: none !important; }

/* Background layers live in a fixed "stage": they stay still while the page scrolls */
.stage {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100%;
  max-width: 480px;
  transform: translateX(-50%);
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

/* dark green-grey tint so the light text is easy to read */
.shade {
  position: absolute;
  inset: 0;
  z-index: -2;
  opacity: 0;
  background: linear-gradient(
    180deg,
    rgba(26, 32, 22, 0.66),
    rgba(32, 38, 26, 0.6) 50%,
    rgba(22, 28, 18, 0.74)
  );
  transition: opacity 1.8s ease;
}

.bg { transition: scale 3.5s var(--ease), filter 1.8s ease; }

.is-story .shade { opacity: 1; }
.is-story .bg    { filter: blur(2px); }

/* the cover/photo screen floats away */
.is-story .content { animation: introOut 1s var(--ease) both; }

@keyframes introOut {
  to { opacity: 0; transform: translateY(-24px); }
}

.story {
  position: relative;
  z-index: 1;
  color: var(--ink);
}

.sec {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 9svh 7vw;
  text-align: center;
}

.sec--gallery { min-height: 0; }

/* program: no full-screen height and less space on top */
.sec--program {
  min-height: 0;
  padding-top: 3svh; /* space above the title: smaller = closer to the photos */
}

.sec-title,
.honor {
  margin: 0;
  font: 400 clamp(21px, 6.4vw, 28px) / 1.9 "Moul", "Noto Serif Khmer", serif;
  color: var(--gold-light);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
}

.honor { font-size: clamp(16px, 4.6vw, 20px); margin-top: 6px; }

.lead {
  margin: 0;
  font-size: clamp(14px, 3.9vw, 16px);
  line-height: 1.95;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

/* ---------- scroll reveal (JS adds .in when an item enters the screen) ---------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1s var(--ease), transform 1.1s var(--ease);
  transition-delay: calc(var(--i, 0) * 0.14s);
}
[data-reveal="zoom"]  { transform: scale(0.82); }
[data-reveal="left"]  { transform: translateX(-34px); }
[data-reveal="right"] { transform: translateX(34px); }
[data-reveal="none"]  { opacity: 1; transform: none; transition: none; }
[data-reveal].in      { opacity: 1; transform: none; }

/* title is "written" from left to right */
/* The clip goes on the image inside, not the box itself:
   a fully clipped box counts as "0% visible", so it would never be revealed. */
[data-reveal="write"] {
  transform: none;
  transition: opacity 0.6s ease 0.2s;
}
[data-reveal="write"] > img {
  clip-path: inset(-40% 100% -40% 0);
  transition: clip-path 2s var(--ease) 0.2s;
}
[data-reveal="write"].in > img { clip-path: inset(-40% -10% -40% -10%); }

/* ---------- 1. Invitation ---------- */

.story-title {
  margin: 0;
  margin-top: 65px;
  margin-bottom: 25px;
  width: min(76vw, 380px);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}
.story-title img {
  display: block;
  width: 100%;
  height: auto;
  /* title.png is square with empty space above/below the lettering: show only the lettering */
  aspect-ratio: 1080 / 380;
  object-fit: cover;
  object-position: 50% 47%;
}

.families,
.couple {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  width: 100%;
}

.family p { margin: 0 0 8px; line-height: 1.7; }

.family small,
.couple small {
  display: block;
  font-size: 15px;
  line-height: 1.7;
  color: var(--gold-light);
}

.family b,
.couple b {
  display: block;
  font-weight: 800;
  font-size: clamp(17px, 4vw, 19px);
  line-height: 1.8;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.story-mono {
  height: min(24svh, 52vw);
  aspect-ratio: 700 / 500;
  background: url("images/monogram.png") center / contain no-repeat;
}
.story-mono.in { animation: glow 4.5s ease-in-out 1.2s infinite; }

/* little arrow that invites the guest to scroll */
.hint {
  width: 16px;
  height: 16px;
  margin-top: 10px;
  border-right: 2px solid var(--gold-light);
  border-bottom: 2px solid var(--gold-light);
  transform: rotate(45deg);
  animation: hint 1.7s ease-in-out infinite;
}

@keyframes hint {
  0%, 100% { transform: translateY(0) rotate(45deg);   opacity: 0.25; }
  50%      { transform: translateY(9px) rotate(45deg); opacity: 1; }
}

/* gold line + diamond under each heading */
.divider {
  position: relative;
  width: min(60%, 200px);
  height: 14px;
  margin: 2px auto 14px;
}
.divider::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-light), transparent);
  transform: scaleX(0);
  transition: transform 1.4s var(--ease);
}
.divider::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  background: var(--gold-light);
  transform: rotate(45deg) scale(0);
  transition: transform 0.8s var(--ease) 0.6s;
}
.divider.in::before { transform: scaleX(1); }
.divider.in::after  { transform: rotate(45deg) scale(1); }

/* ---------- 2. Gallery ---------- */

.gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  margin-top: 6px;
}

.tile {
  margin: 0;
  border: 5px solid #fffdf6;
  background: #fffdf6;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.4);
  aspect-ratio: 2 / 3;
  overflow: hidden;
}
.tile--wide { grid-column: span 2; aspect-ratio: 3 / 2; }
.tile--sq   { aspect-ratio: 1 / 1; }
.tile img   { display: block; width: 100%; height: 100%; object-fit: cover; }

/* one tall photo beside two stacked ones */
.mosaic {
  grid-column: span 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.mosaic .tile { aspect-ratio: 4 / 3; }
.mosaic .tile--tall { grid-row: 1 / span 2; aspect-ratio: auto; }

/* photos fly in with a little tilt, then settle and slowly "breathe" */
.tile[data-reveal]            { transform: translateY(46px) scale(0.88); }
.tile[data-reveal="left"]     { transform: translateX(-40px) rotate(-4deg) scale(0.9); }
.tile[data-reveal="right"]    { transform: translateX(40px) rotate(4deg) scale(0.9); }
.tile.in                      { transform: rotate(var(--r, 0deg)); }
.tile.in img                  { animation: tileDrift 14s ease-in-out 1s infinite alternate; }

@keyframes tileDrift {
  from { transform: scale(1); }
  to   { transform: scale(1.08); }
}

/* ---------- 3. Program ---------- */

.timeline {
  position: relative;
  display: grid;
  gap: 24px;
  width: 100%;
  margin-top: 8px;
}

/* the gold line draws itself downward */
.timeline::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: calc(38% + 11px);
  width: 2px;
  background: linear-gradient(var(--gold-light), rgba(241, 217, 149, 0.25));
  transform-origin: top;
  transform: scaleY(0);
  transition: transform 2.2s var(--ease) 0.3s;
}
.timeline.in::before { transform: scaleY(1); }

.t-row { display: flex; align-items: center; text-align: left; }

.t-row time {
  flex: 0 0 38%;
  padding-right: 14px;
  text-align: right;
  font-weight: 700;
  font-size: clamp(12px, 3.5vw, 14px);
  line-height: 1.7;
  color: var(--gold-light);
}

.t-row .dot { position: relative; flex: 0 0 24px; height: 24px; }
.t-row .dot::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  margin: -6px;
  border-radius: 50%;
  background: var(--gold-light);
  box-shadow: 0 0 0 4px rgba(241, 217, 149, 0.25);
}
.t-row .dot::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  border: 1px solid var(--gold-light);
  animation: ring 2.4s ease-out infinite;
}

.t-row p {
  margin: 0;
  padding-left: 14px;
  font-size: clamp(13px, 3.8vw, 15px);
  line-height: 1.8;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

/* ---------- 4. Location ---------- */

.mapcard {
  position: relative;
  width: min(100%, 340px);
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 2px solid var(--gold-light);
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 55%, rgba(241, 217, 149, 0.22), transparent 60%),
    repeating-linear-gradient(0deg,  transparent 0 29px, rgba(241, 217, 149, 0.14) 29px 30px),
    repeating-linear-gradient(90deg, transparent 0 29px, rgba(241, 217, 149, 0.14) 29px 30px),
    rgba(20, 26, 16, 0.45);
  box-shadow: 0 0 0 5px rgba(241, 217, 149, 0.12), 0 14px 30px rgba(0, 0, 0, 0.4);
}

/* real Google map fills the gold-framed card */
.mapcard iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.pin {
  width: 46px;
  height: 46px;
  color: var(--gold-light);
  filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.5));
  animation: pinBounce 2.2s ease-in-out infinite;
}
.pin svg { display: block; width: 100%; height: 100%; fill: currentColor; }

@keyframes pinBounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
@keyframes ripple {
  from { transform: scale(0.4); opacity: 0.9; }
  to   { transform: scale(2.6); opacity: 0; }
}

.btn {
  display: inline-block;
  padding: 10px 22px;
  border: 1.5px solid var(--gold-light);
  border-radius: 999px;
  color: #2b2414;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.8;
  text-decoration: none;
  background: linear-gradient(120deg, #e9c97c, #f8e8b4 50%, #e9c97c);
  background-size: 200% 100%;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
  animation: btnShine 3.5s linear infinite;
}
@keyframes btnShine { to { background-position: 200% 0; } }

/* ---------- 5. Countdown + thanks ---------- */

.count {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  width: 100%;
  max-width: 340px;
}
.count > div {
  padding: 12px 4px 8px;
  border: 1px solid rgba(241, 217, 149, 0.6);
  border-radius: 10px;
  background: rgba(20, 26, 16, 0.4);
}
.count b {
  display: block;
  font: 400 clamp(20px, 6vw, 26px) / 1.6 "Moul", "Noto Serif Khmer", serif;
  color: var(--gold-light);
}
.count span { font-size: 12px; line-height: 1.7; }

/* ---------- 6. Credits ---------- */
/* spacing is set per group with margin-top (gap is 0) */

.sec--credit {
  gap: 0;
  padding-bottom: 14svh; /* room so the bottom corners don't cover the QR code */
}

/* small label with gold lines on both sides:  ── បង្កើតដោយ ── */
.credit-by {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(12px, 3.4vw, 14px);
  line-height: 1.8;
  letter-spacing: 0.08em;
  color: var(--gold-light);
  opacity: 0.85;
}
.credit-by::before,
.credit-by::after {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

/* the name: biggest item */
.credit-name {
  margin: 4px 0 0;
  font: 400 clamp(24px, 7.4vw, 32px) / 1.9 "Moul", "Noto Serif Khmer", serif;
  color: var(--gold-light);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}
.credit-name span {
  display: block;
  margin-top: -2px;
  font: 600 clamp(11px, 3vw, 13px) / 1.4 "Noto Serif Khmer", serif;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.75;
}

/* short gold line with a dot in the middle */
.credit-line {
  position: relative;
  width: 120px;
  height: 1px;
  margin-top: 18px;
  background: linear-gradient(90deg, transparent, var(--gold-light), transparent);
}
.credit-line::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  background: var(--gold-light);
  transform: translate(-50%, -50%) rotate(45deg);
}

.credit-text {
  margin: 18px 0 0;
  font-size: clamp(13px, 3.6vw, 15px);
  line-height: 1.9;
  opacity: 0.88;
}

.social {
  display: flex;
  gap: 20px;
  margin-top: 24px;
}
.social a {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--gold-light);
  border-radius: 50%;
  color: var(--gold-light);
  background: rgba(0, 0, 0, 0.18);
  transition: transform 0.3s var(--ease), background 0.3s;
}
.social a:hover,
.social a:active { transform: scale(1.1); background: rgba(241, 217, 149, 0.18); }
.social svg { width: 20px; height: 20px; fill: currentColor; }

/* phone numbers: grouped tightly */
.credit-contact {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 20px;
}
.credit-phone {
  font-size: clamp(14px, 4vw, 16px);
  line-height: 1.7;
  letter-spacing: 0.06em;
  color: var(--ink);
  text-decoration: none;
}
.credit-phone small {
  margin-left: 4px;
  padding: 1px 7px;
  font-size: 10px;
  letter-spacing: 0.08em;
  vertical-align: 2px;
  color: var(--gold-light);
  border: 1px solid rgba(241, 217, 149, 0.6);
  border-radius: 20px;
}

.credit-qr {
  width: 108px;
  height: auto;
  margin-top: 22px;
  padding: 5px;
  /* background: #fff; */
  border-radius: 6px;
  box-shadow: 0 0 0 2px var(--gold-light), 0 10px 24px rgba(0, 0, 0, 0.45);
}

/* ---------- Music button ---------- */

.music {
  position: fixed;
  bottom: 16px;
  right: max(14px, calc(50% - 226px));
  z-index: 5;
  width: 44px;
  height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--gold-light);
  border-radius: 50%;
  background: rgba(20, 26, 16, 0.6);
  color: var(--gold-light);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  animation: fadeUp 1s var(--ease) 0.6s both;
}
.music svg { width: 22px; height: 22px; fill: currentColor; }
.music.is-playing svg { animation: spin 4s linear infinite; }
.music:not(.is-playing)::after {
  content: "";
  position: absolute;
  width: 26px;
  height: 2px;
  background: currentColor;
  transform: rotate(-45deg);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Respect "reduce motion" ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
}
@media (max-height: 700px) {
  .content { padding: 3svh 6vw; gap: 8px; }
  .label, .open__label, .name-box span { line-height: 1.5; }
  .name-box { min-height: 46px; padding: 6px 12px; }
  .open { gap: 6px; }
  .open__icon { width: 40px; height: 40px; }
}
