:root {
  --cream: #fff8eb;
  --sun: #f6bf5f;
  --rose: #e99391;
  --sage: #7d9b74;
  --leaf: #365a3b;
  --ink: #2e2a24;
  --soft-ink: #645b50;
  --paper: rgba(255, 250, 240, 0.9);
  --shadow: 0 24px 70px rgba(71, 55, 32, 0.2);
  --photo-path: "assets/gallery/photo-534.jpg";
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font-family: "EB Garamond", "Noto Sans Thai", Georgia, serif;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

.wish-counter {
  position: fixed;
  right: 16px;
  top: 50%;
  z-index: 8;
  display: grid;
  place-items: center;
  gap: 2px;
  width: clamp(92px, 9vw, 126px);
  min-height: clamp(92px, 9vw, 126px);
  padding: 14px 10px;
  border: 1px solid rgba(233, 147, 145, 0.28);
  border-radius: 50%;
  color: #7a7657;
  text-align: center;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.92), rgba(255, 235, 198, 0.82));
  box-shadow: 0 16px 40px rgba(80, 62, 38, 0.2);
  transform: translateY(-50%);
  backdrop-filter: blur(10px);
}

.wish-counter span {
  font-family: Nunito, "Noto Sans Thai", Arial, sans-serif;
  font-size: clamp(2rem, 3.8vw, 3.2rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 0.9;
}

.wish-counter small {
  max-width: 76px;
  color: #b56f45;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.1;
  text-transform: uppercase;
}

button,
input,
textarea {
  font: inherit;
}

.hero {
  min-height: 92svh;
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  color: #fffaf0;
  background-image:
    linear-gradient(90deg, rgba(38, 38, 28, 0.62), rgba(38, 38, 28, 0.25) 48%, rgba(38, 38, 28, 0.05)),
    linear-gradient(0deg, rgba(46, 42, 36, 0.48), rgba(46, 42, 36, 0.02) 45%),
    url("assets/gallery/photo-534.jpg");
  background-size: cover;
  background-position: center;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 18vh;
  background: linear-gradient(0deg, var(--cream), rgba(255, 248, 235, 0));
  pointer-events: none;
}

.nav {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.brand img {
  width: clamp(104px, 11vw, 138px);
  aspect-ratio: 1;
  object-fit: contain;
  border: 1px solid rgba(255, 248, 235, 0.88);
  border-radius: 50%;
  padding: 12px;
  background: rgba(255, 248, 235, 0.86);
  box-shadow: 0 14px 34px rgba(32, 28, 22, 0.26);
  filter: drop-shadow(0 2px 0 rgba(255, 255, 255, 0.65));
}

.brand span {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.85rem, 3.8vw, 3rem);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: 0;
  text-shadow: 0 3px 18px rgba(30, 24, 16, 0.34);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.nav-links a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  color: rgba(255, 250, 240, 0.88);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
}

.hero-copy {
  position: relative;
  z-index: 2;
  align-self: center;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 64px 0 15vh;
}

.eyebrow {
  margin: 0 0 12px;
  color: #ffe5b4;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero .eyebrow {
  font-family: "Pinyon Script", "Cormorant Garamond", Georgia, serif;
  font-size: clamp(2.35rem, 4.8vw, 3.65rem);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
  text-transform: none;
}

.eyebrow.dark {
  color: #b56f45;
}

h1,
h2 {
  font-family: "Cormorant Garamond", Georgia, serif;
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(4.4rem, 11.4vw, 9.7rem);
  font-weight: 600;
  line-height: 0.88;
  text-wrap: balance;
  text-shadow: 0 10px 38px rgba(25, 22, 16, 0.36);
}

h2 {
  margin: 0;
  color: var(--leaf);
  font-size: clamp(2.2rem, 5vw, 4.8rem);
  line-height: 0.95;
  text-wrap: balance;
}

.hero-date {
  margin: 24px 0 0;
  color: #fff4d9;
  font-size: clamp(1.15rem, 3vw, 1.65rem);
  font-weight: 700;
}

.hero-text {
  max-width: 590px;
  margin: 18px 0 0;
  color: rgba(255, 250, 240, 0.92);
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 12px 20px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button.primary {
  color: #3a2d20;
  background: linear-gradient(135deg, #ffe19b, #f4a88f);
  box-shadow: 0 16px 34px rgba(115, 72, 38, 0.24);
}

.button.secondary {
  color: #fff8eb;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 248, 235, 0.42);
  backdrop-filter: blur(10px);
}

.section-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.section-lede {
  max-width: 620px;
  margin: 16px 0 0;
  color: var(--soft-ink);
  font-size: 1.05rem;
  line-height: 1.75;
}

.hero-countdown {
  width: min(560px, 100%);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}

.time-box {
  min-height: 108px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  padding: 15px 10px;
  border: 1px solid rgba(233, 147, 145, 0.22);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 252, 244, 0.96), rgba(255, 229, 180, 0.82));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 12px 28px rgba(115, 72, 38, 0.18);
  backdrop-filter: blur(8px);
}

.time-box span {
  min-width: 3ch;
  color: #7a7657;
  font-family: Nunito, "Noto Sans Thai", Arial, sans-serif;
  font-size: clamp(2.1rem, 3.8vw, 3.35rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  line-height: 1;
  text-align: center;
}

.time-box small {
  color: #b56f45;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.gallery-section {
  padding: 86px 0 92px;
  background: linear-gradient(180deg, var(--cream), #f7efdf);
}

.section-heading {
  display: grid;
  gap: 12px;
  margin-bottom: 32px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-flow: dense;
  gap: 12px;
}

.gallery-item {
  min-height: 260px;
  position: relative;
  grid-column: span 4;
  border: 0;
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  background: #e8d8bf;
  box-shadow: 0 18px 42px rgba(80, 62, 38, 0.16);
}

.gallery-item.wide {
  grid-column: span 8;
}

.gallery-item.half {
  grid-column: span 6;
}

.gallery-item.tall {
  min-height: 420px;
  grid-row: span 2;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms ease, filter 500ms ease;
}

.gallery-item:hover img {
  transform: scale(1.045);
  filter: saturate(1.08) brightness(1.04);
}

.wish-section {
  padding: 86px 0 104px;
  background:
    linear-gradient(180deg, #f7efdf, rgba(255, 248, 235, 0.88)),
    url("assets/gallery/photo-599.jpg");
  background-size: cover;
  background-position: center;
  background-blend-mode: screen;
}

.wish-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
  align-items: stretch;
}

.wish-copy,
.credits-panel {
  border: 1px solid rgba(88, 72, 48, 0.16);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.wish-copy {
  padding: clamp(24px, 4vw, 42px);
}

.wish-form {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

.wish-form label {
  display: grid;
  gap: 8px;
  color: var(--leaf);
  font-size: 0.86rem;
  font-weight: 800;
}

.wish-form input,
.wish-form textarea {
  width: 100%;
  border: 1px solid rgba(88, 72, 48, 0.18);
  border-radius: 8px;
  padding: 14px 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  outline: none;
}

.wish-form input:focus,
.wish-form textarea:focus {
  border-color: var(--rose);
  box-shadow: 0 0 0 4px rgba(233, 147, 145, 0.18);
}

.wish-form textarea {
  min-height: 132px;
  resize: vertical;
}

.form-button {
  width: fit-content;
}

.form-note {
  min-height: 22px;
  margin: 0;
  color: #8e6546;
  font-weight: 700;
}

.credits-panel {
  position: relative;
  min-height: 760px;
  padding: 20px;
}

.credits-panel:fullscreen,
.credits-panel.is-fullscreen {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  padding: clamp(18px, 3vw, 38px);
  border: 0;
  border-radius: 0;
  background: #172315;
  box-shadow: none;
}

.credits-fullscreen-button {
  position: absolute;
  top: 34px;
  right: 34px;
  z-index: 4;
  min-height: 42px;
  border: 1px solid rgba(255, 248, 235, 0.42);
  border-radius: 8px;
  padding: 0 16px;
  color: #fff8eb;
  background: rgba(23, 35, 21, 0.58);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  white-space: nowrap;
  backdrop-filter: blur(10px);
}

.credits-fullscreen-button:hover {
  background: rgba(23, 35, 21, 0.78);
}

.wish-refresh-countdown {
  display: none;
}

.credits-panel:fullscreen .wish-refresh-countdown,
.credits-panel.is-fullscreen .wish-refresh-countdown {
  position: absolute;
  top: clamp(20px, 3vw, 34px);
  left: clamp(20px, 3vw, 34px);
  z-index: 4;
  border: 1px solid rgba(255, 248, 235, 0.34);
  border-radius: 8px;
  margin: 0;
  padding: 12px 14px;
  color: #fff8eb;
  background: rgba(23, 35, 21, 0.62);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
}

.wish-refresh-countdown span {
  font-family: Nunito, "Noto Sans Thai", Arial, sans-serif;
  margin-left: 8px;
  font-size: 1rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.credits-frame {
  position: relative;
  height: 100%;
  min-height: 720px;
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(54, 90, 59, 0.93), rgba(59, 67, 43, 0.9)),
    url("assets/gallery/photo-636.jpg");
  background-size: cover;
  background-position: center;
  background-blend-mode: multiply;
}

.credits-panel:fullscreen .credits-frame,
.credits-panel.is-fullscreen .credits-frame {
  height: 100%;
  min-height: calc(100vh - clamp(36px, 6vw, 76px));
  border-radius: 0;
}

.credits-panel:fullscreen .credits-track,
.credits-panel.is-fullscreen .credits-track {
  top: calc(100% - 180px);
  width: min(980px, calc(100% - 80px));
  padding: 120px 0;
  animation-duration: 60s;
}

.credits-panel:fullscreen .wish-credit blockquote,
.credits-panel.is-fullscreen .wish-credit blockquote {
  font-size: clamp(2rem, 4.4vw, 4.25rem);
}

.credits-panel:fullscreen .wish-author-inline,
.credits-panel.is-fullscreen .wish-author-inline {
  font-size: 0.42em;
}

.credits-frame::before,
.credits-frame::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  z-index: 2;
  height: 34%;
  pointer-events: none;
}

.credits-frame::before {
  top: 0;
  background: linear-gradient(180deg, rgba(34, 47, 31, 0.98), rgba(34, 47, 31, 0));
}

.credits-frame::after {
  bottom: 0;
  background: linear-gradient(0deg, rgba(34, 47, 31, 0.98), rgba(34, 47, 31, 0));
}

.credits-track {
  position: absolute;
  top: calc(100% - 150px);
  left: 50%;
  width: min(700px, calc(100% - 56px));
  transform: translateX(-50%);
  padding: 92px 0;
  color: #fff8eb;
  text-align: center;
  animation: rollCredits 45s linear infinite;
}

.wish-credit {
  margin: 0 0 58px;
}

.wish-credit blockquote {
  margin: 0;
  font-family: "EB Garamond", "Noto Sans Thai", Georgia, serif;
  font-size: clamp(1.42rem, 2.85vw, 2.18rem);
  font-weight: 600;
  line-height: 1.4;
  text-wrap: balance;
}

.wish-credit figcaption {
  margin-top: 12px;
  color: #ffe5b4;
  font-size: clamp(0.62rem, 1.4vw, 0.78rem);
  font-weight: 800;
  letter-spacing: 0.16em;
  text-align: right;
  text-transform: uppercase;
}

.wish-author-inline {
  display: inline-block;
  margin-left: 0.35em;
  color: #ffe5b4;
  font-family: "EB Garamond", "Noto Sans Thai", Georgia, serif;
  font-size: 0.55em;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
  transform: translateY(0.45em);
}

.empty-wishes {
  margin: 180px 0 0;
  color: rgba(255, 248, 235, 0.86);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.05;
}

:lang(th) {
  font-family: "Noto Sans Thai", "EB Garamond", Arial, sans-serif;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(28, 26, 22, 0.88);
}

.lightbox[hidden] {
  display: none;
}

.lightbox img {
  max-height: min(88vh, 980px);
  border-radius: 8px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 248, 235, 0.45);
  border-radius: 999px;
  color: #fff8eb;
  background: rgba(255, 255, 255, 0.12);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

@keyframes rollCredits {
  from {
    transform: translate(-50%, 0);
  }
  to {
    transform: translate(-50%, -100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media (max-width: 920px) {
  .wish-layout {
    grid-template-columns: 1fr;
  }

  .gallery-item,
  .gallery-item.wide {
    grid-column: span 6;
  }

  .gallery-item.half {
    grid-column: span 6;
  }

  .gallery-item.tall {
    min-height: 360px;
  }
}

@media (max-width: 640px) {
  .wish-counter {
    right: 10px;
    top: auto;
    bottom: 14px;
    width: 82px;
    min-height: 82px;
    padding: 10px 8px;
    transform: none;
  }

  .wish-counter span {
    font-size: 1.75rem;
  }

  .wish-counter small {
    max-width: 62px;
    font-size: 0.56rem;
  }

  .hero {
    min-height: 94svh;
    background-position: 42% center;
  }

  .nav {
    align-items: flex-start;
  }

  .brand img {
    width: 92px;
  }

  .brand span {
    max-width: 170px;
    font-size: 2.1rem;
    line-height: 0.9;
  }

  .nav-links {
    max-width: 190px;
  }

  .nav-links a {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 0.78rem;
  }

  .hero-copy {
    padding-bottom: 12vh;
  }

  .hero-countdown {
    width: min(360px, 100%);
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .time-box {
    min-height: 86px;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .gallery-item,
  .gallery-item.wide,
  .gallery-item.half,
  .gallery-item.tall {
    min-height: 340px;
    grid-column: auto;
  }

  .credits-panel {
    min-height: 620px;
  }

  .credits-frame {
    min-height: 584px;
  }

  .credits-fullscreen-button {
    top: 28px;
    right: 28px;
  }

  .credits-panel:fullscreen .wish-refresh-countdown,
  .credits-panel.is-fullscreen .wish-refresh-countdown {
    top: 82px;
    left: 18px;
  }
}
