/* The landing (index.html): one screen over the app's home-screen noise. The
 * policy pages keep style.css and legal.css; nothing here is shared with them
 * except the language switch's markup, which legal.js drives on every page. */

@font-face {
  font-family: "R3al Roboto";
  src: url("fonts/roboto-400.woff2?v=2026-10-08b") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "R3al Roboto";
  src: url("fonts/roboto-500.woff2?v=2026-10-08b") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  /* The darkest colour of the noise's scale under the home screen's 15 % veil:
   * what the noise looks like under the text, so the page reads the same before
   * the first frame, without WebGL and without JavaScript. */
  --navy: #070425;
  /* The colour of the name in the app. */
  --ink: #f6f7fe;
  /* Small text. The shader keeps the noise under the text no brighter than
   * #3d4156, where this has 6.4:1 (5.6:1 on the checksum block's panel). */
  --ink-2: rgba(246, 247, 254, .78);
  /* The app's main button: white, with Tokens.onLight for its text. */
  --on-white: #111113;
  /* Tokens.control, the translucent pill the app floats over the picture, a
   * little darker: at the app's 55 % the label over a white blob had 4.6:1. */
  --control: rgba(28, 28, 31, .62);
  --font: "R3al Roboto", Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Roboto Mono", "Liberation Mono", monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--navy);
}

body {
  margin: 0;
  color: var(--ink);
  font: 400 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* A visitor whose saved language is Russian gets it before the first paint: the
 * inline script in <head> sets lang, and these two rules show the Russian lines
 * that still carry `hidden` until legal.js runs. Every [data-lang] on this page
 * is a span, so inline is the display they would have anyway. */
html[lang="ru"] [data-lang="en"] { display: none; }
html[lang="ru"] [data-lang="ru"] { display: inline; }

::selection { background: var(--ink); color: var(--navy); }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ── the screen ─────────────────────────────────────────────── */

/* Clipped, because the blurred veils of the page without WebGL spill past the
 * window's edges and would otherwise make it scroll sideways. */
.stage {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  overflow: clip;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0)
           env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
}

/* Drawn at half the screen's pixels and stretched, like HeaderNoise.kt. It is
 * as tall as the page, so text that the open checksum block pushes down stays
 * over noise, and fades in over the plain navy once the first frame is drawn. */
.noise {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity .7s ease-out;
}
.noise.on { opacity: 1; }

/* ── language ───────────────────────────────────────────────── */

.top {
  display: flex;
  justify-content: flex-end;
  padding: 16px 16px 0;
}

.lang {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--control);
}

.lang-btn {
  min-width: 46px;
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: 500 13px/1 var(--font);
  letter-spacing: .02em;
  cursor: pointer;
}

/* The chosen one follows <html lang>, which the inline script sets before the
 * first paint; aria-pressed, which legal.js keeps, would arrive a moment later. */
html:not([lang="ru"]) .lang-btn[data-lang-btn="en"],
html[lang="ru"] .lang-btn[data-lang-btn="ru"] {
  background: #fff;
  color: var(--on-white);
}

/* ── name, line, button ─────────────────────────────────────── */

/* Vertical sizes follow the window's height as well, so a small or a landscape
 * phone keeps the whole column on one screen or close to it. The first value of
 * each pair is for browsers without svh. */
