:root {
  --blue: #0078BD;
  --cyan: #00A5E5;
  --purple: #961E82;
  --pink: #E60F4B;
  --orange: #DF5A32;
  --graphite: #222222;
  --muted: #6D7580;
  --line: #DDE5EC;
  --soft: #F4F7FA;
  --white: #FFFFFF;
  --shadow: 0 24px 70px rgba(21, 44, 70, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--graphite);
  background: var(--soft);
  font-family: Montserrat, Arial, sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

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

button,
input,
select {
  font: inherit;
}

.container {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  background: var(--white);
  border-bottom: 1px solid rgba(221, 229, 236, 0.9);
}

.header-inner {
  min-height: 108px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.brand-logo {
  display: block;
  width: min(330px, 58vw);
  max-height: 76px;
  object-fit: contain;
  object-position: left center;
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.main-nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 9px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #3E4650;
  font-weight: 600;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.main-nav a:hover {
  color: var(--blue);
  border-color: rgba(0, 120, 189, 0.28);
  background: rgba(0, 165, 229, 0.08);
}

.brand-line {
  display: grid;
  grid-template-columns: 28fr 30fr 28fr 14fr;
  height: 5px;
}

.brand-line span:nth-child(1) {
  background: var(--pink);
}

.brand-line span:nth-child(2) {
  background: var(--cyan);
}

.brand-line span:nth-child(3) {
  background: var(--purple);
}

.brand-line span:nth-child(4) {
  background: var(--orange);
}

.section {
  padding: 70px 0;
  position: relative;
}

.hero {
  min-height: 520px;
  display: flex;
  align-items: center;
  background: var(--white);
  overflow: hidden;
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.62fr);
  align-items: center;
  gap: 48px;
}

.badge,
.section-kicker,
.match-badge,
.exam-chip-small {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  font-weight: 800;
}

.badge {
  padding: 10px 16px;
  color: var(--blue);
  background: rgba(0, 165, 229, 0.12);
}

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

h1 {
  max-width: 780px;
  margin-bottom: 22px;
  font-size: clamp(42px, 7vw, 78px);
  line-height: 0.98;
  letter-spacing: 0;
  font-weight: 900;
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(30px, 4.8vw, 54px);
  line-height: 1.05;
  letter-spacing: 0;
  font-weight: 900;
}

h3 {
  margin-bottom: 12px;
  font-size: 22px;
  line-height: 1.18;
  font-weight: 850;
}

.hero-text {
  max-width: 760px;
  margin-bottom: 34px;
  color: #59636F;
  font-size: clamp(18px, 2vw, 23px);
  font-weight: 500;
}

.button {
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 999px;
  padding: 14px 25px;
  cursor: pointer;
  font-weight: 800;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-2px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  box-shadow: none;
}

.button-primary {
  color: var(--white);
  background: var(--blue);
  box-shadow: 0 16px 34px rgba(0, 120, 189, 0.22);
}

.button-primary:hover:not(:disabled) {
  background: var(--cyan);
}

.button-secondary {
  color: var(--blue);
  background: var(--white);
  border: 1px solid rgba(0, 120, 189, 0.24);
}

.button-secondary:hover {
  background: rgba(0, 165, 229, 0.08);
}

.hero-card {
  position: relative;
  min-height: 330px;
  padding: 34px;
  border-radius: 28px;
  color: var(--white);
  background: var(--blue);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-card > * {
  position: relative;
  z-index: 1;
}

.hero-card-top {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 28px;
  font-size: 25px;
  font-weight: 850;
}

.hero-number {
  width: 92px;
  height: 92px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 58px;
  line-height: 1;
}

.hero-card-divider {
  width: 100%;
  height: 1px;
  margin-bottom: 24px;
  background: rgba(255, 255, 255, 0.3);
}

.hero-card p,
.hero-card strong {
  display: block;
  font-size: 21px;
}

.hero-card strong {
  margin-top: 40px;
}

.light-orb {
  position: absolute;
  z-index: 0;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  opacity: 0.16;
  filter: blur(36px);
  pointer-events: none;
  animation: lightFlow 9s ease-in-out infinite alternate;
}

.light-orb-a {
  left: -110px;
  top: 90px;
  background: var(--cyan);
}

.light-orb-b {
  right: 5%;
  bottom: -120px;
  background: var(--pink);
  animation-delay: 1.8s;
}

.section-heading {
  max-width: 880px;
}

.section-heading p {
  color: var(--muted);
  font-size: 18px;
  font-weight: 500;
}

.section-kicker {
  margin-bottom: 14px;
  padding: 8px 14px;
  color: var(--pink);
  background: rgba(230, 15, 75, 0.08);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.scores-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 30px;
}

.score-pill {
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border: 1px solid rgba(0, 120, 189, 0.1);
  border-radius: 22px;
  background: var(--white);
  box-shadow: 0 12px 34px rgba(34, 34, 34, 0.05);
}

.score-pill::before {
  content: "";
  width: 7px;
  height: 52px;
  border-radius: 999px;
  background: var(--pink);
  flex: 0 0 auto;
}

.score-pill span {
  flex: 1;
  color: #4E5864;
  font-weight: 750;
}

.score-pill strong {
  color: var(--blue);
  font-size: 32px;
  line-height: 1;
  font-weight: 900;
}

.calculator-section {
  background: var(--soft);
}

.calculator-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}

.choice-panel,
.filters-panel {
  border-radius: 28px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.choice-panel {
  padding: clamp(24px, 4vw, 42px);
}

.subjects-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.subject-chip {
  min-height: 48px;
  border: 1px solid #CAD5DF;
  border-radius: 999px;
  padding: 11px 17px;
  color: #4D5864;
  background: var(--white);
  cursor: pointer;
  font-weight: 800;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.subject-chip:hover {
  color: var(--blue);
  border-color: rgba(0, 120, 189, 0.5);
  transform: translateY(-1px);
}

.subject-chip.is-active {
  color: var(--white);
  border-color: var(--blue);
  background: var(--blue);
  box-shadow: 0 12px 26px rgba(0, 120, 189, 0.18);
}

.selection-tools {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.soft-warning {
  max-width: 610px;
  margin: 0;
  padding: 13px 16px;
  border-radius: 18px;
  color: #8A4B00;
  background: #FFF5E7;
  font-weight: 750;
}

.filters-panel {
  padding: 24px;
  position: sticky;
  top: 18px;
}

.field-label {
  display: block;
  margin: 0 0 8px;
  color: #56616D;
  font-size: 14px;
  font-weight: 850;
}

.search-input,
.level-select {
  width: 100%;
  min-height: 52px;
  margin-bottom: 18px;
  border: 1px solid #D6E0E8;
  border-radius: 18px;
  padding: 0 16px;
  color: var(--graphite);
  background: var(--white);
  outline: none;
  font-weight: 600;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input:focus,
.level-select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 4px rgba(0, 165, 229, 0.12);
}

.counter-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 104px;
  margin-top: 8px;
  padding: 20px;
  border-radius: 22px;
  color: var(--white);
  background: var(--pink);
}

.counter-card span {
  font-weight: 800;
}

.counter-card strong {
  font-size: 48px;
  line-height: 1;
  font-weight: 900;
}

.results-button {
  min-width: 230px;
}

.button-note {
  flex-basis: 100%;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  padding: 24px;
}

.modal.is-open {
  display: block;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 34, 0.52);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  max-height: calc(100vh - 48px);
  margin: 0 auto;
  padding: clamp(22px, 4vw, 38px);
  overflow: auto;
  border-radius: 28px;
  background: var(--white);
  box-shadow: 0 30px 90px rgba(9, 25, 40, 0.25);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.modal-header p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-weight: 500;
}

.modal-close {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border: 1px solid #D6E0E8;
  border-radius: 50%;
  color: var(--graphite);
  background: var(--white);
  cursor: pointer;
  font-size: 30px;
  line-height: 1;
}

.modal-close:hover {
  color: var(--white);
  background: var(--pink);
  border-color: var(--pink);
}

.results-empty {
  padding: 28px;
  border: 1px dashed #B9C7D3;
  border-radius: 24px;
  color: #66727E;
  background: var(--soft);
  font-size: 19px;
  font-weight: 750;
}

.results-list {
  display: grid;
  gap: 16px;
}

.category-group {
  border: 1px solid #DDE5EC;
  border-radius: 24px;
  background: var(--white);
  overflow: hidden;
  animation: fadeUp 0.28s ease both;
}

.category-group[open] {
  box-shadow: 0 14px 42px rgba(34, 34, 34, 0.06);
}

.category-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 76px;
  padding: 20px 24px;
  cursor: pointer;
  color: var(--graphite);
  font-size: 22px;
  font-weight: 900;
  list-style: none;
}

.category-title::-webkit-details-marker {
  display: none;
}

.category-title::after {
  content: "+";
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 50%;
  color: var(--white);
  background: var(--blue);
}

.category-group[open] .category-title::after {
  content: "−";
  background: var(--pink);
}

.category-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 15px;
  font-weight: 750;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding: 0 20px 22px;
}

.direction-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  border: 1px solid rgba(0, 120, 189, 0.11);
  border-radius: 22px;
  background: var(--white);
  box-shadow: 0 12px 34px rgba(34, 34, 34, 0.05);
  overflow: hidden;
  animation: fadeUp 0.32s ease both;
}

