/* GENESIS Academy — minimal editorial system */

:root {
  --bg: #FCFBF8;
  --ink: #0F0F14;
  --ink-dim: rgba(15, 15, 20, 0.48);
  --ink-faint: rgba(15, 15, 20, 0.28);
  --accent: #0066FF;
  --line: #0F0F14;
  --line-soft: rgba(15, 15, 20, 0.14);
  --font-body: 'Inter', -apple-system, 'Segoe UI', 'Roboto', sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum";
}

::selection { background: var(--accent); color: var(--bg); }

a { color: inherit; text-decoration: none; }

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 40px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.brand-mark {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.brand-word {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.main-nav {
  display: flex;
  gap: 32px;
  align-items: center;
}

.main-nav a {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  position: relative;
  padding: 4px 0;
}

.main-nav a::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease);
}

.main-nav a:hover::after { transform: scaleX(1); transform-origin: left; }

.nav-cta {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent) !important;
}

.nav-cta::after { background: var(--accent) !important; }

.nav-balance {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fff !important;
  background: #0E9F5C;
  border: none;
  border-radius: 0;
  padding: 12px 24px;
  margin-right: 6px;
  transition: background 0.3s var(--ease);
}

.nav-balance::after { display: none !important; }

.nav-balance:hover { background: #0B8148; color: #fff !important; }

@media (max-width: 768px) {
  .nav-balance { padding: 14px 28px; font-size: 14px; }
}

.nav-toggle { display: none; }

/* ---------- Layout grid ---------- */

.wrap {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 40px;
}

.section {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 40px;
  padding-top: 96px;
  padding-bottom: 96px;
  border-bottom: 1px solid var(--line-soft);
}

.section:last-of-type { border-bottom: none; }

.section-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-dim);
  padding-top: 10px;
  position: sticky;
  top: 120px;
  align-self: start;
}

/* ---------- Hero ---------- */

.hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 40px;
  align-items: center;
  padding-top: 72px;
}

.hero-left { padding: 64px 0; }

.hero-glyph {
  font-size: clamp(140px, 22vw, 320px);
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 0.85;
  margin-bottom: 40px;
}

.hero-title {
  font-size: clamp(40px, 5vw, 72px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 28px;
}

.hero-title em {
  font-style: normal;
  color: var(--accent);
}

.hero-kicker {
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 28px;
}

/* line-by-line entrance */
.hero-title .h-line { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.hero-title .h-in {
  display: inline-block;
  transform: translateY(115%);
  animation: hero-line 0.9s var(--ease) forwards;
}
.hero-title .h-in.d2 { animation-delay: 0.22s; }

@keyframes hero-line { to { transform: translateY(0); } }

/* underline draw under «спокойно» */
.u-draw { position: relative; white-space: nowrap; }
.u-draw::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0.02em;
  width: 100%; height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  animation: u-draw 0.9s var(--ease) 1.1s forwards;
}

@keyframes u-draw { to { transform: scaleX(1); } }

@media (prefers-reduced-motion: reduce) {
  .hero-title .h-in, .u-draw::after { animation: none; transform: none; }
}

.btn-row { display: flex; gap: 16px; flex-wrap: wrap; }

.hero-sub {
  font-size: 20px;
  line-height: 1.55;
  color: var(--ink-dim);
  max-width: 520px;
  margin-bottom: 48px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 16px 32px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}

.btn:hover { background: var(--ink); color: var(--bg); }

.btn-accent { border-color: var(--accent); color: var(--accent); }
.btn-accent:hover { background: var(--accent); color: #fff; }

.hero-right {
  border-left: 1px solid var(--line-soft);
  padding-left: 40px;
  align-self: center;
}

.hero-meta { list-style: none; }

.hero-meta li {
  padding: 22px 0;
  border-bottom: 1px solid var(--line-soft);
}

.hero-meta li:last-child { border-bottom: none; }

.meta-key {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 6px;
}

.meta-val {
  font-size: 17px;
  font-weight: 500;
  line-height: 1.45;
}

/* ---------- Course catalog ---------- */

.catalog { list-style: none; }

.catalog-item {
  border-top: 1px solid var(--line-soft);
}

.catalog-item:first-child { border-top: 1px solid var(--line); }

.catalog-item a {
  display: grid;
  grid-template-columns: 64px 1fr auto 48px;
  align-items: baseline;
  gap: 32px;
  padding: 36px 0;
  transition: padding-left 0.4s var(--ease);
}

.catalog-item a:hover { padding-left: 16px; }

.cat-num {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-faint);
}

.cat-title {
  font-size: clamp(26px, 3.2vw, 44px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.cat-desc {
  font-size: 16px;
  color: var(--ink-dim);
  margin-top: 8px;
  max-width: 620px;
  line-height: 1.5;
}

.cat-meta {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-dim);
  white-space: nowrap;
  text-align: right;
  line-height: 1.7;
}

.cat-arrow {
  font-size: 26px;
  font-weight: 400;
  justify-self: end;
  color: var(--ink-faint);
  transition: color 0.3s var(--ease), transform 0.35s var(--ease);
}

.catalog-item a:hover .cat-arrow {
  color: var(--accent);
  transform: translateX(6px);
}

/* ---------- Approach / principles ---------- */

.principles { list-style: none; counter-reset: pr; }

.principles li {
  counter-increment: pr;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 32px;
  padding: 28px 0;
  border-top: 1px solid var(--line-soft);
  font-size: 19px;
  line-height: 1.55;
}

.principles li::before {
  content: counter(pr, decimal-leading-zero);
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  padding-top: 6px;
}

.principles li:first-child { border-top: 1px solid var(--line); }

.principles strong { font-weight: 700; }

/* ---------- About ---------- */

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
}

.about-grid p {
  font-size: 19px;
  line-height: 1.65;
  margin-bottom: 24px;
}

.about-grid p:last-child { margin-bottom: 0; }

.about-grid .lead {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.4;
}

/* ---------- Contacts ---------- */

.contact-list { list-style: none; }

.contact-list li {
  border-top: 1px solid var(--line-soft);
  padding: 26px 0;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  align-items: baseline;
}

.contact-list li:first-child { border-top: 1px solid var(--line); }

.contact-key {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.contact-val {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.contact-val a { color: var(--accent); }
.contact-val a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 64px 0 48px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}

.footer-brand p {
  font-size: 15px;
  color: var(--ink-dim);
  margin-top: 12px;
  max-width: 320px;
  line-height: 1.6;
}

.footer-col h4 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 16px;
}

.footer-col ul { list-style: none; }

.footer-col li { margin-bottom: 10px; }

.footer-col a {
  font-size: 15px;
  color: var(--ink);
}

.footer-col a:hover { color: var(--accent); }

.footer-bottom {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--line-soft);
  font-size: 13px;
  color: var(--ink-faint);
  display: flex;
  justify-content: space-between;
}

