/* Digital Kazakhstan — дизайн-система (v0.2)
 * Палитра «Deep Blue / Tech White» + сигнальные цвета телеметрии.
 * Inter Variable + JetBrains Mono для цифр / БИН / протоколов.
 */

:root {
  --dk-ink: #0B1E3B;
  --dk-ink-2: #14274A;
  --dk-muted: #5C6F82;
  --dk-surface: #FFFFFF;
  --dk-surface-soft: #F4F7FB;
  --dk-surface-band: #EEF3F9;
  --dk-accent: #1E6FE0;
  --dk-accent-2: #0D4FB8;
  --dk-signal: #00B27A;
  --dk-warn: #E89F2A;
  --dk-alarm: #D8413A;
  --dk-grid: rgba(11, 30, 59, .08);
  --dk-grid-strong: rgba(11, 30, 59, .18);
  --dk-radius: 10px;
  --dk-shadow-1: 0 1px 2px rgba(11, 30, 59, .04);
  --dk-shadow-2: 0 12px 32px -16px rgba(11, 30, 59, .18);
}

html { scroll-behavior: smooth; }

body {
  color: var(--dk-ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "cv11", "ss01", "ss03";
  background: var(--dk-surface);
}

h1, h2, h3, h4, h5, h6 { color: var(--dk-ink); letter-spacing: -.01em; }
h1, .display-5 { font-weight: 600; letter-spacing: -.02em; }

a { color: var(--dk-accent); }
a:hover { color: var(--dk-accent-2); }

code, pre, .dk-mono, .metric, .proof-value {
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

/* Navigation */
.navbar {
  box-shadow: var(--dk-shadow-1);
  backdrop-filter: saturate(180%) blur(8px);
  background: rgba(255, 255, 255, .92) !important;
}
.navbar .nav-link {
  white-space: nowrap;
  color: var(--dk-ink);
  font-weight: 500;
  position: relative;
}
.navbar .nav-link:hover { color: var(--dk-accent); }
.navbar .nav-link.dropdown-toggle::after {
  margin-left: .35em;
  opacity: .55;
}
.navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  letter-spacing: -.01em;
  color: var(--dk-ink);
}
.navbar-brand:hover { color: var(--dk-accent); }
.dk-brand-mark {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  background: var(--dk-accent);
  color: #fff;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-weight: 700;
  font-size: .85rem;
  letter-spacing: .01em;
}
.dk-brand-mark--on-dark {
  background: rgba(255, 255, 255, .12);
  color: #fff;
}
.navbar .dropdown-menu {
  border: 1px solid var(--dk-grid-strong);
  border-radius: 10px;
  padding: .35rem;
  box-shadow: var(--dk-shadow-2);
}
.navbar .dropdown-item {
  border-radius: 6px;
  padding: .45rem .75rem;
  font-weight: 500;
}
.navbar .dropdown-item:hover,
.navbar .dropdown-item:focus {
  background: var(--dk-surface-soft);
  color: var(--dk-accent);
}

/* Hero with engineering grid background */
.hero-band {
  position: relative;
  background:
    linear-gradient(135deg, #F7FBFF 0%, #EDF5F2 100%);
  overflow: hidden;
}
.hero-band::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--dk-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--dk-grid) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  opacity: .7;
  mask-image: radial-gradient(circle at 70% 30%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(circle at 70% 30%, #000 0%, transparent 75%);
}
.hero-band > .container { position: relative; z-index: 1; }

.hero-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.hero-tag {
  border: 1px solid rgba(30, 111, 224, .22);
  background: rgba(255, 255, 255, .82);
  border-radius: 999px;
  padding: .35rem .75rem;
  font-size: .85rem;
  color: #24435F;
  font-weight: 500;
}

.hero-proof {
  border: 1px solid var(--dk-grid-strong);
  border-radius: var(--dk-radius);
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(6px);
  padding: 1.25rem;
  box-shadow: var(--dk-shadow-2);
}
.proof-row {
  display: grid;
  grid-template-columns: minmax(7rem, 9rem) 1fr;
  gap: .75rem;
  padding: .75rem 0;
  border-top: 1px solid var(--dk-grid);
}
.proof-row:first-of-type { border-top: 0; }
.proof-label { color: var(--dk-muted); font-size: .85rem; }
.proof-value { font-weight: 600; }

/* Section helpers */
.section-band { background: var(--dk-surface-soft); }
.section-band-strong { background: var(--dk-surface-band); }
.page-lead { max-width: 920px; color: var(--dk-ink-2); }
.section-kicker {
  color: var(--dk-muted);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: .5rem;
}

/* Buttons */
.btn-primary {
  --bs-btn-bg: var(--dk-accent);
  --bs-btn-border-color: var(--dk-accent);
  --bs-btn-hover-bg: var(--dk-accent-2);
  --bs-btn-hover-border-color: var(--dk-accent-2);
  --bs-btn-active-bg: var(--dk-accent-2);
  --bs-btn-active-border-color: var(--dk-accent-2);
  font-weight: 500;
}
.btn-outline-primary {
  --bs-btn-color: var(--dk-accent);
  --bs-btn-border-color: var(--dk-accent);
  --bs-btn-hover-bg: var(--dk-accent);
  --bs-btn-hover-border-color: var(--dk-accent);
  font-weight: 500;
}

/* Cards */
.dk-card {
  border: 1px solid var(--dk-grid);
  border-radius: var(--dk-radius);
  background: var(--dk-surface);
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.dk-card:hover {
  border-color: rgba(30, 111, 224, .45);
  transform: translateY(-2px);
  box-shadow: var(--dk-shadow-2);
}
.dk-card .h2 { color: var(--dk-ink); }

/* KPI metric */
.metric {
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--dk-ink);
}
.kpi-card .metric-suffix { color: var(--dk-accent); font-weight: 600; }
.kpi-card .text-muted { color: var(--dk-muted) !important; }

/* Architecture SVG map */
.arch-map { width: 100%; height: auto; display: block; }
.arch-layer { cursor: pointer; transition: opacity .18s ease, transform .18s ease; }
.arch-layer:hover { opacity: .9; transform: translateY(-1px); }
.arch-layer .arch-box { fill: #FFFFFF; stroke: var(--dk-grid-strong); stroke-width: 1.2; }
.arch-layer:hover .arch-box { stroke: var(--dk-accent); }
.arch-layer.is-field   .arch-accent { fill: #5C6F82; }
.arch-layer.is-plc     .arch-accent { fill: #1E6FE0; }
.arch-layer.is-scada   .arch-accent { fill: #00B27A; }
.arch-layer.is-mes     .arch-accent { fill: #E89F2A; }
.arch-layer.is-analytics .arch-accent { fill: #6F42C1; }
.arch-flow {
  stroke: var(--dk-grid-strong);
  stroke-width: 1.4;
  fill: none;
  stroke-dasharray: 5 4;
  animation: dk-flow 1.6s linear infinite;
}
@keyframes dk-flow { to { stroke-dashoffset: -18; } }
.arch-label {
  fill: var(--dk-ink);
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 13px;
}
.arch-sub {
  fill: var(--dk-muted);
  font-family: "Inter", sans-serif;
  font-size: 11px;
}

/* System map (fallback list, still used in i18n driven sections) */
.system-map { display: grid; gap: .75rem; }
.system-layer {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 1rem;
  align-items: start;
  padding: 1rem;
  border: 1px solid var(--dk-grid);
  border-radius: var(--dk-radius);
  background: var(--dk-surface);
  transition: border-color .18s ease;
}
.system-layer:hover { border-color: rgba(30, 111, 224, .45); }
.system-layer-index {
  width: 2.5rem; height: 2.5rem; border-radius: 50%;
  display: grid; place-items: center;
  background: #E7F1FF;
  color: var(--dk-accent);
  font-weight: 700;
}

/* Glossary */
.glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.glossary-card {
  display: block;
  padding: 1rem 1.1rem;
  border: 1px solid var(--dk-grid);
  border-radius: var(--dk-radius);
  background: var(--dk-surface);
  text-decoration: none;
  color: var(--dk-ink);
  transition: border-color .18s ease, transform .18s ease;
}
.glossary-card:hover {
  border-color: rgba(30, 111, 224, .45);
  transform: translateY(-2px);
  color: var(--dk-ink);
}
.glossary-card .term {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-weight: 600;
  color: var(--dk-accent);
  font-size: 1.05rem;
}
.glossary-card .definition {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--dk-muted);
  margin-top: .35rem;
  font-size: .92rem;
}
.glossary-letter {
  display: inline-block;
  margin: 0 .25rem .25rem 0;
  padding: .15rem .5rem;
  border: 1px solid var(--dk-grid-strong);
  border-radius: 6px;
  font-family: "JetBrains Mono", monospace;
  font-weight: 600;
  font-size: .9rem;
  color: var(--dk-ink);
  text-decoration: none;
}
.glossary-letter:hover { background: var(--dk-accent); color: #fff; border-color: var(--dk-accent); }
.glossary-section-title {
  font-family: "JetBrains Mono", monospace;
  font-weight: 600;
  color: var(--dk-accent);
  border-bottom: 1px solid var(--dk-grid);
  padding-bottom: .3rem;
  margin-top: 1.5rem;
}

/* Directory of companies */
.directory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}
.company-card {
  display: flex;
  flex-direction: column;
}
.company-card h3 a { color: var(--dk-ink); }
.company-card h3 a:hover { color: var(--dk-accent); }

.filter-sidebar {
  position: sticky;
  top: 1rem;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .25rem .6rem;
  border-radius: 999px;
  border: 1px solid var(--dk-grid-strong);
  font-size: .85rem;
  color: var(--dk-ink);
  cursor: pointer;
  background: var(--dk-surface);
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.filter-chip:hover { border-color: var(--dk-accent); }
.filter-chip.is-active {
  background: var(--dk-accent);
  border-color: var(--dk-accent);
  color: #fff;
}
.filter-chip-count {
  display: inline-block;
  min-width: 1.4rem;
  padding: 0 .35rem;
  text-align: center;
  border-radius: 999px;
  background: var(--dk-surface-band);
  color: var(--dk-ink);
  font-size: .72rem;
  font-weight: 600;
}
.filter-chip.is-active .filter-chip-count { background: rgba(255, 
/* Inline icons (Lucide style) */
.dk-icon {
  flex-shrink: 0;
  vertical-align: -0.18em;
}
.dk-icon-accent { color: var(--dk-accent); }
.dk-icon-muted  { color: var(--dk-muted); }
.dk-icon-signal { color: var(--dk-signal); }
.dk-icon-warn   { color: var(--dk-warn); }

.dk-card .dk-card-icon {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  background: var(--dk-surface-soft);
  color: var(--dk-accent);
  margin-bottom: .85rem;
}
.dk-card:hover .dk-card-icon {
  background: var(--dk-accent);
  color: #fff;
  transition: background .18s ease, color .18s ease;
}

.navbar .dropdown-item .dk-icon {
  margin-right: .5rem;
  color: var(--dk-muted);
}
.navbar .dropdown-item:hover .dk-icon { color: var(--dk-accent); }

/* Breadcrumbs */
.dk-breadcrumbs {
  color: var(--dk-muted);
  border-bottom: 1px solid var(--dk-grid);
}
.dk-breadcrumbs a { color: var(--dk-muted); text-decoration: none; }
.dk-breadcrumbs a:hover { color: var(--dk-accent); text-decoration: underline; }
.dk-breadcrumbs [aria-current="page"] {
  color: var(--dk-ink);
  font-weight: 500;
}


/* Microanimations */
@keyframes dk-hero-drift {
  0%   { background-position: 0 0; }
  100% { background-position: 64px 64px; }
}
.hero-band::before {
  animation: dk-hero-drift 28s linear infinite;
}
.hero-tag {
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .12s ease;
}
.hero-tag:hover {
  border-color: var(--dk-accent);
  background: rgba(30, 111, 224, .08);
  transform: translateY(-1px);
}
.dk-card .dk-card-icon { transition: transform .18s ease, background .18s ease, color .18s ease; }
.dk-card:hover .dk-card-icon { transform: scale(1.06); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0s !important;
    transition-duration: 0s !important;
    scroll-behavior: auto !important;
  }
  .hero-band::before { animation: none !important; }
  .arch-flow { animation: none !important; stroke-dasharray: 0 !important; }
}

/* National project roadmap timeline */
.dk-roadmap {
  position: relative;
  padding-left: 100px;
}
.dk-roadmap::before {
  content: "";
  position: absolute;
  left: 50px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--dk-grid-strong);
}
.dk-roadmap-phase {
  position: relative;
  margin-bottom: 1.5rem;
}
.dk-roadmap-marker {
  position: absolute;
  left: -85px;
  top: 0;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--dk-surface);
  border: 3px solid var(--dk-grid-strong);
  display: grid;
  place-items: center;
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  color: var(--dk-ink);
  z-index: 1;
}
.dk-roadmap-phase.is-current .dk-roadmap-marker {
  border-color: var(--dk-accent);
  background: var(--dk-accent);
  color: #fff;
  box-shadow: 0 0 0 6px rgba(30, 111, 224, .14);
}
.dk-roadmap-phase.is-current .dk-roadmap-card { border-color: var(--dk-accent); }
.dk-roadmap-card ul { padding-left: 1.2rem; }
@media (max-width: 575.98px) {
  .dk-roadmap { padding-left: 60px; }
  .dk-roadmap::before { left: 24px; }
  .dk-roadmap-marker { left: -50px; width: 50px; height: 50px; font-size: .8rem; }
}

/* ROI Calculator */
.dk-roi {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  background: var(--dk-surface-soft);
  border-radius: 12px;
  padding: 1.5rem;
}
.dk-roi .dk-roi-controls { display: grid; gap: 1rem; }
.dk-roi .dk-roi-row { display: grid; gap: .35rem; }
.dk-roi .dk-roi-row label {
  font-size: .85rem;
  color: var(--dk-muted);
  display: flex; justify-content: space-between; gap: .5rem;
}
.dk-roi .dk-roi-row input[type="range"] { width: 100%; }
.dk-roi .dk-roi-out {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .85rem;
}
.dk-roi .dk-roi-card {
  background: #FFFFFF;
  border: 1px solid var(--dk-grid);
  border-radius: 10px;
  padding: 1rem;
}
.dk-roi .dk-roi-card .label { font-size: .78rem; color: var(--dk-muted); text-transform: uppercase; letter-spacing: .08em; }
.dk-roi .dk-roi-card .value { font-family: "JetBrains Mono", monospace; font-weight: 700; font-size: 1.3rem; color: var(--dk-ink); margin-top: .25rem; }
.dk-roi .dk-roi-card .value-accent { color: var(--dk-signal); }
.dk-roi .dk-roi-chart { background: #FFFFFF; border: 1px solid var(--dk-grid); border-radius: 10px; padding: 1rem; margin-top: 1rem; }
.dk-roi-cta { margin-top: 1rem; }
.dk-roi-formula { font-size: .85rem; color: var(--dk-muted); margin-top: .75rem; }

@media (max-width: 767.98px) {
  .dk-roi { grid-template-columns: 1fr; }
}

/* Content imagery: hero photos */
.hero-art {
  width: 100%;
  max-height: 420px;
  overflow: hidden;
  background: var(--dk-ink);
  position: relative;
}
.hero-art::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11,30,59,0) 40%, rgba(11,30,59,.55) 100%);
  pointer-events: none;
}
.hero-art img {
  width: 100%;
  height: 420px;
  object-fit: cover;
  display: block;
}

.case-hero, .press-cover-hero {
  width: 100%;
  height: 320px;
  background: var(--dk-ink);
  border-bottom: 1px solid var(--dk-grid);
  overflow: hidden;
  position: relative;
}
.case-hero img, .press-cover-hero img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  display: block;
}
.case-hero::after, .press-cover-hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11,30,59,0) 55%, rgba(11,30,59,.4) 100%);
  pointer-events: none;
}

.case-card, .press-card { overflow: hidden; }
.case-hero-thumb, .press-cover-thumb {
  width: 100%;
  background: var(--dk-ink);
  border-bottom: 1px solid var(--dk-grid);
  overflow: hidden;
  position: relative;
}
.case-hero-thumb img, .press-cover-thumb img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  transition: transform .35s ease;
}
.case-card:hover .case-hero-thumb img,
.press-card:hover .press-cover-thumb img {
  transform: scale(1.04);
}

