:root {
  --bg: #06030d;
  --surface: rgba(255, 255, 255, .06);
  --surface-strong: rgba(255, 255, 255, .09);
  --text: #fff7eb;
  --muted: #cbbdd9;
  --gold: #e6c16c;
  --gold2: #f9e19e;
  --violet: #8b5cf6;
  --teal: #9ff1df;
  --rose: #f0a6c8;
  --line: rgba(255, 255, 255, .12);
  --shadow: 0 26px 76px rgba(0, 0, 0, .38);
  --container: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.7;
  background:
    linear-gradient(145deg, #05020a 0%, #0d0617 38%, #150a22 72%, #07040d 100%);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .14;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, .42) 1px, transparent 1.8px),
    radial-gradient(circle, rgba(230, 193, 108, .3) 1px, transparent 2px);
  background-size: 138px 138px, 220px 220px;
  background-position: 0 0, 44px 78px;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(249, 225, 158, .08), transparent 22%, transparent 78%, rgba(139, 92, 246, .1)),
    linear-gradient(180deg, rgba(6, 3, 13, .1), rgba(6, 3, 13, .72));
}

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

a:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(249, 225, 158, .9);
  outline-offset: 4px;
}

p,
h1,
h2,
h3,
h4 {
  margin-top: 0;
}

.container {
  position: relative;
  z-index: 1;
  width: min(var(--container), calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 54px;
}

.breadcrumbs {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  margin: 0 0 26px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  background: rgba(255, 255, 255, .045);
}

.breadcrumbs a,
.breadcrumbs > span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 999px;
  padding: 0 12px;
}

.breadcrumbs a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, .08);
}

.breadcrumbs span:not(:last-child) {
  padding: 0;
  opacity: .5;
}

.card-header {
  display: grid;
  gap: 18px;
  margin: 0 0 24px;
  padding: clamp(28px, 6vw, 58px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .035)),
    rgba(255, 255, 255, .05);
  box-shadow: var(--shadow);
}

.arcana-num {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border: 1px solid rgba(230, 193, 108, .22);
  border-radius: 999px;
  padding: 0 14px;
  color: #ffe5aa;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  background: rgba(230, 193, 108, .08);
}

.card-header h1 {
  max-width: 860px;
  margin: 0;
  color: var(--text);
  font-size: clamp(42px, 7vw, 82px);
  line-height: .96;
  font-weight: 950;
}

.card-header .latin {
  display: block;
  margin-top: 12px;
  color: var(--gold2);
  font-size: clamp(18px, 2.6vw, 28px);
  line-height: 1.15;
  font-weight: 800;
}

.card-header .lead {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.62;
}

section,
.toc,
.cta-block,
.card-nav {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .12);
}

section {
  margin: 16px 0;
  padding: clamp(22px, 4vw, 34px);
}

section h2 {
  margin-bottom: 18px;
  color: var(--gold2);
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.08;
}

section h3 {
  margin: 24px 0 10px;
  color: var(--teal);
  font-size: 21px;
  line-height: 1.22;
}

section h4 {
  margin-bottom: 8px;
  color: var(--gold2);
  font-size: 18px;
  line-height: 1.3;
}

section p {
  margin-bottom: 14px;
  color: rgba(255, 247, 235, .82);
}

section p:last-child {
  margin-bottom: 0;
}

section ul {
  margin: 0;
  padding-left: 22px;
  color: rgba(255, 247, 235, .82);
}

section li {
  margin-bottom: 8px;
}

strong,
b {
  color: #fff1bd;
}

.toc {
  margin: 16px 0;
  padding: 22px;
}

.toc h3 {
  margin: 0 0 14px;
  color: var(--gold2);
  font-size: 15px;
  text-transform: uppercase;
}

.toc ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc a {
  display: flex;
  align-items: center;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 12px;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 15px;
  background: rgba(255, 255, 255, .035);
}

.toc a:hover {
  color: var(--text);
  border-color: rgba(249, 225, 158, .35);
  background: rgba(255, 255, 255, .075);
}

.keywords-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .04);
}

.keywords-table th,
.keywords-table td {
  padding: 15px 18px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.keywords-table tr:last-child th,
.keywords-table tr:last-child td {
  border-bottom: 0;
}

.keywords-table th {
  width: 190px;
  color: var(--gold2);
  font-weight: 900;
  background: rgba(230, 193, 108, .075);
}

.keywords-table td {
  color: rgba(255, 247, 235, .84);
}

.position-block,
.sphere-card,
.combo,
.faq details,
.cards-grid .card-link {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .055);
}

