:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --text: #15192b;
  --muted: #5b6275;
  --line: #e3e6ee;
  --brand: #1c4bb4;
  --brand-ink: #ffffff;
  --accent: #ffc928;
  --hero-from: #16337d;
  --hero-to: #1c4bb4;
  --shadow: 0 6px 24px rgba(21, 25, 43, .08);
  --radius: 18px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1220;
    --surface: #181c2e;
    --text: #eef0f7;
    --muted: #a3a9bc;
    --line: #2a2f45;
    --brand: #5b8cff;
    --brand-ink: #0f1220;
    --hero-from: #0d1a40;
    --hero-to: #1a3684;
    --shadow: 0 6px 24px rgba(0, 0, 0, .35);
  }
}
:root[data-theme="dark"] {
  --bg: #0f1220;
  --surface: #181c2e;
  --text: #eef0f7;
  --muted: #a3a9bc;
  --line: #2a2f45;
  --brand: #5b8cff;
  --brand-ink: #0f1220;
  --hero-from: #0d1a40;
  --hero-to: #1a3684;
  --shadow: 0 6px 24px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); font-weight: 800; }
.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 16px; }
section { padding: 72px 0; }
.section-lead { color: var(--muted); max-width: 640px; margin: 0 0 32px; }

/* Header */
.header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header .wrap { display: flex; align-items: center; gap: 16px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 800; }
.logo img, .logo .logo-mark { width: 40px; height: 40px; border-radius: 10px; }
.logo .logo-mark {
  display: grid; place-items: center; background: var(--brand); color: var(--brand-ink); font-size: .9rem;
}
.nav { margin-left: auto; display: flex; gap: 4px; }
.nav a { color: var(--text); text-decoration: none; padding: 8px 12px; border-radius: 10px; font-weight: 600; font-size: .95rem; }
.nav a:hover { background: var(--bg); }
.burger { display: none; margin-left: auto; background: none; border: 0; font-size: 1.6rem; color: var(--text); cursor: pointer; }
@media (max-width: 820px) {
  .burger { display: block; }
  .nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; background: var(--surface); padding: 8px 16px 16px; border-bottom: 1px solid var(--line);
  }
  .nav.open { display: flex; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 14px 22px; border-radius: 12px;
  font-weight: 700; text-decoration: none; border: 0; cursor: pointer; font-size: 1rem;
}
.btn-accent { background: var(--accent); color: #15192b; }
.btn-ghost { background: rgba(255,255,255,.14); color: #fff; }
.btn-brand { background: var(--brand); color: var(--brand-ink); }

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--hero-from), var(--hero-to));
  background-size: cover; background-position: center;
  color: #fff; padding: 96px 0 88px;
}
.hero h1 { font-size: clamp(2rem, 5.5vw, 3.6rem); font-weight: 800; max-width: 780px; }
.hero p { font-size: 1.15rem; opacity: .9; max-width: 620px; margin: 0 0 28px; }
.hero .eyebrow { display: inline-block; background: rgba(255,255,255,.14); padding: 6px 12px; border-radius: 99px; font-size: .85rem; font-weight: 700; margin-bottom: 18px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: -44px; }
.stat { background: var(--surface); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); text-align: center; }
.stat b { display: block; font-size: 1.8rem; color: var(--brand); overflow-wrap: anywhere; }
.stat span { color: var(--muted); font-size: .9rem; }
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Filters */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.chip {
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  padding: 8px 16px; border-radius: 99px; font-weight: 600; cursor: pointer; font-family: inherit; font-size: .95rem;
}
.chip.active { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }

/* Profession cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.card {
  background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  text-decoration: none; color: var(--text); display: flex; flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(21,25,43,.16); }
.card-media {
  aspect-ratio: 16 / 10; display: grid; place-items: center; font-size: 3.6rem;
  background: var(--c); background-size: cover; background-position: center; position: relative;
}
.card-media.has-photo { font-size: 0; }
.card-tag {
  position: absolute; left: 12px; top: 12px; background: rgba(0,0,0,.45); color: #fff;
  font-size: .75rem; font-weight: 700; padding: 4px 10px; border-radius: 99px;
}
.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.card-body h3 { font-size: 1.25rem; margin-bottom: 6px; }
.card-body p { color: var(--muted); margin: 0 0 16px; font-size: .95rem; }
.card-more { margin-top: auto; font-weight: 700; color: var(--brand); }

/* About & benefits */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.benefits { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.benefit { background: var(--surface); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.benefit .ico { font-size: 1.8rem; }
.benefit h3 { font-size: 1.05rem; margin: 8px 0 4px; }
.benefit p { margin: 0; color: var(--muted); font-size: .92rem; }
@media (max-width: 820px) { .about { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .benefits { grid-template-columns: 1fr; } }

/* Admission steps */
.alt { background: var(--surface); }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: s; }
.step { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: var(--bg); }
.step::before {
  counter-increment: s; content: counter(s);
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: #15192b; font-weight: 800; margin-bottom: 12px;
}
.step h3 { font-size: 1.05rem; margin-bottom: 4px; }
.step p { margin: 0; color: var(--muted); font-size: .92rem; }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .steps { grid-template-columns: 1fr; } }

/* Contacts */
.contacts { display: grid; grid-template-columns: 1fr 1.3fr; gap: 24px; }
.contact-box { background: var(--surface); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.contact-box dl { margin: 0; }
.contact-box dt { color: var(--muted); font-size: .85rem; margin-top: 14px; }
.contact-box dt:first-child { margin-top: 0; }
.contact-box dd { margin: 2px 0 0; font-weight: 700; overflow-wrap: anywhere; }
.contact-box dd a { color: var(--text); text-decoration: none; }
.socials { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.socials a { background: var(--bg); border: 1px solid var(--line); padding: 8px 14px; border-radius: 10px; text-decoration: none; font-weight: 700; font-size: .9rem; }
.map { border-radius: var(--radius); overflow: hidden; min-height: 320px; background: var(--line); }
.map iframe { width: 100%; height: 100%; min-height: 320px; border: 0; display: block; }
@media (max-width: 820px) { .contacts { grid-template-columns: 1fr; } }

/* Footer */
.footer { background: #0d1124; color: #c9cee0; padding: 32px 0; font-size: .9rem; }
.footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer a { color: #fff; }

/* Profession page */
.p-hero { color: #fff; padding: 56px 0 64px; background: var(--c); background-size: cover; background-position: center; position: relative; }
.p-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.15), rgba(0,0,0,.55)); }
.p-hero .wrap { position: relative; z-index: 1; }
.p-hero .back { color: #fff; opacity: .9; text-decoration: none; font-weight: 600; display: inline-block; margin-bottom: 24px; }
.p-hero .big-ico { font-size: 3.4rem; }
.p-hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; margin: 8px 0; }
.p-hero p { font-size: 1.15rem; opacity: .92; margin: 0; max-width: 640px; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: -32px; position: relative; z-index: 2; }
.fact { background: var(--surface); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.fact span { color: var(--muted); font-size: .85rem; display: block; }
.fact b { font-size: 1.05rem; }
@media (max-width: 720px) { .facts { grid-template-columns: 1fr; } }
.p-body { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; padding: 48px 0 24px; }
.p-body .lead { font-size: 1.08rem; }
.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.list li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 12px 40px; position: relative; }
.list li::before { content: "✓"; position: absolute; left: 14px; color: var(--brand); font-weight: 800; }
.side-box { background: var(--surface); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); align-self: start; }
@media (max-width: 820px) { .p-body { grid-template-columns: 1fr; } }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 14px; cursor: zoom-in; }
.placeholder {
  border: 2px dashed var(--line); border-radius: var(--radius); padding: 32px; text-align: center; color: var(--muted);
}
.video { aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; }
.video iframe { width: 100%; height: 100%; border: 0; }
.pager { display: flex; justify-content: space-between; gap: 12px; padding: 24px 0 72px; flex-wrap: wrap; }
.pager a { text-decoration: none; font-weight: 700; background: var(--surface); padding: 14px 18px; border-radius: 12px; border: 1px solid var(--line); }

/* Lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.88); display: none; place-items: center; z-index: 50; padding: 16px; cursor: zoom-out; }
.lightbox.open { display: grid; }
.lightbox img { max-height: 90vh; border-radius: 12px; }

/* Новини і сторінки */
.row-between { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.article { max-width: 820px; padding-top: 40px; padding-bottom: 72px; }
.article h1 { font-size: clamp(1.8rem, 4.5vw, 2.8rem); font-weight: 800; text-wrap: balance; }
.article .cover { width: 100%; border-radius: var(--radius); margin: 16px 0 24px; aspect-ratio: 16 / 9; object-fit: cover; }
.article .back2 { text-decoration: none; font-weight: 700; display: inline-block; margin-bottom: 16px; }
.rich { font-size: 1.06rem; }
.rich h2 { margin-top: 32px; }
.rich .list { margin: 12px 0; }
.rich .video { margin: 20px 0; }
.muted { color: var(--muted); }
