/* Glassnova landing — общие стили для index.html и article.html */

:root {
  --ink: #2f3337;
  --ink-soft: #565d63;
  --red: #cc2600;
  --red-dark: #a51f00;
  --glass: #d3e8e1;
  --glass-deep: #6fa89b;
  --paper: #f5f8f7;
  --white: #ffffff;
  --line: #d3dcd9;
  --steel: #8a9399;

  --font-ui: "Jost", "Segoe UI", Arial, sans-serif;
  --font-read: "Literata", Georgia, "Times New Roman", serif;

  --wrap: 1120px;
  --gutter: 20px;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 1.0625rem;
  line-height: 1.55;
}

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

a { color: var(--red); text-underline-offset: 3px; transition: color .15s; }
a:hover { color: var(--red-dark); }

:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

h1, h2, h3 { overflow-wrap: break-word; hyphens: auto; font-weight: 500; line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.05rem; font-weight: 600; letter-spacing: 0; }
p { margin: 0; }

/* ---------- Шапка ---------- */
.site-header { border-bottom: 1px solid var(--line); background: var(--white); }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding-top: 16px; padding-bottom: 16px; flex-wrap: wrap;
}
.logo img { height: 34px; width: auto; }
.nav { display: flex; gap: 28px; flex-wrap: wrap; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 500; padding: 4px 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--red); border-bottom-color: var(--red); }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-block; padding: 13px 24px; border-radius: 3px;
  font-weight: 500; text-decoration: none; border: 2px solid var(--red);
  transition: background .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--red); color: var(--white); }
.btn-primary:hover { background: var(--red-dark); border-color: var(--red-dark); color: var(--white); }
.btn-line { background: transparent; color: var(--red); }
.btn-line:hover { background: var(--red); color: var(--white); }

/* ---------- Первый экран ---------- */
.hero { padding: 56px 0 64px; }
.hero .wrap { display: grid; grid-template-columns: 1fr; gap: 40px; align-items: center; }
.hero-text p { margin-top: 20px; font-size: 1.2rem; color: var(--ink-soft); max-width: 34ch; }
.hero-actions { margin-top: 32px; display: flex; gap: 14px; flex-wrap: wrap; }

.drawing {
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--white);
  border: 1px solid var(--steel);
  padding: 8px;
}
.drawing svg { width: 100%; height: auto; }
.drawing text { font-family: var(--font-ui); fill: var(--ink); font-size: 15px; }
.drawing .small { font-size: 13px; fill: var(--ink-soft); }

/* ---------- Секции ---------- */
.section { padding: 64px 0; }
.section-head { max-width: 46ch; margin-bottom: 36px; }
.section-head p { margin-top: 12px; color: var(--ink-soft); }

/* ---------- Каталог ---------- */
.catalog { background: var(--white); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; list-style: none; margin: 0; padding: 0; }
.tile {
  display: flex; flex-direction: column; height: 100%;
  border: 1px solid var(--line); background: var(--white);
  color: var(--ink); text-decoration: none;
  transition: border-color .15s;
}
.tile:hover { border-color: var(--red); color: var(--ink); }
.tile-img { aspect-ratio: 4 / 3; padding: 10px; background: var(--white); border-bottom: 1px solid var(--line); }
.tile-img img { width: 100%; height: 100%; object-fit: contain; }
.tile-body { padding: 12px 12px 16px; }
.tile-body p { margin-top: 6px; color: var(--ink-soft); font-size: 0.98rem; }
.tile h3 { font-size: 0.93rem; hyphens: manual; overflow-wrap: normal; }
.tile:hover h3 { color: var(--red); }
.tile-text { background: var(--glass); justify-content: flex-end; }
.tile-text .tile-body { padding-top: 60px; }

/* ---------- Как выбрать ---------- */
.choose-grid { display: grid; grid-template-columns: 1fr; gap: 0; border-top: 1px solid var(--steel); }
.choose-item { padding: 24px 0; border-bottom: 1px solid var(--line); }
.choose-item p { margin-top: 8px; color: var(--ink-soft); max-width: 42ch; }