.hero {
  --name: clamp(48px, 19vw, 150px);
  align-self: center;
  justify-self: center;
  width: min(100% - 32px, 40rem);
  padding: 40px 0 48px;
  padding: clamp(16px, 5svh, 40px) 0 clamp(20px, 6svh, 48px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
@supports (height: 1svh) {
  .hero { --name: clamp(48px, min(19vw, 25svh), 150px); }
}

.name {
  margin: 0;
  font-weight: 400;
  font-size: var(--name);
  line-height: .92;
  letter-spacing: -.02em;
}

/* The line keeps its proportion to the name, within what still reads as a line. */
.line {
  margin: .5em 0 0;
  max-width: 21em;
  font-size: clamp(19px, var(--name) * .135, 28px);
  line-height: 1.3;
  text-wrap: balance;
}

.get {
  margin-top: 44px;
  margin-top: clamp(24px, 5.2svh, 44px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 30px;
  border-radius: 26px;
  background: #fff;
  color: var(--on-white);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.2;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .15s;
}
.get:hover { background: #e9e9e9; }
.get:active { background: #d8d8d8; }
.get:focus-visible { outline-offset: 4px; }

.meta, .note {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-2);
}
.meta {
  margin-top: 16px;
  font-variant-numeric: tabular-nums;
}
.note {
  margin-top: 2px;
  text-wrap: balance;
}

/* ── checksums ──────────────────────────────────────────────── */

.verify {
  margin-top: 26px;
  margin-top: clamp(14px, 3svh, 26px);
  width: 100%;
}

.verify summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink);
  list-style: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.verify summary::-webkit-details-marker { display: none; }
.verify summary::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}
.verify[open] summary::after { transform: translateY(1px) rotate(-135deg); }

/* Two commands, each followed by the line it prints for the right file. */
.term {
  margin: 12px 0 0;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .05);
  text-align: left;
  font: 12px/1.6 var(--mono);
  color: var(--ink-2);
}
.term p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.term code, .term samp { font: inherit; }
.term .out + .cmd { margin-top: 10px; }
/* The prompt marks a command and stays behind when it is copied. */
.term .cmd::before {
  content: "$ ";
  user-select: none;
  -webkit-user-select: none;
}
.term .hash {
  color: var(--ink);
  user-select: all;
  -webkit-user-select: all;
}

/* ── footer ─────────────────────────────────────────────────── */

.foot {
  padding: 0 16px 20px;
  text-align: center;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-2);
}

.links {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}
/* The dot is silent for a screen reader: the list already says where one item ends. */
.links li + li::before {
  content: "·";
  content: "·" / "";
  margin: 0 .6em;
}
.links a {
  display: inline-block;
  padding: 3px 0;
  color: inherit;
  text-decoration: none;
}
.links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

.by { margin: 2px 0 0; }

/* On a phone the row wraps, and a wrapped row must not start with a dot: there
 * the items are set apart by space alone. */
@media (max-width: 559px) {
  .links { column-gap: 18px; }
  .links li + li::before { content: none; }
}

/* Next to a name 200 px tall the phone's 13 px reads as a footnote. */
@media (min-width: 900px) {
  .meta, .note, .verify summary { font-size: 14px; }
  .term { font-size: 13px; }
  .foot { font-size: 13px; }
}

/* ── without WebGL ──────────────────────────────────────────── */

/* landing.js sets .no-gl when there is no WebGL2: a still frame of the same
 * noise instead, and a soft navy veil behind the text instead of the shader's. */
.no-gl .noise { display: none; }
.no-gl .stage {
  background: var(--navy) url("noise.jpg?v=2026-10-08b") 50% 30% / cover no-repeat;
}
.no-gl .hero, .no-gl .foot { position: relative; }
.no-gl .hero::before, .no-gl .foot::before {
  content: "";
  position: absolute;
  inset: -20px -28px;
  z-index: -1;
  border-radius: 48px;
  background: rgba(7, 4, 37, .86);
  filter: blur(24px);
}
/* The footer spans the window; its veil only the width of its lines. */
.no-gl .foot::before {
  inset: -12px auto -4px 50%;
  width: min(100% + 32px, 46rem);
  transform: translateX(-50%);
}

@media (prefers-reduced-motion: reduce) {
  .noise, .get { transition: none; }
}

/* The page offers Google Play, and /download (html.apk) offers the APK with its checksums. */
html:not(.apk) .apk-only { display: none !important; }
html.apk .play-only { display: none !important; }
