:root {
  color-scheme: dark;
  --red: #cc0000;
  --red-hover: #e60000;
  --red-soft: #ff3333;
  --bg: #000;
  --bg-deep: #05070b;
  --surface: #111;
  --surface-2: #181818;
  --surface-hover: #1b1b1b;
  --border: #2a2a2a;
  --text: #fff;
  --text-2: #a8a8a8;
  --muted: #888;
  --success: #2ecc71;
  --warning: #f39c12;
  --max: 1180px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 12% -6%, rgba(204, 0, 0, .17), transparent 28rem),
    linear-gradient(180deg, #07080b 0, var(--bg) 40rem);
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
}
button, a { font: inherit; }
button { color: inherit; }
a { color: inherit; }
svg { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 99;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fff;
  color: #000;
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  width: min(calc(100% - 40px), var(--max));
  min-height: 86px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand { display: inline-flex; align-items: center; }
.brand img { display: block; width: 148px; height: auto; }
.official-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text-2);
  font-size: .875rem;
}
.official-pill span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 18px rgba(46, 204, 113, .65);
}

main, footer { width: min(calc(100% - 40px), var(--max)); margin-inline: auto; }
.intro {
  min-height: 440px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
  align-items: center;
  gap: 56px;
  padding: 70px 0 64px;
}
.eyebrow {
  margin: 0 0 12px;
  color: var(--red-soft);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .16em;
}
h1, h2, h3, p { overflow-wrap: break-word; }
h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.5rem, 6vw, 5.25rem);
  line-height: .96;
  letter-spacing: -.055em;
  font-weight: 900;
}
.intro-text {
  max-width: 700px;
  margin: 26px 0 0;
  color: var(--text-2);
  font-size: clamp(1rem, 2vw, 1.2rem);
}
.trust-panel {
  position: relative;
  display: grid;
  gap: 1px;
  padding: 1px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--border);
  box-shadow: 0 28px 80px rgba(0,0,0,.32);
}
.trust-panel::before {
  content: "";
  position: absolute;
  inset: -1px auto auto 18px;
  width: 80px;
  height: 2px;
  background: var(--red);
  box-shadow: 0 0 24px var(--red);
}
.trust-panel div { padding: 24px; background: rgba(17,17,17,.95); }
.trust-panel strong, .trust-panel span { display: block; }
.trust-panel strong { font-size: 1rem; }
.trust-panel span { margin-top: 4px; color: var(--muted); font-size: .88rem; }

