/* ==========================================================================
   Уроци по химия · демо · styles.css
   Токени от DESIGN.md. Първо телефон, после по-големи екрани.
   ========================================================================== */

/* ---------- Шрифтове (локални, с кирилица; работят и без интернет) ---------- */
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 200 900; font-display: swap; src: url("../assets/fonts/unbounded-cyrillic-wght-normal.woff2") format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../assets/fonts/onest-cyrillic-wght-normal.woff2") format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../assets/fonts/ibm-plex-mono-cyrillic-400-normal.woff2") format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("../assets/fonts/ibm-plex-mono-cyrillic-500-normal.woff2") format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 200 900; font-display: swap; src: url("../assets/fonts/unbounded-latin-wght-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../assets/fonts/onest-latin-wght-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../assets/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("../assets/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

:root {
  /* тъмна повърхност */
  --ink-900: #0A1A24;
  --ink-800: #12293A;
  --ink-700: #1D3B50;
  --on-ink: #E6EEF2;
  --on-ink-muted: #A9BCC7;
  --signal: #C6F432;
  /* светла повърхност */
  --paper-0: #FFFFFF;
  --paper-50: #FAF8F3;
  --paper-100: #F1EEE6;
  --line: #D9D4C7;
  --text: #11222D;
  --text-muted: #4A5B66;
  --primary: #0B6E78;
  --primary-700: #085861;
  /* състояния */
  --success: #1E7B4C;
  --error: #B3261E;
  /* атоми (само декор) */
  --atom-c: #5FD1DA;
  --atom-o: #FF7A66;
  --atom-n: #6EA8FF;
  --atom-s: #F2C230;

  --f-display: "Unbounded", system-ui, sans-serif;
  --f-body: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --fs-display: clamp(2rem, 1.3rem + 3.6vw, 3.9rem);
  --fs-h2: clamp(1.55rem, 1.2rem + 1.8vw, 2.5rem);
  --fs-h3: clamp(1.2rem, 1.1rem + .5vw, 1.5rem);
  --fs-lead: clamp(1.0625rem, 1rem + .35vw, 1.25rem);
  --fs-price: clamp(2rem, 1.6rem + 1.6vw, 2.75rem);

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px;
  --space-6: 32px; --space-7: 48px; --space-8: 64px; --space-9: 96px; --space-10: 128px;

  --r-sm: 8px; --r-md: 16px; --r-lg: 24px; --r-pill: 999px;

  --shadow-1: 0 1px 2px rgba(10,26,36,.06), 0 4px 12px rgba(10,26,36,.06);
  --shadow-2: 0 2px 4px rgba(10,26,36,.08), 0 16px 40px rgba(11,110,120,.22);
  --glow-signal: 0 0 0 1px #C6F432, 0 0 28px rgba(198,244,50,.35);

  --ease: cubic-bezier(.2,.7,.2,1);
  --header-h: 64px;
  --gutter: 20px;
  --section-y: var(--space-8);
  --hex: polygon(25% 5%, 75% 5%, 100% 50%, 75% 95%, 25% 95%, 0 50%);
}

@media (min-width: 768px) { :root { --gutter: 32px; } }
@media (min-width: 900px) { :root { --section-y: var(--space-9); } }
@media (min-width: 1100px) { :root { --gutter: 48px; } }

/* ---------- Основа ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--f-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--paper-50);
  -webkit-font-smoothing: antialiased;
}
body.menu-open { overflow: hidden; }
h1, h2, h3, p, dl, dd, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
img, svg, canvas { display: block; max-width: 100%; }
a { color: var(--primary); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--f-display); line-height: 1.15; color: inherit; }
h2 { font-size: var(--fs-h2); font-weight: 600; letter-spacing: -.01em; }
h3 { font-size: var(--fs-h3); font-weight: 500; overflow-wrap: break-word; }

.container { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: var(--gutter); }
.lead { font-size: var(--fs-lead); line-height: 1.55; max-width: 60ch; }
.nowrap { white-space: nowrap; }
.sr-only {
  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: var(--space-4); top: -100px; z-index: 100;
  background: var(--signal); color: var(--ink-900); font-weight: 600;
  padding: var(--space-3) var(--space-4); border-radius: var(--r-sm);
}
.skip-link:focus { top: var(--space-3); }

:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
.dark :focus-visible { outline-color: var(--on-ink); }
.dark { background: var(--ink-900); color: var(--on-ink); }
.dark .lead { color: var(--on-ink-muted); }
.dark a { color: var(--on-ink); }

/* ---------- Бутони ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 var(--space-5);
  font: 600 1rem/1 var(--f-body); text-decoration: none; cursor: pointer;
  border: 2px solid transparent; border-radius: var(--r-pill);
  transition: background-color .25s var(--ease), box-shadow .25s var(--ease), color .25s var(--ease), transform .15s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-signal { background: var(--signal); color: var(--ink-900) !important; }
.btn-signal:hover { box-shadow: var(--glow-signal); }
.btn-primary { background: var(--primary); color: #fff !important; }
.btn-primary:hover { background: var(--primary-700); }
.btn-ghost-dark { background: transparent; color: var(--on-ink) !important; border-color: var(--on-ink); }
.btn-ghost-dark:hover { background: rgba(230,238,242,.1); }
.btn[disabled] { background: var(--line); color: var(--text-muted) !important; cursor: not-allowed; box-shadow: none; }
.btn-row { display: flex; flex-direction: column; gap: var(--space-3); }
@media (min-width: 640px) { .btn-row { flex-direction: row; flex-wrap: wrap; } }

/* въртящ се шестоъгълник ("молекулата" в бутона) */
.hex { display: inline-block; width: 20px; height: 20px; background: currentColor; clip-path: var(--hex); flex: none; }
.btn-enroll .hex { animation: hex-spin 9s linear infinite; }
.btn-enroll:hover .hex, .btn-enroll:focus-visible .hex { animation-duration: 2.2s; }
@keyframes hex-spin { to { transform: rotate(360deg); } }

/* ---------- Лепкаво меню ---------- */
.site-header { position: sticky; top: 0; z-index: 50; border-bottom: 1px solid var(--ink-700); }
.nav-bar { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: var(--space-3); color: var(--on-ink) !important; text-decoration: none; font-family: var(--f-display); font-weight: 600; font-size: .95rem; min-height: 44px; }
.progress { position: absolute; left: 0; bottom: -1px; height: 3px; width: 100%; background: var(--signal); transform-origin: left; transform: scaleX(var(--p, 0)); }

.menu-btn {
  display: inline-flex; align-items: center; gap: var(--space-2);
  min-width: 44px; min-height: 44px; padding: 0 var(--space-3);
  background: transparent; color: var(--on-ink); font: 600 .9375rem var(--f-body);
  border: 1px solid var(--ink-700); border-radius: var(--r-pill); cursor: pointer;
}
.menu-btn-icon { position: relative; width: 18px; height: 12px; }
.menu-btn-icon i { position: absolute; left: 0; width: 100%; height: 2px; background: currentColor; border-radius: 2px; transition: transform .25s var(--ease), top .25s var(--ease); }
.menu-btn-icon i:first-child { top: 1px; }
.menu-btn-icon i:last-child { top: 9px; }
.menu-btn[aria-expanded="true"] .menu-btn-icon i:first-child { top: 5px; transform: rotate(45deg); }
.menu-btn[aria-expanded="true"] .menu-btn-icon i:last-child { top: 5px; transform: rotate(-45deg); }

.nav {
  position: fixed; inset: var(--header-h) 0 0 0; z-index: 40;
  display: flex; flex-direction: column; gap: var(--space-1);
  padding: var(--space-5) var(--gutter) var(--space-7);
  background: var(--ink-900);
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: opacity .25s var(--ease), transform .25s var(--ease), visibility 0s linear .25s;
  overflow-y: auto;
}
.nav.is-open { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.nav a {
  display: flex; align-items: center; min-height: 56px;
  font-family: var(--f-display); font-weight: 500; font-size: 1.25rem;
  color: var(--on-ink); text-decoration: none; border-bottom: 1px solid var(--ink-700);
}
.nav a[aria-current="true"] { color: var(--signal); }
.nav .nav-cta { margin-top: var(--space-5); justify-content: center; border: 0; border-radius: var(--r-pill); background: var(--signal); color: var(--ink-900); font-family: var(--f-body); font-weight: 600; font-size: 1rem; min-height: 52px; }
.nav .nav-cta[aria-current="true"] { color: var(--ink-900); }

@media (min-width: 900px) {
  .menu-btn { display: none; }
  .nav {
    position: static; inset: auto; flex-direction: row; align-items: center; gap: var(--space-5);
    padding: 0; background: none; opacity: 1; visibility: visible; transform: none; overflow: visible;
  }
  .nav a { min-height: 44px; font-family: var(--f-body); font-weight: 500; font-size: .9375rem; border-bottom: 2px solid transparent; }
  .nav a[aria-current="true"] { border-bottom-color: var(--signal); color: var(--on-ink); }
  .nav a:hover { border-bottom-color: var(--on-ink-muted); }
  .nav .nav-cta { margin: 0 0 0 var(--space-2); padding: 0 var(--space-5); border-bottom: 0 !important; min-height: 44px; }
  .nav .nav-cta:hover { box-shadow: var(--glow-signal); }
}

/* ---------- Начало ---------- */
section[id] { scroll-margin-top: calc(var(--header-h) + 8px); }
.hero { position: relative; overflow: hidden; padding: var(--space-7) 0 var(--space-8); }
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-grid { position: relative; display: grid; gap: var(--space-7); align-items: end; }
.hero-copy { display: grid; gap: var(--space-5); justify-items: start; }
.hero h1 { font-size: var(--fs-display); font-weight: 600; letter-spacing: -.02em; line-height: 1.1; max-width: 14em; }
.hero .btn-row { width: 100%; }
.hero .btn { width: 100%; }
@media (min-width: 640px) { .hero .btn { width: auto; } }
.hero-eq { font-family: var(--f-body); font-size: 1rem; color: var(--on-ink-muted); letter-spacing: .02em; }
.hero-eq sub { font-size: .7em; }

.hero-stats {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4);
  padding: var(--space-5); border: 1px solid var(--ink-700); border-radius: var(--r-md);
  background: rgba(10, 26, 36, .78);
}
.stats-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); }
.stats-list div { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: var(--space-1); }
.stats-list dt { font-size: .8125rem; line-height: 1.35; color: var(--on-ink-muted); }
.stats-list dd { font-family: var(--f-display); font-weight: 600; font-size: clamp(1.2rem, 5.2vw, 2.4rem); line-height: 1; color: var(--signal); font-variant-numeric: tabular-nums; }
.stats-note { font-size: .8125rem; color: var(--on-ink-muted); border-top: 1px solid var(--ink-700); padding-top: var(--space-3); }

