:root {
  --color-dark-blue: #0b3464;
  --color-light-blue: #4a82c4;
  --color-bg-light: #fefefe;
  --color-bg-dark: #091220;
  --color-white: #ffffff;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--color-dark-blue);
  background-color: var(--color-bg-light);
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  transition: background-color 0.8s ease, color 0.8s ease;
}

.scroll-to-top {
  position: fixed;
  right: 2rem;
  bottom: 2rem;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(11, 52, 100, 0.25);
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.4) 100%);
  color: var(--color-dark-blue);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 12px 30px rgba(11, 52, 100, 0.15);
  z-index: 160;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-to-top:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(11, 52, 100, 0.22);
}

body.is-dark .scroll-to-top {
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--color-white);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.05) 100%);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
}

body.is-dark .scroll-to-top:hover {
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.65);
}

body.is-dark {
  background-color: var(--color-bg-dark);
  color: var(--color-white);
}

#canvas-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 2rem 4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  color: inherit;
  transition: padding 0.4s ease;
}

.navbar.scrolled {
  padding: 2rem 4rem;
  background-color: transparent;
  backdrop-filter: none;
  border-bottom: none;
  box-shadow: none;
}

body.is-dark .navbar.scrolled {
  background-color: transparent;
  border-bottom: none;
}

.logo {
  flex: 1;
  display: flex;
  align-items: center;
}

.sfa-interactive-monogram {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  cursor: pointer;
  margin-left: -10px;
  perspective: 600px;
}

.monogram-orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotateX(65deg) rotateY(0deg);
  width: 86px;
  height: 86px;
  border: 1px solid rgba(11, 52, 100, 0.3);
  border-radius: 50%;
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1;
  pointer-events: none;
  transform-style: preserve-3d;
  animation: orbitTumble 8s linear infinite;
}

@keyframes orbitTumble {
  0% { transform: translate(-50%, -50%) rotateX(65deg) rotateZ(-20deg) rotateY(0deg); }
  100% { transform: translate(-50%, -50%) rotateX(65deg) rotateZ(-20deg) rotateY(360deg); }
}

body.is-dark .monogram-orbit {
  border-color: rgba(255, 255, 255, 0.4);
}

.atom-spinner {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: inherit;
  animation: spin 7s linear infinite;
  transform-style: preserve-3d;
}

.atom {
  position: absolute;
  top: -3px;
  left: 50%;
  width: 5px;
  height: 5px;
  background-color: var(--color-dark-blue);
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 5px rgba(11, 52, 100, 0.5);
  transition: opacity 0.4s ease;
}

body.is-dark .atom {
  background-color: var(--color-white);
  box-shadow: 0 0 5px rgba(255, 255, 255, 0.6);
}

@keyframes spin {
  from { transform: rotateZ(0deg); }
  to { transform: rotateZ(360deg); }
}

.sfa-monogram {
  display: flex;
  align-items: center;
  font-family: 'Manrope', sans-serif;
  font-size: 2.2rem;
  font-weight: 300;
  letter-spacing: -0.18em;
  text-transform: uppercase;
  color: var(--color-dark-blue);
  line-height: 1;
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  z-index: 2;
  transform: translateX(3px); /* Визуальная центровка */
}

body.is-dark .sfa-monogram {
  color: var(--color-white);
}

.sfa-monogram span {
  mix-blend-mode: multiply;
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

body.is-dark .sfa-monogram span {
  mix-blend-mode: screen;
}

.letter-s { opacity: 0.9; z-index: 3; }
.letter-f { opacity: 0.7; transform: translateX(-4px); z-index: 2; }
.letter-a { opacity: 0.5; transform: translateX(-8px); z-index: 1; }

/* Интерактивный Hover-эффект "Распаковки смыслов" */
.sfa-interactive-monogram:hover .monogram-orbit {
  animation: none;
  width: 134px;
  height: 52px;
  transform: translate(-50%, -50%) rotateX(0deg) rotateY(0deg) rotateZ(0deg);
  background: transparent;
  border: 1px solid rgba(11, 52, 100, 0.2);
  border-radius: 50px;
  box-shadow: none;
  backdrop-filter: blur(4px);
}

body.is-dark .sfa-interactive-monogram:hover .monogram-orbit {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.3);
}

