/*
  Main site stylesheet
  Use modern layout techniques and keep the design modular.
*/

:root {
  --bg: #090b13;
  --surface: #0f172a;
  --surface-alt: #111827;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --border: rgba(148, 163, 184, 0.15);
  --primary: #7c3aed;
  --primary-soft: rgba(124, 58, 237, 0.12);
  --radius: 24px;
  --shadow: 0 24px 80px rgba(15, 23, 42, 0.18);
  --max-width: 1200px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, rgba(124, 58, 237, 0.16), transparent 30%), #020617;
  color: var(--text);
  line-height: 1.7;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.container {
  width: min(100%, 1200px);
  margin: 0 auto;
  padding: 0 24px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
  background: rgba(8, 15, 32, 0.82);
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  flex-wrap: wrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.9rem;
  transition: background-color 180ms ease, color 180ms ease;
}

.lang-btn:hover,
.lang-btn.active {
  background: var(--primary-soft);
  color: var(--text);
}

.lang-btn.active {
  background: var(--primary);
  color: #ffffff;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand-logo {
  max-height: 46px;
  width: auto;
  display: block;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--muted);
  transition: color 180ms ease;
}

.site-nav a:hover {
  color: var(--text);
}

.nav-toggle {
  display: none;
  width: 38px;
  height: 38px;
  border: none;
  background: transparent;
  flex-direction: column;
  justify-content: space-between;
  padding: 4px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 3px;
  width: 100%;
  border-radius: 999px;
  background: var(--text);
}

.section-block {
  padding: 88px 0;
}

.section-dark {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), #090b13);
}

.section-heading {
  max-width: 720px;
  margin-bottom: 48px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
}

.section-heading h2,
.hero-section h1 {
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.section-heading p,
.hero-section p {
  color: var(--muted);
}

.hero-section {
  min-height: calc(100vh - 96px);
  display: grid;
  align-items: center;
  padding: 120px 0;
}

.hero-content {
  display: grid;
  gap: 32px;
  grid-template-columns: 1.3fr 0.9fr;
  align-items: center;
}

.hero-logo-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.hero-logo {
  max-width: 540px;
  width: 100%;
  height: auto;
  display: block;
}

.hero-content p {
  max-width: 680px;
  margin-top: 20px;
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 32px;
}

.hero-list {
  margin-top: 32px;
  display: grid;
  gap: 12px;
  color: var(--muted);
  list-style: none;
  padding: 0;
}

.hero-list li {
  position: relative;
  padding-left: 28px;
}

.hero-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--primary);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  border-radius: 999px;
  transition: transform 200ms ease, background-color 200ms ease, color 200ms ease;
  border: 1px solid transparent;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-color: rgba(148, 163, 184, 0.18);
}

.hero-panel {
  display: flex;
  justify-content: flex-end;
}

.panel-card {
  padding: 38px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(10, 17, 31, 0.95));
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: var(--shadow);
  min-width: 320px;
}

.panel-card h2 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 1.75rem;
}

.panel-card p {
  color: var(--muted);
}

.feature-grid,
.download-grid,
.docs-grid,
.screenshot-grid {
  display: grid;
  gap: 24px;
}

.feature-grid,
.docs-grid,
.download-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.screenshot-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.12);
  padding: 30px;
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.14);
}

.card h3 {
  margin-top: 0;
  margin-bottom: 14px;
}

.card p {
  margin: 0;
  color: var(--muted);
}

