/* ==========================================================================
   AgentSetup.agency — Layout Styles
   Header nav, footer, page structure, hamburger menu
   ========================================================================== */

@import './variables.css';

/* --------------------------------------------------------------------------
   PAGE WRAPPER
   -------------------------------------------------------------------------- */

.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.main-content {
  flex: 1;
  padding-top: var(--nav-height); /* offset for sticky header */
}

/* --------------------------------------------------------------------------
   HEADER — STICKY WITH GLASSMORPHISM
   -------------------------------------------------------------------------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: calc(var(--z-modal) + 2);
  height: var(--nav-height);
  display: flex;
  align-items: center;
  background: var(--gradient-nav-glass);
  backdrop-filter: blur(var(--nav-blur)) saturate(1.5);
  -webkit-backdrop-filter: blur(var(--nav-blur)) saturate(1.5);
  border-bottom: 1px solid rgba(0, 212, 255, 0.06);
  transition:
    height var(--duration-normal) var(--ease-out),
    background var(--duration-normal) var(--ease-out),
    border-color var(--duration-normal) var(--ease-out),
    box-shadow var(--duration-normal) var(--ease-out);
}

/* Scrolled state — tighter + slightly more opaque */
.site-header--scrolled {
  height: var(--nav-height-scrolled);
  background: linear-gradient(180deg, rgba(8, 13, 22, 0.96) 0%, rgba(8, 13, 22, 0.92) 100%);
  border-bottom-color: rgba(0, 212, 255, 0.10);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.40);
}

/* --------------------------------------------------------------------------
   NAV INNER — CONTAINER
   -------------------------------------------------------------------------- */

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
  gap: var(--space-8);
}

/* --------------------------------------------------------------------------
   LOGO
   -------------------------------------------------------------------------- */

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  flex-shrink: 0;
  color: var(--color-fg-primary);
  transition: opacity var(--duration-fast) var(--ease-out);
}

.nav-logo:hover {
  opacity: 0.85;
  text-decoration: none;
}

.nav-logo__mark {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: var(--gradient-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: var(--weight-black);
  color: var(--color-bg-base);
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.30);
  transition: box-shadow var(--duration-normal) var(--ease-out);
}

.nav-logo:hover .nav-logo__mark {
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.50);
}

.nav-logo__text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.nav-logo__name {
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
  color: var(--color-fg-primary);
}

.nav-logo__tagline {
  font-size: var(--text-xs);
  font-weight: var(--weight-regular);
  letter-spacing: var(--tracking-wide);
  color: var(--color-fg-tertiary);
  text-transform: uppercase;
  margin-top: 2px;
}

/* Logo SVG image — constrain inside fixed-height nav */
.nav-logo__svg {
  height: 32px;
  width: auto;
  display: block;
  object-fit: contain;
}

/* --------------------------------------------------------------------------
   DESKTOP NAVIGATION LINKS
   -------------------------------------------------------------------------- */

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-links li {
  padding: 0;
}

.nav-links li::before {
  content: none; /* override base ul */
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-fg-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  letter-spacing: var(--tracking-normal);
  transition:
    color var(--duration-fast) var(--ease-out),
    background var(--duration-fast) var(--ease-out);
  position: relative;
}

.nav-link:hover {
  color: var(--color-fg-primary);
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}

.nav-link.active,
.nav-link[aria-current="page"] {
  color: var(--color-fg-accent);
}

.nav-link.active::after,
.nav-link[aria-current="page"]::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--gradient-brand);
  border-radius: var(--radius-full);
}

/* Dropdown indicator */
.nav-link--has-dropdown {
  padding-right: var(--space-2);
}

.nav-link--has-dropdown svg {
  width: 14px;
  height: 14px;
  opacity: 0.60;
  transition: transform var(--duration-fast) var(--ease-out);
}

.nav-link--has-dropdown:hover svg {
  transform: rotate(180deg);
}

/* --------------------------------------------------------------------------
   NAV ACTIONS — CTA AREA (right side)
   -------------------------------------------------------------------------- */

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   HAMBURGER BUTTON (mobile)
   -------------------------------------------------------------------------- */

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  gap: 5px;
  background: transparent;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  padding: 0;
  transition:
    background var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out);
  z-index: calc(var(--z-modal) + 1); /* above mobile menu */
  flex-shrink: 0;
  position: relative;
}

.hamburger:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--color-border-default);
}

.hamburger:focus-visible {
  outline: 2px solid var(--color-border-focus);
  outline-offset: 2px;
}

