/* Self-hosted Latin subsets (tools/make-fonts.sh), SIL OFL 1.1 — see /assets/fonts/OFL-*.txt */
@font-face { font-family: "Poppins"; font-weight: 400; font-display: swap; src: url(/assets/fonts/poppins-400.8a93250f6b.woff2) format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-display: swap; src: url(/assets/fonts/poppins-500.f3a0ec6b1b.woff2) format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 600; font-display: swap; src: url(/assets/fonts/poppins-600.463bc2e361.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-display: swap; src: url(/assets/fonts/jetbrains-mono-400.acdc8a04eb.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 500; font-display: swap; src: url(/assets/fonts/jetbrains-mono-500.7f878bec45.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 600; font-display: swap; src: url(/assets/fonts/jetbrains-mono-600.02ae979a5b.woff2) format("woff2"); }

:root {
  /* Black Cherry palette, verbatim from rtp/frontend/src/styles/themes/blackcherry/theme.js */
  --palette-bg: #0C0C0E;
  --palette-bg-deep: #08080A;
  --palette-surface: #161618;
  --palette-surface-active: #1E1E22;
  --palette-surface-hover: #1F1F23;
  --palette-control: #2A2A2E;
  --palette-muted: #6B6B70;
  --palette-text: #ECECEC;
  --palette-accent: #DC143C;
  --palette-accent-2: #FF4D4F;
  --palette-info: #FFA940;
  --success-color: #00d1b2;
  --error-color: #e63946;
  --warning-color: #ffa940;
  --hl-gradient: linear-gradient(0deg, var(--palette-accent), var(--palette-accent-2));
  --cherry-tint: #2A1215;          /* --nav-item-selected-bg */
  --cherry-tint-hover: #3D151A;    /* --menu-item-hover-bg */
  --chart-grid: #1B1B1E;

  /* Web additions: two readable greys between text and muted (AA on every surface) */
  --text: var(--palette-text);
  --text-2: #A6A6AC;
  --text-3: #8A8A90;
  --text-dim: var(--palette-muted);
  --border: var(--palette-surface-hover);
  --border-strong: var(--palette-control);
  --hairline: rgb(255 255 255 / 6%);

  --font: "Poppins", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --wrap: 1160px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--palette-bg);
  color: var(--text);
  font: 400 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 600; }
.i { width: 1em; height: 1em; flex: none; display: block; }
.wrap { width: min(var(--wrap), 100% - 48px); margin-inline: auto; }
.mono { font-family: var(--mono); }

/* ---------- shared controls ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 48px; padding: 0 22px;
  border-radius: 4px;
  background: var(--palette-accent);
  color: #fff;
  font: 600 15px/1 var(--font);
  box-shadow: 0 10px 28px -10px rgb(220 20 60 / 70%), inset 0 1px 0 rgb(255 255 255 / 14%);
  transition: background .15s;
  white-space: nowrap;
}
.btn:hover { background: var(--hl-gradient); }
.btn .i { width: 20px; height: 20px; }
.btn.sm { height: 38px; padding: 0 16px; font-size: 14px; gap: 8px; box-shadow: none; }
.btn.sm .i { width: 18px; height: 18px; }

/* el-icon-label pattern: icon + label, dim until hovered */
.il {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 10px; margin: -8px -10px;
  border-radius: 4px;
  color: var(--text-2);
  font: 500 14px/1.2 var(--font);
  white-space: nowrap;
  transition: color .15s, background .15s;
}
.il:hover { color: var(--text); background: var(--palette-surface-active); }
.il .i { width: 18px; height: 18px; }
.il.strong { color: var(--text); }

.badge {
  display: inline-flex; align-items: center;
  height: 22px; padding: 0 8px;
  border-radius: 4px;
  background: var(--cherry-tint);
  color: var(--palette-accent-2);
  font: 600 12px/1 var(--font);
  white-space: nowrap;
}
.badge.neutral { background: var(--palette-surface-active); color: var(--text-2); font-family: var(--mono); font-weight: 500; }

.eyebrow {
  display: flex; align-items: center; gap: 10px;
  color: var(--palette-accent-2);
  font: 500 14px/1 var(--font);
  margin-bottom: 18px;
}
.eyebrow::before { content: ""; width: 20px; height: 2px; border-radius: 1px; background: var(--hl-gradient); }
.h2 { font-size: 38px; line-height: 1.15; letter-spacing: -0.02em; }
.lead { color: var(--text-2); font-size: 17px; line-height: 1.65; margin-top: 16px; max-width: 620px; }

.card {
  background: var(--palette-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.ico {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 6px;
  background: var(--cherry-tint);
  color: var(--palette-accent-2);
}
.ico .i { width: 22px; height: 22px; }

/* ---------- header ---------- */
.top {
  position: relative;
  background: linear-gradient(180deg, #17060A 0%, #0C0C0E 100%);
  overflow: hidden;
}
.top::before {               /* chart-paper grid, fading out */
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgb(255 255 255 / 3.5%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 3.5%) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 72% 45%, #000 20%, transparent 75%);
          mask-image: radial-gradient(ellipse 60% 70% at 72% 45%, #000 20%, transparent 75%);
  pointer-events: none;
}
.top::after {                /* cherry glow behind the product visual */
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(560px 380px at 74% 52%, rgb(220 20 60 / 20%), transparent 70%);
  pointer-events: none;
}
header {
  position: relative; z-index: 2;
  border-bottom: 1px solid var(--hairline);
}
header .wrap { display: flex; align-items: center; height: 72px; gap: 40px; }
.brand { display: flex; align-items: center; gap: 10px; font: 600 15px/1 var(--font); letter-spacing: -0.01em; }
.brand img { height: 40px; width: auto; margin: 0 -10px 0 -14px; }
nav { display: flex; gap: 28px; font-size: 14px; color: var(--text-2); }
nav a:hover { color: var(--text); }
header .actions { margin-left: auto; display: flex; align-items: center; gap: 22px; }

/* ---------- hero ---------- */
.hero { position: relative; z-index: 1; padding: 76px 0 104px; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 64px; align-items: center; }
.hero-kicker { display: flex; align-items: center; gap: 12px; color: var(--text-2); font-size: 14px; }
.hero h1 {
  margin: 22px 0 0;
  font-size: 54px; line-height: 1.08; letter-spacing: -0.03em;
}
.grad {
  background: linear-gradient(180deg, var(--palette-accent-2) 15%, var(--palette-accent) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .lead { font-size: 18px; margin-top: 22px; max-width: 520px; }
.cta { display: flex; align-items: center; gap: 28px; margin-top: 36px; flex-wrap: wrap; }
.cta-meta { margin-top: 18px; color: var(--text-3); font: 400 12.5px/1.5 var(--mono); }

.visual { position: relative; }
.frame {
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  overflow: hidden;
  background: var(--palette-bg);
  box-shadow: 0 40px 90px -20px rgb(0 0 0 / 75%), 0 0 0 1px rgb(255 255 255 / 2%);
}
.frame-bar {
  display: flex; align-items: center; gap: 10px;
  height: 44px; padding: 0 14px;
  background: var(--palette-surface);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.frame-bar .sym { font-weight: 600; }
.frame-bar .tf { font: 500 11px/1 var(--mono); color: var(--text-2); background: var(--palette-surface-active); padding: 4px 6px; border-radius: 4px; }
.frame-bar .sep { width: 1px; height: 16px; background: var(--palette-control); }
.frame-bar .trig { color: var(--text-2); }
.frame-bar .state { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 12px; }
.frame-bar .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success-color); box-shadow: 0 0 0 3px rgb(0 209 178 / 15%); }
.chart { display: block; width: 100%; height: auto; }

.toast {
  position: absolute; left: -44px; bottom: -40px;
  width: 360px;
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px;
  background: var(--palette-surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  box-shadow: 0 22px 48px -12px rgb(0 0 0 / 80%);
}
.toast .ico { width: 34px; height: 34px; }
.toast .ico .i { width: 18px; height: 18px; }
.toast-body { flex: 1; min-width: 0; }
.toast-title { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.toast-title span { color: var(--text-3); font-weight: 400; font-size: 12px; }
.toast-sub { margin-top: 4px; color: var(--text-2); font: 400 12px/1.45 var(--mono); white-space: nowrap; }

/* ---------- sections ---------- */
section { padding: 96px 0; }
.section-head { margin-bottom: 48px; }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.step { padding: 24px 24px 28px; }
.step .illo { display: block; width: 100%; height: auto; margin-bottom: 22px; border-radius: 6px; background: var(--palette-bg); border: 1px solid var(--border); }
.step-num { font: 600 13px/1 var(--mono); color: var(--palette-accent-2); }
.step h3 { font-size: 19px; line-height: 1.3; margin-top: 10px; letter-spacing: -0.01em; }
.step p { color: var(--text-2); font-size: 15px; margin-top: 10px; }

.features { border-top: 1px solid var(--hairline); }
.feature-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.feature { padding: 26px 24px 28px; }
.feature h3 { font-size: 16.5px; margin-top: 20px; }
.feature p { color: var(--text-2); font-size: 14.5px; margin-top: 8px; line-height: 1.6; }

/* ---------- download ---------- */
.download {
  position: relative;
  background: var(--palette-bg-deep);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  overflow: hidden;
}
.download::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(700px 300px at 50% 0%, rgb(220 20 60 / 12%), transparent 70%);
  pointer-events: none;
}
.download .wrap { position: relative; }
.dl-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 44px; flex-wrap: wrap; }
.release { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; color: var(--text-3); font-size: 14px; white-space: nowrap; }
.dl-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 20px; }
.dl-card { padding: 28px; }
.dl-card-head { display: flex; gap: 16px; align-items: flex-start; }
.dl-card-head h3 { font-size: 19px; line-height: 1.3; }
.dl-card-head p { color: var(--text-2); font-size: 14.5px; margin-top: 4px; }

.os-list { margin-top: 24px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.os-tile {
  display: flex; flex-direction: column; gap: 20px;
  padding: 18px;
  border-radius: 6px;
  background: var(--palette-bg);
  border: 1px solid var(--border);
}
.os-top { display: flex; gap: 14px; align-items: center; }
.os-ico { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 6px; background: var(--palette-surface-active); color: var(--text); }
.os-ico .i { width: 24px; height: 24px; }
.os-name { display: flex; align-items: center; gap: 10px; font-size: 15.5px; font-weight: 600; line-height: 1.3; }
.os-meta { color: var(--text-3); font: 400 12.5px/1.5 var(--mono); margin-top: 2px; }
.os-action { margin-top: auto; display: flex; align-items: center; min-height: 38px; }
.os-tile .yours, .os-tile .btn { display: none; }
.os-tile.is-yours { background: color-mix(in srgb, var(--palette-accent) 7%, var(--palette-bg)); border-color: color-mix(in srgb, var(--palette-accent) 30%, transparent); }
.os-tile.is-yours .yours, .os-tile.is-yours .btn { display: inline-flex; }
.os-tile.is-yours .il { display: none; }

.os-note { display: flex; gap: 8px; align-items: flex-start; color: var(--text-2); font-size: 12.5px; line-height: 1.5; }
.os-note .i { width: 16px; height: 16px; margin-top: 1px; color: var(--warning-color, #ffa940); }

.apk { display: flex; gap: 20px; align-items: center; margin-top: 22px; }
.qr-tile { flex: none; width: 112px; height: 112px; padding: 4px; border-radius: 6px; background: #ECECEC; }
.qr-tile .qr { display: block; width: 100%; height: 100%; }
.apk-hint { color: var(--text-2); font-size: 14px; line-height: 1.5; }
.apk .dl-actions { margin-top: 14px; }
.dl-card[data-os] .btn, .dl-card[data-os] .fdroid-link { display: none; }
.dl-card.is-yours .btn, .dl-card.is-yours .fdroid-link { display: inline-flex; }
.dl-card.is-yours .apk-link, .dl-card.is-yours .qr-tile, .dl-card.is-yours .apk-hint { display: none; }
.dl-card.is-yours .apk .dl-actions { margin-top: 0; }
.code .copy.done { color: var(--success-color); }

.dl-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 28px; margin-top: 22px; }
.field-label { color: var(--text-3); font-size: 13px; margin: 20px 0 8px; }
.code {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px 11px 14px;
  background: var(--palette-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font: 400 12.5px/1.5 var(--mono);
  color: var(--text);
  min-width: 0;
}
.code span { white-space: normal; overflow-wrap: anywhere; }
.code .copy { margin-left: auto; display: grid; place-items: center; padding: 4px; border: 0; border-radius: 4px; background: none; color: var(--text-3); cursor: pointer; flex: none; }
.code .copy:hover { color: var(--text); background: var(--palette-surface-active); }
.code .copy .i { width: 16px; height: 16px; }
.fineprint { color: var(--text-3); font-size: 12.5px; margin-top: 10px; }

.after {
  margin-top: 20px; padding: 22px 28px;
  display: grid; grid-template-columns: auto repeat(3, minmax(0, 1fr)); gap: 28px; align-items: center;
}
.after-title { font-weight: 600; font-size: 15px; padding-right: 8px; }
.after-step { display: flex; align-items: center; gap: 12px; color: var(--text-2); font-size: 14px; line-height: 1.4; }
.after-step b {
  flex: none; display: grid; place-items: center;
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--palette-control);
  color: var(--text); font: 600 12px/1 var(--mono);
}

/* ---------- footer ---------- */
footer { padding: 64px 0 40px; }
.foot { display: grid; grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr)); gap: 40px; }
.foot .brand { margin-bottom: 14px; }
.foot p { color: var(--text-3); font-size: 14px; max-width: 320px; }
.foot h4 { margin: 6px 0 14px; font-size: 13px; font-weight: 600; color: var(--text); }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 14px; color: var(--text-2); }
.foot ul a:hover { color: var(--text); }
.legal { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--hairline); display: flex; justify-content: space-between; gap: 40px; color: var(--text-3); font-size: 12.5px; line-height: 1.6; }
.legal p { max-width: 760px; }

/* ---------- 404 ---------- */
.hero.notfound { padding: 112px 0 140px; }
.hero.notfound .wrap { grid-template-columns: minmax(0, 1fr); }

/* ---------- a11y ---------- */
a:focus-visible, button:focus-visible { outline: 2px solid var(--palette-accent-2); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .os-list { grid-template-columns: minmax(0, 1fr); }
  .os-tile { flex-direction: row; align-items: center; flex-wrap: wrap; }
  .os-action { margin: 0 0 0 auto; }
  .os-note { order: 3; flex-basis: 100%; }
  .hero .wrap { grid-template-columns: minmax(0, 1fr); gap: 56px; }
  .hero .lead { max-width: 640px; }
  .toast { position: relative; left: auto; bottom: auto; margin: -26px 0 0 16px; }
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dl-pair { grid-template-columns: minmax(0, 1fr); }
  .after { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .foot { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 680px) {
  .wrap { width: calc(100% - 40px); }
  header .wrap { height: 64px; }
  nav { display: none; }
  .hero { padding: 44px 0 84px; }
  .hero .lead { font-size: 16.5px; }
  .cta { gap: 22px; margin-top: 30px; }
  .btn { width: 100%; justify-content: center; }
  .btn.sm { width: auto; }
  .toast { width: auto; margin: -22px 12px 0; }
  section { padding: 76px 0; }
  .h2 { font-size: 29px; }
  .section-head { margin-bottom: 36px; }
  .steps, .feature-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .dl-card { padding: 22px 18px; }
  .hero h1 { font-size: 36px; }
  .frame-bar .sep, .frame-bar .trig { display: none; }
  .feature { display: flex; gap: 16px; padding: 20px 18px; }
  .feature h3 { margin-top: 2px; }
  .os-tile .lbl, .os-tile.is-yours .btn span { display: none; }
  .os-tile .il { margin: 0; padding: 10px; }
  .os-list { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .os-tile { flex-wrap: wrap; }
  .os-note { order: 3; flex-basis: 100%; }
  .qr-tile, .apk-hint { display: none; }
  .apk { margin-top: 18px; }
  .apk .dl-actions { margin-top: 0; }
  .os-tile { flex-direction: row; align-items: center; gap: 12px; padding: 12px 14px; }
  .os-ico { width: 40px; height: 40px; }
  .os-action { margin: 0 0 0 auto; }
  .foot { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .legal { flex-direction: column; gap: 14px; }
}
