/* ==========================================================================
   Trouwwebsite Niels & Fleur — kleuren uit het moodboard
   ========================================================================== */

:root {
  --terracotta: #BC6C4A;
  --terracotta-dark: #A05537;
  --blush: #E9C4BC;
  --blush-light: #F3DCD6;
  --sage: #A9B49B;
  --sage-dark: #8A9880;
  --sage-light: #C5CDBA;
  --ivory: #F7F3EC;
  --paper: #FDFBF6;
  --gold: #B08D3E;
  --gold-light: #C9A75C;
  --ink: #4A4139;
  --ink-soft: #6E6459;

  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Montserrat", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 300;
  color: var(--ink);
  background: var(--ivory);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

body.no-scroll { overflow: hidden; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 500; margin: 0; }

/* subtiele linnen-textuur op de achtergrond */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(0deg, rgba(74, 65, 57, 0.02) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(74, 65, 57, 0.02) 0 1px, transparent 1px 3px);
  z-index: 0;
}

/* ==========================================================================
   Envelop-welkomstscherm
   ========================================================================== */

#envelope-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 50% 35%, #FBF8F1 0%, var(--ivory) 60%, #EFE8DC 100%);
  transition: opacity 0.9s ease 0.2s, visibility 0.9s ease 0.2s;
}

#envelope-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.envelope-scene {
  text-align: center;
  perspective: 1200px;
}

.envelope {
  position: relative;
  display: block;
  width: min(420px, 84vw);
  aspect-ratio: 10 / 7;
  margin: 0 auto;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  transform-style: preserve-3d;
  animation: envelope-float 3.5s ease-in-out infinite;
  -webkit-tap-highlight-color: transparent;
}

.envelope:focus-visible { outline: 2px solid var(--gold); outline-offset: 12px; }

@keyframes envelope-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

.envelope.is-open { animation: none; }

/* achterkant */
.envelope-back {
  position: absolute;
  inset: 0;
  background: var(--sage);
  border-radius: 6px;
  box-shadow: 0 24px 50px -18px rgba(74, 65, 57, 0.45);
  z-index: 1;
}

/* de brief in de envelop */
.envelope-letter {
  position: absolute;
  left: 6%;
  right: 6%;
  top: 7%;
  bottom: 10%;
  background: var(--paper);
  border-radius: 3px;
  box-shadow: 0 4px 14px rgba(74, 65, 57, 0.18);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1em;
  padding: 1em;
  transition: transform 1s cubic-bezier(0.3, 0.7, 0.3, 1) 0.75s;
}

.letter-branch { width: 40%; margin-bottom: 0.4em; }

.letter-kicker {
  margin: 0;
  font-size: clamp(0.55rem, 2vw, 0.72rem);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.letter-names {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 6vw, 2.3rem);
  color: var(--terracotta);
}

.letter-date {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(0.9rem, 3vw, 1.15rem);
  letter-spacing: 0.2em;
  color: var(--gold);
}

.envelope.is-open .envelope-letter {
  transform: translateY(-72%) scale(1.04);
}

/* voorkant: zijvouwen + onderste vouw (bedekken samen met de klep de hele envelop) */
.envelope-pocket {
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: 6px;
  overflow: hidden;
  pointer-events: none;
}

.fold {
  position: absolute;
  inset: 0;
}

.fold-left {
  background: linear-gradient(to right, var(--sage-light), var(--sage) 55%);
  clip-path: polygon(0 0, 50% 50%, 0 100%);
  filter: drop-shadow(2px 0 3px rgba(74, 65, 57, 0.18));
}

.fold-right {
  background: linear-gradient(to left, var(--sage-light), var(--sage) 55%);
  clip-path: polygon(100% 0, 50% 50%, 100% 100%);
  filter: drop-shadow(-2px 0 3px rgba(74, 65, 57, 0.18));
}

.fold-bottom {
  background: linear-gradient(to bottom, var(--sage) 42%, var(--sage-light) 100%);
  clip-path: polygon(0 100%, 50% 42%, 100% 100%);
  filter: drop-shadow(0 -2px 3px rgba(74, 65, 57, 0.18));
}

