:root {
  --ink: #fffaf0;
  --muted: rgb(255 250 240 / 72%);
  --line: rgb(255 255 255 / 24%);
  --line-hover: rgb(255 255 255 / 36%);
  --line-focus: rgb(255 255 255 / 50%);
  --field-bg: rgb(8 18 12 / 35%);
  --field-bg-focus: rgb(8 18 12 / 55%);
  --error: #ffb4a8;
  --gold: #f2c96b;
  --red: #d62b2b;
  --red-hover: #bf1f1f;
  --radius: 14px;
  --font: "Montserrat", system-ui, sans-serif;
}

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

html {
  background: #000;
  scroll-behavior: smooth;
  overscroll-behavior-y: none;
}

body {
  min-height: 100svh;
  margin: 0;
  background: #000;
  color: var(--ink);
  font: 400 1rem/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

main {
  isolation: isolate;
}

button,
input {
  font: inherit;
  color: inherit;
}

[hidden] {
  display: none !important;
}

.media {
  position: fixed;
  inset: 0 0 auto;
  z-index: -1;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #000;
  pointer-events: none;
}

.media-frame {
  position: absolute;
  inset: 0 0 auto;
  height: 100vh;
  height: 100lvh;
  background: url("../background-mobile-poster.jpg") center / cover no-repeat;
}

.media::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  height: calc(6rem + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, rgb(0 0 0 / 85%) 60%, #000 80%);
  pointer-events: none;
  content: "";
}

.bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 38%;
  opacity: 0;
  transition: opacity 0.6s linear;
}

.bg-video.is-active {
  opacity: 1;
}

.bg-video.is-front {
  z-index: 1;
}

.hero {
  display: flex;
  height: 100vh;
  height: 100lvh;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding:
    calc(clamp(1.5rem, 5vh, 3rem) + env(safe-area-inset-top))
    1.25rem
    calc(clamp(1.5rem, 5vh, 3rem) + env(safe-area-inset-bottom));
  padding-bottom: calc(clamp(1.5rem, 5vh, 3rem) + max(100lvh - 100svh, env(safe-area-inset-bottom) + 3rem));
  background: linear-gradient(180deg, rgb(0 0 0 / 50%), rgb(0 0 0 / 25%) 30%, rgb(0 0 0 / 25%) 62%, rgb(0 0 0 / 60%));
}

.logo {
  display: block;
  width: clamp(10rem, 18vw, 15rem);
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 0 1px #fffaf0) drop-shadow(0 0 2px rgb(255 250 240 / 85%));
}

.hero-logo {
  max-width: 100%;
}

.register-logo {
  display: none;
}

.scroll-cue {
  display: flex;
  justify-content: center;
  text-decoration: none;
}

.scroll-cue.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.scroll-cue:focus-visible {
  outline: none;
}

.cta {
  position: relative;
  display: inline-flex;
  border-radius: 999px;
}

