.mix-sec {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: 80px 24px 88px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.mix-sec::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  opacity: 0.5;
  pointer-events: none;
}

.mix-sec::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 12% 18%, rgba(227, 166, 87, 0.09), transparent 34%),
    radial-gradient(circle at 88% 78%, rgba(127, 179, 213, 0.08), transparent 36%);
  pointer-events: none;
}

.mix-sec > * {
  position: relative;
  z-index: 1;
}

.mix-h {
  margin: 0 0 20px;
  font: 700 clamp(28px, 3.6vw, 38px) / 1.15 var(--display);
  letter-spacing: -1.2px;
  color: var(--text);
}

.mix-h::before {
  content: "";
  display: inline-block;
  width: 22px;
  height: 2px;
  margin-right: 14px;
  vertical-align: middle;
  background: linear-gradient(90deg, var(--gold-bright), #7FB3D5);
}

.mix-h.sm {
  margin: 0 0 8px;
  font-size: clamp(19px, 2.3vw, 23px);
  letter-spacing: -0.4px;
}

.mix-h.sm::before {
  width: 14px;
  margin-right: 10px;
}

.mix-panels {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 14px;
  margin: 14px 0 0;
}

.mix-pan {
  position: relative;
  min-height: 190px;
  padding: 26px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
}

.mix-pan p {
  margin: 0 0 16px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

.mix-quick {
  counter-reset: quick;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--line);
}

.mix-quick a {
  --quick-accent: var(--gold-bright);
  counter-increment: quick;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  border: 0;
  border-radius: 0;
  background: var(--bg-card);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  transition: color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

.mix-quick a:nth-child(1) {
  --quick-accent: #E3A657;
}

.mix-quick a:nth-child(2) {
  --quick-accent: #7FB3D5;
}

.mix-quick a:nth-child(3) {
  --quick-accent: #86C5A8;
}

.mix-quick a:nth-child(4) {
  --quick-accent: #B99BD8;
}

.mix-quick a::before {
  content: counter(quick, decimal-leading-zero);
  color: var(--quick-accent);
  font: 500 11px / 1 var(--math);
}

.mix-quick a:hover {
  background: var(--bg-card);
  color: var(--quick-accent);
  box-shadow: inset 3px 0 var(--quick-accent);
}

.mix-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 28px;
  border: none;
  border-radius: var(--radius-md);
  font: 600 14px / 1 var(--font);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.mix-btn:hover {
  transform: translateY(-1px);
}

.mix-btn.pri {
  color: var(--btn-primary-text);
  background: var(--btn-primary-bg);
  box-shadow: var(--shadow-sm);
}

.mix-btn.pri:hover {
  background: var(--btn-primary-hover);
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

.mix-btn.out {
  border: 1px solid var(--line-strong);
  color: var(--text);
  background: transparent;
}

.mix-btn.out:hover {
  border-color: var(--gold);
  background: var(--gold-dim);
  color: var(--gold);
}

.hero-art.mix-art {
  display: block;
  min-height: 0;
  aspect-ratio: auto;
  padding: 0;
  border: 0;
  background: none;
}

.hero-art.mix-art::before,
.hero-art.mix-art::after {
  display: none;
}

.mix-art img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.exam-dialog {
  width: min(920px, 96vw);
  max-height: 92vh;
  padding: 0;
  overflow: auto;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

.exam-dialog::backdrop {
  background: rgba(10, 13, 15, 0.8);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.exam-close {
  position: sticky;
  top: 12px;
  float: right;
  margin: 12px 16px 0 0;
  z-index: 2;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  background: var(--bg);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.exam-close:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.exam-dialog .exam-main {
  padding: 28px;
}

@media (max-width: 1024px) {
  .mix-panels {
    grid-template-columns: 1fr;
  }
}


@media (max-width: 760px) {
  .mix-sec {
    padding-top: 64px;
    padding-bottom: 72px;
  }

  .mix-quick {
    grid-template-columns: 1fr;
  }

  .mix-pan {
    min-height: 0;
    padding: 22px 24px;
  }
}


@media (max-width: 560px) {
  .mix-sec {
    padding: 56px 16px 64px;
  }

  .mix-panels {
    gap: 12px;
  }

  .mix-quick a {
    padding: 13px 14px;
    font-size: 12px;
  }
}


@media (prefers-reduced-motion: reduce) {
  .mix-quick a,
  .mix-btn {
    transition: none !important;
  }
}

/* ---------- Mövzular bölməsi ---------- */
#movzular.mix-sec {
  --rule: rgba(232, 230, 225, 0.11);
  --rule-strong: rgba(232, 230, 225, 0.22);
  --paper: rgba(232, 230, 225, 0.045);
  padding-top: 72px;
  padding-bottom: 80px;
  border: 0;
  scroll-margin-top: 80px;
}

#movzular.mix-sec::before,
#movzular.mix-sec::after {
  content: none;
}

.topics-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 380px);
  align-items: end;
  gap: 24px 48px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--rule-strong);
}

.topics-kicker {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 600;
}

.topics-title {
  margin: 0;
  color: var(--text);
  font: 700 clamp(30px, 4vw, 44px) / 1.12 var(--display);
  letter-spacing: -1px;
}

.topics-intro {
  margin: 0;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.65;
}

.topics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

.topic {
  display: flex;
}

.topic-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--bg-elevated);
  transition: border-color var(--transition-fast);
}

.topic-card:hover,
.topic-card:focus-within {
  border-color: var(--gold);
}

/* Dəftər torunda riyazi sxem */
.topic-figure {
  padding: 16px 12px;
  border-bottom: 1px solid var(--rule);
  background-image:
    linear-gradient(var(--paper) 1px, transparent 1px),
    linear-gradient(90deg, var(--paper) 1px, transparent 1px);
  background-size: 16px 16px;
  background-position: center;
}