/* ---------- Блок статьи ---------- */
.articles { background: var(--glass); }
.articles .wrap { display: grid; grid-template-columns: 1fr; gap: 32px; }
.articles-main p { margin-top: 12px; max-width: 40ch; }
.articles-main .btn { margin-top: 24px; }
.old-list { list-style: none; margin: 0; padding: 0; }
.old-list li { border-top: 1px solid var(--glass-deep); }
.old-list li:last-child { border-bottom: 1px solid var(--glass-deep); }
.old-list a { display: block; padding: 14px 0; color: var(--ink); text-decoration: none; font-weight: 500; }
.old-list a:hover { color: var(--red); }
.old-list small { display: block; font-weight: 400; color: var(--ink-soft); }

/* ---------- Подвал ---------- */
.site-footer { padding: 36px 0 44px; font-size: 0.95rem; color: var(--ink-soft); }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.site-footer a { color: var(--ink-soft); }
.site-footer a:hover { color: var(--red); }

/* ---------- Страница статьи ---------- */
.crumbs { padding: 20px 0 0; font-size: 0.95rem; color: var(--ink-soft); }
.crumbs a { color: var(--ink-soft); }
.crumbs a:hover { color: var(--red); }

.article { padding: 32px 0 72px; }
.article-head { max-width: 34em; }
.article-meta { margin-top: 16px; color: var(--ink-soft); font-size: 0.95rem; }

.prose { max-width: 68ch; margin-top: 36px; font-family: var(--font-read); font-size: 1.15rem; line-height: 1.75; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-family: var(--font-ui); font-size: 1.7rem; margin-top: 2em; }
.prose h3 { font-family: var(--font-ui); font-size: 1.3rem; margin-top: 1.6em; }
.prose .lead { font-size: 1.3rem; line-height: 1.6; color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .4em; }
.prose blockquote { margin-left: 0; padding-left: 1.2em; border-left: 3px solid var(--glass-deep); color: var(--ink-soft); font-style: italic; }
.prose figure { margin: 2em 0; }
.prose figure img { border: 1px solid var(--line); background: var(--white); }
.prose figcaption { margin-top: 8px; font-family: var(--font-ui); font-size: 0.92rem; color: var(--ink-soft); }
.prose .note { font-family: var(--font-ui); font-size: 0.98rem; background: var(--glass); padding: 14px 18px; border-left: 3px solid var(--glass-deep); }

.article-cta { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--line); max-width: 68ch; }
.article-cta p { color: var(--ink-soft); margin-bottom: 16px; }

/* ---------- Широкие экраны ---------- */
@media (min-width: 760px) {
  .tiles { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
  .tile-img { padding: 14px; }
  .tile h3 { font-size: 1.05rem; }
  .tile-body { padding: 16px 18px 20px; }
  .tile-text .tile-body { padding-top: 90px; }
  .hero { padding: 72px 0 80px; }
  .hero .wrap { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 56px; }
  .choose-grid { grid-template-columns: repeat(3, 1fr); }
  .choose-item { padding: 28px 32px 28px 0; border-bottom: 0; }
  .choose-item + .choose-item { padding-left: 32px; border-left: 1px solid var(--line); }
  .articles .wrap { grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* Статья на главной */
.section .article { padding: 0; }
.h1-article { font-size: clamp(1.8rem, 4vw, 2.8rem); }

/* Таблицы в статье */
.table-wrap { overflow-x: auto; margin: 1.6em 0; -webkit-overflow-scrolling: touch; }
.prose table { width: 100%; min-width: 560px; border-collapse: collapse; font-family: var(--font-ui); font-size: 0.98rem; line-height: 1.45; background: var(--white); border: 1px solid var(--steel); }
.prose caption { caption-side: top; text-align: left; font-weight: 600; padding: 0 0 10px; color: var(--ink); }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.prose thead th { background: var(--glass); border-bottom: 1px solid var(--steel); font-weight: 600; }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose td:first-child { font-weight: 500; }
.prose ol { padding-left: 1.5em; }
.article-head { max-width: 40em; }
.section.article-section { background: var(--paper); }
.prose { max-width: 74ch; }

/* Таблицы с полными границами */
.prose table { border: 1px solid var(--ink); }
.prose th, .prose td { border: 1px solid var(--steel); }
.prose thead th { border-bottom: 2px solid var(--ink); }
.prose tbody tr:last-child td { border-bottom: 1px solid var(--steel); }
