/* The invitation's handwriting (Bendina Sambat). Its numbers, "+" and "&" come from
   Licorice, exactly as on the printed invitation. */
@font-face { font-family: "Invito"; src: url("assets/fonts/bendina-sambat.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Invito"; src: url("assets/fonts/licorice.woff2") format("woff2"); font-display: swap; unicode-range: U+0030-0039, U+002B, U+0026; size-adjust: 125%; }

/* Colours and fonts: change here, applies everywhere. */
:root {
  --sage-deep: #657d64;    /* opening and footer */
  --sage: #9aa79c;         /* thin lines, small ornaments */
  --sage-light: #e3dfd0;   /* empty photo frames, soft fills */
  --cream: #f1ece0;        /* the page: the invitation paper */
  --white: #ffffff;
  --ink: #163d28;          /* the invitation green: all text on the page */

  --font-script: "Invito", "Licorice", cursive;         /* names, section titles */
  --font-body: "Cormorant Garamond", "Garamond", serif; /* everything else */

  --ease: cubic-bezier(.22, .61, .36, 1);
  --nav-h: 3.25rem;
  --curve: clamp(2.25rem, 9vw, 4.5rem);   /* depth of the soft arc under the opening / above the footer */
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--cream); color: var(--ink);
  font: 400 1.125rem/1.55 var(--font-body); font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased; overflow-x: clip;
}
body.is-save-the-date { background: var(--sage-deep); }
img, video { display: block; max-width: 100%; }
p, h1, h2, h3, figure { margin: 0; font-weight: 400; }
[hidden] { display: none !important; }
[data-t] { white-space: pre-line; }

/* ------------------------------------------------------------ type
   Handwritten lines are tilted a little, like on the invitation; titles are
   lowercase. The padding keeps the long strokes from being cut. */
.eyebrow { font-weight: 500; font-size: clamp(.85rem, 3.4vw, 1.1rem); letter-spacing: .3em; text-indent: .3em; text-transform: uppercase; }
.names { font: 400 clamp(1.9rem, 9vw, 4rem)/1.5 var(--font-script); padding: 0 .2em; margin-top: .25em; rotate: -4deg; white-space: nowrap; }
.date { font-size: clamp(1.7rem, 7.5vw, 2.4rem); letter-spacing: .14em; text-indent: .14em; line-height: 1.1; }
.place, .caps { font-size: clamp(.8rem, 3.3vw, 1rem); letter-spacing: .26em; text-indent: .26em; text-transform: uppercase; }
.place { margin-top: .3rem; }
.soon { margin-top: clamp(.9rem, 3dvh, 1.6rem); font-style: italic; font-size: clamp(1.05rem, 4.4vw, 1.3rem); opacity: .9; }
.kicker { font-size: .78rem; font-weight: 600; letter-spacing: .3em; text-indent: .3em; text-transform: uppercase; color: var(--sage-deep); }
.title { font: 400 clamp(2.1rem, 9.5vw, 3.2rem)/1.5 var(--font-script); padding: 0 .35em; margin: .25em 0 .35em; color: var(--ink); text-transform: lowercase; rotate: -3deg; }
.big { font-size: clamp(1.5rem, 6.5vw, 2rem); line-height: 1.2; }
.big--date { font-size: clamp(1.7rem, 7.4vw, 2.5rem); margin-top: .5rem; }
.text { font-size: 1.15rem; font-style: italic; max-width: 30rem; margin-inline: auto; }

/* ------------------------------------------------------------ menu */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 20; height: calc(var(--nav-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) .9rem 0; display: flex; align-items: center; gap: .9rem;
  background: rgba(241, 236, 224, .94); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 rgba(22, 61, 40, .16);
  transform: translateY(-110%); transition: transform .5s var(--ease);
}
.nav.is-shown { transform: none; }
.nav__logo { flex: none; color: var(--ink); text-decoration: none; }
.nav__logo img { height: 2.3rem; width: auto; }
.nav__mono { font: 1.7rem/1.3 var(--font-script); white-space: nowrap; padding: 0 .2em; }
.nav__mono i { font-size: .7em; font-style: normal; }
.nav__links {
  flex: 1; display: flex; justify-content: safe center; gap: clamp(.75rem, 3.4vw, 2.2rem);
  overflow-x: auto; scrollbar-width: none;
}
.nav__links::-webkit-scrollbar { display: none; }
.nav__links a {
  position: relative; flex: none; padding: .5rem 0; color: var(--ink); text-decoration: none; white-space: nowrap;
  font-size: clamp(.62rem, 2.7vw, .74rem); font-weight: 600; letter-spacing: .13em; text-transform: uppercase;
}
.nav__links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: .25rem; height: 1px; background: var(--ink); transform: scaleX(0); transition: transform .35s var(--ease); }
.nav__links a.is-active::after, .nav__links a:hover::after { transform: scaleX(1); }
.nav__rsvp { flex: none; padding: .35rem .8rem; background: var(--ink); color: var(--white); border: 0; font: 600 .72rem var(--font-body); letter-spacing: .16em; cursor: pointer; }
@media (max-width: 480px) { .nav { gap: .5rem; padding-inline: .6rem; } .nav__mono { font-size: 1.35rem; } .nav__logo img { height: 2rem; } }

