/* Captivate 2 — GitHub Pages */

:root {
  --bg-0: #07080c;
  --bg-1: #0e1016;
  --bg-2: #161922;
  --bg-3: #1e2230;
  --text: #f2f2f2;
  --text-dim: #a8aebc;
  --text-mute: #6f7688;
  --line: rgba(255, 255, 255, 0.08);
  --rgb-r: #ff3b4a;
  --rgb-g: #3dff7a;
  --rgb-b: #3d8cff;
  --accent-patch: #4c91ff;
  --accent-movers: #00c5b1;
  --accent-led: #ffb142;
  --accent-scenes: #a16eff;
  --accent-viz: #ff549b;
  --accent-mixer: #78dc82;
  --accent-gold: #ffd36f;
  --font-display: "IBM Plex Sans", "Segoe UI", sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", sans-serif;
  --max: 1120px;
  --radius: 4px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.55;
  background: var(--bg-0);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--text);
  color: var(--bg-0);
  border-radius: var(--radius);
}

.skip-link:focus {
  top: 1rem;
}

.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;
}

/* Atmosphere */
.stage-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 80% 50% at 15% -10%, rgba(255, 59, 74, 0.14), transparent 55%),
    radial-gradient(ellipse 70% 45% at 90% 0%, rgba(61, 140, 255, 0.16), transparent 50%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(61, 255, 122, 0.08), transparent 55%),
    linear-gradient(180deg, #0a0c12 0%, var(--bg-0) 40%, #050608 100%);
}

.stage-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black, transparent 80%);
}

/* Nav */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem clamp(1rem, 3vw, 2rem);
  transition: background 0.35s var(--ease), border-color 0.35s var(--ease), backdrop-filter 0.35s;
  border-bottom: 1px solid transparent;
}

.site-nav.is-scrolled {
  background: rgba(7, 8, 12, 0.78);
  border-bottom-color: var(--line);
  backdrop-filter: blur(14px);
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.nav-brand img {
  width: 36px;
  height: 36px;
  border-radius: 6px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 1.5rem);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--text-dim);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--text);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--rgb-r), var(--rgb-b) 55%, var(--rgb-g));
  color: #06070b !important;
  font-weight: 700;
  font-size: 0.9rem;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  position: relative;
}

.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: var(--text);
}

.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.75rem 1.35rem;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 1rem;
  transition: transform 0.2s var(--ease), opacity 0.2s, background 0.2s, border-color 0.2s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--text);
  color: var(--bg-0);
}

.btn-primary:hover {
  background: #fff;
}

.btn-ghost {
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.btn-ghost:hover {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.06);
}

.btn-rgb {
  background: linear-gradient(120deg, var(--rgb-r), var(--rgb-b) 50%, var(--rgb-g));
  color: #06070b;
  background-size: 160% 160%;
  animation: rgb-shift 8s ease infinite;
}

@keyframes rgb-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Layout */
.wrap {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

.section {
  padding: clamp(4rem, 10vw, 7rem) 0;
}

.section-label {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-mute);
}

.section-title {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.section-lead {
  margin: 0;
  max-width: 38rem;
  color: var(--text-dim);
  font-size: 1.1rem;
}

/* Hero */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: end;
  padding: 6.5rem 0 3.5rem;
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transform: scale(1.04);
  animation: hero-drift 28s var(--ease) infinite alternate;
}

@keyframes hero-drift {
  from { transform: scale(1.04) translate3d(0, 0, 0); }
  to { transform: scale(1.1) translate3d(-1.5%, -1%, 0); }
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(7, 8, 12, 0.55) 0%, rgba(7, 8, 12, 0.2) 35%, rgba(7, 8, 12, 0.88) 78%, var(--bg-0) 100%),
    linear-gradient(90deg, rgba(7, 8, 12, 0.55), transparent 45%);
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  animation: rise 0.9s var(--ease) both;
}

.hero-brand img {
  width: clamp(72px, 12vw, 110px);
  height: auto;
  filter: drop-shadow(0 0 28px rgba(255, 255, 255, 0.18));
  animation: brand-pulse 4.5s ease-in-out infinite;
}

@keyframes brand-pulse {
  0%, 100% { filter: drop-shadow(0 0 22px rgba(255, 255, 255, 0.14)); }
  50% { filter: drop-shadow(0 0 36px rgba(61, 140, 255, 0.28)); }
}

.hero-brand-text {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.4rem, 7.5vw, 4.75rem);
  line-height: 0.98;
  letter-spacing: -0.025em;
}

.hero-brand-text span {
  display: block;
  font-size: 0.34em;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 0.4rem;
}

.hero h1 {
  margin: 0 0 0.85rem;
  max-width: 18ch;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--text-dim);
  animation: rise 0.9s 0.08s var(--ease) both;
}

.hero-support {
  margin: 0 0 1.75rem;
  max-width: 34rem;
  color: var(--text-dim);
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  animation: rise 0.9s 0.14s var(--ease) both;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  animation: rise 0.9s 0.2s var(--ease) both;
}

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

/* Reveal */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}

/* Features */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem 2rem;
  margin-top: 3rem;
}

.feature {
  position: relative;
  padding-top: 1rem;
  border-top: 2px solid var(--feature-accent, var(--accent-scenes));
}

.feature h3 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.feature p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.98rem;
}

.feature[data-accent="patch"] { --feature-accent: var(--accent-patch); }
.feature[data-accent="scenes"] { --feature-accent: var(--accent-scenes); }
.feature[data-accent="viz"] { --feature-accent: var(--accent-viz); }
.feature[data-accent="movers"] { --feature-accent: var(--accent-movers); }
.feature[data-accent="led"] { --feature-accent: var(--accent-led); }
.feature[data-accent="mixer"] { --feature-accent: var(--accent-mixer); }