@media (min-width: 900px) {
  .hero { padding: var(--space-9) 0 var(--space-9); min-height: min(86vh, 760px); display: flex; align-items: center; }
  .hero-grid { grid-template-columns: 1.35fr .65fr; width: 100%; }
  .stats-list { grid-template-columns: minmax(0, 1fr); gap: var(--space-5); }
  .stats-list dd { font-size: 2.6rem; }
}

/* ---------- Секции ---------- */
.section { padding: var(--section-y) 0; }
.section-alt { background: var(--paper-100); }
.section-head { display: grid; gap: var(--space-3); margin-bottom: var(--space-7); }
.section-head .lead { color: var(--text-muted); }

/* ---------- Карти на курсове ---------- */
.cards { display: grid; gap: var(--space-4); grid-template-columns: 1fr; }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(2, 1fr); gap: var(--space-5); } }
@media (min-width: 1200px) { .cards { grid-template-columns: repeat(4, 1fr); } .container { max-width: 1240px; } }

.card {
  display: flex; flex-direction: column; gap: var(--space-4);
  padding: var(--space-5); background: var(--paper-0);
  border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-1);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
}
.card:hover, .card:focus-within { transform: translateY(-6px); box-shadow: 0 0 0 2px rgba(11,110,120,.35), var(--shadow-2); border-color: transparent; }
.card h3 { font-size: 1.15rem; }
.card-text { color: var(--text-muted); font-size: .9375rem; line-height: 1.55; }
.card .btn { width: 100%; }