/* bovenklep */
.envelope-flap {
  position: absolute;
  inset: 0;
  z-index: 4;
  background: linear-gradient(to bottom, var(--sage-dark) 0%, var(--sage) 95%);
  clip-path: polygon(0 0, 100% 0, 50% 58%);
  border-radius: 6px 6px 0 0;
  transform-origin: top center;
  transition: transform 0.8s cubic-bezier(0.6, 0.05, 0.4, 1), z-index 0s 0.75s;
  backface-visibility: hidden;
}

.envelope.is-open .envelope-flap {
  transform: rotateX(180deg);
  z-index: 1;
}

/* wax-zegel */
.wax-seal {
  position: absolute;
  left: 50%;
  top: 58%;
  z-index: 5;
  width: 21%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 46% 54% 52% 48% / 52% 47% 53% 48%;
  background:
    radial-gradient(circle at 32% 30%, var(--gold-light) 0%, var(--gold) 45%, #8F6F2C 100%);
  box-shadow:
    inset 0 2px 5px rgba(255, 240, 200, 0.55),
    inset 0 -3px 6px rgba(74, 55, 15, 0.45),
    0 3px 8px rgba(74, 65, 57, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.45s ease, opacity 0.45s ease;
  animation: seal-pulse 3.5s ease-in-out infinite;
}

.wax-seal::before {
  content: "";
  position: absolute;
  inset: 12%;
  border-radius: inherit;
  border: 1.5px solid rgba(247, 243, 236, 0.55);
}

@keyframes seal-pulse {
  0%, 100% { box-shadow: inset 0 2px 5px rgba(255,240,200,.55), inset 0 -3px 6px rgba(74,55,15,.45), 0 3px 8px rgba(74,65,57,.35), 0 0 0 0 rgba(176,141,62,.35); }
  50%      { box-shadow: inset 0 2px 5px rgba(255,240,200,.55), inset 0 -3px 6px rgba(74,55,15,.45), 0 3px 8px rgba(74,65,57,.35), 0 0 0 14px rgba(176,141,62,0); }
}

.wax-initials {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 4.4vw, 1.6rem);
  font-style: italic;
  color: var(--ivory);
  text-shadow: 0 1px 2px rgba(74, 55, 15, 0.5);
}

.envelope.is-open .wax-seal {
  transform: translate(-50%, -50%) scale(1.25);
  opacity: 0;
  animation: none;
}

.envelope-hint {
  margin-top: 3rem;
  font-size: 0.78rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-soft);
  animation: hint-fade 2.4s ease-in-out infinite;
  transition: opacity 0.4s ease;
}

.envelope.is-open ~ .envelope-hint,
#envelope-overlay.is-opening .envelope-hint { opacity: 0; }

@keyframes hint-fade {
  0%, 100% { opacity: 0.45; }
  50%      { opacity: 1; }
}

/* ==========================================================================
   Site — algemeen
   ========================================================================== */

.site { position: relative; z-index: 1; }

.site.is-revealed { animation: site-fade 1.2s ease both; }

@keyframes site-fade {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

.section {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(3.5rem, 9vw, 6rem) 1.5rem;
}

.section-title {
  font-size: clamp(1.9rem, 5.5vw, 2.6rem);
  text-align: center;
  color: var(--ink);
  margin-bottom: 0.4em;
}

.section-title::after {
  content: "";
  display: block;
  width: 64px;
  height: 2px;
  margin: 0.55em auto 0;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
}

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.95em 2.2em;
  border-radius: 999px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.15s ease;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--terracotta);
  color: var(--ivory);
}

.btn-primary:hover { background: var(--terracotta-dark); }

.btn-outline {
  background: transparent;
  color: var(--terracotta);
  border-color: var(--terracotta);
}

.btn-outline:hover { background: var(--blush-light); }

.btn-small { padding: 0.7em 1.6em; font-size: 0.72rem; }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  padding: clamp(2.5rem, 8vh, 5rem) 1.5rem clamp(2.25rem, 6vh, 4rem);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  /* warme dusk-gradient als terugval wanneer de foto er (nog) niet is */
  background: linear-gradient(180deg, #3A2E24 0%, #55402E 55%, #6B4E34 100%);
}

