/* Styles for the static pages without JS (404.html, privacy/index.html).
   Same look as the landing: black, white, red #e30613, heavy uppercase headings, Inter.
   Sizes of text in rem and media queries in em, as on the landing: a visitor's larger default
   font enlarges the text and switches the layout as zoom would. */

/* Inter: the same four files as the landing (src/index.css). They are hashed Vite assets:
   scripts/prerender.mjs replaces each /assets/<name>.woff2 below with the file of the current build
   (/assets/<name>-<hash>.woff2), so the landing and these pages share one cached copy. The dev
   server serves this file as it is, without the fonts (the system font stands in). */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/inter-cyrillic-400-normal-obahsSVq.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/inter-latin-400-subset-DIlKJTav.woff2') format('woff2');
  unicode-range: U+0020-007E, U+00A0, U+00A9, U+00AB, U+00B0, U+00B7, U+00BB, U+00D7, U+2010-2014, U+2018-201E, U+2022, U+2026, U+2212;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url('/assets/inter-cyrillic-900-normal-CjyCg421.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url('/assets/inter-latin-900-subset-Bhs0PVDU.woff2') format('woff2');
  unicode-range: U+0020-007E, U+00A0, U+00A9, U+00AB, U+00B0, U+00B7, U+00BB, U+00D7, U+2010-2014, U+2018-201E, U+2022, U+2026, U+2212;
}

:root {
  --red: #e30613;
  --black: #000;
  --white: #fff;
  --text: rgba(255, 255, 255, 0.8);
  --muted: rgba(255, 255, 255, 0.6);
  --line: rgba(255, 255, 255, 0.15);
  --line-strong: rgba(255, 255, 255, 0.4);
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* A link that Tab scrolls to the edge of the window keeps its whole focus ring (2px + 4px
     offset) on screen; the headings of the policy add their own margin (.doc-body section) */
  scroll-padding-block: 0.75rem;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--black);
  color: var(--white);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  /* A run longer than its line (only with a very large default font) breaks instead of being cut
     off at the edge of the screen */
  overflow-wrap: break-word;
}

::selection {
  background: var(--red);
  color: var(--white);
}

a {
  color: var(--white);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  transition: color 0.3s ease;
}

/* White text on black; the red is only in the underline (red text on black is 4.3:1) */
a:hover {
  color: var(--white);
  text-decoration-color: var(--red);
  text-decoration-thickness: 2px;
}

a:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 4px;
}

a[href^='mailto:'],
.nowrap {
  white-space: nowrap;
}

/* A very large default font on a phone (a screen narrower than 20em): an address or a compound
   longer than the line breaks instead of widening the page */
@media (max-width: 19.99em) {
  a[href^='mailto:'],
  .nowrap {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

.wrap {
  width: 100%;
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 48em) {
  .wrap {
    padding: 0 32px;
  }
}

@media (min-width: 64em) {
  .wrap {
    padding: 0 64px;
  }
}

/* Header: the height of the landing's header (--nav-h in src/index.css) and, as there, no rule
   under it, so the logo stands in the same place on every page */
.top .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 16px;
  min-height: 4rem;
}

@media (min-width: 48em) {
  .top .wrap {
    min-height: 4.5rem;
  }
}

.logo {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--white);
  text-decoration: none;
}

/* Same vector wordmark as the landing (src/components/Logo.tsx) */
.logo-mark {
  display: block;
  height: 24px;
  width: auto;
}

@media (min-width: 48em) {
  .logo-mark {
    height: 28px;
  }
}

.top-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  text-decoration: none;
}

.top-link:hover {
  color: var(--white);
}

/* Section label: red bar + small caps, as on the landing */
.label {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 24px;
  font-size: 0.875rem;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.label::before {
  content: '';
  flex: none;
  width: 32px;
  height: 3px;
  background: var(--red);
}

.heading {
  margin: 0;
  font-weight: 900;
  /* tracking as the landing's titles (−0.02em); a line height of 1.1 keeps the breve of Й clear
     of the tail of Ц / Д in the line above */
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-transform: uppercase;
  overflow-wrap: break-word;
}

main {
  flex: 1;
}

/* Footer: the requisites line of the landing's footer (src/sections/Footer.tsx), the same text
   (scripts/prerender.mjs writes it from src/lib/company.ts), and one more item beside it */
.bottom {
  border-top: 1px solid var(--line);
  padding: 32px 0;
  font-size: 0.875rem;
  line-height: 1.625;
  color: var(--muted);
}

.bottom .wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (min-width: 64em) {
  .bottom .wrap {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 32px;
  }

  .bottom .wrap > :last-child {
    flex: none;
  }
}

.bottom p {
  margin: 0;
}

.bottom a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
}

.bottom a:hover {
  color: var(--white);
}

/* ---------- 404 ---------- */
.nf {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 64px 0 96px;
}

.nf-code {
  margin: 0 0 16px;
  font-size: clamp(6rem, 28vw, 16rem);
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 0.8;
}

.nf-code span {
  color: var(--red);
}

.nf .heading {
  font-size: clamp(2.25rem, 7vw, 4.5rem);
  margin-bottom: 24px;
}

.nf-text {
  max-width: 36rem;
  margin: 0 0 40px;
  font-size: 1.125rem;
  color: var(--text);
}

.nf-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 32px;
}

