:root {
  --blue: #1f7ae0;
  --blue-dark: #1560b4;
  --blue-soft: #e8f2fd;
  --yellow: #ffd54a;
  --yellow-dark: #f2b705;
  --ink: #17253a;
  --muted: #5c6b80;
  --line: #e2e8f1;
  --bg: #ffffff;
  --bg-alt: #f5f9ff;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(31, 122, 224, 0.10);
  --shadow-sm: 0 4px 14px rgba(23, 37, 58, 0.08);
  --font: system-ui, 'Segoe UI', Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }

.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
}
.container.narrow { max-width: 620px; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  color: var(--ink);
  font-weight: 600;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: #fff;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}
.brand-name b { color: var(--blue); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}
.site-nav a {
  color: var(--ink);
  font-weight: 500;
  font-size: .97rem;
}
.site-nav a:hover { color: var(--blue); }
.nav-cta {
  background: var(--yellow);
  color: var(--ink) !important;
  padding: 8px 16px;
  border-radius: 10px;
  font-weight: 600;
}
.nav-cta:hover { background: var(--yellow-dark); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.nav-toggle span {
  width: 20px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .12s ease, background .2s ease, box-shadow .2s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--blue-dark); color: #fff; }
.btn-ghost {
  background: transparent;
  color: var(--blue);
  border-color: var(--blue);
}
.btn-ghost:hover { background: var(--blue-soft); }
.btn-small { padding: 8px 16px; font-size: .9rem; border-radius: 10px; background: var(--blue-soft); color: var(--blue); }
.btn-small:hover { background: var(--blue); color: #fff; }
.btn-block { width: 100%; }

/* Hero */
.hero {
  background: radial-gradient(1200px 400px at 80% -10%, var(--blue-soft), transparent),
              linear-gradient(180deg, #fbfdff, #ffffff);
  padding: 56px 0 64px;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 40px;
  align-items: center;
}
.hero-badge {
  display: inline-block;
  background: var(--yellow);
  color: var(--ink);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: 18px;
}
.hero h1 { font-size: clamp(1.9rem, 4vw, 2.9rem); }
.hero-text p { color: var(--muted); font-size: 1.1rem; max-width: 48ch; }
.hero-actions { display: flex; gap: 14px; margin: 26px 0 30px; flex-wrap: wrap; }
.hero-stats {
  display: flex;
  gap: 30px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.hero-stats li { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 1.6rem; color: var(--blue); }
.hero-stats span { color: var(--muted); font-size: .9rem; }

.hero-art { position: relative; min-height: 320px; }
.hero-blob {
  position: absolute;
  inset: 10% 5%;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  border-radius: 40% 60% 55% 45% / 55% 45% 55% 45%;
  opacity: .12;
}
.hero-card {
  position: absolute;
  background: #fff;
  padding: 14px 18px;
  border-radius: 14px;
  box-shadow: var(--shadow);
  font-weight: 600;
  border: 1px solid var(--line);
}
.card-a { top: 8%; left: 10%; }
.card-b { top: 42%; right: 4%; }
.card-c { bottom: 8%; left: 22%; }

/* Sections */
.section { padding: 64px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 40px; }
.section-head h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
.section-head p { color: var(--muted); margin: 0; }

/* Courses */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 24px;
}
.course-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .2s ease;
}
.course-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.course-top {
  height: 96px;
  display: grid;
  place-items: center;
  font-size: 2.4rem;
  background: linear-gradient(135deg, var(--blue-soft), #fff);
}
.course-top[data-cat="dev"] { background: linear-gradient(135deg, #e8f2fd, #d5e8fb); }
.course-top[data-cat="math"] { background: linear-gradient(135deg, #fff6d6, #ffeeb0); }
.course-top[data-cat="eng"] { background: linear-gradient(135deg, #e3f7ee, #cfeede); }
.course-top[data-cat="design"] { background: linear-gradient(135deg, #f3e8fd, #e7d5fb); }
.course-body { padding: 18px 18px 20px; display: flex; flex-direction: column; flex: 1; }
.course-tag {
  align-self: flex-start;
  font-size: .75rem;
  font-weight: 600;
  color: var(--blue);
  background: var(--blue-soft);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.course-body h3 { font-size: 1.1rem; }
.course-body p { color: var(--muted); font-size: .95rem; flex: 1; }
.course-meta {
  list-style: none;
  display: flex;
  gap: 14px;
  padding: 0;
  margin: 10px 0 16px;
  font-size: .85rem;
  color: var(--muted);
}
.course-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.price { font-weight: 700; color: var(--ink); }

/* Teachers */
.teacher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
}
.teacher-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1.2rem;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
}
.teacher-card h3 { font-size: 1.05rem; margin-bottom: 2px; }
.teacher-role { color: var(--blue); font-weight: 600; font-size: .9rem; margin: 0 0 8px; }
.teacher-bio { color: var(--muted); font-size: .9rem; margin: 0; }

/* Benefits */
.benefit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 24px;
}
.benefit {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 22px;
  box-shadow: var(--shadow-sm);
}
.benefit-ico {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--yellow);
  font-size: 1.6rem;
  margin-bottom: 14px;
}
.benefit h3 { font-size: 1.08rem; }
.benefit p { color: var(--muted); margin: 0; font-size: .95rem; }

/* Reviews */
.review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}
.review {
  margin: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--yellow);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.review p { margin: 0 0 14px; font-size: 1rem; }
.review footer { color: var(--muted); font-weight: 600; font-size: .9rem; }

/* Panels & forms */
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 34px 30px;
  box-shadow: var(--shadow);
}
.panel h2 { font-size: 1.5rem; margin-bottom: 4px; }
.panel-sub { color: var(--muted); margin: 0 0 22px; }
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .9rem; }
.field input,
.field select,
.field textarea {
  font-family: inherit;
  font-size: 1rem;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(31, 122, 224, 0.15);
  background: #fff;
}
.field.invalid input,
.field.invalid select,
.field.invalid textarea { border-color: #e0483d; box-shadow: 0 0 0 3px rgba(224, 72, 61, .12); }
.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .88rem;
  font-weight: 500;
}
.checkbox { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 500; }
.link-muted { color: var(--muted); }
.form-note { margin: 4px 0 0; font-size: .92rem; font-weight: 600; min-height: 1.2em; }
.form-note.error { color: #d63a2f; }
.form-note.ok { color: #1e9e5a; }

/* Contacts */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 24px;
}
.contact-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 20px;
  box-shadow: var(--shadow-sm);
}
.contact-ico {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--blue-soft);
  font-size: 1.4rem;
  margin-bottom: 12px;
}
.contact-item h3 { font-size: 1.05rem; margin-bottom: 6px; }
.contact-item p { color: var(--muted); margin: 0; }

/* Footer */
.site-footer {
  background: var(--ink);
  color: #c3cfe0;
  padding: 44px 0 24px;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.footer-brand .brand-name { color: #fff; font-size: 1.3rem; font-weight: 600; }
.footer-brand .brand-name b { color: var(--yellow); }
.footer-brand p { margin: 8px 0 0; color: #9fb0c6; max-width: 30ch; }
.footer-links { display: flex; flex-wrap: wrap; gap: 20px; }
.footer-links a { color: #c3cfe0; font-size: .95rem; }
.footer-links a:hover { color: #fff; }
.footer-legal { padding-top: 18px; }
.footer-legal p { margin: 0; color: #8194ad; font-size: .85rem; }

/* Toast */
.toast-wrap {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 100;
}
.toast {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 12px;
  padding: 14px 18px;
  box-shadow: var(--shadow);
  font-weight: 600;
  max-width: 320px;
  animation: toast-in .25s ease;
}
.toast.ok { border-left-color: #1e9e5a; }
.toast.err { border-left-color: #d63a2f; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 404 */
.err-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  text-align: center;
  background: linear-gradient(180deg, var(--blue-soft), #fff);
  padding: 40px 20px;
}
.err-code {
  font-size: clamp(4rem, 16vw, 9rem);
  font-weight: 800;
  line-height: 1;
  color: var(--blue);
  margin: 0;
}
.err-page h1 { font-size: 1.6rem; margin: 10px 0; }
.err-page p { color: var(--muted); max-width: 46ch; margin: 0 auto 24px; }

/* Responsive */
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-art { display: none; }
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 8px 20px 16px;
    box-shadow: var(--shadow);
    display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px 4px; border-bottom: 1px solid var(--line); }
  .nav-cta { text-align: center; margin-top: 10px; border-bottom: none !important; }
}

@media (max-width: 520px) {
  .hero-stats { gap: 18px; }
  .panel { padding: 26px 20px; }
  .form-row { flex-direction: column; align-items: flex-start; gap: 8px; }
}