@media (max-width: 575.98px) {
  .hero-art, .hero-art img { height: 240px; max-height: 240px; }
  .case-hero, .case-hero img, .press-cover-hero, .press-cover-hero img { height: 200px; }
}

/* Kazakhstan map: Leaflet + OSM */
.dk-kz-map-wrap {
  background: var(--dk-surface-soft);
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--dk-grid);
}
.dk-kz-leaflet {
  height: 480px;
  width: 100%;
  background: var(--dk-surface-soft);
  z-index: 0;
}
.dk-kz-divicon { background: transparent; border: 0; }
.dk-kz-marker-html {
  border-radius: 50%;
  border: 2px solid #5C6F82;
  text-align: center;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 4px 12px -2px rgba(11, 30, 59, .22);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s ease, box-shadow .15s ease;
  cursor: pointer;
}
.dk-kz-marker-html:hover {
  transform: scale(1.12);
  box-shadow: 0 8px 18px -2px rgba(30, 111, 224, .35);
  z-index: 999;
}
.dk-kz-marker-html.is-active { box-shadow: 0 6px 16px -2px rgba(30, 111, 224, .45); }
.dk-kz-pin-dot { color: var(--dk-muted); font-size: 18px; }

.dk-kz-popup { font-family: "Inter", sans-serif; min-width: 200px; }
.dk-kz-popup-title { font-weight: 600; color: var(--dk-ink); margin-bottom: .35rem; }
.dk-kz-popup-meta { color: var(--dk-muted); font-size: .88rem; margin-bottom: .55rem; }
.dk-kz-popup-link { color: var(--dk-accent); font-weight: 500; text-decoration: none; font-size: .92rem; }
.dk-kz-popup-link:hover { text-decoration: underline; }

.dk-kz-scroll-hint {
  background: rgba(11, 30, 59, .82);
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  font-family: "Inter", sans-serif;
  font-size: .76rem;
  margin: 8px;
  backdrop-filter: blur(4px);
}

.leaflet-control-attribution {
  background: rgba(255, 255, 255, .85) !important;
  font-family: "Inter", sans-serif !important;
  font-size: .72rem !important;
}