.card { --el: var(--atom-c); position: relative; overflow: hidden; border-top: 4px solid var(--el); }
.card::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s var(--ease);
  background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--el) 26%, transparent), transparent 70%); }
.card:hover::before, .card:focus-within::before { opacity: 1; }
.card > * { position: relative; }
.card:hover, .card:focus-within { border-top-color: var(--el); }
.tile {
  position: relative; width: 104px; height: 104px; flex: none; margin: 14px 0 10px 14px;
  background: var(--ink-900); border: 2px solid var(--el); border-radius: 14px;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--el) 20%, transparent);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.card:hover .tile, .card:focus-within .tile { transform: rotate(-5deg) scale(1.06); box-shadow: 0 0 0 5px color-mix(in srgb, var(--el) 30%, transparent), 0 10px 34px color-mix(in srgb, var(--el) 60%, transparent); }
.tile-n, .tile-m { position: absolute; top: 7px; font-family: var(--f-mono); font-weight: 500; font-size: .6875rem; color: var(--on-ink-muted); }
.tile-n { left: 9px; } .tile-m { right: 9px; }
.tile-s { position: absolute; left: 0; right: 0; top: 24px; text-align: center; font-family: var(--f-display); font-weight: 600; font-size: 2.3rem; line-height: 1.1; color: var(--el); text-shadow: 0 0 18px color-mix(in srgb, var(--el) 55%, transparent); }
.tile-name { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; font-size: .6875rem; color: var(--on-ink); letter-spacing: .02em; }
.orbit { position: absolute; inset: -15px; border-radius: 50%; border: 1px dashed color-mix(in srgb, var(--el) 70%, var(--text-muted)); animation: hex-spin 9s linear infinite; pointer-events: none; }
.orbit i { position: absolute; top: -5px; left: 50%; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--el); box-shadow: 0 0 0 2px var(--paper-0), 0 0 12px var(--el); }
.card:hover .orbit, .card:focus-within .orbit { animation-duration: 2.2s; }

