/* ==========================================================================
   Teacher Zaichenko — стилі теми
   ========================================================================== */

:root {
  --bg: #07090d;
  --bg-alt: #090c11;
  --card: #0e1218;
  --card-2: #121720;
  --text: #e8edf2;
  --text-strong: #f3f7fa;
  --soft: #c3ccd5;
  --muted: #a9b4bf;
  --muted-2: #8a96a3;
  --accent: #3dff8a;
  --accent-2: #9dffc4;
  --on-accent: #06110a;
  --blue: #7aa7ff;
  --line: rgba(255, 255, 255, .06);
  --line-2: rgba(255, 255, 255, .1);

  --f-display: Unbounded, sans-serif;
  --f-body: Onest, system-ui, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, monospace;

  --header-h: 68px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }
::selection { background: var(--accent); color: var(--bg); }
[hidden] { display: none !important; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.accent { color: var(--accent); }
.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.container--narrow { max-width: 820px; }
.stack { display: flex; flex-direction: column; gap: 36px; }
.stack__end { align-self: flex-start; }
.main { min-height: 60vh; }

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-weight: 600;
}
.skip-link:focus { top: 16px; color: var(--on-accent); }
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}

@keyframes blink { 50% { opacity: 0; } }

/* ---------- Reveal (лише коли є JS і користувач не вимкнув анімації) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
  .js [data-reveal].is-visible { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 16px 24px; border-radius: 14px; border: 1px solid transparent;
  font: 600 16px/1.1 var(--f-body); white-space: nowrap; cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s, transform .2s;
}
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-2); color: var(--on-accent); transform: translateY(-2px); }
.btn--ghost { border-color: rgba(255, 255, 255, .18); color: var(--text); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--outline { padding: 10px 16px; border-radius: 12px; border-color: rgba(61, 255, 138, .35); color: var(--accent); font-size: 14px; }
.btn--outline:hover { background: rgba(61, 255, 138, .1); color: var(--accent); }
.btn--pill { padding: 10px 16px; border-radius: 999px; font-size: 14px; }
.btn__arrow { font-family: var(--f-mono); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

/* ---------- Loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 1000; background: #05070a;
  display: flex; align-items: center; justify-content: center; transition: opacity .7s ease;
}
.loader.is-done { opacity: 0; pointer-events: none; }
.tz-seen .loader { display: none; }
@media (prefers-reduced-motion: reduce) { .loader { display: none; } }
.loader__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.loader__box {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 28px 36px; border-radius: 16px; background: rgba(5, 7, 10, .82);
  border: 1px solid rgba(61, 255, 138, .35); backdrop-filter: blur(6px);
}
.loader__label { font: 600 12px/1 var(--f-mono); letter-spacing: .2em; color: var(--accent); text-transform: uppercase; }
.loader__pct { font: 700 clamp(56px, 12vw, 104px)/1 var(--f-display); color: #eafff2; font-variant-numeric: tabular-nums; text-shadow: 0 0 24px rgba(61, 255, 138, .55); }
.loader__bar { width: 220px; height: 3px; background: rgba(61, 255, 138, .15); border-radius: 3px; overflow: hidden; }
.loader__fill { height: 100%; width: 100%; background: var(--accent); box-shadow: 0 0 12px var(--accent); transform: scaleX(0); transform-origin: left; }
.loader__msg { font: 400 12px/1 var(--f-mono); color: #8fa59a; }

/* ---------- Header ---------- */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: rgba(7, 9, 13, .72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.admin-bar .header { top: 32px; }
@media (max-width: 782px) { .admin-bar .header { top: 46px; } }
.header__inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: var(--header-h); }

.logo { display: flex; align-items: center; gap: 10px; color: var(--text); }
.logo:hover { color: var(--text); }
.logo__mark {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid rgba(61, 255, 138, .5);
  display: flex; align-items: center; justify-content: center; font: 600 13px var(--f-mono); color: var(--accent);
}
.logo__text { display: flex; flex-direction: column; font: 600 15px/1.15 var(--f-body); }
.logo__sub { font-weight: 400; font-size: 12px; color: var(--muted-2); }

