/* CSS Variables and base resets */
:root {
  --bg: #0b1f33;
  --primary: #2d9cdb;
  --primary-600: #1d7fb7;
  --accent: #ff8647;
  --surface: #ffffff;
  --muted: #eef3f7;
  --text: #0f172a;
  --text-muted: #475569;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 6px 18px rgba(0,0,0,.12);
  --shadow-lg: 0 16px 40px rgba(0,0,0,.18);
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.6;
  color: var(--text);
  background: radial-gradient(1200px 800px at 10% -10%, #2563eb33, transparent 60%),
              radial-gradient(1200px 800px at 110% 10%, #10b98133, transparent 60%),
              var(--bg);
  background-repeat: no-repeat, no-repeat, no-repeat;
}

h1, h2, h3 {
  margin: 0 0 .6rem 0;
  line-height: 1.2;
}

h2 { font-weight: 700; letter-spacing: .2px; }
b { font-weight: 700; }

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

/* Layout */
.central {
  width: min(1200px, 96%);
  margin: 20px auto;
  background: transparent;
}

.site-header {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.header_img {
  width: 100%;
  display: block;
  max-height: 320px;
  object-fit: cover;
  filter: saturate(1.05) contrast(1.02);
  transform: scale(1.001);
}

.nav-toggle {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: none;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}
.nav-toggle .bar {
  display: block;
  width: 22px;
  height: 2px;
  background: #0b1220;
  margin: 3px 0;
  transition: transform .3s ease, opacity .3s ease;
}
.nav-toggle[aria-expanded="true"] .bar:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .bar:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

/* Main navigation */
.main-nav {
  margin-top: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,255,255,0.95));
  backdrop-filter: blur(8px);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1000;
}

.mobile-menu-toggle {
  display: none;
}

.nav-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: block;
  padding: 18px 24px;
  color: var(--text);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.3px;
  transition: all 0.2s ease;
  border-radius: 10px;
}

.nav-link:hover {
  background: rgba(45,156,219,0.08);
  text-decoration: none;
  color: var(--primary);
}

.has-dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  min-width: 240px;
  list-style: none;
  margin: 8px 0 0 0;
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 2000;
}

.has-dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu li {
  margin: 0;
}