.topic-figure svg {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 1;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topic-figure .axis {
  stroke: var(--text-dim);
  stroke-width: 1.25;
}

.topic-figure .guide {
  stroke: var(--text-dim);
  stroke-width: 1;
  stroke-dasharray: 3 4;
}

.topic-figure .ink {
  stroke: var(--gold-bright);
  stroke-width: 2;
}

.topic-figure .fill {
  fill: var(--gold-dim);
}

.topic-figure .dot {
  fill: var(--gold-bright);
}

.topic-figure text {
  fill: var(--text-muted);
  font: italic 12px var(--math);
  text-anchor: middle;
}

.topic-figure text.label {
  fill: var(--text);
  font-size: 14px;
}

.topic--numbers .topic-figure text {
  font-style: normal;
}

.topic-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px 20px 8px;
}

.topic-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 12px;
}

.topic-meta span:first-child {
  color: var(--gold);
  font-weight: 600;
}

.topic-title {
  min-height: 2.6em;
  margin: 0 0 8px;
  color: var(--text);
  font: 700 19px / 1.3 var(--display);
  letter-spacing: -0.3px;
}

.topic-text {
  min-height: 3.2em;
  margin: 0 0 16px;
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.6;
}

.topic-list {
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.topic-list li {
  padding: 9px 0;
  border-top: 1px solid var(--rule);
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

/* bütün kart kliklənir: başlıqdakı keçid kartın üstünü örtür */
.topic-card {
  position: relative;
}

.topic-open {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  color: inherit;
  text-decoration: none;
}

.topic-open::after {
  content: "";
  position: absolute;
  inset: 0;
}

.topic-open span {
  color: var(--gold-bright);
  transition: transform var(--transition-fast);
}

.topic-card:hover .topic-open span {
  transform: translateX(4px);
}

.topic-card:hover .topic-title {
  color: var(--gold-bright);
}

.topics-next {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 32px;
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
}

.topics-next-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 0;
}

.topics-next-item + .topics-next-item {
  margin-left: 32px;
  padding-left: 32px;
  border-left: 1px solid var(--rule);
}

.topics-next-item p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.55;
}

.topics-next-item .topics-next-title {
  margin-bottom: 4px;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
}

.topics-next .mix-btn {
  flex: 0 0 auto;
}

@media (max-width: 1080px) {
  .topics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topics-next {
    grid-template-columns: 1fr;
  }

  .topics-next-item + .topics-next-item {
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--rule);
  }
}

@media (max-width: 760px) {
  .topics-head {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  #movzular.mix-sec {
    padding: 48px 16px 56px;
  }

  .topics-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .topic-title,
  .topic-text {
    min-height: 0;
  }

  .topics-next-item {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .topic-card,
  .topic-open span {
    transition: none;
  }
}

/* ---------- Mövzu sxemlərinin rəngləri ---------- */
.topic-figure svg .coral { --tone: #FF8A75; }
.topic-figure svg .teal { --tone: #45D6C4; }
.topic-figure svg .sun { --tone: #FFC857; }
.topic-figure svg .blue { --tone: #6FB1FF; }
.topic-figure svg .green { --tone: #8BDB81; }
.topic-figure svg .violet { --tone: #A996FF; }
.topic-figure svg .pink { --tone: #FF8FC7; }

.topic-figure svg path.line { stroke: var(--tone); stroke-width: 2; }
.topic-figure svg path.bold { stroke-width: 3; }
.topic-figure svg path.guide { stroke-width: 1.5; stroke-dasharray: 3 4; }
.topic-figure svg path.shade { fill: var(--tone); fill-opacity: 0.22; }
.topic-figure svg circle[class],
.topic-figure svg text.coral,
.topic-figure svg text.teal,
.topic-figure svg text.sun,
.topic-figure svg text.blue,
.topic-figure svg text.green,
.topic-figure svg text.pink { fill: var(--tone); }
.topic-figure svg text { font-weight: 600; }

/* hər bölmənin sxem pəncərəsi öz çalarında */
.topic--numbers .topic-figure { background-color: rgba(255, 200, 87, 0.08); }
.topic--algebra .topic-figure { background-color: rgba(111, 177, 255, 0.09); }
.topic--geometry .topic-figure { background-color: rgba(69, 214, 196, 0.09); }
.topic--functions .topic-figure { background-color: rgba(169, 150, 255, 0.11); }
.topic--mentiq .topic-figure { background-color: rgba(255, 138, 117, 0.09); }
.topic--trigonometry .topic-figure { background-color: rgba(69, 214, 196, 0.09); }
.topic--probability .topic-figure { background-color: rgba(111, 177, 255, 0.09); }
.topic--sequences .topic-figure { background-color: rgba(169, 150, 255, 0.09); }
.topic--sets .topic-figure { background-color: rgba(139, 219, 129, 0.09); }
.topic--calculus .topic-figure { background-color: rgba(255, 143, 199, 0.09); }
.topic--coordinates .topic-figure { background-color: rgba(255, 200, 87, 0.09); }
.topic--stereometry .topic-figure { background-color: rgba(111, 177, 255, 0.09); }

/* ---------- Ana səhifə: 5 bölmə və "Hamısı" kartı ---------- */
.topic-all {
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 160px;
  padding: 24px 16px;
  color: var(--text-muted);
  font-size: 13.5px;
  text-align: center;
  text-decoration: none;
}

.topic-all strong {
  color: var(--gold-bright);
  font: 700 28px / 1.2 var(--display);
}

.topic-all b {
  color: var(--gold-bright);
  font-size: 24px;
}

@media (min-width: 1081px) {
  .topics-grid--home {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
