/* ==========================================================================
   Космонавтите — терапевтичен център
   Токени взети от истинския бранд: тъмно навy + топло оранжево
   ========================================================================== */

:root {
  --color-space: #12294f;
  --color-space-deep: #0c1c3a;
  --color-space-glow: #1c3a6b;
  --color-orange: #d99a3f;
  --color-orange-dark: #c2822b;
  --color-orange-2: #e0a94f;
  --color-sky: #3f7fd9;
  --color-sky-2: #6aa0e0;
  --color-cream: #f4f7fc;
  --color-ink: #12294f;
  --color-ink-soft: #5b6b85;

  --font-display: "Baloo 2", "Nunito", sans-serif;
  --font-body: "Nunito", "Segoe UI", sans-serif;

  --radius-md: 16px;
  --radius-lg: 28px;
  --shadow-soft: 0 20px 40px -20px rgba(18, 41, 79, 0.35);
  --container-w: 1180px;
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

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

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 800; line-height: 1.15; margin: 0 0 0.5em; color: var(--color-space); }
p { margin: 0 0 1em; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
ul { list-style: none; margin: 0; padding: 0; }

.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--color-orange); color: #fff;
  padding: 10px 16px; border-radius: 0 0 8px 0; z-index: 999;
}
.skip-link:focus { left: 0; }
:focus-visible { outline: 3px solid var(--color-orange); outline-offset: 2px; }

.container { width: 100%; max-width: var(--container-w); margin: 0 auto; padding: 0 24px; }
.two-col { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: start; }

/* ---------- Starfield / space texture ---------- */
.hero-stars {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 20% 30%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1.5px 1.5px at 70% 20%, rgba(255,255,255,0.7), transparent),
    radial-gradient(2px 2px at 40% 70%, rgba(255,255,255,0.85), transparent),
    radial-gradient(1px 1px at 85% 55%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1.5px 1.5px at 55% 40%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 15% 80%, rgba(255,255,255,0.6), transparent),
    radial-gradient(2px 2px at 90% 85%, rgba(255,255,255,0.75), transparent),
    radial-gradient(1px 1px at 30% 15%, rgba(255,255,255,0.6), transparent);
  animation: twinkle 4s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: 0.4; } to { opacity: 0.85; } }

/* ---------- Buttons ---------- */
.btn {
  white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-display); font-weight: 700; font-size: 1rem;
  padding: 14px 28px; border-radius: 999px; border: 2px solid transparent;
  cursor: pointer; transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, filter 0.18s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--color-orange); color: #fff; box-shadow: 0 12px 26px -10px rgba(217, 154, 63, 0.6); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-outline { background: transparent; border-color: var(--color-space); color: var(--color-space); }
.btn-outline:hover { background: var(--color-space); color: #fff; }
.btn-ghost-light { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.35); color: #fff; }
.btn-ghost-light:hover { background: rgba(255,255,255,0.2); }
.btn-small { padding: 10px 20px; font-size: 0.9rem; }
.btn-full { width: 100%; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,0.93); backdrop-filter: blur(8px); border-bottom: 1px solid rgba(18,41,79,0.08); }
.header-inner { display: flex; align-items: center; gap: 24px; padding-block: 10px; }
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.brand-logo { width: 78px; height: 78px; object-fit: contain; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; color: var(--color-orange); }
.brand-sub { font-size: 0.68rem; color: var(--color-ink-soft); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }

.main-nav { display: flex; gap: 6px; }
.main-nav a { font-weight: 700; font-size: 0.95rem; color: rgba(18,41,79,0.8); padding: 8px 14px; border-radius: 999px; white-space: nowrap; }
.main-nav a:hover { color: var(--color-space); background: rgba(18,41,79,0.05); }

.header-actions { display: flex; align-items: center; gap: 14px; }
.header-phone { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 0.9rem; color: var(--color-space); white-space: nowrap; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 6px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--color-space); border-radius: 2px; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; color: #fff; padding-block: 96px 72px;
  background: radial-gradient(circle at 30% 20%, var(--color-space-glow) 0%, var(--color-space) 55%, var(--color-space-deep) 100%);
}
.hero-inner { position: relative; display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-display); font-weight: 700; font-size: 0.85rem;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15); padding: 6px 16px; border-radius: 999px;
  color: rgba(255,255,255,0.9); margin-bottom: 18px;
}
.eyebrow-dark { background: rgba(18,41,79,0.06); border: none; color: var(--color-space); }
.hero h1 { font-size: clamp(2rem, 4.2vw, 3.2rem); color: #fff; max-width: 15ch; }
.hl-orange { color: var(--color-orange); }
.hero-lead { font-size: 1.1rem; color: rgba(255,255,255,0.78); max-width: 46ch; font-weight: 600; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin: 26px 0 34px; }
.hero-contact-card { display: inline-flex; flex-direction: column; gap: 8px; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15); padding: 16px 22px; border-radius: 22px; }
.hero-contact-phone { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.hero-contact-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--color-orange); font-size: 0.9rem; }
.hero-contact-email { padding-left: 44px; font-weight: 700; color: rgba(255,255,255,0.75); font-size: 0.92rem; }
.hero-art { justify-self: center; position: relative; }
.hero-photo { width: 100%; max-width: 380px; aspect-ratio: 1/1; object-fit: cover; border-radius: 50%; border: 8px solid rgba(255,255,255,0.9); box-shadow: 0 30px 60px -20px rgba(0,0,0,0.5); }