.sfa-interactive-monogram:hover .atom {
  opacity: 0;
}

.sfa-interactive-monogram:hover .sfa-monogram {
  letter-spacing: 0.12em;
  transform: translateX(0); /* Сброс центровки при расширении */
}

.sfa-interactive-monogram:hover .letter-f {
  transform: translateX(0);
  opacity: 1;
}

.sfa-interactive-monogram:hover .letter-a {
  transform: translateX(0);
  opacity: 1;
}

.nav-links {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  align-items: center;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.4s ease;
  border-radius: 50px;
  padding: 0.8rem 2.5rem;
  border: 1px solid transparent;
  background: transparent;
}

.navbar.scrolled .nav-links {
  background-color: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-color: rgba(11, 52, 100, 0.08);
  box-shadow: 0 8px 32px rgba(11, 52, 100, 0.05);
}

body.is-dark .navbar.scrolled .nav-links {
  background-color: rgba(10, 10, 10, 0.6);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.nav-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 2rem;
  flex: 1;
}

.nav-links a {
  text-decoration: none;
  color: inherit;
  transition: opacity 0.3s ease;
}

.nav-links a:hover {
  opacity: 0.7;
}

.btn-glass {
  display: inline-flex;
  align-items: center;
  padding: 0.8rem 2rem;
  border-radius: 50px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.1) 100%);
  border: 1px solid rgba(11, 52, 100, 0.2);
  color: var(--color-dark-blue);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 
    inset 0 1px 1px rgba(255, 255, 255, 1),
    0 4px 15px rgba(11, 52, 100, 0.05);
  animation: btnBreathe 4s infinite ease-in-out;
}

@keyframes btnBreathe {
  0%, 100% {
    box-shadow: 
      inset 0 1px 1px rgba(255, 255, 255, 1),
      0 4px 15px rgba(11, 52, 100, 0.02),
      0 0 0px rgba(11, 52, 100, 0);
  }
  50% {
    box-shadow: 
      inset 0 1px 1px rgba(255, 255, 255, 1),
      0 6px 20px rgba(11, 52, 100, 0.08),
      0 0 15px rgba(11, 52, 100, 0.15);
  }
}

.btn-glass:hover {
  background: linear-gradient(145deg, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.4) 100%);
  border-color: rgba(11, 52, 100, 0.4);
  transform: translateY(-2px);
  animation: none;
  box-shadow: 
    inset 0 1px 1px rgba(255, 255, 255, 1),
    0 8px 25px rgba(11, 52, 100, 0.15),
    0 0 25px rgba(11, 52, 100, 0.2);
}

.btn-accent {
  border-color: rgba(74, 130, 196, 0.5);
  background: linear-gradient(145deg, rgba(74, 130, 196, 0.25) 0%, rgba(74, 130, 196, 0.05) 100%);
}

.btn-accent:hover {
  border-color: rgba(74, 130, 196, 0.8);
  background: linear-gradient(145deg, rgba(74, 130, 196, 0.4) 0%, rgba(74, 130, 196, 0.1) 100%);
}

body.is-dark .btn-glass {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.02) 100%);
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--color-white);
  animation: btnBreatheDark 4s infinite ease-in-out;
}

@keyframes btnBreatheDark {
  0%, 100% {
    box-shadow: 
      inset 0 1px 1px rgba(255, 255, 255, 0.15),
      0 4px 15px rgba(0, 0, 0, 0.3),
      0 0 0px rgba(255, 255, 255, 0);
  }
  50% {
    box-shadow: 
      inset 0 1px 1px rgba(255, 255, 255, 0.15),
      0 6px 20px rgba(0, 0, 0, 0.4),
      0 0 15px rgba(255, 255, 255, 0.15);
  }
}

