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

:root {
  --cream:   #f0e9dc;
  --cream-2: #d8cdb8;
  --stone:   #2a2520;
  --stone-2: #3d362e;
  --stone-3: #1a1714;
  --gold:    #8a7449;
}

html {
  background: var(--cream);
  color: var(--stone);
  font-family: 'Cormorant Garamond', serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  background: var(--cream);
  min-height: 100vh;
}

/* Noise grain overlay — paper materiality */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: url('/noise.png') repeat;
  opacity: 0.3;
  pointer-events: none;
  z-index: 100;
  mix-blend-mode: multiply;
}

::selection {
  background: var(--stone);
  color: var(--cream);
}


/* ========== ANIMATIONS ========== */

@keyframes rise {
  from {
    transform: translateY(120%);
    filter: blur(4px);
  }
  to {
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes blur-in {
  from {
    opacity: 0;
    filter: blur(6px);
  }
  to {
    opacity: 1;
    filter: blur(0);
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: var(--to-opacity, 1); }
}

.anim-rise {
  animation: rise 0.8s cubic-bezier(0.25, 0.1, 0.25, 1) both;
  animation-delay: var(--delay, 0s);
}

.anim-blur {
  opacity: 0;
  animation: blur-in var(--duration, 1.2s) cubic-bezier(0.25, 0.1, 0.25, 1) both;
  animation-delay: var(--delay, 0s);
}

.anim-fade {
  opacity: 0;
  animation: fade-in var(--duration, 1.0s) cubic-bezier(0.25, 0.1, 0.25, 1) both;
  animation-delay: var(--delay, 0s);
}


/* ========== FOLD 1 — the statement ========== */

.scene {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 3rem 4.5rem;
  position: relative;
  background:
    radial-gradient(ellipse 80% 60% at 35% 40%, rgba(244, 237, 224, 0.8), transparent),
    radial-gradient(ellipse 50% 40% at 75% 70%, rgba(216, 205, 184, 0.15), transparent),
    var(--cream);
}

/* Blur-at-fold: dissolve into painting */
.scene::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 8rem;
  background: linear-gradient(to bottom, transparent, var(--cream));
  pointer-events: none;
  mask: linear-gradient(to bottom, transparent, black);
  -webkit-mask: linear-gradient(to bottom, transparent, black);
}

header {
  flex-shrink: 0;
}

.wordmark {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: 1rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--stone-2);
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 0 2vw;
}

.headline {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: clamp(4rem, 9.5vw, 10rem);
  line-height: 0.95;
  letter-spacing: -0.035em;
  color: var(--stone);
  text-shadow: 4px 4px 12px rgba(42, 37, 32, 0.12);
  max-width: 16ch;
  display: flex;
  flex-direction: column;
}

.headline-line {
  display: block;
}

.headline-mobile {
  display: none;
}

.word-wrap {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding-bottom: 0.15em;
  margin-bottom: -0.15em;
}

.word {
  display: inline-block;
}

.yours {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-style: italic;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  color: var(--gold);
  letter-spacing: 0.1em;
  margin-top: 3rem;
}

.fold-footer {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  gap: 0;
  position: relative;
  z-index: 4;
}


.invite-wrap {
  display: flex;
  align-items: center;
}

.invite-form {
  display: flex;
  align-items: center;
  gap: 0;
  border-bottom: 1px solid var(--cream-2);
}

.invite-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--stone);
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.04em;
  padding: 0.5rem 0;
  width: 200px;
  caret-color: var(--gold);
}

.invite-input::placeholder {
  color: var(--cream-2);
  font-style: italic;
}

.invite-btn {
  background: transparent;
  border: none;
  color: var(--stone-2);
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  padding: 0.5rem 0.3rem;
  cursor: pointer;
  transition: color 0.3s ease;
}

.invite-btn:hover {
  color: var(--gold);
}

.thankyou {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1rem;
  color: var(--stone-2);
  letter-spacing: 0.04em;
}


/* ========== THE PAINTING ========== */

.painting {
  position: relative;
  width: 100%;
  margin-top: -8rem;
  z-index: 3;
  overflow: hidden;
  height: 55vh;
  min-height: 360px;
  opacity: 0;
  animation: fade-in 2.5s cubic-bezier(0.25, 0.1, 0.25, 1) 1.2s both;
}

.painting-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 55%;
  display: block;
  mask: linear-gradient(to bottom, transparent 0%, black 5%, black 85%, transparent 100%);
  -webkit-mask: linear-gradient(to bottom, transparent 0%, black 5%, black 85%, transparent 100%);
  filter: saturate(0.88) contrast(0.96);
}