.facts { display: grid; gap: var(--space-3); }
.facts div { display: grid; gap: 2px; padding-top: var(--space-3); border-top: 1px solid var(--line); }
.facts dt { font-family: var(--f-mono); font-size: .75rem; font-weight: 500; color: var(--text-muted); }
.facts dd { font-size: .9375rem; font-weight: 500; }

.pack-list { display: grid; gap: var(--space-1); font-size: .9375rem; }
.pack-list li { display: flex; justify-content: space-between; padding: var(--space-1) 0; border-bottom: 1px dashed var(--line); }
.pack-list b { font-variant-numeric: tabular-nums; }

.price { min-height: 3.6rem; align-content: flex-start; display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2); margin-top: auto; }
.price strong { font-family: var(--f-display); font-weight: 600; font-size: 1.85rem; white-space: nowrap; line-height: 1; color: var(--primary); letter-spacing: -.02em; }
.price span { font-size: .875rem; color: var(--text-muted); }

/* ---------- Стъпки като уравнение ---------- */
.equation { display: grid; gap: var(--space-7); counter-reset: none; }
.step { position: relative; display: grid; gap: var(--space-2); justify-items: start; }
.step p { color: var(--text-muted); max-width: 32ch; }
.step h3 { font-size: 1.25rem; }
.step-n {
  display: grid; place-items: center; width: 52px; height: 58px;
  background: var(--ink-900); color: var(--signal); clip-path: var(--hex);
  font-family: var(--f-display); font-weight: 600; font-size: 1.1rem; margin-bottom: var(--space-2);
}
/* стрелка на реакция между стъпките (телефон: надолу) */
.step:not(:last-child)::after {
  content: "→"; position: absolute; left: 16px; bottom: calc(var(--space-7) / -1 + 6px);
  font-family: var(--f-mono); font-size: 1.5rem; color: var(--primary); transform: rotate(90deg); transform-origin: center;
  line-height: 1;
}
.product {
  display: inline-flex; align-items: center; gap: var(--space-3); margin-top: var(--space-7);
  padding: var(--space-3) var(--space-5); border: 2px solid var(--primary); border-radius: var(--r-pill);
  font-family: var(--f-display); font-weight: 600; font-size: 1.05rem; color: var(--primary); background: var(--paper-0);
}
.product-sign { font-family: var(--f-mono); }
@media (min-width: 640px) { .equation { grid-template-columns: repeat(2, 1fr); gap: var(--space-7) var(--space-6); } .step:not(:last-child)::after { transform: none; left: auto; right: calc(var(--space-6) / -2 - 8px); bottom: auto; top: 14px; } .step:nth-child(2)::after { display: none; } }
@media (min-width: 900px) { .equation { grid-template-columns: repeat(4, 1fr); } .step:nth-child(2)::after { display: block; } }