body.is-dark .btn-glass:hover {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.05) 100%);
  border-color: rgba(255, 255, 255, 0.4);
  animation: none;
  box-shadow: 
    inset 0 1px 1px rgba(255, 255, 255, 0.3),
    0 8px 25px rgba(0, 0, 0, 0.5),
    0 0 20px rgba(255, 255, 255, 0.25);
}

main {
  position: relative;
  z-index: 10;
}

.screen {
  min-height: 100vh;
  width: 100%;
  display: flex;
  position: relative;
  padding: 0 10vw;
}

.content {
  max-width: 550px;
}

.content.left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  height: 100vh;
}

.content.center-top {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  padding-top: 15vh;
}

.content.center-middle {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

h1 {
  font-size: 5rem;
  line-height: 1;
  letter-spacing: -0.02em;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: 3.5rem;
  line-height: 1.1;
  letter-spacing: -0.01em;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

p {
  font-size: 1.125rem;
  line-height: 1.6;
  font-weight: 400;
  margin-bottom: 2.5rem;
}

.cta-invite {
  max-width: 780px;
  text-align: center;
  margin-bottom: 1.75rem;
}

.cta-telegram-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0.9rem 2rem;
  text-align: center;
  text-decoration: none;
}

footer {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 2rem 4rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  font-size: 0.9rem;
  opacity: 0.6;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 3rem;
}

.footer-logo {
  font-weight: 700;
  font-size: 1.2rem;
}

.footer-links .links {
  display: flex;
  gap: 2rem;
}

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

/* Modals Overlay (Glassmorphism) */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(230, 238, 248, 0.4);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

body.is-dark .modal-overlay {
  background: rgba(5, 10, 20, 0.6);
}

.glass-panel {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.4) 100%);
  color: var(--color-dark-blue);
  padding: 4rem;
  border-radius: 32px;
  max-width: 780px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(40px) scale(0.95);
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 
    0 40px 100px rgba(11, 52, 100, 0.15),
    inset 0 1px 2px rgba(255, 255, 255, 1);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-top: 1px solid rgba(255, 255, 255, 0.9);
  border-left: 1px solid rgba(255, 255, 255, 0.9);
}

