:root {
  --bg: #111419;
  --panel: #1a1e25;
  --panel-soft: rgba(255, 255, 255, 0.035);
  --text: #eee9df;
  --muted: #b8b0a3;
  --line: rgba(255, 255, 255, 0.11);
  --accent: #c99855;
  --accent-soft: #e6c48f;
  --cold: #6fa5aa;
  --max: 1120px;
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--text);

  background:
    radial-gradient(
      circle at 18% 8%,
      rgba(201, 152, 85, 0.1),
      transparent 29rem
    ),
    radial-gradient(
      circle at 88% 16%,
      rgba(111, 165, 170, 0.08),
      transparent 26rem
    ),
    linear-gradient(
      180deg,
      #101318 0%,
      #15191f 58%,
      #0f1216 100%
    );

  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  line-height: 1.65;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

img {
  max-width: 100%;
}

.container {
  width: min(calc(100% - 32px), var(--max));
  margin-inline: auto;
}

/* Шапка */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;

  border-bottom: 1px solid var(--line);

  background: rgba(17, 20, 25, 0.84);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.nav {
  min-height: 68px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 24px;
}

.brand {
  flex: 0 0 auto;

  color: var(--text);
  text-decoration: none;

  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;

  letter-spacing: 0.11em;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand span {
  color: var(--accent-soft);
}

/* Логотип в шапке */

.brand-logo {
  display: block;
  line-height: 0;
}

.brand-logo img {
  display: block;

  width: 150px;
  height: 44px;

  object-fit: contain;
  object-position: left center;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;

  gap: 18px;
}

.nav-links a {
  color: var(--muted);

  text-decoration: none;
  font-size: 0.92rem;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--text);
}

/* Секретный поиск */

.secret-search {
  width: min(250px, 26vw);
  min-width: 160px;

  display: flex;
  align-items: center;

  overflow: hidden;

  border: 1px solid var(--line);
  border-radius: 999px;

  background: rgba(255, 255, 255, 0.03);

  transition:
    border-color 0.2s ease,
    background 0.2s ease;
}

.secret-search:focus-within {
  border-color: rgba(230, 196, 143, 0.46);
  background: rgba(255, 255, 255, 0.055);
}

.secret-search input {
  width: 100%;
  min-width: 0;
  height: 40px;

  padding: 0 8px 0 16px;

  border: 0;
  outline: 0;

  color: var(--text);
  background: transparent;
}

.secret-search input::placeholder {
  color: #88857f;
}

.secret-search input::-webkit-search-cancel-button {
  display: none;
}

.secret-search button {
  flex: 0 0 42px;

  width: 42px;
  height: 40px;

  display: grid;
  place-items: center;

  padding: 0;
  border: 0;

  color: var(--muted);
  background: transparent;

  cursor: pointer;
}

.secret-search button:hover,
.secret-search button:focus-visible {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  outline: none;
}

.secret-search svg {
  width: 18px;
  height: 18px;

  fill: none;
  stroke: currentColor;

  stroke-width: 1.8;
  stroke-linecap: round;
}

.visually-hidden {
  position: absolute;

  width: 1px;
  height: 1px;

  padding: 0;
  margin: -1px;

  overflow: hidden;

  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;

  border: 0;
}

/* Типографика */

h1,
h2,
h3 {
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.12;

  overflow-wrap: anywhere;
}

h1 {
  margin: 0;

  font-size: clamp(3.6rem, 9vw, 7.4rem);
  letter-spacing: -0.045em;
}

h2 {
  max-width: 12ch;
  margin: 0;

  font-size: clamp(2rem, 4.5vw, 3.8rem);
  letter-spacing: -0.025em;
}

h3 {
  margin: 0 0 10px;

  font-size: 1.45rem;
}

.eyebrow {
  margin: 0 0 14px;

  color: var(--accent-soft);

  text-transform: uppercase;
  letter-spacing: 0.16em;

  font-size: 0.76rem;
  font-weight: 750;
}

.hero-lead,
.hero-note,
.section-head > p,
.card p,
.rule-box > p,
.quote,
.class-description,
.cta > p {
  text-wrap: pretty;

  hyphens: auto;
  -webkit-hyphens: auto;
}

section {
  padding: 82px 0;
}

/* Главный экран */

.hero {
  min-height: 78vh;

  display: grid;
  align-items: center;

  padding: 76px 0 68px;
}

.hero-grid {
  display: grid;

  grid-template-columns:
    minmax(0, 1.15fr)
    minmax(280px, 0.85fr);

  align-items: center;

  gap: 64px;
}

/* Большой логотип на главном экране */

.hero-logo {
  width: 100%;
  max-width: 760px;
}

.hero-logo .eyebrow {
  margin-bottom: 14px;
}