.position-block {
  margin: 14px 0;
  padding: 22px;
}

.position-block.upright {
  border-color: rgba(249, 225, 158, .24);
  background: linear-gradient(135deg, rgba(230, 193, 108, .12), rgba(255, 255, 255, .045));
}

.position-block.reversed {
  border-color: rgba(240, 166, 200, .28);
  background: linear-gradient(135deg, rgba(240, 166, 200, .12), rgba(255, 255, 255, .045));
}

.position-block h3 {
  margin-top: 0;
}

.spheres {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.sphere-card {
  padding: 20px;
}

.sphere-card[style] {
  grid-column: 1 / -1 !important;
}

.combinations {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.combo {
  padding: 14px 16px;
  color: rgba(255, 247, 235, .84);
  border-color: rgba(159, 241, 223, .2);
}

.combo strong {
  color: var(--teal);
}

.faq {
  display: grid;
  gap: 10px;
}

.faq h2 {
  margin-bottom: 8px;
}

.faq details {
  padding: 16px 18px;
}

.faq summary {
  cursor: pointer;
  color: #fff1bd;
  font-weight: 900;
}

.faq details[open] summary {
  margin-bottom: 10px;
}

.cta-block {
  margin: 18px 0;
  padding: clamp(26px, 5vw, 42px);
  text-align: center;
  background:
    linear-gradient(135deg, rgba(230, 193, 108, .16), rgba(139, 92, 246, .12)),
    rgba(255, 255, 255, .06);
}

.cta-block h2 {
  margin-bottom: 10px;
  color: var(--gold2);
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.08;
}

.cta-block p {
  max-width: 720px;
  margin: 0 auto 22px;
  color: var(--muted);
}

.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  border-radius: 16px;
  padding: 0 22px;
  color: #180f28;
  font-size: 15px;
  font-weight: 950;
  background: linear-gradient(135deg, var(--gold2), var(--gold));
  box-shadow: 0 18px 44px rgba(230, 193, 108, .23);
  transition: transform .18s, box-shadow .18s;
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 52px rgba(230, 193, 108, .28);
}

.card-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  padding: 14px;
}

.card-nav a,
.card-nav > span {
  min-height: 58px;
}

.card-nav a {
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-radius: 16px;
  padding: 10px 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, .04);
}

.card-nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, .08);
}

.card-nav .nav-home {
  width: 58px;
  align-items: center;
  color: #180f28;
  font-size: 0;
  background: linear-gradient(135deg, var(--gold2), var(--gold));
}

.card-nav .nav-home::before {
  content: "Все";
  font-size: 13px;
  font-weight: 950;
}

.card-nav .nav-next {
  text-align: right;
  align-items: flex-end;
}

.nav-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.nav-title {
  display: block;
  color: var(--gold2);
  font-weight: 950;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.cards-grid .card-link {
  display: grid;
  gap: 6px;
  min-height: 138px;
  padding: 20px;
  transition: transform .18s, border-color .18s, background .18s;
}

.cards-grid .card-link:hover {
  transform: translateY(-3px);
  border-color: rgba(249, 225, 158, .42);
  background: rgba(255, 255, 255, .085);
}

.cards-grid .num {
  color: var(--teal);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.cards-grid .name {
  color: var(--text);
  font-size: 22px;
  font-weight: 950;
  line-height: 1.14;
}

.cards-grid .lat {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

footer {
  position: relative;
  z-index: 1;
  width: min(var(--container), calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 38px;
  color: rgba(203, 189, 217, .78);
  font-size: 14px;
  text-align: center;
}

footer p {
  margin: 0;
}

footer a {
  color: var(--gold2);
}

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

  .container {
    width: min(100% - 22px, var(--container));
    padding-top: 18px;
  }

  .breadcrumbs {
    border-radius: 18px;
  }

  .card-header,
  section,
  .toc,
  .cta-block,
  .card-nav {
    border-radius: 20px;
  }

  .toc ul,
  .spheres,
  .card-nav {
    grid-template-columns: 1fr;
  }

  .card-nav .nav-home {
    width: 100%;
  }

  .card-nav .nav-next {
    text-align: left;
    align-items: stretch;
  }

  .keywords-table,
  .keywords-table tbody,
  .keywords-table tr,
  .keywords-table th,
  .keywords-table td {
    display: block;
    width: 100%;
  }

  .keywords-table th {
    border-bottom: 0;
    padding-bottom: 6px;
  }

  .keywords-table td {
    padding-top: 6px;
  }

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