/* ==========================================================================
   Синапс — Моят дигитален свят
   Един файл със стилове за всички страници.

   1. Шрифтове            7. Начална страница
   2. Цветове и мерки     8. Информация
   3. Основа              9. Галерия
   4. Помощни класове    10. Контакти
   5. Хедър и меню       11. Футър
   6. Общи елементи      12. Печат
   ========================================================================== */


/* 1. Шрифтове --------------------------------------------------------------
   Sofia Sans е създаден от българското студио Lettersoup и показва
   българската форма на кирилицата. Файловете са в папка fonts/, така че
   сайтът изглежда еднакво и без интернет. */

@font-face {
  font-family: "Sofia Sans";
  src: url("../fonts/sofia-sans.woff2") format("woff2");
  font-weight: 1 1000;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Sofia Sans Extra Condensed";
  src: url("../fonts/sofia-sans-extra-condensed.woff2") format("woff2");
  font-weight: 1 1000;
  font-style: normal;
  font-display: swap;
}


/* 2. Цветове и мерки -------------------------------------------------------
   Палитрата идва от viridis: скалата, с която учените оцветяват данни.
   Тя се чете добре и от хора с нарушено цветоусещане. Пълният преход от
   лилаво към жълто се появява само там, където показва числа. */

:root {
  --violet: #440154;
  --indigo: #3B528B;
  --teal: #21918C;
  --green: #5EC962;
  --yellow: #FDE725;
  --latent: #150B22;
  --viridis: linear-gradient(90deg, #440154, #482878 12.5%, #3E4989 25%, #31688E 37.5%, #26828E 50%, #1F9E89 62.5%, #35B779 75%, #6ECE58 87.5%, #FDE725);

  --bg: #F5F3F9;
  --surface: #FFFFFF;
  --surface-2: #ECE8F3;
  --text: #1C1030;
  --text-2: #4F4566;
  --line: rgba(28, 16, 48, 0.13);
  --line-strong: rgba(28, 16, 48, 0.3);
  --control: #7E7590;
  --link: #0E6B66;
  --focus: #21918C;
  --mark: #440154;
  --error: #B3261E;
  --btn-bg: #1C1030;
  --btn-text: #F5F3F9;
  --btn-hover: #440154;
  --band-bg: #150B22;
  --band-text: #F1EEF7;
  --band-text-2: #B9AFCC;
  --shadow: 0 24px 48px -24px rgba(21, 11, 34, 0.35);
  color-scheme: light;

  --font-text: "Sofia Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Sofia Sans Extra Condensed", "Sofia Sans", "Arial Narrow", sans-serif;

  --wrap: 77.5rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --section: clamp(4rem, 8vw, 6.5rem);
  --radius: 10px;
  --header-h: 4.5rem;
}

/* Тъмна тема: по системната настройка или чрез бутона в хедъра */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #150B22;
    --surface: #21162F;
    --surface-2: #2B1E3D;
    --text: #F1EEF7;
    --text-2: #B9AFCC;
    --line: rgba(241, 238, 247, 0.12);
    --line-strong: rgba(241, 238, 247, 0.28);
    --control: #8A7FA3;
    --link: #5ED3C7;
    --focus: #5ED3C7;
    --mark: #FDE725;
    --error: #FF8A80;
    --btn-bg: #F1EEF7;
    --btn-text: #150B22;
    --btn-hover: #FDE725;
    --band-bg: #21162F;
    --shadow: 0 24px 48px -20px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #150B22;
  --surface: #21162F;
  --surface-2: #2B1E3D;
  --text: #F1EEF7;
  --text-2: #B9AFCC;
  --line: rgba(241, 238, 247, 0.12);
  --line-strong: rgba(241, 238, 247, 0.28);
  --control: #8A7FA3;
  --link: #5ED3C7;
  --focus: #5ED3C7;
  --mark: #FDE725;
  --error: #FF8A80;
  --btn-bg: #F1EEF7;
  --btn-text: #150B22;
  --btn-hover: #FDE725;
  --band-bg: #21162F;
  --shadow: 0 24px 48px -20px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}


