*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0c0b0f;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.1);
  --border-hover: rgba(255, 255, 255, 0.22);
  --text: #f4f0eb;
  --text-muted: rgba(244, 240, 235, 0.5);
  --accent: #c9a87c;
  --accent-soft: rgba(201, 168, 124, 0.15);
  --radius: 20px;
  --radius-sm: 12px;
  --transition: 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Outfit", system-ui, sans-serif;
}

html,
body {
  height: 100%;
}

body {
  font-family: var(--font-body);
  font-weight: 300;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Ambient background */
.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ambient__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
  animation: drift 18s ease-in-out infinite alternate;
}

.ambient__orb--1 {
  width: 55vw;
  height: 55vw;
  max-width: 520px;
  max-height: 520px;
  top: -15%;
  right: -10%;
  background: radial-gradient(circle, #2a1f3d 0%, transparent 70%);
}

.ambient__orb--2 {
  width: 45vw;
  height: 45vw;
  max-width: 420px;
  max-height: 420px;
  bottom: -10%;
  left: -8%;
  background: radial-gradient(circle, #1a2838 0%, transparent 70%);
  animation-delay: -6s;
}

.ambient__grain {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-3%, 4%) scale(1.08); }
}

.app {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  z-index: 1;
  transition: filter 0.45s ease;
}

body.welcome-open .app,
body.welcome-open .ambient {
  filter: blur(14px) saturate(0.85);
  pointer-events: none;
  user-select: none;
}

/* Welcome window */
.welcome {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.35);
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.welcome--hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.welcome__window {
  width: min(380px, 100%);
  background: rgba(22, 20, 28, 0.92);
  border: 1px solid var(--border-hover);
  border-radius: 14px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 24px 80px rgba(0, 0, 0, 0.65),
    0 8px 32px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transform: scale(1);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
}

.welcome--hidden .welcome__window {
  transform: scale(0.94);
  opacity: 0;
}

.welcome__titlebar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
}

.welcome__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

.welcome__dot:nth-child(1) {
  background: rgba(255, 120, 120, 0.55);
}

.welcome__dot:nth-child(2) {
  background: rgba(255, 200, 100, 0.55);
}

.welcome__dot:nth-child(3) {
  background: rgba(120, 200, 140, 0.55);
}

.welcome__body {
  padding: 1.5rem 1.5rem 1.35rem;
  text-align: center;
}

.welcome__title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.welcome__text {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-muted);
  margin-bottom: 1.35rem;
}

.welcome__btn {
  width: 100%;
  padding: 0.85rem 1.25rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--bg);
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.welcome__btn:hover {
  background: #d4b48a;
  transform: translateY(-1px);
}

.welcome__btn:active {
  transform: translateY(0);
}

/* Views */
.view {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2.5rem 1.5rem;
  transition:
    opacity var(--transition),
    transform var(--transition),
    filter var(--transition);
}

.view--active {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
  pointer-events: auto;
  z-index: 2;
}

.view--hidden {
  opacity: 0;
  transform: translateY(28px) scale(0.96);
  filter: blur(6px);
  pointer-events: none;
  z-index: 1;
}

.view--leaving {
  opacity: 0;
  transform: translateY(-24px) scale(0.98);
  filter: blur(4px);
  pointer-events: none;
}

.view--entering {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
  pointer-events: auto;
  z-index: 3;
}

#list-view {
  justify-content: center;
  gap: 2.5rem;
}

/* Hero */
.hero {
  text-align: center;
  max-width: 480px;
}

.hero__eyebrow {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 10vw, 4.5rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.hero__subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Date list */
.date-list {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  width: min(440px, 100%);
}

.date-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 1.15rem 1.35rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--text);
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px);
  animation: fadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition:
    background 0.25s,
    border-color 0.25s,
    transform 0.25s,
    box-shadow 0.25s;
}


.date-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-soft) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
}

.date-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.date-btn:hover::before {
  opacity: 1;
}

.date-btn:active {
  transform: translateY(-1px);
}

.date-btn__date {
  flex: 1;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  padding: 0 1.5rem;
}

.date-btn__arrow {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.25s, color 0.25s;
}

.date-btn:hover .date-btn__arrow {
  transform: translateX(4px);
  color: var(--accent);
}

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

.home-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.home-footer__line {
  width: 32px;
  height: 1px;
  background: var(--border);
}

/* Gallery header */
.gallery-header {
  position: relative;
  z-index: 10;
  width: min(760px, 100%);
  margin-bottom: 2rem;
  flex-shrink: 0;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem 0.55rem 0.75rem;
  margin-bottom: 1.75rem;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  position: relative;
  z-index: 11;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  backdrop-filter: blur(8px);
  transition:
    color 0.2s,
    border-color 0.2s,
    background 0.2s;
}

.back-btn:hover {
  color: var(--text);
  border-color: var(--border-hover);
  background: var(--surface-hover);
}

.gallery-header__label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.gallery-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