body.is-dark .glass-panel {
  background: linear-gradient(135deg, rgba(30, 40, 60, 0.6) 0%, rgba(10, 15, 25, 0.3) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 
    0 40px 100px rgba(0, 0, 0, 0.7),
    inset 0 1px 2px rgba(255, 255, 255, 0.05);
  color: var(--color-white);
}

.modal-overlay.active .glass-panel {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2rem;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  color: var(--color-dark-blue);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: rotate(90deg);
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

body.is-dark .modal-close {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

body.is-dark .modal-close:hover {
  background: rgba(255, 255, 255, 0.15);
}

.modal-content h3 {
  font-size: 2.8rem;
  margin-bottom: 2.5rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  background: linear-gradient(90deg, var(--color-dark-blue), var(--color-light-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.is-dark .modal-content h3 {
  background: linear-gradient(90deg, #ffffff, #a0c4ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.modal-content p, .modal-content ol {
  font-size: 1.15rem;
  line-height: 1.7;
  margin-bottom: 1.2rem;
  opacity: 0.9;
}

.modal-content ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: 1.5rem;
}

.modal-content li {
  position: relative;
  padding-left: 2rem;
  margin-bottom: 1.2rem;
  font-size: 1.15rem;
  line-height: 1.6;
}

.modal-content li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.7rem;
  width: 4px;
  height: 4px;
  background: var(--color-light-blue);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--color-light-blue);
  animation: atomPulse 4s infinite ease-in-out;
}

@keyframes atomPulse {
  0% { transform: scale(0.8); opacity: 0.6; box-shadow: 0 0 4px var(--color-light-blue); }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 12px var(--color-light-blue); }
  100% { transform: scale(0.8); opacity: 0.6; box-shadow: 0 0 4px var(--color-light-blue); }
}

.highlight-text {
  font-size: 1.25rem !important;
  margin-top: 3rem;
  padding: 1.5rem 2rem;
  background: rgba(74, 130, 196, 0.08); /* light blue tint box */
  border-left: 4px solid var(--color-light-blue);
  border-radius: 0 16px 16px 0;
  color: var(--color-dark-blue);
}

body.is-dark .highlight-text {
  background: rgba(74, 130, 196, 0.15);
  color: #fff;
}

.glass-quote {
  font-style: italic;
  font-size: 1.3rem !important;
  border-left: 3px solid var(--color-light-blue);
  padding-left: 1.5rem;
  margin: 2rem 0;
  opacity: 1 !important;
}

.glass-card {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(11, 52, 100, 0.1);
  padding: 1.8rem;
  border-radius: 16px;
  margin-bottom: 1.2rem;
  transition: transform 0.3s ease;
}

.glass-card:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.9);
}

body.is-dark .glass-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

body.is-dark .glass-card:hover {
  background: rgba(255, 255, 255, 0.08);
}

.glass-card h4 {
  font-size: 1.3rem;
  margin-bottom: 0.8rem;
  font-weight: 600;
}

/* Responsive */
@media (max-width: 1024px) {
  h1 { font-size: 4rem; }
  h2 { font-size: 3rem; }
  .navbar, footer { padding: 1.5rem; }
  .screen { padding: 0 5vw; }
  .nav-links { display: none; }
  .logo, .nav-actions { flex: initial; }
}

@media (max-width: 768px) {
  html, body {
    width: 100%;
    overflow-x: hidden;
  }

  .navbar {
    padding: calc(env(safe-area-inset-top) + 0.75rem) 0.9rem 0.75rem;
    gap: 0.65rem;
    align-items: flex-start;
  }

  .navbar.scrolled {
    padding: calc(env(safe-area-inset-top) + 0.75rem) 0.9rem 0.75rem;
  }

  .logo {
    flex: 0 0 auto;
    min-width: 0;
  }

  .sfa-interactive-monogram {
    width: 64px;
    height: 64px;
    margin-left: 0;
  }

  .monogram-orbit {
    width: 70px;
    height: 70px;
  }

  .sfa-monogram {
    font-size: 1.8rem;
  }

  .nav-actions {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: flex-end;
  }

  .header-btn,
  .nav-actions .btn-glass {
    width: min(100%, 16rem);
    max-width: 100%;
    min-height: 56px;
    padding: 0.75rem 1.1rem;
    font-size: 0.9rem;
    text-align: center;
    justify-content: center;
    line-height: 1.25;
    white-space: normal;
  }

  .screen {
    min-height: 100svh;
    width: 100%;
    padding: 0 1rem;
  }

  .content {
    max-width: 100%;
  }

  .content.left,
  .content.center-top,
  .content.center-middle {
    height: auto;
    min-height: 100svh;
    padding-top: 6.5rem;
    padding-bottom: 2rem;
  }

  #section-8 {
    display: block;
    padding-bottom: calc(2.5rem + env(safe-area-inset-bottom));
  }

  #section-8 .content.center-middle {
    min-height: auto;
    padding-top: 6.5rem;
    padding-bottom: 1.25rem;
  }

  #section-8 footer {
    position: static;
    width: 100%;
    padding: 0 0 calc(2.5rem + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  #section-8 .footer-links {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.9rem;
  }

  #section-8 .footer-links .links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
  }

  #section-8 .copyright {
    width: 100%;
    max-width: 100%;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }

  .cta-form,
  .cta-form input,
  .cta-form button {
    width: 100%;
    max-width: 100%;
  }

  .cta-form input {
    font-size: 16px;
  }

  h1 { font-size: 3rem; }
  h2 { font-size: 2.2rem; }
  .footer-links { flex-direction: column; align-items: flex-start; gap: 1rem; }
  footer { flex-direction: column; align-items: flex-start; gap: 2rem; position: relative; padding-bottom: 2rem; }
  .glass-panel { padding: 2rem; }
  .scroll-to-top {
    right: 0.75rem;
    bottom: calc(0.75rem + env(safe-area-inset-bottom));
  }
}
