/* ── Reset & Base ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-bg: #fffaf7;
  --color-text: #1a1916;
  --color-muted: #6b6560;
  --color-accent: #3d4f3a;
  --color-line: #e8e2db;

  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Jost', system-ui, sans-serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --transition: 800ms var(--ease);

  --nav-height: 5.5rem;
  --section-x: clamp(1.25rem, 4vw, 2.5rem);
  --section-y: clamp(3.5rem, 10vw, 10rem);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: clamp(15px, 1.6vw, 16px);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

/* ── Navigation ── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 1rem var(--section-x);
  padding-top: max(1rem, env(safe-area-inset-top));
  background: rgba(255, 250, 247, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition);
}

.nav.scrolled {
  border-bottom-color: var(--color-line);
}

.nav__links {
  display: flex;
  gap: clamp(1.25rem, 3vw, 2.5rem);
}

.nav__links--left {
  justify-content: flex-end;
  padding-right: clamp(0.5rem, 2vw, 1.5rem);
}

.nav__links--right {
  justify-content: flex-start;
  padding-left: clamp(0.5rem, 2vw, 1.5rem);
}

.nav__logo {
  flex-shrink: 0;
  padding: 0 clamp(1rem, 3vw, 2.5rem);
  opacity: 1;
  transition: opacity var(--transition);
}

.nav__logo:hover {
  opacity: 0.75;
}

.nav__logo img {
  width: clamp(52px, 7vw, 68px);
  height: auto;
  object-fit: contain;
}

.nav a {
  font-size: clamp(0.58rem, 1.4vw, 0.7rem);
  font-weight: 400;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  opacity: 0.7;
  transition: opacity var(--transition);
  padding: 0.35rem 0;
  white-space: nowrap;
}

.nav a:hover {
  opacity: 1;
}

.nav__logo,
.nav__logo:hover {
  opacity: 1;
}

/* ── Section Label ── */
.section-label {
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 1.5rem;
}

/* ── Hero ── */
.hero {
  min-height: 100svh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: 1fr auto;
  padding-top: var(--nav-height);
}

.hero__image {
  position: relative;
  overflow: hidden;
  max-height: min(70vh, 720px);
  min-height: 240px;
}

.hero__image img {
  width: 100%;
  height: 100%;
  min-height: 240px;
  object-position: center 30%;
  animation: fadeIn 1.2s var(--ease) both;
}

.hero__content {
  text-align: center;
  padding: clamp(2.5rem, 6vw, 4rem) var(--section-x) clamp(3.5rem, 8vw, 6rem);
  animation: fadeUp 1s var(--ease) 0.3s both;
}

.hero__label {
  font-size: clamp(0.62rem, 1.5vw, 0.7rem);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: clamp(1.25rem, 4vw, 2rem);
}

.hero__names {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(2.4rem, 10vw, 5.5rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1em;
  text-wrap: balance;
}

.hero__amp {
  font-style: italic;
  font-size: 0.6em;
  color: var(--color-accent);
  margin: 0.1em 0;
}

.hero__date {
  margin-top: clamp(1.5rem, 4vw, 2.5rem);
  font-size: clamp(0.72rem, 2vw, 0.85rem);
  letter-spacing: clamp(0.18em, 2vw, 0.35em);
  color: var(--color-accent);
}

/* ── Countdown ── */
.countdown {
  text-align: center;
  padding: var(--section-y) var(--section-x);
  border-top: 1px solid var(--color-line);
  border-bottom: 1px solid var(--color-line);
}

.countdown__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(1.5rem, 5vw, 5rem);
  max-width: 720px;
  margin: 0 auto;
}

.countdown__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

.countdown__number {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(2.5rem, 9vw, 5rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

.countdown__unit {
  margin-top: 0.75rem;
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--color-muted);
}

/* ── Story ── */
.story {
  padding: var(--section-y) var(--section-x);
  max-width: 1100px;
  margin: 0 auto;
}

.story__title {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(1.85rem, 6vw, 3.2rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: clamp(1.25rem, 3vw, 2rem);
  text-wrap: balance;
}

.story__text {
  max-width: 520px;
  color: var(--color-muted);
  font-size: clamp(0.95rem, 2.2vw, 1.05rem);
  margin-bottom: clamp(2.5rem, 6vw, 5rem);
}

.story__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 2.5vw, 1.5rem);
}

.story__photo {
  overflow: hidden;
}

.story__photo img {
  aspect-ratio: 3/4;
  transition: transform 1.2s var(--ease);
}

.story__photo:hover img {
  transform: scale(1.03);
}

.story__photo--wide {
  grid-column: 1 / -1;
}

.story__photo--wide img {
  aspect-ratio: 16 / 9;
  object-position: center 25%;
}

.story__photo figcaption {
  margin-top: 0.75rem;
  font-size: clamp(0.68rem, 1.8vw, 0.75rem);
  letter-spacing: 0.12em;
  color: var(--color-muted);
  font-style: italic;
  font-family: var(--font-serif);
}

/* ── Gallery ── */
.gallery {
  padding: var(--section-y) var(--section-x);
  max-width: 1100px;
  margin: 0 auto;
}

.gallery__title {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(1.85rem, 6vw, 3.2rem);
  letter-spacing: -0.02em;
  margin-bottom: clamp(2rem, 5vw, 4rem);
  text-wrap: balance;
}

.gallery__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(0.75rem, 2vw, 1rem);
}

.gallery__item {
  overflow: hidden;
  grid-column: span 4;
}

.gallery__item img {
  aspect-ratio: 1;
  transition: transform 1.2s var(--ease);
}