#gallery-view {
  justify-content: center;
}

/* Gallery */
.gallery {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  width: min(760px, 100%);
}

@media (min-width: 641px) {
  .gallery {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
  }

  .nav-btn--prev {
    grid-column: 1;
  }

  .gallery-media {
    grid-column: 2;
  }

  .nav-btn--next {
    grid-column: 3;
  }
}

.image-frame {
  position: relative;
  flex: 1;
  width: 100%;
  min-width: 0;
  max-height: min(62vh, 720px);
  border-radius: var(--radius);
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-frame--portrait {
  max-height: min(72vh, 820px);
}

.image-frame--landscape {
  max-height: min(58vh, 640px);
}

.image-frame__glow {
  position: absolute;
  inset: -20%;
  background: var(--slide-glow, rgba(201, 168, 124, 0.2));
  filter: blur(40px);
  opacity: 0.5;
  transition: background 0.6s ease;
  z-index: 0;
  pointer-events: none;
}

.image-slide {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  z-index: 1;
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition:
    opacity 0.35s ease,
    transform 0.35s ease;
}

.image-slide--fade {
  opacity: 0;
  transform: scale(0.98);
}

.gallery-img {
  display: block;
  max-width: 100%;
  max-height: min(62vh, 720px);
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
}

.image-frame--portrait .gallery-img {
  max-height: min(72vh, 820px);
}

.image-frame--landscape .gallery-img {
  max-height: min(58vh, 640px);
}

.gallery-media {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  flex: 1;
  min-width: 0;
}


.image-caption {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-muted);
  text-align: center;
  letter-spacing: 0.04em;
  line-height: 1.5;
  max-width: 32ch;
  margin: 0;
  transition: opacity 0.3s ease;
}

.image-caption--fade {
  opacity: 0;
}

.nav-btn {
  position: relative;
  z-index: 5;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition:
    background 0.25s,
    border-color 0.25s,
    transform 0.25s,
    box-shadow 0.25s;
}

.nav-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  transform: scale(1.06);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.nav-btn:active {
  transform: scale(0.98);
}

.nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
}

/* Gallery footer */
.gallery-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 1.75rem;
}

.dots {
  display: flex;
  gap: 0.5rem;
}

.dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition:
    background 0.3s,
    transform 0.3s,
    width 0.3s;
}

.dot--active {
  width: 24px;
  border-radius: 4px;
  background: var(--accent);
}

.dot:hover:not(.dot--active) {
  background: rgba(255, 255, 255, 0.35);
}

.gallery-counter {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

/* Mobile */
@media (max-width: 640px) {
  .view {
    padding: 1.25rem 1rem;
  }

  #list-view {
    gap: 1.75rem;
    padding-top: 2rem;
    padding-bottom: 1.5rem;
    justify-content: flex-start;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .hero {
    flex-shrink: 0;
  }

  .hero__title {
    font-size: 2.75rem;
  }

  .date-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-bottom: 0.5rem;
  }

  .date-btn {
    padding: 1rem 1.15rem;
  }

  .date-btn__date {
    font-size: 1.05rem;
  }

  #gallery-view {
    justify-content: flex-start;
    padding-top: 0.75rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .gallery-header {
    width: 100%;
    margin-bottom: 1rem;
    flex-shrink: 0;
  }

  .back-btn {
    margin-bottom: 1rem;
  }

  .gallery-title {
    font-size: 1.5rem;
  }

  .gallery {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 1rem;
    width: 100%;
    flex: 1;
    min-height: 0;
    align-content: start;
  }

  .gallery-media {
    grid-column: 1 / -1;
    grid-row: 1;
    width: 100%;
  }

  .image-caption {
    font-size: 0.78rem;
    padding: 0 0.5rem;
    margin-bottom: 0.25rem;
  }

  .nav-btn--prev {
    grid-row: 2;
    grid-column: 1;
    justify-self: end;
  }

  .nav-btn--next {
    grid-row: 2;
    grid-column: 2;
    justify-self: start;
  }

  .image-frame {
    order: unset;
    max-height: none;
    width: 100%;
  }

  .image-slide {
    width: 100%;
  }

  .gallery-img,
  .image-frame--portrait .gallery-img,
  .image-frame--landscape .gallery-img {
    width: 100%;
    max-width: 100%;
    max-height: min(58dvh, 520px);
    height: auto;
  }

  .image-frame--portrait .gallery-img {
    max-height: min(64dvh, 580px);
  }

  .nav-btn {
    width: 52px;
    height: 52px;
    min-height: 48px;
  }

  .gallery-footer {
    margin-top: 1.5rem;
    flex-shrink: 0;
    padding-bottom: 1rem;
  }

  .dots {
    flex-wrap: wrap;
    justify-content: center;
    max-width: 100%;
    gap: 0.4rem;
  }

  .dot {
    width: 7px;
    height: 7px;
  }

  .dot--active {
    width: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