/* tekst bovenin, knop onderin — het midden blijft vrij voor de foto */
.hero-top {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Fotolagen achter de hero-tekst */
.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-media > div { position: absolute; inset: 0; }

.hero-photo {
  /* Zet hier jullie eigen foto neer: img/save-the-date.png
     (staat de foto er nog niet? dan valt de hero terug op een warme dusk-gradient) */
  background: url("../img/save-the-date.png") center 42% / cover no-repeat;
}

/* warme, donkere overlay + zachte vignette voor leesbaarheid van de tekst */
.hero-overlay {
  background:
    radial-gradient(ellipse at 50% 44%, rgba(40, 31, 23, 0.30) 0%, rgba(40, 31, 23, 0.68) 100%),
    linear-gradient(180deg, rgba(40, 31, 23, 0.55) 0%, rgba(40, 31, 23, 0.62) 55%, rgba(40, 31, 23, 0.78) 100%);
}

/* subtiel stippenpatroon over de foto */
.hero-pattern {
  background-image: radial-gradient(rgba(247, 243, 236, 0.09) 1px, transparent 1.4px);
  background-size: 22px 22px;
  mix-blend-mode: soft-light;
  opacity: 0.7;
}

/* alle hero-inhoud boven de fotolagen */
.hero > :not(.hero-media) { position: relative; z-index: 1; }

.branch { color: var(--sage-dark); width: min(300px, 62vw); }

.hero .branch-top { color: rgba(247, 243, 236, 0.5); }

.hero-kicker {
  font-size: 0.8rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--blush);
  margin: 1.6rem 0 0.4rem;
}

.hero-names {
  font-size: clamp(3rem, 11vw, 5.5rem);
  line-height: 1.1;
  color: var(--ivory);
  text-shadow: 0 2px 22px rgba(28, 20, 13, 0.5);
}

.hero-names .amp {
  font-style: italic;
  color: var(--gold-light);
  font-size: 0.7em;
  padding: 0 0.12em;
}

.hero-date {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 4.5vw, 2rem);
  letter-spacing: 0.3em;
  color: var(--ivory);
  margin: 0.7rem 0 0.2rem;
  text-shadow: 0 2px 18px rgba(28, 20, 13, 0.5);
}

.hero-countdown {
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(247, 243, 236, 0.85);
  margin: 0 0 2.2rem;
}

.hero-countdown span { color: var(--gold-light); font-weight: 500; }

.hero-cta { margin-top: 1rem; }

/* ==========================================================================
   Locatie
   ========================================================================== */

.section-location {
  background: transparent;
}

.location-card {
  background: var(--paper);
  border: 1px solid rgba(176, 141, 62, 0.25);
  border-radius: 8px;
  box-shadow: 0 16px 40px -24px rgba(74, 65, 57, 0.35);
  padding: clamp(2rem, 6vw, 3.2rem);
  text-align: center;
}

.location-icon { width: 42px; color: var(--terracotta); }

.location-name {
  font-size: clamp(1.6rem, 4.5vw, 2.1rem);
  margin-top: 0.3em;
}

.location-city {
  font-size: 0.85rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--sage-dark);
  margin: 0.2em 0 1.2em;
}

.location-text { max-width: 42ch; margin: 0 auto 1.8em; }

/* ==========================================================================
   Dagplanning — timeline
   ========================================================================== */

.section-program {
  background: linear-gradient(to bottom, transparent, rgba(169, 180, 155, 0.16), transparent);
}

.timeline {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 27px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, transparent, var(--sage) 8%, var(--sage) 92%, transparent);
}

.timeline-item {
  position: relative;
  display: flex;
  gap: 1.4rem;
  padding: 0 0 2.4rem 0;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-marker {
  flex: 0 0 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--sage);
  color: var(--terracotta);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  box-shadow: 0 4px 10px -4px rgba(74, 65, 57, 0.3);
}

.timeline-marker svg { width: 26px; height: 26px; }

.timeline-time {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--gold);
  background: rgba(176, 141, 62, 0.12);
  border-radius: 999px;
  padding: 0.15em 0.9em;
  margin-bottom: 0.25em;
}

