/* Ezoterium: the Sorceress's night sky. Violet dark, moonlight text, the logo's gold. */

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url(../fonts/nunito-latin.woff2) format("woff2");
}

:root {
  --night: #120926;
  --dusk: #1d0d3c;
  --plum: #4b1c7c;
  --moon: #f8f0ff;
  --text: #eee6fb;
  --muted: #cbbde6;
  --gold: #ffd35c;
  --gold-deep: #e39a1c;
  --rose: #ff72cf;
  --line: rgba(255, 211, 92, 0.28);
  --glass: rgba(43, 18, 89, 0.55);
  --serif: "Palatino Linotype", "Book Antiqua", Palatino, "URW Palladio L", Georgia, serif;
  --sans: "Nunito", "Segoe UI", system-ui, sans-serif;
  --gutter: max(20px, calc((100vw - 1240px) / 2));
  --ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
  background: var(--night);
}

body {
  margin: 0;
  color: var(--text);
  font: 500 17px/1.65 var(--sans);
  background:
    radial-gradient(1200px 700px at 80% 10%, rgba(255, 114, 207, 0.08), transparent 70%),
    radial-gradient(900px 600px at 10% 60%, rgba(97, 227, 212, 0.06), transparent 70%),
    linear-gradient(180deg, var(--night), var(--dusk) 40%, var(--night));
  overflow-x: clip;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
}

/* The serif's bold: its regular is too thin to hold against the art and the night. */
h1,
h2,
h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  color: var(--moon);
}

h2 {
  font-size: clamp(36px, 5vw, 60px);
  line-height: 1.08;
}

h1 em,
h2 em,
.tagline {
  font-style: italic;
  background: linear-gradient(100deg, var(--gold), #fff1b8 45%, var(--gold-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

h3 {
  font-size: 23px;
  line-height: 1.25;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "\2726";
  margin-right: 10px;
  color: var(--rose);
}

.body-copy {
  margin: 22px 0 0;
  max-width: 560px;
  color: var(--text);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 20;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--night);
  font-weight: 800;
}

.skip-link:focus {
  top: 12px;
}

/* Header */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px var(--gutter);
  background: rgba(18, 9, 38, 0.72);
  border-bottom: 1px solid rgba(255, 211, 92, 0.12);
  backdrop-filter: blur(12px);
}

.brand {
  font-family: var(--serif);
  font-size: 26px;
  font-style: italic;
  font-weight: 700;
  color: var(--moon);
  text-decoration: none;
}

.brand-star {
  margin-left: 6px;
  color: var(--gold);
  font-size: 16px;
  font-style: normal;
  vertical-align: super;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-header nav a {
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
}

.site-header nav a:hover {
  color: var(--gold);
}

.site-header .nav-play {
  padding: 9px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--gold);
}

/* Buttons */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.button:hover {
  transform: translateY(-2px);
}

.button-gold {
  background: linear-gradient(180deg, #ffe58f, var(--gold) 45%, var(--gold-deep));
  color: #3a1d00;
  box-shadow: 0 10px 30px rgba(227, 154, 28, 0.35);
}

.button-gold:hover {
  box-shadow: 0 14px 38px rgba(227, 154, 28, 0.5);
}

.button-ghost {
  border: 1px solid rgba(248, 240, 255, 0.4);
  color: var(--moon);
  backdrop-filter: blur(6px);
}

/* Hero: the Sorceress under her moon, the logo's letters arriving one by one as in the game */

.hero {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 100svh;
  padding: 110px var(--gutter) 56px;
  overflow: hidden;
}

/* The art and its stars dissolve into the page's own night instead of ending on a colour of their own, so
   there is no seam however the page's background shades below. */
.hero-art,
.sky {
  position: absolute;
  inset: 0;
  -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 55%, transparent 100%);
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 40%;
}

.hero-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      180deg,
      rgba(18, 9, 38, 0.55) 0%,
      rgba(18, 9, 38, 0) 30%,
      rgba(18, 9, 38, 0) 45%,
      rgba(18, 9, 38, 0.75) 80%
    ),
    radial-gradient(ellipse at 50% 45%, transparent 40%, rgba(18, 9, 38, 0.6));
}

