:root {
  --milk: #fbf7ef;
  --paper: #f4eadc;
  --linen: #e7d7c1;
  --sand: #c9ae8c;
  --sage: #7f907f;
  --ochre: #b67a35;
  --terracotta: #a75b43;
  --ink: #1f2f37;
  --blue-gray: #405660;
  --muted: #66716d;
  --line: rgba(64, 86, 96, 0.18);
  --shadow: 0 20px 55px rgba(51, 40, 28, 0.12);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--milk);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

body::selection {
  color: var(--milk);
  background: var(--terracotta);
}

img {
  display: block;
  max-width: 100%;
}

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

p,
h1,
h2,
h3 {
  margin: 0;
}

.site-header {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
  padding: 18px 34px;
  color: var(--ink);
  border-bottom: 1px solid rgba(255, 255, 255, 0);
  transition: background 240ms ease, border-color 240ms ease, box-shadow 240ms ease;
}

.site-header.is-scrolled {
  background: rgba(251, 247, 239, 0.88);
  border-color: var(--line);
  box-shadow: 0 8px 30px rgba(41, 36, 30, 0.08);
  backdrop-filter: blur(16px);
}

.brand {
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 600;
  line-height: 1;
}

.anchor-nav {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 22px;
  color: rgba(31, 47, 55, 0.82);
  font-size: 0.86rem;
  font-weight: 500;
}

.anchor-nav a,
.header-link,
.theme-pills a,
.course-link,
.footer a,
.category-cta a {
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.anchor-nav a:hover,
.footer a:hover,
.category-cta a:hover {
  color: var(--terracotta);
}

.header-link {
  padding: 10px 16px;
  color: var(--blue-gray);
  border: 1px solid rgba(64, 86, 96, 0.3);
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
}

.header-link:hover {
  color: var(--milk);
  background: var(--blue-gray);
  border-color: var(--blue-gray);
}

.hero,
.closing {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 88svh;
  display: grid;
  place-items: center;
  padding: 126px 24px 74px;
}

.hero-bg,
.closing-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-shade,
.closing-shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at center, rgba(251, 247, 239, 0.38), rgba(251, 247, 239, 0.06) 44%),
    linear-gradient(180deg, rgba(251, 247, 239, 0.08), rgba(251, 247, 239, 0.5));
}

.hero-content,
.closing-content {
  width: min(760px, 100%);
  min-width: 0;
  text-align: center;
}

.eyebrow,
.section-kicker {
  color: var(--terracotta);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1.2;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: 0;
}

h1 {
  margin-top: 8px;
  font-size: 5.9rem;
  line-height: 0.92;
  color: rgba(255, 255, 255, 0.96);
  text-shadow: 0 14px 50px rgba(31, 47, 55, 0.35);
}

h1 span {
  white-space: nowrap;
}

.hero-subtitle {
  max-width: 620px;
  margin: 22px auto 0;
  color: rgba(255, 255, 255, 0.95);
  font-size: 1.18rem;
  line-height: 1.55;
  text-shadow: 0 8px 34px rgba(31, 47, 55, 0.4);
}

.discount-line {
  width: fit-content;
  margin: 26px auto 0;
  padding: 8px 14px;
  color: var(--ink);
  background: rgba(251, 247, 239, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 700;
  backdrop-filter: blur(8px);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  margin-top: 22px;
  padding: 13px 24px;
  border-radius: 999px;
  font-weight: 700;
  line-height: 1.1;
}

.button-primary {
  color: var(--milk);
  background: var(--blue-gray);
  box-shadow: 0 16px 36px rgba(31, 47, 55, 0.22);
}

.button-primary:hover {
  transform: translateY(-2px);
  background: #273f49;
}

.fineprint {
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.86rem;
  text-shadow: 0 8px 24px rgba(31, 47, 55, 0.45);
}

.section {
  padding: 104px 34px;
}

.intro-section,
.format-section {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(380px, 1fr);
  gap: 76px;
  align-items: start;
  margin-top: 22px;
}

.intro-grid h2,
.section-heading h2,
.closing-content h2 {
  color: var(--ink);
  font-size: 3.55rem;
  line-height: 1.02;
}

.copy-column {
  display: grid;
  gap: 20px;
  color: var(--muted);
  font-size: 1.02rem;
}

.themes-section {
  background:
    linear-gradient(180deg, rgba(231, 215, 193, 0.35), rgba(251, 247, 239, 0)),
    var(--paper);
}

.section-heading {
  width: min(850px, 100%);
}

.section-heading.centered {
  margin: 0 auto;
  text-align: center;
}

.section-heading h2 {
  margin-top: 10px;
}

.section-heading p:not(.section-kicker) {
  margin-top: 18px;
  color: var(--muted);
  font-size: 1.02rem;
}

.theme-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  width: min(900px, 100%);
  margin: 34px auto 74px;
}