.hamburger__line {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--color-fg-secondary);
  border-radius: 2px;
  transition:
    transform var(--duration-normal) var(--ease-in-out),
    opacity var(--duration-fast) var(--ease-out),
    width var(--duration-normal) var(--ease-in-out);
  transform-origin: center;
}

/* Open state — morphs into X */
.hamburger[aria-expanded="true"] .hamburger__line:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.hamburger[aria-expanded="true"] .hamburger__line:nth-child(2) {
  opacity: 0;
  width: 0;
}

.hamburger[aria-expanded="true"] .hamburger__line:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* --------------------------------------------------------------------------
   MOBILE NAV MENU
   -------------------------------------------------------------------------- */

.mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-modal);
  background: rgba(8, 13, 22, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  flex-direction: column;
  padding-top: var(--nav-height);
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform var(--duration-slow) var(--ease-out);
}

.mobile-menu--open {
  display: flex;
  transform: translateX(0);
}

.mobile-menu__inner {
  padding: var(--space-8) var(--container-padding);
  flex: 1;
}

.mobile-menu__links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.mobile-menu__links li {
  padding-left: 0;
}

.mobile-menu__links li::before {
  content: none;
}

.mobile-menu__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-4);
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
  color: var(--color-fg-secondary);
  text-decoration: none;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  transition:
    color var(--duration-fast) var(--ease-out),
    background var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out);
}

.mobile-menu__link:hover,
.mobile-menu__link:focus {
  color: var(--color-fg-primary);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--color-border-subtle);
  text-decoration: none;
}

.mobile-menu__divider {
  height: 1px;
  background: var(--color-border-subtle);
  margin: var(--space-4) 0;
}

.mobile-menu__actions {
  padding: var(--space-6) var(--container-padding) var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* --------------------------------------------------------------------------
   FOOTER
   -------------------------------------------------------------------------- */

.site-footer {
  background: var(--gradient-footer);
  border-top: 1px solid var(--color-border-subtle);
  padding: var(--spacing-section) 0 var(--spacing-2xl);
  position: relative;
  overflow: hidden;
}

/* Subtle background glow behind footer */
.site-footer::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 200px;
  background: radial-gradient(ellipse, rgba(0, 212, 255, 0.04) 0%, transparent 70%);
  pointer-events: none;
}

.footer-inner {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* Footer top — logo + columns */
.footer-top {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: var(--space-12);
  margin-bottom: var(--spacing-section);
}

/* Brand column */
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.footer-brand__logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--color-fg-primary);
}

.footer-brand__logo:hover {
  text-decoration: none;
  opacity: 0.85;
}

.footer-brand__description {
  font-size: var(--text-sm);
  color: var(--color-fg-secondary);
  line-height: var(--leading-relaxed);
  max-width: 28ch;
}

.footer-brand__socials {
  display: flex;
  gap: var(--space-3);
  padding: 0;
}

.footer-brand__socials li {
  padding: 0;
}

.footer-brand__socials li::before {
  content: none;
}

.footer-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--color-border-subtle);
  color: var(--color-fg-tertiary);
  text-decoration: none;
  transition:
    background var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-normal) var(--ease-out);
}

.footer-social-link:hover {
  background: rgba(0, 212, 255, 0.08);
  border-color: rgba(0, 212, 255, 0.20);
  color: var(--color-fg-accent);
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.15);
  text-decoration: none;
}

/* Footer columns */
.footer-col__heading {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-widest);
  color: var(--color-fg-tertiary);
  margin-bottom: var(--space-5);
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer-links li {
  padding: 0;
}

.footer-links li::before {
  content: none;
}

.footer-link {
  font-size: var(--text-sm);
  color: var(--color-fg-secondary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.footer-link:hover {
  color: var(--color-fg-primary);
  text-decoration: none;
}

.footer-link--accent {
  color: var(--color-fg-accent);
}

.footer-link--accent:hover {
  color: var(--color-brand-secondary);
}

/* Contact info in footer */
.footer-contact-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-fg-secondary);
  margin-bottom: var(--space-3);
}

.footer-contact-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--color-fg-tertiary);
  margin-top: 2px;
}

/* Footer bottom — legal + copyright */
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--spacing-xl);
  border-top: 1px solid var(--color-border-subtle);
  gap: var(--space-6);
  flex-wrap: wrap;
}

.footer-copyright {
  font-size: var(--text-xs);
  color: var(--color-fg-tertiary);
}

