/* ============================================================
   ШРИФТЫ
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@300;400;500;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&display=swap');


:root {
    --k: calc(min(100vw / 1920, 1));
}

/* ============================================================
   БАЗА
   ============================================================ */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

* {
    box-sizing: border-box;
}

html {
  font-size: calc(16px * (100vw / 1920));
  line-height: 1.6;
  font-family: 'Inter', system-ui, sans-serif;
  color: #2e2e2e;
}

body {
  margin: 0;
  padding: 2rem;
  background: #fafafa;
  position: relative; /* если нужно */
}




/* ============================================================
   ЗАГОЛОВКИ (h1–h6)
   ============================================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: 'Cormorant Garamond', serif;
  margin: 1.3em 0 0.6em;
  color: #1f1f1f;
  line-height: 1.25;
}

h1 { font-size: 4.84rem; font-weight: 500; }
h2 { font-size: 3.72rem; font-weight: 500; }
h3 { font-size: 2.86rem; font-weight: 500; }
h4 { font-size: 2.2rem; font-weight: 500; }
h5 { font-size: 1.69rem; font-weight: 500; }
h6 { font-size: 1.3rem; font-weight: 500; }


/* ============================================================
   АБЗАЦЫ
   ============================================================ */

p {
  margin: 0.9em 0;
  font-weight: 300;
}

p.lead {
  font-size: 1.25rem;
  line-height: 1.7;
  font-weight: 300;
}

p.note {
  font-size: 0.9rem;
  color: #555;
  font-style: italic;
}

p.muted {
  color: #888;
}


/* ============================================================
   СПИСКИ
   ============================================================ */

ul, ol {
  margin: 1em 0;
  padding-left: 1.6em;
}

li {
  margin: 0.4em 0;
}


/* ============================================================
   МЕЛКИЙ ТЕКСТ
   ============================================================ */

small {
  font-size: 0.8rem;
  color: #666;
}


/* ============================================================
   ВЕРХНИЕ/НИЖНИЕ ИНДЕКСЫ
   ============================================================ */

sup, sub {
  font-size: 0.75em;
  line-height: 0;
}

sup { vertical-align: super; }
sub { vertical-align: sub; }


/* ============================================================
   ССЫЛКИ
   ============================================================ */

a {
  color: #2a4d8f;
  text-decoration: none;
  transition: color 0.25s ease;
}

a:hover {
  color: #182c55;
}

a:focus,
a:active {
  outline: none;
  color: #0d1c3a;
}

a:visited {
  color: #5a6d9f;
}


/* ============================================================
   ФИГУРЫ / ПОДПИСИ
   ============================================================ */

figcaption,
.caption {
  font-size: 0.9rem;
  color: #666;
  margin-top: 0.4em;
  text-align: center;
  font-style: italic;
}


/* ============================================================
   ТЕГИ / МЕТКИ
   ============================================================ */

.tag {
  display: inline-block;
  background: #ececec;
  color: #444;
  padding: 0.15em 0.5em;
  border-radius: 4px;
  font-size: 0.85rem;
  text-transform: lowercase;
  letter-spacing: 0.02em;
}


/* ============================================================
   ЦИТАТЫ
   ============================================================ */

blockquote {
  margin: 1.4em 0;
  padding-left: 1em;
  border-left: 3px solid #ccc;
  font-style: italic;
  color: #444;
}

cite {
  display: block;
  margin-top: 0.3em;
  font-size: 0.9rem;
  color: #666;
}


/* ============================================================
   КОД
   ============================================================ */

code,
pre {
  font-family: 'IBM Plex Mono', monospace;
}

code {
  background: #eee;
  padding: 0.15em 0.3em;
  border-radius: 4px;
  font-size: 0.95rem;
}

pre {
  background: #f2f2f2;
  padding: 1em;
  border-radius: 6px;
  overflow-x: auto;
}

/* ============================================================
   КАРТОЧКИ / СЕКЦИИ / КОНТЕЙНЕРЫ
   ============================================================ */

/* Универсальная карточка */
.card {
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;

  padding: 2.2rem;
  margin: 2.4rem 0;

  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);

  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.card:hover {
  border-color: #dcdcdc;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.08);
}

/* Статьи — более «редакционный» блок */
article {
  max-width: 900px;
  margin: 0 auto 4rem auto;
  padding: 0 0.5rem;
}

article p {
  font-size: 1.05rem;
  line-height: 1.75;
  margin: 1.2em 0;
}

article h1,
article h2,
article h3 {
  margin-top: 2.4rem;
  margin-bottom: 1rem;
}

article h1:first-child,
article h2:first-child,
article h3:first-child {
  margin-top: 0;
}

article img {
  display: block;
  max-width: 100%;
  margin: 2rem auto;
  border-radius: 8px;
}

article ul,
article ol {
  margin: 1.2em 0 1.4em 0;
  padding-left: 1.8em;
}

article li {
  margin: 0.4em 0;
  line-height: 1.6;
}

article hr {
  margin: 3rem 0;
  border: none;
  border-top: 1px solid #e3e3e3;
}

article blockquote {
  margin: 2rem 0;
  padding: 0.5rem 1.2rem;
  border-left: 3px solid #ccc;
  color: #444;
  font-style: italic;
}



/* Секции — крупные "главы" страницы */
section {
  margin: 4rem 0;
  padding: 0;
}