.gallery__item:hover img {
  transform: scale(1.03);
}

.gallery__item--tall {
  grid-column: span 4;
  grid-row: span 2;
}

.gallery__item--tall img {
  aspect-ratio: auto;
  height: 100%;
  min-height: clamp(280px, 40vw, 400px);
}

.gallery__item--wide {
  grid-column: span 8;
}

.gallery__item--wide img {
  aspect-ratio: 2/1;
}

/* ── Event ── */
.event {
  background: var(--color-text);
  color: var(--color-bg);
  padding: var(--section-y) var(--section-x);
}

.event__inner {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

.event .section-label {
  color: rgba(255, 250, 247, 0.5);
}

.event__title {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(1.85rem, 6vw, 3.2rem);
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  text-wrap: balance;
}

.event__date {
  font-size: clamp(0.78rem, 2vw, 0.85rem);
  letter-spacing: clamp(0.12em, 1.5vw, 0.2em);
  color: rgba(255, 250, 247, 0.6);
  margin-bottom: clamp(2.5rem, 6vw, 4rem);
}

.event__details {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(2rem, 5vw, 3rem);
  margin-bottom: clamp(2rem, 4vw, 3rem);
  flex-wrap: wrap;
}

.event__detail {
  flex: 1 1 200px;
  max-width: 260px;
}

.event__detail h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.2rem, 3vw, 1.4rem);
  margin-bottom: 0.5rem;
}

.event__time {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 250, 247, 0.5);
  margin-bottom: 0.5rem;
}

.event__place {
  font-size: 0.95rem;
  color: rgba(255, 250, 247, 0.7);
}

.event__divider {
  width: 1px;
  height: 80px;
  background: rgba(255, 250, 247, 0.15);
  align-self: center;
}

.event__note {
  font-size: clamp(0.85rem, 2vw, 0.9rem);
  color: rgba(255, 250, 247, 0.45);
  font-style: italic;
  font-family: var(--font-serif);
  max-width: 420px;
  margin: 0 auto;
}

/* ── Footer ── */
.footer {
  text-align: center;
  padding: clamp(3rem, 6vw, 4rem) var(--section-x) clamp(3.5rem, 7vw, 5rem);
  padding-bottom: max(clamp(3.5rem, 7vw, 5rem), env(safe-area-inset-bottom));
}

.footer__names {
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 4vw, 1.5rem);
  font-weight: 300;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.footer__date {
  font-size: clamp(0.68rem, 1.8vw, 0.75rem);
  letter-spacing: clamp(0.2em, 2vw, 0.3em);
  color: var(--color-accent);
  margin-bottom: 1.5rem;
}

.footer__heart {
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--color-muted);
}

/* ── Animations ── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

/* ── Scroll reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--transition), transform var(--transition);
}

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

/* ── Responsive ── */

/* Tablet */
@media (max-width: 1024px) {
  :root {
    --nav-height: 5rem;
  }

  .nav__logo {
    padding: 0 1.25rem;
  }

  .nav__logo img {
    width: clamp(48px, 6vw, 60px);
  }

  .gallery__item--tall {
    grid-column: span 6;
    grid-row: span 2;
  }

  .gallery__item {
    grid-column: span 6;
  }

  .gallery__item--wide {
    grid-column: span 12;
  }
}

/* Mobile */
@media (max-width: 768px) {
  :root {
    --nav-height: 6.75rem;
  }

  .nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.65rem 1.25rem;
    padding: 0.65rem var(--section-x);
    padding-top: max(0.65rem, env(safe-area-inset-top));
  }

  .nav__logo {
    order: -1;
    flex: 0 0 100%;
    display: flex;
    justify-content: center;
    padding: 0;
  }

  .nav__logo img {
    width: 44px;
  }

  .nav__links--left,
  .nav__links--right {
    display: contents;
  }

  .nav a:not(.nav__logo) {
    letter-spacing: 0.18em;
    padding: 0.5rem 0.15rem;
  }

  .hero {
    min-height: auto;
  }

  .hero__image {
    max-height: min(52vh, 420px);
    min-height: 200px;
  }

  .hero__image img {
    min-height: 200px;
    object-position: center 35%;
  }

  .countdown__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem 1.25rem;
  }

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

  .story__photo--wide {
    grid-column: 1;
  }

  .story__photo--wide img {
    aspect-ratio: 4 / 3;
  }

  .gallery__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery__item,
  .gallery__item--tall,
  .gallery__item--wide {
    grid-column: span 1;
    grid-row: span 1;
  }

  .gallery__item img,
  .gallery__item--tall img,
  .gallery__item--wide img {
    aspect-ratio: 3 / 4;
    min-height: auto;
    height: auto;
  }

  .event__divider {
    display: none;
  }

  .event__details {
    flex-direction: column;
    align-items: center;
    gap: 2rem;
  }

  .event__detail {
    max-width: none;
  }
}

/* Small phones */
@media (max-width: 380px) {
  :root {
    --nav-height: 7.25rem;
  }

  .nav a:not(.nav__logo) {
    letter-spacing: 0.12em;
    font-size: 0.55rem;
  }

  .countdown__number {
    font-size: clamp(2rem, 12vw, 2.5rem);
  }

  .countdown__unit {
    font-size: 0.58rem;
    letter-spacing: 0.18em;
  }

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

  .gallery__item img,
  .gallery__item--tall img,
  .gallery__item--wide img {
    aspect-ratio: 4 / 5;
  }
}

/* Touch devices: skip hover zoom */
@media (hover: none) {
  .story__photo:hover img,
  .gallery__item:hover img {
    transform: none;
  }
}

/* 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;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