.direction-photo {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--blue);
  overflow: hidden;
}

.direction-photo.category-it {
  background: var(--blue);
}

.direction-photo.category-engineering {
  background: var(--purple);
}

.direction-photo.category-energy {
  background: var(--cyan);
}

.direction-photo.category-architecture {
  background: var(--orange);
}

.direction-photo.category-pedagogy {
  background: var(--pink);
}

.direction-photo.category-ecology {
  background: #168B64;
}

.direction-photo.category-management {
  background: #2F7DBF;
}

.direction-photo.category-mining {
  background: #515D6B;
}

.direction-photo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  opacity: 1;
}

.direction-photo img.is-loaded {
  opacity: 1;
}

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

.card-top {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.card-top h3 {
  overflow-wrap: anywhere;
}

.level-tag {
  max-width: 100%;
  padding: 7px 11px;
  border-radius: 999px;
  color: var(--purple);
  background: rgba(150, 30, 130, 0.08);
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
}

.level-tag.specialist {
  color: var(--white);
  background: var(--blue);
}

.match-badge {
  margin-bottom: 12px;
  padding: 7px 11px;
  color: #087241;
  background: rgba(12, 170, 93, 0.1);
  font-size: 13px;
}

.exam-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 18px;
}

.admission-summary {
  display: grid;
  gap: 12px;
  margin: 12px 0 18px;
}

