@font-face {
  font-family: "Self Dream";
  src: url("/assets/fonts/SelfDream-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --page-bg: #17142d;
  --text: #fff9ed;
  --accent: #b74e43;
  --surface: rgb(28 24 48 / 64%);
  --surface-hover: #fff9ed;
  --surface-hover-text: #211d37;
  --focus: #fff0a8;
  --button-radius: 999px;
}

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

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--page-bg);
}

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background: var(--page-bg);
  color: var(--text);
  font-family: "Self Dream", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before,
body::after {
  position: fixed;
  inset: 0;
  content: "";
  pointer-events: none;
}

body::before {
  z-index: 0;
  background-image: url("/assets/images/banner-desktop-original.webp");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

body::after {
  z-index: 1;
  background:
    radial-gradient(circle at 50% 45%, rgb(18 15 38 / 8%) 0 30%, rgb(18 15 38 / 35%) 72%),
    linear-gradient(180deg, rgb(15 13 34 / 18%) 0%, rgb(15 13 34 / 8%) 42%, rgb(15 13 34 / 58%) 100%);
}

.landing-page {
  position: relative;
  z-index: 3;
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: clamp(1.25rem, 4vw, 3.25rem);
}

.hero {
  display: flex;
  width: 100%;
  max-width: 68rem;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(2rem, 6vh, 4.5rem);
  text-align: center;
}

.wordmark-reveal {
  width: min(100%, 58rem);
  max-width: 100%;
}

.wordmark-button {
  --logo-shift-x: 0px;
  --logo-shift-y: 0px;
  --logo-tilt-x: 0deg;
  --logo-tilt-y: 0deg;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transform:
    perspective(900px)
    translate3d(var(--logo-shift-x), var(--logo-shift-y), 0)
    rotateX(var(--logo-tilt-x))
    rotateY(var(--logo-tilt-y));
  transform-style: preserve-3d;
  transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1);
}

.wordmark-button:hover {
  transform:
    perspective(900px)
    translate3d(var(--logo-shift-x), var(--logo-shift-y), 0)
    rotateX(var(--logo-tilt-x))
    rotateY(var(--logo-tilt-y))
    scale(1.012);
}

.wordmark-button:active {
  transform:
    perspective(900px)
    translate3d(var(--logo-shift-x), var(--logo-shift-y), 0)
    rotateX(var(--logo-tilt-x))
    rotateY(var(--logo-tilt-y))
    scale(0.985);
}

.wordmark-button:focus-visible {
  border-radius: var(--button-radius);
  outline: 3px solid var(--focus);
  outline-offset: 0.7rem;
}

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

.photo-flash {
  position: fixed;
  inset: 0;
  z-index: 4;
  background: radial-gradient(circle at 50% 42%, rgb(255 249 237 / 46%), transparent 64%);
  opacity: 0;
  pointer-events: none;
}

.photo-flash.is-active {
  animation: camera-flash 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.ambient-lights {
  display: none;
}

.actions-shell {
  display: contents;
}

.actions {
  display: flex;
  width: min(100%, 22rem);
  max-width: 100%;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.steam-status,
.community-link {
  display: inline-flex;
  min-height: 3.25rem;
  align-items: center;
  justify-content: center;
  border-radius: var(--button-radius);
  font-size: clamp(1.25rem, 2.5vw, 1.8rem);
  line-height: 1;
  text-align: center;
  text-decoration: none;
  text-shadow: 0 0.12rem 0.15rem rgb(28 17 30 / 28%);
}

.steam-status {
  width: 19rem;
  max-width: 100%;
  padding: 1rem 2rem;
  background: var(--accent);
  font-size: clamp(1.2rem, 2.1vw, 1.55rem);
  white-space: nowrap;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 20%),
    0 0.55rem 1.4rem rgb(19 12 34 / 25%);
  cursor: default;
}

.community-links {
  display: flex;
  width: 100%;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem;
}

.community-kicker {
  display: none;
}

.community-link {
  min-width: 9rem;
  padding: 0.8rem 1.45rem;
  border: 2px solid rgb(255 249 237 / 88%);
  background: var(--surface);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 10%);
  transition:
    color 220ms cubic-bezier(0.32, 0.72, 0, 1),
    background-color 220ms cubic-bezier(0.32, 0.72, 0, 1),
    transform 220ms cubic-bezier(0.32, 0.72, 0, 1);
}

.community-link:hover {
  background: var(--surface-hover);
  color: var(--surface-hover-text);
  text-shadow: none;
  transform: translateY(-2px);
}

.community-link:active {
  transform: translateY(0) scale(0.98);
}

.community-link:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.not-found-wordmark {
  width: min(100%, 42rem);
}

.not-found-title {
  margin: 0;
  font-size: clamp(2.25rem, 7vw, 4.75rem);
  line-height: 1;
}