/* ---------- Hero entrance animation (плавно появяване при зареждане) ---------- */
.hero-anim-fade { animation: heroFadeUp 0.6s ease both; }
.hero-anim-scale { animation: heroScaleIn 0.7s ease 0.15s both; }
@keyframes heroFadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes heroScaleIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }

/* ---------- Space decor (летящи ракети, НЛО, комети в hero-а) ---------- */
.space-decor { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.hide-mobile { display: block; }
@media (max-width: 767px) {
  .hide-mobile { display: none; }
}

.fly-rocket { position: absolute; width: 2.5rem; height: 2.5rem; color: var(--color-orange); opacity: 0; animation: flyRocket 7s ease-in-out infinite; }
.fly-rocket svg { width: 100%; height: 100%; transform: rotate(-45deg); }
.fly-rocket-1 { top: 32%; left: 8%;  width: 2.5rem; height: 2.5rem; animation-delay: 0s; }
.fly-rocket-2 { bottom: 18%; right: 9%; width: 3rem;   height: 3rem;   color: #fff; animation-delay: 2.5s; }
.fly-rocket-3 { top: 14%; left: 34%; width: 2rem;   height: 2rem;   color: #fff; animation-delay: 1.2s; }
.fly-rocket-4 { top: 48%; right: 27%; width: 2.25rem; height: 2.25rem; animation-delay: 3.4s; }
.fly-rocket-5 { bottom: 30%; left: 44%; width: 1.75rem; height: 1.75rem; color: #fff; animation-delay: 4.6s; }
.fly-rocket-6 { top: 26%; right: 7%;  width: 2.5rem; height: 2.5rem; animation-delay: 2s; }
.fly-rocket-7 { top: 63%; left: 58%; width: 2.25rem; height: 2.25rem; animation-delay: 0.8s; }
@keyframes flyRocket {
  0%   { transform: translate(-40px, 40px);  opacity: 0; }
  15%  { opacity: 1; }
  50%  { transform: translate(20px, -10px); }
  85%  { opacity: 1; }
  100% { transform: translate(60px, -50px); opacity: 0; }
}

.ufo { position: absolute; width: 4rem; height: 2.5rem; opacity: 0; animation: ufoDrift 9s ease-in-out infinite; }
.ufo svg { width: 100%; height: 100%; }
.ufo-1 { top: 20%; left: 54%; animation-delay: 1s; }
.ufo-2 { bottom: 22%; right: 39%; width: 3.5rem; height: 2.2rem; animation-delay: 4s; }
@keyframes ufoDrift {
  0%   { transform: translate(60px, 0);     opacity: 0; }
  15%  { opacity: 1; }
  50%  { transform: translate(-20px, -12px); }
  85%  { opacity: 1; }
  100% { transform: translate(-80px, 6px);  opacity: 0; }
}

.comet { position: absolute; width: 10px; height: 10px; opacity: 0; animation: cometShoot 4.5s ease-in 3s infinite; }
.comet::before { content: ""; position: absolute; width: 10px; height: 10px; border-radius: 50%; background: #fff; box-shadow: 0 0 12px 4px rgba(255,255,255,0.7); }
.comet::after { content: ""; position: absolute; top: 50%; left: 50%; width: 96px; height: 2px; background: linear-gradient(to right, rgba(255,255,255,0.8), transparent); transform: translateY(-50%) rotate(135deg); transform-origin: left; }
.comet-1 { top: 8%; right: 15%; }
.comet-2 { top: 32%; left: 28%; animation-delay: 5.8s; }
@keyframes cometShoot {
  0%   { transform: translate(80px, -60px); opacity: 0; }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { transform: translate(-140px, 100px); opacity: 0; }
}

/* ---------- Features ---------- */
.features { background: var(--color-space); padding-block: 72px; position: relative; }
.features-title { text-align: center; color: #fff; text-transform: uppercase; letter-spacing: 0.03em; font-size: clamp(1.4rem, 3vw, 2rem); }
.features-note { max-width: 800px; margin: 36px auto 0; text-align: center; color: rgba(255,255,255,0.75); font-size: 0.98rem; }
.features-grid { margin-top: 48px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.feature-card { background: #fff; border-radius: var(--radius-lg); padding: 30px 24px; text-align: center; box-shadow: 0 20px 40px -18px rgba(0,0,0,0.35); }
.feature-icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 18px; margin: 0 auto; font-size: 1.7rem; }
.feature-icon-sky { background: rgba(63, 127, 217, 0.14); }
.feature-icon-orange { background: rgba(217, 154, 63, 0.16); }
.feature-icon-sky-2 { background: rgba(106, 160, 224, 0.16); }
.feature-icon-orange-2 { background: rgba(224, 169, 79, 0.16); }
.feature-card h3 { margin-top: 18px; font-size: 1.1rem; }
.feature-card p { color: var(--color-ink-soft); font-size: 0.92rem; margin: 0; }

/* ---------- Sections (generic) ---------- */
.section { padding-block: 88px; }
.section-white { background: #fff; }
.section-dark { position: relative; overflow: hidden; color: #fff; background: radial-gradient(circle at 70% 20%, var(--color-space-glow) 0%, var(--color-space) 60%, var(--color-space-deep) 100%); }
.section-title { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.section-title-light { color: #fff; }
.section-lead { max-width: 60ch; color: var(--color-ink-soft); font-size: 1.05rem; font-weight: 600; }
.section-lead-light { color: rgba(255,255,255,0.75); }
.section-head-center { text-align: center; max-width: 640px; margin: 0 auto; }

/* ---------- About ---------- */
.about-grid { align-items: center; }
.about-photo-wrap { position: relative; }
.about-photo { width: 100%; border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); border: 4px solid #fff; object-fit: cover; aspect-ratio: 4/3.2; }
.about-badge { position: absolute; bottom: -18px; right: -12px; background: var(--color-orange); color: #fff; border-radius: 22px; padding: 14px 22px; text-align: center; box-shadow: 0 16px 30px -12px rgba(217,154,63,0.6); }
.about-badge strong { display: block; font-family: var(--font-display); font-size: 1.8rem; }
.about-badge span { font-size: 0.7rem; font-weight: 700; opacity: 0.9; }
.checklist { margin: 26px 0 0; display: flex; flex-direction: column; gap: 12px; }
.checklist li { position: relative; padding-left: 32px; font-weight: 700; color: var(--color-space); }
.checklist li::before {
  content: "✓"; position: absolute; left: 0; top: -1px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--color-orange); color: #fff; font-size: 0.75rem; display: grid; place-items: center;
}

/* ---------- Services ---------- */
.services-grid { margin-top: 48px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.service-card { border: 2px solid rgba(18,41,79,0.08); border-radius: var(--radius-lg); padding: 30px 26px; transition: transform 0.2s ease, border-color 0.2s ease; }
.service-card:hover { transform: translateY(-6px); border-color: var(--color-orange); }
.service-number { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--color-space); color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; }
.service-card h3 { margin-top: 18px; font-size: 1.1rem; }
.service-card p { color: var(--color-ink-soft); font-size: 0.94rem; margin: 0; }

/* ---------- Gallery ---------- */
.gallery-grid { margin-top: 48px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; position: relative; }
.gallery-tile { position: relative; margin: 0; border-radius: var(--radius-md); overflow: hidden; border: 2px solid rgba(255,255,255,0.1); aspect-ratio: 3/4; }
.gallery-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.gallery-tile:hover img { transform: scale(1.08); }
.gallery-tile figcaption {
  position: absolute; inset-inline: 0; bottom: 0; padding: 12px 16px; font-weight: 700; font-size: 0.9rem;
  background: linear-gradient(to top, rgba(12,28,58,0.92), transparent); color: #fff;
}
.video-block { margin-top: 56px; position: relative; }
.video-block h3 { text-align: center; color: #fff; font-size: 1.4rem; }
.video-grid { margin-top: 30px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.video-card { background: rgba(0,0,0,0.25); border: 2px solid rgba(255,255,255,0.1); border-radius: var(--radius-md); overflow: hidden; }
.video-frame { aspect-ratio: 16/9; }
.video-frame iframe { width: 100%; height: 100%; border: 0; }
.video-card p { padding: 16px 18px; margin: 0; font-weight: 700; color: #fff; }

/* ---------- Parents ---------- */
.parents-panel { position: relative; overflow: hidden; border-radius: var(--radius-lg); background: radial-gradient(circle at 80% 20%, var(--color-space-glow) 0%, var(--color-space) 60%); }
.parents-panel-inner { position: relative; padding: 56px 40px; }
.resources-grid { margin-top: 34px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.resource-card { background: rgba(255,255,255,0.1); border-radius: var(--radius-md); padding: 22px; transition: background 0.2s ease; }
.resource-card:hover { background: rgba(255,255,255,0.16); }
.resource-title { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: #fff; margin: 0 0 8px; }
.resource-desc { font-size: 0.88rem; color: rgba(255,255,255,0.7); margin: 0; }

/* ---------- Blog ---------- */
.blog-grid { margin-top: 44px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.blog-card { display: block; border-radius: var(--radius-lg); overflow: hidden; background: var(--color-cream); box-shadow: var(--shadow-soft); transition: transform 0.2s ease; }
.blog-card:hover { transform: translateY(-6px); }
.blog-card-thumb {
  height: 150px; display: grid; place-items: center; font-size: 2.2rem;
  background: radial-gradient(circle at 40% 30%, var(--color-space-glow), var(--color-space));
}
.blog-card-body { padding: 24px; }
.blog-tag { color: var(--color-orange-dark); font-weight: 800; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; }
.blog-card h3 { font-size: 1.08rem; margin: 10px 0 8px; }
.blog-card p { color: var(--color-ink-soft); font-size: 0.92rem; }
.blog-meta { font-size: 0.78rem; color: rgba(18,41,79,0.5); font-weight: 700; margin: 0; }

/* ---------- Contact ---------- */
.contact-info { display: flex; flex-direction: column; gap: 16px; margin: 26px 0 28px; font-size: 1rem; font-weight: 700; }
.contact-info li { display: flex; align-items: center; gap: 14px; }
.hours-lines { display: flex; flex-direction: column; gap: 2px; font-size: 0.92rem; }
.contact-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--color-space); color: #fff; font-size: 1rem; flex-shrink: 0; }
.map-frame { border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-soft); }
.map-frame iframe { width: 100%; height: 240px; border: 0; display: block; }

.contact-form { background: #fff; border-radius: var(--radius-lg); padding: 34px; box-shadow: var(--shadow-soft); border: 1px solid rgba(18,41,79,0.06); }
.form-row { margin-bottom: 18px; display: flex; flex-direction: column; gap: 6px; }
.form-row label { font-weight: 800; font-size: 0.9rem; color: var(--color-space); }
.form-row input, .form-row textarea {
  font-family: var(--font-body); font-size: 1rem; padding: 12px 16px; border-radius: 12px;
  border: 2px solid rgba(18,41,79,0.1); background: var(--color-cream); font-weight: 600;
}
.form-row input:focus, .form-row textarea:focus { outline: none; border-color: var(--color-orange); }
.form-note { font-size: 0.78rem; color: var(--color-ink-soft); margin-top: 12px; }
.form-alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; font-weight: 700; font-size: 0.92rem; }
.form-alert-success { background: rgba(63, 190, 130, 0.15); color: #1c8a52; }
.form-alert-error { background: rgba(217, 90, 63, 0.15); color: #b4402a; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Footer ---------- */
.site-footer { background: var(--color-space-deep); color: rgba(255,255,255,0.75); padding-top: 64px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; padding-bottom: 40px; }
.footer-brand-head { display: flex; align-items: center; gap: 10px; }
.footer-logo { width: 44px; height: 44px; object-fit: contain; }
.footer-brand .brand-name { color: var(--color-orange); font-size: 1.2rem; }
.footer-brand p { font-size: 0.9rem; margin-top: 12px; }
.footer-col h3 { color: #fff; font-size: 0.95rem; margin-bottom: 14px; }
.footer-col ul { display: flex; flex-direction: column; gap: 10px; font-size: 0.9rem; }
.footer-col a:hover { color: var(--color-orange); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding: 20px 0; font-size: 0.8rem; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .two-col { grid-template-columns: 1fr; }
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-actions, .hero-contact-card { margin-inline: auto; }
  .hero-art { order: -1; }
  .hero-photo { max-width: 260px; }
  .about-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .services-grid, .gallery-grid, .blog-grid, .resources-grid { grid-template-columns: repeat(2, 1fr); }
  .video-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .main-nav {
    position: absolute; top: 100%; left: 0; right: 0; background: #fff;
    flex-direction: column; padding: 16px 24px; gap: 4px; border-bottom: 1px solid rgba(18,41,79,0.08);
    display: none;
  }
  .main-nav.is-open { display: flex; }
  .nav-toggle { display: flex; }
  .header-phone { display: none; }
  .header-cta { display: none; }
  .features-grid, .services-grid, .gallery-grid, .blog-grid, .resources-grid, .footer-grid { grid-template-columns: 1fr; }

  .hero-inner { display: flex; flex-direction: column; align-items: center; text-align: center; }
  .hero-copy { display: flex; flex-direction: column; align-items: center; }
  .hero-actions { justify-content: center; }
}
