@font-face {
  font-family: "Alagard";
  src: url("assets/alagard.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Pixelify Sans";
  src: url("assets/pixelify-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --night: #0a1726;
  --gold: #ffd16c;
  --muted: #bcc8d0;
  --line: #424d56;
  --display: "Alagard", Georgia, serif;
  --pixel: "Pixelify Sans", ui-monospace, monospace;
}

@property --ink-radius {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 135%;
}

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

body {
  margin: 0;
  background: var(--night);
  color: var(--gold);
  font: 1rem/1.5 var(--pixel);
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.26em;
}

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

.frame {
  width: min(100% - clamp(2rem, 8vw, 7rem), 78rem);
  margin-inline: auto;
}

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: 4rem clamp(8rem, 13vw, 13rem) 5rem;
}

.hero-art, .hero-motif {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-art {
  z-index: -2;
  overflow: hidden;
  background: var(--night);
  mask-image: radial-gradient(ellipse farthest-corner at 50% 38%, #000 calc(var(--ink-radius) - 22%), transparent var(--ink-radius));
}

.hero-art-incoming {
  --ink-radius: 0%;
  opacity: 0;
}

.hero-art::after {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 48%, #0a17267a 8%, transparent 65%),
    radial-gradient(ellipse at 50% 34%, transparent 28%, #0a17269c 100%),
    linear-gradient(to bottom, #0a172662 0%, #0a17265c 32%, #0a1726b0 68%, var(--night) 99%);
  content: "";
}

.hero-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 38%;
}

.hero-motif {
  z-index: -1;
  overflow: hidden;
}

.hero-motif::before {
  position: absolute;
  top: 13%;
  left: 61%;
  width: clamp(6rem, 15vw, 13rem);
  aspect-ratio: 1;
  border: 3px solid #efb84f;
  border-radius: 50%;
  border-left-color: transparent;
  border-bottom-color: #efb84f24;
  box-shadow: 0 0 22px #deaa5260, inset 0 0 14px #deaa5236;
  opacity: 0.78;
  transform: rotate(-26deg);
  content: "";
}

.rail {
  position: absolute;
  top: 50%;
  left: clamp(1.5rem, 3.5vw, 3.5rem);
  transform: translateY(-50%);
}

.rail ul {
  display: grid;
  gap: 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rail-entry {
  display: grid;
  grid-template-columns: 2rem auto;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.75rem;
  color: #a9b5be;
  font-size: 0.875rem;
  letter-spacing: 0.06em;
  line-height: 1.15;
  text-transform: uppercase;
}

.rail-entry small {
  display: block;
  color: #8e9eac;
  font-size: 0.75rem;
  letter-spacing: 0.07em;
}

.rail-entry[aria-current] {
  color: var(--gold);
  text-decoration: none;
}

.rail-entry[aria-current]:hover {
  text-decoration: underline;
}

.rail-icon {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid #6674828c;
  background: #0a1726d9;
}

.rail-entry[aria-current] .rail-icon {
  border-color: #d3a94e;
  background: #3c321f;
}

.rail-icon img,
.rail-icon::after {
  width: 1.4rem;
  height: 1.4rem;
}

.rail-icon img {
  object-fit: contain;
}

.rail-icon:empty::after {
  background: currentColor;
  mask: var(--icon) center / contain no-repeat;
  content: "";
}

.icon-world { --icon: url("assets/b8-world.png"); }
.icon-classes { --icon: url("assets/b8-classes.png"); }
.icon-devlog { --icon: url("assets/b8-devlog.png"); }
.icon-about { --icon: url("assets/b8-about.png"); }

.music-control {
  position: absolute;
  z-index: 1;
  top: calc(1.2rem + env(safe-area-inset-top));
  right: max(1rem, 4vw, env(safe-area-inset-right));
  text-align: right;
}

.music-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid #8e7950;
  background: #0a1726ed;
  color: #d2bb89;
  cursor: pointer;
}

.music-button:hover, .music-button[aria-pressed="true"] {
  border-color: var(--gold);
  color: var(--gold);
}

.music-button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.music-icon {
  width: 1.35rem;
  height: 1.35rem;
  background: currentColor;
  mask: url("assets/music-note.png") center / contain no-repeat;
}

.music-button[aria-pressed="false"] .music-icon { opacity: 0.72; }

.music-button[aria-pressed="false"]::after {
  position: absolute;
  right: 0.35rem;
  bottom: 0.35rem;
  width: 0.5rem;
  height: 0.5rem;
  background: linear-gradient(45deg, transparent 40%, currentColor 40% 60%, transparent 60%),
    linear-gradient(-45deg, transparent 40%, currentColor 40% 60%, transparent 60%);
  content: "";
}

@media (prefers-reduced-motion: no-preference) {
  .music-button[aria-pressed="true"] .music-icon {
    animation: music-note 2s ease-in-out infinite;
  }

  @keyframes music-note {
    50% { transform: translateY(-2px); }
  }
}

.hero-copy {
  display: grid;
  justify-items: center;
  width: 100%;
  max-width: 54rem;
  text-align: center;
}

.eyebrow {
  margin: 0;
  font-size: clamp(0.9375rem, 1.5vw, 1.125rem);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-shadow: 0 2px 8px #081321, 0 0 16px #081321;
}

.hero-brand {
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  margin: clamp(1rem, 3svh, 1.75rem) 0 clamp(1.65rem, 4svh, 2.65rem);
  font: 400 clamp(2.15rem, 4.3vw, 4.25rem)/0.98 var(--display);
  text-shadow: 0 3px #0a1726, 0 7px 18px #081321;
}

.hero-brand img {
  display: block;
  width: clamp(8.5rem, 24svh, 15rem);
  height: auto;
  filter: drop-shadow(0 3px 10px #081321e0);
}

.hero-details {
  display: grid;
  justify-items: center;
  gap: 1.35rem;
}

.features {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.features li {
  color: #ffe6af;
  font-size: 0.9375rem;
  letter-spacing: 0.045em;
  line-height: 1.3;
  text-shadow: 0 1px 2px var(--night), 0 0 12px var(--night);
  text-transform: uppercase;
}

.feature-short {
  display: none;
}

.development {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 3rem;
  margin: 0;
  padding: 0.5rem 1rem;
  background: var(--gold);
  color: var(--night);
  box-shadow: 4px 4px #101b2b;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.development span {
  width: 0.5rem;
  height: 0.5rem;
  border: 2px solid currentColor;
  transform: rotate(45deg);
}

.newsletter {
  width: min(100%, 27rem);
  margin-block-start: 1.35rem;
}

.newsletter label {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  margin-block-end: 0.4rem;
  font-size: 0.9375rem;
  letter-spacing: 0.07em;
  text-align: left;
  text-shadow: 0 1px 2px var(--night), 0 0 10px var(--night);
  text-transform: uppercase;
}

.newsletter label::after {
  flex: 1;
  border-bottom: 2px dotted #a58b57;
  content: "";
}

.newsletter-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.45rem;
}

.newsletter input, .newsletter button, .newsletter-result button {
  min-height: 2.75rem;
  padding: 0.5rem 0.65rem;
  font: inherit;
}

.newsletter input {
  width: 100%;
  border: 1px solid #a58b57;
  border-radius: 0;
  background-color: #d6bc80;
  color: var(--night);
}

.newsletter input::placeholder {
  color: #393023;
  text-transform: uppercase;
}

.newsletter button, .newsletter-result button {
  border: 1px solid var(--gold);
  border-radius: 0;
  background: #c9a04d;
  color: var(--night);
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
}

.newsletter button:hover, .newsletter-result button:hover {
  background: var(--gold);
}

.newsletter button:disabled {
  cursor: wait;
}

.newsletter :focus-visible, .newsletter-result button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.newsletter p {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.8125rem;
  text-align: left;
  text-shadow: 0 1px 2px var(--night), 0 0 10px var(--night);
}

.newsletter .newsletter-status {
  min-height: 1.5em;
  color: #ffdfa0;
}

.newsletter .newsletter-status[data-error] {
  color: #ffbcae;
}

.scene-caption {
  position: absolute;
  right: max(1rem, 4vw);
  bottom: 0.75rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
}

.statement {
  margin-block: 0;
  padding-block: clamp(2.5rem, 6vw, 4.75rem);
  border-top: 1px dashed var(--line);
  color: #ffe0a0;
  font-size: clamp(1.55rem, 3.5vw, 2.55rem);
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
  text-wrap: balance;
  text-transform: uppercase;
}

.mechanics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  margin: 0;
  padding: 0 0 clamp(2.5rem, 6vw, 4.75rem);
  list-style: decimal-leading-zero inside;
}

.mechanics li {
  padding: 1.25rem 1rem;
  border-top: 1px dashed var(--line);
}

.mechanics li::marker {
  color: #dbb665;
}

.mechanics h3 {
  display: inline;
  margin: 0;
  font-size: 1.125rem;
  text-transform: uppercase;
}

.mechanics p {
  max-width: 48ch;
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-family: system-ui, sans-serif;
}

.newsletter-result {
  max-width: 40rem;
  padding-block: 3rem;
}

.newsletter-result h1 {
  margin: 0 0 1rem;
  font: 400 clamp(2.5rem, 9vw, 4rem)/1 var(--display);
}

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0 1rem;
  min-height: 4.25rem;
  border-top: 1px solid var(--line);
}

.footer a {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.875rem;
  letter-spacing: 0.06em;
}

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

@media (max-width: 54rem) {
  .hero {
    --hero-copy-top: clamp(7rem, 16svh, 11rem);
    align-items: start;
    padding: var(--hero-copy-top) max(1rem, env(safe-area-inset-right))
      calc(7.6rem + env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  }

  .rail {
    top: auto;
    right: max(0.6rem, env(safe-area-inset-right));
    bottom: 0;
    left: max(0.6rem, env(safe-area-inset-left));
    max-width: 30rem;
    margin-inline: auto;
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
    transform: none;
  }

  .rail ul {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
  }

  .rail-entry {
    grid-template-columns: 1fr;
    align-content: start;
    justify-items: center;
    gap: 0.2rem;
    text-align: center;
  }

  .rail-icon,
  .rail-entry[aria-current] .rail-icon {
    border-color: transparent;
    background: transparent;
  }

  .scene-caption {
    bottom: calc(4.75rem + max(0.75rem, env(safe-area-inset-bottom)));
  }

  .hero-motif::before {
    top: 16%;
    left: 61%;
  }

  .hero-brand {
    font-size: clamp(1.7rem, 8.65vw, 4rem);
  }

  .hero-brand img {
    width: clamp(7.5rem, 19svh, 11rem);
  }

  .features li {
    font-size: 0.875rem;
    letter-spacing: 0.02em;
  }
}

@media (max-width: 36rem) {
  .hero-motif::before {
    /* The open rim starts about 2rem below the top of its 6rem circle. */
    top: calc(var(--hero-copy-top) - 2.65rem);
    left: calc(50% + 2.6rem);
    width: 6rem;
  }
}

@media (max-width: 29rem) {
  .feature-full {
    display: none;
  }

  .feature-short {
    display: inline;
  }
}

@media (max-width: 54rem) and (max-height: 44rem) {
  .hero {
    --hero-copy-top: 7.25rem;
  }

  .hero-brand {
    margin-block: 0.75rem 1.25rem;
  }
}

@media (max-width: 36rem) and (max-height: 44rem) and (orientation: portrait) {
  .hero {
    --hero-copy-top: 5rem;
    padding-block-end: calc(6.85rem + env(safe-area-inset-bottom));
  }

  .hero-details {
    gap: 0.9rem;
  }

  .hero-motif::before {
    left: calc(50% + 1.7rem);
  }

  .newsletter {
    margin-block-start: 0.9rem;
  }
}