/* 3. Основа ---------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1.5rem);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-text);
  font-size: 1.125rem;
  line-height: 1.6;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  flex: 1;
}

img,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

img,
video {
  height: auto;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
  text-wrap: balance;
}

h3 {
  font-size: 1.375rem;
  font-weight: 700;
}

p,
ul,
ol {
  margin: 0 0 1rem;
}

p {
  text-wrap: pretty;
}

a {
  color: var(--link);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 3px;
}

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

::selection {
  background: var(--yellow);
  color: #1C1030;
}

strong {
  font-weight: 700;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* 4. Помощни класове ------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius);
  background: var(--btn-bg);
  color: var(--btn-text);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}


/* 5. Хедър и меню ---------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
}

.header-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-right: auto;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  width: 1.625rem;
  height: 1.625rem;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  padding-bottom: 0.15em;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-link {
  position: relative;
  display: inline-block;
  padding: 0.55rem 0.8rem;
  color: var(--text);
  font-weight: 550;
  text-decoration: none;
}

/* Ефект при посочване: линия, която се „изтегля“ отляво надясно */
.nav-link::after {
  content: "";
  position: absolute;
  left: 0.8rem;
  right: 0.8rem;
  bottom: 0.3rem;
  height: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.nav-link:hover::after {
  transform: scaleX(1);
}

.nav-link[aria-current="page"]::after {
  height: 3px;
  background: var(--mark);
  transform: scaleX(1);
}

/* Падащо меню */
.has-sub {
  position: relative;
  display: flex;
  align-items: center;
}

.has-sub > .nav-link {
  padding-right: 0.2rem;
}

.has-sub > .nav-link::after {
  right: 0.2rem;
}

.sub-toggle {
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 2.5rem;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: none;
  cursor: pointer;
}

.sub-toggle::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  margin-top: -0.25rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.sub-toggle[aria-expanded="true"]::before {
  margin-top: 0.2rem;
  transform: rotate(-135deg);
}

.sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 5;
  min-width: 15.5rem;
  margin: 0;
  padding: 0.5rem;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
}

/* Невидим „мост“, за да не се затваря менюто, докато мишката слиза към него */
.sub-menu::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -0.75rem;
  height: 0.75rem;
}

.sub-toggle[aria-expanded="true"] + .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}

@media (hover: hover) and (min-width: 861px) {
  .has-sub:hover .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition-delay: 0s;
  }
}

.sub-menu a {
  display: block;
  padding: 0.55rem 0.75rem;
  white-space: nowrap;
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  text-decoration: none;
}

.sub-menu a:hover {
  background: var(--surface-2);
}

.theme-toggle,
.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-width: 2.75rem;
  height: 2.75rem;
  padding: 0 0.6rem;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  background: none;
  cursor: pointer;
}

.theme-toggle:hover,
.menu-toggle:hover {
  border-color: var(--text);
}

.theme-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
  transition: transform 0.4s ease;
}

.theme-toggle[aria-pressed="true"] svg {
  transform: rotate(180deg);
}

.menu-toggle {
  display: none;
  font-weight: 600;
}

.menu-icon {
  position: relative;
  width: 1.1rem;
  height: 2px;
  background: currentColor;
  transition: background 0.2s ease;
}

.menu-icon::before,
.menu-icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  transition: transform 0.2s ease;
}

.menu-icon::before {
  transform: translateY(-6px);
}

.menu-icon::after {
  transform: translateY(6px);
}

.menu-toggle[aria-expanded="true"] .menu-icon {
  background: transparent;
}