.cta::before {
  --stripe-repeat: 22.627px;
  position: absolute;
  inset: 0;
  padding: 3px;
  border-radius: inherit;
  background: repeating-linear-gradient(-45deg, var(--red) 0 8px, #fff 8px 16px) 0 0 / var(--stripe-repeat) var(--stripe-repeat);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: candy-stripes 1.4s linear infinite;
  pointer-events: none;
  content: "";
}

.cta-inner {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.95rem 1.6rem;
  line-height: 1;
  border-radius: 999px;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background-color 0.2s;
}

.scroll-cue:hover .cta-inner {
  background: rgb(255 255 255 / 10%);
}

.scroll-cue:focus-visible .cta {
  outline: 2px solid #fff;
  outline-offset: 4px;
}

.santa-hat {
  position: absolute;
  top: -31px;
  left: -14px;
  width: 54px;
  rotate: -29deg;
  pointer-events: none;
}

.cta-arrow {
  display: flex;
}

.cta-arrow svg {
  width: 1rem;
  height: 1rem;
  animation: nudge 1.6s ease-in-out infinite;
}

@keyframes candy-stripes {
  to { background-position: var(--stripe-repeat) 0; }
}

@keyframes nudge {
  0%,
  100% { transform: translateY(-2px); }
  50% { transform: translateY(2px); }
}

.register {
  position: relative;
  display: grid;
  place-items: center;
  padding:
    calc(clamp(3rem, 8vh, 5rem) + env(safe-area-inset-bottom) + 3rem)
    1.25rem
    calc(1.5rem + env(safe-area-inset-bottom) + 3.5rem);
  background:
    linear-gradient(0deg, #000 calc(1rem + env(safe-area-inset-bottom)), transparent calc(5rem + env(safe-area-inset-bottom))),
    linear-gradient(180deg, rgb(0 0 0 / 60%), rgb(0 0 0 / 75%) 25%, rgb(0 0 0 / 78%));
}

.register:where(:has(.confirmation:not([hidden]))) {
  min-height: 100vh;
  min-height: 100lvh;
}

.snowfall {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.card {
  position: relative;
  z-index: 1;
  width: min(100%, 30rem);
  padding: clamp(1.75rem, 3vw, 2.5rem);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(145deg, rgb(255 255 255 / 8%), rgb(8 18 12 / 30%));
  color-scheme: dark;
}

.holly,
.snowcap {
  position: absolute;
  pointer-events: none;
}

.holly {
  top: -30px;
  left: -26px;
  width: 96px;
  height: 96px;
}

.snowcap {
  top: -10px;
  right: -6px;
  width: 140px;
  height: 72px;
}

.card-header {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  text-align: center;
}

.eyebrow {
  margin: 0;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.card-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.candy-stripe {
  --stripe-repeat: 16.971px;
  width: 72px;
  height: 5px;
  margin-top: 0.35rem;
  border-radius: 999px;
  background: repeating-linear-gradient(-45deg, var(--red) 0 6px, #fff 6px 12px) 0 0 / var(--stripe-repeat) var(--stripe-repeat);
  animation: candy-stripes 1.4s linear infinite;
}

.snowflake {
  position: relative;
  width: 26px;
  height: 26px;
  margin-top: 0.35rem;
}

.snowflake > span {
  position: absolute;
  inset: 0;
  background: var(--gold);
  clip-path: polygon(
    47% 0, 53% 0, 53% 28%, 67% 14%, 71% 18%, 53% 36%,
    53% 64%, 71% 82%, 67% 86%, 53% 72%, 53% 100%, 47% 100%,
    47% 72%, 33% 86%, 29% 82%, 47% 64%, 47% 36%, 29% 18%, 33% 14%, 47% 28%
  );
}

.snowflake > :nth-child(2) {
  transform: rotate(60deg);
}

.snowflake > :nth-child(3) {
  transform: rotate(-60deg);
}

.snowflake::before,
.snowflake::after {
  position: absolute;
  top: 50%;
  width: 4px;
  height: 4px;
  background: var(--gold);
  opacity: 0.6;
  transform: translateY(-50%) rotate(45deg);
  content: "";
}

.snowflake::before {
  left: -12px;
}

.snowflake::after {
  right: -12px;
}

form {
  display: grid;
  gap: 1rem;
}

.form-actions {
  display: grid;
}

.row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 0.85rem;
}

.field {
  display: grid;
  gap: 0.4rem;
  min-width: 0;
}

.field label {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.required {
  color: var(--error);
}

.optional {
  color: var(--muted);
  font-weight: 400;
}

input,
.dropdown-trigger {
  --field-fill: var(--field-bg);
  display: block;
  width: 100%;
  min-height: 3.1rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--field-fill);
  outline: none;
  transition: border-color 0.2s, background-color 0.2s;
}

input::placeholder {
  color: var(--muted);
  opacity: 1;
}

input:hover,
.dropdown-trigger:hover {
  border-color: var(--line-hover);
}

input:focus,
.dropdown-trigger:focus,
.dropdown-trigger[aria-expanded="true"] {
  --field-fill: var(--field-bg-focus);
  border-color: var(--line-focus);
}

input:is(:autofill, :-webkit-autofill) {
  -webkit-background-clip: text;
  background-clip: text;
  box-shadow: inset 0 0 0 100vmax var(--field-fill);
  -webkit-text-fill-color: var(--ink);
  caret-color: var(--ink);
}

[aria-invalid="true"] {
  border-color: var(--error);
}

.dropdown {
  position: relative;
}

.dropdown-trigger {
  position: relative;
  padding-right: 2.75rem;
  text-align: start;
  cursor: pointer;
}

.dropdown-trigger.is-placeholder {
  color: var(--muted);
}

.dropdown-trigger::after {
  position: absolute;
  top: 50%;
  right: 1.1rem;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.2s;
  pointer-events: none;
  content: "";
}

.dropdown-trigger[aria-expanded="true"]::after {
  transform: translateY(-25%) rotate(225deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  z-index: 10;
  max-height: 16rem;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgb(8 18 12 / 85%);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  list-style: none;
  outline: none;
  scrollbar-width: none;
  animation: dropdown-in 0.16s ease-out;
}

.dropdown-menu::-webkit-scrollbar {
  display: none;
}

@keyframes dropdown-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}

.dropdown-menu li {
  position: relative;
  display: flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.9rem;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.12s;
}

.dropdown-menu li:hover,
.dropdown-menu li.is-active {
  background: rgb(255 255 255 / 9%);
}

.dropdown-menu li[aria-selected="true"] {
  color: #fff;
  font-weight: 600;
}

.dropdown-menu li[aria-selected="true"]::after {
  width: 0.4rem;
  height: 0.75rem;
  flex-shrink: 0;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: translateY(-2px) rotate(45deg);
  content: "";
}

.dropdown-menu .is-other {
  margin-top: 9px;
}

.dropdown-menu .is-other::before {
  position: absolute;
  top: -5px;
  right: 0.5rem;
  left: 0.5rem;
  height: 1px;
  background: var(--line);
  content: "";
}

.field-error {
  margin: 0;
  color: var(--error);
  font-size: 0.8rem;
  font-weight: 500;
}

.field-error:empty {
  display: none;
}

.form-message {
  margin: 0;
  padding: 0.7rem 1rem;
  border: 1px solid rgb(255 180 168 / 45%);
  border-radius: var(--radius);
  background: rgb(120 30 30 / 35%);
  color: #ffe1db;
  font-size: 0.875rem;
}

.button {
  min-height: 3.2rem;
  margin-top: 0.4rem;
  padding: 0.7rem 1.25rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--red);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.15s;
}

.button:hover {
  background: var(--red-hover);
}

.button:active {
  transform: scale(0.985);
}

.button:disabled {
  cursor: progress;
  opacity: 0.7;
}

.button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.confirmation {
  display: flex;
  min-height: 22rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  text-align: center;
}

.confirmation .eyebrow {
  font-family: Georgia, serif;
  font-size: 1rem;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: none;
}

.confirmation h2 {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  outline: none;
}

.confirmation p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
}

.confirmation .snowflake {
  margin: 0.4rem 0 0.6rem;
}

.confirmation .logo {
  width: 8.75rem;
  margin-bottom: 0.5rem;
}

@media (max-width: 25rem) {
  .register {
    padding-inline: 0.9rem;
  }

  .card {
    padding: 1.5rem 1.25rem 1.25rem;
    border-radius: 22px;
  }

  .holly {
    top: -26px;
    left: -20px;
    width: 80px;
    height: 80px;
  }

  .row {
    gap: 0.65rem;
  }
}

@media (min-width: 64rem) and (min-aspect-ratio: 5/4) {
  :root {
    --split: 50vw;
  }

  html {
    font-size: clamp(16px, 0.75vw + 4px, 22px);
  }

  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  .media {
    inset: 0 auto auto 0;
    width: 66vw;
    height: 100vh;
  }

  .media-frame {
    height: 100%;
    background-image: url("../background-poster.jpg");
    background-position: calc(var(--split) / 2 - 100svh * 8 / 9) center;
  }

  .bg-video {
    object-position: calc(var(--split) / 2 - 100svh * 8 / 9) center;
  }

  .media::after {
    position: absolute;
    inset: 0;
    z-index: 2;
    height: auto;
    background:
      linear-gradient(
        90deg,
        rgb(0 0 0 / 22%) 0%,
        rgb(0 0 0 / 24%) 25%,
        rgb(0 0 0 / 33%) 45%,
        rgb(0 0 0 / 48%) 57%,
        rgb(0 0 0 / 66%) 67%,
        rgb(0 0 0 / 82%) 75%,
        rgb(0 0 0 / 94%) 82%,
        #000 88%
      ),
      radial-gradient(ellipse 70% 75% at 36% 50%, transparent 55%, rgb(0 0 0 / 35%)),
      linear-gradient(180deg, rgb(0 0 0 / 30%), transparent 22%, transparent 78%, rgb(0 0 0 / 35%));
    content: "";
  }

  .hero {
    display: contents;
  }

  .hero-logo,
  .scroll-cue {
    display: none;
  }

  .register {
    display: flex;
    height: 100svh;
    min-height: 0;
    flex-direction: column;
    align-items: center;
    gap: clamp(1.25rem, 3vh, 2rem);
    margin-left: var(--split);
    padding-block: clamp(1.5rem, 4vh, 3rem);
    overflow-y: auto;
    scrollbar-width: none;
    background: none;
  }

  .register::-webkit-scrollbar {
    display: none;
  }

  .register-logo {
    display: block;
    width: clamp(9.5rem, 21vh, 14rem);
    margin-top: auto;
  }

  .register:has(.confirmation:not([hidden])) > .register-logo {
    display: none;
  }

  .card {
    margin-bottom: auto;
  }

  .card:has(.confirmation:not([hidden])) {
    margin-top: auto;
  }
}

@media (min-width: 64rem) and (min-aspect-ratio: 5/4) and (max-height: 52rem) {
  .register {
    gap: 1rem;
    padding-block: 1rem;
  }

  .register-logo {
    width: 8.5rem;
  }

  .card {
    padding: 1.5rem 2rem;
  }

  form {
    gap: 0.75rem;
  }

  input,
  .dropdown-trigger {
    min-height: 2.8rem;
    padding-block: 0.55rem;
  }

  .button {
    min-height: 2.9rem;
  }
}

@media (prefers-reduced-motion: no-preference) {
  :root {
    --reveal-duration: 800ms;
    --reveal-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  }

  .reveal {
    --reveal-scale: 0.92;
  }

  .card.reveal {
    --reveal-scale: 0.98;
  }

  .reveal:not(.is-in-view, :focus-visible) {
    opacity: 0;
  }

  /* Focused form controls must be visible and stop moving immediately. */
  .card:has(form:focus-within),
  #registration .reveal:focus-within {
    opacity: 1 !important;
    translate: none !important;
    scale: none !important;
  }

  .scroll-cue.is-hidden {
    transition: opacity 180ms ease-in, visibility 0s linear 180ms;
  }

  .scroll-cue.is-hidden > .cta {
    translate: 0 0.375rem;
    scale: 0.97;
    transition: translate 180ms ease-in, scale 180ms ease-in;
  }

  .reveal.is-in-view:not(.hero-logo, .scroll-cue, :has(.confirmation:not([hidden]))),
  .hero-logo.is-in-view > .logo,
  .scroll-cue.is-in-view:not(.is-hidden, :focus-visible) > .cta {
    animation: pop-in var(--reveal-duration) var(--reveal-ease) var(--reveal-delay, 0ms) backwards;
  }

  .card.is-in-view .confirmation:not([hidden]) {
    animation: confirmation-fade-in var(--reveal-duration) var(--reveal-ease) backwards;
  }
}

@keyframes pop-in {
  from {
    opacity: 0;
    translate: 0 0.5rem;
    scale: var(--reveal-scale, 0.92);
  }

  50% {
    opacity: 0.5;
  }

  to {
    opacity: 1;
    translate: 0 0;
    scale: 1;
  }
}

@keyframes confirmation-fade-in {
  from { opacity: 0; }
  50% { opacity: 0.5; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .bg-video,
  .snowfall {
    display: none;
  }

  .cta::before,
  .cta-arrow svg,
  .candy-stripe {
    animation: none;
  }
}
