/* Random Mix website. Dark neon-club theme, no JavaScript required.
   Baseline: any browser with CSS custom properties (2017+). Everything newer
   (clamp, color-mix, balance, container queries) is layered via fallbacks or
   @supports so old WebKit/Blink still gets a clean readable page. */

@font-face {
  font-family: 'Audiowide';
  src: url('fonts/audiowide-latin-400-normal.woff2') format('woff2'),
       url('fonts/audiowide-latin-400-normal.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #05060b;
  --bg-glow: #131a2c;
  --bg-raise: #0e1424;
  --panel: #101524;
  --edge: #232c44;
  --text: #e8ecf6;
  --text-dim: #9aa4bd;
  --blue: #4c8dff;
  --pink: #ff5cae;
  --teal: #35c2a0;
  --orange: #ffa033;
  --purple: #9b6cff;
  --gold: #ffd166;
  --fx-star: rgba(230, 238, 255, 0.5);
  --fx-bar-alpha: 0.12;
  --fx-haze-alpha: 0.16;
  --radius: 14px;
  --display: 'Audiowide', 'Trebuchet MS', 'Segoe UI', sans-serif;
  --body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* LIGHT THEME — same neon accents, deepened for contrast on paper-light surfaces.
   Applied by explicit choice (data-theme="light") or by system preference when no choice is stored. */
:root[data-theme="light"] {
  --bg: #eef1f8;
  --bg-glow: #dfe6f6;
  --bg-raise: #e3e8f4;
  --panel: #ffffff;
  --edge: #d3daeb;
  --text: #182031;
  --text-dim: #55617a;
  --blue: #2e63d8;
  --pink: #d92c86;
  --teal: #128f72;
  --orange: #c47410;
  --purple: #6f42d8;
  --gold: #a8821a;
  --fx-star: rgba(40, 56, 100, 0.28);
  --fx-bar-alpha: 0.10;
  --fx-haze-alpha: 0.12;
}
/* No system-preference auto-switch: the neon dark theme is the brand default everywhere;
   light mode is an explicit visitor choice via the toggle. */

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  background-image: radial-gradient(90rem 50rem at 50% -10rem, var(--bg-glow), var(--bg) 60%);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

/* layout container */
.wrap { max-width: 68rem; margin: 0 auto; padding: 0 1.25rem; }

a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--pink); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 4px; }

.skip {
  position: absolute; left: -999px; top: 0; z-index: 10;
  background: var(--panel); color: var(--text); padding: 0.6rem 1rem; border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; }

