:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #edf3f9;
  --ink: #102033;
  --muted: #64748b;
  --line: #dce6f0;
  --navy: #0d1b2a;
  --blue: #1f6feb;
  --teal: #18a999;
  --shadow: 0 18px 50px rgba(17, 42, 74, .09);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.container { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.skip-link { position: fixed; left: 16px; top: -80px; z-index: 999; background: #fff; padding: 10px 16px; border-radius: 10px; }
.skip-link:focus { top: 16px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(13, 27, 42, .92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.header-inner { height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; letter-spacing: -.02em; }
.brand-mark { width: 34px; height: 34px; border-radius: 11px; display: inline-grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--blue), var(--teal)); box-shadow: 0 8px 20px rgba(31,111,235,.28); }
.site-header .brand-text { color: #fff; font-size: 18px; }
.top-nav { display: flex; gap: 24px; }
.top-nav a { color: #c8d7e6; text-decoration: none; font-size: 14px; font-weight: 650; }
.top-nav a:hover { color: #fff; }

.hero { background: linear-gradient(135deg, #0d1b2a 0%, #12304c 55%, #143b4a 100%); color: #fff; padding: 78px 0 72px; overflow: hidden; position: relative; }
.hero::after { content: ""; position: absolute; inset: auto -140px -220px auto; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle, rgba(24,169,153,.28), rgba(24,169,153,0) 68%); pointer-events: none; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(330px, .65fr); gap: 56px; align-items: center; position: relative; z-index: 1; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: 12px; font-weight: 800; color: var(--teal); margin-bottom: 10px; }
.hero h1 { font-size: clamp(40px, 6vw, 70px); line-height: 1.02; letter-spacing: -.045em; margin: 0 0 24px; max-width: 820px; }
.hero h1 span { color: #8ce2d8; }
.hero-lead { color: #d2dfeb; font-size: clamp(17px, 2vw, 20px); max-width: 760px; margin: 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 48px; padding: 0 20px; border-radius: 13px; background: linear-gradient(135deg, var(--blue), #3284ff); color: #fff; text-decoration: none; font-weight: 750; box-shadow: 0 10px 25px rgba(31,111,235,.22); border: 1px solid transparent; }
.button:hover { transform: translateY(-1px); }
.button-secondary { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.2); box-shadow: none; }
.button-full { width: 100%; }
.stats { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 42px; }
.stats div { display: flex; flex-direction: column; gap: 1px; }
.stats strong { font-size: 24px; line-height: 1.2; }
.stats span { color: #9fb3c5; font-size: 13px; }
.hero-panel { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); border-radius: 24px; padding: 26px; box-shadow: 0 30px 90px rgba(0,0,0,.18); }
.hero-panel-head { font-weight: 800; font-size: 18px; margin-bottom: 16px; }
.search-box { display: flex; align-items: center; gap: 10px; background: #fff; color: var(--ink); border-radius: 14px; padding: 0 14px; min-height: 54px; }
.search-icon { color: var(--blue); font-size: 24px; line-height: 1; }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; font: inherit; color: var(--ink); }
.search-hint { color: #adc0d0; font-size: 13px; margin: 12px 0 0; }
.search-status { min-height: 22px; margin-top: 8px; color: #8ce2d8; font-weight: 700; font-size: 13px; }

.catalog-section { padding: 78px 0; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 32px; margin-bottom: 30px; }
.section-heading h2 { margin: 0; font-size: clamp(30px, 4vw, 44px); letter-spacing: -.035em; line-height: 1.1; }
.section-heading > p { margin: 0; color: var(--muted); max-width: 500px; }
.section-heading.compact { margin-bottom: 22px; }
.section-heading.compact h2 { font-size: 32px; }
.category-grid { display: grid; gap: 16px; }
details { background: var(--surface); }
.category-card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 28px rgba(17,42,74,.04); overflow: clip; }
.category-card[open] { box-shadow: var(--shadow); border-color: #c9d8e7; }
.category-card > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 24px 26px; }
.category-card > summary::-webkit-details-marker, .subcategory > summary::-webkit-details-marker { display: none; }
.category-summary-main { display: flex; align-items: center; gap: 16px; min-width: 0; }
.category-summary-main strong { display: block; font-size: 20px; line-height: 1.25; }
.category-summary-main small { display: block; color: var(--muted); margin-top: 4px; }
.category-dot { flex: 0 0 auto; width: 14px; height: 14px; border-radius: 50%; background: linear-gradient(135deg, var(--blue), var(--teal)); box-shadow: 0 0 0 7px #e8f2fb; }
.count-badge { flex: 0 0 auto; border-radius: 999px; background: var(--surface-soft); color: #3f5870; font-weight: 800; font-size: 13px; padding: 7px 11px; }
.category-body { padding: 0 18px 18px; display: grid; gap: 10px; }
.subcategory { border: 1px solid var(--line); border-radius: 16px; background: #fbfdff; overflow: clip; }
.subcategory > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 20px; padding: 16px 18px; font-weight: 750; }
.subcategory > summary span:last-child { color: var(--muted); font-size: 13px; }
.article-link-list { border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
.article-link { min-height: 54px; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; color: #28445e; text-decoration: none; border-bottom: 1px solid #edf2f7; }
.article-link:nth-child(odd) { border-right: 1px solid #edf2f7; }
.article-link:hover { background: #f1f7fd; color: var(--blue); }
.link-arrow { flex: 0 0 auto; color: #8aa0b5; }
.no-results { padding: 28px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); text-align: center; color: var(--muted); }

.about-section { padding: 72px 0; background: #eaf1f8; border-top: 1px solid #dce6f0; }
.about-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 64px; }
.about-grid h2 { margin: 0; font-size: 40px; line-height: 1.12; letter-spacing: -.03em; }
.about-text { font-size: 18px; color: #40566d; }
.about-text p { margin: 0 0 18px; }

.breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; margin: 28px 0 20px; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--blue); }
.article-page { padding-bottom: 72px; }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 28px; align-items: start; }
.article-card { background: #fff; border: 1px solid var(--line); border-radius: 26px; padding: clamp(24px, 5vw, 54px); box-shadow: var(--shadow); }
.article-topline { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 20px; }
.topic-pill { background: #e8f4f2; color: #117b70; border: 1px solid #c9e8e3; border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 800; }
.site-address { color: var(--muted); font-size: 12px; }
.article-card h1 { font-size: clamp(34px, 5vw, 58px); line-height: 1.06; letter-spacing: -.045em; margin: 0 0 20px; max-width: 920px; }
.article-description { font-size: clamp(18px, 2.4vw, 22px); line-height: 1.55; color: #52677c; margin: 0; }
.keyword-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.keyword-row span { border-radius: 999px; border: 1px solid var(--line); background: #f7fafc; color: #50677d; padding: 6px 10px; font-size: 12px; }
.article-divider { height: 1px; background: var(--line); margin: 32px 0; }
.article-content { font-size: clamp(17px, 2vw, 19px); line-height: 1.82; max-width: 840px; }
.article-content p { margin: 0 0 22px; }
.article-content p:first-child::first-letter { font-size: 3.2em; line-height: .9; float: left; margin: 8px 9px 0 0; font-weight: 800; color: var(--blue); }
.article-meta-box { margin-top: 38px; border: 1px solid var(--line); background: #f8fbfe; border-radius: 18px; overflow: hidden; }
.article-meta-box > div { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.article-meta-box > div:last-child { border-bottom: 0; }
.article-meta-box span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; }
.article-meta-box strong { font-size: 13px; line-height: 1.5; font-weight: 650; overflow-wrap: anywhere; }
.article-sidebar { min-width: 0; }
.sidebar-card { background: #10283f; color: #fff; border-radius: 22px; padding: 24px; }
.sidebar-kicker { color: #8ce2d8; text-transform: uppercase; letter-spacing: .12em; font-size: 11px; font-weight: 800; }
.sidebar-card h2 { font-size: 24px; line-height: 1.15; margin: 8px 0 10px; }
.sidebar-card p { color: #bed0df; font-size: 14px; margin: 0 0 20px; }
.sticky-card { position: sticky; top: 96px; }
.related-section { margin-top: 52px; }
.related-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; }
.related-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 20px; text-decoration: none; display: flex; flex-direction: column; min-height: 230px; transition: .18s ease; }
.related-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #b9cee1; }
.related-topic { color: var(--teal); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 12px; }
.related-card strong { font-size: 18px; line-height: 1.28; }
.related-desc { color: var(--muted); font-size: 13px; margin-top: 10px; }
.related-more { margin-top: auto; padding-top: 16px; color: var(--blue); font-weight: 800; font-size: 13px; }

.site-footer { background: var(--navy); color: #b8cadb; padding: 46px 0 22px; }
.footer-grid { display: flex; justify-content: space-between; gap: 40px; }
.footer-brand .brand-text { color: #fff; }
.footer-grid p { max-width: 520px; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { color: #c7d7e6; text-decoration: none; }
.footer-links a:hover { color: #fff; }
.footer-bottom { margin-top: 28px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.1); font-size: 12px; color: #7f99b1; }
.error-page { min-height: 60vh; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding-top: 70px; padding-bottom: 70px; }
.error-code { font-size: 80px; font-weight: 900; letter-spacing: -.06em; color: var(--blue); line-height: 1; }
.error-page h1 { font-size: 42px; margin: 10px 0; }
.error-page p { color: var(--muted); max-width: 580px; }

@media (max-width: 980px) {
  .hero-grid, .article-layout, .about-grid { grid-template-columns: 1fr; }
  .hero-panel { max-width: 680px; }
  .article-sidebar { display: none; }
  .related-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .about-grid { gap: 24px; }
}

@media (max-width: 720px) {
  .container { width: min(100% - 28px, 1180px); }
  .header-inner { height: 64px; }
  .top-nav a:last-child { display: none; }
  .hero { padding: 54px 0 48px; }
  .hero-grid { gap: 30px; }
  .hero h1 { font-size: clamp(38px, 12vw, 54px); }
  .stats { gap: 18px; }
  .stats div { min-width: 90px; }
  .catalog-section { padding: 54px 0; }
  .section-heading { display: block; }
  .section-heading > p { margin-top: 12px; }
  .category-card > summary { padding: 19px 16px; }
  .category-summary-main small { display: none; }
  .category-body { padding: 0 10px 10px; }
  .article-link-list { grid-template-columns: 1fr; }
  .article-link:nth-child(odd) { border-right: 0; }
  .article-card { border-radius: 20px; padding: 24px 20px; }
  .article-card h1 { font-size: clamp(33px, 10vw, 46px); }
  .article-meta-box > div { grid-template-columns: 1fr; gap: 5px; }
  .related-grid { grid-template-columns: 1fr; }
  .related-card { min-height: 0; }
  .footer-grid { flex-direction: column; }
}

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

.auth-page { padding: 70px 0; min-height: 60vh; }
.form-card { width: min(520px,100%); margin:0 auto; background:#fff; border:1px solid var(--line); border-radius:26px; padding:36px; box-shadow:var(--shadow); }
.form-card.wide { width:min(820px,100%); }
.form-card h1 { margin:0 0 25px; font-size:38px; letter-spacing:-.03em; }
.site-form { display:grid; gap:18px; }
.site-form label { display:grid; gap:8px; color:#40566d; font-weight:700; font-size:14px; }
.site-form input,.site-form textarea { width:100%; border:1px solid var(--line); border-radius:14px; padding:14px 16px; font:inherit; background:#fbfdff; color:var(--ink); }
.site-form input:focus,.site-form textarea:focus { outline:2px solid #cce3ff; border-color:var(--blue); }
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.alert,.success { padding:14px 16px; border-radius:14px; margin-bottom:18px; background:#fff1f1; color:#a33; }
.success { background:#e8f4f2; color:#117b70; }
@media(max-width:720px){.form-grid{grid-template-columns:1fr}.form-card{padding:24px}.form-card h1{font-size:32px}}


.comments-section{margin-top:40px;padding:30px;background:#fff;border-radius:24px}
.comment-form textarea{width:100%;min-height:120px;margin-bottom:15px;padding:15px;border:1px solid #ddd;border-radius:12px}
.comment-item{padding:15px 0;border-bottom:1px solid #eee}
.comment-item p{margin:8px 0 0}
