/*
 * The public pages: the landing, /privacy and /terms. The colors are the
 * kit's tokens, see its DESIGN.md: sheets of paper (--surface) on a desk
 * (--background), blue-black ink and pencil graphite, hairline rules, and
 * the highlighter (--marker) where the reader is. The brand is the
 * product's: set it here and in frontend/src/app.css.
 */
@font-face {
  font-family: "Onest";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/fonts/onest-cyrillic-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Onest";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/fonts/onest-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light dark;
  --brand: oklch(0.42 0.14 264);
  --brand-foreground: oklch(0.985 0.006 264);
  --background: oklch(0.962 0.004 255);
  --surface: oklch(1 0 0);
  --text: oklch(0.2 0.02 262);
  --text-muted: oklch(0.48 0.012 255);
  --border: oklch(0.905 0.006 255);
  --border-strong: oklch(0.6 0.012 255);
  --marker: oklch(0.935 0.11 98);
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: oklch(0.78 0.1 264);
    --brand-foreground: oklch(0.2 0.04 264);
    --background: oklch(0.155 0.006 260);
    --surface: oklch(0.195 0.007 260);
    --text: oklch(0.955 0.005 250);
    --text-muted: oklch(0.72 0.01 255);
    --border: oklch(0.285 0.008 260);
    --border-strong: oklch(0.58 0.01 260);
    --marker: oklch(0.43 0.085 85);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  color: var(--text);
  font:
    17px/1.6 Onest,
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--marker);
  color: var(--text);
}

a {
  color: inherit;
  text-underline-offset: 4px;
}

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

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.muted {
  color: var(--text-muted);
}

/* The header: the product's mark and name, and the way in. */
.site-header .bar {
  height: 72px;
}

.product {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-weight: 600;
  text-decoration: none;
}

.mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--brand);
  color: var(--brand-foreground);
  font-size: 15px;
  font-weight: 600;
}

/* Actions: the brand fill for the main one, an outline or a link for the rest. */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--brand);
  color: var(--brand-foreground);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
}

.button:hover {
  background: color-mix(in oklab, var(--brand), var(--text) 12%);
}

.button-secondary {
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--text);
}

.button-secondary:hover {
  background: color-mix(in oklab, var(--surface), var(--text) 5%);
}

.button-small {
  min-height: 36px;
  padding: 0 14px;
  font-size: 15px;
  font-weight: 500;
}

.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
}

.text-link:hover {
  text-decoration-color: currentColor;
}

/* The first screen: the product's name as the page's mark. */
.hero {
  padding-top: 72px;
  padding-bottom: 72px;
}

h1 {
  margin: 0;
  font-size: clamp(3.25rem, 1.5rem + 7vw, 7rem);
  font-weight: 650;
  line-height: 0.95;
  letter-spacing: -0.045em;
}

.lead {
  margin: 28px 0 0;
  max-width: 34ch;
  color: var(--text-muted);
  font-size: clamp(1.1875rem, 1rem + 0.6vw, 1.4375rem);
  line-height: 1.5;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
  margin-top: 36px;
}

/* The app on the desk: a sheet the product replaces with its screenshot. */
.desk {
  padding: 56px 0;
  background: var(--background);
  border-block: 1px solid var(--border);
}

.sheet {
  display: grid;
  grid-template-columns: 200px 1fr;
  margin: 0;
  min-height: 340px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  overflow: hidden;
}

.sheet-sidebar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 14px;
  background: var(--background);
  border-right: 1px solid var(--border);
  font-size: 15px;
}

.sheet-sidebar .product {
  margin: 0 8px 16px;
}

.nav-item {
  margin: 0;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--text-muted);
}

.nav-item.current {
  background: var(--marker);
  color: var(--text);
  font-weight: 500;
}

.sheet-page {
  padding: 28px 36px;
}

.sheet-title {
  margin: 0 0 20px;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.sheet-notes {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--border);
}

.sheet-notes li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.sheet-notes small {
  color: var(--text-muted);
  font-size: 13px;
}

/* How it works: a real sequence, so its steps are numbered. */
.how {
  padding-top: 88px;
  padding-bottom: 96px;
}

h2 {
  margin: 0;
  font-size: clamp(1.75rem, 1.25rem + 1.5vw, 2.5rem);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 40px 48px;
  margin: 40px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  padding-top: 20px;
  border-top: 2px solid var(--text);
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  display: block;
  margin-bottom: 20px;
  font-size: 44px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.steps h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
}

.steps p {
  margin: 8px 0 0;
  max-width: 36ch;
  color: var(--text-muted);
}

/* The documents: /privacy and /terms, set for reading. */
.doc {
  flex: 1;
  max-width: 760px;
  padding-top: 56px;
  padding-bottom: 96px;
}

.doc h1 {
  font-size: clamp(2.25rem, 1.5rem + 3vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.doc h1 + .muted {
  margin: 16px 0 48px;
  font-size: 1.1875rem;
}

.doc h2 {
  margin: 44px 0 12px;
  font-size: 1.3125rem;
  letter-spacing: -0.015em;
}

.doc p,
.doc ul {
  margin: 12px 0;
  max-width: 66ch;
  line-height: 1.7;
}

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

/* The footer: the documents and the contact. */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  font-size: 15px;
}

.site-footer .bar {
  flex-wrap: wrap;
  padding-top: 28px;
  padding-bottom: 28px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  color: var(--text-muted);
}

.site-footer nav a {
  text-decoration: none;
}

.site-footer nav a:hover {
  color: var(--text);
  text-decoration: underline;
}

@media (max-width: 720px) {
  .hero {
    padding-top: 48px;
    padding-bottom: 56px;
  }

  .desk {
    padding: 32px 0;
  }

  .sheet {
    grid-template-columns: 1fr;
  }

  .sheet-sidebar {
    display: none;
  }

  .sheet-page {
    padding: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