.engine-icons {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.engine-icon-link {
  display: inline-flex;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(255, 255, 255, 0.04);
  transition: transform 180ms ease, background-color 180ms ease;
}

.engine-icon-link:hover,
.engine-icon-link:focus-visible {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
}

.engine-icon {
  width: 86px;
  height: 86px;
  object-fit: contain;
  display: block;
}

/* Donation buttons styling */
.donation-icons {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.donation-link {
  display: inline-flex;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, rgba(255,255,255,0.14), rgba(255,255,255,0.08));
  padding: 12px;
  transition: transform 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
  box-shadow: 0 18px 46px rgba(2,6,23,0.48), inset 0 1px 0 rgba(255,255,255,0.03);
}

.donation-link:hover,
.donation-link:focus-visible {
  transform: translateY(-2px);
  background: linear-gradient(180deg, rgba(255,255,255,0.22), rgba(255,255,255,0.12));
  box-shadow: 0 28px 64px rgba(2,6,23,0.56), inset 0 1px 0 rgba(255,255,255,0.04);
}

.donation-icon {
  width: 76px;
  height: 76px;
  object-fit: contain;
  display: block;
}

/* Ensure logo is clearly visible on dark backgrounds */
.donation-link .donation-icon {
  background: #ffffff;
  padding: 8px;
  border-radius: 8px;
}

.donation-link .donation-icon {
  filter: drop-shadow(0 6px 18px rgba(2,6,23,0.45));
}

@media (max-width: 900px) {
  .donation-icon {
    width: 64px;
    height: 64px;
  }
}

@media (max-width: 640px) {
  .donation-icon {
    width: 56px;
    height: 56px;
  }
}

.card-download {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-download .btn {
  margin-top: 24px;
  width: fit-content;
}

.screenshot-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.screenshot-card {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  aspect-ratio: 4 / 3;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(0,0,0,0.2));
  border: 1px solid rgba(148, 163, 184, 0.14);
  transition: transform 240ms ease, box-shadow 240ms ease;
}

.screenshot-card:hover,
.screenshot-card:focus-within {
  transform: translateY(-6px);
  box-shadow: 0 28px 68px rgba(15, 23, 42, 0.24);
}

.screenshot-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 320ms ease;
}

.screenshot-card:hover img,
.screenshot-card:focus-within img {
  transform: scale(1.08);
}

.screenshot-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.36);
  opacity: 0;
  transition: opacity 180ms ease;
}

.screenshot-card:hover .screenshot-overlay {
  opacity: 1;
}

.screenshot-overlay span {
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.9rem;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.92);
  z-index: 50;
  padding: 20px;
}

.modal.hidden {
  display: none;
}

.modal-panel {
  position: relative;
  max-width: 1000px;
  width: min(100%, 98vw);
  max-height: min(95vh, 920px);
  overflow: hidden;
  border-radius: 24px;
  background: #09101e;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.45);
}

.modal-close {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 44px;
  height: 44px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 1.5rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 180ms ease;
  z-index: 2;
}

.modal-close:hover,
.modal-close:focus {
  background: rgba(255, 255, 255, 0.18);
}

.modal-image {
  width: 100%;
  height: auto;
  display: block;
  max-height: calc(95vh - 90px);
  object-fit: contain;
  background: #0f172a;
}

.modal-caption {
  margin: 14px 16px 18px;
  color: #dbeafe;
  font-size: 0.95rem;
  text-align: center;
}

.faq-list {
  display: grid;
  gap: 20px;
}

.faq-item {
  padding: 26px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(148, 163, 184, 0.1);
}

.faq-item h3 {
  margin-top: 0;
  margin-bottom: 12px;
}

.site-footer {
  padding: 36px 0;
  background: rgba(8, 15, 32, 0.98);
  border-top: 1px solid rgba(148, 163, 184, 0.08);
}

.section-legal {
  background: rgba(255, 255, 255, 0.03);
}

.legal-card {
  padding: 32px;
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.12);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.12);
}

.legal-card h2 {
  margin-top: 0;
  margin-bottom: 16px;
}

.legal-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}

@media (max-width: 1024px) {
  .hero-content {
    grid-template-columns: 1fr;
  }

  .feature-grid,
  .download-grid,
  .docs-grid,
  .screenshot-grid {
    grid-template-columns: 1fr;
  }
}