.menu-toggle[aria-expanded="true"] .menu-icon::before {
  transform: rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-icon::after {
  transform: rotate(-45deg);
}

/* Мобилно меню */
@media (max-width: 860px) {
  .js .menu-toggle {
    display: inline-flex;
  }

  .js .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
    padding: 0.5rem var(--gutter) 1.75rem;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
  }

  .js .site-nav.is-open {
    display: block;
  }

  .js .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .js .nav-list > li {
    border-bottom: 1px solid var(--line);
  }

  .js .nav-link {
    display: block;
    padding: 0.8rem 0;
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 750;
    line-height: 1.1;
  }

  .js .nav-link::after {
    left: 0;
    right: auto;
    width: 2.5rem;
    bottom: 0.5rem;
  }

  .js .has-sub {
    flex-direction: column;
    align-items: stretch;
  }

  .js .sub-toggle {
    display: none;
  }

  .js .sub-menu {
    position: static;
    min-width: 0;
    padding: 0 0 0.75rem;
    background: none;
    border: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .js .sub-menu a {
    padding: 0.4rem 0;
    color: var(--text-2);
  }

  /* Без JavaScript менюто просто се пренася на нов ред */
  html:not(.js) .header-bar {
    flex-wrap: wrap;
    padding-block: 0.75rem;
  }

  html:not(.js) .site-nav {
    order: 3;
    width: 100%;
  }

  html:not(.js) .nav-list {
    flex-wrap: wrap;
  }

  html:not(.js) .sub-toggle,
  html:not(.js) .sub-menu {
    display: none;
  }
}


/* 6. Общи елементи --------------------------------------------------------- */

.section {
  padding-block: var(--section);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 1.6rem + 3vw, 4rem);
  font-weight: 820;
  line-height: 0.95;
  letter-spacing: -0.005em;
}

.lead {
  max-width: 34em;
  font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.4375rem);
  line-height: 1.5;
  color: var(--text-2);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.7rem 1.35rem;
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn-primary {
  background: var(--btn-bg);
  color: var(--btn-text);
}

.btn-primary:hover {
  background: var(--btn-hover);
}

.btn-ghost {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--text);
}

.btn-small {
  min-height: 2.5rem;
  padding: 0.45rem 0.95rem;
  font-size: 1rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Голямо изображение с надпис под него */
.figure {
  margin-block: 0;
}

.figure img {
  width: 100%;
  background: var(--latent);
}

.figure figcaption {
  max-width: 46em;
  margin-top: 0.9rem;
  font-size: 1rem;
  color: var(--text-2);
}

/* Път до страницата */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.75rem;
  padding: 0;
  list-style: none;
  font-size: 1rem;
  color: var(--text-2);
}

.breadcrumbs li + li::before {
  content: "/";
  margin-right: 0.5rem;
  opacity: 0.6;
}

.breadcrumbs a {
  color: inherit;
}

/* Заглавна част на вътрешните страници */
.page-head {
  padding-block: clamp(2.5rem, 6vw, 5rem) clamp(2.5rem, 5vw, 4rem);
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(3.75rem, 1.4rem + 8vw, 8.5rem);
  font-weight: 860;
  line-height: 0.88;
  letter-spacing: -0.01em;
}

.page-head .lead {
  margin-top: 1.75rem;
}

/* Цветни квадратчета вместо точки в списъците */
.pixel-list {
  padding: 0;
  list-style: none;
}

.pixel-list li {
  position: relative;
  padding-left: 1.6rem;
  margin-bottom: 0.65rem;
}

.pixel-list li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 0.6em;
  width: 0.5rem;
  height: 0.5rem;
  background: var(--text);
}


/* 7. Начална страница ------------------------------------------------------ */

.hero {
  padding-block: clamp(2rem, 5vw, 4rem) var(--section);
}

.hero-grid {
  display: grid;
  gap: clamp(2.5rem, 5vw, 4rem);
}

.kicker {
  margin-bottom: 1.25rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-2);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(4.25rem, 1.6rem + 9vw, 9.75rem);
  font-weight: 880;
  line-height: 0.84;
  letter-spacing: -0.012em;
}

.hero-title span {
  display: block;
}

.hero-text .lead {
  margin-top: 2rem;
}

.hero-text .actions {
  margin-top: 2rem;
}

@media (min-width: 1040px) {
  .hero-grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    align-items: start;
  }

  .hero-text {
    padding-top: 2.25rem;
  }
}

/* Живата мрежа */
.playground {
  display: grid;
  gap: 1.1rem;
  min-width: 0;
}

.pg-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
}

.pg-title {
  font-size: 1.125rem;
  font-weight: 700;
}

.pg-status {
  margin: 0;
  font-size: 1rem;
  color: var(--text-2);
}

