/*
  Stupid Audio catalog.
  Each plugin section sets three custom properties inline in index.html:
    --accent   brand color (headings, Download button, glow)
    --accent2  partner color from the same plugin UI (gradients, second glow)
    --bg       page tint used while that section is on screen
  Everything here works without JavaScript; fx.js only adds the animated
  backdrop, the active-section tint, and the scroll reveal.
*/

:root {
  --ink: #0b0b0f;
  --cream: #f4ead0;
  --metal: #c8d6e5;
  --page-bg: var(--ink);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 4.5rem;
}

body {
  margin: 0;
  background-color: var(--page-bg);
  color: var(--cream);
  font: 18px/1.6 system-ui, sans-serif;
  /* Crossfades when fx.js switches data-active. */
  transition: background-color 1.2s ease;
}

/* Page tint per active section (set by fx.js from the IntersectionObserver). */
body[data-active="tew03"] { --page-bg: #171400; }
body[data-active="k1x"]   { --page-bg: #121a28; }
body[data-active="5hkr"]  { --page-bg: #120a1c; }
body[data-active="v4jb"]  { --page-bg: #191830; }
body[data-active="f4rt"]  { --page-bg: #0a1408; }

a { color: var(--accent, var(--metal)); }

a:focus-visible,
.skip:focus-visible {
  outline: 2px solid var(--cream);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  z-index: 20;
  padding: 0.35rem 0.7rem;
  background: #1a1a1a;
  color: var(--cream);
  text-decoration: none;
}

.skip:focus { top: 0.75rem; }

/* Decorative PixiJS backdrop. Never intercepts input. */
#fx {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem clamp(1.25rem, 4vw, 3rem);
  background: #0b0b0fb3;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #ffffff14;
}

.brand {
  color: var(--cream);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.4rem;
}

nav a {
  position: relative;
  color: var(--metal);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-decoration: none;
  transition: color 0.3s;
}

/* Underline bar in the plugin color; grows when hovered or active. */
nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.3rem;
  height: 2px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  transform: scaleX(0);
  transition: transform 0.3s;
}

nav a:hover,
nav a.active { color: var(--accent); }

nav a:hover::after,
nav a.active::after { transform: scaleX(1); }

main,
footer {
  position: relative;
  z-index: 1;
}

/* ---------- Hero ---------- */

.intro {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(100svh - 4rem);
  max-width: 80rem;
  margin: 0 auto;
  padding: 4rem clamp(1.25rem, 4vw, 3rem);
}

.kicker {
  margin: 0;
  color: var(--metal);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.intro h1 {
  margin: 0.2rem 0 1rem;
  font-size: clamp(3.5rem, 11vw, 9rem);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.04em;
  /* fit-content so the gradient spans the text, not the whole row;
     bottom padding keeps descenders inside the clipped background. */
  width: fit-content;
  padding-bottom: 0.08em;
  /* Text gradient runs through all four plugin colors. */
  background: linear-gradient(90deg, #e8c200, #d94214, #ff00ff, #6fc3b8, #02f53a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  max-width: 40rem;
  margin: 0 0 3rem;
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  text-shadow: 0 1px 12px #000;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 1rem;
  max-width: 52rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tiles a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  padding: 1.25rem 1rem;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 1rem;
  background: color-mix(in srgb, var(--accent) 8%, #0b0b0fcc);
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-decoration: none;
  transition: transform 0.3s, box-shadow 0.3s;
}

.tiles a:hover,
.tiles a:focus-visible {
  transform: translateY(-6px);
  box-shadow: 0 0 32px color-mix(in srgb, var(--accent) 55%, transparent);
}

.tiles img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  border-radius: 0.75rem;
}

/* ---------- Plugin sections ---------- */

.plugin {
  display: grid;
  gap: clamp(2rem, 4vw, 4rem);
  align-items: center;
  min-height: 100svh;
  padding: clamp(4rem, 8vw, 7rem) clamp(1.25rem, 5vw, 5rem);
  /* Plugin-colored light pools; the canvas shows through the gaps. */
  background:
    radial-gradient(60% 70% at 15% 20%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
    radial-gradient(50% 60% at 90% 85%, color-mix(in srgb, var(--accent2) 18%, transparent), transparent 70%);
  border-top: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}

.copy {
  max-width: 38rem;
  padding: clamp(1.25rem, 3vw, 2.25rem);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 1.25rem;
  background: color-mix(in srgb, var(--bg) 70%, #000000aa);
  backdrop-filter: blur(6px);
}

.logo {
  display: block;
  width: clamp(96px, 12vw, 144px);
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  /* drop-shadow follows PNG alpha; box-shadow would still draw a square plate. */
  filter: drop-shadow(0 0 18px color-mix(in srgb, var(--accent) 60%, transparent));
}

.plugin h2 {
  margin: 1rem 0 0.5rem;
  font-size: clamp(3.5rem, 10vw, 7.5rem);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: -0.04em;
  width: fit-content;
  padding-bottom: 0.08em;
  background: linear-gradient(100deg, var(--accent) 30%, var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 18px color-mix(in srgb, var(--accent) 45%, transparent));
}

.plugin p { margin: 0 0 0.85rem; }

.tagline {
  color: var(--accent);
  font-size: clamp(1.1rem, 1.7vw, 1.35rem);
  font-weight: 650;
  line-height: 1.4;
}

.meta {
  color: var(--accent2);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem !important;
}

.actions a {
  padding: 0.75rem 1.25rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--cream);
  font-weight: 650;
  text-decoration: none;
  transition: background 0.25s, box-shadow 0.25s, transform 0.25s;
}

.actions a:hover {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  transform: translateY(-2px);
}

.actions .download {
  background: var(--accent);
  color: #111;
  font-weight: 800;
  box-shadow: 0 0 24px color-mix(in srgb, var(--accent) 55%, transparent);
}

.actions .download:hover {
  background: var(--accent);
  box-shadow: 0 0 40px var(--accent);
}

/* Screenshot in a glowing, slightly tilted frame. */
.frame {
  margin: 0;
  perspective: 1400px;
}

.shot {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.75rem;
  border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent);
  box-shadow:
    -18px 18px 60px color-mix(in srgb, var(--accent) 35%, transparent),
    18px -12px 60px color-mix(in srgb, var(--accent2) 25%, transparent),
    0 30px 60px #000a;
  transform: rotateY(-8deg) rotateX(3deg);
  transition: transform 0.6s ease;
}

.frame:hover .shot { transform: none; }

footer {
  padding: 2rem 1.25rem;
  color: var(--metal);
  text-align: center;
  background: #0b0b0fcc;
  border-top: 1px solid #ffffff14;
}

footer p { margin: 0; }

/* Scroll reveal: only active once fx.js adds .reveal to <html>. */
.reveal .plugin .copy,
.reveal .plugin .frame {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

.reveal .plugin.seen .copy,
.reveal .plugin.seen .frame {
  opacity: 1;
  transform: none;
}

.reveal .plugin.seen .frame { transition-delay: 0.15s; }

@media (min-width: 60rem) {
  .plugin {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  }

  /* Alternate sides: K1X and V4JB put the screenshot on the left. */
  .plugin:nth-of-type(even) {
    grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  }

  .plugin:nth-of-type(even) .copy { order: 2; justify-self: end; }

  .plugin:nth-of-type(even) .shot { transform: rotateY(8deg) rotateX(3deg); }

  .plugin:nth-of-type(even) .frame:hover .shot { transform: none; }
}

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

  *,
  *::before,
  *::after {
    transition: none !important;
  }

  .shot { transform: none; }
}
