/* ── Design tokens ─────────────────────────────────────────── */
:root {
  color-scheme: dark;
  --bg: #101412;
  --surface: #191f1c;
  --surface-2: #22231f;
  --surface-3: #111816;
  --text: #f7f3ea;
  --muted: #c8c2b8;
  --soft: #938c82;
  --line: rgba(255, 255, 255, 0.15);
  --accent: #ff9138;
  --accent-2: #ffd08a;
  --accent-3: #58d7c7;
  --accent-4: #a7b7ff;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.34);
  --header-bg: rgba(16, 20, 18, 0.88);
  --install-bg: #171615;
  --install-hover: #24211d;
  --band-bg: #171c1a;
  --footer-bg: #0e100f;
  --hero-shade-h: linear-gradient(0deg, rgba(16, 20, 18, 0.98), rgba(16, 20, 18, 0.5));
  --hero-shade-v: linear-gradient(90deg, rgba(16, 20, 18, 0.96), rgba(16, 20, 18, 0.18));
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ── Light theme ───────────────────────────────────────────── */
[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f4f0;
  --surface: #ffffff;
  --surface-2: #eeecea;
  --surface-3: #f0efec;
  --text: #1a1916;
  --muted: #504940;
  --soft: #7a746c;
  --line: rgba(0, 0, 0, 0.12);
  --accent: #d4620a;
  --accent-2: #b34d00;
  --accent-3: #0f8c7e;
  --accent-4: #4455cc;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.10);
  --header-bg: rgba(245, 244, 240, 0.90);
  --install-bg: #ebebea;
  --install-hover: #e0deda;
  --band-bg: #ece9e5;
  --footer-bg: #e8e6e2;
  --hero-shade-h: linear-gradient(0deg, rgba(245, 244, 240, 0.98), rgba(245, 244, 240, 0.5));
  --hero-shade-v: linear-gradient(90deg, rgba(245, 244, 240, 0.96), rgba(245, 244, 240, 0.18));
}

/* ── Reset ─────────────────────────────────────────────────── */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a {
  color: inherit;
}

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

/* ── Skip link ─────────────────────────────────────────────── */
.skip-link {
  position: fixed;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  padding: 0.75rem 1rem;
  background: var(--accent-2);
  color: #211208;
  border-radius: 6px;
  transition: top 160ms ease;
}

[data-theme="light"] .skip-link {
  color: #fff;
}

.skip-link:focus {
  top: 1rem;
}

/* ── Header ────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem clamp(1rem, 4vw, 4rem);
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 850;
  text-decoration: none;
}

.brand img {
  border-radius: 6px;
  box-shadow: 0 0 0 1px var(--line);
}

/* ── Navigation ────────────────────────────────────────────── */
.nav-links,
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.nav-links a,
.site-footer a {
  padding: 0.45rem 0.7rem;
  color: var(--muted);
  text-decoration: none;
  border-radius: 6px;
}

.nav-links a:hover,
.site-footer a:hover {
  color: var(--text);
  background: rgba(127, 127, 127, 0.12);
}

.site-footer p a {
  padding: 0;
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  border-radius: 0;
}

.site-footer p a:hover {
  background: transparent;
  color: var(--accent-2);
}

/* ── Header controls (lang + theme) ─────────────────────────── */
.header-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
  position: relative;
}

.ctrl-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.7rem;
  background: rgba(127, 127, 127, 0.1);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: inherit;
  line-height: 1;
  transition: background 160ms ease, color 160ms ease, transform 120ms ease;
}

.ctrl-btn:hover {
  background: rgba(127, 127, 127, 0.2);
  color: var(--text);
  transform: translateY(-1px);
}

/* Sun/Moon icon visibility by theme */
[data-theme="dark"] .icon-sun  { display: none; }
[data-theme="light"] .icon-moon { display: none; }

/* Language dropdown menu */
.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  min-width: 170px;
  padding: 0.4rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.lang-menu[hidden] {
  display: none;
}

.lang-menu button {
  display: block;
  width: 100%;
  padding: 0.52rem 0.8rem;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
  text-align: left;
  transition: background 120ms ease, color 120ms ease;
}

.lang-menu button:hover,
.lang-menu button.active {
  background: rgba(127, 127, 127, 0.14);
  color: var(--text);
}

.lang-menu button.active {
  font-weight: 700;
}

