/* Font Face Declarations */
@font-face {
  font-family: 'Space Mono';
  src: url('../fonts/space-mono-v17-latin-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Space Mono';
  src: url('../fonts/space-mono-v17-latin-italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
}

@font-face {
  font-family: 'Space Mono';
  src: url('../fonts/space-mono-v17-latin-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: 'Space Mono';
  src: url('../fonts/space-mono-v17-latin-700italic.woff2') format('woff2');
  font-weight: 700;
  font-style: italic;
}

@font-face {
  font-family: 'Syne';
  src: url('../fonts/syne-v24-latin-regular.woff2') format('woff2');
  font-weight: 400;
}

@font-face {
  font-family: 'Syne';
  src: url('../fonts/syne-v24-latin-500.woff2') format('woff2');
  font-weight: 500;
}

@font-face {
  font-family: 'Syne';
  src: url('../fonts/syne-v24-latin-600.woff2') format('woff2');
  font-weight: 600;
}

@font-face {
  font-family: 'Syne';
  src: url('../fonts/syne-v24-latin-700.woff2') format('woff2');
  font-weight: 700;
}

@font-face {
  font-family: 'Syne';
  src: url('../fonts/syne-v24-latin-800.woff2') format('woff2');
  font-weight: 800;
}

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

    :root {
      --green: #268245;
      --green-bright: #34b060;
      --green-dim: #1a5c30;
      --blurple: #5865F2;
      --blurple-bright: #7983f5;
      --bg: #0a0c0f;
      --bg2: #0f1215;
      --bg3: #141820;
      --surface: #181c24;
      --surface2: #1e2430;
      --border: rgba(255,255,255,0.07);
      --text: #e8edf5;
      --text-dim: #7a8599;
      --text-dimmer: #3d4657;
      --mono: 'Space Mono', monospace;
      --sans: 'Syne', sans-serif;
    }

    html { scroll-behavior: smooth; }

    body {
      background: var(--bg);
      color: var(--text);
      font-family: var(--sans);
      overflow-x: hidden;
      line-height: 1.6;
    }

    body::before {
      content: '';
      position: fixed;
      inset: 0;
      background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
      opacity: 0.022;
      pointer-events: none;
      z-index: 9999;
    }

    /* NAV */
    nav {
      position: fixed;
      top: 0; left: 0; right: 0;
      z-index: 100;
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0.75rem 2.5rem;
      background: rgba(10,12,15,0.85);
      backdrop-filter: blur(16px);
      border-bottom: 1px solid var(--border);
    }
    .nav-logo-img { height: 48px; width: auto; display: block; transition: height 0.3s; }
    .nav-links { display: flex; gap: 2rem; list-style: none; align-items: center; margin: 7px 0 0 0; padding: 0; }
    .nav-links li { display: flex; align-items: center; }
    .nav-links a {
      font-family: var(--mono);
      font-size: 0.75rem;
      color: var(--text-dim);
      text-decoration: none;
      letter-spacing: 0.05em;
      transition: color 0.2s;
      display: inline-flex;
      align-items: center;
    }
    .nav-links a:hover,
    .nav-links a.active { color: var(--text); }
    .nav-cta {
      color: var(--blurple-bright) !important;
      border: 1px solid rgba(88,101,242,0.4);
      padding: 0.4rem 1rem;
      border-radius: 4px;
    }
    .nav-cta:hover { background: rgba(88,101,242,0.15) !important; color: #fff !important; }
    .nav-release-badge {
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      font-family: var(--mono);
      font-size: 0.65rem;
      letter-spacing: 0.05em;
      padding: 0.35rem 0.85rem;
      border-radius: 999px;
      background: rgba(38,130,69,0.1);
      border: 1px solid rgba(38,130,69,0.35);
      color: var(--green-bright);
      text-decoration: none;
      transition: background 0.2s, border-color 0.2s;
    }
    #release-badge-text { display: inline-block; min-width: 21ch; }
    .nav-release-badge:hover { background: rgba(38,130,69,0.18); border-color: rgba(38,130,69,0.6); }
    
    /* HAMBURGER MENU */
    .hamburger-btn {
      display: none;
      position: relative;
      width: 28px;
      height: 24px;
      flex-direction: column;
      background: none;
      border: none;
      cursor: pointer;
      padding: 0;
    }
    .hamburger-btn span {
      width: 24px;
      height: 2px;
      position: absolute;
      left: 2px;
      top: 50%;
      background: var(--text-dim);
      transform-origin: center;
      transition: transform 0.25s ease, opacity 0.2s ease, background 0.2s ease;
      display: block;
    }
    .hamburger-btn span:nth-child(1) { transform: translateY(-7px); }
    .hamburger-btn span:nth-child(2) { transform: translateY(0); }
    .hamburger-btn span:nth-child(3) { transform: translateY(7px); }
    .hamburger-btn.active span:nth-child(1) {
      transform: rotate(45deg);
    }
    .hamburger-btn.active span:nth-child(2) {
      opacity: 0;
    }
    .hamburger-btn.active span:nth-child(3) {
      transform: rotate(-45deg);
    }
    
    .mobile-nav-overlay {
      display: none;
      position: fixed;
      top: 60px;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(10,12,15,0.95);
      backdrop-filter: blur(16px);
      z-index: 99;
      flex-direction: column;
      padding: 2rem 2rem;
      gap: 1rem;
      max-height: calc(100vh - 60px);
      overflow-y: auto;
    }
    .mobile-nav-overlay.active {
      display: flex;
    }
    .mobile-nav-overlay a {
      font-family: var(--mono);
      font-size: 0.85rem;
      color: var(--text-dim);
      text-decoration: none;
      letter-spacing: 0.05em;
      transition: color 0.2s, background 0.2s, border-color 0.2s;
      padding: 0.75rem;
      display: block;
      width: 100%;
      border: 1px solid transparent;
      border-radius: 6px;
    }
    .mobile-nav-overlay a:hover,
    .mobile-nav-overlay a.active {
      color: var(--text);
      background: rgba(255,255,255,0.03);
    }
    .mobile-nav-overlay .nav-cta {
      color: var(--blurple-bright) !important;
      border: 1px solid rgba(88,101,242,0.4);
      padding: 0.6rem 1rem;
      border-radius: 6px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 100%;
      background: rgba(88,101,242,0.08);
    }
    .mobile-nav-overlay .nav-cta:hover {
      color: #fff !important;
      background: rgba(88,101,242,0.16) !important;
    }
    .mobile-nav-overlay .nav-release-badge {
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      justify-content: center;
      text-align: center;
      width: 100%;
      padding: 0.65rem 1rem;
      background: rgba(38,130,69,0.12);
      border-color: rgba(38,130,69,0.35);
    }
    .mobile-nav-overlay .nav-release-badge:hover {
      background: rgba(38,130,69,0.18);
    }
    .mobile-nav-overlay .nav-release-badge .loading-text {
      color: var(--green-bright);
    }

    /* HERO */
    .release-dot {
      width: 7px; height: 7px;
      border-radius: 50%;
      background: var(--green-bright);
      box-shadow: 0 0 6px var(--green-bright);
      animation: rpulse 2s ease-in-out infinite;
      flex-shrink: 0;
    }
    @keyframes rpulse {
      0%,100% { opacity:1; transform:scale(1); }
      50%      { opacity:0.6; transform:scale(0.85); }
    }
    .loading-text { color: var(--text-dimmer); }

    /* LAYOUT */
    .doc-container {
      display: grid;
      grid-template-columns: 250px 1fr;
      gap: 2rem;
      padding: 8rem 2rem 2rem;
      max-width: 1400px;
      margin: 0 auto;
    }

    /* SIDEBAR */
    .sidebar {
      position: sticky;
      top: 80px;
      height: fit-content;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 1.5rem 1rem;
      max-height: calc(100vh - 100px);
      overflow-y: auto;
    }
    .sidebar-title {
      font-family: var(--mono);
      font-size: 0.65rem;
      letter-spacing: 0.2em;
      text-transform: uppercase;
      color: var(--text-dimmer);
      margin-bottom: 1rem;
    }
    .sidebar-list {
      list-style: none;
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
    }
    .sidebar-list a {
      display: block;
      font-family: var(--mono);
      font-size: 0.75rem;
      color: var(--text-dim);
      text-decoration: none;
      padding: 0.5rem 0.75rem;
      border-radius: 4px;
      transition: background 0.2s, color 0.2s;
    }
    .sidebar-list a:hover, .sidebar-list a.active {
      background: rgba(52, 176, 96, 0.15);
      color: var(--green-bright);
    }
    
    /* SIDEBAR MOBILE TOGGLE */
    .sidebar-toggle-btn {
      display: none;
      background: none;
      border: 1px solid var(--border);
      color: var(--text-dim);
      padding: 0.5rem 1rem;
      border-radius: 4px;
      cursor: pointer;
      font-family: var(--mono);
      font-size: 0.75rem;
      margin-bottom: 1.5rem;
      transition: background 0.2s;
    }
    .sidebar-toggle-btn:hover {
      background: rgba(52, 176, 96, 0.1);
      color: var(--text);
    }
    .sidebar-toggle-btn.collapsed::after {
      content: ' ▼';
    }
    .sidebar-toggle-btn:not(.collapsed)::after {
      content: ' ▲';
    }

    /* CONTENT */
    .content {
      min-height: 100vh;
    }

    .doc-section {
      margin-bottom: 4rem;
      scroll-margin-top: 80px;
    }

    .section-title {
      font-size: 2rem;
      font-weight: 800;
      letter-spacing: -0.03em;
      margin-bottom: 1rem;
      padding-bottom: 1rem;
      border-bottom: 2px solid var(--green-bright);
      color: var(--text);
    }

    .section-subtitle {
      font-size: 1.3rem;
      font-weight: 700;
      margin-top: 2.5rem;
      margin-bottom: 0.8rem;
      color: var(--green-bright);
    }

    .section-desc {
      color: var(--text-dim);
      margin-bottom: 1.5rem;
      line-height: 1.7;
    }

    /* CODE BLOCKS */
    .code-block {
      background: var(--bg3);
      border: 1px solid var(--border);
      border-radius: 6px;
      padding: 1rem;
      font-family: var(--mono);
      font-size: 0.75rem;
      color: #7ab8a0;
      line-height: 1.7;
      overflow-x: auto;
      margin: 1rem 0;
      word-break: break-word;
      white-space: pre-wrap;
    }

    .code-inline {
      font-family: var(--mono);
      font-size: 0.8rem;
      background: var(--bg3);
      border: 1px solid var(--border);
      color: var(--green-bright);
      padding: 0.2rem 0.5rem;
      border-radius: 4px;
      word-break: break-word;
    }

    /* LISTS */
    ul, ol {
      margin-left: 1.5rem;
      margin-bottom: 1rem;
    }

    li {
      color: var(--text-dim);
      margin-bottom: 0.5rem;
      line-height: 1.6;
    }

    li strong {
      color: var(--text);
    }

    /* TABLE */
    .doc-table {
      width: 100%;
      border-collapse: collapse;
      border: 1px solid var(--border);
      border-radius: 8px;
      overflow: hidden;
      margin: 1.5rem 0;
      font-size: 0.85rem;
    }

    .doc-table thead {
      background: var(--bg3);
    }

    .doc-table th {
      font-family: var(--mono);
      font-size: 0.7rem;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      color: var(--green-bright);
      padding: 0.9rem 1rem;
      text-align: left;
      border-bottom: 1px solid var(--border);
    }

    .doc-table td {
      padding: 0.9rem 1rem;
      color: var(--text-dim);
      border-bottom: 1px solid var(--border);
      word-break: break-word;
    }

    .doc-table tr:hover td {
      background: rgba(52, 176, 96, 0.05);
    }

    .doc-table tr:last-child td {
      border-bottom: none;
    }

    /* CALLOUT */
    .callout {
      border-left: 4px solid;
      border-radius: 4px;
      padding: 1rem 1.25rem;
      margin: 1.5rem 0;
      background: rgba(52, 176, 96, 0.05);
    }

    .callout.info {
      border-color: var(--blurple-bright);
      background: rgba(88, 101, 242, 0.05);
    }

    .callout.warning {
      border-color: #f5c842;
      background: rgba(245, 200, 66, 0.05);
    }

    .callout.danger {
      border-color: #f57b5e;
      background: rgba(245, 123, 94, 0.05);
    }

    .callout-title {
      font-weight: 700;
      margin-bottom: 0.5rem;
    }

    .callout p {
      margin: 0;
      color: var(--text-dim);
    }

    /* FOOTER */
    footer {
      border-top: 1px solid var(--border);
      padding: 3rem 2rem;
      text-align: center;
      margin-top: 4rem;
    }

    .footer-logo-img {
      height: 30px;
      width: auto;
      margin: 0 auto 0.75rem;
      display: block;
      opacity: 0.75;
    }

    footer p {
      font-family: var(--mono);
      font-size: 0.72rem;
      color: var(--text-dimmer);
      margin-bottom: 1.5rem;
    }

    .footer-links {
      display: flex;
      gap: 1.5rem;
      justify-content: center;
      flex-wrap: wrap;
    }

    .footer-links a {
      font-family: var(--mono);
      font-size: 0.72rem;
      color: var(--text-dimmer);
      text-decoration: none;
      transition: color 0.2s;
    }

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

    .btn-back {
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      font-family: var(--mono);
      font-size: 0.8rem;
      color: var(--blurple-bright);
      text-decoration: none;
      border: 1px solid rgba(88,101,242,0.35);
      padding: 0.5rem 1rem;
      border-radius: 6px;
      transition: background 0.2s;
      margin-bottom: 2rem;
    }

    .btn-back:hover {
      background: rgba(88,101,242,0.12);
    }

    /* PAGE LOAD ANIMATIONS */
    @keyframes fadeInSlideUp {
      from {
        opacity: 0;
        transform: translateY(20px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    @keyframes fadeIn {
      from {
        opacity: 0;
      }
      to {
        opacity: 1;
      }
    }

    .sidebar {
      animation: fadeInSlideUp 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    }

    .content {
      animation: fadeInSlideUp 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
    }

    .doc-section {
      animation: fadeInSlideUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
      opacity: 0;
    }

    .doc-section:nth-child(1) { animation-delay: 0.15s; }
    .doc-section:nth-child(2) { animation-delay: 0.25s; }
    .doc-section:nth-child(3) { animation-delay: 0.35s; }
    .doc-section:nth-child(4) { animation-delay: 0.45s; }
    .doc-section:nth-child(5) { animation-delay: 0.55s; }
    .doc-section:nth-child(6) { animation-delay: 0.65s; }
    .doc-section:nth-child(7) { animation-delay: 0.75s; }
    .doc-section:nth-child(8) { animation-delay: 0.85s; }
    .doc-section:nth-child(9) { animation-delay: 0.95s; }
    .doc-section:nth-child(10) { animation-delay: 1.05s; }
    .doc-section:nth-child(11) { animation-delay: 1.15s; }

    .btn-back {
      animation: fadeInSlideUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    }

    @media (max-width: 900px) {
      .doc-container {
        grid-template-columns: 1fr;
      }
      .sidebar {
        position: static;
        top: auto;
      }
    }

    @media (max-width: 768px) {
      nav { padding: 0.6rem 1rem; }
      .nav-logo-img { height: 48px; }
      .hamburger-btn { display: flex; }
      .nav-links { display: none; }
      
      .doc-container { padding-top: 7rem; padding-left: 1rem; padding-right: 1rem; gap: 1.5rem; }
      .section-title { font-size: 1.75rem; }
      
      .sidebar {
        position: static;
        top: auto;
        max-height: none;
        margin-bottom: 2rem;
      }
      .sidebar-title { display: none; }
      .sidebar-toggle-btn { display: block; }
      .sidebar-list {
        max-height: 500px;
        overflow-y: auto;
        transition: max-height 0.3s ease;
      }
      .sidebar.collapsed .sidebar-list {
        max-height: 0;
        overflow: hidden;
      }
      .doc-table { font-size: 0.75rem; }
      .doc-table th, .doc-table td { padding: 0.6rem 0.75rem; }
      .code-block { font-size: 0.7rem; padding: 0.75rem; }
    }

    @media (max-width: 640px) {
      nav { padding: 0.5rem 0.75rem; }
      .nav-logo-img { height: 40px; }
      .nav-wrapper { display: flex; align-items: center; gap: 0.5rem; width: 100%; justify-content: space-between; }
      
      .doc-container { padding-top: 5.5rem; padding-left: 0.75rem; padding-right: 0.75rem; gap: 1rem; }
      .section-title { font-size: 1.5rem; padding-bottom: 0.75rem; }
      .section-subtitle { font-size: 1.1rem; }
      .sidebar-toggle-btn { margin-bottom: 1rem; }
      
      .doc-table { font-size: 0.7rem; }
      .doc-table th, .doc-table td { padding: 0.5rem 0.5rem; }
      .code-block { font-size: 0.65rem; padding: 0.5rem; }
      .code-inline { font-size: 0.7rem; }
      
      ul, ol { margin-left: 1rem; }
      .content { min-height: auto; }
      .btn-back { font-size: 0.75rem; margin-bottom: 1.5rem; }
    }

    .sidebar::-webkit-scrollbar {
      width: 6px;
    }
    .sidebar::-webkit-scrollbar-track {
      background: transparent;
    }
    .sidebar::-webkit-scrollbar-thumb {
      background: var(--border);
      border-radius: 3px;
    }
    .sidebar::-webkit-scrollbar-thumb:hover {
      background: var(--text-dimmer);
    }