.hero-logo-image {
  display: block;

  width: min(100%, 680px);
  height: auto;

  object-fit: contain;
  object-position: left center;
}

/*
  Подходит для файлов PNG с прозрачным фоном.
  Если у изображения вокруг логотипа есть лишние пустые поля,
  его можно увеличить через transform: scale(...).
*/

.hero-logo-image.is-cropped {
  transform: scale(1.06);
  transform-origin: left center;
}

.hero-lead {
  max-width: 720px;

  margin: 23px 0 0;

  color: #d3cdc2;

  font-size: clamp(1.05rem, 1.8vw, 1.28rem);
}

.hero-note {
  max-width: 700px;

  margin-top: 26px;

  color: var(--muted);
  font-size: 0.96rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;

  gap: 12px;
  margin-top: 30px;
}

.button {
  min-height: 46px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 0 20px;

  border: 1px solid var(--line);
  border-radius: 999px;

  text-decoration: none;
  font-weight: 680;
}

.button.primary {
  color: #18130d;

  border-color: var(--accent);
  background: var(--accent-soft);
}

.button.secondary {
  background: rgba(255, 255, 255, 0.03);
}

.button:hover,
.button:focus-visible {
  filter: brightness(1.08);
}

.sigil {
  position: relative;

  aspect-ratio: 1;

  display: grid;
  place-items: center;

  border: 1px solid rgba(230, 196, 143, 0.24);
  border-radius: 50%;

  background:
    radial-gradient(
      circle,
      rgba(201, 152, 85, 0.11) 0 3%,
      transparent 3.4%
    ),
    repeating-radial-gradient(
      circle,
      transparent 0 10%,
      rgba(255, 255, 255, 0.045) 10.3% 10.7%,
      transparent 11% 18%
    ),
    conic-gradient(
      from 45deg,
      transparent 0 11%,
      rgba(111, 165, 170, 0.11) 11% 14%,
      transparent 14% 36%,
      rgba(201, 152, 85, 0.13) 36% 39%,
      transparent 39% 61%,
      rgba(111, 165, 170, 0.11) 61% 64%,
      transparent 64% 86%,
      rgba(201, 152, 85, 0.13) 86% 89%,
      transparent 89%
    );
}

.sigil::before,
.sigil::after {
  content: "";

  position: absolute;
  inset: 13%;

  border: 1px solid rgba(255, 255, 255, 0.11);

  transform: rotate(45deg);
}

.sigil::after {
  inset: 26%;

  border-color: rgba(230, 196, 143, 0.24);

  transform: rotate(22.5deg);
}

.sigil-text {
  position: relative;
  z-index: 2;

  max-width: 70%;

  text-align: center;
}

.sigil-text strong {
  display: block;

  font-family: Georgia, "Times New Roman", serif;

  font-size: clamp(1.5rem, 3.3vw, 2.7rem);
  line-height: 1.18;
}

.sigil-text span {
  display: block;

  margin-top: 12px;

  color: var(--muted);

  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* Заголовки разделов */

.section-head {
  display: grid;

  grid-template-columns:
    minmax(240px, 0.8fr)
    minmax(0, 1.2fr);

  align-items: start;

  gap: 56px;
  margin-bottom: 38px;
}

.section-head > * {
  min-width: 0;
}

.section-head > p {
  max-width: 760px;

  margin: 2px 0 0;

  color: var(--muted);
  font-size: 1.04rem;
}

/* Карточки и сетки */

.grid {
  display: grid;
  gap: 18px;
}

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

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card {
  min-width: 0;

  padding: 25px;

  border: 1px solid var(--line);
  border-radius: var(--radius);

  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.04),
      rgba(255, 255, 255, 0.018)
    );
}

.card .number {
  display: block;

  margin-bottom: 12px;

  color: var(--accent-soft);

  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.86rem;
  letter-spacing: 0.14em;
}

.card p {
  margin: 0;

  color: var(--muted);
}

.plain-list {
  display: grid;

  gap: 13px;

  margin: 0;
  padding: 0;

  list-style: none;
}

.plain-list li {
  position: relative;

  padding-left: 18px;

  color: var(--muted);
}

.plain-list li::before {
  content: "—";

  position: absolute;
  left: 0;

  color: var(--accent-soft);
}

/* Правила */

.rule-box {
  padding: 28px;

  border: 1px solid rgba(230, 196, 143, 0.22);
  border-radius: var(--radius);

  background:
    linear-gradient(
      135deg,
      rgba(201, 152, 85, 0.08),
      rgba(111, 165, 170, 0.045)
    ),
    var(--panel);
}

.rule-box h3 {
  margin-bottom: 14px;
}

