/* Словолов — shared foundation for every public page.
 *
 * «Чорнило на теплому папері»: one ink diluted four times on aged paper, one
 * sealing-wax accent that is an action, never decoration. Tokens mirror the
 * app's design_tokens.dart via the brandbook (admin SPA → «Брендбук»); the
 * palette test chain in admin-ui keeps those values honest, and this file
 * quotes them.
 *
 * Self-hosted everything: the two variable fonts live in /assets/fonts and are
 * the ONLY non-page requests this site makes. No CDN, no analytics, no
 * external image — the offline-first charter applies to the site too.
 */

@font-face {
  font-family: "Literata";
  src: url("/assets/fonts/literata-variable.woff2") format("woff2-variations");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Literata";
  src: url("/assets/fonts/literata-italic-variable.woff2") format("woff2-variations");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Golos Text";
  src: url("/assets/fonts/golos-text-variable.woff2") format("woff2-variations");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Paper and ink (light: the daylight page). */
  --paper: #faf5ea;
  --paper-2: #efe4cc;
  --surface: #fffdf6;
  --ink: #33291f;
  --ink-2: #6e5f49;
  --ink-soft: #8a7a60;
  --ink-faint: #a99878;
  --accent: #a63d2a;

  /* The word groups: sprout / quill / wax seal. */
  --group-new: #437a54;
  --group-new-tint: rgba(67, 122, 84, 0.14);
  --group-beautiful: #5b549e;
  --group-beautiful-tint: rgba(91, 84, 158, 0.12);
  --group-important: #a63d2a;
  --group-important-tint: rgba(166, 61, 42, 0.12);

  /* One shadow in the whole system; radii with one job each. */
  --shadow: 0 2px 8px rgba(51, 41, 31, 0.13);
  --radius-word: 7px;
  --radius-row: 12px;
  --radius-card: 14px;
  --radius-pill: 999px;

  --hairline: color-mix(in srgb, var(--ink-faint) 35%, transparent);
  --ruling: color-mix(in srgb, var(--ink-faint) 45%, transparent);

  --serif: "Literata", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* The same world by lamplight: paper darkens to coffee, ink lightens. */
    --paper: #241d13;
    --paper-2: #1e1810;
    --surface: #2b2418;
    --ink: #f0e6d0;
    --ink-2: #a5977c;
    --ink-soft: #a5977c;
    --ink-faint: #7d7059;
    --accent: #d07a66;
    --group-new: #7fb08d;
    --group-new-tint: rgba(127, 176, 141, 0.14);
    --group-beautiful: #9b93cf;
    --group-beautiful-tint: rgba(155, 147, 207, 0.12);
    --group-important: #d07a66;
    --group-important-tint: rgba(208, 122, 102, 0.12);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    --ruling: color-mix(in srgb, var(--ink-faint) 25%, transparent);
  }
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  min-height: 100vh;
  /* Column flex so short pages (the 404) still pin the footer to the viewport
     bottom and the gradient never ends mid-screen. */
  display: flex;
  flex-direction: column;
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.35;
  color: var(--ink);
  background: var(--paper);
  background-image: linear-gradient(to bottom, var(--paper), var(--paper-2));
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1;
}

a {
  color: inherit;
}

img,
svg {
  max-width: 100%;
}

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

/* --- header: the mark, the name, one quiet link ------------------------- */

.site-header {
  padding: 20px 0;
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  width: 44px;
  height: auto;
  flex: none;
}

.brand-mark .ring {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.2;
}

.brand-mark .drop {
  fill: var(--accent);
}

.brand-name {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.header-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
}

.header-link:hover {
  color: var(--accent);
}

/* --- footer: the legal nav every page shares ---------------------------- */

.site-footer {
  margin-top: 96px;
  padding: 40px 0 48px;
  border-top: 1px solid var(--hairline);
  font-size: 0.8125rem;
  color: var(--ink-soft);
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 24px;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.footer-nav a {
  color: var(--ink-2);
  text-decoration: none;
}

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

.footer-note {
  margin: 0;
}