.sky {
  pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 20% 30%, #fff, transparent),
    radial-gradient(1px 1px at 70% 20%, #fff, transparent),
    radial-gradient(2px 2px at 85% 60%, #ffe9a8, transparent),
    radial-gradient(1px 1px at 40% 75%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 55% 45%, #ffd2f1, transparent);
  background-size: 240px 240px;
  animation: twinkle 5s ease-in-out infinite alternate;
}

@keyframes twinkle {
  from {
    opacity: 0.35;
  }
  to {
    opacity: 0.9;
  }
}

.hero-copy {
  position: relative;
  align-self: start;
  text-align: center;
}

.logo {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.45));
}

.letter {
  width: auto;
  height: clamp(46px, 8.6vw, 116px);
  margin: 0 -0.25%;
  animation: letter-in 0.45s var(--ease-pop) both;
}

.letter:nth-child(odd) {
  --turn: -8deg;
}

.letter:nth-child(even) {
  --turn: 6deg;
}

.letter:nth-child(2) { animation-delay: 0.04s; }
.letter:nth-child(3) { animation-delay: 0.08s; }
.letter:nth-child(4) { animation-delay: 0.12s; }
.letter:nth-child(5) { animation-delay: 0.16s; }
.letter:nth-child(6) { animation-delay: 0.2s; }
.letter:nth-child(7) { animation-delay: 0.24s; }
.letter:nth-child(8) { animation-delay: 0.28s; }
.letter:nth-child(9) { animation-delay: 0.32s; }

@keyframes letter-in {
  from {
    opacity: 0;
    transform: scale(0.3) rotate(var(--turn));
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.tagline {
  margin: 14px 0 0;
  font-family: var(--serif);
  font-size: clamp(24px, 3.2vw, 38px);
  font-weight: 700;
  filter: drop-shadow(0 2px 3px rgba(18, 9, 38, 0.95)) drop-shadow(0 0 14px rgba(18, 9, 38, 0.8));
}

.hero-bottom {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 22px;
  text-align: center;
}

.lead {
  max-width: 640px;
  margin: 0;
  color: var(--moon);
  font-size: 19px;
  font-weight: 600;
  text-shadow:
    0 1px 2px rgba(18, 9, 38, 0.9),
    0 2px 14px rgba(18, 9, 38, 0.8);
}

.hero-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  text-shadow: 0 1px 6px rgba(18, 9, 38, 0.9);
}

/* Sections share one rhythm */

.magic,
.worlds,
.town,
.rewards,
.ways {
  padding: 130px var(--gutter) 0;
}

/* The magic: the gems of the game on a ring, the boards below */

.magic {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) 1.1fr;
  align-items: center;
  gap: 60px 80px;
}

.gem-ring {
  position: relative;
  width: min(460px, 100%);
  aspect-ratio: 1;
  justify-self: center;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 211, 92, 0.18), transparent 58%),
    radial-gradient(circle, transparent 63%, var(--line) 63.4%, transparent 64%),
    radial-gradient(circle, transparent 46%, rgba(255, 114, 207, 0.25) 46.3%, transparent 46.8%);
}

.gem {
  position: absolute;
  left: 39%;
  top: 39%;
  width: 22%;
  animation: float 4.5s ease-in-out infinite;
}

/* Seven signs around the circle (360 / 7 degrees apart), each kept upright. */
.gem:nth-child(1) { transform: rotate(0deg) translateY(-160%) rotate(0deg); }
.gem:nth-child(2) { transform: rotate(51.4deg) translateY(-160%) rotate(-51.4deg); animation-delay: -0.6s; }
.gem:nth-child(3) { transform: rotate(102.9deg) translateY(-160%) rotate(-102.9deg); animation-delay: -1.2s; }
.gem:nth-child(4) { transform: rotate(154.3deg) translateY(-160%) rotate(-154.3deg); animation-delay: -1.8s; }
.gem:nth-child(5) { transform: rotate(205.7deg) translateY(-160%) rotate(-205.7deg); animation-delay: -2.4s; }
.gem:nth-child(6) { transform: rotate(257.1deg) translateY(-160%) rotate(-257.1deg); animation-delay: -3s; }
.gem:nth-child(7) { transform: rotate(308.6deg) translateY(-160%) rotate(-308.6deg); animation-delay: -3.6s; }

@keyframes float {
  50% {
    translate: 0 -8px;
  }
}

.facts {
  display: grid;
  gap: 22px;
  margin: 34px 0 0;
  padding: 0;
  list-style: none;
}

.facts li {
  padding-left: 22px;
  border-left: 2px solid var(--line);
}

.facts p {
  margin: 6px 0 0;
  color: var(--muted);
}

.boards {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.rewards .boards {
  margin-top: 40px;
}

.shot {
  margin: 0;
}

.shot img,
.town-art img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
}

