/* ИРО — общий слой стилей. Подключается во все страницы редизайна. */

/* Глобальный масштаб 150%: все rem-значения Tailwind вырастают × 1.5.
   16px → 24px базовый шрифт. Размеры, отступы, контейнеры — всё пропорционально. */
html {
  font-size: 150%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Мобильный — масштаб обратно к ~110%, чтобы не было горизонтального скролла */
@media (max-width: 640px) {
  html {
    font-size: 110%;
  }
}

/* Icons — SVG-спрайт (assets/icons.svg). <symbol> хранит только геометрию,
   обводка/заливка задаются здесь, как в исходных иконках Lucide. */
.lucide {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Typography */
body {
  font-family: "Inter", system-ui, sans-serif;
  color: #1a1a1a;
  background: #fbfaf6;
}
h1,
h2,
h3,
h4,
.serif {
  font-family: "Playfair Display", Georgia, serif;
}
.display {
  font-family: "Playfair Display", serif;
  letter-spacing: -0.025em;
  line-height: 1.05;
}

/* Tabular figures for dates, numbers, currency */
time,
.num,
.stat {
  font-variant-numeric: tabular-nums;
}

/* Focus ring — visible only when keyboard nav, never on click (a11y) */
*:focus {
  outline: none;
}
*:focus-visible {
  outline: 2px solid #c9933a;
  outline-offset: 3px;
  border-radius: 4px;
}

/* Skip-to-content link — appears only on Tab focus */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: #1f4e3d;
  color: #fff;
  padding: 12px 20px;
  border-radius: 0 0 12px 12px;
  font-weight: 500;
  z-index: 200;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 0;
}

/* Active/pressed feedback for clickable elements */
.btn-press {
  transition: transform 0.12s ease;
}
.btn-press:active {
  transform: scale(0.97);
}

/* News card image hover */
.news-card img {
  transition: transform 0.6s ease;
}
.news-card:hover img {
  transform: scale(1.04);
}

/* Hero patterns */
.hero-pattern {
  background-image:
    radial-gradient(circle at 18% 28%, rgba(201, 147, 58, 0.1) 0%, transparent 45%),
    radial-gradient(circle at 82% 72%, rgba(255, 255, 255, 0.04) 0%, transparent 45%);
}

/* Knowledge constellation (hero background) — decorative, GPU-only motion */
.constellation {
  pointer-events: none;
}
.cn-field {
  animation: cn-drift 15s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes cn-drift {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-22px, -14px, 0);
  }
}
.cn-twinkle {
  animation: cn-twinkle var(--d, 5s) ease-in-out infinite;
}
@keyframes cn-twinkle {
  0%,
  100% {
    opacity: 0.28;
  }
  50% {
    opacity: 1;
  }
}
.cn-halo {
  transform-box: fill-box;
  transform-origin: center;
  animation: cn-pulse var(--d, 7s) ease-in-out infinite;
}
@keyframes cn-pulse {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.14);
  }
}
/* Motion for .cn-* is already disabled by the global prefers-reduced-motion rule below. */

/* Large-text mode — "Версия для слабовидящих" (toggled in site.js) */
html.a11y-large {
  font-size: 185%;
}
@media (max-width: 640px) {
  html.a11y-large {
    font-size: 135%;
  }
}
html.a11y-large a {
  text-decoration: underline;
}
html.a11y-large .text-cream\/60,
html.a11y-large .text-cream\/70,
html.a11y-large .text-cream\/80 {
  --tw-text-opacity: 1 !important;
}
html.a11y-large .text-muted {
  color: #4a4a4a !important;
}

/* Underline-grow link */
.underline-grow {
  position: relative;
}
.underline-grow::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  height: 1px;
  width: 0;
  background: currentColor;
  transition: width 0.3s ease;
}
.underline-grow:hover::after {
  width: 100%;
}

/* Program tile */
.program-tile {
  aspect-ratio: 1;
}