/* ---------- За учителя ---------- */
.teacher { display: grid; gap: var(--space-7); align-items: center; }
.hex-frame { width: min(260px, 70vw); aspect-ratio: 1 / 1.1547; background: var(--ink-900); clip-path: var(--hex); padding: 5px; justify-self: center; }
.hex-in { width: 100%; height: 100%; clip-path: var(--hex); background: var(--paper-100); display: grid; place-items: center; color: var(--text-muted); font-family: var(--f-mono); font-weight: 500; }
.hex-in img { width: 100%; height: 100%; object-fit: cover; }
.teacher-copy { display: grid; gap: var(--space-5); }
.teacher-copy { gap: var(--space-4); }
.teacher-copy > p { max-width: 62ch; }
.teacher-name { font-family: var(--f-display); font-weight: 500; font-size: var(--fs-h3); color: var(--primary); }
.teacher-copy h3 { font-size: 1.1rem; margin-top: var(--space-3); }
/* Образование: верига от „атоми" във времето */
.edu-block { margin-top: var(--space-8); }
.edu-block h3 { font-size: var(--fs-h3); }
.edu-note { color: var(--text-muted); margin-top: var(--space-2); max-width: 60ch; }
.edu { position: relative; display: grid; gap: var(--space-4); margin-top: var(--space-6); padding-left: 44px; }
.edu::before { content: ""; position: absolute; left: 14px; top: 8px; bottom: 8px; width: 4px; border-radius: 4px;
  background: linear-gradient(to bottom, #5FD1DA, #F2C230, #6EA8FF, #C6F432); transform-origin: top left; }
.edu li { position: relative; display: grid; gap: var(--space-1); padding: var(--space-5); background: var(--paper-0);
  border: 1px solid var(--line); border-top: 4px solid var(--el); border-radius: var(--r-md); box-shadow: var(--shadow-1);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.edu li:hover { transform: translateY(-6px); box-shadow: 0 16px 40px color-mix(in srgb, var(--el) 45%, transparent); }
.edu-node { position: absolute; left: -44px; top: 22px; width: 32px; height: 36px; background: var(--ink-900); clip-path: var(--hex); display: grid; place-items: center; transition: transform .5s var(--ease); }
.edu-node::after { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--el); }
.edu li:hover .edu-node { transform: rotate(180deg) scale(1.15); }
.edu-year { font-family: var(--f-display); font-weight: 600; font-size: 2.2rem; line-height: 1; letter-spacing: -.02em; }
.edu-deg { justify-self: start; margin-top: var(--space-2); padding: 2px 10px; border-radius: var(--r-pill); font-family: var(--f-mono); font-weight: 500; font-size: .75rem;
  color: var(--text); background: color-mix(in srgb, var(--el) 35%, var(--paper-0)); }
.edu li p { font-weight: 500; line-height: 1.4; }
.edu .is-top { background: var(--ink-900); color: var(--on-ink); border-color: var(--ink-700); border-top-color: var(--el);
  box-shadow: 0 0 0 1px var(--signal), 0 0 32px rgba(198,244,50,.3); }
.edu .is-top .edu-year { color: var(--signal); }
.edu .is-top .edu-deg { background: var(--signal); color: var(--ink-900); }
.edu .is-top .edu-node::after { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.5); box-shadow: 0 0 12px var(--signal); } }
@media (min-width: 900px) {
  .edu { grid-template-columns: repeat(4, 1fr); gap: var(--space-5); padding-left: 0; padding-top: 52px; }
  .edu::before { left: 20px; right: 20px; top: 16px; bottom: auto; width: auto; height: 4px; background: linear-gradient(to right, #5FD1DA, #F2C230, #6EA8FF, #C6F432); }
  .edu-node { left: var(--space-5); top: -52px; }
}
@media (prefers-reduced-motion: no-preference) {
  .js .edu.reveal::before { transition: transform 1.4s var(--ease) .3s; }
  .js .edu.reveal:not(.is-visible)::before { transform: scale(0); }
  .js .edu.reveal li { opacity: 0; transform: translateY(16px); transition: opacity .5s var(--ease), transform .5s var(--ease), box-shadow .25s var(--ease); }
  .js .edu.reveal.is-visible li { opacity: 1; transform: none; }
  .js .edu.reveal.is-visible li:hover { transform: translateY(-6px); }
  .js .edu.reveal li:nth-child(1) { transition-delay: .3s, .3s, 0s; } .js .edu.reveal li:nth-child(2) { transition-delay: .6s, .6s, 0s; }
  .js .edu.reveal li:nth-child(3) { transition-delay: .9s, .9s, 0s; } .js .edu.reveal li:nth-child(4) { transition-delay: 1.2s, 1.2s, 0s; }
  .js .edu.reveal.is-done li { transition-delay: 0s; }
}
.cards-note { margin-top: var(--space-6); padding: var(--space-4) var(--space-5); border-left: 4px solid var(--primary); background: var(--paper-100); border-radius: var(--r-sm); max-width: 75ch; }

/* ---------- Експерименти (колби) ---------- */
.lab { display: grid; gap: var(--space-5); align-items: center; margin-top: var(--space-7); padding: var(--space-5); background: var(--ink-900); color: var(--on-ink); border-radius: var(--r-lg); }
.lab-art { width: min(100%, 460px); height: auto; justify-self: center; }
.lab-copy { display: grid; gap: var(--space-3); text-align: center; justify-items: center; }
.lab-copy p { color: var(--on-ink-muted); max-width: 52ch; }
.bub { opacity: 0; animation: bubble 3.2s ease-in infinite; }
.b2 { animation-delay: .9s; } .b3 { animation-delay: .4s; } .b4 { animation-delay: 1.7s; } .b5 { animation-delay: 1.2s; }
@keyframes bubble { 0% { opacity: 0; transform: translateY(8px); } 25% { opacity: .55; } 100% { opacity: 0; transform: translateY(-22px); } }
@media (min-width: 900px) { .lab { grid-template-columns: 420px 1fr; gap: var(--space-7); padding: var(--space-7); } }
/* пара над колбите */
.puff { opacity: 0; transform-box: fill-box; transform-origin: center; animation: smoke 4.2s ease-out infinite; }
.p2 { animation-delay: 1.4s; animation-name: smoke-l; } .p3 { animation-delay: 2.8s; }
@keyframes smoke { 0% { opacity: 0; transform: translate(0, 4px) scale(.5); } 20% { opacity: .38; } 100% { opacity: 0; transform: translate(9px, -46px) scale(2.3); } }
@keyframes smoke-l { 0% { opacity: 0; transform: translate(0, 4px) scale(.5); } 20% { opacity: .3; } 100% { opacity: 0; transform: translate(-10px, -42px) scale(2); } }
.contact-flask { width: 96px; height: auto; margin-top: var(--space-2); }
.contact-flask .puff { animation-name: smoke; }
@media (prefers-reduced-motion: reduce) { .bub { opacity: .45; } .puff { opacity: .18; } .p2 { transform: translate(-6px, -14px) scale(1.4); } .p3 { transform: translate(6px, -28px) scale(1.9); } }
@media (min-width: 900px) { .teacher { grid-template-columns: .8fr 1.2fr; gap: var(--space-9); } .hex-frame { width: 320px; } }

/* ---------- Контакт и форма ---------- */
.contact { display: grid; gap: var(--space-7); align-items: start; }
.contact-info { display: grid; gap: var(--space-5); }
.contact-info .lead { color: var(--text-muted); }
.contact-list { display: grid; gap: var(--space-3); }
.contact-list div { display: grid; gap: 2px; padding-top: var(--space-3); border-top: 1px solid var(--line); }
.contact-list dt { font-family: var(--f-mono); font-size: .75rem; font-weight: 500; color: var(--text-muted); }
.contact-list dd { font-weight: 500; }
.contact-list a { display: inline-flex; align-items: center; min-height: 44px; }

@property --ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.form {
  position: relative; overflow: hidden;
  display: grid; gap: var(--space-4); padding: var(--space-5); border-radius: var(--r-lg);
  border: 3px solid transparent;
  background: linear-gradient(var(--paper-0), var(--paper-0)) padding-box,
              conic-gradient(from var(--ang), #5FD1DA, #C6F432, #F2C230, #FF7A66, #6EA8FF, #5FD1DA) border-box;
  box-shadow: var(--shadow-1); animation: ring 9s linear infinite;
  transition: box-shadow .35s var(--ease);
}
@keyframes ring { to { --ang: 360deg; } }
.form:focus-within { box-shadow: 0 0 0 6px rgba(11,110,120,.12), 0 18px 48px rgba(11,110,120,.25); }
.field label { transition: color .2s var(--ease); }
.field:focus-within label { color: var(--primary); }
.field input, .field select, .field textarea { transition: border-color .15s var(--ease), box-shadow .15s var(--ease), transform .2s var(--ease); }
.field input:focus, .field select:focus, .field textarea:focus { transform: translateY(-2px); }
.form .btn-primary { background: linear-gradient(to top, var(--primary-700) 50%, var(--primary) 50%) top / 100% 205%; transition: background-position .5s var(--ease), transform .15s var(--ease); }
.form .btn-primary:hover { background-position: bottom; }
.form-success { animation: pop .45s var(--ease); }
@keyframes pop { from { opacity: 0; transform: scale(.94) translateY(8px); } }
.fizz { position: absolute; bottom: -14px; width: 12px; height: 12px; border-radius: 50%; pointer-events: none; opacity: .8; animation: fizz 1.6s ease-in forwards; }
@keyframes fizz { to { transform: translateY(-420px) scale(.4); opacity: 0; } }
.field { display: grid; gap: 6px; align-content: start; }
.field label { font-weight: 600; font-size: .9375rem; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 0 14px; font: inherit; color: var(--text);
  background: var(--paper-0); border: 2px solid var(--line); border-radius: var(--r-sm);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.field textarea { padding: 12px 14px; resize: vertical; min-height: 128px; line-height: 1.5; }
.field select { appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1.5l6 6 6-6' fill='none' stroke='%2311222D' stroke-width='2'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.field input::placeholder { color: #66757F; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(11,110,120,.25); }
.field.is-invalid input, .field.is-invalid select, .field.is-invalid textarea { border-color: var(--error); }
.error { display: none; align-items: flex-start; gap: 6px; color: var(--error); font-size: .875rem; font-weight: 500; line-height: 1.4; }
.field.is-invalid .error { display: flex; }
.error svg { flex: none; margin-top: 2px; }
.form-actions { display: grid; gap: var(--space-3); align-items: center; }
.form-actions .btn { width: 100%; }
.form-note { font-size: .875rem; color: var(--text-muted); }
.form-hint { font-size: .875rem; color: var(--text-muted); }
.form-success { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-4); border-radius: var(--r-md); border: 2px solid var(--success); background: #EEF8F2; color: #0F4D2E; font-weight: 500; }
.form-success[hidden] { display: none; }
.field input, .field select, .field textarea, .form-success { scroll-margin-top: calc(var(--header-h) + 24px); }
.form-success:focus { outline: 3px solid var(--primary); outline-offset: 3px; }
.form-success small { font-weight: 400; opacity: .85; }
.form-success.is-error { border-color: var(--error); background: #FCEEEC; color: #7A1812; }
.btn[aria-disabled="true"] { cursor: progress; opacity: .75; }
.form-success svg { flex: none; margin-top: 2px; }

@media (min-width: 640px) {
  .form { grid-template-columns: 1fr 1fr; padding: var(--space-6); }
  .field-wide { grid-column: 1 / -1; }
  .form-actions { grid-template-columns: auto 1fr; gap: var(--space-5); }
  .form-actions .btn { width: auto; }
  .form-success { grid-column: 1 / -1; }
}
@media (min-width: 900px) { .contact { grid-template-columns: .8fr 1.2fr; gap: var(--space-8); } }

/* ---------- Футър ---------- */
.site-footer { padding: var(--space-7) 0 var(--space-6); }
.demo-note { display: grid; gap: var(--space-1); padding: var(--space-4) var(--space-5); border: 2px solid var(--signal); border-radius: var(--r-md); margin-bottom: var(--space-6); }
.demo-note strong { color: var(--signal); font-family: var(--f-display); font-weight: 600; font-size: 1.05rem; }
.demo-note span { color: var(--on-ink-muted); font-size: .9375rem; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-3); color: var(--on-ink-muted); font-size: .9375rem; }
.made-by { margin-top: var(--space-5); text-align: center; color: var(--on-ink-muted); font-family: var(--f-display); font-weight: 300; font-size: .8125rem; letter-spacing: .08em; }
.to-top { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; }
@media (min-width: 640px) { .demo-note { grid-template-columns: auto 1fr; gap: var(--space-4); align-items: center; } }

/* ---------- Движение ---------- */
/* Поява при скрол: скрива се само ако JS работи и анимациите са позволени */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
  .js .reveal.is-visible { opacity: 1; transform: none; }
  .js .cards .reveal:nth-child(2) { transition-delay: .06s; }
  .js .cards .reveal:nth-child(3) { transition-delay: .12s; }
  .js .cards .reveal:nth-child(4) { transition-delay: .18s; }
  .js .equation .reveal:nth-child(2) { transition-delay: .08s; }
  .js .equation .reveal:nth-child(3) { transition-delay: .16s; }
  .js .equation .reveal:nth-child(4) { transition-delay: .24s; }
}
/* .card има собствен transition за hover: поява + повдигане заедно */
@media (prefers-reduced-motion: no-preference) {
  .js .card.reveal { transition: opacity .6s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .card:hover, .card:focus-within { transform: none; }
  .progress { transition: none; }
}

.count { display: inline-block; font-variant-numeric: tabular-nums; }
.count.is-rolling { animation: jitter .12s linear infinite; }
@keyframes jitter { 0% { transform: translateY(-2px); } 50% { transform: translateY(2px); } 100% { transform: translateY(-2px); } }