/* ── Hero ──────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 78vh;
  display: grid;
  align-items: end;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero-media,
.hero-media img,
.hero-shade {
  position: absolute;
  inset: 0;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: saturate(0.98) contrast(1.03);
}

[data-theme="light"] .hero-media img {
  filter: saturate(0.7) contrast(0.9) brightness(1.1);
}

.hero-shade {
  background:
    var(--hero-shade-v),
    var(--hero-shade-h);
}

.hero-content {
  position: relative;
  width: min(780px, calc(100% - 2rem));
  padding: clamp(5rem, 14vh, 9rem) 0 clamp(3rem, 8vh, 5rem);
  margin-left: clamp(1rem, 6vw, 5rem);
}

/* ── Type ──────────────────────────────────────────────────── */
.eyebrow,
.card-kicker {
  margin: 0 0 0.7rem;
  color: var(--accent-2);
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.card-kicker {
  color: var(--accent-3);
  font-size: 0.76rem;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  max-width: 12ch;
  font-size: clamp(3.2rem, 8vw, 6.25rem);
  line-height: 0.93;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(2.1rem, 5vw, 3.35rem);
  line-height: 1.05;
  letter-spacing: 0;
}

h3 {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.2;
}

.hero-copy {
  max-width: 66ch;
  margin: 1.4rem 0 0;
  color: var(--muted);
  font-size: 1.22rem;
}

/* ── Buttons ───────────────────────────────────────────────── */
.hero-actions,
.download-card {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-actions {
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.85rem;
  padding: 0.78rem 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 850;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button.primary {
  background: var(--accent);
  border-color: transparent;
  color: #211208;
}

[data-theme="light"] .button.primary {
  color: #fff;
}

.button.secondary {
  background: rgba(127, 127, 127, 0.12);
  color: var(--text);
}

/* ── Install strip ─────────────────────────────────────────── */
.install-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line);
}

.install-strip a {
  padding: 1.15rem clamp(1rem, 3vw, 2rem);
  color: var(--text);
  text-align: center;
  text-decoration: none;
  border-right: 1px solid var(--line);
  background: var(--install-bg);
}

.install-strip a:last-child {
  border-right: 0;
}

.install-strip a:hover {
  background: var(--install-hover);
}

/* ── Section layout ────────────────────────────────────────── */
.section {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(4rem, 8vw, 7rem) 0;
}

/* ── Metrics intro ─────────────────────────────────────────── */
.intro {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  width: 100%;
  max-width: none;
  padding: 0;
  border-bottom: 1px solid var(--line);
  background: var(--line);
}

.metric {
  padding: 1.25rem clamp(1rem, 3vw, 2rem);
  background: var(--surface-3);
}

.metric strong {
  display: block;
  color: var(--accent-2);
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
}

.metric span {
  display: block;
  max-width: 18rem;
  margin-top: 0.35rem;
  color: var(--muted);
}

/* ── Section heading ───────────────────────────────────────── */
.section-heading {
  max-width: 800px;
  margin-bottom: 2rem;
}

.section-heading p,
.split p,
.download-card p,
.feature-card p,
.gallery-item figcaption,
.faq p {
  color: var(--muted);
}

/* ── Feature grid ──────────────────────────────────────────── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.feature-card,
.download-card,
.gallery-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 300ms ease, border-color 300ms ease;
}

.feature-card:hover,
.download-card:hover,
.gallery-item:hover {
  transform: translateY(-4px);
  border-color: var(--accent-2);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.45);
}

[data-theme="light"] .feature-card:hover,
[data-theme="light"] .download-card:hover,
[data-theme="light"] .gallery-item:hover {
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.15);
}

.feature-card,
.gallery-item {
  overflow: hidden;
}

.feature-card.wide {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
}

.feature-card img {
  width: 100%;
  height: 100%;
  min-height: 270px;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
  transition: transform 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

.feature-card:hover img {
  transform: scale(1.02);
}

.feature-card.wide img {
  border-right: 1px solid var(--line);
  border-bottom: 0;
}

.feature-card div {
  padding: 1.25rem;
}

/* ── Gallery ───────────────────────────────────────────────── */
.gallery {
  padding-top: 0;
}

.gallery-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr;
  gap: 1rem;
}

.gallery-item {
  margin: 0;
  background: var(--surface-2);
}

.gallery-item.large {
  grid-row: span 2;
}

.gallery-item img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
  transition: transform 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-item:hover img {
  transform: scale(1.025);
}

.gallery-item.large img {
  height: 100%;
  min-height: 440px;
}

.gallery-item figcaption {
  padding: 1rem;
  font-size: 0.95rem;
}