.not-found-copy {
  margin: -1.25rem 0 0;
  font-family: system-ui, sans-serif;
  font-size: clamp(1rem, 2.5vw, 1.2rem);
}

@media (prefers-reduced-motion: no-preference) {
  .wordmark-reveal {
    animation: rise-in 380ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .steam-status {
    animation: rise-in 380ms 60ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .community-links {
    animation: rise-in 380ms 100ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }
}

@keyframes camera-flash {
  0% {
    opacity: 0;
  }

  12% {
    opacity: 0.8;
  }

  100% {
    opacity: 0;
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(0.65rem);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) and (orientation: portrait) {
  body::before {
    inset: 0;
    background-image: url("/assets/images/banner-mobile-v2.webp");
    background-position: center bottom;
  }

  body::after {
    background:
      url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.72' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.055'/%3E%3C/svg%3E"),
      radial-gradient(circle at 50% 17%, rgb(109 91 175 / 14%), transparent 29%),
      radial-gradient(circle at 55% 61%, transparent 0 22%, rgb(10 9 29 / 16%) 67%),
      linear-gradient(180deg, rgb(10 9 28 / 6%) 0%, transparent 35%, rgb(10 9 28 / 5%) 60%, rgb(10 9 28 / 62%) 100%);
    background-size: 10rem 10rem, cover, cover, cover;
    mix-blend-mode: normal;
  }

  .ambient-lights {
    position: fixed;
    inset: 0;
    z-index: 2;
    display: block;
    overflow: hidden;
    pointer-events: none;
  }

  .ambient-lights span {
    position: absolute;
    width: 0.2rem;
    height: 0.2rem;
    border-radius: 50%;
    background: #fff2bd;
    box-shadow: 0 0 0.75rem 0.2rem rgb(255 238 168 / 38%);
    opacity: 0;
  }

  .ambient-lights span:nth-child(1) {
    top: 29%;
    left: 15%;
    animation-delay: 1.1s;
  }

  .ambient-lights span:nth-child(2) {
    top: 36%;
    right: 18%;
    animation-delay: 3.7s;
  }

  .ambient-lights span:nth-child(3) {
    top: 48%;
    left: 28%;
    animation-delay: 6.2s;
  }

  .ambient-lights span:nth-child(4) {
    top: 24%;
    right: 34%;
    animation-delay: 8.4s;
  }

  .landing-page {
    min-height: 100svh;
    place-items: stretch;
    padding:
      max(1rem, env(safe-area-inset-top))
      max(1rem, env(safe-area-inset-right))
      max(1rem, env(safe-area-inset-bottom))
      max(1rem, env(safe-area-inset-left));
  }

  .hero {
    display: grid;
    width: 100%;
    max-width: none;
    grid-template-rows: auto 1fr auto;
    gap: 0;
  }

  .wordmark-reveal {
    position: relative;
    width: min(90%, 22.25rem);
    margin-block-start: clamp(3.6rem, 13svh, 7rem);
    justify-self: center;
    filter: drop-shadow(0 0.45rem 1.25rem rgb(15 11 38 / 32%));
  }

  .wordmark-reveal::before {
    position: absolute;
    inset: -2.5rem -1.25rem;
    z-index: -1;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgb(124 100 190 / 17%), transparent 68%);
    content: "";
  }

  .actions-shell {
    display: block;
    width: min(100%, 22rem);
    align-self: end;
    justify-self: center;
    padding: 0;
    background: transparent;
    box-shadow: none;
  }

  .actions {
    width: 100%;
    gap: 0.62rem;
    padding: 0;
    background: transparent;
    box-shadow: none;
  }

  .steam-status {
    width: 100%;
    min-height: 3.25rem;
    gap: 0.58rem;
    padding: 0.85rem 1.2rem;
    border-radius: 1.08rem;
    background: linear-gradient(145deg, #cc6154 0%, #b84e46 54%, #9f3e3c 100%);
    font-size: clamp(1.04rem, 4.6vw, 1.2rem);
    box-shadow:
      inset 0 1px 1px rgb(255 255 255 / 25%),
      inset 0 -1px 0 rgb(102 34 38 / 32%),
      0 0 0 1px rgb(255 249 237 / 12%),
      0 0.65rem 1.35rem rgb(109 42 47 / 22%);
    text-shadow: 0 0.1rem 0.1rem rgb(91 33 39 / 35%);
  }

  .steam-status::before {
    width: 0.4rem;
    height: 0.4rem;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #ffe6b3;
    box-shadow: 0 0 0.65rem rgb(255 224 155 / 58%);
    content: "";
  }

  .community-kicker {
    display: block;
    margin: 0.3rem 0.2rem -0.05rem;
    color: rgb(255 249 237 / 62%);
    font-family: system-ui, sans-serif;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.13em;
    line-height: 1;
    text-transform: uppercase;
  }

  .community-links {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.62rem;
    padding: 0;
    background: transparent;
    box-shadow: none;
  }

  .community-link {
    width: 100%;
    min-width: 0;
    min-height: 2.85rem;
    padding: 0.72rem 0.65rem;
    border: 0;
    border-radius: 1rem;
    background: linear-gradient(145deg, rgb(43 37 70 / 94%), rgb(19 17 41 / 96%));
    font-size: clamp(1rem, 4.5vw, 1.15rem);
    box-shadow:
      inset 0 1px 1px rgb(255 255 255 / 13%),
      inset 0 -1px 0 rgb(4 4 17 / 38%),
      0 0 0 1px rgb(255 249 237 / 14%),
      0 0.55rem 1.2rem rgb(11 9 33 / 24%);
    touch-action: manipulation;
  }

  .community-link:active {
    background: rgb(255 249 237 / 10%);
    transform: scale(0.985);
  }
}

@media (max-width: 768px) and (orientation: landscape) {
  body::before {
    background-image: url("/assets/images/banner-1440.webp");
  }
}

@media (max-width: 768px) and (orientation: portrait) and (max-height: 700px) {
  .wordmark-reveal {
    margin-block-start: clamp(2rem, 8svh, 3.5rem);
  }

  .steam-status,
  .community-link {
    min-height: 2.75rem;
  }
}

@media (hover: none) {
  .wordmark-button:hover {
    transform: none;
  }
}

@media (hover: none) and (max-width: 768px) and (orientation: portrait) {
  .community-link:hover {
    background: linear-gradient(145deg, rgb(43 37 70 / 94%), rgb(19 17 41 / 96%));
    color: var(--text);
    text-shadow: 0 0.12rem 0.15rem rgb(28 17 30 / 28%);
    transform: none;
  }
}

@media (max-height: 620px) and (min-width: 600px) {
  .hero {
    gap: 1.75rem;
  }

  .wordmark-reveal {
    width: min(72vw, 50rem);
  }

  .steam-status,
  .community-link {
    min-height: 2.8rem;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .community-link {
    background: #2b2742;
  }
}

@media (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .wordmark-button {
    will-change: transform;
  }
}

@media (prefers-reduced-motion: reduce) {
  body::before,
  .ambient-lights span,
  .steam-status::before,
  .wordmark-button,
  .wordmark-button:hover,
  .wordmark-button:active {
    animation: none;
    transform: none;
    transition: none;
  }

  .photo-flash.is-active {
    animation-duration: 180ms;
  }
}

@media (max-width: 768px) and (orientation: portrait) and (prefers-reduced-motion: no-preference) {
  body::before {
    animation:
      mobile-scene-in 1.25s cubic-bezier(0.16, 1, 0.3, 1) both,
      mobile-scene-drift 16s 1.25s cubic-bezier(0.45, 0, 0.55, 1) infinite alternate;
  }

  .wordmark-reveal {
    animation: wordmark-arrive 920ms 150ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .actions-shell {
    animation: island-arrive 820ms 260ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .steam-status,
  .community-links {
    animation: none;
  }

  .ambient-lights span {
    animation-name: firefly-drift;
    animation-duration: 9s;
    animation-timing-function: cubic-bezier(0.45, 0, 0.55, 1);
    animation-iteration-count: infinite;
  }

  .steam-status::before {
    animation: status-pulse 2.8s cubic-bezier(0.45, 0, 0.55, 1) infinite;
  }
}

@keyframes mobile-scene-in {
  from {
    opacity: 0;
    transform: scale(1.025);
  }

  to {
    opacity: 1;
    transform: scale(1.005);
  }
}

@keyframes mobile-scene-drift {
  from {
    transform: translate3d(-0.08%, 0, 0) scale(1.005);
  }

  to {
    transform: translate3d(0.1%, -0.1%, 0) scale(1.012);
  }
}

@keyframes wordmark-arrive {
  from {
    opacity: 0;
    transform: translate3d(0, 0.8rem, 0) scale(0.975);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes island-arrive {
  from {
    opacity: 0;
    transform: translate3d(0, 1.4rem, 0) scale(0.975);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes firefly-drift {
  0%,
  100% {
    opacity: 0.08;
    transform: translate3d(0, 0, 0) scale(0.8);
  }

  42% {
    opacity: 0.55;
    transform: translate3d(0.5rem, -0.7rem, 0) scale(1.1);
  }

  72% {
    opacity: 0.18;
    transform: translate3d(-0.35rem, -1rem, 0) scale(0.9);
  }
}

@keyframes status-pulse {
  0%,
  100% {
    opacity: 0.62;
    transform: scale(0.86);
  }

  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

@media (prefers-contrast: more) {
  body::after {
    background: rgb(15 13 34 / 40%);
  }

  .community-link {
    border-width: 3px;
    background: #211d37;
  }
}
