/* ============================================
   LAYOUT — Header, Footer, Grid, Containers
   ============================================ */

/* ── Site Header ── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-fixed);
  background: var(--color-bg-dark);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: background var(--transition-base), box-shadow var(--transition-base);
}

.site-header.scrolled {
  background: rgba(10, 22, 40, 0.98);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  flex-shrink: 0;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--color-accent-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--weight-extrabold);
  color: var(--color-white);
  font-size: var(--text-lg);
  font-family: var(--font-heading);
}

.logo-text {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--color-white);
  letter-spacing: -0.02em;
}

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

/* Navigation */
.main-nav { display: flex; align-items: center; gap: var(--space-1); }

.nav-link {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: rgba(255,255,255,0.75);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  text-decoration: none;
}
.nav-link:hover { color: var(--color-white); background: rgba(255,255,255,0.08); }
.nav-link.active { color: var(--color-white); }

.header-cta { display: flex; align-items: center; gap: var(--space-3); }

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-white);
  border-radius: 2px;
  transition: all var(--transition-base);
}
.menu-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile Nav Drawer */
.mobile-nav {
  display: none;
  position: fixed;
  top: 72px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-bg-dark);
  z-index: var(--z-modal);
  padding: var(--space-6);
  flex-direction: column;
  gap: var(--space-2);
  overflow-y: auto;
}
.mobile-nav.open { display: flex; }
.mobile-nav .nav-link {
  font-size: var(--text-lg);
  padding: var(--space-4);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.mobile-nav .btn { margin-top: var(--space-4); text-align: center; }

@media (max-width: 1023px) {
  .main-nav, .header-cta { display: none; }
  .menu-toggle { display: flex; }
}

/* ── Footer ── */
.site-footer {
  background: var(--color-bg-dark);
  color: rgba(255,255,255,0.7);
  padding: var(--space-16) 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: var(--space-10);
  padding-bottom: var(--space-12);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.footer-brand p {
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  margin-top: var(--space-4);
  max-width: 300px;
}

.footer-heading {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-white);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-5);
}

.footer-links { display: flex; flex-direction: column; gap: var(--space-3); }
.footer-links a {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.6);
  transition: color var(--transition-fast);
}
.footer-links a:hover { color: var(--color-accent); }

.footer-social {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.social-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.6);
  transition: all var(--transition-fast);
  font-size: var(--text-lg);
}
.social-icon:hover {
  background: var(--color-accent);
  color: var(--color-white);
}

.footer-bottom {
  padding: var(--space-6) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-sm);
  flex-wrap: wrap;
  gap: var(--space-4);
}

.footer-bottom-links {
  display: flex;
  gap: var(--space-6);
}
.footer-bottom-links a {
  color: rgba(255,255,255,0.5);
  font-size: var(--text-sm);
}
.footer-bottom-links a:hover { color: var(--color-accent); }

/* Newsletter */
.newsletter-form {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-4);
}
.newsletter-form input {
  flex: 1;
  padding: var(--space-3) var(--space-4);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-md);
  color: var(--color-white);
  font-size: var(--text-sm);
}
.newsletter-form input::placeholder { color: rgba(255,255,255,0.4); }
.newsletter-form input:focus {
  border-color: var(--color-accent);
  outline: none;
}

/* ── Back to Top ── */
.back-to-top {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  width: 48px;
  height: 48px;
  background: var(--color-accent-gradient);
  color: var(--color-white);
  border: none;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(20px);
  transition: all var(--transition-base);
  z-index: var(--z-sticky);
  font-size: 1.2rem;
}
.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}
.back-to-top:hover { transform: translateY(-3px); box-shadow: var(--shadow-xl); }

/* ── Grid Systems ── */
.grid { display: grid; gap: var(--space-6); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1023px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--space-8); }
}
@media (max-width: 575px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

/* ── Page Layout ── */
.page-content {
  padding-top: 72px;
}

.page-hero {
  background: var(--color-bg-dark);
  padding: var(--space-16) 0 var(--space-12);
  color: var(--color-white);
}

.page-hero h1 {
  color: var(--color-white);
  margin-bottom: var(--space-4);
}

.page-hero p {
  color: rgba(255,255,255,0.7);
  font-size: var(--text-lg);
  max-width: 600px;
}