.nav { display: flex; align-items: center; gap: 28px; }
.nav__list { display: flex; align-items: center; gap: 28px; margin: 0; padding: 0; list-style: none; font: 500 14px var(--f-body); }
.nav__list a { color: var(--soft); transition: color .2s; }
.nav__list a:hover, .nav__list .current-menu-item > a { color: var(--accent); }

.burger {
  display: none; position: relative; width: 44px; height: 44px; border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .14); background: transparent; cursor: pointer;
}
.burger__line, .burger__line::before, .burger__line::after {
  position: absolute; left: 50%; width: 18px; height: 2px; margin-left: -9px; border-radius: 2px; background: var(--text);
  transition: transform .25s, opacity .25s;
}
.burger__line { top: 50%; margin-top: -1px; }
.burger__line::before, .burger__line::after { content: ''; left: 0; margin-left: 0; }
.burger__line::before { transform: translateY(-6px); }
.burger__line::after { transform: translateY(6px); }
.header.is-open .burger__line { background: transparent; }
.header.is-open .burger__line::before { transform: rotate(45deg); background: var(--text); }
.header.is-open .burger__line::after { transform: rotate(-45deg); background: var(--text); }

@media (max-width: 920px) {
  .burger { display: block; }
  .nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px 24px 20px; background: rgba(7, 9, 13, .97); border-bottom: 1px solid var(--line);
    max-height: calc(100vh - var(--header-h)); overflow-y: auto;
  }
  .header.is-open .nav { display: flex; }
  .nav__list { flex-direction: column; align-items: stretch; gap: 0; font-size: 17px; }
  .nav__list a { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--text); }
  .nav__cta { margin-top: 14px; padding: 14px; border-radius: 12px; font-size: 16px; }
}

/* ---------- Section basics ---------- */
.section { padding: clamp(60px, 9vw, 120px) 0; border-top: 1px solid var(--line); }
.section--alt { background: var(--bg-alt); }
.section--flush { padding-top: 0; border-top: 0; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 20px; }
.section-head__titles { display: flex; flex-direction: column; gap: 14px; }
.eyebrow { font: 500 12px var(--f-mono); color: var(--accent); }
.h2 { margin: 0; font: 700 clamp(30px, 4.4vw, 52px)/1.05 var(--f-display); letter-spacing: -.02em; color: var(--text); }
.h2--sm { font-size: clamp(28px, 4vw, 48px); }
.lead { margin: 0; max-width: 440px; font: 400 16px/1.6 var(--f-body); color: var(--muted); }
.empty {
  padding: 40px 24px; text-align: center; border: 1px dashed rgba(255, 255, 255, .12); border-radius: 16px;
  font: 400 15px var(--f-body); color: var(--muted-2);
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: calc(var(--header-h) + clamp(40px, 7vw, 82px)) 0 clamp(60px, 8vw, 100px);
  background-image:
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 56px 56px;
}
.hero__glow {
  position: absolute; width: 620px; height: 620px; right: -120px; top: 40px; border-radius: 50%;
  background: radial-gradient(circle, rgba(61, 255, 138, .14), transparent 65%); pointer-events: none;
}
.hero__grid {
  position: relative; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: clamp(40px, 6vw, 96px); align-items: center;
}
@media (max-width: 899px) { .hero__grid { grid-template-columns: minmax(0, 1fr); } }
.hero__content { display: flex; flex-direction: column; gap: 28px; }

.badge {
  display: inline-flex; align-self: flex-start; align-items: center; gap: 10px; white-space: nowrap;
  padding: 8px 14px; border: 1px solid rgba(61, 255, 138, .3); border-radius: 999px;
  font: 500 13px var(--f-mono); color: var(--accent); background: rgba(61, 255, 138, .06);
}
.badge__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }

.hero__title {
  margin: 0; font: 700 clamp(32px, 4.6vw, 64px)/1.04 var(--f-display);
  letter-spacing: -.03em; color: var(--text-strong); overflow-wrap: anywhere;
}
.hero__text { margin: 0; max-width: 520px; font: 400 clamp(16px, 1.6vw, 19px)/1.6 var(--f-body); color: var(--muted); text-wrap: pretty; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

.code-card { max-width: 460px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 14px; background: rgba(14, 18, 24, .85); overflow: hidden; }
.code-card__bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.code-card__dot { width: 10px; height: 10px; border-radius: 50%; }
.code-card__dot--r { background: #ff5f57; }
.code-card__dot--y { background: #febc2e; }
.code-card__dot--g { background: #28c840; }
.code-card__file { margin-left: 8px; font: 400 12px var(--f-mono); color: #6b7782; }
.code-card__body { margin: 0; padding: 16px 18px; min-height: 120px; font: 400 14px/1.7 var(--f-mono); color: var(--soft); white-space: pre-wrap; }
.code-card__caret { display: inline-block; width: 8px; height: 16px; vertical-align: -3px; background: var(--accent); animation: blink 1s steps(1) infinite; }

.hero__visual { position: relative; justify-self: center; width: min(100%, 480px); }
.hero__photo {
  position: relative; aspect-ratio: 4 / 5; border-radius: 28px; overflow: hidden;
  border: 1px solid var(--line-2); background: #141920;
}
.hero__img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; }
.hero__shade { position: absolute; inset: auto 0 0 0; height: 40%; background: linear-gradient(transparent, rgba(7, 9, 13, .85)); }
.hero__caption { position: absolute; left: 20px; bottom: 20px; right: 20px; font: 500 13px/1.4 var(--f-mono); color: var(--soft); }

.float-chip {
  position: absolute; padding: 12px 16px; border-radius: 14px; background: var(--card);
  font: 600 14px var(--f-mono); box-shadow: 0 20px 40px rgba(0, 0, 0, .4); will-change: transform;
}
.float-chip--green { left: 16px; top: 6%; border: 1px solid rgba(61, 255, 138, .35); color: var(--accent); }
.float-chip--blue { right: 16px; top: 52%; border: 1px solid rgba(122, 167, 255, .35); color: var(--blue); }

/* ---------- About ---------- */
.about__grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: clamp(32px, 5vw, 64px); align-items: start;
}
.about__photo { position: relative; border-radius: 24px; overflow: hidden; aspect-ratio: 2 / 3; border: 1px solid rgba(255, 255, 255, .08); }
.about__img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.about__label {
  position: absolute; top: 16px; left: 16px; padding: 6px 12px; border-radius: 8px;
  background: rgba(7, 9, 13, .75); font: 500 12px var(--f-mono); color: var(--accent);
}
.about__content { display: flex; flex-direction: column; gap: 28px; }
.about__text { font: 400 17px/1.75 var(--f-body); color: var(--muted); text-wrap: pretty; }
.about__text p { margin: 0 0 18px; }
.about__text p:last-child { margin-bottom: 0; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.steps__item { padding: 18px; border-radius: 16px; background: var(--card); border: 1px solid rgba(255, 255, 255, .07); display: flex; flex-direction: column; gap: 6px; }
.steps__num { font: 600 12px var(--f-mono); color: var(--accent); }
.steps__text { font: 400 14px/1.5 var(--f-body); color: var(--muted); }

/* ---------- Classes picker ---------- */
.picker { display: flex; flex-direction: column; gap: 14px; }
.grade-tabs { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 10px; }
@media (max-width: 559px) { .grade-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.grade-tab {
  display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 16px 18px; border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .08); background: var(--card); color: var(--text); cursor: pointer;
  transition: background-color .25s, border-color .25s, color .25s;
}
.grade-tab:hover { border-color: var(--accent); }
.grade-tab.is-active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.grade-tab__num { font: 700 clamp(20px, 3vw, 28px)/1 var(--f-display); }
.grade-tab__sub { font: 500 12px/1.3 var(--f-mono); opacity: .8; }

.class-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.class-chips--links { margin-top: 8px; }
.class-chip {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 10px 16px; border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .12); background: transparent; color: var(--soft); cursor: pointer;
  transition: border-color .2s, background-color .2s, color .2s;
}
.class-chip:hover { border-color: var(--accent); color: var(--soft); }
.class-chip.is-active { border-color: var(--accent); background: rgba(61, 255, 138, .12); color: var(--accent); }
.class-chip__name { font: 700 16px/1 var(--f-display); white-space: nowrap; }
.class-chip__subj { font: 500 11px/1.2 var(--f-mono); opacity: .75; white-space: nowrap; }

/* ---------- Panel + lessons ---------- */
.panel {
  display: flex; flex-direction: column; gap: 20px; padding: clamp(18px, 3vw, 32px);
  border-radius: 24px; background: var(--card); border: 1px solid rgba(255, 255, 255, .07);
}
.panel__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; }
.panel__titles { display: flex; flex-direction: column; gap: 4px; }
.panel__title { font: 700 clamp(22px, 2.6vw, 30px)/1.1 var(--f-display); }
.panel__sub { font: 400 14px var(--f-body); color: var(--muted-2); }
.panel__more { align-self: flex-start; }

.lessons { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.lesson {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: start;
  padding: 18px; border-radius: 18px; background: var(--card-2); border: 1px solid var(--line);
  transition: border-color .25s ease;
}
.lesson:hover { border-color: rgba(61, 255, 138, .45); }
.lesson--latest { border-color: rgba(61, 255, 138, .4); }
.lesson__date {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px 10px;
  min-width: 84px; padding: 12px 10px; border-radius: 14px; background: #0b0f15; color: var(--text);
}
.lesson--latest .lesson__date { background: var(--accent); color: var(--on-accent); }
.lesson__day { font: 700 30px/1 var(--f-display); }
.lesson__dm { display: flex; flex-direction: column; align-items: center; gap: 2px; font: 600 11px/1.2 var(--f-mono); text-transform: uppercase; opacity: .85; }
.lesson__body { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.lesson__head { display: flex; flex-direction: column; gap: 6px; }
.lesson__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lesson__num { font: 500 12px var(--f-mono); color: var(--muted-2); }
.lesson__badge { padding: 3px 8px; border-radius: 6px; background: rgba(61, 255, 138, .12); font: 600 11px var(--f-mono); color: var(--accent); }
.lesson__title { margin: 0; font: 600 18px/1.35 var(--f-body); color: var(--text-strong); text-wrap: pretty; }
.lesson__desc { font-size: 15px; color: var(--muted); }
.lesson__mats { display: flex; flex-wrap: wrap; gap: 8px; }
.lesson__empty { margin: 0; font: 400 13px var(--f-body); color: var(--muted-2); }
@media (max-width: 559px) {
  .lesson { grid-template-columns: minmax(0, 1fr); }
  .lesson__date { flex-direction: row; justify-self: start; }
  .lesson__dm { flex-direction: row; gap: 6px; }
}

.mat {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; padding: 8px 12px 8px 8px; border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--c) 25%, transparent);
  background: color-mix(in srgb, var(--c) 7%, transparent);
  color: var(--text); font: 500 13px var(--f-body); transition: transform .2s, border-color .2s, color .2s;
}
.mat:hover { transform: translateY(-2px); color: #fff; border-color: var(--c); }
.mat__tag { padding: 3px 6px; border-radius: 6px; background: var(--c); color: var(--bg); font: 600 10px var(--f-mono); }

/* ---------- Filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters--links { margin-top: 8px; }
.filter {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; padding: 9px 14px; border-radius: 999px;
  border: 1px solid var(--line-2); background: transparent; color: var(--muted); font: 500 14px var(--f-body);
  cursor: pointer; transition: background-color .2s, border-color .2s, color .2s;
}
.filter:hover { color: #fff; border-color: rgba(255, 255, 255, .3); }
.filter.is-active { background: var(--line-2); border-color: rgba(255, 255, 255, .3); color: #fff; }
.filter__dot { width: 8px; height: 8px; border-radius: 2px; background: var(--c); }
.filter__count { font: 500 12px var(--f-mono); opacity: .6; }

.month { display: flex; flex-direction: column; gap: 12px; }
.month__title { margin: 8px 0 0; font: 600 13px var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted-2); }

/* ---------- Page hero (внутрішні сторінки) ---------- */
.page-hero {
  padding: calc(var(--header-h) + clamp(36px, 6vw, 72px)) 0 clamp(32px, 5vw, 56px);
  background-image:
    linear-gradient(rgba(255, 255, 255, .03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .03) 1px, transparent 1px);
  background-size: 56px 56px;
}
.page-hero--center { min-height: 70vh; display: flex; align-items: center; }
.page-hero__inner { display: flex; flex-direction: column; gap: 18px; }
.page-hero__title { margin: 0; font: 700 clamp(36px, 6vw, 72px)/1.02 var(--f-display); letter-spacing: -.03em; color: var(--text-strong); overflow-wrap: anywhere; }
.page-hero__title--sm { font-size: clamp(28px, 4.4vw, 52px); }
.page-hero__sub { margin: 0; font: 400 17px/1.6 var(--f-body); color: var(--muted); }
.page-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font: 500 13px var(--f-mono); color: var(--muted-2); }
.crumbs a { color: var(--soft); }
.crumbs a:hover { color: var(--accent); }
.crumbs__sep { opacity: .5; }

/* ---------- Resources ---------- */
.res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 14px; }
.res-card {
  display: flex; flex-direction: column; gap: 16px; padding: 16px; border-radius: 20px;
  background: var(--card); border: 1px solid rgba(255, 255, 255, .07); color: var(--text);
  transition: border-color .25s, transform .25s;
}
.res-card:hover { border-color: rgba(61, 255, 138, .45); transform: translateY(-4px); color: var(--text); }
.res-card__cover {
  position: relative; aspect-ratio: 16 / 10; border-radius: 14px; overflow: hidden;
  background: radial-gradient(circle at 30% 20%, rgba(61, 255, 138, .16), transparent 60%), #121821;
  border: 1px solid var(--line); display: flex; align-items: center; justify-content: center;
}
.res-card__img { width: 100%; height: 100%; object-fit: cover; }
.res-card__glyph { font: 700 clamp(36px, 4vw, 48px)/1 var(--f-mono); color: var(--accent); opacity: .8; }
.res-card__type {
  position: absolute; left: 12px; top: 12px; padding: 4px 8px; border-radius: 6px;
  background: rgba(7, 9, 13, .8); font: 600 11px var(--f-mono); color: var(--accent); text-transform: uppercase;
}
.res-card__body { display: flex; flex-direction: column; gap: 6px; }
.res-card__title { font: 600 17px/1.3 var(--f-body); }
.res-card__text { font: 400 14px/1.5 var(--f-body); color: var(--muted-2); }
.res-card__foot {
  margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding-top: 12px;
  border-top: 1px solid var(--line); font: 600 13px var(--f-mono); color: var(--accent);
}

/* ---------- Books ---------- */
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 14px; }
.book {
  display: flex; flex-direction: column; gap: 16px; padding: 16px; border-radius: 20px;
  background: var(--card); border: 1px solid rgba(255, 255, 255, .07); color: var(--text);
  transition: border-color .25s, transform .25s;
}
.book:hover { border-color: rgba(61, 255, 138, .45); transform: translateY(-4px); color: var(--text); }
.book__cover {
  position: relative; aspect-ratio: 16 / 10; border-radius: 14px; overflow: hidden; background: #121821;
  border: 1px solid var(--line); display: flex; align-items: flex-end; justify-content: space-between; padding: 16px 16px 16px 26px;
}
.book__cover::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 10px; background: var(--c); }
.book__grade { font: 700 clamp(44px, 5vw, 60px)/1 var(--f-display); color: var(--c); }
.book__tag { font: 600 11px var(--f-mono); color: var(--muted-2); text-transform: uppercase; }
.book__info { display: flex; flex-direction: column; gap: 6px; }
.book__title { font: 600 17px/1.3 var(--f-body); }
.book__note { font: 400 14px/1.4 var(--f-body); color: var(--muted-2); }
.book__foot {
  margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding-top: 12px;
  border-top: 1px solid var(--line); font: 600 13px var(--f-mono); color: var(--accent);
}

