/* Bastion Nova — teaser site.
   Palette follows the game's own UI chrome (src/ui/theme.rs): near-black panels,
   #ebebeb text, #8c8c8c dim. The game's chrome carries no accent hue, so the
   warm nova amber below is the site's alone. */

@font-face {
  font-family: 'Acari Sans';
  src: url('fonts/AcariSans-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Acari Sans';
  src: url('fonts/AcariSans-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Acari Sans';
  src: url('fonts/AcariSans-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0d0d0f;
  --panel: #1c1c1f;
  --text: #ebebeb;
  --dim: #8c8c8c;
  --accent: #f0a63c;

  --step: clamp(1rem, 0.6rem + 1.8vw, 1.6rem);
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(var(--step) * 2.5);
  padding: calc(var(--step) * 2) var(--step);

  background-color: var(--bg);
  color: var(--text);
  font-family: 'Acari Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-weight: 400;
  line-height: 1.6;
  text-align: center;

  overflow-x: hidden;
}

/* --- Backdrop ------------------------------------------------------------ */

/* The nova: a warm core bleeding into cold blue, breathing slowly. Sits behind
   the title rather than beside it, so the wordmark reads as lit from within. */
.nova {
  position: fixed;
  top: 34%;
  left: 50%;
  width: min(150vw, 150vh);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  z-index: -1;
  pointer-events: none;

  background:
    radial-gradient(circle closest-side,
      rgba(240, 166, 60, 0.16) 0%,
      rgba(240, 166, 60, 0.06) 22%,
      rgba(120, 130, 190, 0.05) 42%,
      rgba(13, 13, 15, 0) 66%);

  animation: breathe 14s ease-in-out infinite;
}

/* A sparse, static star layer. Four gradients rather than a bitmap keeps the
   page free of image requests. */
.stars {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: 0.5;

  background-image:
    radial-gradient(1.5px 1.5px at 12% 22%, rgba(255, 255, 255, 0.55), transparent),
    radial-gradient(1px 1px at 68% 14%, rgba(255, 255, 255, 0.40), transparent),
    radial-gradient(1.5px 1.5px at 84% 68%, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1px 1px at 27% 78%, rgba(255, 255, 255, 0.45), transparent),
    radial-gradient(1px 1px at 46% 46%, rgba(255, 255, 255, 0.25), transparent),
    radial-gradient(1.5px 1.5px at 92% 32%, rgba(255, 255, 255, 0.30), transparent),
    radial-gradient(1px 1px at 6% 56%, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1px 1px at 57% 88%, rgba(255, 255, 255, 0.30), transparent);
}

@keyframes breathe {
  0%, 100% { opacity: 0.75; transform: translate(-50%, -50%) scale(1); }
  50%      { opacity: 1;    transform: translate(-50%, -50%) scale(1.06); }
}

/* --- Content ------------------------------------------------------------- */

/* Wide enough for the wordmark to hold one line on a desktop viewport; the
   prose below is capped separately so it stays a readable measure. */
main {
  max-width: min(100%, 52rem);
  animation: rise 1.2s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 0.9rem + 5vw, 5rem);
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.15;
  text-transform: uppercase;
  text-wrap: balance;

  /* Two shadows: a tight warm halo, and a wide soft one for the bloom. */
  text-shadow:
    0 0 18px rgba(240, 166, 60, 0.28),
    0 0 60px rgba(240, 166, 60, 0.12);
}

/* A hairline that fades out at both ends, with the nova's ember at its centre.
   Closes the name/hook statement off from the footer below. */
.rule {
  position: relative;
  width: min(15rem, 60%);
  height: 1px;
  margin: calc(var(--step) * 1.9) auto 0;
  border: 0;
  background: linear-gradient(
    to right,
    transparent,
    rgba(235, 235, 235, 0.20) 22%,
    rgba(235, 235, 235, 0.20) 78%,
    transparent);
}

.rule::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 3px;
  height: 3px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px 1px rgba(240, 166, 60, 0.6);
}

.line {
  max-width: 34rem;
  margin: calc(var(--step) * 1.4) auto 0;
  font-size: clamp(1rem, 0.9rem + 0.6vw, 1.3rem);
  font-weight: 300;
  line-height: 1.75;
  text-wrap: balance;
  color: #c8c8c8;
}

/* --- Footer -------------------------------------------------------------- */

footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.7rem 1.4rem;

  font-size: 0.82rem;
  font-weight: 300;
  letter-spacing: 0.06em;
  color: var(--dim);

  animation: rise 1.2s cubic-bezier(0.2, 0.7, 0.3, 1) 0.35s both;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px rgba(240, 166, 60, 0.7);
  animation: pulse 3.2s ease-in-out infinite;
}

footer a {
  color: var(--dim);
  text-decoration: none;
  border-bottom: 1px solid rgba(140, 140, 140, 0.3);
  padding-bottom: 1px;
  transition: color 0.25s ease, border-color 0.25s ease;
}

footer a:hover,
footer a:focus-visible {
  color: var(--text);
  border-bottom-color: var(--accent);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(1.2rem); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

/* Wide tracking is what pushes the wordmark off a phone screen, so it is the
   first thing to give. Below ~320px it still wraps to two lines, which is why
   the markup no longer glues the words together. */
@media (max-width: 30rem) {
  h1 { letter-spacing: 0.07em; }
}

/* Short landscape viewports (a phone turned sideways) have no room for the
   full rhythm — tighten it rather than letting the footer push off-screen. */
@media (max-height: 34rem) {
  body { gap: var(--step); }
  .line { margin-top: var(--step); }
  .rule { margin: calc(var(--step) * 1.1) auto 0; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}