.timeline-title { font-size: 1.45rem; }

.timeline-text { margin: 0.15em 0 0; color: var(--ink-soft); }

/* ==========================================================================
   RSVP-formulier
   ========================================================================== */

.rsvp-intro {
  text-align: center;
  max-width: 46ch;
  margin: 0 auto 2.6rem;
  color: var(--ink-soft);
}

#rsvp-form {
  background: var(--paper);
  border: 1px solid rgba(169, 180, 155, 0.5);
  border-radius: 8px;
  box-shadow: 0 16px 40px -24px rgba(74, 65, 57, 0.35);
  padding: clamp(1.6rem, 5vw, 2.8rem);
}

.form-field { margin-bottom: 1.4rem; }

.form-field label,
.form-radio legend,
.guests-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.5em;
}

.form-field input[type="text"],
.form-field input[type="email"],
.form-field textarea,
.guest-row input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 300;
  color: var(--ink);
  background: var(--ivory);
  border: 1px solid var(--sage-light);
  border-radius: 6px;
  padding: 0.8em 1em;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-field input:focus,
.form-field textarea:focus,
.guest-row input:focus {
  outline: none;
  border-color: var(--terracotta);
  box-shadow: 0 0 0 3px rgba(188, 108, 74, 0.15);
}

.form-field textarea { resize: vertical; }

.form-radio { border: none; margin: 0 0 1.4rem; padding: 0; }

.radio-option {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  margin-right: 1.6em;
  font-size: 0.95rem;
  cursor: pointer;
}

.radio-option input {
  appearance: none;
  width: 20px;
  height: 20px;
  margin: 0;
  border: 1.5px solid var(--sage-dark);
  border-radius: 50%;
  display: grid;
  place-content: center;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.radio-option input::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--terracotta);
  transform: scale(0);
  transition: transform 0.15s ease;
}

.radio-option input:checked { border-color: var(--terracotta); }
.radio-option input:checked::before { transform: scale(1); }

#attending-extra.is-hidden { display: none; }

.guests-block {
  margin-bottom: 1.4rem;
  padding: 1.1rem 1.2rem;
  background: rgba(169, 180, 155, 0.12);
  border-radius: 6px;
}

.guest-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

.guest-remove {
  border: none;
  background: none;
  color: var(--terracotta);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.4em;
  border-radius: 6px;
  transition: background 0.2s ease;
}

.guest-remove:hover { background: var(--blush-light); }

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.btn-submit { width: 100%; margin-top: 0.4rem; }

.btn-submit:disabled { opacity: 0.6; cursor: wait; }

.form-status {
  min-height: 1.4em;
  margin: 1em 0 0;
  text-align: center;
  font-size: 0.9rem;
}

.form-status.is-success { color: var(--sage-dark); }
.form-status.is-error { color: var(--terracotta-dark); }

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  text-align: center;
  padding: 3.5rem 1.5rem 3rem;
  background: linear-gradient(to bottom, transparent, rgba(233, 196, 188, 0.25));
}

.branch-footer { width: min(240px, 55vw); color: var(--sage-dark); }

.footer-names {
  font-family: var(--font-display);
  font-size: 1.7rem;
  color: var(--terracotta);
  margin: 0.6em 0 0.1em;
}

.footer-date {
  font-size: 0.78rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0;
}

/* ==========================================================================
   Responsief & toegankelijkheid
   ========================================================================== */

@media (max-width: 560px) {
  .guest-row { grid-template-columns: 1fr; }
  .guest-row .guest-remove { justify-self: end; }
  .radio-option { display: flex; margin: 0 0 0.7em; }
  .timeline::before { left: 23px; }
  .timeline-marker { flex-basis: 48px; height: 48px; }
  .timeline-marker svg { width: 22px; height: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .envelope, .wax-seal, .envelope-hint, .scroll-cue { animation: none; }
  .envelope-flap, .envelope-letter, .wax-seal { transition-duration: 0.01s; transition-delay: 0s; }
  #envelope-overlay { transition-duration: 0.01s; transition-delay: 0s; }
  .site.is-revealed { animation: none; }
}
