:root {
  --paper: #f4ead8;
  --paper-deep: #e2d2b4;
  --ink: #1c1612;
  --ink-soft: #3f342c;
  --warm: #c45c3e;
  --shadow: rgba(28, 22, 18, 0.18);
  font-synthesis: none;
}

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

html,
body {
  margin: 0;
  height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: "Newsreader", "Iowan Old Style", Georgia, serif;
  overflow: hidden;
}

.stage {
  position: fixed;
  inset: 0;
  background: var(--paper);
}

#scene {
  width: 100%;
  height: 100%;
  display: block;
  font-family: "Fraunces", Georgia, serif;
}

.ui {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: clamp(12px, 2.4vw, 32px);
}

.top-bar {
  display: grid;
  grid-template-columns: minmax(7rem, 1fr) auto minmax(7rem, 1fr);
  align-items: start;
  gap: 12px 20px;
}

.playback {
  justify-self: start;
  position: relative;
  width: 9.5em;
  height: 2.2em;
}

.skip,
.replay,
.nav a {
  pointer-events: auto;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 8px 2px;
  text-decoration: none;
  cursor: pointer;
}

.skip,
.replay {
  position: absolute;
  left: 0;
  top: 0;
}

.skip,
.nav a {
  opacity: 0.42;
}

.replay {
  opacity: 0;
  pointer-events: none;
}

.skip:hover,
.replay:hover,
.nav a:hover,
.skip:focus-visible,
.replay:focus-visible,
.nav a:focus-visible {
  opacity: 1;
  outline: none;
}

.replay.is-on {
  opacity: 0.55;
  pointer-events: auto;
}

.nav {
  justify-self: end;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.2em 1.15em;
  pointer-events: none;
}

.nav a[aria-current="page"] {
  opacity: 0.9;
  box-shadow: inset 0 -1px 0 currentColor;
}

.brand {
  justify-self: center;
  text-align: center;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}

.brand.is-on,
body.page .brand {
  pointer-events: auto;
}

.brand h1,
.brand-link {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 300;
  font-style: italic;
  font-size: clamp(28px, 4.4vw, 56px);
  letter-spacing: -0.03em;
  line-height: 0.92;
  color: inherit;
  text-decoration: none;
}

.brand-old {
  font-style: normal;
  font-weight: 300;
  letter-spacing: -0.02em;
  margin-right: 0.18em;
}

.brand p {
  margin: 8px 0 0;
  font-size: clamp(13px, 1.4vw, 17px);
  color: var(--ink-soft);
}

.copy {
  place-self: center;
  margin: 0 0 12vh;
  min-height: 2.4em;
  text-align: center;
  font-family: "Fraunces", Georgia, serif;
  font-optical-sizing: auto;
  font-weight: 300;
  font-size: clamp(22px, 3.2vw, 40px);
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--ink);
  opacity: 0;
  text-wrap: balance;
  max-width: 18em;
}

.invite {
  pointer-events: none;
  opacity: 0;
  transform: translateY(16px);
  width: min(520px, 100%);
  justify-self: center;
  background: color-mix(in srgb, var(--paper) 84%, white);
  border: 1px solid rgba(28, 22, 18, 0.12);
  box-shadow: 0 16px 44px var(--shadow);
  padding: 16px 16px 14px;
  display: grid;
  gap: 8px;
}

.invite.is-on {
  pointer-events: auto;
}

.invite label {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.invite .row {
  display: flex;
  gap: 8px;
}

.invite input {
  flex: 1;
  min-width: 0;
  border: 0;
  border-bottom: 1px solid rgba(28, 22, 18, 0.28);
  background: transparent;
  font-family: "Newsreader", Georgia, serif;
  font-size: 18px;
  padding: 8px 2px;
  color: var(--ink);
  border-radius: 0;
}

.invite input:focus {
  outline: none;
  border-bottom-color: var(--ink);
}

.invite button {
  appearance: none;
  border: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-size: 16px;
  padding: 10px 16px;
  cursor: pointer;
  white-space: nowrap;
}

.invite button:hover,
.invite button:focus-visible {
  background: var(--warm);
  outline: none;
}

.invite .note,
.invite .thanks {
  margin: 0;
  font-size: 14px;
  color: var(--ink-soft);
}

.invite .thanks {
  display: none;
  font-style: italic;
}

.invite.is-sent .row,
.invite.is-sent label,
.invite.is-sent .note {
  display: none;
}

.invite.is-sent .thanks {
  display: block;
}

.noscript {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
  font-family: "Fraunces", Georgia, serif;
}

body.page {
  overflow: auto;
  min-height: 100%;
}

body.page .stage {
  display: none;
}

body.page .ui {
  position: relative;
  min-height: 100%;
  pointer-events: auto;
  grid-template-rows: auto 1fr;
}

body.page .brand {
  opacity: 1;
  transform: none;
}

body.page .brand p {
  display: none;
}

.page-main {
  width: min(40rem, 100%);
  justify-self: center;
  align-self: start;
  padding: 8vh 8px 12vh;
  pointer-events: auto;
}

.page-main h1 {
  margin: 0 0 0.6em;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 300;
  font-style: italic;
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: -0.03em;
}

.page-main p,
.page-main li {
  font-size: 1.125rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.page-main p {
  margin: 0 0 1em;
}

.page-main ul {
  margin: 0;
  padding: 0 0 0 1.1em;
}

.page-main .invite {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  margin-top: 1.8rem;
  width: 100%;
}

@media (max-width: 720px) {
  .ui {
    padding: 12px 12px 14px;
  }

  .top-bar {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "playback nav"
      "brand brand";
  }

  .playback {
    grid-area: playback;
  }

  body.page .playback {
    display: none;
  }

  body.page .top-bar {
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "nav";
    justify-items: center;
  }

  body.page .nav {
    justify-self: center;
  }

  .playback {
    width: auto;
    min-width: 7.2em;
  }

  .nav {
    grid-area: nav;
    flex-wrap: nowrap;
    gap: 0.75em;
  }

  .nav a {
    font-size: 10px;
    letter-spacing: 0.12em;
    padding: 8px 0;
  }

  .brand {
    grid-area: brand;
    padding-top: 4px;
  }

  .invite .row {
    flex-direction: column;
  }

  .copy {
    margin-bottom: 22vh;
    font-size: 22px;
  }

  .brand h1,
  .brand-link {
    font-size: 28px;
  }

  .brand p {
    font-size: 13px;
  }

  .page-main {
    padding-top: 5vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
