:root {
  --nuit-bg: #ffffff;
  --nuit-ink: #272522;
  --nuit-ink-accent: #66705d;
  --nuit-ink-soft: #b9b3a8;
  --nuit-ink-muted: rgba(39, 37, 34, 0.6);
  --nuit-line: #b9b3a8;
  --nuit-content-max-w: 540px;
  --font-forum: 'Forum', Georgia, serif;
  --font-caveat: 'Caveat', cursive;
  --font-great-vibes: 'Great Vibes', cursive;
  --font-helveticaCyr: 'helveticaCyr', Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--nuit-bg);
  color: var(--nuit-ink);
  font-family: var(--font-helveticaCyr);
  font-weight: 300;
  line-height: 1.3;
  overflow-x: hidden;
}

body .nuit-template,
div.nuit-template {
  overflow: visible !important;
  width: 100%;
  position: relative;
}

/* Section defaults */
section {
  padding: 120px 24px 0;
  text-align: center;
  position: relative;
  overflow: visible;
}

section > div {
  max-width: 560px;
  margin: 0 auto;
  position: relative;
  isolation: isolate;
}

/* Typography */
h2 {
  font-family: var(--font-forum);
  font-size: 54px;
  color: var(--nuit-ink-accent);
  font-weight: 400;
  line-height: 0.95;
  text-transform: uppercase;
  letter-spacing: normal;
  margin: 0 0 20px;
  text-wrap: balance;
}

p {
  font-family: var(--font-helveticaCyr);
  font-size: 16px;
  line-height: 1.3;
  color: var(--nuit-ink);
  font-weight: 300;
  margin: 12px auto;
  max-width: var(--nuit-content-max-w);
}

/* Hero Section */
.nuit-hero-section {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  z-index: 1;
}

.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 46% 40%;
  z-index: 0;
}

.hero-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.05) 22%, rgba(0,0,0,0) 55%, rgba(0,0,0,0.55) 100%);
  z-index: 1;
  pointer-events: none;
}

.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.hero-names {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding-top: max(8vh, 54px);
  text-align: center;
  font-family: var(--font-great-vibes);
  font-size: 72px;
  color: #ffffff;
  line-height: 1;
  font-style: italic;
  text-shadow: 0 1px 8px rgba(0,0,0,0.3);
  z-index: 10;
}

.hero-names p {
  margin: 0;
  color: #ffffff;
  font-size: inherit;
  font-family: inherit;
}

.nuit-hero-bottom {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding-bottom: max(1.5vh, 12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 10;
}

.countdown-wrapper {
  align-self: flex-end;
  margin-right: 22px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  transform: rotate(-9deg);
  transform-origin: center;
}

.countdown-arrow {
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 8px;
  transform: rotate(40deg);
  transform-origin: center;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.4));
}

.countdown-note {
  margin: 0;
  font-family: var(--font-caveat);
  font-size: 20px;
  color: rgba(255,255,255,0.92);
  line-height: 0.9;
  text-align: center;
  text-shadow: 0 1px 6px rgba(0,0,0,0.35);
}

.hero-date-big {
  font-family: var(--font-forum);
  font-size: min(calc(22.96vw - 11px), 100px);
  color: #ffffff;
  line-height: 1;
  margin: 0;
  white-space: nowrap;
  text-shadow: 0 1px 10px rgba(0,0,0,0.35);
}

/* Music Toggle */
.music-toggle {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border: none;
  background: none;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s;
  padding: 12px;
  margin: -12px;
}

.music-toggle:hover {
  opacity: 1;
}

.music-toggle .heart-bg {
  position: absolute;
  inset: 12px;
  width: calc(100% - 24px);
  height: calc(100% - 24px);
  pointer-events: none;
}

.music-toggle .play-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-1px);
  z-index: 1;
}

/* Polaroid */
.polaroid {
  position: relative;
  width: 190px;
  height: 253.33px;
  margin: 0 auto 48px;
  background: var(--nuit-bg);
  z-index: 1;
  will-change: opacity;
  backface-visibility: hidden;
}

.polaroid .notes {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 370.5px;
  height: auto;
  max-width: none;
  z-index: 0;
  mix-blend-mode: multiply;
  pointer-events: none;
}

.polaroid > img:nth-child(2) {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  box-sizing: border-box;
  border: none;
}

.polaroid .clip {
  position: absolute;
  z-index: 2;
  top: -14px;
  left: -20px;
  width: 58px;
  height: auto;
  transform: rotate(45deg);
  pointer-events: none;
}

/* Venue */
.venue-title {
  font-family: var(--font-forum);
  font-size: 34px;
  color: var(--nuit-ink);
  line-height: 1.1;
  margin: 44px 0 0;
  white-space: pre-line;
}

.venue-subtitle {
  font-family: var(--font-helveticaCyr);
  font-size: 16px;
  font-weight: 300;
  color: var(--nuit-ink);
  margin-top: 8px;
}

.venue-image {
  width: 100%;
  aspect-ratio: 3/2;
  margin-top: 24px;
  border-radius: 0;
  overflow: hidden;
  border: none;
  box-sizing: border-box;
}

