/* ========================================================================
   Welcome Book — Российский институт стандартизации
   Design System (derived from FPF pattern C.33 — Publication Carriers,
   applied via A.6.3.NAR Structure-to-Narrative Rendering and A.7 Strict
   Distinction: every section is one EntityOfConcern with explicit Cards).
   ======================================================================== */

/* --------- 1. Design Tokens (CSS Custom Properties) --------- */
:root {
  /* Brand colors (РИС deep-blue palette, sampled from supplied logos) */
  --c-brand-900: #0e2a52;
  --c-brand-800: #143a6e;
  --c-brand-700: #1d4e8c;
  --c-brand-600: #2563a8;
  --c-brand-500: #2f7ac4;
  --c-brand-100: #e7effa;
  --c-brand-050: #f3f7fd;

  /* Neutral palette */
  --c-ink:      #15233b;
  --c-ink-soft: #4a5b78;
  --c-line:     #e3e8f1;
  --c-bg:       #ffffff;
  --c-bg-soft:  #f7f9fc;
  --c-accent:   #f5b733;       /* highlight gold for accents */
  --c-danger:   #d64545;

  /* Typography */
  --ff-base: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter",
             "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei",
             sans-serif;
  --ff-display: "Georgia", "Times New Roman", serif;
  --fs-12: 0.75rem;
  --fs-14: 0.875rem;
  --fs-16: 1rem;
  --fs-18: 1.125rem;
  --fs-20: 1.25rem;
  --fs-24: 1.5rem;
  --fs-30: 1.875rem;
  --fs-36: 2.25rem;
  --fs-48: 3rem;
  --fs-60: 3.75rem;
  --lh-tight: 1.2;
  --lh-base:  1.6;

  /* Layout */
  --container: 1200px;
  --gutter: 24px;
  --radius-sm: 6px;
  --radius:    12px;
  --radius-lg: 20px;

  /* Elevation */
  --shadow-1: 0 2px 6px rgba(14, 42, 82, 0.06);
  --shadow-2: 0 8px 24px rgba(14, 42, 82, 0.10);
  --shadow-3: 0 16px 40px rgba(14, 42, 82, 0.16);

  /* Motion */
  --t-fast: 0.15s ease;
  --t-base: 0.25s ease;
}

/* --------- 2. Reset / Base --------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--ff-base);
  font-size: var(--fs-16);
  line-height: var(--lh-base);
  color: var(--c-ink);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--c-brand-700);
  text-decoration: none;
  transition: color var(--t-fast);
}
a:hover { color: var(--c-brand-500); }

h1, h2, h3, h4 {
  margin: 0 0 0.5em;
  font-weight: 700;
  line-height: var(--lh-tight);
  color: var(--c-brand-900);
  letter-spacing: -0.01em;
}
h1 { font-size: var(--fs-48); }
h2 { font-size: var(--fs-30); }
h3 { font-size: var(--fs-20); }
h4 { font-size: var(--fs-18); }

p { margin: 0 0 1em; }

ul, ol { padding-left: 1.4em; margin: 0 0 1em; }
li { margin-bottom: 0.35em; }

/* --------- 3. Layout primitives --------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section {
  padding: 64px 0;
}
.section--soft { background: var(--c-bg-soft); }
.section--brand { background: linear-gradient(135deg, var(--c-brand-900), var(--c-brand-700)); color: #fff; }
.section--brand h1, .section--brand h2, .section--brand h3 { color: #fff; }

.grid {
  display: grid;
  gap: var(--gutter);
}
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 900px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
}

/* --------- 4. Header / Top navigation --------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--c-line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 24px;
}

.site-header__logo img {
  height: 48px;
  width: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.site-nav a {
  display: inline-block;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-14);
  font-weight: 500;
  color: var(--c-ink-soft);
  transition: background var(--t-fast), color var(--t-fast);
}
.site-nav a:hover { background: var(--c-brand-050); color: var(--c-brand-700); }
.site-nav a.is-active {
  background: var(--c-brand-700);
  color: #fff;
}

.site-nav__toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--c-line);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  cursor: pointer;
  font-size: var(--fs-18);
}

@media (max-width: 900px) {
  .site-header__logo img { height: 40px; }
  .site-nav { display: none; flex-direction: column; align-items: stretch; width: 100%; }
  .site-nav.is-open { display: flex; }
  .site-nav a { text-align: left; }
  .site-nav__toggle { display: inline-block; }
  .site-header__inner { flex-wrap: wrap; }
  .site-nav { order: 3; }
}

/* --------- 5. Hero --------- */
.hero {
  position: relative;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(47, 122, 196, 0.35), transparent 60%),
    radial-gradient(800px 400px at 0% 110%, rgba(245, 183, 51, 0.18), transparent 60%),
    linear-gradient(135deg, var(--c-brand-900), var(--c-brand-700));
  color: #fff;
  padding: 96px 0 96px;
  overflow: hidden;
}
.hero h1 {
  color: #fff;
  font-size: clamp(2rem, 5vw, var(--fs-60));
  max-width: 820px;
}
.hero p.lead {
  font-size: var(--fs-20);
  color: rgba(255, 255, 255, 0.86);
  max-width: 720px;
}
.hero__row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 28px;
}
.hero__row .btn--ghost { border-color: rgba(255, 255, 255, 0.4); color: #fff; }
.hero__row .btn--ghost:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }

.hero__brand-mark {
  position: absolute;
  right: 5%;
  bottom: 16px;
  height: 120px;
  opacity: 0.18;
  pointer-events: none;
}

/* --------- 6. Buttons --------- */
.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-14);
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--t-fast), background var(--t-fast),
              color var(--t-fast), box-shadow var(--t-fast);
  border: 1px solid transparent;
  text-align: center;
}
.btn--primary {
  background: var(--c-brand-700);
  color: #fff;
  box-shadow: var(--shadow-1);
}
.btn--primary:hover { background: var(--c-brand-600); color: #fff; transform: translateY(-1px); }

.btn--ghost {
  background: transparent;
  border-color: var(--c-line);
  color: var(--c-brand-700);
}
.btn--ghost:hover { background: var(--c-brand-050); }

/* --------- 7. Cards --------- */
.card {
  background: var(--c-bg);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-1);
  transition: transform var(--t-base), box-shadow var(--t-base), border-color var(--t-base);
  height: 100%;
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-2);
  border-color: var(--c-brand-100);
}
.card h3 { color: var(--c-brand-800); margin-bottom: 8px; }
.card p { color: var(--c-ink-soft); margin-bottom: 0; }
.card__icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--c-brand-050);
  color: var(--c-brand-700);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 16px;
}
.card__link {
  margin-top: 16px;
  font-size: var(--fs-14);
  font-weight: 600;
  color: var(--c-brand-700);
}

.card--accent {
  background: linear-gradient(135deg, var(--c-brand-700), var(--c-brand-600));
  color: #fff;
  border: none;
}
.card--accent h3 { color: #fff; }
.card--accent p  { color: rgba(255, 255, 255, 0.85); }

/* --------- 8. Lists (TOC) --------- */
.toc {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gutter);
  counter-reset: toc;
}
.toc__item {
  counter-increment: toc;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--c-line);
  background: var(--c-bg);
  transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast);
}
.toc__item:hover {
  border-color: var(--c-brand-100);
  background: var(--c-brand-050);
  transform: translateY(-2px);
}
.toc__num {
  flex: 0 0 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--c-brand-700);
  color: #fff;
  font-weight: 700;
  font-size: var(--fs-18);
}
.toc__title {
  font-size: var(--fs-18);
  font-weight: 700;
  color: var(--c-brand-900);
}
.toc__desc {
  color: var(--c-ink-soft);
  font-size: var(--fs-14);
  margin-top: 4px;
}

@media (max-width: 900px) { .toc { grid-template-columns: 1fr; } }

/* --------- 9. Page section blocks --------- */
.page-header {
  padding: 56px 0 24px;
  background: var(--c-brand-050);
  border-bottom: 1px solid var(--c-line);
}
.page-header h1 { margin-bottom: 8px; }
.page-header p  { color: var(--c-ink-soft); margin: 0; max-width: 760px; }