/* ------- header ------- */
header.site {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 1rem 1.25rem; max-width: 68rem; margin: 0 auto;
}
header.site img { width: 40px; height: 40px; border-radius: 9px; }
header.site .name {
  font-family: var(--display); font-size: 1.05rem; letter-spacing: 0.06em;
  color: var(--text); text-decoration: none;
}
header.site nav { margin-left: auto; display: flex; gap: 1rem; row-gap: 0.6rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
header.site nav a { color: var(--text-dim); text-decoration: none; font-size: 0.95rem; }
header.site nav a:hover { color: var(--text); }
header.site nav a.btn-play, header.site nav a.btn-play:hover { color: #fff; font-size: 0.9rem; padding: 0.55rem 1.1rem; }

/* theme / motion toggles. Header buttons live in their own .tgls group between the brand and
   the nav; the footer gets inline text pills. */
.tgls { display: flex; gap: 0.45rem; align-items: center; margin-left: auto; }
header.site nav { margin-left: 1.1rem; }
button.tgl {
  -webkit-appearance: none; appearance: none;
  background: transparent; border: 1.5px solid var(--edge); color: var(--text-dim);
  border-radius: 999px; padding: 0.35rem 0.75rem; font: 600 0.8rem var(--body);
  cursor: pointer; letter-spacing: 0.02em; line-height: 1.2; white-space: nowrap;
}
button.tgl:hover { border-color: var(--blue); color: var(--text); }

/* Phone header: one tidy brand row (logo + name left, icon-only toggles right), then the nav
   as its own centered row. No text wrapping around the logo, no pill soup. */
@media (max-width: 760px) {
  header.site { flex-wrap: wrap; padding: 0.85rem 1rem 0.7rem; row-gap: 0.75rem; }
  header.site .name { font-size: 1rem; white-space: nowrap; }
  header.site nav { margin-left: 0; width: 100%; justify-content: center; gap: 1rem; }
  header.site .tgls .tgl { padding: 0.35rem 0.55rem; font-size: 0.9rem; }
  header.site .tgls .tgl .txt { display: none; }   /* glyph-only in the brand row */
}

/* ------- buttons ------- */
.btn {
  display: inline-block; padding: 0.85rem 1.6rem; border-radius: 999px;
  font-family: var(--display); font-size: 1rem; letter-spacing: 0.04em;
  text-decoration: none; text-align: center; border: 2px solid transparent;
}
.btn-play {
  background: var(--pink);
  background-image: linear-gradient(100deg, var(--pink), var(--purple));
  color: #fff;
}
.btn-play:hover { filter: brightness(1.12); color: #fff; }
.btn-ghost { border-color: var(--edge); color: var(--text); }
.btn-ghost:hover { border-color: var(--blue); color: var(--text); }

/* ------- hero ------- */
.hero { text-align: center; padding: 3.5rem 0 2.5rem; }
.hero .mark { width: 132px; height: 132px; border-radius: 26px; }
.hero h1 {
  font-family: var(--display); font-weight: 400;
  font-size: 2.1rem; font-size: clamp(2rem, 6vw, 3.4rem);
  margin: 1.2rem 0 0.4rem; letter-spacing: 0.05em;
}
.hero h1 .mix {
  background: linear-gradient(100deg, var(--pink), var(--purple));
  -webkit-background-clip: text; background-clip: text; color: var(--pink);
}
@supports (background-clip: text) or (-webkit-background-clip: text) {
  .hero h1 .mix { color: transparent; }
}
.hero .tag {
  font-size: 1.15rem; font-size: clamp(1.1rem, 2.6vw, 1.4rem);
  color: var(--text-dim); max-width: 38rem; margin: 0 auto 1.8rem;
}
.hero .tag strong { color: var(--text); font-weight: 600; }
.hero .cta { display: flex; gap: 0.9rem; justify-content: center; flex-wrap: wrap; }
.hero .fineprint { color: var(--text-dim); font-size: 0.85rem; margin-top: 0.9rem; }

/* equalizer animation: decorative only, resting bars when motion is reduced */
.eq { display: flex; gap: 10px; justify-content: center; align-items: flex-end; height: 64px; margin: 2.2rem auto 0; }
.eq span { width: 14px; border-radius: 7px; height: 30%; }
.eq span:nth-child(1) { background: var(--blue); height: 42%; }
.eq span:nth-child(2) { background: var(--pink); height: 72%; }
.eq span:nth-child(3) { background: var(--teal); height: 100%; }
.eq span:nth-child(4) { background: var(--orange); height: 72%; }
.eq span:nth-child(5) { background: var(--purple); height: 42%; }
@media (prefers-reduced-motion: no-preference) {
  .eq span { animation: eq 1.1s ease-in-out infinite alternate; transform-origin: bottom; }
  .eq span:nth-child(1) { animation-delay: 0s; }
  .eq span:nth-child(2) { animation-delay: 0.15s; }
  .eq span:nth-child(3) { animation-delay: 0.3s; }
  .eq span:nth-child(4) { animation-delay: 0.45s; }
  .eq span:nth-child(5) { animation-delay: 0.6s; }
  @keyframes eq { from { transform: scaleY(0.55); } to { transform: scaleY(1); } }
}

/* ------- sections ------- */
section { padding: 2.6rem 0; }
h2 {
  font-family: var(--display); font-weight: 400; letter-spacing: 0.04em;
  font-size: 1.5rem; font-size: clamp(1.4rem, 3.4vw, 1.9rem); margin: 0 0 1.4rem;
}
@supports (text-wrap: balance) { h1, h2, .tag { text-wrap: balance; } }

.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr)); }
.card {
  background: var(--panel); border: 1px solid var(--edge); border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
}
.card h3 { margin: 0 0 0.4rem; font-size: 1.02rem; font-family: var(--display); font-weight: 400; letter-spacing: 0.03em; }
.card p { margin: 0; color: var(--text-dim); font-size: 0.95rem; }
.card[data-c="blue"] h3 { color: var(--blue); }
.card[data-c="pink"] h3 { color: var(--pink); }
.card[data-c="teal"] h3 { color: var(--teal); }
.card[data-c="orange"] h3 { color: var(--orange); }
.card[data-c="purple"] h3 { color: var(--purple); }
.card[data-c="gold"] h3 { color: var(--gold); }

/* demo vs full — fits every screen width, no horizontal scrolling. Labels wrap; the two
   value columns stay compact. */
table { border-collapse: collapse; width: 100%; font-size: 0.97rem; }
th, td { text-align: left; padding: 0.65rem 0.9rem; border-bottom: 1px solid var(--edge); vertical-align: top; }
th { font-family: var(--display); font-weight: 400; letter-spacing: 0.04em; color: var(--text-dim); font-size: 0.9rem; }
td:first-child { color: var(--text-dim); }
.yes { color: var(--teal); }
.cmp { border: 1px solid var(--edge); border-radius: var(--radius); padding: 0 0.35rem; background: var(--panel); }
.cmp tr:last-child td { border-bottom: none; }
@media (max-width: 480px) {
  table { font-size: 0.88rem; }
  th, td { padding: 0.55rem 0.5rem; }
}