.venue-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.map-link-wrapper {
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  gap: 2px;
  margin-top: 6px;
}

.map-arrow {
  flex-shrink: 0;
  margin-bottom: 2px;
  transform: translateY(2px);
}

.map-link {
  font-family: var(--font-caveat);
  font-size: 21px;
  line-height: 1;
  color: var(--nuit-ink);
  text-decoration: none;
  border-bottom: 1px solid var(--nuit-ink);
  padding-bottom: 2px;
  transform: translateY(8px) rotate(-2deg);
  transform-origin: center;
  white-space: nowrap;
}

/* Timeline */
.timeline {
  margin-top: 56px;
}

.timeline-item {
  position: relative;
  z-index: 2;
  margin-bottom: 48px;
  text-align: center;
}

.timeline-item:last-of-type {
  margin-bottom: 0;
}

.timeline-time {
  position: relative;
  display: inline-block;
}

.timeline-time span {
  font-family: var(--font-forum);
  font-size: 32px;
  color: var(--nuit-ink);
  line-height: 1;
}

.timeline-time svg {
  position: absolute;
  left: 50%;
  bottom: -9px;
  transform: translateX(-50%);
  width: 116%;
  height: 14px;
  overflow: visible;
  pointer-events: none;
}

.timeline-title {
  font-family: var(--font-forum);
  font-size: 21px;
  font-weight: 400;
  color: var(--nuit-ink);
  line-height: 1.1;
  margin: 18px 0 0;
  padding: 0;
}

.timeline-desc {
  font-family: var(--font-helveticaCyr);
  font-size: 15px;
  font-weight: 300;
  color: var(--nuit-ink);
  line-height: 1.3;
  margin: 6px auto 0;
  text-wrap: balance;
  max-width: 270px;
}

.schedule-image-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  overflow: visible;
  margin-top: -24px;
  position: relative;
  z-index: 0;
}

.schedule-image-wrapper img {
  width: min(100%, 440px);
  max-width: none;
  height: auto;
  object-fit: contain;
  flex-shrink: 0;
}

/* Dress Code */
.dress-palette {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  margin: 28px 0 40px;
}

.dress-palette div {
  width: 50px;
  height: 50px;
  border-radius: 0;
  flex-shrink: 0;
}

.dress-carousel {
  position: relative;
  width: min(100%, 560px);
  margin-left: 50%;
  transform: translateX(-50%);
  height: 400px;
  overflow: hidden;
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
  margin-top: 44px;
}

.dress-carousel:active {
  cursor: grabbing;
}

.dress-slide {
  position: absolute;
  top: 0;
  left: 50%;
  width: 300px;
  height: 400px;
  margin-left: -150px;
  overflow: hidden;
  will-change: transform, opacity;
  pointer-events: none;
}

.dress-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: none;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-drag: none;
}

/* Wishes / Details */
.wishes-section {
  display: flex;
  flex-direction: column;
  gap: 44px;
}

.wishes-item {
  text-align: center;
}

.wishes-item img {
  display: block;
  width: 110px;
  height: auto;
  aspect-ratio: 1/1;
  object-fit: contain;
  margin: 0 auto 8px;
}

.wishes-divider {
  display: block;
  margin: 0 auto 20px;
}

/* Footer */
.footer-section {
  position: relative;
  padding-top: 100px;
  text-align: center;
}

.footer-section > div {
  max-width: 560px;
  margin: 0 auto;
}

.footer-text {
  position: relative;
  z-index: 2;
}

.footer-text p:first-child {
  font-family: var(--font-forum);
  font-size: 54px;
  color: var(--nuit-ink);
  font-weight: 400;
  line-height: 0.95;
  text-transform: uppercase;
  margin: 0;
}

.footer-text p:last-child {
  font-family: var(--font-forum);
  font-size: 28px;
  color: var(--nuit-ink);
  text-align: center;
  margin: 16px 0 0;
}

.footer-image-wrapper {
  display: flex;
  justify-content: center;
  width: 100%;
  overflow: visible;
  margin-top: -100px;
  z-index: 0;
  position: relative;
}

.footer-image-wrapper img {
  width: min(120%, 540px);
  max-width: none;
  height: auto;
  object-fit: contain;
  flex-shrink: 0;
  transform: translateX(-15px);
}

/* Reveal animations */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

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

/* Fade-only reveal (no transform, for polaroid) */
.fade-reveal {
  opacity: 0;
  transition: opacity 0.8s ease;
}

.fade-reveal.visible {
  opacity: 1;
}

/* Responsive */
@media (max-width: 600px) {
  section {
    padding-left: 22px;
    padding-right: 22px;
    padding-top: 90px;
  }

  .nuit-hero-section {
    min-height: 580px;
  }

  .hero-names {
    font-size: min(14vw, 65px);
  }

  .hero-date-big {
    font-size: min(calc(25vw - 32px), 85px);
  }

  h2 {
    font-size: 51px;
  }
}
