@font-face {
  font-family: "IVY";
  src: url("/assets//fonts/IVY.otf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "Amalfi";
  src: url("/assets//fonts/Amalfi.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

:root {
  --white: #fff;
  --ink: #231f20;

  /* timings */
  --delay-start: 4s; /* when canvas should start fading */
  --fade: 1000ms; /* generic fade duration */
  --logo-hold: 350ms; /* how long the logo sits centered before shrink */
  --logo-slide: 900ms; /* header shrink duration */

  /* header (final) sizes — keep large so logo stays centered */
  --header-h: 20vh; /* was 60vh */
  --header-h-m: 17vh; /* was 55vh */

  /* logo sizing */
  --logo-w: min(50vw, 420px);

  /* content staggers */
  --content-gap: 80ms;
  --form-gap: 0ms;

  /* unlock scroll right as #invite starts fading in */
  --unlock-delay: calc(
    var(--delay-start) + var(--fade) + var(--logo-hold) + var(--logo-slide) +
      var(--content-gap)
  );
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  max-width: 100vw;
  color: var(--ink);
  font-family: IVY, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    Arial, sans-serif;
  overflow: hidden;
}

body {
  /* prevent mobile browser chrome jumps while locked */
  /* height: 100dvh; */

  /* flip scrolling back on at the unlock moment */
  animation: allowScroll 1ms steps(1, end) forwards var(--unlock-delay);
}

@keyframes allowScroll {
  to {
    overflow-y: auto;
    /* height: auto; */
  }
}

.global-wrapper {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  min-height: 100%;
  position: relative;
  overflow-x: hidden;
  overflow: hidden;
  animation: allowScroll 1ms steps(1, end) forwards var(--unlock-delay);

  background-image: url("../assets/images/bg-1.webp");
  background-size: "contain";
  background-position: "center center";
}

.content {
  font-size: 20px;
  line-height: 1.8;
}

.link-to-maps {
  text-decoration: underline;
  color: var(--ink);
}

.link-to-maps span {
  display: block;
  padding-left: 30px;
}

.icon {
  display: inline-block;
  width: 22px;
  height: auto;
  margin-right: 4px;
  position: relative;
  top: 4px;
}

#c {
  position: absolute;
  top: 45px;
  left: calc(-1 * (50vw - 50%));
  /* padding-left: 20px; */
  right: 0;
  display: block;
  z-index: 10;
  opacity: 1;
  animation: canvasFadeOut var(--fade) ease forwards;
  animation-delay: var(--delay-start);
  background: none;
}
@keyframes canvasFadeOut {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

/* ===== SHRINKING HEADER =====
   - starts full viewport height (logo centered)
   - shrinks to a tall band so the logo remains centered on screen
*/
#masthead {
  position: relative;
  max-width: 720px;
  margin-inline: auto;
  z-index: 2;
  display: grid;
  place-items: center;
  height: 100vh;
  top: -55px;
  padding: 16px;
  animation: headerShrink var(--logo-slide) ease forwards
    calc(var(--delay-start) + var(--fade) + var(--logo-hold));
}
@keyframes headerShrink {
  to {
    height: var(--header-h);
    top: 10px;
  }
}

/* ===== Logo =====
   - fades in; no scale or movement so it stays centered
*/
#logo {
  width: var(--logo-w);
  height: auto;
  /* margin-top: 15px; */
  opacity: 0;
  transform: none;
  will-change: opacity;
  animation: logoFadeIn var(--fade) ease forwards
    calc(var(--delay-start) - 1800ms);

  /* add this: when the logo itself is in place, we'll start letter animation */
  --logo-text-delay: calc(
    var(--delay-start) + var(--fade) + var(--logo-hold) + var(--logo-slide) +
      var(--content-gap)
  );
}
#logo img {
  width: 100%;
}
#logo p {
  font-family: Amalfi;
  font-size: 35px;
  margin: 0 auto;
  position: absolute;
  text-align: center;
  width: 100vw;
  top: 55%;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;

  /* no fade animation on the whole line anymore */
  opacity: 1;
}

/* each letter */
#logo p .logo-char {
  opacity: 0;
  display: inline-block;
  transform: translateY(6px);
  padding: 5px;
  margin: -5px;
  animation: logoCharIn 400ms ease forwards;
}

/* letter keyframes */
@keyframes logoCharIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes logoFadeIn {
  to {
    opacity: 1;
  }
}

/* ===== Content below header ===== */
#content {
  z-index: 1;
}

#invite {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px 64px;
  padding-top: 24px; /* was 24px */
  opacity: 0;
  transform: translateY(140px);
  animation: inviteFadeIn var(--fade) ease forwards
    calc(
      var(--delay-start) + var(--fade) + var(--logo-hold) + var(--logo-slide) +
        var(--content-gap)
    );
}
@keyframes inviteFadeIn {
  to {
    opacity: 1;
    transform: none;
  }
}

/* Form fades just after text */
#invite-form {
  display: grid;
  gap: 14px;
  margin-top: 35px;
  opacity: 0;
  transform: translateY(8px);
  animation: formFadeIn var(--fade) ease forwards
    calc(
      var(--delay-start) + var(--fade) + var(--logo-hold) + var(--logo-slide) +
        var(--content-gap) + var(--fade) + var(--form-gap)
    );
}
@keyframes formFadeIn {
  to {
    opacity: 1;
    transform: none;
  }
}

/* ===== Form styles ===== */
label {
  display: grid;
  gap: 6px;
  font-size: 20px;
  font-weight: 600;
}
input,
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  /* padding-left: 0px; */
  /* border: 0; */
  border: 1px solid #231f20;
  background-color: white;
  border-radius: 14px;
  font: inherit;
  outline: none;
  color: var(--ink);
}
input::placeholder {
  font-weight: 300;
}
input:focus,
textarea:focus,
select:focus {
  outline: none;
}
button {
  justify-self: center;
  width: 100%;
  padding: 14px 18px;
  border-radius: 14px;
  border: 0;
  background: #f46f21;
  color: #fff;
  font-weight: 400;
  font-size: 22px;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.06s ease, filter 0.2s ease;
  font-family: IVY, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto;
}
button:disabled {
  opacity: 0.7;
}
button:hover {
  filter: brightness(0.9);
}
button:active {
  transform: translateY(1px);
}

/* ===== Layout tweaks ===== */
#invite-form.two-col {
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}
#invite-form .span-2 {
  grid-column: span 2;
}

.lang-block {
  display: none;
}
.lang-block.active {
  display: block;
}

/* ===== Motion accessibility ===== */
@media (prefers-reduced-motion: reduce) {
  /* never lock scrolling when reduced motion is requested */
  html,
  body {
    overflow: auto !important;
  }
  body {
    height: auto !important;
    animation: none !important;
  }

  #c,
  #masthead,
  #logo,
  #invite,
  #invite-form {
    animation: none !important;
  }
  #c {
    opacity: 0;
    visibility: hidden;
  }
  #masthead {
    height: var(--header-h);
  }
  #logo {
    opacity: 1;
    transform: none;
  }
  #invite,
  #invite-form {
    opacity: 1;
    transform: none;
  }
}

/* ===== Mobile tweaks ===== */
@media (max-width: 640px) {
  :root {
    --header-h: var(--header-h-m);
    --logo-w: min(65vw, 360px);
  }
  #invite-form.two-col {
    grid-template-columns: 1fr;
  }
  #invite-form .span-2 {
    grid-column: auto;
  }
  .content {
    font-size: 18px;
  }
  label {
    font-size: 18px;
  }
  button {
    font-size: 20px;
  }
  #logo p {
    font-size: 25px;
  }
}