/* ---------- Contact (Meet / Telegram) ---------- */
.contact { padding-bottom: clamp(32px, 4vw, 56px); }
.contact__card {
  position: relative; padding: 0; overflow: hidden; border-radius: 28px;
  border: 1px solid rgba(61, 255, 138, .25); background: #0b1210;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 400px);
  max-width: calc(1240px - 48px); width: calc(100% - 48px);
}
.contact__content { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 22px; padding: clamp(28px, 5vw, 56px); }
.contact__text { margin: 0; max-width: 440px; font: 400 16px/1.6 var(--f-body); color: var(--muted); }
.contact__btn { align-self: flex-start; }
.contact__visual { position: relative; aspect-ratio: 2 / 3; background: #b9b8ba; }
.contact__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.contact__fade { position: absolute; inset: 0; background: linear-gradient(90deg, #0b1210 0%, rgba(11, 18, 16, .2) 40%, transparent); }
@media (max-width: 819px) {
  .contact__card { grid-template-columns: minmax(0, 1fr); width: calc(100% - 32px); }
  .contact__visual { aspect-ratio: 4 / 3; order: -1; }
  .contact__img { object-position: 50% 30%; }
  .contact__fade { background: linear-gradient(0deg, #0b1210 0%, rgba(11, 18, 16, .2) 45%, transparent); }
}

.copy-field {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 14px;
  background: var(--bg); border: 1px solid rgba(255, 255, 255, .08);
}
.copy-field__value { flex: 1; min-width: 200px; font: 500 15px var(--f-mono); color: var(--text); overflow-wrap: anywhere; }
.copy-field__btn {
  padding: 10px 14px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .14); background: transparent;
  color: var(--text); font: 500 13px var(--f-mono); cursor: pointer; transition: border-color .2s, color .2s;
}
.copy-field__btn:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Dev ad ---------- */
.dev { padding: 0 0 clamp(48px, 6vw, 80px); }
.dev__card {
  display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(24px, 4vw, 56px); align-items: center;
  padding: clamp(24px, 4vw, 44px); border-radius: 24px; border: 1px solid var(--line-2);
  background: linear-gradient(135deg, rgba(122, 167, 255, .08), transparent 55%), var(--card);
  max-width: calc(1240px - 48px); width: calc(100% - 48px);
}
@media (max-width: 819px) { .dev__card { grid-template-columns: minmax(0, 1fr); width: calc(100% - 32px); } }
.dev__code {
  display: flex; flex-direction: column; gap: 6px; padding: 20px; border-radius: 16px;
  background: var(--bg); border: 1px solid var(--line); font: 500 14px/1.6 var(--f-mono); color: var(--soft); overflow-wrap: anywhere;
}
.dev__line--in { padding-left: 20px; color: var(--muted-2); }
.dev__kw { color: var(--blue); }
.dev__attr { color: #ffb86b; }
.dev__content { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.dev__title { margin: 0; font: 700 clamp(24px, 3vw, 36px)/1.1 var(--f-display); letter-spacing: -.02em; }
.dev__text { margin: 0; max-width: 560px; font: 400 16px/1.6 var(--f-body); color: var(--muted); }

/* ---------- Content (текст з редактора) ---------- */
.content { font: 400 17px/1.75 var(--f-body); color: var(--muted); }
.content > *:first-child { margin-top: 0; }
.content h2, .content h3, .content h4 { color: var(--text-strong); font-family: var(--f-display); line-height: 1.2; margin: 1.6em 0 .6em; }
.content h2 { font-size: clamp(22px, 2.6vw, 30px); }
.content h3 { font-size: 20px; }
.content p, .content ul, .content ol { margin: 0 0 1em; }
.content a { text-decoration: underline; text-underline-offset: 3px; }
.content img, .content__cover { border-radius: 16px; margin: 1.2em 0; }
.content iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 16px; }
.content code { padding: 2px 6px; border-radius: 6px; background: var(--card-2); font: 14px var(--f-mono); color: var(--accent); }
.content pre { padding: 16px; border-radius: 12px; background: var(--card-2); overflow-x: auto; }
.content blockquote { margin: 1.2em 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--accent); color: var(--soft); }
.lesson__desc.content p:last-child { margin-bottom: 0; }

.post-row { padding: 20px 0; border-bottom: 1px solid var(--line); }
.post-row__title { font: 600 20px/1.3 var(--f-body); color: var(--text-strong); }
.post-row__text { margin: 8px 0 0; color: var(--muted); }

/* ---------- Pagination ---------- */
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 12px;
  border-radius: 12px; border: 1px solid var(--line-2); color: var(--soft); font: 600 14px var(--f-mono);
}
.pagination .page-numbers.current, .pagination a.page-numbers:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Footer ---------- */
.footer { padding: 40px 0; border-top: 1px solid var(--line); }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; font: 400 14px var(--f-body); color: var(--muted-2); }
.footer__tg { color: var(--soft); }
.footer__bin { font-family: var(--f-mono); color: var(--accent); }
