/* ==========================================================
   Wedding site — cleaned Canva export
   Layout: slides 1–4 are 1455 x 768 "design canvases".
   Elements are positioned in canvas pixels (left/top/width).
   script.js scales each canvas to fit the screen width.
   Slides 5+ (RSVP, FAQ, contacts) are normal flowing sections.
   ========================================================== */

:root {
  /* Colours */
  --cream: #f9f3e7;
  --off-white: #fbf7f3;
  --green: #a2a869;
  --black: #020202;

  /* Fonts — Canva exported these as IDs, not names.
     TODO: set the real family names (and add @font-face / Google Fonts link). */
  --font-names:   "YAEt2vnw7VE_1", sans-serif;  /* big "TERESA / TOMÁS" */
  --font-heading: "YACgEeV8bIQ_0", sans-serif;  /* section titles */
  --font-body:    "YAFdJpYuLss_0", sans-serif;  /* paragraphs, date, link, form */
  --font-button:  "YAGyDvJ_4Ts_0", sans-serif;  /* buttons */

  /* Motion */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; } /* leaves room for the navbar when jumping to a block */
html, body { background: var(--cream); }
body { font-family: var(--font-body); }

/* ---------- Slide framework ---------- */
.slide { position: relative; width: 100%; overflow: hidden; }
.stage {
  position: relative;
  width: 1455px;
  height: 768px;
  transform-origin: 0 0;
}
/* Everything inside .stage is absolutely positioned */
.stage > * { position: absolute; }

.bg-cream     { background: var(--cream); }
.bg-off-white { background: var(--off-white); }
.bg-green     { background: var(--green); }
.bg-black     { background: var(--black); }

/* ---------- Shared text styles ---------- */
.heading {
  font-family: var(--font-heading);
  font-size: 53.391px;
  line-height: 62px;
  letter-spacing: -0.05em;
  text-transform: uppercase;
  font-weight: 400;
}
.body-text {
  font-family: var(--font-body);
  font-size: 18.667px;
  line-height: 26px;
}
.body-text p + p { margin-top: 26px; }