/* Skyline decoration */
.skyline {
  height: 70px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1600 70' preserveAspectRatio='xMidYMax slice'><path fill='%23C9933A' fill-opacity='.18' d='M0,70 L0,55 L40,55 L40,40 L70,40 L70,28 L82,28 L82,18 L92,28 L92,40 L120,40 L120,32 L140,32 L140,42 L155,42 L155,30 L175,30 L175,42 L200,42 L200,55 L240,55 L240,38 L255,38 L255,22 L268,8 L281,22 L281,38 L300,38 L300,55 L340,55 L340,40 L370,40 L370,30 L385,30 L385,18 L398,30 L398,40 L420,40 L420,55 L460,55 L460,42 L490,42 L490,32 L510,32 L510,42 L540,42 L540,55 L580,55 L580,38 L605,38 L605,22 L618,12 L631,22 L631,38 L660,38 L660,55 L700,55 L700,40 L730,40 L730,28 L745,28 L745,16 L758,28 L758,40 L780,40 L780,55 L820,55 L820,42 L845,42 L845,28 L860,28 L860,42 L880,42 L880,55 L920,55 L920,38 L945,38 L945,22 L960,8 L975,22 L975,38 L1000,38 L1000,55 L1040,55 L1040,40 L1070,40 L1070,28 L1085,28 L1085,18 L1098,28 L1098,40 L1120,40 L1120,55 L1160,55 L1160,42 L1190,42 L1190,32 L1210,32 L1210,42 L1240,42 L1240,55 L1280,55 L1280,38 L1305,38 L1305,22 L1318,12 L1331,22 L1331,38 L1360,38 L1360,55 L1400,55 L1400,40 L1430,40 L1430,30 L1445,30 L1445,18 L1458,30 L1458,40 L1480,40 L1480,55 L1520,55 L1520,42 L1550,42 L1550,32 L1570,32 L1570,42 L1600,42 L1600,70 Z'/></svg>");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: bottom center;
}

/* Mega-menu */
.has-mega {
  position: static;
}
.mega-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: #fbfaf6;
  border-top: 1px solid #e8e4d9;
  border-bottom: 1px solid #e8e4d9;
  box-shadow: 0 24px 48px -16px rgba(15, 42, 32, 0.18);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease,
    visibility 0.25s;
  z-index: 50;
}
.has-mega:hover .mega-panel,
.has-mega:focus-within .mega-panel,
.mega-panel:hover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.mega-link {
  display: block;
  padding: 8px 0;
  color: #1a1a1a;
  transition: color 0.15s;
  font-size: 14px;
}
.mega-link:hover {
  color: #a67726;
}
.mega-link .arrow {
  opacity: 0;
  transition:
    opacity 0.15s,
    transform 0.15s;
  display: inline-block;
  margin-left: 6px;
}
.mega-link:hover .arrow {
  opacity: 1;
  transform: translateX(2px);
}

/* Search command palette */
.cmd-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 42, 32, 0.55);
  backdrop-filter: blur(6px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
  z-index: 100;
}
.cmd-overlay.open {
  display: flex;
}
.cmd-panel {
  width: 100%;
  max-width: 640px;
  background: #fbfaf6;
  border-radius: 20px;
  border: 1px solid #e8e4d9;
  overflow: hidden;
  box-shadow: 0 32px 64px -16px rgba(15, 42, 32, 0.4);
}

/* Breadcrumbs */
.crumb-sep {
  color: #c9933a;
  padding: 0 8px;
}

/* Filter chip */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 9999px;
  border: 1px solid #e8e4d9;
  background: #fbfaf6;
  font-size: 13px;
  color: #1a1a1a;
  transition: all 0.15s;
  cursor: pointer;
  user-select: none;
}
.chip:hover {
  border-color: #c9933a;
  color: #a67726;
}
.chip.active {
  background: #1f4e3d;
  border-color: #1f4e3d;
  color: #fff;
}

/* Doc row */
.doc-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 16px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid #e8e4d9;
}
.doc-row:hover {
  background: #f7f5ef;
}
.doc-row .icon {
  width: 40px;
  height: 40px;
  background: #f7f5ef;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Prose for article body */
.prose-iro {
  color: #1a1a1a;
}
.prose-iro p {
  margin: 0 0 1.1em;
  line-height: 1.7;
}
.prose-iro h2 {
  font-family: "Playfair Display", serif;
  font-size: 1.75rem;
  margin: 2em 0 0.8em;
  color: #1f4e3d;
}
.prose-iro h3 {
  font-family: "Playfair Display", serif;
  font-size: 1.35rem;
  margin: 1.6em 0 0.6em;
  color: #163a2d;
}
.prose-iro a {
  color: #a67726;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.prose-iro a:hover {
  color: #1f4e3d;
}
.prose-iro ul {
  padding-left: 1.4em;
  margin: 0 0 1.1em;
}
.prose-iro ul li {
  margin: 0.4em 0;
  list-style: disc;
}
.prose-iro blockquote {
  border-left: 3px solid #c9933a;
  padding: 4px 18px;
  color: #4a4a4a;
  font-style: italic;
  margin: 1.4em 0;
}

/* Search hint key */

/* Active page nav */
.nav-active {
  color: #a67726 !important;
}
.nav-active::after {
  width: 100% !important;
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
