/* ============================================================
   Witch Launcher — WebGPU landing (monochrome / B&W)
   ============================================================ */
:root {
  --bg:        #000000;
  --bg-1:      #0a0a0a;
  --bg-2:      #111111;
  --fg:        #ffffff;
  --fg-dim:    #b8b8b8;
  --fg-faint:  #7a7a7a;
  --line:      rgba(255,255,255,0.12);
  --line-soft: rgba(255,255,255,0.06);
  --glass:     rgba(255,255,255,0.045);
  --glass-2:   rgba(255,255,255,0.07);
  --radius:    18px;
  --maxw:      1120px;
  --ease:      cubic-bezier(.22,.61,.36,1);
  --mono:      ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans:      -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
code { font-family: var(--mono); font-size: .88em; background: var(--glass-2); padding: .1em .35em; border-radius: 6px; }

/* ---------- i18n visibility ---------- */
html.lang-vi .en { display: none; }
html.lang-en .vi { display: none; }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  background: rgba(0,0,0,0.25);
  border-bottom: 1px solid transparent;
  transition: background .4s var(--ease), border-color .4s var(--ease);
}
.nav.scrolled { background: rgba(0,0,0,0.72); border-bottom-color: var(--line); }
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 14px 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .3px; }
.brand-logo { filter: drop-shadow(0 0 10px rgba(255,255,255,.25)); animation: float 6s ease-in-out infinite; will-change: transform; }
.brand-name { font-size: 1.05rem; }
.brand-sub { color: var(--fg-faint); font-weight: 400; }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a { font-size: .94rem; color: var(--fg-dim); transition: color .25s var(--ease); position: relative; }
.nav-links a:not(.gh):not(.lang-btn)::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 1px; width: 0;
  background: var(--fg); transition: width .3s var(--ease);
}
.nav-links a:not(.gh):not(.lang-btn):hover { color: var(--fg); }
.nav-links a:not(.gh):not(.lang-btn):hover::after { width: 100%; }
.nav-links .gh { display: inline-flex; align-items: center; gap: 6px; }
.nav-links .gh:hover { color: var(--fg); }
.lang-btn {
  font-family: var(--mono); font-size: .8rem; letter-spacing: .5px;
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px;
  background: var(--glass); color: var(--fg-dim); cursor: pointer;
  transition: all .25s var(--ease);
}
.lang-btn:hover { color: var(--fg); border-color: var(--fg); background: var(--glass-2); }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--fg); border-radius: 2px; transition: .3s var(--ease); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative; min-height: 100svh; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 120px 22px 80px; overflow: hidden;
}
.hero-media { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: #000; }
.gpu-video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0;
  /* blur được điều khiển bởi scroll: sắc nét ở đầu, mờ dần khi cuộn xuống */
  filter: blur(0px) brightness(0.95);
  transform: scale(1.14);
  transform-origin: center;
  will-change: filter, transform;
}
.page-scrim {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: #000; opacity: var(--scrim, 0.4);
  will-change: opacity;
}
.gpu { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 2; }
.gpu-fallback { position: absolute; inset: 0; z-index: 0; display: flex; align-items: center; justify-content: center; }
.gpu-fallback-bg {
  position: absolute; inset: -20%;
  background:
    radial-gradient(40% 50% at 30% 30%, rgba(255,255,255,.10), transparent 60%),
    radial-gradient(45% 55% at 75% 70%, rgba(255,255,255,.07), transparent 60%),
    conic-gradient(from 0deg at 50% 50%, #000, #0d0d0d, #000);
  filter: blur(8px);
  animation: spin 30s linear infinite;
}
.gpu-note { position: relative; z-index: 1; font-family: var(--mono); font-size: .8rem; color: var(--fg-faint); }
.hero-overlay { display: none; }
.hero::after {
  content: ""; position: absolute; inset: 12px; z-index: 4; pointer-events: none;
  border: 1px solid rgba(255,255,255,.09); border-radius: 22px;
}
.hero-content { position: relative; z-index: 3; max-width: 760px; }
.hero-logo { width: clamp(140px, 22vw, 180px); height: auto; margin: 0 auto 22px; filter: drop-shadow(0 0 28px rgba(255,255,255,.35)); animation: float 6s ease-in-out infinite; will-change: transform; }
.hero-title {
  font-size: clamp(2.6rem, 9vw, 5.4rem); line-height: 1; font-weight: 800; letter-spacing: -.02em;
  background: linear-gradient(180deg, #ffffff 0%, #c8c8c8 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 50px rgba(255,255,255,.12);
}
.hero-title .thin { font-weight: 200; }
.hero-tag { margin: 22px auto 0; max-width: 560px; color: var(--fg-dim); font-size: clamp(1rem, 2.4vw, 1.2rem); }
.hero-cta { margin-top: 36px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 26px; border-radius: 999px; font-weight: 600; font-size: .98rem;
  cursor: pointer; transition: transform .25s var(--ease), box-shadow .3s var(--ease), background .3s var(--ease);
  border: 1px solid transparent;
}
.btn-primary { background: var(--fg); color: #000; box-shadow: 0 0 0 0 rgba(255,255,255,.4); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 40px rgba(255,255,255,.25); }
.btn-ghost { border-color: var(--line); color: var(--fg); background: var(--glass); }
.btn-ghost:hover { transform: translateY(-2px); border-color: var(--fg); background: var(--glass-2); }

.scroll-cue {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 3;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: .72rem; letter-spacing: 2px; color: var(--fg-faint); text-transform: uppercase;
}
.scroll-cue .arrow { width: 1px; height: 34px; background: linear-gradient(var(--fg), transparent); position: relative; overflow: hidden; }
.scroll-cue .arrow::after { content: ""; position: absolute; top: -34px; left: 0; width: 1px; height: 34px; background: var(--fg); animation: cue 1.8s var(--ease) infinite; }

/* ============================================================
   SECTIONS
   ============================================================ */
.section { padding: clamp(70px, 11vw, 130px) 22px; position: relative; z-index: 2; }
.section-alt { border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.container { max-width: var(--maxw); margin: 0 auto; }
.eyebrow {
  font-family: var(--mono); font-size: .78rem; letter-spacing: 3px; text-transform: uppercase;
  color: var(--fg-faint); margin-bottom: 14px;
}
.eyebrow::before { content: "◇ "; color: var(--fg-dim); }
.section-title {
  font-size: clamp(1.8rem, 5vw, 3rem); line-height: 1.1; font-weight: 800; letter-spacing: -.02em;
  max-width: 16ch;
}
.section-title.light { color: var(--fg); }
.lead { margin-top: 22px; max-width: 70ch; color: var(--fg-dim); font-size: clamp(1rem, 2.2vw, 1.15rem); }
.lead strong { color: var(--fg); font-weight: 600; }

/* reveal */
[data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
[data-reveal].in { opacity: 1; transform: none; }
.grid .card:nth-child(1) { transition-delay: 0ms; }
.grid .card:nth-child(2) { transition-delay: 60ms; }
.grid .card:nth-child(3) { transition-delay: 120ms; }
.grid .card:nth-child(4) { transition-delay: 180ms; }
.grid .card:nth-child(5) { transition-delay: 240ms; }
.grid .card:nth-child(6) { transition-delay: 300ms; }
.grid .card:nth-child(7) { transition-delay: 360ms; }
.grid .card:nth-child(8) { transition-delay: 420ms; }
.grid .card:nth-child(9) { transition-delay: 480ms; }

/* ============================================================
   FEATURES GRID
   ============================================================ */
.grid {
  margin-top: 50px; display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.card {
  position: relative; padding: 26px 24px; border-radius: var(--radius);
  background: var(--glass); border: 1px solid var(--line-soft);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  overflow: hidden; transition: transform .35s var(--ease), border-color .35s var(--ease), background .35s var(--ease);
}
.card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: radial-gradient(120% 100% at 0% 0%, rgba(255,255,255,.10), transparent 55%);
  opacity: 0; transition: opacity .35s var(--ease);
}
.card:hover { transform: translateY(-6px); border-color: var(--line); background: var(--glass-2); }
.card:hover::before { opacity: 1; }
.card-ico { width: 46px; height: 46px; margin-bottom: 16px; }
.card-ico svg { width: 100%; height: 100%; fill: none; stroke: var(--fg); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.card h3 { font-size: 1.12rem; font-weight: 700; margin-bottom: 8px; }
.card p { color: var(--fg-dim); font-size: .95rem; }

/* ============================================================
   DOWNLOAD
   ============================================================ */
.status-row {
  margin-top: 26px; display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-family: var(--mono); font-size: .85rem; color: var(--fg-dim);
  padding: 10px 18px; border: 1px solid var(--line); border-radius: 999px; background: var(--glass);
}
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 0 rgba(255,255,255,.6); animation: pulse 2s infinite; }
.status-sep { color: var(--fg-faint); }
.status-ver { color: var(--fg); font-weight: 600; }

.dl-grid { margin-top: 36px; display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.dl-card {
  display: flex; flex-direction: column; gap: 10px; padding: 26px 24px; border-radius: var(--radius);
  background: var(--glass); border: 1px solid var(--line-soft);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: transform .35s var(--ease), border-color .35s var(--ease), background .35s var(--ease);
}
.dl-card:hover { transform: translateY(-6px); border-color: var(--fg); background: var(--glass-2); }
.dl-ico { width: 40px; height: 40px; }
.dl-ico svg { width: 100%; height: 100%; fill: none; stroke: var(--fg); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.dl-card h3 { font-size: 1.1rem; font-weight: 700; }
.dl-card p { color: var(--fg-dim); font-size: .93rem; flex: 1; }
.dl-go { font-family: var(--mono); font-size: .85rem; letter-spacing: .5px; color: var(--fg); }

.support { margin-top: 48px; display: grid; gap: 26px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.support-block h4 { font-size: .8rem; font-family: var(--mono); letter-spacing: 2px; text-transform: uppercase; color: var(--fg-faint); margin-bottom: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  font-size: .85rem; padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--glass); color: var(--fg-dim);
  transition: all .25s var(--ease);
}
.chip:hover { color: var(--fg); border-color: var(--fg); background: var(--glass-2); transform: translateY(-2px); }
.chip-note { border-style: dashed; }
.support-note { grid-column: 1 / -1; margin-top: 6px; color: var(--fg-dim); font-size: .92rem; }

/* download: dynamic GitHub Releases */
.dl-head { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.dl-quick {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--glass);
  color: var(--fg-dim); font-size: .9rem; transition: all .25s var(--ease);
}
.dl-quick svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.dl-quick:hover { color: var(--fg); border-color: var(--fg); background: var(--glass-2); transform: translateY(-2px); }

.release-list { margin-top: 28px; display: grid; gap: 16px; }
.release-loading, .release-fallback { text-align: center; color: var(--fg-faint); padding: 30px; }
.release-fallback p { margin-bottom: 16px; }
.release-item {
  border: 1px solid var(--line-soft); border-radius: var(--radius);
  background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
}
.release-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 16px 20px; border-bottom: 1px solid var(--line-soft);
  background: rgba(255,255,255,.03);
}
.rel-ver { font-weight: 700; font-size: 1.05rem; }
.rel-badge { font-family: var(--mono); font-size: .68rem; letter-spacing: 1px; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--fg-dim); }
.rel-badge.pre { color: #fff; border-color: rgba(255,255,255,.4); }
.rel-date { margin-left: auto; color: var(--fg-faint); font-size: .82rem; font-family: var(--mono); }
.asset-list { display: grid; }
.asset {
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 14px;
  padding: 14px 20px; border-bottom: 1px solid var(--line-soft);
  color: var(--fg); transition: background .2s var(--ease);
}
.asset:last-child { border-bottom: 0; }
.asset:hover { background: var(--glass-2); }
.asset-ico { width: 22px; height: 22px; }
.asset-ico svg { width: 100%; height: 100%; fill: none; stroke: var(--fg); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.asset-name { font-size: .95rem; word-break: break-all; }
.asset-size { font-family: var(--mono); font-size: .8rem; color: var(--fg-faint); }
.asset-go { font-family: var(--mono); font-size: .82rem; color: var(--fg-dim); white-space: nowrap; }
.asset:hover .asset-go { color: var(--fg); }
.asset-none { padding: 16px 20px; color: var(--fg-faint); font-size: .9rem; }

@media (max-width: 560px) {
  .asset { grid-template-columns: auto 1fr; row-gap: 4px; }
  .asset-size { grid-column: 2; }
  .asset-go { grid-column: 1 / -1; justify-self: start; }
}

/* bảng version (lazy) */
.rel-table { display: grid; gap: 10px; }
.rel-row-wrap { border: 1px solid var(--line-soft); border-radius: 14px; overflow: hidden; background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.rel-row {
  width: 100%; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 14px 18px; background: none; border: 0; color: var(--fg);
  cursor: pointer; text-align: left; font: inherit; transition: background .2s var(--ease);
}
.rel-row:hover { background: var(--glass-2); }
.rel-ver { font-weight: 700; font-size: 1.02rem; }
.rel-badge {
  font-family: var(--mono); font-size: .64rem; letter-spacing: 1px; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--fg-dim);
  white-space: nowrap;
}
.rel-badge.rel { color: #fff; border-color: rgba(255,255,255,.45); }
.rel-badge.pre { color: #fff; border-color: rgba(255,255,255,.45); background: rgba(255,255,255,.06); }
.rel-badge.latest { color: #000; background: #fff; border-color: #fff; }
.rel-date { color: var(--fg-faint); font-size: .82rem; font-family: var(--mono); margin-left: auto; }
.rel-caret { width: 18px; height: 18px; transition: transform .25s var(--ease); }
.rel-caret svg { width: 100%; height: 100%; fill: none; stroke: var(--fg-dim); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rel-row[aria-expanded="true"] .rel-caret { transform: rotate(180deg); }
.rel-body { border-top: 1px solid var(--line-soft); }
.rel-stale { margin-top: 12px; text-align: center; color: var(--fg-faint); font-size: .82rem; }

/* ============================================================
   CONTRIBUTE
   ============================================================ */
.contribute { display: flex; justify-content: center; }
.contribute-card {
  position: relative; max-width: 760px; text-align: center; padding: clamp(40px, 7vw, 70px) clamp(26px, 6vw, 60px);
  border-radius: 28px; border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--glass-2), var(--glass));
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); overflow: hidden;
}
.contribute-glow {
  position: absolute; width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.16), transparent 65%);
  top: -160px; left: 50%; transform: translateX(-50%); filter: blur(10px); animation: float 7s ease-in-out infinite;
}
.contribute-card .lead { margin-left: auto; margin-right: auto; position: relative; }
.contribute-card .hero-cta { margin-top: 32px; position: relative; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { border-top: 1px solid var(--line-soft); padding: 50px 22px; background: transparent; position: relative; z-index: 2; }
.footer-inner { max-width: var(--maxw); margin: 0 auto; display: flex; flex-direction: column; gap: 12px; align-items: center; text-align: center; }
.footer-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.footer-credit, .footer-lic { color: var(--fg-dim); font-size: .9rem; max-width: 60ch; }
.footer-lic { color: var(--fg-faint); font-size: .82rem; }
.footer-copy { color: var(--fg-faint); font-size: .82rem; font-family: var(--mono); }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,255,255,.55); }
  70% { box-shadow: 0 0 0 10px rgba(255,255,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}
@keyframes cue { 0% { top: -34px; } 60%,100% { top: 34px; } }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute; top: 100%; right: 14px; left: 14px;
    flex-direction: column; align-items: stretch; gap: 4px; padding: 14px;
    background: rgba(0,0,0,.92); border: 1px solid var(--line); border-radius: 16px;
    transform: translateY(-12px); opacity: 0; pointer-events: none; transition: .3s var(--ease);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  }
  .nav-links.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav-links a { padding: 10px 8px; }
  .lang-btn { align-self: flex-start; margin-top: 6px; }
  .hero { padding-top: 110px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1; transform: none; }
}