.shot figcaption {
  margin-top: 12px;
  color: var(--muted);
  font-size: 15px;
}

/* Worlds: each town whole, in the proportions the game draws it, never cropped or blown up; the row of them
   scrolls on its own, the next one peeking in at the edge. */

.section-head {
  max-width: 720px;
}

.world-row {
  display: flex;
  gap: 28px;
  margin: 50px calc(-1 * var(--gutter)) 0;
  padding: 10px var(--gutter) 24px;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  scrollbar-color: var(--plum) transparent;
}

.world {
  flex: 0 0 min(78vw, 980px);
  scroll-snap-align: start;
}

.world img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow:
    0 0 0 6px rgba(43, 18, 89, 0.8),
    0 0 40px rgba(255, 114, 207, 0.18);
}

.world-name {
  display: block;
  margin-top: 16px;
  font-family: var(--serif);
  font-size: 20px;
  font-style: italic;
  font-weight: 700;
  text-align: center;
  color: var(--moon);
}

/* The town */

.town {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  align-items: center;
  gap: 60px;
}

.way-list {
  display: grid;
  gap: 14px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.way-list li::before {
  content: "\2726";
  margin-right: 12px;
  color: var(--gold);
}

/* Rewards: cards like a fortune teller's spread */

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 50px;
}

.card {
  padding: 30px 24px 28px;
  border: 1px solid var(--line);
  border-radius: 120px 120px 22px 22px;
  background: linear-gradient(180deg, var(--glass), rgba(18, 9, 38, 0.4));
  text-align: center;
}

/* The game's own icon for each feature, at one height whatever its shape. */
.card-icon {
  width: auto;
  height: 110px;
  margin: 0 auto 18px;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.45));
}

.card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
}

/* Play your way, and the call to play */

.ways-facts {
  grid-template-columns: repeat(3, 1fr);
  margin-top: 40px;
}

.play {
  display: grid;
  justify-items: center;
  gap: 26px;
  margin-top: 130px;
  padding: 100px var(--gutter);
  text-align: center;
  background:
    radial-gradient(600px 300px at 50% 0%, rgba(255, 211, 92, 0.16), transparent 70%),
    linear-gradient(180deg, transparent, rgba(75, 28, 124, 0.45));
  border-top: 1px solid var(--line);
}

.play .actions {
  justify-content: center;
}

.play-icon {
  width: 120px;
  border-radius: 28px;
  box-shadow: 0 0 0 1px var(--line), 0 20px 50px rgba(255, 114, 207, 0.25);
}

.play-note {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

/* Footer */

footer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 34px var(--gutter);
  border-top: 1px solid rgba(255, 211, 92, 0.14);
  color: var(--muted);
  font-size: 14px;
}

footer > div {
  display: flex;
  gap: 22px;
}

footer a {
  text-decoration: none;
}

footer a:hover {
  color: var(--gold);
}

/* Reveal on scroll, only when the script runs and motion is welcome */

.has-reveals .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 0.7s,
    transform 0.7s;
}

.has-reveals .reveal.visible {
  opacity: 1;
  transform: none;
}

/* The 404 page */

.lost-page main {
  display: grid;
  place-items: center;
  min-height: calc(100svh - 110px);
  padding: 120px var(--gutter) 60px;
  text-align: center;
}

.lost-number {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 0 0 24px;
  font-family: var(--serif);
  font-size: clamp(90px, 16vw, 170px);
  line-height: 1;
  color: var(--moon);
}

.lost-number img {
  width: 0.9em;
  animation: float 4.5s ease-in-out infinite;
}

.lost-page h1 {
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.1;
}

.lost-page .body-copy {
  margin: 22px auto 30px;
}

.lost-page .actions {
  justify-content: center;
}

@media (max-width: 900px) {
  .magic,
  .town {
    grid-template-columns: 1fr;
  }

  .boards,
  .ways-facts {
    grid-template-columns: 1fr;
  }

  .cards {
    grid-template-columns: 1fr 1fr;
  }

  footer {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  body {
    font-size: 16px;
  }

  .site-header nav a:not(.nav-play) {
    display: none;
  }

  .hero {
    padding-top: 96px;
  }

  .hero-image {
    object-position: 46% 40%;
  }

  .magic,
  .worlds,
  .rewards,
  .ways,
  .town {
    padding-top: 90px;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .world {
    flex-basis: 88vw;
  }
}

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

  .letter,
  .gem,
  .sky,
  .lost-number img {
    animation: none;
  }
}