.pg-stage {
  position: relative;
  aspect-ratio: 1;
  background: var(--latent);
  overflow: hidden;
}

.pg-canvas {
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: manipulation;
}

.pg-stage noscript img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Без JavaScript се показва снимка на обучена мрежа вместо живото демо */
html:not(.js) .pg-canvas,
html:not(.js) .pg-status,
html:not(.js) .pg-stats,
html:not(.js) .pg-controls,
html:not(.js) .pg-hint {
  display: none;
}

.pg-legend {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9375rem;
  color: var(--text-2);
}

.pg-ramp {
  height: 0.6rem;
  background: var(--viridis);
}

.pg-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 0;
  padding: 1rem 0;
  border-block: 1px solid var(--line);
}

.pg-stats dt {
  font-size: 0.9375rem;
  color: var(--text-2);
}

.pg-stats dd {
  margin: 0.15rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 1.4rem + 1vw, 2.25rem);
  font-weight: 750;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.pg-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem 1.5rem;
}

.choice {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.choice legend {
  margin-bottom: 0.45rem;
  padding: 0;
  font-size: 0.9375rem;
  color: var(--text-2);
}

.choice-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.choice label {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.5rem;
  padding: 0.35rem 0.95rem;
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 550;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.choice label:hover {
  border-color: var(--text);
}

.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice label:has(input:checked) {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

.choice label:has(input:focus-visible) {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.dot {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
}

.dot-0 {
  background: var(--violet);
  box-shadow: 0 0 0 1.5px #FFFFFF;
}

.dot-1 {
  background: var(--yellow);
  box-shadow: 0 0 0 1.5px #150B22;
}

.pg-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pg-hint,
.pg-note {
  margin: 0;
  font-size: 1rem;
  color: var(--text-2);
}

/* Какво е ИИ */
.intro-grid {
  display: grid;
  gap: 1.5rem 4rem;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.intro-text p {
  max-width: 36em;
}

.intro-text p:first-child {
  font-size: 1.3125rem;
  line-height: 1.5;
}

@media (min-width: 900px) {
  .intro-grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  }
}

/* Четирите стъпки на обучението */
.steps-head {
  display: grid;
  gap: 1rem 4rem;
  align-items: end;
}

.steps-head p {
  max-width: 34em;
  margin: 0;
  color: var(--text-2);
}

@media (min-width: 900px) {
  .steps-head {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  }
}

.step-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 2.5rem 2rem;
  margin: clamp(2.5rem, 5vw, 4rem) 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.step-list li {
  counter-increment: step;
  padding-top: 1.25rem;
  border-top: 4px solid var(--step-color);
}

.step-list li::before {
  content: counter(step);
  display: block;
  margin-bottom: 1rem;
  font-family: var(--font-display);
  font-size: 4.5rem;
  font-weight: 800;
  line-height: 0.8;
}

.step-list h3 {
  margin-bottom: 0.5rem;
}

.step-list p {
  margin: 0;
  color: var(--text-2);
}

/* Разгледай сайта */
.path-list {
  margin: clamp(2rem, 4vw, 3rem) 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line-strong);
}

.path {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 6.5rem;
  align-items: center;
  gap: 0.5rem 1.25rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line-strong);
  color: var(--text);
  text-decoration: none;
}

.path-name {
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 1.6rem + 3.6vw, 5rem);
  font-weight: 820;
  line-height: 0.95;
  transition: color 0.2s ease, transform 0.3s ease;
}

.path-desc {
  grid-column: 1;
  max-width: 30em;
  color: var(--text-2);
}

.path-thumb {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--latent);
}

.path:hover .path-name {
  color: var(--mark);
  transform: translateX(0.5rem);
}

@media (min-width: 800px) {
  .path {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr) 9rem;
    gap: 2rem;
    padding: 1.75rem 0;
  }

  .path-desc {
    grid-column: 2;
    margin: 0;
  }

  .path-thumb {
    grid-column: 3;
    grid-row: 1;
    aspect-ratio: 16 / 10;
  }
}

/* Цитат */
.quote-band {
  padding-block: var(--section);
  background: var(--band-bg);
  color: var(--band-text);
}