/* Split story */
.story {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.story-visual {
  position: relative;
  overflow: hidden;
  border-radius: 2px;
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.story-visual img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top;
}

.story-copy .section-title {
  max-width: 12ch;
}

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

.story-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  color: var(--text-dim);
}

.story-list strong {
  display: block;
  color: var(--text);
  font-weight: 700;
  margin-bottom: 0.15rem;
}

.dot {
  width: 10px;
  height: 10px;
  margin-top: 0.45rem;
  border-radius: 50%;
  background: var(--dot, var(--accent-gold));
}

/* Gallery */
.gallery-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.gallery-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.gallery-tab {
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-dim);
  font-size: 0.88rem;
  font-weight: 600;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.gallery-tab.is-active,
.gallery-tab:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.06);
}

.gallery-stage {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-1);
  min-height: 280px;
}

.gallery-stage img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: top;
  opacity: 0;
  transition: opacity 0.45s var(--ease);
  position: absolute;
  inset: 0;
  height: 100%;
}

.gallery-stage img.is-active {
  opacity: 1;
  position: relative;
}

.gallery-caption {
  margin: 0.85rem 0 0;
  color: var(--text-mute);
  font-size: 0.95rem;
}

/* Platforms / download strip */
.platforms {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2.25rem;
}

.platform {
  display: grid;
  gap: 0.35rem;
  padding: 1.25rem 1.2rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius);
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.platform:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-2px);
}

.platform strong {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
}

.platform span {
  color: var(--text-mute);
  font-size: 0.9rem;
}

/* CTA band */
.cta-band {
  position: relative;
  overflow: hidden;
  border-block: 1px solid var(--line);
  background:
    radial-gradient(ellipse 50% 80% at 20% 50%, rgba(255, 59, 74, 0.12), transparent 60%),
    radial-gradient(ellipse 50% 80% at 80% 50%, rgba(61, 140, 255, 0.14), transparent 60%),
    var(--bg-1);
}

.cta-band .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: clamp(2.5rem, 6vw, 4rem) 0;
}

.cta-band h2 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 3.2vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.015em;
}

.cta-band p {
  margin: 0;
  color: var(--text-dim);
  max-width: 36rem;
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Community */
.community-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2rem;
}

.community-link {
  display: grid;
  gap: 0.4rem;
  padding: 1.4rem 1.25rem;
  border-top: 2px solid var(--link-accent, var(--accent-patch));
  background: transparent;
  transition: background 0.2s;
}

.community-link:hover {
  background: rgba(255, 255, 255, 0.03);
}

.community-link strong {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
}

.community-link span {
  color: var(--text-dim);
  font-size: 0.95rem;
}

.community-link[data-accent="wiki"] { --link-accent: var(--accent-patch); }
.community-link[data-accent="discord"] { --link-accent: var(--accent-scenes); }
.community-link[data-accent="discuss"] { --link-accent: var(--accent-viz); }

/* Footer */
.site-footer {
  padding: 2.5rem 0 3rem;
  border-top: 1px solid var(--line);
  color: var(--text-mute);
  font-size: 0.92rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.25rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text-dim);
  font-family: var(--font-display);
  font-weight: 700;
}

.footer-brand img {
  width: 28px;
  height: 28px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.25rem;
}

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

/* Download page */
.page-hero {
  padding: 8rem 0 3rem;
}

.page-hero h1 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.page-hero p {
  margin: 0;
  max-width: 40rem;
  color: var(--text-dim);
  font-size: 1.1rem;
}

.release-meta {
  margin-top: 1.25rem;
  color: var(--text-mute);
  font-size: 0.95rem;
}

.release-meta a {
  color: var(--accent-gold);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 2rem;
}

.download-card {
  display: grid;
  gap: 0.65rem;
  align-content: start;
  padding: 1.4rem 1.3rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  border-radius: var(--radius);
  text-align: left;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.download-card:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
}

.download-card:disabled {
  opacity: 0.55;
  cursor: wait;
}

.download-card .os {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
}

.download-card .file {
  color: var(--text-mute);
  font-size: 0.88rem;
  word-break: break-all;
}

.download-card .hint {
  color: var(--text-dim);
  font-size: 0.92rem;
}

.macos-panel {
  margin-top: 3rem;
  padding: 1.75rem;
  border: 1px solid var(--line);
  background: var(--bg-1);
}

.macos-panel h2 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
}

.macos-panel ol {
  margin: 1rem 0 0;
  padding-left: 1.2rem;
  color: var(--text-dim);
}

.macos-panel li + li {
  margin-top: 0.45rem;
}

.macos-table {
  width: 100%;
  margin-top: 1rem;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.macos-table th,
.macos-table td {
  padding: 0.7rem 0.6rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.macos-table th {
  color: var(--text-mute);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.macos-table code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
  color: var(--accent-gold);
}

.status-error {
  margin-top: 1rem;
  color: #ff8a95;
}

/* Responsive */
@media (max-width: 900px) {
  .feature-grid,
  .community-grid,
  .platforms {
    grid-template-columns: 1fr 1fr;
  }

  .story {
    grid-template-columns: 1fr;
  }

  .story-visual {
    order: -1;
  }
}

@media (max-width: 720px) {
  .nav-toggle {
    display: grid;
  }

  .nav-links {
    position: fixed;
    inset: 64px 0 auto 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 1rem 1rem;
    background: rgba(7, 8, 12, 0.96);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links li {
    border-top: 1px solid var(--line);
  }

  .nav-links a {
    display: block;
    padding: 0.9rem 0.2rem;
  }

  .nav-cta {
    justify-content: center;
  }

  .feature-grid,
  .community-grid,
  .platforms,
  .download-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    align-items: end;
    min-height: 92svh;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