.footer-legal-links {
  display: flex;
  gap: var(--space-6);
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-legal-links li {
  padding: 0;
}

.footer-legal-links li::before {
  content: none;
}

.footer-legal-link {
  font-size: var(--text-xs);
  color: var(--color-fg-tertiary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

.footer-legal-link:hover {
  color: var(--color-fg-secondary);
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   HERO SECTION STRUCTURE
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  min-height: 90dvh;
  display: flex;
  align-items: center;
  overflow: hidden;
  margin-top: calc(-1 * var(--nav-height)); /* pull hero up behind the glass nav */
  padding-top: var(--nav-height); /* compensate content offset */
}

.hero__content {
  position: relative;
  z-index: var(--z-raised);
  text-align: center;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: var(--space-20) var(--container-padding);
}

.hero__content h1 + .lead {
  margin-top: var(--space-8);
}

/* Decorative background shapes for hero */
.hero__bg-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: var(--z-base);
}

.hero__bg-glow::before {
  content: '';
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 600px;
  background: radial-gradient(ellipse,
    rgba(0, 180, 255, 0.12) 0%,
    rgba(34, 211, 238, 0.05) 40%,
    transparent 70%);
  border-radius: 50%;
  filter: blur(40px);
}

.hero__bg-glow::after {
  content: '';
  position: absolute;
  bottom: -10%;
  right: -10%;
  width: 500px;
  height: 400px;
  background: radial-gradient(ellipse,
    rgba(52, 211, 153, 0.06) 0%,
    transparent 70%);
  border-radius: 50%;
  filter: blur(60px);
}

/* --------------------------------------------------------------------------
   SECTION SHAPES / DECORATIVE GRID
   -------------------------------------------------------------------------- */

/* Subtle dot-grid background pattern */
.bg-grid {
  position: relative;
}

.bg-grid::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(0, 212, 255, 0.08) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 40%, transparent 100%);
}

/* Alternating section backgrounds */
.section-alt {
  background: rgba(255, 255, 255, 0.015);
  border-top: 1px solid var(--color-border-subtle);
  border-bottom: 1px solid var(--color-border-subtle);
}

/* --------------------------------------------------------------------------
   STICKY CTA BAR (optional — for long pages)
   -------------------------------------------------------------------------- */

.sticky-cta {
  position: fixed;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-overlay);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-5);
  background: rgba(13, 21, 37, 0.90);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 212, 255, 0.15);
  border-radius: var(--radius-full);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.60),
    0 0 20px rgba(0, 212, 255, 0.08);
  white-space: nowrap;
  font-size: var(--text-sm);
  color: var(--color-fg-secondary);
}

/* --------------------------------------------------------------------------
   RESPONSIVE — HEADER
   -------------------------------------------------------------------------- */

@media (max-width: 1024px) {
  .nav-links {
    display: none;
  }

  .hamburger {
    display: flex;
    /* Ensure 44px minimum touch target */
    width: 44px;
    height: 44px;
  }

  .nav-actions .btn:not(.btn--mobile-show) {
    display: none;
  }
}

@media (max-width: 768px) {
  .nav-inner {
    padding: 0 var(--space-4);
  }

  .nav-logo__tagline {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   RESPONSIVE — FOOTER
   -------------------------------------------------------------------------- */

@media (max-width: 1024px) {
  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-10);
  }

  .footer-brand {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .footer-brand__description {
    max-width: 40ch;
  }
}

@media (max-width: 640px) {
  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }

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

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
  }

  .footer-legal-links {
    gap: var(--space-4);
  }

  .sticky-cta {
    display: none; /* too cramped on small screens */
  }
}

@media (max-width: 480px) {
  .footer-top {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
}

/* --------------------------------------------------------------------------
   RESPONSIVE — HERO
   -------------------------------------------------------------------------- */

@media (max-width: 768px) {
  .hero {
    min-height: 80dvh;
  }

  .hero__content {
    padding: var(--space-16) var(--space-4);
  }

  /* Bump footer social icons to minimum 44px touch target on mobile */
  .footer-social-link {
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 480px) {
  .hero__content {
    padding: var(--space-12) var(--space-4);
  }

  /* Hero CTA buttons: stack vertically and go full-width on small screens */
  .hero__content .btn {
    width: 100%;
    justify-content: center;
  }

  /* Hero code block: constrain on small screens */
  .hero__content .code-block {
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: 100% !important;
  }
}