.quote {
  margin: 0;
}

.quote blockquote {
  margin: 0;
}

.quote blockquote p {
  max-width: 21ch;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 1.3rem + 4.2vw, 5.5rem);
  font-weight: 760;
  line-height: 0.98;
  text-wrap: balance;
}

.quote figcaption {
  margin-top: 2rem;
  font-size: 1.0625rem;
  color: var(--band-text-2);
}


/* 8. Информация ------------------------------------------------------------ */

.article-grid {
  display: grid;
  gap: 2rem 4rem;
  padding-block: clamp(3rem, 6vw, 5rem) var(--section);
}

@media (min-width: 1000px) {
  .article-grid {
    grid-template-columns: 15rem minmax(0, 1fr);
  }
}

.toc {
  align-self: start;
  font-size: 1rem;
}

.toc-title {
  margin-bottom: 0.75rem;
  font-size: 1rem;
  font-weight: 700;
}

.toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
  border-left: 1px solid var(--line-strong);
}

.toc a {
  display: block;
  margin-left: -1px;
  padding: 0.35rem 0 0.35rem 1rem;
  border-left: 3px solid transparent;
  color: var(--text-2);
  text-decoration: none;
}

.toc a:hover {
  color: var(--text);
}

.toc a[aria-current="true"] {
  border-left-color: var(--mark);
  color: var(--text);
  font-weight: 650;
}

@media (min-width: 1000px) {
  .toc {
    position: sticky;
    top: calc(var(--header-h) + 2rem);
  }
}

@media (max-width: 999px) {
  .toc {
    padding: 1.25rem 1.5rem;
    background: var(--surface-2);
  }

  .toc ul {
    columns: 2 12rem;
    border: 0;
  }

  .toc a {
    padding-left: 0;
    border: 0;
  }
}

.article {
  max-width: 44rem;
}

.article > section + section {
  margin-top: clamp(3.5rem, 7vw, 5.5rem);
}

.article h2 {
  margin-bottom: 1.25rem;
}

.article h3 {
  margin: 2.25rem 0 0.6rem;
}

/* Хронология: цветът на квадратчето показва годината (лилаво = 1950, жълто = 2024) */
.timeline {
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 4.25rem minmax(0, 1fr);
  gap: 0 2.25rem;
  padding-bottom: 1.75rem;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: calc(4.25rem + 0.85rem);
  top: 0.35rem;
  width: 0.75rem;
  height: 0.75rem;
  background: var(--c);
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 4px var(--line-strong);
}

.timeline li::after {
  content: "";
  position: absolute;
  left: calc(4.25rem + 1.2rem);
  top: 1.5rem;
  bottom: 0.1rem;
  width: 1px;
  background: var(--line-strong);
}

.timeline li:last-child::after {
  display: none;
}

.timeline time {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.timeline p {
  margin: 0;
}

/* Пътят на един модел */
.number-list {
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: num;
}

.number-list li {
  position: relative;
  counter-increment: num;
  padding: 0 0 1rem 3rem;
}

.number-list li::before {
  content: counter(num);
  position: absolute;
  left: 0;
  top: -0.1rem;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 1.5px solid var(--text);
  border-radius: 50%;
  font-size: 1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Таблица */
.table-wrap {
  margin: 2.25rem 0;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
  line-height: 1.45;
}

caption {
  padding-bottom: 1rem;
  caption-side: top;
  text-align: left;
  font-size: 1.1875rem;
  font-weight: 700;
}

th,
td {
  padding: 0.9rem 1rem 0.9rem 0;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line-strong);
}

thead th {
  padding-top: 0;
  border-bottom: 2px solid var(--text);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-2);
}

tbody th {
  width: 30%;
  font-weight: 700;
}

tbody tr:hover {
  background: var(--surface-2);
}