.rule-formula {
  margin: 14px 0;
  padding: 16px 18px;

  border-left: 3px solid var(--accent);

  background: rgba(255, 255, 255, 0.025);
  color: #ddd6ca;

  font-family:
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Consolas,
    monospace;

  overflow-wrap: anywhere;
}

.result-grid {
  display: grid;

  grid-template-columns: repeat(5, minmax(0, 1fr));

  gap: 10px;
  margin-top: 18px;
}

.result {
  padding: 14px;

  border: 1px solid var(--line);
  border-radius: 14px;

  background: rgba(255, 255, 255, 0.025);
}

.result strong {
  display: block;

  color: var(--accent-soft);
  font-size: 1.02rem;
}

.result span {
  display: block;

  margin-top: 4px;

  color: var(--muted);
  font-size: 0.86rem;
}

.quote {
  padding: 30px;

  border-left: 3px solid var(--accent);

  background: rgba(201, 152, 85, 0.055);
  color: #d8d1c5;

  font-family: Georgia, "Times New Roman", serif;

  font-size: clamp(1.15rem, 2.2vw, 1.7rem);
  line-height: 1.42;
}

/* Карусель классов */

.class-carousel {
  position: relative;

  margin-top: 12px;
}

.class-viewport {
  overflow: hidden;

  border-radius: calc(var(--radius) + 2px);
}

.class-track {
  display: flex;

  transition: transform 0.45s ease;

  will-change: transform;
}

.class-slide {
  min-width: 100%;

  padding: 1px;
}

.class-card {
  position: relative;

  min-height: 390px;

  display: grid;

  grid-template-columns:
    minmax(220px, 0.72fr)
    minmax(0, 1.28fr);

  align-items: stretch;

  gap: 34px;
  padding: 34px;

  overflow: hidden;

  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);

  background:
    linear-gradient(
      135deg,
      rgba(201, 152, 85, 0.1),
      rgba(111, 165, 170, 0.05)
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.045),
      rgba(255, 255, 255, 0.018)
    );
}

.class-card::after {
  content: "";

  position: absolute;
  right: -90px;
  bottom: -120px;

  width: 260px;
  height: 260px;

  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 50%;

  box-shadow:
    0 0 0 34px rgba(255, 255, 255, 0.015),
    0 0 0 68px rgba(255, 255, 255, 0.01);

  pointer-events: none;
}

.class-mark {
  position: relative;
  z-index: 1;

  min-height: 260px;

  display: grid;
  place-items: center;

  padding: 24px;

  border: 1px solid rgba(230, 196, 143, 0.2);
  border-radius: 18px;

  background:
    radial-gradient(
      circle at 50% 38%,
      rgba(230, 196, 143, 0.15),
      transparent 30%
    ),
    repeating-linear-gradient(
      135deg,
      transparent 0 18px,
      rgba(255, 255, 255, 0.025) 18px 19px
    ),
    rgba(255, 255, 255, 0.02);

  text-align: center;
}

.class-mark strong {
  display: block;

  color: var(--accent-soft);

  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.6rem, 8vw, 6.8rem);
  line-height: 1;

  opacity: 0.95;
}

.class-mark span {
  display: block;

  margin-top: 14px;

  color: var(--muted);

  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.class-copy {
  position: relative;
  z-index: 1;

  min-width: 0;

  display: flex;
  flex-direction: column;
  justify-content: center;
}

.class-copy h3 {
  margin: 0;

  font-size: clamp(2rem, 4.5vw, 3.5rem);
}

.class-role {
  margin: 10px 0 18px;

  color: var(--accent-soft);
  font-weight: 700;
}

.class-description {
  max-width: 720px;

  margin: 0;

  color: var(--muted);
  font-size: 1.03rem;
}

.class-tags {
  display: flex;
  flex-wrap: wrap;

  gap: 9px;
  margin-top: 24px;
}

.class-tags span {
  padding: 7px 11px;

  border: 1px solid var(--line);
  border-radius: 999px;

  background: rgba(255, 255, 255, 0.025);
  color: #d6d0c5;

  font-size: 0.84rem;
}

.class-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 18px;
  margin-top: 18px;
}

.class-buttons {
  display: flex;
  gap: 10px;
}

.class-button {
  width: 46px;
  height: 46px;

  display: grid;
  place-items: center;

  border: 1px solid var(--line);
  border-radius: 50%;

  background: rgba(255, 255, 255, 0.03);
  color: var(--text);

  font-size: 1.3rem;

  cursor: pointer;
}

.class-button:hover,
.class-button:focus-visible {
  background: rgba(255, 255, 255, 0.07);
  outline: none;
}

.class-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;

  gap: 8px;
}

.class-dot {
  width: 9px;
  height: 9px;

  padding: 0;
  border: 0;
  border-radius: 50%;

  background: rgba(255, 255, 255, 0.22);

  cursor: pointer;
}

