/* ========================
   Variables
   ======================== */
:root {
  --bg:          #08090C;
  --bg-card:     #0D0F14;
  --bg-raised:   #14161C;
  --bg-code:     #0C0D11;
  --border:      #1E2130;
  --border-mid:  #2A2E40;
  --gold:        #5BB8FF;
  --gold-dim:    #2E7DB8;
  --gold-light:  #8DD0FF;
  --gold-glow:   rgba(91, 184, 255, 0.12);
  --blue:        #5BB8FF;
  --blue-dim:    #2E7DB8;
  --blue-light:  #8DD0FF;
  --text:        #E8EBF4;
  --text-dim:    #8A8FA8;
  --text-muted:  #454A60;
  --font-pixel:  'Press Start 2P', monospace;
  --font-body:   'Outfit', sans-serif;
  --font-mono:   'JetBrains Mono', monospace;
  --radius:      6px;
  --radius-md:   12px;
  --radius-lg:   16px;
  --radius-xl:   20px;
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --transition-base: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  --glow-gold:   0 0 20px rgba(91, 184, 255, 0.15);
  --glow-blue:   0 0 20px rgba(91, 184, 255, 0.12);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(91, 184, 255, 0.04), transparent),
    radial-gradient(ellipse 60% 40% at 80% 0%, rgba(91, 184, 255, 0.03), transparent);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100vh;
}

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

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

/* ========================
   Header / Nav
   ======================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: none;
  box-shadow: 0 1px 0 0 rgba(91, 184, 255, 0.06), 0 4px 30px rgba(0, 0, 0, 0.3);
  background: rgba(8, 9, 12, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.header-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.logo-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  object-fit: cover;
}

.logo-pixel {
  font-family: var(--font-pixel);
  font-size: 0.65rem;
  color: var(--gold);
  letter-spacing: 0.05em;
  line-height: 1;
}

.logo-text {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-link {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-dim);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-md);
  transition: color var(--transition-base), background var(--transition-base), box-shadow var(--transition-base);
}

.nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.nav-link.active {
  color: var(--gold);
  box-shadow: 0 2px 0 0 var(--gold);
}

.nav-link[target="_blank"]::after {
  content: "";
  display: inline-block;
  width: 0.6em;
  height: 0.6em;
  margin-left: 0.3em;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: translateY(-0.05em) rotate(45deg);
  opacity: 0.6;
}

/* ========================
   Hero
   ======================== */
.hero {
  position: relative;
  max-width: 1140px;
  margin: 0 auto;
  padding: 6rem 1.5rem 5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  min-height: 400px;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 80% at 30% 40%, rgba(91, 184, 255, 0.05), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 560px;
}

.hero-badge {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  letter-spacing: 0.06em;
  color: var(--gold);
  background: var(--gold-glow);
  border: 1px solid rgba(91, 184, 255, 0.25);
  padding: 0.5rem 1rem;
  border-radius: 100px;
  margin-bottom: 1.75rem;
  line-height: 1.6;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 0 15px rgba(91, 184, 255, 0.08);
}

.hero-title {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: clamp(2.8rem, 6vw, 5rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin-bottom: 1.75rem;
  background: linear-gradient(135deg, var(--text) 40%, var(--gold-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--text-dim);
  line-height: 1.75;
  max-width: 460px;
}

/* Floating pixel blocks */
.hero-blocks {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 380px;
  pointer-events: none;
  z-index: 1;
}

.block {
  position: absolute;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.bl-1 { width: 88px; height: 88px; top: 60px; right: 140px; background: var(--bg-raised); animation: bob 7s ease-in-out infinite; }
.bl-2 { width: 52px; height: 52px; top: 40px; right: 70px; background: var(--gold-glow); border-color: rgba(91,184,255,0.3); animation: bob 5s ease-in-out infinite 0.8s; box-shadow: 0 0 25px rgba(91, 184, 255, 0.1); }
.bl-3 { width: 132px; height: 132px; top: 130px; right: 100px; background: var(--bg-card); animation: bob 8s ease-in-out infinite 0.3s; }
.bl-4 { width: 40px; height: 40px; top: 220px; right: 56px; background: rgba(91,184,255,0.08); border-color: rgba(91,184,255,0.25); animation: bob 6s ease-in-out infinite 1.5s; box-shadow: 0 0 25px rgba(91, 184, 255, 0.08); }
.bl-5 { width: 64px; height: 64px; top: 80px; right: 30px; background: var(--bg-raised); animation: bob 9s ease-in-out infinite 0.5s; }

@keyframes bob {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-14px) rotate(1deg); }
}

/* ========================
   Addons Section
   ======================== */
.addons-section {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.5rem 5rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.section-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.section-count {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.addon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.addon-card {
  background: rgba(13, 15, 20, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(30, 33, 48, 0.6);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.3s var(--ease-out), background 0.3s var(--ease-out), transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.03), 0 2px 8px rgba(0, 0, 0, 0.2);
}

.addon-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--blue));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  opacity: 0.3;
  transition: opacity 0.3s var(--ease-out);
}