/* ── Privacy band ──────────────────────────────────────────── */
.band {
  width: 100%;
  max-width: none;
  margin: 0;
  background: var(--band-bg);
  border-block: 1px solid var(--line);
}

.split {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}

.languages-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.2rem;
}

.lang-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.38rem 0.85rem;
  background: rgba(127, 127, 127, 0.1);
  border: 1px solid var(--line);
  border-radius: 20px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  transition: background 200ms ease, border-color 200ms ease, transform 150ms ease, box-shadow 200ms ease;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
}

.lang-tag:hover {
  background: rgba(255, 142, 48, 0.14);
  border-color: var(--accent-2);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 142, 48, 0.1);
}

/* ── Download grid ─────────────────────────────────────────── */
.download-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.download-card {
  min-height: 260px;
  flex-direction: column;
  align-items: flex-start;
  padding: 1.25rem;
}

.download-card .button {
  margin-top: auto;
}

.download-card.quiet {
  background: var(--surface-2);
}

/* ── Release note + download counters ──────────────────────── */
.release-note {
  margin-top: 1rem;
  color: var(--soft);
  font-size: 0.95rem;
}

.release-note a {
  color: var(--accent-2);
  font-weight: 800;
  text-underline-offset: 0.18em;
}

.release-download-count {
  display: block;
  min-height: 1.35rem;
  color: var(--soft);
  font-size: 0.88rem;
  margin-top: auto;
}

.release-download-count + .button {
  margin-top: 0.5rem;
}


.release-download-number {
  display: inline-block;
  color: var(--accent-2);
  font-size: 1.08em;
  font-weight: 900;
  line-height: 1;
  padding: 0.08rem 0.28rem;
  background: rgba(255, 142, 48, 0.14);
  border: 1px solid rgba(255, 142, 48, 0.28);
  border-radius: 0.35rem;
}

.release-download-count .release-download-number {
  font-size: 1.18em;
}

/* ── FAQ ───────────────────────────────────────────────────── */
.faq {
  padding-top: clamp(3.5rem, 7vw, 5.5rem);
}

details {
  border-top: 1px solid var(--line);
  padding: 1rem 0;
}

details:last-child {
  border-bottom: 1px solid var(--line);
}

summary {
  cursor: pointer;
  font-weight: 850;
}

/* ── Legal pages ───────────────────────────────────────────── */
.legal-page {
  background:
    linear-gradient(180deg, rgba(88, 215, 199, 0.08), transparent 18rem),
    var(--bg);
}

.legal-hero {
  width: min(980px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(4rem, 9vw, 7rem) 0 clamp(2rem, 5vw, 4rem);
}

.legal-hero h1 {
  max-width: 14ch;
  font-size: clamp(2.8rem, 7vw, 5.4rem);
}

.legal-hero p {
  max-width: 68ch;
  color: var(--muted);
  font-size: 1.12rem;
}

.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
  color: var(--soft);
}

.legal-meta span {
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(127, 127, 127, 0.1);
  font-size: 0.9rem;
  font-weight: 700;
}

.legal-layout {
  width: min(980px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 0 0 clamp(4rem, 8vw, 7rem);
  display: grid;
  grid-template-columns: minmax(180px, 0.32fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.legal-toc {
  position: sticky;
  top: 5rem;
  display: grid;
  gap: 0.3rem;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.legal-toc a {
  padding: 0.35rem 0;
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
}

.legal-toc a:hover {
  color: var(--accent-2);
}

.legal-document {
  min-width: 0;
}

.legal-section {
  padding: 1.6rem 0;
  border-top: 1px solid var(--line);
}

.legal-section:last-child {
  border-bottom: 1px solid var(--line);
}

.legal-section h2 {
  font-size: clamp(1.45rem, 3vw, 2rem);
}

.legal-section p,
.legal-section li {
  color: var(--muted);
}

.legal-section a {
  color: var(--accent-2);
  font-weight: 800;
  text-underline-offset: 0.18em;
}

.legal-list {
  display: grid;
  gap: 0.7rem;
  padding-left: 1.2rem;
}

/* ── Footer ────────────────────────────────────────────────── */
.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem clamp(1rem, 4vw, 4rem);
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: var(--footer-bg);
}

/* ── Image Lightbox Modal ──────────────────────────────────── */
.lightbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  opacity: 0;
  transition: opacity 200ms ease;
}

.lightbox-modal.active {
  opacity: 1;
}

.lightbox-modal img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transform: scale(0.95);
  transition: transform 200ms ease;
}

.lightbox-modal.active img {
  transform: scale(1);
}