/* ---------- Buttons (hero RSVP + form submit) ---------- */
.btn {
  display: flex; align-items: center; justify-content: center;
  width: 300px; height: 68px;
  background: var(--cream);
  border: 3px solid var(--black);
  border-radius: 100px;
  font-family: var(--font-button);
  font-size: 18.667px; font-weight: 700;
  color: #000; text-decoration: none;
  cursor: pointer;
  transition: background-color 0.25s, color 0.25s, transform 0.25s var(--ease);
}
.btn:hover, .btn:focus-visible { background: var(--black); color: var(--cream); transform: translateY(-3px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn:disabled { opacity: 0.6; cursor: wait; }

/* ---------- Slide 1: Hero ---------- */
.hero-photo { left: 44.5px; top: 135.2px; width: 767px; height: 614.7px; overflow: hidden; }
.hero-photo img { display: block; width: 100%; height: auto; }

.name {
  font-family: var(--font-names);
  font-size: 106.667px;
  line-height: 106px;
  letter-spacing: -0.036em;
  text-transform: uppercase;
  font-weight: 400;
  color: var(--green);
  white-space: nowrap;
}
.name-teresa { left: 702.7px; top: 180.3px; }
.name-tomas  { left: 884.1px; top: 339.4px; }

.date {
  left: 933.4px; top: 569px; width: 253.5px;
  font-size: 34.667px; line-height: 48px;
  text-align: center; color: var(--black);
}

.btn-rsvp-wrap { left: 910.2px; top: 671.2px; border-radius: 100px; }
.btn-rsvp-wrap .btn { animation: ring 2.8s ease-out 2.4s infinite; }

/* ---------- Slide 2: Our story ---------- */
.story-photo {
  left: 469.9px; top: 108.4px; width: 452.2px; height: 551.1px;
  filter: drop-shadow(14.142px 14.142px 10px rgba(0, 0, 0, 0.3));
}
.story-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.story-title { left: 157px; top: 266.8px; width: 283px; color: var(--cream); }
.story-text  { left: 971.2px; top: 176px; width: 387.6px; color: var(--cream); }

/* ---------- Slide 3: Two full-bleed photos ---------- */
/* The two photos meet in the middle and overlap by 1px so no green shows through. */
.photo-left  { left: 0;     top: 0; width: 728px; height: 768px; overflow: hidden; }
.photo-right { left: 727px; top: 0; width: 728px; height: 768px; overflow: hidden; }

/* ---------- Slide 4: Ceremony ---------- */
.ceremony-title {
  left: 367.1px; top: 35.6px; width: 720.8px;
  text-align: center; font-weight: 300; color: var(--green);
}
.ceremony-photo {
  left: 388.8px; top: 130px; width: 677.3px; height: 508px;
  border-radius: 100px; overflow: hidden;
}
.ceremony-address {
  left: 327.1px; top: 685.7px; width: 800.8px;
  font-size: 25.333px; line-height: 35px;
  text-align: center; color: var(--green);
}
.ceremony-address a { color: inherit; text-underline-offset: 6px; transition: text-decoration-thickness 0.2s; }
.ceremony-address a:hover { text-decoration-thickness: 3px; }

/* ---------- Photos that move slightly while scrolling ---------- */
/* .parallax is taller than its frame so it can drift without showing gaps */
.parallax { position: absolute; left: 0; right: 0; top: -6%; height: 112%; will-change: transform; }
.parallax img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ==========================================================
   Flowing sections (RSVP / FAQ / Contacts)
   ========================================================== */
.section { padding: 96px 8vw; min-height: 60vh; }
.section h2 {
  font-family: var(--font-heading);
  font-size: clamp(36px, 6vw, 53.391px); line-height: 1.16;
  letter-spacing: -0.05em; text-transform: uppercase; font-weight: 400;
  margin-bottom: 32px;
}
.section p { font-size: 18.667px; line-height: 26px; max-width: 60ch; }

/* ---------- RSVP form ---------- */
#rsvp { background: var(--green); color: var(--cream); }
.rsvp-inner { max-width: 720px; margin: 0 auto; }
#rsvp h2 { text-align: center; margin-bottom: 20px; }
.rsvp-intro { margin: 0 auto 48px; text-align: center; }

.rsvp-form { display: flex; flex-direction: column; gap: 32px; }
.field { border: 0; min-width: 0; }
.field > label, .field > legend {
  display: block; margin-bottom: 12px; padding: 0;
  font-size: 18.667px; line-height: 26px; font-weight: 700;
}

.rsvp-form input[type="text"],
.rsvp-form select,
.rsvp-form textarea {
  width: 100%;
  padding: 16px 28px;
  background: var(--cream);
  color: var(--black);
  border: 3px solid var(--black);
  border-radius: 100px;
  font-family: var(--font-body);
  font-size: 18.667px; line-height: 26px;
  transition: box-shadow 0.25s, transform 0.25s var(--ease);
}
.rsvp-form textarea { border-radius: 32px; resize: vertical; min-height: 190px; }
.rsvp-form select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  padding-right: 64px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='10' viewBox='0 0 16 10'%3E%3Cpath d='M1.5 1.5 8 8l6.5-6.5' fill='none' stroke='%23020202' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 28px center;
}
.rsvp-form input:focus-visible,
.rsvp-form select:focus-visible,
.rsvp-form textarea:focus-visible {
  outline: 3px solid var(--cream); outline-offset: 4px; transform: translateY(-2px);
}

/* Yes / No as pill toggles */
.choices { display: flex; flex-wrap: wrap; gap: 16px; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice span {
  display: block; padding: 14px 32px;
  background: var(--cream); color: var(--black);
  border: 3px solid var(--black); border-radius: 100px;
  font-family: var(--font-button); font-size: 18.667px; font-weight: 700;
  transition: background-color 0.25s, color 0.25s, transform 0.25s var(--ease);
}
.choice:hover span { transform: translateY(-3px); }
.choice input:checked + span { background: var(--black); color: var(--cream); }
.choice input:focus-visible + span { outline: 3px solid var(--cream); outline-offset: 4px; }

.field-error { display: none; margin-top: 10px; font-size: 16px; font-weight: 700; color: var(--black); }
.field.has-error .field-error { display: block; }
.field.has-error { animation: shake 0.45s; }

.form-actions { display: flex; flex-direction: column; align-items: center; gap: 16px; margin-top: 8px; }
.form-status { min-height: 26px; text-align: center; font-weight: 700; }

.rsvp-thanks { display: none; text-align: center; }
.rsvp-thanks.show { display: block; animation: pop 0.9s var(--ease) both; }
.rsvp-thanks h3 {
  font-family: var(--font-heading);
  font-size: clamp(30px, 5vw, 53.391px); line-height: 1.16;
  letter-spacing: -0.05em; text-transform: uppercase; font-weight: 400;
  margin-bottom: 16px;
}
.rsvp-thanks p { margin: 0 auto; }

/* ---------- FAQ ---------- */
#faq { background: var(--cream); color: var(--black); }
#faq h2 { color: var(--green); }
#faq .faq-item { display: grid; grid-template-columns: 64px 1fr; gap: 8px 16px; margin-bottom: 32px; }
#faq .faq-num { font-family: var(--font-heading); font-size: 34.667px; color: var(--green); grid-row: span 2; }
#faq h3 { font-size: 22px; }

/* ---------- Contacts ---------- */
#contacts { background: var(--black); color: var(--cream); }
#contacts .contact { margin-bottom: 24px; }
#contacts a { color: inherit; }

/* ==========================================================
   ANIMATIONS
   Elements with data-anim="..." start hidden and animate in when
   their section scrolls into view (script.js adds .in-view).
   Delay: style="--delay: .4s".  Everything below only applies when
   JS is running (html.js), so the page still works without it.
   ========================================================== */
.js [data-anim] {
  opacity: 0;
  transition: opacity 1s var(--ease), transform 1.1s var(--ease), clip-path 1.4s var(--ease);
  transition-delay: var(--delay, 0s);
}
.js [data-anim="up"]    { transform: translateY(60px); }
.js [data-anim="zoom"]  { transform: scale(0.85); }
.js [data-anim="tilt"]  { transform: translateY(70px) rotate(-4deg) scale(0.92); }
.js [data-anim="fade"]  { transform: none; }
/* Photos revealed with a wipe (the frame opens up) */
.js [data-anim="wipe-up"]   { opacity: 1; clip-path: inset(100% 0 0 0); }
.js [data-anim="wipe-down"] { opacity: 1; clip-path: inset(0 0 100% 0); }
.js [data-anim="wipe-round"] { opacity: 1; clip-path: inset(100% 0 0 0 round 100px); }

.js .in-view [data-anim] { opacity: 1; transform: none; }
.js .in-view [data-anim="wipe-up"],
.js .in-view [data-anim="wipe-down"] { clip-path: inset(0 0 0 0); }
.js .in-view [data-anim="wipe-round"] { clip-path: inset(0 0 0 0 round 100px); }

/* Photos settle from a slight zoom while their frame opens */
.js [data-anim^="wipe"] img { transform: scale(1.25); transition: transform 2.4s var(--ease); transition-delay: var(--delay, 0s); }
.js .in-view [data-anim^="wipe"] img { transform: scale(1); }

/* Headings: each line slides up out of a mask */
.heading .line { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.js .heading .line > span {
  display: inline-block;
  transform: translateY(115%);
  transition: transform 1.1s var(--ease);
  transition-delay: var(--delay, 0s);
}
.js .in-view .heading .line > span { transform: none; }

/* Names: letter by letter (letters are created by script.js) */
.name .ch { display: inline-block; }
.js .name .ch { opacity: 0; }
.js .in-view .name .ch {
  animation: letter-up 1s var(--ease) both;
  animation-delay: calc(var(--i) * 70ms + 150ms);
}

@keyframes letter-up {
  from { opacity: 0; transform: translateY(70%) rotate(8deg); }
  to   { opacity: 1; transform: none; }
}
@keyframes ring {
  0%   { box-shadow: 0 0 0 0 rgba(2, 2, 2, 0.35); }
  70%, 100% { box-shadow: 0 0 0 22px rgba(2, 2, 2, 0); }
}
@keyframes shake {
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
@keyframes pop {
  from { opacity: 0; transform: scale(0.9) translateY(24px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-anim], .js [data-anim] img, .js .heading .line > span, .js .name .ch {
    opacity: 1 !important; transform: none !important; clip-path: none !important;
    transition: none !important; animation: none !important;
  }
  .btn-rsvp-wrap .btn { animation: none; }
}

@media (max-width: 600px) {
  .section { padding: 64px 6vw; }
  .rsvp-form input[type="text"], .rsvp-form select { padding: 14px 22px; }
  .btn { width: 100%; max-width: 300px; }
}

/* ==========================================================
   NAVBAR
   Fixed, centered pill (same look as the buttons). The block
   you are currently viewing is highlighted (set by script.js).
   ========================================================== */
.nav-wrap {
  position: fixed; top: 16px; left: 0; right: 0; z-index: 100;
  display: flex; justify-content: center;
  pointer-events: none; /* only the pill itself is clickable */
}
.nav {
  pointer-events: auto;
  background: var(--cream);
  border: 3px solid var(--black);
  border-radius: 100px;
  padding: 6px;
}
.js .nav { animation: nav-in 1s var(--ease) 0.6s both; }

.nav-links { list-style: none; display: flex; align-items: center; justify-content: center; gap: 4px; }
.nav-links a {
  display: block; padding: 10px 20px;
  border-radius: 100px;
  font-family: var(--font-button); font-size: 16px; font-weight: 700; line-height: 22px;
  color: var(--black); text-decoration: none; white-space: nowrap;
  transition: background-color 0.25s, color 0.25s, transform 0.25s var(--ease);
}
.nav-links a:hover { background: rgba(2, 2, 2, 0.1); transform: translateY(-1px); }
.nav-links a.active { background: #a2a869; color: var(--cream); }
.nav-links a:focus-visible, .nav-toggle:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }

.nav-toggle { display: none; }

@keyframes nav-in {
  from { opacity: 0; transform: translateY(-140%); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .js .nav { animation: none; }
}

/* Phones: collapse into a "Menu" pill that opens a list */
@media (max-width: 860px) {
  html { scroll-padding-top: 76px; }
  .nav { border-radius: 32px; }
  .nav-toggle {
    display: block; width: 100%; padding: 10px 28px;
    background: transparent; border: 0; border-radius: 100px; cursor: pointer;
    font-family: var(--font-button); font-size: 16px; font-weight: 700; line-height: 22px; color: var(--black);
  }
  .nav-links { display: none; flex-direction: column; align-items: stretch; margin-top: 4px; min-width: 220px; }
  .nav-links a { text-align: center; }
  .nav.open .nav-links { display: flex; }
}