/* ========== FOLD 2 — the accumulation ========== */

.depths {
  padding: 0 4.5rem 12vh;
  margin-top: -8rem;
  position: relative;
  z-index: 5;
  background: linear-gradient(to bottom,
    var(--cream) 0%,
    #ebe3d4 30%,
    #e4dacb 60%,
    #ddd2c0 100%
  );
}

.depth-section {
  display: flex;
  flex-direction: column;
  padding: 10vh 2vw;
  position: relative;
}

.fragment {
  font-family: 'Cormorant Garamond', serif;
  will-change: transform, opacity;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.fragment.visible {
  opacity: 1;
}

.frag-large {
  font-weight: 300;
  font-size: clamp(2.8rem, 6vw, 5.5rem);
  line-height: 1.0;
  letter-spacing: -0.025em;
  color: var(--stone);
}

.frag-mid {
  font-weight: 300;
  font-size: clamp(1.8rem, 3.5vw, 3rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--stone);
}

.frag-small {
  font-weight: 400;
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--stone-2);
}

.frag-italic {
  font-style: italic;
}

.frag-muted {
  color: var(--cream-2);
}

.frag-gold {
  color: var(--gold);
}

.depth-lead {
  padding-top: 7rem;
  padding-bottom: 0;
  mask: linear-gradient(to bottom, transparent 0%, black 40%);
  -webkit-mask: linear-gradient(to bottom, transparent 0%, black 40%);
}

.lead-wire {
  font-family: 'Cormorant Garamond', serif;
  opacity: 0;
  animation: fade-in 2s cubic-bezier(0.25, 0.1, 0.25, 1) 1.8s both;
  --to-opacity: 0.3;
}
.depth-1 { padding-top: 8vh; }
.depth-2 { padding-top: 8vh; }
.depth-3 { padding-top: 5vh; padding-bottom: 15vh; }
.depth-4 { padding-top: 10vh; }
.depth-5 { padding-top: 5vh; padding-bottom: 12vh; }
.depth-6 { padding-top: 10vh; }
.depth-7 { padding-top: 8vh; }
.depth-8 { padding-top: 5vh; padding-bottom: 20vh; }


/* ========== FLOOR ========== */

.floor {
  background: var(--stone);
  color: var(--cream);
  padding: 6rem 4.5rem 3rem;
  text-align: center;
}

.floor-line {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-style: italic;
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  letter-spacing: 0.02em;
  color: var(--cream-2);
  margin-bottom: 4rem;
}

.floor-mark {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}


/* ========== MOBILE ========== */

@media (max-width: 768px) {
  .scene {
    padding: 2rem 1.8rem;
  }

  .headline-desktop {
    display: none;
  }

  .headline-mobile {
    display: block;
  }

  main {
    padding: 0 4vw;
    justify-content: flex-start;
    padding-top: 8vh;
  }

  .headline {
    font-size: clamp(4rem, 17vw, 6rem);
    line-height: 1.0;
    letter-spacing: -0.03em;
    max-width: none;
  }

  .yours {
    font-size: 2rem;
    margin-top: 2.5rem;
  }

  .fold-footer {
    justify-content: flex-start;
    padding-left: 4vw;
    margin-bottom: 1rem;
  }

  .invite-input {
    width: 160px;
    font-size: 0.9rem;
  }

  .scene {
    height: 100dvh;
  }

  .painting {
    margin-top: -4rem;
    height: 40vh;
    min-height: 280px;
  }

  .painting-img {
    object-position: 30% 55%;
  }

  .depths {
    padding: 0 1.8rem 8vh;
    margin-top: -4rem;
  }

  .depth-section {
    padding: 12vh 0;
  }

  .frag-large {
    font-size: clamp(2rem, 9vw, 3rem);
  }

  .frag-mid {
    font-size: clamp(1.5rem, 6vw, 2rem);
  }

  .frag-small {
    font-size: clamp(0.95rem, 3.5vw, 1.1rem);
  }

  .fragment[style*="flex-end"] {
    align-self: flex-end !important;
    max-width: 75%;
  }

  .depth-1 { padding-top: 12vh; }
  .depth-2 { padding-top: 10vh; }
  .depth-3 { padding-top: 8vh; padding-bottom: 14vh; }
  .depth-4 { padding-top: 12vh; }
  .depth-5 { padding-top: 8vh; padding-bottom: 14vh; }
  .depth-6 { padding-top: 12vh; }
  .depth-7 { padding-top: 10vh; }
  .depth-8 { padding-top: 8vh; padding-bottom: 16vh; }
}