/* На тесен екран всеки ред на таблицата става отделна карта */
@media (max-width: 640px) {
  .table-wrap table,
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap th,
  .table-wrap td {
    display: block;
    width: auto;
  }

  .table-wrap caption {
    display: block;
  }

  .table-wrap thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .table-wrap tr {
    padding: 1rem 0;
    border-bottom: 1px solid var(--line-strong);
  }

  .table-wrap th,
  .table-wrap td {
    padding: 0.2rem 0;
    border: 0;
  }

  .table-wrap tbody th {
    font-size: 1.1875rem;
  }

  .table-wrap td::before {
    content: attr(data-label) ": ";
    font-weight: 600;
    color: var(--text-2);
  }
}

.sources {
  font-size: 1rem;
}

.sources li {
  margin-bottom: 0.5rem;
}


/* 9. Галерия --------------------------------------------------------------- */

/* Подравнени редове: ширината на всяка картина е пропорционална на формата ѝ
   (--ar = ширина / височина), затова картините в един ред са еднакво високи. */
.gallery {
  display: grid;
  gap: clamp(2.5rem, 5vw, 3.5rem);
}

.art-row {
  display: flex;
  align-items: flex-start;
  gap: clamp(1rem, 2.2vw, 1.75rem);
}

.art {
  flex: var(--ar) 1 0%;
  min-width: 0;
  margin: 0;
}

@media (max-width: 720px) {
  .art-row {
    flex-direction: column;
    gap: 2.5rem;
  }

  .art {
    flex: none;
    width: 100%;
  }
}

.art-link {
  display: block;
  overflow: hidden;
  background: var(--latent);
  cursor: zoom-in;
}

.art-link img {
  width: 100%;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.art-link:hover img {
  transform: scale(1.04);
}

.art figcaption {
  padding-top: 0.9rem;
}

.art-title {
  margin-bottom: 0.3rem;
  font-size: 1.25rem;
}

.art-text {
  margin: 0;
  font-size: 1rem;
  color: var(--text-2);
}

/* Видео */
.video-grid {
  display: grid;
  gap: 2rem 4rem;
  align-items: start;
}

@media (min-width: 1000px) {
  .video-grid {
    grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  }
}

.video-frame {
  margin: 0;
  background: var(--latent);
}

.video-frame video {
  width: 100%;
  aspect-ratio: 16 / 9;
}

.video-text .section-title {
  margin-bottom: 1.5rem;
}

.video-text p {
  color: var(--text-2);
}

.video-steps {
  margin: 1.5rem 0;
}

/* Преглед на цял екран (HTML елементът dialog) */
.lightbox {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #F1EEF7;
}

.lightbox::backdrop {
  background: rgba(13, 6, 22, 0.94);
}

.lightbox[open] {
  animation: lb-in 0.25s ease;
}

@keyframes lb-in {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
}

.lb-figure {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 1rem;
  height: 100%;
  margin: 0;
  padding: 4.25rem clamp(1rem, 7vw, 6rem) 1.5rem;
}

.lb-img {
  align-self: center;
  justify-self: center;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.lb-caption {
  max-width: 44rem;
  margin-inline: auto;
  text-align: center;
}

.lb-title {
  font-size: 1.25rem;
}

.lb-text {
  margin: 0.25rem 0;
  font-size: 1rem;
  color: #B9AFCC;
}

.lb-count {
  margin: 0;
  font-size: 0.9375rem;
  color: #B9AFCC;
  font-variant-numeric: tabular-nums;
}

.lb-btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: 1.5px solid rgba(241, 238, 247, 0.35);
  border-radius: 50%;
  background: rgba(21, 11, 34, 0.6);
  color: #F1EEF7;
  cursor: pointer;
}

.lb-btn:hover {
  border-color: #F1EEF7;
}

.lb-btn svg {
  width: 1.25rem;
  height: 1.25rem;
}

.lb-close {
  top: 1rem;
  right: 1rem;
}

.lb-prev,
.lb-next {
  top: 50%;
  transform: translateY(-50%);
}

.lb-prev {
  left: 1rem;
}

.lb-next {
  right: 1rem;
}

@media (max-width: 640px) {
  .lb-figure {
    padding-bottom: 5rem;
  }

  .lb-prev,
  .lb-next {
    top: auto;
    bottom: 1rem;
    transform: none;
  }
}


/* 10. Контакти ------------------------------------------------------------- */

.contact-grid {
  display: grid;
  gap: clamp(3rem, 6vw, 5rem);
  padding-bottom: var(--section);
}

@media (min-width: 960px) {
  .contact-grid {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  }
}

.contact-form {
  max-width: 40rem;
}

.form-title {
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

.field {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 1.4rem;
}

.field label {
  font-weight: 650;
}

.optional {
  font-weight: 400;
  color: var(--text-2);
}

.input {
  width: 100%;
  min-height: 3rem;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--control);
  border-radius: var(--radius);
  background: var(--surface);
  line-height: 1.4;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input:hover {
  border-color: var(--text);
}

.input:focus-visible {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 35%, transparent);
}

textarea.input {
  min-height: 10rem;
  resize: vertical;
}

select.input {
  appearance: none;
  padding-right: 2.75rem;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 1.35rem) 55%, calc(100% - 1rem) 55%;
  background-size: 0.35rem 0.35rem;
  background-repeat: no-repeat;
}

