@font-face {
  font-family: "Fredoka";
  src: url("/fonts/fredoka-latin-wght.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --sky: #4aa8ec;
  --ink: #12305f;
  --brass-light: #ffd983;
  --brass: #eaa83c;
  --brass-dark: #b8701c;
  --brass-edge: #7c4a12;
  --wood-ink: #3a2208;
  --butter-light: #f8dc6e;
  --butter: #efc443;
  --butter-edge: #d6a934;
  /* One unit that scales with the scene: 1vw, capped by height on wide screens. */
  --u: min(1vw, 1.5vh);
}

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

html, body { margin: 0; }

body {
  background: var(--sky);
  color: #fff;
  font-family: "Fredoka", ui-rounded, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
}

.scene, .scene img {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
}

.scene img {
  object-fit: cover;
  object-position: 70% 10%; /* keep the workshop in view on wide screens */
}

.intro {
  width: calc(var(--u) * 47);
  margin-left: max(16px, 5.5vw);
  padding-bottom: 14vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.logo { margin: 0; width: 100%; line-height: 0; }

.logo img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 calc(var(--u) * 0.6) calc(var(--u) * 1.2) rgba(20, 60, 120, 0.3));
}

.tagline {
  margin: calc(var(--u) * 1.6) 0 0;
  font-size: calc(var(--u) * 2.7);
  font-weight: 600;
  line-height: 1.2;
  text-shadow: 0 2px 0 rgba(20, 70, 140, 0.45), 0 3px 14px rgba(10, 50, 110, 0.45);
}

.label {
  margin: calc(var(--u) * 1.4) 0 0;
  color: var(--ink);
  font-size: calc(var(--u) * 1.45);
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.6);
}

.button {
  position: relative;
  margin-top: calc(var(--u) * 2);
  padding: 0.5em 2.4em 0.55em;
  font-size: calc(var(--u) * 2);
  font-weight: 600;
  color: var(--wood-ink);
  text-decoration: none;
  border: 2px solid var(--brass-edge);
  border-radius: 0.8em;
  background: linear-gradient(180deg, var(--brass-light), var(--brass) 55%, var(--brass-dark));
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.55),
    inset 0 -3px 0 rgba(124, 74, 18, 0.35),
    0 5px 0 var(--brass-edge),
    0 10px 22px rgba(20, 50, 100, 0.35);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

/* Brass bolts on both ends of the plate. */
.button::before, .button::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 0.42em;
  height: 0.42em;
  margin-top: -0.21em;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff3c4, #e2a03a 55%, #8a5416);
  box-shadow: 0 1px 1px rgba(60, 30, 0, 0.5);
}
.button::before { left: 0.75em; }
.button::after { right: 0.75em; }

.button:hover { transform: translateY(-2px); }
.button:active {
  transform: translateY(3px);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.55),
    inset 0 -3px 0 rgba(124, 74, 18, 0.35),
    0 2px 0 var(--brass-edge),
    0 5px 12px rgba(20, 50, 100, 0.35);
}
.button:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }

/* Secondary: a lighter butter plate, flat, for form actions. */
.button-secondary {
  padding: 0 1.2em;
  min-height: 48px;
  font: inherit;
  font-weight: 600;
  color: var(--wood-ink);
  border: 1px solid var(--butter-edge);
  border-radius: 10px;
  background: linear-gradient(180deg, var(--butter-light), var(--butter));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 1px 2px rgba(58, 34, 8, 0.15);
  cursor: pointer;
}
.button-secondary:hover { filter: brightness(1.04); }
.button-secondary:active { box-shadow: inset 0 1px 3px rgba(58, 34, 8, 0.25); }
.button-secondary:disabled { opacity: 0.6; cursor: progress; }
.button-secondary:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }

.games {
  padding: 14vh 16px;
  text-align: center;
  color: var(--ink);
  background: linear-gradient(180deg, #f4faff, #dcefff);
}

.games h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 600;
}

.games p {
  margin: 0.6em auto 0;
  max-width: 32em;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.5;
}

.waitlist-form {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 440px;
  margin: 1.6em auto 0;
}

.waitlist-form input[type="email"] {
  flex: 1 1 220px;
  min-height: 48px;
  padding: 0 14px;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid #b9d3ea;
  border-radius: 10px;
}
.waitlist-form input[type="email"]:focus-visible { outline: 3px solid var(--sky); outline-offset: 1px; }

.honeypot { position: absolute; left: -9999px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.games .waitlist-status { min-height: 1.5em; margin-top: 0.8em; font-size: 1rem; font-weight: 500; }
.waitlist-status[data-state="joined"] { color: #3f7a1c; }
.waitlist-status[data-state="invalid"], .waitlist-status[data-state="failed"] { color: #a33a1a; }

.games .waitlist-note { margin-top: 0.2em; font-size: 0.9rem; color: rgba(18, 48, 95, 0.7); }

.footer {
  padding: 24px 16px;
  text-align: center;
  font-size: 0.9rem;
  color: rgba(18, 48, 95, 0.7);
  background: #dcefff;
}

/* Portrait screens: text on top, island below. */
@media (max-aspect-ratio: 1/1) {
  :root { --u: min(1.9vw, 0.95vh); }

  .hero { align-items: flex-start; justify-content: center; }

  .scene img { object-position: 50% 0; }

  .intro {
    width: calc(var(--u) * 47);
    max-width: calc(100vw - 32px);
    margin: 0;
    padding: max(5svh, calc(env(safe-area-inset-top) + 20px)) 0 0;
  }

  .tagline { font-size: max(1.1rem, calc(var(--u) * 2.8)); }
  .label { font-size: max(0.8rem, calc(var(--u) * 1.5)); }
  .button { font-size: max(1.05rem, calc(var(--u) * 2.1)); }
}

@media (prefers-reduced-motion: reduce) {
  .button { transition: none; }
}