.addon-card:hover {
  border-color: rgba(91, 184, 255, 0.15);
  background: var(--bg-raised);
  transform: translateY(-4px) scale(1.01);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.05), 0 8px 30px rgba(0, 0, 0, 0.3), 0 0 20px rgba(91, 184, 255, 0.06);
}

.addon-card:hover::before {
  opacity: 1;
}

.addon-card:hover .card-arrow {
  color: var(--gold);
  opacity: 1;
  transform: translateX(3px);
}

.addon-card:hover .tag {
  border-color: var(--border-mid);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-icon-wrap {
  font-size: 1.5rem;
  line-height: 1;
}

.card-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: var(--radius);
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-version {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 100px;
}

.card-name {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.card-desc {
  font-size: 0.83rem;
  color: var(--text-dim);
  line-height: 1.7;
  flex: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.25rem;
}

.card-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.tag {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 100px;
  transition: border-color 0.3s var(--ease-out);
}

.card-arrow {
  font-size: 1rem;
  color: var(--text-muted);
  opacity: 0.5;
  transition: color 0.3s var(--ease-out), transform 0.3s var(--ease-out), opacity 0.3s var(--ease-out);
  flex-shrink: 0;
}

/* ========================
   Footer
   ======================== */
.site-footer {
  border-top: 1px solid transparent;
  background-image: linear-gradient(var(--bg), var(--bg)), linear-gradient(90deg, transparent, var(--gold-dim), var(--blue-dim), transparent);
  background-origin: padding-box, border-box;
  background-clip: padding-box, border-box;
}

.footer-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-logo {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  color: var(--gold);
  letter-spacing: 0.05em;
}

.footer-copy {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ========================
   Addon Page Layout
   ======================== */
.page-layout {
  max-width: 1140px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 3.5rem;
  align-items: start;
}

/* ========================
   Sidebar
   ======================== */
.sidebar {
  position: sticky;
  top: 78px;
}

.sidebar-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-md);
  transition: color 0.15s, background 0.15s;
}

.sidebar-back:hover {
  color: var(--text);
  background: var(--bg-raised);
}

.sidebar-section {
  margin-bottom: 1.5rem;
}

.sidebar-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 0 0.5rem;
  margin-bottom: 0.6rem;
  display: block;
}

.sidebar-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sidebar-nav a {
  display: block;
  font-size: 0.82rem;
  color: var(--text-dim);
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-md);
  border-left: 2px solid transparent;
  transition: color var(--transition-base), background var(--transition-base), border-color var(--transition-base);
}

.sidebar-nav a:hover {
  color: var(--text);
  background: var(--bg-raised);
}

.sidebar-nav a.active {
  color: var(--gold);
  background: var(--gold-glow);
  border-left-color: var(--gold);
  padding-left: calc(0.6rem - 2px);
}

/* ========================
   Doc Content
   ======================== */
.doc-header {
  padding-bottom: 2.5rem;
  margin-bottom: 3rem;
  border-bottom: none;
  background-image: linear-gradient(to right, var(--gold), var(--blue), transparent);
  background-size: 100% 1px;
  background-repeat: no-repeat;
  background-position: bottom;
}

