/*
 * Altis APK download page. Colours and type of Altis Player (VIDAA tokens, Inter + DM Sans).
 * Read from a sofa on a TV browser: sizes in rem, the root size grows with the window (720p, 1080p, 4K),
 * every link and step is reachable with the arrow keys and shows a white focus ring.
 * Kept to CSS that old Chromium WebViews understand (no gap on flex, no clamp(), no :focus-visible).
 */

@font-face {
  font-family: 'DM Sans';
  src: url('fonts/dm-sans-latin-wght.woff2') format('woff2');
  font-weight: 100 1000;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('fonts/inter-latin-wght.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #050608;
  --bg-night: #070b16;
  --surface: #0e121b;
  --surface-2: #151a26;
  --text: #f4f5f8;
  --text-2: #c7ccd8;
  --muted: #9aa3b5;
  --accent: #7b8cff;
  --accent-2: #a274ff;
  --warning: #f3b64c;
  --line: rgba(255, 255, 255, 0.12);
  --display: 'DM Sans', 'Inter', 'Roboto', Arial, sans-serif;
  --ring: 0 0 0 0.1875rem var(--bg), 0 0 0 0.4375rem #fff;
}

* { box-sizing: border-box; }

/* 1 rem: 16 px on phones and 720p windows, then larger with the window (1080p, 1440p, 4K). */
html { font-size: 16px; background: var(--bg); }
@media (min-width: 1500px) { html { font-size: 20px; } }
@media (min-width: 2200px) { html { font-size: 26px; } }
@media (min-width: 3000px) { html { font-size: 34px; } }

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image: radial-gradient(ellipse at 50% -10%, rgba(123, 140, 255, 0.16) 0%, rgba(162, 116, 255, 0.06) 38%, rgba(5, 6, 8, 0) 70%),
    linear-gradient(180deg, var(--bg-night) 0%, var(--bg) 60%);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: 'Inter', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

a { color: inherit; }
code { font-family: 'Roboto Mono', 'DejaVu Sans Mono', Menlo, Consolas, monospace; }

/* ---------- Header ---------- */
.masthead { text-align: center; padding: 3rem 1rem 2rem; }
.logo { display: block; width: 15rem; max-width: 70%; height: auto; margin: 0 auto 1.25rem; }
.eyebrow {
  margin: 0 0 0.5rem;
  font-family: var(--display);
  font-size: 0.9375rem;
  font-weight: 650;
  letter-spacing: 0.24em;
  color: var(--accent);
}
h1 {
  margin: 0 auto;
  max-width: 40rem;
  font-family: var(--display);
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

main { display: block; width: 100%; max-width: 64rem; margin: 0 auto; padding: 0 1rem; }

/* ---------- Release cards: side by side on wide windows, stacked on narrow ones ---------- */
.releases { display: flex; flex-wrap: wrap; margin: 0 -0.75rem; }
.release {
  position: relative;
  flex: 1 1 22rem;
  display: flex;
  flex-direction: column;
  margin: 0.75rem;
  padding: 1.75rem 1.75rem 1.5rem;
  border-radius: 1rem;
  background: linear-gradient(180deg, rgba(21, 26, 38, 0.95) 0%, rgba(14, 18, 27, 0.95) 100%);
  border: 0.0625rem solid var(--line);
  min-width: 0;
}
.release-stable { border-color: rgba(123, 140, 255, 0.45); box-shadow: 0 1.25rem 3rem rgba(0, 0, 0, 0.45), 0 0 2.5rem rgba(123, 140, 255, 0.10); }
.badge {
  align-self: flex-start;
  margin-bottom: 1rem;
  padding: 0.25rem 0.75rem;
  border-radius: 62.4375rem;
  font-family: var(--display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}
.badge-stable { background: linear-gradient(90deg, var(--accent), var(--accent-2)); color: #07091a; }
.badge-beta { background: rgba(243, 182, 76, 0.14); color: var(--warning); border: 0.0625rem solid rgba(243, 182, 76, 0.45); }
.release h2 { margin: 0 0 0.375rem; font-family: var(--display); font-size: 1.625rem; font-weight: 700; line-height: 1.2; }
.facts { margin: 0 0 0.75rem; color: var(--text-2); font-size: 1rem; }
.facts strong { color: var(--text); font-weight: 600; }
.text { margin: 0 0 1.5rem; color: var(--text-2); flex: 1 0 auto; }
.warn { color: var(--warning); font-weight: 600; }

/* ---------- Buttons: real links, large, white ring on focus ---------- */
.button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.75rem;
  padding: 0.875rem 1.5rem;
  border-radius: 0.75rem;
  font-family: var(--display);
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}
.button .icon {
  width: 1.375rem;
  height: 1.375rem;
  margin-right: 0.75rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.button-primary { background: linear-gradient(90deg, #6f82ff 0%, #9a6dff 100%); color: #fff; }
.button-secondary { background: rgba(255, 255, 255, 0.10); color: var(--text); border: 0.0625rem solid rgba(255, 255, 255, 0.18); }
.button-ghost { display: inline-flex; background: transparent; color: var(--text); border: 0.0625rem solid var(--line); min-height: 3.25rem; font-size: 1.0625rem; }
.button:hover { transform: translateY(-0.0625rem); }
.button-primary:hover { background: linear-gradient(90deg, #8193ff 0%, #a97fff 100%); }
.button-secondary:hover, .button-ghost:hover { background-color: rgba(255, 255, 255, 0.16); }
.button:focus { box-shadow: var(--ring); transform: scale(1.02); }
.button-secondary:focus, .button-ghost:focus { background-color: #fff; color: #07091a; }

.hash { margin: 1rem 0 0; font-size: 0.8125rem; color: var(--muted); line-height: 1.45; }
.hash span { display: block; font-weight: 600; letter-spacing: 0.08em; }
.hash code, .compat code { font-size: 0.8125rem; color: var(--text-2); word-break: break-all; }

/* ---------- Update rules ---------- */
.updates {
  margin: 1.5rem 0 0;
  padding: 1.25rem 1.5rem;
  border-radius: 1rem;
  border: 0.0625rem solid var(--line);
  background: rgba(14, 18, 27, 0.6);
  color: var(--text-2);
}
.updates p { margin: 0; }
.updates p + p { margin-top: 0.75rem; }
.updates strong { color: var(--text); }

.jump { text-align: center; margin: 2rem 0; }

/* ---------- Install guide ---------- */
.guide { padding-top: 1rem; outline: none; }
.guide h2 { margin: 0 0 0.5rem; font-family: var(--display); font-size: 1.875rem; font-weight: 700; text-align: center; }
.lead { margin: 0 auto 1.5rem; max-width: 40rem; text-align: center; color: var(--text-2); }

.step {
  margin: 0 0 1rem;
  border-radius: 1rem;
  background: rgba(14, 18, 27, 0.85);
  border: 0.0625rem solid var(--line);
}
.step summary {
  display: flex;
  align-items: center;
  min-height: 4rem;
  padding: 0.875rem 1.25rem;
  border-radius: 1rem;
  font-family: var(--display);
  font-size: 1.3125rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.step summary::-webkit-details-marker { display: none; }
.step summary::after {
  content: '';
  margin-left: auto;
  width: 0.625rem;
  height: 0.625rem;
  border-right: 0.1875rem solid var(--muted);
  border-bottom: 0.1875rem solid var(--muted);
  transform: rotate(45deg);
  flex: none;
}
.step[open] summary::after { transform: rotate(225deg); }
.step summary:hover { background: rgba(255, 255, 255, 0.05); }
.step summary:focus { box-shadow: var(--ring); background: rgba(255, 255, 255, 0.08); }
.num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 2.25rem;
  height: 2.25rem;
  margin-right: 1rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #07091a;
  font-size: 1.0625rem;
}
.step ol { margin: 0; padding: 0.25rem 1.5rem 0.5rem 4.75rem; color: var(--text-2); font-size: 1.0625rem; }
.step li { margin: 0 0 0.5rem; padding-left: 0.25rem; }
.step li strong { color: var(--text); font-weight: 600; }
.note { margin: 0 1.5rem 1.25rem 4.75rem; color: var(--muted); font-size: 0.9375rem; }

.compat { margin: 1.5rem 0 0; color: var(--muted); font-size: 0.9375rem; text-align: center; }
.compat + .compat { margin-top: 0.5rem; }
.compat strong { color: var(--text-2); }

.footer {
  margin-top: 3rem;
  padding: 1.5rem 1rem 2.5rem;
  text-align: center;
  color: var(--muted);
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0.12em;
  font-size: 0.875rem;
  border-top: 0.0625rem solid rgba(255, 255, 255, 0.06);
}

/* ---------- TV browser windows (wide and short, such as 960 x 540): the download buttons on the first screen ---------- */
@media (orientation: landscape) and (max-height: 760px) {
  .masthead { padding: 1.5rem 1rem 1rem; }
  .logo { width: 10rem; margin-bottom: 0.75rem; }
  .eyebrow { font-size: 0.8125rem; margin-bottom: 0.25rem; }
  h1 { font-size: 1.75rem; max-width: 48rem; }
  .release { padding: 1.25rem 1.5rem; }
  .badge { margin-bottom: 0.75rem; }
  .facts { margin-bottom: 0.5rem; }
  .text { margin-bottom: 1rem; }
}

/* ---------- Narrow windows (phones) ---------- */
@media (max-width: 600px) {
  .masthead { padding: 2rem 1rem 1.25rem; }
  .logo { width: 11rem; }
  h1 { font-size: 1.75rem; }
  .release { padding: 1.375rem 1.25rem 1.25rem; flex-basis: 100%; }
  .release h2 { font-size: 1.375rem; }
  .button { font-size: 1.0625rem; }
  .step summary { font-size: 1.125rem; padding: 0.75rem 1rem; }
  .num { width: 2rem; height: 2rem; margin-right: 0.75rem; }
  .step ol { padding: 0.25rem 1rem 0.5rem 3rem; }
  .note { margin: 0 1rem 1rem 3rem; }
}

@media (prefers-reduced-motion: reduce) {
  .button { transition: none; }
  .button:hover, .button:focus { transform: none; }
}