.dropdown-menu a {
  display: block;
  padding: 10px 14px;
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.dropdown-menu a:hover {
  background: rgba(45,156,219,0.08);
  color: var(--primary);
  text-decoration: none;
  transform: translateX(4px);
}

/* Navigation contacts */
.nav-contacts {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 18px;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-weight: 500;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(45,156,219,0.08);
  transition: all 0.2s ease;
  text-decoration: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.contact-link:hover {
  background: rgba(45,156,219,0.15);
  transform: translateY(-1px);
  text-decoration: none;
}

.contact-link .icon {
  flex-shrink: 0;
  color: var(--primary);
}

.email-copy {
  position: relative;
}

.email-copy.copied::after {
  content: 'Скопировано!';
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: white;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  animation: fadeInOut 2s ease;
}

@keyframes fadeInOut {
  0%, 100% { opacity: 0; }
  10%, 90% { opacity: 1; }
}

/* Content card */
.info {
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  border-radius: var(--radius);
  padding: 22px 26px;
  box-shadow: var(--shadow-lg);
  min-height: 40vh;
  margin-top: 18px;
  position: relative;
  z-index: 1;
}

.info section {
  margin-bottom: 50px;
  padding: 30px 0;
  border-bottom: 1px solid rgba(45,156,219,0.1);
  scroll-margin-top: 80px;
}

.info section:last-child {
  margin-bottom: 0;
  border-bottom: none;
}

.info section h2 {
  color: var(--primary);
  margin-bottom: 16px;
  font-size: 28px;
}

.info section:first-child {
  padding-top: 0;
}

/* Typography helpers */
.wrapper { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.lt { width: 100%; }
.sc_img { width: 100%; height: auto; }
.column { display: inline-block; width: 31%; margin: 1%; }
.logo_img { width: 100%; height: auto; }
.logo_img:hover { cursor: pointer; }
/* Constrain any images within content */
.info img { max-width: 100%; height: auto; }
.justify { text-align: justify; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.revealed { opacity: 1; transform: translateY(0); }

/* Footer */
.site-footer { margin: 26px 0 8px; color: #e2e8f0; font-size: 14px; }
.footer-inner { display: flex; align-items: center; gap: 10px; justify-content: center; }
.footer-inner .dot { width: 4px; height: 4px; border-radius: 50%; background: #93c5fd; display: inline-block; }

/* Fullscreen animated background canvas */
.bg-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
}

/* Backdrop for mobile menu */
.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
.backdrop.show { opacity: 1; pointer-events: auto; }
.no-scroll { overflow: hidden; }

/* Program specific (kept) */
.programm { width: 100%; margin: 0; padding: 0; font-size: 0; }
.temp-programm { display: block; width: 100%; margin: auto; }
.programm-content { font-size: 0; margin: auto; }
.programm-header { text-align: center; width: 95%; font-size: 20px; }
.programm-stabilizer { display: block; height: 10vh; margin: 0; padding: 0; font-size: 0; }
.programm-content-header { margin: auto; padding: 6px 8px; border: 2px solid #0f172a; border-bottom: 1px solid #0f172a; font-size: 16px; border-top-left-radius: 10px; border-top-right-radius: 10px; background: #f8fafc; }
.programm-content-time { display: inline-block; margin: 0 auto 0 0; padding: 6px 8px; width: 18%; min-height: 72px; border: 1px solid #0f172a; border-left: 2px solid #0f172a; font-size: 16px; vertical-align: top; background: #ffffff; }
.programm-content-element { display: inline-block; margin: 0; padding: 6px 10px; width: 82%; min-height: 72px; border: 1px solid #0f172a; border-right: 2px solid #0f172a; font-size: 16px; vertical-align: top; background: #ffffff; }

/* Small tweaks */
p { color: var(--text-muted); }
ul { padding-left: 1.2rem; }
li { margin: .25rem 0; }

/* Map widget responsive wrapper */
.map-widget {
  max-width: 100%;
}

.map-widget__frame {
  width: 100%;
  max-width: 100%;
  border: 0;
  border-radius: 10px;
  height: 400px;
}

/* Download buttons */
.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(45,156,219,0.1);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
  box-shadow: var(--shadow-sm);
}

.download-btn:hover {
  background: rgba(45,156,219,0.18);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.download-btn.is-disabled {
  background: rgba(148,163,184,0.2);
  color: var(--text-muted);
  cursor: not-allowed;
  box-shadow: none;
}

.download-btn.is-disabled:hover {
  transform: none;
  box-shadow: none;
}

/* Organizers list with logos */
.org-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 16px;
}

.org-list li {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 14px;
  background: rgba(45,156,219,0.06);
  border-radius: 12px;
}

.org-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  flex-shrink: 0;
  background: #fff;
  border-radius: 10px;
  padding: 6px;
  box-shadow: var(--shadow-sm);
}

.org-list span {
  display: inline-block;
}

/* Fee table */
.fee-table-wrapper {
  overflow-x: auto;
  margin: 16px 0;
}

.fee-table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.fee-table thead {
  background: rgba(45,156,219,0.15);
}

.fee-table th,
.fee-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(45,156,219,0.1);
}

.fee-table th {
  font-weight: 700;
  color: var(--text);
}

.fee-table tbody tr:last-child td {
  border-bottom: none;
}

.fee-table tbody tr {
  background: #fff;
  transition: background 0.2s ease;
}

.fee-table tbody tr:hover {
  background: rgba(45,156,219,0.04);
}

/* Dates list */
.dates-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.dates-list li {
  padding: 12px 16px;
  margin: 8px 0;
  background: rgba(45,156,219,0.06);
  border-radius: 10px;
  border-left: 4px solid var(--primary);
}

.dates-list strong {
  color: var(--primary);
  font-weight: 700;
}

/* Registration form container */
.form-container {
  margin: 16px 0;
  border-radius: 12px;
  overflow: hidden;
}

.yandex-form {
  width: 100%;
  min-height: 600px;
  border: 0;
  border-radius: 12px;
}

/* Responsive */
@media (max-width: 980px) {
  .main-nav {
    flex-direction: column;
    padding: 10px 12px;
    gap: 10px;
  }
  
  .nav-menu {
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
  }
  
  .nav-link {
    padding: 12px 16px;
    font-size: 15px;
  }
  
  .dropdown-menu {
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
  }
  
  .has-dropdown:hover .dropdown-menu {
    transform: translateX(-50%) translateY(0);
  }
  
  .nav-contacts {
    width: 100%;
    justify-content: center;
    padding: 8px 0 0;
    border-top: 1px solid rgba(45,156,219,0.1);
  }
  
  .contact-link {
    padding: 8px 12px;
    font-size: 13px;
  }
}

@media (max-width: 640px) {
  .header_img { max-height: 220px; }
  .info { padding: 16px 18px; }
  .wrapper { grid-template-columns: 1fr; }
  
  .main-nav {
    padding: 8px 8px;
  }
  
  .nav-menu {
    gap: 4px;
  }
  
  .nav-link {
    padding: 10px 12px;
    font-size: 14px;
  }
  
  .nav-contacts {
    gap: 8px;
    padding-top: 8px;
  }
  
  .contact-text {
    font-size: 12px;
  }
  
  .contact-link {
    padding: 8px 10px;
  }
  
  .contact-link .icon {
    width: 18px;
    height: 18px;
  }

  .org-list li {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
  }

  .org-logo {
    width: 48px;
    height: 48px;
  }

  .download-grid {
    grid-template-columns: 1fr;
  }

  .download-btn {
    padding: 14px 16px;
    font-size: 14px;
    text-align: center;
  }

  .map-widget__frame {
    height: 280px;
  }

  /* Participants page mobile */
  .fee-table th,
  .fee-table td {
    padding: 10px 12px;
    font-size: 14px;
  }

  .dates-list li {
    padding: 10px 12px;
    font-size: 14px;
  }

  .yandex-form {
    min-height: 500px;
  }
  
  body { 
    background: radial-gradient(900px 600px at 10% -10%, #2563eb33, transparent 60%),
                radial-gradient(900px 600px at 110% 10%, #10b98133, transparent 60%),
                var(--bg);
    background-repeat: no-repeat, no-repeat, no-repeat;
  }
}

@media (min-width: 1500px) {
  body {
    background: radial-gradient(1600px 1000px at 10% -10%, #2563eb33, transparent 60%),
                radial-gradient(1600px 1000px at 110% 10%, #10b98133, transparent 60%),
                var(--bg);
    background-repeat: no-repeat, no-repeat, no-repeat;
  }
}