.block {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 40px;
  padding: 28px 0;
  border-top: 1px solid var(--c-line);
}
.block:first-child { border-top: none; }
.block__label {
  font-size: var(--fs-12);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-brand-700);
  font-weight: 700;
}
.block__body { color: var(--c-ink); }
.block__body h3 { margin-bottom: 12px; }

@media (max-width: 900px) {
  .block { grid-template-columns: 1fr; gap: 8px; }
}

/* --------- 10. Values list (decorative) --------- */
.values {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gutter);
  margin: 0;
  padding: 0;
  list-style: none;
}
.values__item {
  padding: 24px;
  border-radius: var(--radius);
  background: var(--c-bg);
  border: 1px solid var(--c-line);
  text-align: center;
}
.values__item strong {
  display: block;
  font-size: var(--fs-20);
  color: var(--c-brand-700);
  margin-bottom: 8px;
}
.values__item p { color: var(--c-ink-soft); margin: 0; font-size: var(--fs-14); }
@media (max-width: 900px) { .values { grid-template-columns: 1fr 1fr; } }
@media (max-width: 540px) { .values { grid-template-columns: 1fr; } }

/* --------- 11. Callout / quote --------- */
.callout {
  margin: 24px 0;
  padding: 24px 28px;
  border-left: 4px solid var(--c-brand-700);
  background: var(--c-brand-050);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.callout p { margin: 0; color: var(--c-brand-900); font-weight: 500; }
.callout--quote {
  font-family: var(--ff-display);
  font-style: italic;
  font-size: var(--fs-20);
}

/* --------- 12. Tag chips --------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 12px 0 0; list-style: none; }
.chips li {
  padding: 6px 12px;
  background: var(--c-brand-050);
  border: 1px solid var(--c-brand-100);
  color: var(--c-brand-800);
  border-radius: 999px;
  font-size: var(--fs-12);
  font-weight: 600;
}

/* --------- 13. Social row --------- */
.social {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
}
.social a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--c-line);
  border-radius: var(--radius-sm);
  font-size: var(--fs-14);
  font-weight: 600;
  color: var(--c-brand-700);
  background: var(--c-bg);
}
.social a:hover { background: var(--c-brand-050); color: var(--c-brand-700); }
.social .ico {
  width: 22px; height: 22px; display: inline-grid; place-items: center;
  background: var(--c-brand-700); color: #fff; border-radius: 50%;
  font-size: 12px; font-weight: 700;
}

/* --------- 14. Footer --------- */
.site-footer {
  background: var(--c-brand-900);
  color: rgba(255, 255, 255, 0.85);
  padding: 56px 0 24px;
}
.site-footer__top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.site-footer h4 { color: #fff; font-size: var(--fs-18); margin-bottom: 16px; }
.site-footer a  { color: rgba(255, 255, 255, 0.8); display: inline-block; padding: 4px 0; }
.site-footer a:hover { color: var(--c-accent); }
.site-footer__brand img { height: 60px; margin-bottom: 12px; }
.site-footer__legal {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 18px;
  font-size: var(--fs-12);
  color: rgba(255, 255, 255, 0.55);
  display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between;
}

@media (max-width: 900px) {
  .site-footer__top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 540px) {
  .site-footer__top { grid-template-columns: 1fr; }
}

/* --------- 15. Timeline (history) --------- */
.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 2px solid var(--c-brand-100);
}
.timeline li {
  position: relative;
  padding: 0 0 24px 28px;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: -7px; top: 4px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--c-brand-700);
  box-shadow: 0 0 0 4px var(--c-brand-050);
}
.timeline strong {
  display: inline-block;
  min-width: 100px;
  color: var(--c-brand-700);
  font-weight: 700;
}
.timeline span { color: var(--c-ink); }

/* --------- 16. Utility --------- */
.text-center { text-align: center; }
.muted       { color: var(--c-ink-soft); }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--c-brand-700);
  color: #fff;
  padding: 8px 14px;
  z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

@media (max-width: 600px) {
  .section { padding: 40px 0; }
  .hero { padding: 56px 0; }
  h1 { font-size: var(--fs-36); }
  h2 { font-size: var(--fs-24); }
}