.theme-pills a {
  padding: 11px 16px;
  color: var(--blue-gray);
  background: rgba(251, 247, 239, 0.62);
  border: 1px solid rgba(64, 86, 96, 0.2);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
}

.theme-pills a:hover {
  color: var(--milk);
  background: var(--terracotta);
  border-color: var(--terracotta);
  transform: translateY(-1px);
}

.course-sections {
  display: grid;
  gap: 90px;
  width: min(1220px, 100%);
  margin: 0 auto;
}

.course-category {
  scroll-margin-top: 98px;
}

.category-head {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(340px, 1fr);
  gap: 46px;
  align-items: end;
  padding-bottom: 26px;
  border-bottom: 1px solid rgba(64, 86, 96, 0.18);
}

.category-head h3 {
  margin-top: 8px;
  font-size: 2.65rem;
  line-height: 1.02;
}

.category-head p:not(.section-kicker) {
  color: var(--muted);
  font-size: 1rem;
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.course-card {
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  min-width: 0;
  background: rgba(251, 247, 239, 0.72);
  border: 1px solid rgba(64, 86, 96, 0.12);
  border-radius: 8px;
  box-shadow: 0 16px 42px rgba(50, 41, 30, 0.08);
  transition: transform 190ms ease, box-shadow 190ms ease, border-color 190ms ease;
}

.course-card:hover {
  transform: translateY(-4px);
  border-color: rgba(167, 91, 67, 0.28);
  box-shadow: var(--shadow);
}

.course-image-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background:
    linear-gradient(135deg, rgba(127, 144, 127, 0.2), rgba(167, 91, 67, 0.12)),
    var(--linen);
}

.course-image-wrap::after {
  position: absolute;
  inset: 16px;
  display: none;
  align-items: center;
  justify-content: center;
  color: rgba(31, 47, 55, 0.55);
  border: 1px solid rgba(64, 86, 96, 0.22);
  border-radius: 6px;
  content: "Обложка урока";
  font-size: 0.84rem;
  font-weight: 600;
}

.course-image-wrap.is-empty::after {
  display: flex;
}

.course-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 260ms ease;
}

.course-card:hover .course-image-wrap img {
  transform: scale(1.035);
}

.course-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 18px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 25px;
}

.tag-row span {
  padding: 4px 8px;
  color: var(--blue-gray);
  background: rgba(127, 144, 127, 0.12);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.2;
}

.course-body h3 {
  margin-top: 13px;
  font-size: 1.42rem;
  line-height: 1.08;
}

.course-body p {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.55;
}

.course-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.course-meta span {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(64, 86, 96, 0.14);
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.2;
}

.course-link {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  margin-top: auto;
  padding-top: 18px;
  color: var(--terracotta);
  font-size: 0.9rem;
  font-weight: 800;
}

.course-link::after {
  margin-left: 8px;
  content: "→";
  transition: transform 180ms ease;
}

.course-link:hover::after {
  transform: translateX(3px);
}

.data-error {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 28px;
  color: var(--blue-gray);
  background: rgba(251, 247, 239, 0.72);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: center;
}

.category-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 24px;
  padding: 22px 0 0;
  color: var(--muted);
  border-top: 1px solid rgba(64, 86, 96, 0.14);
}

.category-cta strong {
  color: var(--ink);
}

.category-cta div {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.category-cta a {
  padding: 9px 14px;
  color: var(--blue-gray);
  border: 1px solid rgba(64, 86, 96, 0.22);
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 700;
}

.category-cta a:hover {
  background: rgba(255, 255, 255, 0.62);
}

.format-section {
  display: grid;
  grid-template-columns: 0.76fr 1fr;
  gap: 64px;
  align-items: start;
}

.format-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.format-card,
.guide-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.34);
}

.format-card {
  min-height: 260px;
  padding: 24px;
}

