@font-face {
  font-family: "Brittany Signature";
  src: url("fonts/BrittanySignature.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #eceee0;
  --mist: #c2e2e1;
  --ink: #535a29;
  --sage: #798676;
  --gold: #b4ae7a;
  --paper: #faf8ed;
  --font-display: "Brittany Signature", "Segoe Script", cursive;
  --font-text: "Jost", "Century Gothic", "Trebuchet MS", sans-serif;
  --space: 1.5rem;
}

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

html,
body {
  margin: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-text);
  font-weight: 400;
  isolation: isolate;
  overflow-x: clip;
}

.scenery,
.botanicals {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.scenery {
  z-index: -2;
  background: var(--bg);
}

.scene,
.scene img,
.scenery-veil {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.scene {
  opacity: 0;
  transition: opacity 650ms ease-in-out;
}

.scene.is-active {
  opacity: 1;
}

.scene img {
  object-fit: cover;
}

.scenery-veil {
  background: linear-gradient(180deg, rgb(250 248 237 / 12%), rgb(236 238 224 / 3%) 55%, rgb(83 90 41 / 9%));
}

.seafoam {
  position: absolute;
  inset: -20%;
  width: 140%;
  height: 140%;
  object-fit: cover;
  opacity: 0;
}

.botanicals {
  z-index: -1;
}

.palm {
  position: absolute;
  width: clamp(10rem, 24vw, 26rem);
  height: auto;
  opacity: 0.86;
}

.palm-left {
  top: -7rem;
  left: -7rem;
  transform: rotate(-26deg);
  transform-origin: 0 0;
}

.palm-right {
  bottom: -9rem;
  right: -7rem;
  transform: rotate(152deg);
  transform-origin: 50% 50%;
}

main {
  display: flex;
  align-items: safe center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 4.5rem var(--space) 3rem;
}

.invitation-stage {
  position: relative;
  width: min(36rem, 100%);
}

body[data-current-screen="intro"] .invitation-stage {
  width: min(44rem, 100%);
}

.ribbon {
  position: absolute;
  z-index: 1;
  top: -3.4rem;
  left: calc(50% - 4.5rem);
  width: 9rem;
  height: 7.5rem;
  object-fit: contain;
  pointer-events: none;
}

.screen {
  position: relative;
  width: 100%;
  padding: clamp(3.5rem, 5vw, 4.25rem) clamp(1.5rem, 4vw, 3rem) 2.75rem;
  background: radial-gradient(ellipse at 25% 10%, #fffdf5, transparent 75%), var(--paper);
  border: 1px solid rgb(180 174 122 / 55%);
  border-radius: 2px;
  box-shadow: 0 18px 65px rgb(46 66 46 / 13%), 0 2px 8px rgb(46 66 46 / 7%);
  text-align: center;
}

.screen::before {
  content: "";
  position: absolute;
  inset: 0.55rem;
  border: 1px solid rgb(180 174 122 / 36%);
  pointer-events: none;
}

[hidden] {
  display: none !important;
}

.screen[data-screen="intro"] {
  padding-block: clamp(4.5rem, 10vw, 7rem);
  cursor: pointer;
}

.screen[data-screen="register"] {
  padding-block: 4.75rem 3.5rem;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.7rem, 4.2vw, 2.35rem);
  font-weight: 400;
  line-height: 1.35;
  text-wrap: balance;
}

h2 {
  margin-top: 1.75rem;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.script {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.2;
}

.screen[data-screen="intro"] h1 {
  font-size: clamp(2.6rem, 7vw, 4.75rem);
  line-height: 1.6;
}

.title {
  margin: 0.5rem 0 1.1rem;
  font-size: clamp(3.4rem, 12vw, 4.4rem);
  line-height: 1.5;
}

.name {
  font-size: clamp(2.15rem, 6vw, 2.6rem);
  line-height: 1.6;
}

.kicker + .name {
  margin-top: 0.65rem;
}

.with {
  margin: 0.45rem 0 0.55rem;
  font-size: clamp(1.5rem, 4vw, 1.9rem);
  line-height: 1.5;
}

.parents {
  margin-bottom: 1rem;
  font-size: 0.96rem;
  line-height: 1.5;
}

.kicker,
.quiet {
  font-size: 0.92rem;
  line-height: 1.55;
}

.kicker {
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.quiet {
  margin-top: 0.85rem;
}

.ask {
  margin-top: 1.35rem;
  font-size: 0.96rem;
  line-height: 1.55;
}

.rule {
  width: 4.5rem;
  height: 1px;
  margin: 1.35rem auto 0.35rem;
  border: 0;
  background: var(--gold);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.actions button,
.text-link {
  font-family: inherit;
  cursor: pointer;
}

.actions button {
  flex: 1 1 auto;
  min-width: 8.5rem;
  max-width: 12rem;
  padding: 0.8rem 1.25rem;
  border: 1px solid var(--sage);
  background: transparent;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  min-height: 46px;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.actions button:first-child {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.actions button:hover,
.actions button:focus-visible {
  border-color: var(--gold);
  background: var(--bg);
}

.actions button:first-child:hover,
.actions button:first-child:focus-visible {
  background: #41491f;
  border-color: #41491f;
}

.text-link {
  margin-top: 1.75rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: 1rem;
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-underline-offset: 0.28em;
}

form {
  display: grid;
  gap: 1.2rem;
  text-align: left;
}

label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

input {
  width: 100%;
  padding: 0.5rem 0;
  border: 0;
  border-bottom: 1px solid var(--sage);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 1.05rem;
  letter-spacing: 0;
  text-transform: none;
}

input:focus {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
  border-bottom-color: var(--ink);
}

.error {
  margin: 0;
  text-align: center;
  font-size: 0.95rem;
  letter-spacing: 0;
  text-transform: none;
}

.details {
  margin: 1.5rem 0 0;
}

.details div + div {
  margin-top: 0.85rem;
}

dt {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

dd {
  margin: 0.2rem 0 0;
  font-size: 1.05rem;
}

.contacts {
  margin: 0.9rem 0 0;
  padding: 0;
  list-style: none;
}

.contacts li + li {
  margin-top: 0.55rem;
}

.contacts a {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  color: inherit;
  text-decoration: none;
}

.contacts a span {
  display: block;
  margin-top: 0.1rem;
}

.contacts a:hover span,
.contacts a:focus-visible span {
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-underline-offset: 0.2em;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* Headings receive focus to announce the new screen, but are not controls. */
.screen h1:focus {
  outline: none;
}

@media (max-width: 32rem) {
  main {
    padding: 4.25rem 1.15rem 1.75rem;
  }

  .screen {
    padding-inline: 1.5rem;
    padding-bottom: 2rem;
  }

  .palm {
    width: 12rem;
    opacity: 0.65;
  }

  .palm-left {
    left: -7.5rem;
    top: -6rem;
  }

  .palm-right {
    right: -7.5rem;
    bottom: -5rem;
  }

  .ribbon {
    width: 8rem;
    left: calc(50% - 4rem);
  }

  .screen[data-screen="intro"] h1 {
    font-size: clamp(2.5rem, 10vw, 3.5rem);
  }

  .actions {
    flex-direction: column;
    align-items: center;
  }

  .actions button {
    flex: 0 0 auto;
    width: min(100%, 16rem);
    max-width: none;
  }
}

@media (max-height: 32rem) and (orientation: landscape) {
  main {
    padding-top: 3.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
