:root {
  --bg: #000000;
  --bg-alt: #0d0d0d;
  --surface: #1a1a1a;
  --surface-2: #242424;
  --border: #2c2c2c;
  --text: #ffffff;
  --text-dim: #b3b3b3;
  --text-mute: #7a7a7a;
  --brand: #e85d04;
  --brand-accent: #ff7a00;
  --radius: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

h1, h2, h3 { line-height: 1.15; margin: 0 0 12px; font-weight: 800; }

p { margin: 0 0 12px; color: var(--text-dim); }

.muted { color: var(--text-mute); }

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(0, 0, 0, 0.75);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  margin-right: auto;
}

.brand-icon {
  height: 34px;
  width: auto;
}

.nav-links {
  display: flex;
  gap: 24px;
}

.nav-links a {
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 600;
  transition: color 0.15s;
}

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

.nav-cta { display: inline-flex; }

@media (max-width: 720px) {
  .nav-links { display: none; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 18px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.15s, filter 0.15s, background 0.15s;
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-accent));
  color: #fff;
  box-shadow: 0 8px 24px rgba(232, 93, 4, 0.35);
}

.btn-primary:hover { filter: brightness(1.08); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost:hover { background: rgba(255, 255, 255, 0.1); }

.btn-lg { padding: 14px 26px; font-size: 15px; border-radius: 12px; }

/* Hero */
.hero {
  padding: 96px 24px 72px;
  text-align: center;
  background: radial-gradient(ellipse at top, rgba(232, 93, 4, 0.16), transparent 60%);
}

.hero-inner { max-width: 720px; margin: 0 auto; }

.hero-icon {
  height: 130px;
  width: auto;
  margin: 0 auto 20px;
}

.hero h1 {
  font-size: clamp(32px, 6vw, 52px);
  letter-spacing: -1px;
}

.hero-sub {
  font-size: 17px;
  max-width: 560px;
  margin: 0 auto 32px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.hero-meta {
  font-size: 13px;
  color: var(--text-mute);
  margin: 0;
}

/* Sections */
.section {
  max-width: 1120px;
  margin: 0 auto;
  padding: 72px 24px;
}

.section-alt { background: var(--bg-alt); max-width: none; }
.section-alt > * { max-width: 1120px; margin-left: auto; margin-right: auto; }

.section h2 {
  font-size: clamp(24px, 4vw, 34px);
  text-align: center;
  letter-spacing: -0.5px;
}

.section-sub {
  text-align: center;
  max-width: 520px;
  margin: 0 auto 40px;
}

/* Grid / cards */
.grid { display: grid; gap: 16px; margin-top: 40px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .grid-4 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: border-color 0.15s, transform 0.15s;
}

.card:hover { border-color: rgba(232, 93, 4, 0.4); transform: translateY(-2px); }

.card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(232, 93, 4, 0.22), rgba(255, 122, 0, 0.08));
  border: 1px solid rgba(232, 93, 4, 0.25);
}

.card h3 { font-size: 16px; margin-bottom: 6px; }

.card p { font-size: 13.5px; margin: 0; }

.grid-2 { grid-template-columns: repeat(2, 1fr); max-width: 960px; margin-left: auto; margin-right: auto; }

@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }

/* Device picker */
.device-picker-label {
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-mute);
  margin: 0 0 14px;
}

.device-picker {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
}

.device-tab {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.device-tab:hover { background: var(--surface-2); color: var(--text); }

.device-tab.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-accent));
  border-color: transparent;
  color: #fff;
}

.device-panel { max-width: 960px; margin: 0 auto; }

/* Downloader code callout */
.code-callout {
  max-width: 960px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, rgba(232, 93, 4, 0.18), rgba(255, 122, 0, 0.06));
  border: 1px solid var(--brand);
  border-radius: 16px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}

.code-callout-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--brand-accent);
}

.code-callout-code {
  font-size: clamp(36px, 8vw, 52px);
  font-weight: 900;
  letter-spacing: 6px;
  color: #fff;
  font-family: 'Courier New', monospace;
  text-shadow: 0 0 24px rgba(232, 93, 4, 0.5);
}

.code-callout-hint {
  font-size: 12.5px;
  color: var(--text-dim);
}