.summary-block {
  display: grid;
  gap: 7px;
  padding: 12px;
  border-radius: 16px;
  background: #F6F9FC;
}

.summary-block .exam-row {
  margin: 0;
}

.summary-label {
  color: #53606D;
  font-size: 13px;
  font-weight: 850;
}

.summary-text {
  color: #2F3A45;
  font-size: 14px;
  font-weight: 750;
}

.entrance-block {
  border: 1px solid rgba(230, 15, 75, 0.16);
  background: rgba(230, 15, 75, 0.06);
}

.entrance-block .summary-text {
  color: var(--pink);
}

.exam-chip-small {
  padding: 7px 10px;
  color: #485563;
  background: #EEF4F8;
  font-size: 13px;
}

.exam-chip-small.required {
  color: var(--white);
  background: var(--blue);
}

.exam-chip-small.entrance {
  color: var(--white);
  background: var(--pink);
}

.direction-card p {
  color: #5E6874;
  font-weight: 500;
}

.careers {
  margin-top: auto;
  color: #3D4650;
  font-size: 15px;
  font-weight: 500;
}

.details-link {
  width: 100%;
  margin-top: 20px;
}

body.modal-open {
  overflow: hidden;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes lightFlow {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(44px, 26px, 0) scale(1.08);
  }
}

@media (max-width: 1024px) {
  .hero-grid,
  .calculator-layout {
    grid-template-columns: 1fr;
  }

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

  .filters-panel {
    position: static;
  }

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

@media (max-width: 768px) {
  .container {
    width: min(100% - 28px, 1180px);
  }

  .header-inner {
    min-height: 112px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
  }

  .brand-logo {
    width: min(300px, 100%);
  }

  .main-nav {
    justify-content: flex-start;
  }

  .main-nav a {
    padding-inline: 13px;
  }

  .section {
    padding: 54px 0;
  }

  .hero {
    min-height: auto;
  }

  .hero-card {
    min-height: 280px;
    padding: 26px;
  }

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

  .score-pill {
    min-height: 82px;
  }

  .subject-chip {
    max-width: 100%;
    white-space: normal;
  }

  .modal {
    padding: 12px;
  }

  .modal-panel {
    max-height: calc(100vh - 24px);
    border-radius: 22px;
  }

  .modal-header {
    flex-direction: column-reverse;
  }
}

@media (max-width: 420px) {
  .container {
    width: min(100% - 22px, 1180px);
  }

  h1 {
    font-size: 40px;
  }

  h2 {
    font-size: 30px;
  }

  .button {
    width: 100%;
  }

  .hero-card-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-number {
    width: 78px;
    height: 78px;
    font-size: 48px;
  }

  .choice-panel,
  .filters-panel {
    border-radius: 22px;
  }

  .category-title {
    align-items: flex-start;
    flex-wrap: wrap;
  }
}