section > h2,
section > h3 {
  margin-top: 0.2em;
}

/* Мягкая зона — для вставок, комментариев, второстепенной информации */
.soft {
  background: #f5f5f5;
  border: 1px solid #e1e1e1;
  border-radius: 10px;

  padding: 1.6rem 2rem;
  margin: 1.6rem 0;

  color: #444;
  font-size: 0.97rem;
  line-height: 1.55;
}

/* Уменьшенная контрастность текста */
.text-muted {
  color: #777 !important;
}

header {
  margin-bottom: 3rem;
}

header h1 {
  margin-bottom: 0.6rem;
}

/* ============================================================
   ТАБЛИЦЫ — мягкий редакционный стиль
   ============================================================ */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 2.4rem 0;
  font-size: 0.95rem;
  color: #2e2e2e;
}

caption {
  caption-side: top;
  font-size: 0.95rem;
  color: #666;
  margin-bottom: 0.8rem;
  font-style: italic;
  text-align: left;
}

thead th {
  font-weight: 600;
  text-align: left;
  border-bottom: 2px solid #e5e5e5;
  padding: 0.8rem 0.6rem;
}

tbody td,
tbody th {
  padding: 0.7rem 0.6rem;
  border-bottom: 1px solid #eeeeee;
  vertical-align: top;
}

tbody tr:last-child td,
tbody tr:last-child th {
  border-bottom: none;
}

tfoot td {
  padding: 0.8rem 0.6rem;
  border-top: 2px solid #e5e5e5;
  font-weight: 500;
}

td, th {
  /* чтобы длинные тексты не ломали таблицу */
  word-break: break-word;
}

colgroup col {
  /* по умолчанию не задаём цвет или ширину
     — но оставляем крючок на будущее */
}

/* ============================================================
   ФОРМЫ — мягкая редакционная система
   ============================================================ */

form {
  margin: 2.4rem 0;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  color: #444;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="search"],
input[type="file"],
select,
textarea {
  width: 100%;
  padding: 0.65rem 0.8rem;

  font-size: 1rem;
  font-family: 'Inter', system-ui, sans-serif;

  color: #2e2e2e;
  background: #ffffff;

  border: 1px solid #dcdcdc;
  border-radius: 8px;

  box-sizing: border-box;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #2a4d8f;
  box-shadow: 0 0 0 3px rgba(42, 77, 143, 0.18);
  outline: none;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

button,
input[type="submit"],
input[type="button"] {
  cursor: pointer;

  padding: 0.6rem 1.2rem;
  border: 1px solid #1b5583;
  border-radius: 6px;

  background: #1b5583;
  color: #ffffff;

  font-size: 1rem;
  font-family: 'Inter', system-ui, sans-serif;

  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
  background: #15476c;  /* чуть темнее */
  border-color: #15476c;
}

button:disabled {
  background: #a5b3c1;   /* охлаждённый серо-синий */
  border-color: #a5b3c1;
  cursor: default;
  opacity: 0.8;
}

select {
  background-image: none; /* без уродливых дефолтных стрелок (на macOS/Win) */
  appearance: none;
}

select::-ms-expand {
  display: none;
}

optgroup {
  font-weight: 600;
  color: #333;
}

option {
  color: #2e2e2e;
}

datalist {
  font-size: 0.95rem;
}


/* ============================================================
   ПРОГРЕСС-БАР (толстый, мягкий, без градиента — цвет задаёт JS)
   ============================================================ */

progress {
  width: 100%;
  height: 18px;
  border: none;
  border-radius: 9px;
  background: #e6e6e6;
  overflow: hidden;
}

progress::-webkit-progress-bar {
  background: #e6e6e6;
  border-radius: 6px;
}

progress::-webkit-progress-value {
  background: #3d7b9e;
  border-radius: 6px;
}

meter {
  width: 100%;
  height: 12px;
}

meter::-webkit-meter-bar {
  background: #eee;
  border-radius: 6px;
}

meter::-webkit-meter-optimum-value {
  background: #2a4d8f;
}


.mt-1-2 {
  margin-top: 1.2rem;
}

.button-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

/* ============================================================
   FIELDSET / LEGEND
   ============================================================ */

fieldset {
  border: 1px solid #dcdcdc;
  border-radius: 8px;
  padding: 1.4rem 1.6rem;
  margin: 1.8rem 0;
}

legend {
  padding: 0 0.4rem;
  font-size: 0.95rem;
  color: #555;
}

/* ============================================================
   DETAILS / SUMMARY — максимально спокойные аккордеоны
   ============================================================ */

details {
  margin: 1.6rem 0;
  padding: 0;
}

summary {
  cursor: pointer;
  list-style: none;

  font-size: 1.1rem;
  color: #2e2e2e;        /* всегда один и тот же цвет */
  font-weight: 500;

  padding: 0.4rem 0;
  display: flex;
  align-items: center;

  /* никаких color: hover */
  transition: none;
}

/* убираем встроенный маркер */
summary::-webkit-details-marker {
  display: none;
}

/* кастомная стрелочка */
summary::before {
  content: "▸";
  font-size: 1rem;
  color: #888;           /* тоже постоянный, не меняется */
  margin-right: 0.6rem;
  transition: transform 0.25s ease;  /* только поворот */
}

@media (max-width: 640px) {
  body { padding: 0.4rem; }
}

@media (max-width: 640px) {
  .card { padding: 1.4rem; }
}