/* ------- docs & prose pages ------- */
.prose { max-width: 46rem; }
.prose h1 { font-family: var(--display); font-weight: 400; font-size: 1.8rem; letter-spacing: 0.04em; margin: 2.4rem 0 1rem; }
.prose h2 { font-size: 1.25rem; margin-top: 2rem; }
.prose li { margin: 0.3rem 0; }
.prose .updated { color: var(--text-dim); font-size: 0.9rem; }
kbd {
  background: var(--bg-raise); border: 1px solid var(--edge); border-bottom-width: 3px;
  border-radius: 6px; padding: 0.1rem 0.5rem; font-size: 0.88em;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

/* ------- footer ------- */
footer.site {
  border-top: 1px solid var(--edge); margin-top: 3rem; padding: 2rem 0 3rem;
  color: var(--text-dim); font-size: 0.92rem;
}
footer.site .wrap { display: flex; gap: 1.4rem; flex-wrap: wrap; align-items: center; }
footer.site a { color: var(--text-dim); }
footer.site a:hover { color: var(--text); }
footer.site .spacer { flex: 1; }

@media (max-width: 640px) {
  .hero { padding-top: 2.2rem; }
  .hero .mark { width: 104px; height: 104px; }
  header.site nav { gap: 0.8rem; }
}

/* ------- ambient FX layer (injected by site.js; inspired by the game's menu) -------
   A fixed backdrop behind everything: drifting star specks, two slow haze glows in the
   brand blue/pink, and an equalizer skyline breathing along the bottom edge. Pure CSS
   animation, pointer-transparent, hidden entirely when the player turns FX off. */
.fx { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
:root[data-fx="off"] .fx { display: none; }

.fx-stars {
  position: absolute; left: 0; right: 0; top: -260px; bottom: -260px;
  background-image:
    radial-gradient(2px 2px at 22% 18%, var(--fx-star), transparent 55%),
    radial-gradient(1.6px 1.6px at 68% 42%, var(--fx-star), transparent 55%),
    radial-gradient(1.4px 1.4px at 41% 71%, var(--fx-star), transparent 55%),
    radial-gradient(2px 2px at 87% 84%, var(--fx-star), transparent 55%),
    radial-gradient(1.3px 1.3px at 9% 55%, var(--fx-star), transparent 55%);
  background-size: 260px 260px;
  animation: fx-drift 90s linear infinite;
}
@keyframes fx-drift { to { transform: translateY(260px); } }

.fx-haze { position: absolute; width: 46rem; height: 46rem; border-radius: 50%; filter: blur(70px); opacity: var(--fx-haze-alpha); }
.fx-h1 { left: -14rem; top: -16rem; background: radial-gradient(circle, var(--blue), transparent 65%); animation: fx-haze1 34s ease-in-out infinite alternate; }
.fx-h2 { right: -16rem; bottom: -18rem; background: radial-gradient(circle, var(--pink), transparent 65%); animation: fx-haze2 41s ease-in-out infinite alternate; }
@keyframes fx-haze1 { to { transform: translate(6rem, 4rem) scale(1.15); } }
@keyframes fx-haze2 { to { transform: translate(-5rem, -6rem) scale(1.12); } }

.fx-bars { position: absolute; left: 0; right: 0; bottom: -6px; height: 22vh; display: flex; align-items: flex-end; justify-content: space-around; opacity: var(--fx-bar-alpha); }
.fx-bars b { width: 4.5%; border-radius: 8px 8px 0 0; transform-origin: bottom; }
.fx-bars b:nth-child(5n+1) { background: var(--blue); height: 42%; animation: fx-eq 5.2s ease-in-out infinite alternate; }
.fx-bars b:nth-child(5n+2) { background: var(--pink); height: 74%; animation: fx-eq 6.1s ease-in-out infinite alternate; animation-delay: -1.2s; }
.fx-bars b:nth-child(5n+3) { background: var(--teal); height: 100%; animation: fx-eq 4.6s ease-in-out infinite alternate; animation-delay: -2.4s; }
.fx-bars b:nth-child(5n+4) { background: var(--orange); height: 63%; animation: fx-eq 6.8s ease-in-out infinite alternate; animation-delay: -0.7s; }
.fx-bars b:nth-child(5n+5) { background: var(--purple); height: 51%; animation: fx-eq 5.7s ease-in-out infinite alternate; animation-delay: -3.1s; }
@keyframes fx-eq { from { transform: scaleY(0.45); } to { transform: scaleY(1); } }

@media (prefers-reduced-motion: reduce) {
  .fx-stars, .fx-haze, .fx-bars b { animation: none !important; }
}

@media print {
  body { background: #fff; color: #000; }
  header.site nav, .cta, .eq, .fx, button.tgl { display: none; }
}