.nf-actions a:not(.button) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* The landing's outline button (buttonClass('outline') in src/lib/buttons.ts): 56px high, heavy
   uppercase label, a grey rule that turns into a white fill on hover */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 3.5rem;
  padding: 0 1.75rem;
  border: 1px solid var(--line-strong);
  font-size: 0.875rem;
  font-weight: 900;
  line-height: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.button:hover {
  border-color: var(--white);
  background: var(--white);
  color: var(--black);
}

.shape {
  position: absolute;
  pointer-events: none;
}

.shape-red {
  top: 12%;
  right: 6%;
  width: clamp(56px, 12vw, 160px);
  aspect-ratio: 1;
  background: var(--red);
  transform: rotate(12deg);
}

.shape-outline {
  bottom: 10%;
  right: 18%;
  width: clamp(48px, 9vw, 128px);
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.shape-line {
  top: 55%;
  right: 3%;
  width: clamp(64px, 14vw, 200px);
  height: 2px;
  background: rgba(255, 255, 255, 0.5);
}

@media (max-width: 47.99em) {
  .shape-outline {
    display: none;
  }
}

/* The line sits at the height of the heading: only where the heading ends well before it */
@media (max-width: 79.99em) {
  .shape-line {
    display: none;
  }
}

/* ---------- Privacy policy ---------- */
.doc-head {
  position: relative;
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--line);
}

.doc-head .heading {
  max-width: 60rem;
  font-size: clamp(2rem, 6vw, 4.5rem);
}

.doc-meta {
  margin: 24px 0 0;
  color: var(--muted);
}

/* One column that never grows past the screen: a long word of a heading (a large default font on
   a phone) breaks inside it instead of widening the page */
.doc {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 48px;
  padding-top: 48px;
  padding-bottom: 80px;
}

@media (min-width: 64em) {
  .doc {
    grid-template-columns: 16rem minmax(0, 1fr);
    gap: 64px;
  }

  .toc {
    position: sticky;
    top: 32px;
    align-self: start;
  }
}

.toc {
  font-size: 0.875rem;
  line-height: 1.5;
}

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
  display: grid;
  gap: 4px;
}

.toc li {
  counter-increment: toc;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

/* The numbers in the tone of the items: red 14px text on black is 4.3:1, below the 4.5:1 of small
   text. Red stays in the numbers of the section headings, which are large. */
.toc li::before {
  content: counter(toc) '.';
  flex: none;
  min-width: 1.75em;
  color: var(--muted);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.toc a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  color: var(--muted);
  text-decoration: none;
  overflow-wrap: anywhere;
}

/* Touch screens: every item of the contents is a 44px target */
@media (pointer: coarse) {
  .toc ol {
    gap: 0;
  }

  .toc a {
    min-height: 44px;
  }
}

.toc a:hover {
  color: var(--white);
  text-decoration: underline;
}

.doc-body {
  max-width: 46rem;
  color: var(--text);
}

.doc-body section {
  /* with the 0.75rem of scroll-padding (html): a heading reached from the contents lands 24px
     below the top of the window */
  scroll-margin-top: 0.75rem;
}

.doc-body section + section {
  margin-top: 48px;
  padding-top: 48px;
  border-top: 1px solid var(--line);
}

.doc-body h2 {
  margin: 0 0 20px;
  color: var(--white);
  font-size: clamp(1.375rem, 3vw, 1.875rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-transform: uppercase;
}

/* A word wider than the column (only with a very large default font) breaks inside the heading */
.doc-body h2,
.doc-body h3 {
  overflow-wrap: anywhere;
}

.doc-body h2 span {
  color: var(--red);
}

.doc-body h3 {
  margin: 32px 0 12px;
  color: var(--white);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.35;
}

.doc-body p,
.doc-body ul,
.doc-body dl {
  margin: 0 0 16px;
}

.doc-body ul {
  padding-left: 0;
  list-style: none;
}

.doc-body li {
  position: relative;
  padding-left: 24px;
}

.doc-body li + li {
  margin-top: 8px;
}

.doc-body li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 7px;
  height: 7px;
  background: var(--red);
  transform: rotate(45deg);
}

.doc-body strong {
  color: var(--white);
  font-weight: 600;
}

.facts {
  display: grid;
  gap: 4px 24px;
  padding: 20px;
  border: 1px solid var(--line);
}

@media (min-width: 40em) {
  .facts {
    grid-template-columns: 11rem minmax(0, 1fr);
  }
}

.facts dt {
  color: var(--muted);
  font-size: 0.875rem;
}

.facts dd {
  margin: 0 0 8px;
  color: var(--white);
  overflow-wrap: anywhere;
}

/* The e-mail in the requisites: a target as tall as its line (no change in the layout) */
.facts a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
}

@media (min-width: 40em) {
  .facts dd {
    margin-bottom: 4px;
  }
}

.purpose {
  margin: 0 0 24px;
  padding: 20px;
  border: 1px solid var(--line);
}

.purpose h3 {
  margin-top: 0;
}

.purpose dl {
  margin: 0;
}

.purpose dt {
  margin-top: 12px;
  color: var(--white);
  font-weight: 600;
}

.purpose dt:first-child {
  margin-top: 0;
}

.purpose dd {
  margin: 4px 0 0;
}

@media print {
  body {
    background: #fff;
    color: #000;
  }

  .top,
  .toc,
  .shape {
    display: none;
  }

  .doc-body,
  .doc-body h2,
  .doc-body h3,
  .doc-body strong,
  .facts dd,
  .purpose dt,
  a {
    color: #000;
  }
}