.input[aria-invalid="true"] {
  border-color: var(--error);
}

.field-hint,
.field-meta {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-2);
}

.field-meta {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.field-error {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--error);
}

.form-status {
  margin: 1.25rem 0 0;
  font-weight: 600;
}

.form-status:empty {
  display: none;
}

.form-status.is-success {
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--teal);
  background: var(--surface-2);
}

.contact-aside {
  display: grid;
  gap: 3rem;
  align-content: start;
}

.aside-title {
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.email-link {
  display: inline-block;
  margin-bottom: 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem);
  font-weight: 750;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.copy-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.copy-status {
  font-size: 1rem;
  color: var(--text-2);
}

.author-card {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.author-card img {
  width: 100%;
  aspect-ratio: 1;
}

.author-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}

.author-role {
  margin: 0.35rem 0 0;
  color: var(--text-2);
}

.tech-title {
  margin: 1.75rem 0 0.75rem;
  font-size: 1.125rem;
}

.tech-list {
  font-size: 1rem;
}

/* Въпроси и отговори (елементите details и summary) */
.faq {
  padding-bottom: var(--section);
}

.faq-list {
  max-width: 50rem;
  margin-top: 2rem;
  border-bottom: 1px solid var(--line-strong);
}

.faq details {
  border-top: 1px solid var(--line-strong);
}

.faq summary {
  position: relative;
  padding: 1.15rem 3rem 1.15rem 0;
  font-size: 1.1875rem;
  font-weight: 650;
  list-style: none;
  cursor: pointer;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::before,
.faq summary::after {
  content: "";
  position: absolute;
  right: 0.5rem;
  top: 50%;
  width: 1rem;
  height: 2px;
  background: currentColor;
  transition: transform 0.25s ease;
}

.faq summary::after {
  transform: rotate(90deg);
}

.faq details[open] summary::after {
  transform: rotate(0deg);
}

.faq details p {
  max-width: 42em;
  margin: 0;
  padding: 0 0 1.4rem;
  color: var(--text-2);
}


/* 11. Футър ---------------------------------------------------------------- */

.site-footer {
  padding-block: 3.5rem 2rem;
  border-top: 1px solid var(--line);
  font-size: 1rem;
}

.footer-grid {
  display: grid;
  gap: 2.5rem;
}

@media (min-width: 800px) {
  .footer-grid {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
  }
}

.footer-about {
  max-width: 28rem;
  margin-top: 1rem;
  color: var(--text-2);
}

.footer-title {
  margin-bottom: 0.75rem;
  font-size: 1rem;
  font-weight: 700;
}

.footer-links {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.35rem;
}

.footer-links a,
.footer-base a {
  color: var(--text);
}

.footer-author {
  margin: 0;
  color: var(--text-2);
}

.footer-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--text-2);
}

.footer-base p {
  margin: 0;
}


/* 12. Печат ---------------------------------------------------------------- */

@media print {
  .site-header,
  .playground,
  .pg-stage,
  .skip-link,
  .toc,
  .lightbox,
  .footer-base a {
    display: none !important;
  }

  body {
    background: #FFFFFF;
    color: #000000;
  }

  .quote-band {
    background: none;
    color: #000000;
  }
}