.doc-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--gold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.doc-title {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.doc-desc {
  font-size: 0.95rem;
  color: var(--text-dim);
  line-height: 1.8;
  max-width: 540px;
  margin-bottom: 1.5rem;
}

.doc-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.meta-pill {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  padding: 0.35rem 0.75rem;
  border-radius: 100px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.meta-label {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.meta-value {
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

/* ========================
   Content Typography
   ======================== */
.doc-content h2 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 3rem 0 0.875rem;
  scroll-margin-top: 80px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.doc-content h2::before {
  content: '#';
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 400;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.doc-content h2:hover::before {
  opacity: 1;
}

.doc-content h3 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-dim);
  margin: 1.75rem 0 0.6rem;
  scroll-margin-top: 80px;
}

.doc-content p {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.85;
  margin-bottom: 1rem;
}

.doc-content ul,
.doc-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.doc-content li {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.8;
  margin-bottom: 0.35rem;
}

.doc-content ul li::marker {
  color: var(--gold);
}

.doc-content a {
  color: var(--gold);
  text-decoration: underline;
  text-decoration-color: rgba(91, 184, 255, 0.35);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s;
}

.doc-content a:hover {
  text-decoration-color: var(--gold);
}

/* Inline code */
.doc-content p code,
.doc-content li code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--blue);
  background: var(--bg-code);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: var(--radius);
}

/* Code blocks */
.doc-content pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold-dim);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin: 1.25rem 0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.doc-content pre code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-dim);
  background: none;
  border: none;
  padding: 0;
}

/* ========================
   Callout Boxes
   ======================== */
.callout {
  display: flex;
  gap: 0.75rem;
  background: rgba(91, 184, 255, 0.07);
  border: none;
  border-left: 3px solid rgba(91, 184, 255, 0.4);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.callout.warn {
  background: rgba(91, 184, 255, 0.06);
  border-left-color: rgba(91, 184, 255, 0.4);
}

.callout.danger {
  background: rgba(255, 100, 100, 0.06);
  border-left-color: rgba(255, 100, 100, 0.4);
}

.callout-icon {
  font-size: 0.9rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.callout-body {
  flex: 1;
}

.callout-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-bottom: 0.3rem;
  display: block;
}

.callout.warn .callout-label { color: var(--blue); }
.callout.danger .callout-label { color: #FF6464; }

.callout p {
  margin: 0;
  font-size: 0.85rem;
}

/* ========================
   Step List
   ======================== */
.steps {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  font-size: 0.88rem;
  color: var(--text-dim);
}

.steps li::before {
  content: counter(step);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  background: var(--gold-glow);
  border: 1px solid rgba(91, 184, 255, 0.3);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--gold);
  flex-shrink: 0;
  margin-top: 2px;
}

/* ========================
   Page-Load Animations
   ======================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-badge  { animation: fadeInUp 0.6s var(--ease-out) 0.1s both; }
.hero-title  { animation: fadeInUp 0.6s var(--ease-out) 0.2s both; }
.hero-sub    { animation: fadeInUp 0.6s var(--ease-out) 0.3s both; }

.addon-card { animation: fadeInUp 0.5s var(--ease-out) both; }
.addon-card:nth-child(1) { animation-delay: 0s; }
.addon-card:nth-child(2) { animation-delay: 0.06s; }
.addon-card:nth-child(3) { animation-delay: 0.12s; }
.addon-card:nth-child(4) { animation-delay: 0.18s; }
.addon-card:nth-child(5) { animation-delay: 0.24s; }

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

/* ========================
   Responsive
   ======================== */
@media (max-width: 1024px) {
  .page-layout {
    grid-template-columns: 180px 1fr;
  }
}

@media (max-width: 800px) {
  .page-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding-top: 2rem;
  }

  .sidebar {
    position: static;
    display: flex;
    flex-direction: column;
  }

  .sidebar-nav {
    flex-direction: row;
    overflow-x: auto;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
  }

  .sidebar-nav a {
    white-space: nowrap;
    border-left: none;
    border-radius: 100px;
    padding: 0.35rem 0.75rem;
  }

  .sidebar-nav a.active {
    border-left: none;
    padding-left: 0.75rem;
  }

  .hero-blocks { display: none; }

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

  .hero {
    padding: 3rem 1.5rem 2.5rem;
  }
}
