/* Reset & base */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ── Design tokens (dark-only) ── */
:root {
  --bg: #000000;
  --bg-gradient: radial-gradient(ellipse at 50% -20%, #1a1207 0%, #0a0804 40%, #000 70%);
  --fg: #f5f0e8;
  --muted: #8a8070;
  --accent: #D4A853;
  --accent-hover: #BF9540;
  --accent-glow: rgba(212, 168, 83, 0.15);
  --accent-glow-strong: rgba(212, 168, 83, 0.3);
  --card-bg: rgba(255, 255, 255, 0.02);
  --card-border: rgba(212, 168, 83, 0.1);
  --card-glow: rgba(212, 168, 83, 0.06);
  --code-bg: rgba(255, 255, 255, 0.05);
  --note-bg: rgba(234, 179, 8, 0.08);
  --note-border: #d97706;
  --section-gap: clamp(2rem, 4vw, 3rem);
  color-scheme: dark;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--fg);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

code {
  font-family: "SF Mono", SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.85em;
  background: var(--code-bg);
  padding: 0.15em 0.45em;
  border-radius: 5px;
}

/* ── Hero ── */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#particle-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(4rem, 10vw, 7rem) 2rem clamp(1.5rem, 3vw, 2.5rem);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.hero-brand {
  position: relative;
  display: inline-block;
  font-size: clamp(3.5rem, 9vw, 6rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1;
  color: var(--accent);
  margin-bottom: 1rem;
}

.hero-brand::after {
  content: "";
  position: absolute;
  inset: -0.25rem -0.6rem;
  background:
    linear-gradient(var(--accent), var(--accent)) bottom left / 0% 2px no-repeat,
    linear-gradient(var(--accent), var(--accent)) bottom right / 2px 0% no-repeat,
    linear-gradient(var(--accent), var(--accent)) top right / 0% 2px no-repeat,
    linear-gradient(var(--accent), var(--accent)) top left / 2px 0% no-repeat;
  animation: draw-rect 1.6s ease-out 0.3s forwards;
}

@keyframes draw-rect {
  0% {
    background-size: 0% 2px, 2px 0%, 0% 2px, 2px 0%;
  }

  25% {
    background-size: 100% 2px, 2px 0%, 0% 2px, 2px 0%;
  }

  50% {
    background-size: 100% 2px, 2px 100%, 0% 2px, 2px 0%;
  }

  75% {
    background-size: 100% 2px, 2px 100%, 100% 2px, 2px 0%;
  }

  100% {
    background-size: 100% 2px, 2px 100%, 100% 2px, 2px 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-brand::after {
    animation: none;
    background-size: 100% 2px, 2px 100%, 100% 2px, 2px 100%;
  }
}

.hero-tagline {
  font-size: clamp(0.85rem, 1.8vw, 1.1rem);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.hero-subtitle {
  font-size: clamp(0.95rem, 1.6vw, 1.1rem);
  color: var(--muted);
  margin-bottom: 3.5rem;
  max-width: 580px;
  line-height: 1.7;
}

/* Download */
.download-area {
  margin-bottom: 1rem;
  text-align: center;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--accent);
  color: #000;
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 1rem 2.5rem;
  min-width: 640px;
  justify-content: center;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.3s, transform 0.2s;
  box-shadow: 0 0 16px var(--accent-glow);
}

.download-btn:hover {
  background: var(--accent-hover);
  color: #000;
  text-decoration: none;
  box-shadow: 0 0 24px var(--accent-glow-strong);
  transform: translateY(-1px);
}

.alt-platforms {
  font-size: 1rem;
  color: var(--muted);
  margin-top: 0.85rem;
}

.platform-link {
  background: none;
  border: none;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s;
}

.platform-link:hover {
  text-decoration: underline;
  color: var(--accent-hover);
}

.version-info {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.6rem;
  font-size: 1.2rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.app-size-note {
  font-size: 1rem;
  color: var(--muted);
}

/* ── Sections ── */
.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--section-gap) 2rem;
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  margin-bottom: 1.5rem;
  text-align: center;
  letter-spacing: -0.03em;
}

/* ── Scroll reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Card (replaces .glass) ── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.card:hover {
  border-color: var(--accent-glow);
  box-shadow: 0 0 20px var(--card-glow);
}

/* ── Steps ── */
.steps {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.step-card {
  padding: 2rem 1.5rem;
  flex: 1 1 0;
  min-width: 200px;
  max-width: 280px;
  text-align: center;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
  border-radius: 50%;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 0 12px var(--accent-glow);
}

.step-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.step-card p {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

.step-arrow {
  font-size: 1.5rem;
  color: var(--accent);
  opacity: 0.4;
  align-self: center;
}

.byok-note {
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted);
}

/* ── Features grid ── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

.feature-card {
  padding: 2rem 1.5rem;
}

.feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 12px;
  background: var(--accent-glow);
  border: 1px solid var(--accent-glow-strong);
  color: var(--accent);
  margin-bottom: 1rem;
}

.feature-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.feature-card p {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.55;
}

/* ── Tabs ── */
.tab-bar {
  display: flex;
  gap: 0.35rem;
  justify-content: center;
  margin-bottom: 1.75rem;
  background: var(--card-bg);
  border-radius: 12px;
  padding: 0.3rem;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  border: 1px solid var(--card-border);
}

.tab {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.5rem 1.5rem;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.25s;
}

.tab:hover {
  color: var(--fg);
}

.tab.active {
  background: var(--accent);
  color: #000;
  box-shadow: 0 0 16px var(--accent-glow);
}

.tab-content {
  display: none;
  padding: 2rem 2.5rem;
}

.tab-content.active {
  display: block;
}

.tab-content ol {
  padding-left: 1.25rem;
}

.tab-content li {
  margin-bottom: 0.6rem;
  font-size: 0.9rem;
  line-height: 1.6;
}

.install-note {
  margin-top: 1.25rem;
  padding: 0.85rem 1.15rem;
  background: var(--note-bg);
  border-left: 3px solid var(--note-border);
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ── Releases ── */
.release-card {
  padding: 2rem;
  margin-bottom: 1.25rem;
}

.release-header {
  margin-bottom: 1rem;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.release-card ul {
  padding-left: 1.25rem;
}

.release-card li {
  font-size: 0.875rem;
  margin-bottom: 0.4rem;
  color: var(--muted);
  line-height: 1.55;
}

.release-body h3 {
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  color: var(--fg);
}

.release-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.changelog-loading {
  font-size: 0.875rem;
  color: var(--muted);
  text-align: center;
}

.changelog-link {
  text-align: center;
  font-size: 0.875rem;
  margin-top: 1.25rem;
}

/* ── Footer ── */
.site-footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
  text-align: center;
  border-top: 1px solid var(--card-border);
}

.footer-links {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.footer-links a {
  color: var(--muted);
  transition: color 0.2s;
}

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

.footer-copy {
  font-size: 0.8rem;
  color: var(--muted);
}

/* ── Focus visible ── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .hero-content {
    padding: 4rem 1.25rem 3rem;
  }

  .section {
    padding: var(--section-gap) 1.25rem;
  }

  .steps {
    flex-direction: column;
    align-items: center;
  }

  .step-arrow {
    transform: rotate(90deg);
    padding-top: 0;
  }

  .step-card {
    width: 100%;
    max-width: 300px;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .tab-content {
    padding: 1.5rem;
  }

  .download-btn {
    min-width: auto;
    width: 100%;
  }
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--card-border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}