/* Fire TV */
.firetv-note {
  max-width: 960px;
  margin: 0 auto 32px;
  background: rgba(232, 93, 4, 0.1);
  border: 1px solid rgba(232, 93, 4, 0.35);
  border-radius: 12px;
  padding: 16px 20px 16px 56px;
  font-size: 13.5px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
}

.firetv-note::before {
  content: '🔓';
  position: absolute;
  left: 16px;
  top: 16px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  border-radius: 50%;
  background: rgba(232, 93, 4, 0.25);
}

.firetv-note strong { font-size: 14px; }
.firetv-note span { color: var(--text-dim); }

.method-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.method-icon {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(232, 93, 4, 0.28), rgba(255, 122, 0, 0.1));
}

.method-card h3 {
  font-size: 16px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.badge {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  background: linear-gradient(135deg, var(--brand), var(--brand-accent));
  color: #fff;
  padding: 3px 9px;
  border-radius: 999px;
}

.steps-compact { gap: 10px; }
.steps-compact li { padding: 14px 16px 14px 48px; font-size: 13px; }
.steps-compact li::before { width: 20px; height: 20px; left: 14px; font-size: 11px; }

.steps-compact code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 12.5px;
}

/* Socials */
.socials-section { text-align: center; }

.social-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  max-width: 720px;
  margin: 0 auto;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 700;
  transition: background 0.15s, border-color 0.15s;
}

.social-link:hover { background: var(--surface-2); border-color: var(--brand); transform: translateY(-2px); }

.social-link span {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(232, 93, 4, 0.28), rgba(255, 122, 0, 0.1));
}

/* Download card */
.download-card {
  max-width: 720px;
  margin: 0 auto 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.download-card-main {
  display: flex;
  align-items: center;
  gap: 18px;
}

.download-card-icon img {
  height: 60px;
  width: auto;
}

.download-card-info h3 { font-size: 17px; margin-bottom: 10px; }

.version-facts {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 4px 24px;
  margin: 0;
}

.version-facts div { display: flex; gap: 6px; font-size: 13px; }
.version-facts dt { color: var(--text-mute); margin: 0; }
.version-facts dd { margin: 0; font-weight: 700; }

.download-btn { flex-shrink: 0; }

/* Steps */
.steps {
  max-width: 720px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
  counter-reset: step;
  display: grid;
  gap: 14px;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding: 18px 20px 18px 56px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-accent));
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.steps strong { display: block; font-size: 14.5px; margin-bottom: 2px; }
.steps span { font-size: 13px; color: var(--text-dim); }

/* Changelog */
.changelog-card {
  max-width: 720px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.changelog-card h4 {
  margin: 0 0 4px;
  font-size: 16px;
}

.changelog-card .changelog-date {
  font-size: 12.5px;
  color: var(--text-mute);
  margin-bottom: 16px;
}

.changelog-card pre {
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-dim);
  margin: 0;
}

.changelog-card a.gh-link {
  display: inline-block;
  margin-top: 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-accent);
}

/* FAQ */
.faq-list {
  max-width: 720px;
  margin: 0 auto;
  display: grid;
  gap: 10px;
}

details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
}

details summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 14.5px;
  list-style: none;
}

details summary::-webkit-details-marker { display: none; }

details summary::after {
  content: '+';
  float: right;
  color: var(--text-mute);
  font-weight: 400;
}

details[open] summary::after { content: '−'; }

details p { margin: 12px 0 0; font-size: 13.5px; }

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 24px;
}

.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  font-size: 13px;
  color: var(--text-dim);
}

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

.footer-copy {
  width: 100%;
  text-align: center;
  font-size: 12px;
  color: var(--text-mute);
  margin: 8px 0 0;
}

/* Screenshots */
.screenshot-strip {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 8px 16px 16px;
  margin: 40px -16px 0;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.screenshot-strip::-webkit-scrollbar {
  display: none;
}

.screenshot-strip img {
  flex: 0 0 auto;
  height: 340px;
  width: auto;
  border-radius: 14px;
  border: 1px solid var(--border);
  scroll-snap-align: start;
  background: var(--surface);
}

@media (max-width: 600px) {
  .screenshot-strip img { height: 240px; }
}
