:root {
    --bg: #0a0a0a;
    --bar: #0a0a0a;
    --menu: #151515;
    --line: rgba(255, 255, 255, 0.14);
    --text: #ededed;
    --muted: #9b9b9b;
    --focus: #d0d0d0;
    --warning: #facc15;
    color-scheme: dark;
  }
  * { box-sizing: border-box; }
  html, body { margin: 0; height: 100%; }
  @media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
  }
  body {
    background: var(--bg);
    color: var(--text);
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  }
  body { padding-top: 60px; }
  .navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 20px;
    height: 60px;
    padding: 0 24px;
    background: transparent;
    transition: padding 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .navbar::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: rgba(0, 0, 0, 0.2);
    -webkit-backdrop-filter: blur(22px);
    backdrop-filter: blur(22px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
  }
  .navbar.scrolled::before { opacity: 1; }

  @media (min-width: 481px) {
    .navbar.scrolled { padding-inline: max(24px, calc((100% - 900px) / 2)); }
  }
  @media (prefers-reduced-motion: reduce) {
    .navbar, .navbar::before { transition: none; }
  }
  .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    text-decoration: none;
    font-family: "Inter", "Segoe UI", system-ui, sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: -0.02em;
  }
  .logo img { width: 30px; height: 30px; display: block; }
  .navbar-divider { width: 1px; height: 26px; background: var(--line); }

  nav { display: flex; align-items: center; gap: 4px; }
  nav a, .dropdown-button {
    color: var(--muted);
    text-decoration: none;
    font-family: "Inter", "Segoe UI", system-ui, sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 9px 20px;
    border-radius: 12px;
    transition: color 0.15s, background 0.15s;
  }
  nav a:hover, .dropdown-button:hover, .dropdown-button[aria-expanded="true"] {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
  }
  a:focus-visible, button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

  .nav-download-button {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 12px;
    background: #ffffff;
    color: #0a0a0a;
    font-family: "Inter", "Segoe UI", system-ui, sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s, transform 0.15s;
  }
  .nav-download-button:hover { background: #e2e2e2; }
  .nav-download-button:active { transform: scale(0.97); }
  .nav-download-button svg { width: 16px; height: 16px; flex: none; }

  @keyframes word-in {
    from { opacity: 0; transform: translateY(28px); filter: blur(14px); }
    60%  { opacity: 1; }
    to   { opacity: 1; transform: none; filter: blur(0); }
  }
  .fade-in {
    animation: word-in 0.9s cubic-bezier(0.22, 1, 0.36, 1) backwards;
    animation-delay: var(--delay, 0s);
  }
  .download-page {
    min-height: calc(100vh - 60px);
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .download-cards {
    width: min(900px, 100%);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  .download-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 28px;
    background: #101010;
    border: 1px solid var(--line);
    border-radius: 22px;
    text-align: center;
  }
  .download-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
  }
  .os-icon { width: 28px; height: 28px; flex: none; }

  .architecture-picker { display: flex; width: 100%; gap: 14px; margin: 28px 0 18px; }
  .architecture-option {
    flex: 1 1 0;
    min-width: 0;
    height: 56px;
    padding: 0;
    display: grid;
    place-items: center;
    border-radius: 16px;
    border: 2px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.15s;
  }
  .architecture-option:hover:not(:disabled):not(.selected) { background: rgba(255, 255, 255, 0.08); }
  .architecture-option:active:not(:disabled) { transform: scale(0.96); }
  .architecture-option.selected { border-color: #ffffff; background: rgba(255, 255, 255, 0.1); }
  .architecture-option:disabled {
    background: rgba(0, 0, 0, 0.45);
    border-color: rgba(255, 255, 255, 0.06);
    color: var(--muted);
    opacity: 0.45;
    cursor: not-allowed;
  }

  .version-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 0 14px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--muted);
  }
  .version-text.unsupported { color: var(--warning); }
  .version-text svg { width: 18px; height: 18px; flex: none; }

  .download-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 22px;
    border: 0;
    border-radius: 14px;
    background: #ffffff;
    color: #0a0a0a;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
  }
  .download-button:hover:not(:disabled) { background: #e2e2e2; }
  .download-button:active:not(:disabled) { transform: scale(0.97); }
  .download-button:disabled { opacity: 0.4; cursor: not-allowed; }
  .download-button svg { width: 20px; height: 20px; flex: none; }
  @media (max-width: 720px) {
    .download-cards { grid-template-columns: 1fr; max-width: 440px; }
  }
  @media (prefers-reduced-motion: reduce) {
    .fade-in { animation: none; }
    .architecture-option { transition: none; }
  }

  .dropdown { position: relative; }
  .dropdown-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 0;
    cursor: pointer;
    line-height: inherit;
  }
  .dropdown-button .dropdown-arrow { width: 16px; height: 16px; transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1); }
  .dropdown-button[aria-expanded="true"] .dropdown-arrow { transform: rotate(180deg); }

  .dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 190px;
    padding: 6px;
    background: var(--menu);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
    z-index: 10;
  }
  .dropdown-menu {
    transform-origin: top left;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-4px) scale(0.96);
    transition: opacity 0.12s ease, transform 0.12s ease, visibility 0s linear 0.12s;
  }
  .dropdown-menu.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    transition: opacity 0.14s ease-out, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s;
  }
  .submenu { transform: translateX(-6px) scale(0.96); }
  .dropdown-menu a, .dropdown-menu .submenu-button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 12px;
    border-radius: 9px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 500;
    text-align: left;
    text-decoration: none;
    background: none;
    border: 0;
    cursor: pointer;
  }
  .dropdown-menu a:hover, .dropdown-menu .submenu-button:hover, .dropdown-menu .submenu-button[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.05);
  }
  .dropdown-menu svg { width: 16px; height: 16px; flex: none; }
  .dropdown-menu .submenu-button .submenu-arrow { margin-left: auto; }

  .dropdown-menu-wide { width: 250px; }
  .dropdown-menu a.has-description { align-items: flex-start; }
  .dropdown-menu a.has-description svg { margin-top: 2px; }
  .menu-item-text { display: flex; flex-direction: column; gap: 3px; }
  .menu-item-description { color: var(--muted); font-size: 0.78rem; font-weight: 400; line-height: 1.4; }

  .submenu-wrapper { position: relative; }
  .submenu { left: calc(100% + 8px); top: -6px; }

  @media (prefers-reduced-motion: reduce) {
    .dropdown-button .dropdown-arrow { transition: none; }
    .dropdown-menu, .submenu { transition: none !important; }
  }
  @media (max-width: 480px) {
    .navbar { gap: 8px; padding: 0 12px; }
    nav { gap: 0; }
    .nav-download-button span { display: none; }
    .nav-download-button { padding: 10px 12px; }
    .logo span { display: none; }
    nav a, .dropdown-button { padding: 8px; }
    .dropdown-menu { position: fixed; left: 12px; right: 12px; top: 64px; }
    .dropdown-menu-wide { width: auto; }
    .submenu {
      position: static;
      transform: none;
      box-shadow: none;
      background: rgba(255, 255, 255, 0.04);
      max-height: 0;
      margin-top: 0;
      padding-top: 0;
      padding-bottom: 0;
      border-width: 0;
      overflow: hidden;
      transition: max-height 0.15s ease, margin 0.15s ease, padding 0.15s ease, opacity 0.12s ease, visibility 0s linear 0.15s;
    }
    .submenu.open {
      max-height: 200px;
      margin-top: 4px;
      padding-top: 6px;
      padding-bottom: 6px;
      border-width: 1px;
      transition: max-height 0.22s cubic-bezier(0.16, 1, 0.3, 1), margin 0.22s cubic-bezier(0.16, 1, 0.3, 1), padding 0.22s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.14s ease-out, visibility 0s;
    }
  }

.delay-1 { --delay: 0.2s; }
.delay-2 { --delay: 0.35s; }