.class-dot.is-active {
  width: 26px;

  border-radius: 999px;

  background: var(--accent-soft);
}

.class-count {
  min-width: 64px;

  color: var(--muted);

  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Статус разработки */

.cta {
  padding: 38px;

  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);

  background: var(--panel-soft);
}

.cta h2 {
  max-width: 16ch;

  font-size: clamp(2rem, 4vw, 3.2rem);
}

.cta > p {
  max-width: 760px;

  margin: 18px 0 0;

  color: var(--muted);
}

/* Подвал */

footer {
  padding: 32px 0 46px;

  color: #918b82;
  font-size: 0.9rem;
}

.footer-row {
  display: flex;
  justify-content: space-between;

  gap: 24px;
  padding-top: 24px;

  border-top: 1px solid var(--line);
}

/* Небольшие ноутбуки */

@media (max-width: 1040px) {
  .nav {
    gap: 16px;
  }

  .nav-links {
    gap: 12px;
  }

  .nav-links a {
    font-size: 0.84rem;
  }

  .secret-search {
    width: min(220px, 24vw);
  }

  .brand-logo img {
    width: 132px;
  }
}

/* Планшеты */

@media (max-width: 920px) {
  .nav {
    flex-wrap: wrap;

    gap: 14px;
    padding: 13px 0;
  }

  .secret-search {
    order: 3;
    width: 100%;
  }

  .hero-grid,
  .section-head {
    grid-template-columns: 1fr;

    gap: 34px;
  }

  h2 {
    max-width: 18ch;
  }

  .hero-logo {
    max-width: 700px;
  }

  .hero-logo-image {
    width: min(100%, 620px);
  }

  .sigil {
    width: min(480px, 88vw);
    margin-inline: auto;
  }

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

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

/* Карусель на небольших экранах */

@media (max-width: 760px) {
  .class-card {
    grid-template-columns: 1fr;

    padding: 24px;
  }

  .class-mark {
    min-height: 180px;
  }

  .class-controls {
    align-items: center;
  }
}

/* Телефоны */

@media (max-width: 620px) {
  .container {
    width: min(calc(100% - 40px), var(--max));
  }

  .nav {
    padding: 14px 0;
  }

  .nav-links {
    display: none;
  }

  .brand-logo img {
    width: 124px;
    height: 40px;
  }

  .secret-search {
    min-width: 0;
  }

  .hero {
    min-height: auto;

    padding: 48px 0 58px;
  }

  section {
    padding: 58px 0;
  }

  h1 {
    font-size: clamp(3.15rem, 17vw, 4.7rem);
    line-height: 0.98;
  }

  h2 {
    max-width: 100%;

    font-size: clamp(2rem, 10vw, 2.75rem);
    line-height: 1.05;
    letter-spacing: -0.025em;
  }

  h3 {
    font-size: 1.32rem;
  }

  .hero-logo {
    width: 100%;
    max-width: none;
  }

  .hero-logo .eyebrow {
    margin-bottom: 12px;
  }

  .hero-logo-image {
    width: 100%;
    max-width: 520px;

    object-position: left center;
  }

  .section-head {
    gap: 22px;
    margin-bottom: 30px;
  }

  .hero-lead,
  .hero-note,
  .section-head > p,
  .card p,
  .rule-box > p,
  .quote,
  .class-description,
  .cta > p {
    max-width: none;

    text-align: justify;
    text-align-last: left;
    text-justify: inter-word;

    hyphens: auto;
    -webkit-hyphens: auto;

    overflow-wrap: normal;
    word-break: normal;

    line-height: 1.62;
  }

  .section-head > p,
  .card p,
  .rule-box > p,
  .class-description,
  .cta > p {
    font-size: 1rem;
  }

  .hero-lead {
    font-size: 1.05rem;
  }

  .hero-note {
    font-size: 0.94rem;
  }

  .quote {
    padding: 24px 20px;

    font-size: 1.13rem;
  }

  .grid.two,
  .grid.three,
  .grid.four,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .card,
  .rule-box {
    padding: 22px;
  }

  .cta {
    padding: 28px 22px;
  }

  .class-controls {
    gap: 12px;
  }

  .class-button {
    width: 42px;
    height: 42px;
  }

  .footer-row {
    flex-direction: column;
  }
}

/* Очень узкие телефоны */

@media (max-width: 390px) {
  .container {
    width: min(calc(100% - 28px), var(--max));
  }

  .brand-logo img {
    width: 112px;
  }

  .hero-logo-image {
    width: 100%;
  }

  .class-card {
    padding: 20px;
  }

  .class-dots {
    gap: 6px;
  }

  .class-count {
    min-width: 48px;
    font-size: 0.86rem;
  }
}

/* Уменьшение анимации */

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

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

  .class-track {
    transition: none;
  }
}