/* ------------------------------------------------------------ opening */
.opening {
  position: relative; min-height: 100svh; overflow: hidden;
  background: var(--sage-deep); color: var(--white);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(.4rem, 2dvh, 1.25rem); text-align: center;
  padding: calc(1rem + env(safe-area-inset-top)) 1rem calc(3.6rem + var(--curve));
}
.is-save-the-date .opening { min-height: 100dvh; padding-bottom: calc(1.25rem + env(safe-area-inset-bottom)); }
/* The opening ends in one soft arc into the cream page (full website only). */
body:not(.is-save-the-date) .opening::after {
  content: ""; position: absolute; left: -15%; right: -15%; bottom: -1px; height: var(--curve);
  background: var(--cream); border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}

/* Camera stage: everything shares one 961x1382 coordinate space, so positions
   are percentages of the stage. */
.stage {
  position: relative; flex: none; padding: 0; border: 0; background: none; cursor: pointer;
  height: min(52svh, 128vw, 620px); aspect-ratio: 961 / 1382;
  -webkit-tap-highlight-color: transparent;
}
.stage .layer { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* Flower: one image (content/flower.png), mirrored on the right.
   Move/resize it here if a new flower sits differently. */
.flower { position: absolute; width: 42.35%; height: 40.6%; object-fit: contain; object-position: right bottom; pointer-events: none; }
.flower--left  { left: 0.1%;  top: 31.6%; }
.flower--right { left: 57.55%; top: 27.4%; transform: scaleX(-1); }

.print { position: absolute; inset: 0; transform: translateY(40%); animation: print 2.4s .6s var(--ease) forwards; }
.photo {
  position: absolute; left: 31.48%; top: 3.70%; width: 34.43%; height: 32.32%;
  object-fit: cover;
  filter: brightness(1.6) saturate(0) blur(1px);
  animation: develop 3.5s 1.8s ease-out forwards;
}
@keyframes print { to { transform: translateY(0); } }
@keyframes develop { to { filter: none; } }

.flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.is-flashing .flash { animation: flash .6s ease-out; }
@keyframes flash { 0% { opacity: 0; } 15% { opacity: .9; } 100% { opacity: 0; } }

.opening__foot { opacity: 0; animation: fade-in 1s 2.4s forwards; }
@keyframes fade-in { to { opacity: 1; } }

.scroll-cue {
  position: absolute; z-index: 1; left: 50%; bottom: calc(var(--curve) + .5rem); transform: translateX(-50%);
  display: grid; justify-items: center; gap: .15rem; color: var(--white); text-decoration: none;
  font-size: .68rem; font-weight: 600; letter-spacing: .3em; text-indent: .3em; text-transform: uppercase;
  opacity: 0; animation: fade-in 1s 3.2s forwards;
}
.scroll-cue i { width: .7rem; height: .7rem; border: solid currentColor; border-width: 0 1px 1px 0; transform: rotate(45deg); animation: nudge 2.2s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(.3rem) rotate(45deg); } }

/* ------------------------------------------------------------ buttons */
.cta, .btn {
  display: inline-block; margin-top: clamp(.6rem, 2dvh, 1.1rem); padding: .65rem 1.6rem;
  background: none; color: inherit; border: 1px solid currentColor; text-decoration: none;
  font: 500 clamp(.95rem, 4vw, 1.1rem) var(--font-body); text-transform: uppercase; letter-spacing: .14em;
  cursor: pointer; transition: background .3s, color .3s, border-color .3s;
}
.cta:hover, .cta:focus-visible { background: var(--white); color: var(--sage-deep); outline: none; }
.btn { color: var(--ink); margin-top: 1.4rem; }
.btn:hover, .btn:focus-visible { background: var(--ink); color: var(--cream); border-color: var(--ink); outline: none; }
.cta--solid { background: var(--ink); color: var(--cream); border-color: var(--ink); justify-self: center; }
.cta--solid:hover, .cta--solid:focus-visible { background: var(--sage-deep); color: var(--white); border-color: var(--sage-deep); }
.cta[disabled] { opacity: .6; cursor: default; }

