/* 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;
      --yellow: #f5c842;
      --yellow-dim: #a17c2a;
      --red: #f57b5e;
      --red-dim: #a14c3b;
      --bg: #0a0c0f;
      --bg2: #0c0f11;
      --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;
      overflow-x: hidden;
      max-width: 100%;
    }

    body {
      background: var(--bg);
      color: var(--text);
      font-family: var(--sans);
      overflow-x: hidden;
      max-width: 100%;
      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;
      width: 100%;
      max-width: 100vw;
      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; }
    .nav-links { display: flex; gap: 2rem; list-style: none; align-items: center; margin: 0; padding: 0; }
    .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;
    }
    .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; color: var(--green-bright);}
    .nav-release-badge:hover { background: rgba(38,130,69,0.18); border-color: rgba(38,130,69,0.6); }
    .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); }
    
    /* 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-backdrop {
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0.55);
      backdrop-filter: blur(6px);
      -webkit-backdrop-filter: blur(6px);
      z-index: 98;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.35s ease;
    }
    .mobile-nav-backdrop.active {
      opacity: 1;
      pointer-events: auto;
    }

    .mobile-nav-overlay {
      position: absolute;
      top: 100%;
      left: 0;
      right: 0;
      width: 100%;
      max-width: 100vw;
      background: var(--bg);
      z-index: 99;
      flex-direction: column;
      padding: 0 1rem;
      gap: 0.35rem;
      max-height: 0;
      overflow: hidden;
      opacity: 0;
      transform: translateY(-10px);
      transition: max-height 0.35s ease-in-out, opacity 0.35s ease-in-out, transform 0.35s ease-in-out, padding 0.35s ease-in-out;
      border-bottom: 1px solid var(--border);
    }
    .mobile-nav-overlay.active {
      max-height: 400px;
      opacity: 1;
      transform: translateY(0);
      padding: 1rem;
      overflow-y: auto;
    }
    .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, opacity 0.3s ease, transform 0.3s ease;
      padding: 0.75rem;
      display: block;
      width: 100%;
      border: 1px solid transparent;
      border-radius: 6px;
      opacity: 0;
      transform: translateY(-8px);
    }
    .mobile-nav-overlay.active a {
      opacity: 1;
      transform: translateY(0);
    }
    .mobile-nav-overlay.active a:nth-child(1) { transition-delay: 0.05s; }
    .mobile-nav-overlay.active a:nth-child(2) { transition-delay: 0.08s; }
    .mobile-nav-overlay.active a:nth-child(3) { transition-delay: 0.11s; }
    .mobile-nav-overlay.active a:nth-child(4) { transition-delay: 0.14s; }
    .mobile-nav-overlay.active a:nth-child(5) { transition-delay: 0.17s; }
    .mobile-nav-overlay.active a:nth-child(6) { transition-delay: 0.20s; }
    .mobile-nav-overlay.active a:nth-child(7) { transition-delay: 0.23s; }
    .mobile-nav-overlay a:hover { 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%;
      margin-top: 0.75rem;
      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;
      margin-top: 0.75rem;
      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); }
    .mobile-nav-overlay .nav-footer-text {
      display: block;
      font-size: 0.65rem;
      color: var(--text-dimmer);
      text-align: center;
      padding: 0.75rem 0.5rem 0.3rem;
      letter-spacing: 0.04em;
      pointer-events: none;
      user-select: none;
    }

    /* RELEASES SECTION */
    .releases-section {
      padding: 8rem 2rem 6rem;
      max-width: 860px;
      margin: 0 auto;
    }

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

    .section-header { text-align: center; margin-bottom: 3.5rem; }
    .section-header h2 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
    .section-header p  { color: var(--text-dim); margin-top: 0.75rem; font-size: 0.95rem; }
    .section-label {
      font-family: var(--mono);
      font-size: 0.65rem;
      letter-spacing: 0.2em;
      text-transform: uppercase;
      color: var(--text-dimmer);
      margin-bottom: 1rem;
    }

    .releases-loading {
      font-family: var(--mono);
      font-size: 0.75rem;
      color: var(--text-dimmer);
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0.5rem;
      padding: 4rem 0;
    }
    .spinner {
      width: 14px; height: 14px;
      border: 2px solid var(--border);
      border-top-color: var(--green-bright);
      border-radius: 50%;
      animation: spin 0.8s linear infinite;
      flex-shrink: 0;
    }
    @keyframes spin { to { transform: rotate(360deg); } }

    .releases-list {
      display: flex;
      flex-direction: column;
      gap: 1.5rem;
    }

    .release-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 10px;
      overflow: hidden;
    }
    .release-card-header {
      padding: 1.25rem;
      border-bottom: 1px solid var(--border);
      display: flex;
      justify-content: space-between;
      align-items: center;
      cursor: pointer;
      gap: 1rem;
    }
    .release-card-header-left { 
      display: flex;
      flex-direction: column;
      gap: 0.25rem;
    }
    .release-card-header-right {
      display: flex;
      align-items: center;
      gap: 0.75rem;
    }
    .release-version-tag { font-family: var(--mono); font-size: 0.85rem; font-weight: 700; color: var(--green-bright); }
    .release-date { font-family: var(--mono); font-size: 0.7rem; color: var(--text-dimmer); }
    .release-gh-link {
      display: inline-block;
      font-family: var(--mono);
      font-size: 0.7rem;
      color: var(--blurple-bright);
      text-decoration: none;
      border: 1px solid rgba(88,101,242,0.35);
      padding: 0.25rem 0.6rem;
      border-radius: 4px;
      transition: background 0.2s;
      white-space: nowrap;
    }
    .release-gh-link:hover { background: rgba(88,101,242,0.12); }
    .release-toggle-arrow {
      width: 24px; height: 24px;
      display: flex; align-items: center; justify-content: center;
      transition: transform 0.3s ease;
      flex-shrink: 0;
    }
    .release-toggle-arrow::before {
      content: '';
      width: 8px; height: 8px;
      border-right: 2px solid var(--text-dim);
      border-bottom: 2px solid var(--text-dim);
      transform: rotate(-135deg);
      transition: transform 0.3s ease;
    }
    .release-toggle-arrow.collapsed::before {
      transform: rotate(45deg);
    }
    .release-card-body {
      padding: 1.5rem;
      max-height: 600px;
      overflow-y: auto;
      transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
      opacity: 1;
    }
    .release-card-body.collapsed {
      max-height: 0;
      overflow-y: hidden;
      opacity: 0;
      padding: 0 1.5rem;
    }
    .release-card-body::-webkit-scrollbar { width: 6px; }
    .release-card-body::-webkit-scrollbar-track { background: transparent; }
    .release-card-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
    .release-card-body::-webkit-scrollbar-thumb:hover { background: var(--text-dimmer); }

    /* Changelog rendered content */
    .changelog-content h2, .changelog-content h3 {
      font-size: 0.85rem;
      font-weight: 700;
      color: var(--text);
      margin: 1.25rem 0 0.6rem;
      padding-bottom: 0.4rem;
      border-bottom: 1px solid var(--border);
      letter-spacing: -0.01em;
    }
    .changelog-content h2:first-child,
    .changelog-content h3:first-child { margin-top: 0; }
    .changelog-content ul { padding-left: 1.25rem; margin-bottom: 0.75rem; }
    .changelog-content li { font-size: 0.83rem; color: var(--text-dim); line-height: 1.65; margin-bottom: 0.3rem; }
    .changelog-content li strong { color: var(--text); font-weight: 600; }
    .changelog-content p { font-size: 0.83rem; color: var(--text-dim); line-height: 1.65; margin-bottom: 0.5rem; }
    .changelog-content code {
      font-family: var(--mono);
      font-size: 0.75rem;
      background: var(--bg3);
      border: 1px solid var(--border);
      color: var(--green-bright);
      padding: 0.1rem 0.4rem;
      border-radius: 3px;
    }
    .changelog-content a { color: var(--blurple-bright); text-decoration: none; }
    .changelog-content a:hover { text-decoration: underline; }
    .changelog-content hr {
      border: none;
      border-top: 1px solid var(--border);
      margin: 0.9rem 0 1rem;
    }
    .changelog-content pre {
      margin: 0.75rem 0;
      padding: 0.8rem 0.95rem;
      background: var(--bg3);
      border: 1px solid var(--border);
      border-radius: 6px;
      overflow-x: auto;
    }
    .changelog-content pre::-webkit-scrollbar { height: 6px; }
    .changelog-content pre::-webkit-scrollbar-track { background: transparent; }
    .changelog-content pre::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
    .changelog-content pre::-webkit-scrollbar-thumb:hover { background: var(--text-dimmer); }
    .changelog-content pre code {
      display: block;
      border: none;
      background: transparent;
      padding: 0;
      border-radius: 0;
      color: #7ab8a0;
      font-size: 0.72rem;
      line-height: 1.6;
      white-space: pre;
    }
    .changelog-table {
      width: 100%;
      border-collapse: collapse;
      margin: 0.75rem 0;
      font-size: 0.8rem;
      border: 1px solid var(--border);
      border-radius: 6px;
      overflow: hidden;
    }
    .changelog-table th {
      font-family: var(--mono);
      font-size: 0.65rem;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      color: var(--green-bright);
      background: var(--bg3);
      padding: 0.6rem 0.8rem;
      text-align: left;
      border-bottom: 1px solid var(--border);
    }
    .changelog-table td {
      padding: 0.5rem 0.8rem;
      border-bottom: 1px solid var(--border);
      color: var(--text-dim);
      background-color: #1e232c;
    }
    .changelog-table tr:last-child td { border-bottom: none; }
    .changelog-table code {
      font-family: var(--mono);
      font-size: 0.72rem;
      background: var(--bg3);
      border: 1px solid var(--border);
      color: var(--green-bright);
      padding: 0.1rem 0.35rem;
      border-radius: 3px;
    }

    .release-latest-badge {
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
      font-family: var(--mono);
      font-size: 0.55rem;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      padding: 0.2rem 0.6rem;
      border-radius: 999px;
      background: rgba(38,130,69,0.1);
      border: 1px solid rgba(38,130,69,0.35);
      color: var(--green-bright);
      width: fit-content;
      margin-top: 0.35rem;
    }
    .release-latest-dot {
      width: 6px; height: 6px;
      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;
    }
    .releases-separator {
      display: flex;
      align-items: center;
      gap: 1rem;
      margin: 2rem 0 0.5rem;
      color: var(--text-dimmer);
      font-family: var(--mono);
      font-size: 0.65rem;
      letter-spacing: 0.2em;
      text-transform: uppercase;
    }
    .releases-separator::before,
    .releases-separator::after {
      content: '';
      flex: 1;
      height: 1px;
      background: var(--border);
    }

    .release-error {
      font-family: var(--mono);
      font-size: 0.75rem;
      color: var(--text-dimmer);
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }

    /* FOOTER */
    footer {
      position: relative;
      border-top: 1px solid var(--border);
      padding: 3rem 2rem;
      text-align: center;
      background: rgba(10,12,15,0.85);
      backdrop-filter: blur(12px);
    }
    footer::before {
      content: '';
      position: absolute;
      bottom: 100%;
      left: 0;
      right: 0;
      height: 80px;
      background: linear-gradient(to bottom, transparent, rgba(10,12,15,0.6));
      pointer-events: none;
    }

    footer span { color: var(--text-dimmer); font-weight: 600; }

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

    /* REVEAL ANIMATION */
    .reveal { opacity:0; transform:translateY(24px); transition:opacity 0.6s ease, transform 0.6s ease; }
    .reveal.visible { opacity:1; transform:none; }

    @media (max-width: 1120px) {
      nav { padding: 0.6rem 1rem; }
      .nav-logo-img { height: 40px; }
      .hamburger-btn { display: flex; }
      .nav-links { display: none; }
    }

    @media (max-width: 768px) {
      .releases-section { padding: 7rem 1rem 4rem; }
    }

    @media (max-width: 640px) {
      nav { padding: 0.5rem 0.75rem; }
      .nav-logo-img { height: 36px; }
      .releases-section { padding: 5.5rem 0.75rem 3rem; }
      .release-card-header { 
        flex-direction: row;
        align-items: flex-start;
        padding: 1rem;
      }
      .release-card-header-left { gap: 0.15rem; flex: 1; }
      .release-card-header-right {
        flex-direction: column-reverse;
        align-items: flex-end;
        gap: 0.5rem;
      }
      .release-gh-link { font-size: 0.68rem; padding: 0.2rem 0.5rem; }
      .btn-back { font-size: 0.75rem; margin-bottom: 1.5rem; }
    }
