/* Layout: starfield shell, header, footer, containers */

#starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(37, 99, 235, 0.28), transparent 55%),
    radial-gradient(ellipse 50% 40% at 90% 60%, rgba(34, 211, 238, 0.08), transparent 50%),
    radial-gradient(ellipse 40% 35% at 10% 80%, rgba(29, 78, 216, 0.12), transparent 45%),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-space) 45%, var(--bg-deep) 100%);
}

.noise {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.site {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
}

/* —— Header —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  backdrop-filter: blur(14px);
  background: rgba(2, 6, 23, 0.65);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  flex-shrink: 0;
}

.logo:hover {
  color: var(--text);
}

.logo img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.logo-text strong {
  font-family: var(--font-en);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.logo-text span {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav a {
  color: var(--text-muted);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
}

.nav a:hover {
  color: var(--text);
  background: rgba(56, 189, 248, 0.08);
}

.nav a.is-active {
  color: var(--text);
  background: rgba(56, 189, 248, 0.08);
}

.nav-cta {
  display: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  position: relative;
}

.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  height: 2px;
  background: currentColor;
}

.nav-toggle span::before {
  top: -6px;
}

.nav-toggle span::after {
  top: 6px;
}

main {
  flex: 1;
}

/* —— Footer —— */
.site-footer {
  margin-top: 4rem;
  border-top: 1px solid var(--border);
  background: rgba(2, 6, 23, 0.85);
  padding: 3rem 0 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.footer-brand p {
  max-width: 32ch;
  font-size: 0.92rem;
}

.footer-brand .logo {
  margin-bottom: 1rem;
}

.footer-col h3 {
  font-size: 0.95rem;
  margin-bottom: 1rem;
  color: var(--text);
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.footer-col a {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.footer-col a:hover {
  color: var(--primary-light);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* —— Sections —— */
.section {
  padding: 5rem 0;
}

.section-head {
  text-align: center;
  max-width: 40rem;
  margin: 0 auto 3rem;
}

.section-head h2 {
  font-size: clamp(1.6rem, 3vw, 2.15rem);
}

.section-head p {
  margin-bottom: 0;
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav {
    position: fixed;
    top: var(--header-h);
    inset-inline: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    background: rgba(2, 6, 23, 0.96);
    border-bottom: 1px solid var(--border);
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform var(--transition), opacity var(--transition);
  }

  .nav.is-open {
    transform: none;
    opacity: 1;
    pointer-events: auto;
  }

  .nav a {
    padding: 0.85rem 1rem;
  }

  .nav-cta {
    display: block;
    margin-top: 0.5rem;
    text-align: center;
    color: #020617 !important;
    background: linear-gradient(135deg, var(--primary-mid), var(--primary-light)) !important;
    font-weight: 600;
  }

  .header-actions .btn {
    display: none;
  }

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

  .section {
    padding: 3.5rem 0;
  }
}