.downloads, .install { padding: 56px 0 72px; }
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}
.section-heading h2, .support h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -.04em;
  line-height: 1.05;
}
.refresh-button, .qr-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease;
}
.refresh-button:hover, .qr-button:hover { border-color: #555; background: var(--surface-hover); color: #fff; }
.refresh-button:active, .qr-button:active { transform: translateY(1px); }
.refresh-button svg { width: 17px; }
.refresh-button.loading svg { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.release-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.release-card {
  position: relative;
  display: flex;
  min-height: 610px;
  flex-direction: column;
  padding: 26px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(24,24,24,.95), rgba(9,9,9,.98));
  box-shadow: 0 20px 60px rgba(0,0,0,.22);
}
.release-card.featured { border-color: rgba(204, 0, 0, .7); }
.release-card.featured::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--red), transparent 70%);
}
.card-topline { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.platform-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: #202020;
  color: #eee;
}
.platform-icon svg { width: 27px; height: 27px; }
.platform-icon.android { background: rgba(46,204,113,.12); color: var(--success); }
.platform-icon.tv { background: rgba(204,0,0,.16); color: var(--red-soft); }
.platform-icon.windows { background: rgba(64,169,255,.12); color: #40a9ff; }
.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
}
.status-badge.stable { background: rgba(46,204,113,.12); color: var(--success); }
.status-badge.testing { background: rgba(243,156,18,.12); color: var(--warning); }
.status-badge.upcoming { background: rgba(255,255,255,.07); color: var(--text-2); }
.card-copy { margin-top: 30px; }
.platform-overline { margin: 0 0 7px; color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .11em; }
.card-copy h3 { margin: 0; font-size: 1.65rem; letter-spacing: -.035em; }
.card-copy > p:last-child { min-height: 72px; margin: 13px 0 0; color: var(--text-2); }
.release-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 1px;
  margin: 26px 0 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--border);
}
.release-meta div { padding: 12px; background: #0c0c0c; }
.release-meta dt { color: var(--muted); font-size: .7rem; text-transform: uppercase; }
.release-meta dd { margin: 3px 0 0; font-size: .82rem; font-weight: 700; }
.release-notes { min-height: 66px; margin: 22px 0; color: var(--text-2); font-size: .88rem; }
.release-warning {
  margin: -8px 0 18px;
  padding: 11px 12px;
  border-left: 2px solid var(--warning);
  background: rgba(243,156,18,.07);
  color: #d9c59b;
  font-size: .78rem;
}
.card-actions { display: grid; grid-template-columns: 1fr auto; gap: 9px; margin-top: auto; }
.download-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid var(--red);
  border-radius: 10px;
  background: var(--red);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.download-button:hover { background: var(--red-hover); border-color: var(--red-hover); }
.download-button:active { transform: translateY(1px); }
.download-button.secondary { background: transparent; color: var(--red-soft); }
.download-button.secondary:hover { background: rgba(204,0,0,.16); }
.download-button.disabled { width: 100%; margin-top: auto; border-color: var(--border); background: #151515; color: #666; cursor: not-allowed; }
.download-button svg { width: 19px; height: 19px; }
.qr-panel { margin-top: 12px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: #fff; color: #111; text-align: center; }
.qr-code { display: grid; place-items: center; min-height: 154px; }
.qr-code img { display: block; width: 154px; height: 154px; }
.qr-panel p { margin: 10px 0 0; font-size: .78rem; }
.hash-button {
  width: 100%;
  min-height: 38px;
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: .72rem;
  text-align: left;
}
.hash-button code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hash-button .copy-label { margin-left: auto; color: var(--text-2); }
.coming-soon { margin: 34px 0; padding: 18px; border: 1px dashed #333; border-radius: 12px; background: rgba(255,255,255,.025); }
.coming-soon strong, .coming-soon span { display: block; }
.coming-soon span { margin-top: 7px; color: var(--muted); font-size: .88rem; }
.sync-status { margin: 16px 2px 0; color: var(--muted); font-size: .82rem; }
.sync-status.ok { color: var(--success); }
.sync-status.warning { color: var(--warning); }

.install { border-top: 1px solid rgba(255,255,255,.08); }
.install-heading > p { max-width: 360px; margin: 0; color: var(--muted); text-align: right; }
.install-layout { display: grid; grid-template-columns: 290px 1fr; gap: 18px; }
.install-tabs { display: grid; align-content: start; gap: 8px; }
.install-tabs button {
  min-height: 54px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text-2);
  text-align: left;
  cursor: pointer;
}
.install-tabs button:hover { background: var(--surface); color: #fff; }
.install-tabs button[aria-selected="true"] { border-color: var(--red); background: rgba(204,0,0,.11); color: #fff; font-weight: 700; }
.guide-panel { min-height: 280px; padding: 30px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.guide-panel ol { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin: 0; padding: 0; list-style: none; }
.guide-panel li { display: flex; gap: 14px; }
.guide-panel li > span { flex: 0 0 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--red); border-radius: 50%; color: var(--red-soft); font-weight: 800; }
.guide-panel strong { display: block; margin-top: 4px; font-size: 1rem; }
.guide-panel p { margin: 7px 0 0; color: var(--text-2); font-size: .9rem; }

.support {
  margin-bottom: 76px;
  padding: 38px;
  display: grid;
  grid-template-columns: 1.4fr .6fr;
  align-items: center;
  gap: 44px;
  border: 1px solid rgba(204,0,0,.55);
  border-radius: 18px;
  background: linear-gradient(100deg, rgba(204,0,0,.12), rgba(17,17,17,.7));
}
.support > div > p:last-child { margin-bottom: 0; color: var(--text-2); }
.support-note { padding-left: 28px; border-left: 1px solid #393939; }
.support-note strong { color: var(--red-soft); }
.support-note p { margin: 7px 0 0; color: var(--text-2); font-size: .88rem; }

footer {
  min-height: 92px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-top: 1px solid rgba(255,255,255,.08);
  color: var(--muted);
  font-size: .86rem;
}
footer img { width: 28px; height: auto; }
footer a { margin-left: auto; color: var(--text-2); text-decoration: none; }
footer a:hover { color: #fff; }
.toast {
  position: fixed;
  z-index: 90;
  left: 50%;
  bottom: 24px;
  max-width: calc(100% - 32px);
  padding: 11px 16px;
  border: 1px solid #444;
  border-radius: 10px;
  background: #171717;
  color: #fff;
  box-shadow: 0 16px 50px rgba(0,0,0,.45);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

@media (max-width: 980px) {
  .intro { grid-template-columns: 1fr; min-height: 0; gap: 34px; }
  .trust-panel { grid-template-columns: 1fr 1fr; }
  .release-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .release-card:last-child { grid-column: 1 / -1; min-height: 420px; }
  .guide-panel ol { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .site-header, main, footer { width: min(calc(100% - 28px), var(--max)); }
  .site-header { min-height: 74px; }
  .brand img { width: 118px; }
  .official-pill { font-size: .75rem; }
  .intro { padding: 54px 0 42px; }
  h1 { font-size: clamp(2.5rem, 14vw, 4rem); }
  .trust-panel { grid-template-columns: 1fr; }
  .downloads, .install { padding: 44px 0 56px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .release-grid { grid-template-columns: 1fr; }
  .release-card, .release-card:last-child { min-height: 0; grid-column: auto; padding: 22px; }
  .card-copy > p:last-child, .release-notes { min-height: 0; }
  .card-actions { grid-template-columns: 1fr; }
  .release-meta { grid-template-columns: 1fr 1fr; }
  .release-meta div:last-child { grid-column: 1 / -1; }
  .install-heading > p { text-align: left; }
  .install-layout { grid-template-columns: 1fr; }
  .install-tabs { grid-template-columns: 1fr; }
  .guide-panel { padding: 22px; }
  .support { grid-template-columns: 1fr; padding: 26px; }
  .support-note { padding: 22px 0 0; border-left: 0; border-top: 1px solid #393939; }
  footer { flex-wrap: wrap; padding: 22px 0; }
  footer a { width: 100%; margin: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