/* ------------------------------------------------------------ sections
   One cream page. Sections are separated by air and a small ornament:
   a hairline, a tiny leaf sprig, a hairline. */
.section {
  position: relative; text-align: center; max-width: 58rem; margin: 0 auto;
  padding: clamp(3.75rem, 13vw, 5.5rem) 1.5rem;
  scroll-margin-top: var(--nav-h);
}
#date { padding-top: clamp(2.5rem, 9vw, 4rem); }
.section + .section::before {
  content: ""; position: absolute; top: -12px; left: 50%; width: min(15rem, 62%); height: 24px; transform: translateX(-50%);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 24'%3E%3Cg fill='%239aa79c'%3E%3Cpath d='M20 12c-3.500-5-8-5.500-12-3 3.500 4 8 5 12 3z'/%3E%3Cpath d='M20 12c3.500-5 8-5.500 12-3-3.500 4-8 5-12 3z'/%3E%3Ccircle cx='20' cy='12' r='1.600'/%3E%3C/g%3E%3C/svg%3E") center / 40px 24px no-repeat,
    linear-gradient(var(--sage), var(--sage)) left center / calc(50% - 30px) 1px no-repeat,
    linear-gradient(var(--sage), var(--sage)) right center / calc(50% - 30px) 1px no-repeat;
  opacity: .8;
}
.section .caps { margin: .4rem 0 .9rem; opacity: .75; }

/* Countdown: plain numbers separated by hairlines */
.countdown { display: flex; justify-content: center; margin-top: 1.4rem; }
.countdown div { display: grid; justify-items: center; min-width: clamp(4.2rem, 21vw, 6.5rem); padding: .1rem 0; }
.countdown div + div { border-left: 1px solid var(--sage); }
.countdown b { font: 400 clamp(1.9rem, 8.5vw, 2.8rem)/1.1 var(--font-body); font-variant-numeric: lining-nums tabular-nums; }
.countdown small { font-size: .64rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--sage-deep); }

/* Our story: a strip of small Polaroids that scrolls sideways (about three
   fit on a phone, the next one peeks in). */
.snaps {
  --gap: clamp(.6rem, 3vw, 1.5rem);
  display: flex; gap: var(--gap); margin: 1.5rem -1.5rem 0; padding: 1.25rem 1.5rem 2rem;
  overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: 1.5rem;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; outline: none;
}
.snaps::-webkit-scrollbar { display: none; }
.snap {
  flex: 0 0 calc((100% - 3 * var(--gap)) / 3.25); max-width: 12.5rem; scroll-snap-align: start; background: var(--white);
  padding: clamp(.3rem, 1.4vw, .6rem) clamp(.3rem, 1.4vw, .6rem) clamp(1.1rem, 5vw, 2.2rem);
  box-shadow: 0 0 0 1px rgba(22,61,40,.06), 0 12px 22px -14px rgba(22,61,40,.45);
}
.snap img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: var(--sage-light); }
.snap:nth-child(3n+1) { rotate: -2.5deg; }
.snap:nth-child(3n+2) { rotate: 1.5deg; margin-top: .7rem; }
.snap:nth-child(3n)   { rotate: -1deg; }

/* Proposal video */
.video {
  position: relative; max-width: 44rem; margin: 2rem auto 0; aspect-ratio: 16 / 9; overflow: hidden;
  background: var(--sage-light); border-radius: 1rem;
  box-shadow: 0 0 0 1px rgba(22,61,40,.06), 0 18px 34px -20px rgba(22,61,40,.5);
}
.video video { width: 100%; height: 100%; object-fit: cover; }
.video__soon { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: .6rem; color: var(--sage-deep); font-style: italic; }
.video__soon svg { width: 3.4rem; height: 3.4rem; fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linejoin: round; }