.format-card span,
.guide-grid span {
  color: var(--terracotta);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.format-card h3,
.guide-grid h3 {
  margin-top: 18px;
  font-size: 1.7rem;
  line-height: 1.08;
}

.format-card p,
.guide-grid p {
  margin-top: 14px;
  color: var(--muted);
}

.start-section {
  background: #eef0e8;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  width: min(1180px, 100%);
  margin: 42px auto 0;
}

.guide-grid article {
  min-height: 230px;
  padding: 24px;
}

.closing {
  min-height: 76svh;
  justify-items: start;
  padding-left: max(34px, calc((100vw - 1180px) / 2));
  padding-right: 34px;
}

.closing-shade {
  background:
    linear-gradient(90deg, rgba(251, 247, 239, 0.88), rgba(251, 247, 239, 0.5) 42%, rgba(251, 247, 239, 0.04)),
    linear-gradient(180deg, rgba(251, 247, 239, 0.15), rgba(251, 247, 239, 0.25));
}

.closing-content {
  max-width: 610px;
  text-align: left;
}

.closing-content p:not(.section-kicker):not(.discount-line) {
  margin-top: 18px;
  color: var(--blue-gray);
  font-size: 1.06rem;
}

.closing-content .discount-line {
  margin-left: 0;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 34px;
  color: rgba(31, 47, 55, 0.68);
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}

.footer a {
  color: var(--blue-gray);
  font-weight: 700;
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 520ms ease, transform 520ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

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

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (max-width: 1120px) {
  .course-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .format-section {
    grid-template-columns: 1fr;
    gap: 34px;
  }
}

@media (max-width: 900px) {
  .site-header {
    grid-template-columns: auto auto;
    gap: 14px;
    padding: 14px 18px;
  }

  .anchor-nav {
    grid-column: 1 / -1;
    justify-self: stretch;
    justify-content: flex-start;
    order: 3;
    overflow-x: auto;
    gap: 16px;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .anchor-nav::-webkit-scrollbar {
    display: none;
  }

  .header-link {
    justify-self: end;
  }

  .hero {
    min-height: 86svh;
    padding-top: 132px;
  }

  h1 {
    font-size: 4.45rem;
  }

  .intro-grid,
  .category-head {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .intro-grid h2,
  .section-heading h2,
  .closing-content h2 {
    font-size: 3rem;
  }

  .course-grid,
  .guide-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .format-grid {
    grid-template-columns: 1fr;
  }

  .format-card {
    min-height: auto;
  }

  .category-cta,
  .footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 16px;
  }

  .site-header {
    width: 100vw;
    background: rgba(251, 247, 239, 0.9);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
  }

  .brand {
    font-size: 1.35rem;
  }

  .header-link {
    display: none;
  }

  .anchor-nav {
    font-size: 0.82rem;
  }

  .hero {
    width: 100vw;
    max-width: 100vw;
    min-height: 84svh;
    justify-items: start;
    padding: 142px 18px 54px;
  }

  .hero-content,
  .closing-content {
    width: 100%;
    max-width: 354px;
  }

  .hero-bg {
    object-position: 52% center;
  }

  .hero-shade {
    background:
      radial-gradient(circle at center, rgba(31, 47, 55, 0.28), rgba(251, 247, 239, 0.16) 62%),
      linear-gradient(180deg, rgba(251, 247, 239, 0.24), rgba(31, 47, 55, 0.18));
  }

  .eyebrow,
  .section-kicker {
    font-size: 0.72rem;
  }

  h1 {
    max-width: 320px;
    margin-right: auto;
    margin-left: auto;
    font-size: 2.9rem;
    line-height: 0.96;
  }

  h1 span {
    display: block;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .discount-line {
    font-size: 0.86rem;
  }

  .button {
    width: 100%;
    max-width: 286px;
  }

  .fineprint {
    max-width: 310px;
    margin-right: auto;
    margin-left: auto;
    color: rgba(255, 255, 255, 0.94);
    font-size: 0.82rem;
  }

  .section {
    width: 100vw;
    max-width: 100vw;
    padding: 72px 18px;
  }

  .intro-grid h2,
  .section-heading h2,
  .closing-content h2 {
    font-size: 2.16rem;
    overflow-wrap: break-word;
  }

  .copy-column,
  .section-heading p:not(.section-kicker),
  .closing-content p:not(.section-kicker):not(.discount-line) {
    font-size: 1rem;
  }

  .theme-pills {
    display: grid;
    grid-template-columns: 1fr;
    margin-bottom: 56px;
  }

  .theme-pills a {
    text-align: center;
  }

  .course-sections {
    gap: 68px;
  }

  .course-category {
    scroll-margin-top: 132px;
  }

  .category-head h3 {
    font-size: 2.2rem;
  }

  .course-grid,
  .guide-grid {
    grid-template-columns: 1fr;
  }

  .course-body {
    padding: 18px 16px 20px;
  }

  .course-body h3 {
    font-size: 1.5rem;
  }

  .course-body p {
    font-size: 0.95rem;
  }

  .category-cta a {
    width: 100%;
    text-align: center;
  }

  .category-cta div {
    width: 100%;
  }

  .guide-grid article {
    min-height: auto;
  }

  .closing {
    width: 100vw;
    max-width: 100vw;
    min-height: 74svh;
    padding: 84px 18px;
  }

  .closing-bg {
    object-position: 70% center;
  }

  .closing-shade {
    background:
      linear-gradient(90deg, rgba(251, 247, 239, 0.92), rgba(251, 247, 239, 0.76)),
      linear-gradient(180deg, rgba(251, 247, 239, 0.18), rgba(251, 247, 239, 0.22));
  }
}
