/* ==============================================================
   Unia — legal / long-form document styles
   Same brand palette as the landing, tuned for comfortable reading.
   ============================================================== */

:root {
  --bg-base: #1C0810;
  --bg-deep: #160509;
  --bg-card: #2C0F1A;
  --border: #43182A;
  --gold: #D4A640;
  --gold-bright: #F4C757;
  --gold-dark: #8B6F2D;
  --gold-mid: #B58A3C;
  --text: #F0E6DA;
  --text-muted: #C2A39B;

  --gold-linear: linear-gradient(135deg, #8B6F2D 0%, #F4C757 50%, #B58A3C 100%);

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--text);
  background-color: var(--bg-deep);
  background-image:
    radial-gradient(ellipse 70% 40% at 50% -2%, rgba(244, 199, 87, 0.10) 0%, rgba(244, 199, 87, 0) 60%),
    linear-gradient(180deg, #3A0C18 0%, #1C0810 45%, #160509 100%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  line-height: 1.7;
}

main {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 24px 96px;
  position: relative;
  z-index: 1;
}

img { max-width: 100%; height: auto; display: block; }

/* ----- Top nav ----- */

.nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 44px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.nav-home {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.1em;
  font-size: 18px;
  color: var(--gold);
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav-home:hover { color: var(--gold-bright); }

.nav-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  filter: drop-shadow(0 0 10px rgba(244, 199, 87, 0.4));
}

.nav-back {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.nav-back:hover {
  color: var(--gold);
  border-bottom-color: rgba(212, 166, 64, 0.5);
}

/* ----- Document body ----- */

.doc {
  font-size: 16px;
}

.doc h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(30px, 4.4vw, 40px);
  letter-spacing: 0.02em;
  line-height: 1.2;
  background: var(--gold-linear);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  margin-bottom: 8px;
}

.doc h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(20px, 2.6vw, 25px);
  color: var(--gold);
  letter-spacing: 0.01em;
  line-height: 1.3;
  margin-top: 44px;
  margin-bottom: 14px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--gold-dark);
}

.doc h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  color: var(--gold-mid);
  letter-spacing: 0.01em;
  margin-top: 28px;
  margin-bottom: 10px;
}

/* the "_Последнее обновление:…_" line renders as the first <em> paragraph */
.doc > p:first-of-type em,
.doc p em:only-child {
  color: var(--text-muted);
  font-style: italic;
}

.doc p {
  margin-bottom: 16px;
  color: var(--text);
  font-weight: 300;
}

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

.doc a {
  color: var(--gold-bright);
  text-decoration: none;
  border-bottom: 1px solid rgba(244, 199, 87, 0.3);
  transition: color 0.2s ease, border-color 0.2s ease;
  word-break: break-word;
}

.doc a:hover {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.doc ul,
.doc ol {
  margin: 4px 0 18px 4px;
  padding-left: 24px;
}

.doc li {
  margin-bottom: 8px;
  color: var(--text);
  font-weight: 300;
}

.doc li::marker {
  color: var(--gold-dark);
}

.doc ul li::marker {
  color: var(--gold);
}

.doc code {
  background: var(--bg-card);
  color: var(--gold-bright);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88em;
  border: 1px solid var(--border);
}

.doc hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, rgba(67, 24, 42, 0), var(--border), rgba(67, 24, 42, 0));
  margin: 36px 0;
}

/* any remaining blockquote (e.g. emphasised callout) */
.doc blockquote {
  background: var(--bg-card);
  border-left: 3px solid var(--gold);
  padding: 14px 20px;
  margin: 20px 0;
  border-radius: 0 6px 6px 0;
  color: var(--text-muted);
}

.doc blockquote p:last-child { margin-bottom: 0; }

/* ----- Cross-link nav between docs ----- */

.doc-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 64px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.doc-nav a,
.doc-nav__current {
  font-size: 13px;
  letter-spacing: 0.02em;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

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

.doc-nav a:hover {
  color: var(--gold);
  border-color: rgba(212, 166, 64, 0.4);
  background: rgba(212, 166, 64, 0.05);
}

.doc-nav__current {
  color: var(--gold);
  border-color: rgba(212, 166, 64, 0.5);
  background: rgba(212, 166, 64, 0.06);
}

/* ----- Footer ----- */

.doc-footer {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  line-height: 1.9;
}

.doc-footer a {
  color: var(--gold);
  text-decoration: none;
}

.doc-footer a:hover { color: var(--gold-bright); }

/* ----- Responsive ----- */

@media (max-width: 768px) {
  main { padding: 28px 20px 72px; }
  .nav-bar { margin-bottom: 32px; }
  .doc h2 { margin-top: 36px; }
}