/* ---------- Course page ---------- */

.course-hero {
  padding-top: 180px;
  padding-bottom: 80px;
  border-bottom: 1px solid var(--line);
}

.back-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-dim);
  display: inline-block;
  margin-bottom: 40px;
}

.back-link:hover { color: var(--accent); }

.course-kicker {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}

.course-title {
  font-size: clamp(40px, 6vw, 84px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.02;
  margin-bottom: 32px;
  max-width: 1000px;
}

.course-goal {
  font-size: 22px;
  line-height: 1.5;
  color: var(--ink-dim);
  max-width: 720px;
  margin-bottom: 48px;
}

.course-stats {
  display: flex;
  gap: 64px;
  flex-wrap: wrap;
}

.stat .stat-num {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.stat .stat-key {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: 8px;
}

.course-note {
  border-left: 2px solid var(--accent);
  padding: 20px 28px;
  margin: 56px 0 0;
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-dim);
  max-width: 760px;
  background: rgba(0, 102, 255, 0.04);
}

/* Module */

.module {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 40px;
  padding-top: 72px;
  padding-bottom: 72px;
  border-bottom: 1px solid var(--line-soft);
}

.module:last-of-type { border-bottom: none; }

.module-head { position: sticky; top: 120px; align-self: start; }

.module-num {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 10px;
}

.module-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.lessons { list-style: none; }

.lesson {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 28px;
  padding: 24px 0;
  border-top: 1px solid var(--line-soft);
}

.lesson:first-child { border-top: 1px solid var(--line); }

.lesson-num {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-faint);
  padding-top: 3px;
}

.lesson-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.35;
  margin-bottom: 6px;
}

.lesson-body {
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-dim);
  margin-bottom: 10px;
}

.lesson-practice {
  font-size: 15px;
  line-height: 1.55;
}

.lesson-practice .pr-key {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-right: 10px;
}

/* Exam block */

.exam-block {
  margin: 72px 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 48px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: center;
}

.exam-block h3 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.exam-block p {
  font-size: 16px;
  color: var(--ink-dim);
  max-width: 560px;
  line-height: 1.6;
}

/* Next course nav */

.next-course {
  display: block;
  padding-top: 96px;
  padding-bottom: 96px;
  border-top: 1px solid var(--line);
}

.next-course .nc-key {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 16px;
}

.next-course .nc-title {
  font-size: clamp(32px, 4.5vw, 60px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  display: flex;
  align-items: baseline;
  gap: 24px;
}

.next-course .nc-arrow {
  color: var(--ink-faint);
  transition: color 0.3s var(--ease), transform 0.35s var(--ease);
}

.next-course:hover .nc-arrow { color: var(--accent); transform: translateX(10px); }

/* ---------- Reveal motion ---------- */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.in { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .catalog-item a, .cat-arrow, .main-nav a::after, .btn { transition: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
  .section, .module { grid-template-columns: 1fr; gap: 24px; }
  .section-label, .module-head { position: static; }
  .hero { grid-template-columns: 1fr; min-height: auto; padding: 140px 0 64px; }
  .hero-right { border-left: none; padding-left: 0; border-top: 1px solid var(--line-soft); }
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .exam-block { grid-template-columns: 1fr; padding: 32px; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .wrap, .header-inner { padding: 0 20px; }
  .header-inner { height: 64px; }
  .main-nav {
    display: none;
    position: absolute;
    top: 64px; left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 8px 20px 20px;
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 14px 0; font-size: 17px; width: 100%; }
  .nav-toggle {
    display: block;
    background: none;
    border: 1px solid var(--ink);
    border-radius: 4px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 10px 18px;
    cursor: pointer;
    color: var(--ink);
  }
  .catalog-item a { grid-template-columns: 40px 1fr 32px; }
  .cat-meta { display: none; }
  .course-hero { padding: 120px 0 56px; }
  .course-stats { gap: 32px; }
  .stat .stat-num { font-size: 36px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; gap: 8px; }
  .contact-list li { grid-template-columns: 1fr; gap: 6px; }
}

/* ---------- Reading progress ---------- */

.read-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0;
  background: var(--accent);
  z-index: 200;
}

/* ---------- Course TOC ---------- */

.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 36px;
  padding-top: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--line);
}

.toc .toc-key {
  width: 100%;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 4px;
}

.toc a {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-dim);
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}

.toc a:hover { color: var(--accent); border-bottom-color: var(--accent); }
