/* Математика без кордонів — базове адаптивне оформлення */
:root {
  --navy: #0F1C3C;
  --ink: #102D50;
  --muted: #435D78;
  --blue: #1C5D94;
  --yellow: #F8EF72;
  --orange: #FF9F1C;
  --turquoise: #008B91;
  --soft: #DFF1FB;
  --line: #D8E4ED;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-width: 0; background: #F6F9FC; color: var(--ink); font-family: 'Segoe UI', system-ui, Arial, sans-serif; font-size: 16px; line-height: 1.65; }
img, svg, iframe { max-width: 100%; }
a { color: var(--blue); }
a:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }
.wrap { width: min(100% - 44px, 1300px); margin-inline: auto; }

/* Спільна шапка */
.site-header { background: var(--navy); color: #fff; border-bottom: 1px solid var(--navy); }
.site-header .header-top { display: flex; align-items: center; justify-content: space-between; gap: clamp(12px, 3vw, 36px); padding-top: 23px; }
.site-header .brand { flex: 1 1 auto; min-width: 0; }
.site-header .brand strong { display: block; color: #fff; font-size: clamp(22px, 2.8vw, 39px); line-height: 1.35; font-weight: 800; letter-spacing: -.025em; }
.site-header .brand .brand-nowrap { display: block; font-size: clamp(17px, 2.05vw, 29px); line-height: 1.35; font-weight: 800; white-space: nowrap; }
.site-header .brand span.brand-subtitle { display:block; color:#D9E1F2; font-size:14px; }
.site-header .header-logo { flex: 0 1 390px; width: clamp(200px, 30vw, 390px); min-width: 0; display: flex; justify-content: flex-end; align-items: center; }
.site-header .header-logo img { display: block; width: 100%; max-height: 190px; height: auto; object-fit: contain; }
.site-header .nav { display: flex; flex-wrap: wrap; gap: 9px; padding: 17px 0 21px; }
.site-header .nav a { display: inline-flex; align-items:center; justify-content:center; min-height: 46px; padding: 9px 18px; color: #101D3D; background: var(--yellow); border: 2px solid var(--yellow); border-radius: 10px; text-decoration: none; font-weight: 750; line-height: 1.25; transition: background-color .18s, border-color .18s; }
.site-header .nav a:hover, .site-header .nav a:focus-visible { background: #FFF7AB; border-color: var(--orange); }
.site-header .nav a[aria-current="page"] { border-color: var(--orange); font-weight: 800; }

/* Загальні панелі */
h1, h2, h3, p { overflow-wrap: break-word; }
h1 { font-size: clamp(27px, 3vw, 42px); line-height:1.2; margin: 0 0 14px; }
h2 { font-size: clamp(21px, 2.2vw, 28px); line-height:1.3; margin: 0 0 20px; }
p { margin: 0 0 16px; }
.hero { padding: 39px 0 32px; }
.hero .lead { color: var(--muted); font-size: clamp(16px, 1.6vw, 20px); }
.eyebrow { display: block; font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .09em; color: var(--turquoise); }
.panel { padding: clamp(22px, 3.5vw, 38px); margin: 22px 0 45px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 8px 25px rgba(16,29,61,.04); min-width:0; }
.btn { display: inline-flex; padding: 12px 20px; align-items:center; gap:8px; border-radius: 10px; background:var(--blue); color:#fff; text-decoration:none; font-weight:750; }
.btn:hover { background: #164A75; }
.notice { padding: 18px 20px; background: #EAF3F9; border-left: 4px solid var(--turquoise); border-radius: 10px; }
.footer { padding: 18px 0 30px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }

/* Головна сторінка */
.hero.hero-split { display:flex; align-items: center; justify-content: space-between; gap: clamp(24px, 3vw, 42px); padding: clamp(24px, 3vw, 42px); margin: 30px 0 34px; background:var(--soft); border-radius: 20px; }
.hero-text { flex: 1 1 55%; min-width:0; }
.school-goal { min-width:0; }
.goal-heading { color:var(--ink); font-size:clamp(25px, 2.75vw, 39px); font-weight:800; letter-spacing:.01em; line-height:1.23; margin:0 0 20px; }
.goal-description { color:var(--muted); font-size:clamp(16px, 1.35vw, 19px); line-height:1.75; margin:0; }
.school-info-card { flex: 1 1 43%; min-width:0; padding:24px; display:grid; gap:18px; background:linear-gradient(135deg,#fff,#F2F8FF); border:2px solid var(--navy); border-radius:18px; box-shadow:0 8px 22px rgba(16,29,61,.12); }
.school-info-item { display:flex; align-items:center; gap:15px; min-width:0; }
.school-info-item > div:last-child { flex:1; min-width:0; }
.school-info-icon { flex:0 0 54px; width:54px; height:54px; border-radius:12px; background:#DFF1FB; display:flex; align-items:center; justify-content:center; font-size:24px; color:var(--navy); }
.school-info-item h3 { color:var(--navy); font-size:clamp(16px,1.45vw,20px); line-height:1.28; font-weight:800; margin:0 0 3px; }
.school-info-item p { font-size:clamp(15px,1.2vw,18px); line-height:1.45; color:var(--muted); margin:0; }
.benefits-heading { color:var(--ink); font-size:clamp(22px,2.5vw,30px); font-weight:800; }
.benefits-box { background:#EAF3F9; padding:24px 28px; border-left:4px solid var(--turquoise); border-radius:12px; }
.benefits-box ul.benefits-list { list-style:none; padding:0; margin:0; display:grid; gap:15px; }
.benefits-box ul.benefits-list li { position:relative; padding-left:30px; list-style:none; color:var(--muted); line-height:1.65; }
.benefits-box ul.benefits-list li::before { content:'✓'; position:absolute; left:0; top:0; color:var(--turquoise); font-size:20px; font-weight:800; }
.benefits-box strong { color:var(--ink); }

/* Лектори */
.people { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:22px; }
.person { background:#fff; border:1px solid var(--line); border-radius:14px; overflow:hidden; min-width:0; }
.portrait { width:100%; height:340px; background:#EEF3F8; overflow:hidden; }
.portrait img { display:block; width:100%; height:100%; object-fit:contain; object-position:center; }
.person-details { padding:20px; }
.person-details h2 { font-size:clamp(18px,1.6vw,23px); margin:0 0 10px; }
.person-details p { color:var(--muted); margin:0; line-height:1.6; }
.school-inspirer { color:#D62828; font-size:.85em; }

/* Реєстрація */
.form-frame { width:100%; display:block; height:1100px; border:0; border-radius:12px; background:#F0EFFF; }
.registration-form-panel { overflow:hidden; }

/* Контакти/програма — базові безпечні обмеження */
.contacts-panel, .program-panel { min-width:0; }
.contacts-logo, .program-logo { max-width:100%; min-width:0; }
.contacts-logo img, .program-logo img { display:block; width:100%; max-width:100%; height:auto; object-fit:contain; }

/* Планшет і вузький ноутбук */
@media (max-width: 1050px) {
  .site-header .brand .brand-nowrap { white-space:normal; }
  .site-header .header-logo { flex-basis: 275px; }
  .hero.hero-split { gap:22px; }
}

/* Телефони */
@media (max-width: 750px) {
  .wrap { width:calc(100% - 30px); }
  .site-header .header-top { padding-top:17px; gap:10px; align-items:center; }
  .site-header .brand strong { font-size:clamp(17px,4.2vw,23px); line-height:1.28; }
  .site-header .brand .brand-nowrap { font-size:clamp(15px,3.5vw,20px); white-space:normal; }
  .site-header .header-logo { flex:0 0 92px; width:92px; }
  .site-header .header-logo img { max-height:85px; }
  .site-header .nav { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; padding-top:17px; }
  .site-header .nav a { min-height:42px; padding:9px 6px; font-size:14px; }
  .hero { padding:27px 0 18px; }
  .hero.hero-split { display:flex; flex-direction:column; align-items:stretch; gap:22px; margin:18px 0 28px; padding:22px 17px; }
  .hero-text, .school-info-card { width:100%; flex:none; }
  .goal-heading { font-size:clamp(22px,5.6vw,29px); margin-bottom:14px; }
  .goal-description { font-size:16px; line-height:1.65; }
  .school-info-card { padding:17px 15px; gap:17px; border-radius:15px; }
  .school-info-item { gap:12px; align-items:center; }
  .school-info-icon { flex-basis:46px; width:46px; height:46px; font-size:21px; }
  .school-info-item h3 { font-size:16px; }
  .school-info-item p { font-size:15px; }
  .panel { padding:21px 17px; margin-bottom:29px; }
  .benefits-box { padding:18px 14px; }
  .benefits-box ul.benefits-list { gap:13px; }
  .benefits-box ul.benefits-list li { padding-left:25px; font-size:15px; }
  .people { grid-template-columns:minmax(0,1fr); gap:17px; }
  .portrait { height:300px; }
  .contacts-panel, .program-panel { grid-template-columns:minmax(0,1fr) !important; gap:24px; }
  .form-frame { height:1250px; }
}
@media (max-width: 360px) {
  .wrap { width:calc(100% - 24px); }
  .site-header .header-logo { flex-basis:72px; width:72px; }
  .site-header .brand strong { font-size:16px; }
  .site-header .brand .brand-nowrap { font-size:14px; }
  .site-header .nav a { font-size:13px; }
  .school-info-icon { flex-basis:40px; width:40px; height:40px; }
}