/* Come arrivare: three ways, no boxes */
.ways { display: grid; gap: 2rem; margin-top: 1.5rem; }
.ways h3 { font: 400 1.6rem/1.6 var(--font-script); color: var(--ink); padding: 0 .3em; text-transform: lowercase; }
.ways article + article { padding-top: 2rem; border-top: 1px solid rgba(154,167,156,.6); max-width: 20rem; width: 100%; margin-inline: auto; }
@media (min-width: 760px) {
  .ways { grid-template-columns: repeat(3, 1fr); gap: 0; }
  .ways article + article { padding: 0 1rem; border-top: 0; border-left: 1px solid rgba(154,167,156,.6); max-width: none; }
  .ways .reveal:nth-child(2) { transition-delay: .12s; }
  .ways .reveal:nth-child(3) { transition-delay: .24s; }
}
.icon { width: 2.75rem; height: 2.75rem; fill: none; stroke: var(--ink); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------------------ footer */
.footer {
  position: relative; overflow: hidden; margin-top: 1rem; text-align: center;
  background: var(--sage-deep); color: var(--white);
  padding: calc(var(--curve) + 3.5rem) 1.5rem calc(3.5rem + env(safe-area-inset-bottom));
}
.footer::before {
  content: ""; position: absolute; left: -15%; right: -15%; top: -1px; height: var(--curve);
  background: var(--cream); border-radius: 0 0 50% 50% / 0 0 100% 100%;
}
.footer .kicker { color: inherit; opacity: .85; }
.footer .names { margin: .2rem 0; }
.footer__logo { width: 4.5rem; margin: 0 auto 1.4rem; }

/* Things fade up gently as they scroll into view */
.reveal { opacity: 0; translate: 0 18px; transition: opacity 1s var(--ease), translate 1s var(--ease); }
.reveal.is-in { opacity: 1; translate: none; }

/* ------------------------------------------------------------ RSVP */
.rsvp {
  width: min(30rem, calc(100vw - 1.5rem)); max-height: calc(100dvh - 1.5rem);
  padding: 2rem clamp(1.1rem, 5vw, 2.25rem) 1.75rem; border: 0; border-radius: 2px;
  background: var(--cream); color: var(--ink); text-align: center;
  box-shadow: 0 30px 80px rgba(0,0,0,.35);
}
.rsvp:focus { outline: none; }
.rsvp::backdrop { background: rgba(40, 54, 40, .6); backdrop-filter: blur(3px); }
.rsvp[open] { animation: rise .45s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
.rsvp__close { position: absolute; top: .3rem; right: .5rem; width: 2.75rem; height: 2.75rem; border: 0; background: none; font-size: 1.9rem; line-height: 1; color: var(--ink); cursor: pointer; }
.rsvp__title { font: 400 2.6rem/1.5 var(--font-script); text-transform: lowercase; color: var(--ink); }
.rsvp__lead { margin: .6rem 0 1.4rem; font-style: italic; font-size: 1rem; }
.rsvp form, .rsvp .if-yes { display: grid; gap: 1.1rem; text-align: left; }
.rsvp label, .rsvp legend { display: grid; gap: .3rem; padding: 0; font-size: .72rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; }
.rsvp input:not([type=radio]), .rsvp select, .rsvp textarea {
  width: 100%; padding: .45rem 0; border: 0; border-bottom: 1px solid rgba(22,61,40,.4); border-radius: 0;
  background: none; color: var(--ink); font: 400 1.15rem var(--font-body); letter-spacing: normal; text-transform: none; resize: vertical;
}
.rsvp input:focus, .rsvp select:focus, .rsvp textarea:focus { outline: none; border-bottom-color: var(--ink); box-shadow: 0 1px 0 var(--ink); }
.rsvp fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: .5rem; }
.rsvp .choice { display: flex; align-items: center; gap: .6rem; font: 400 1.15rem var(--font-body); letter-spacing: normal; text-transform: none; cursor: pointer; }
.rsvp .choice input { accent-color: var(--ink); width: 1.1rem; height: 1.1rem; margin: 0; }
.rsvp__error { color: #9b2c2c; text-align: center; font-style: italic; }
.rsvp__thanks { display: grid; gap: .5rem; padding: 1rem 0 .5rem; color: var(--ink); font-size: 1.2rem; font-style: italic; }
.rsvp__thanks .names { font-style: normal; }
.rsvp__preview { margin-top: 1rem; padding: .6rem .8rem; background: var(--sage-light); color: var(--ink); font-size: .9rem; font-style: normal; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .print { transform: none; } .photo { filter: none; }
  .opening__foot, .scroll-cue, .reveal { opacity: 1; }
  .reveal { translate: none; }
}
