/* =============================================
   magicco.ai — shared.css
   Shared nav + footer styles for all magicco.ai pages.
   All values are hardcoded (no var() references) so this
   file is self-contained and safe to load on any page
   regardless of that page's own CSS variable definitions.
   ============================================= */

/* === Container utility === */
.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 32px;
}

/* === Navigation ===
   Scoped to #nav (set on the top nav in nav.html) so other semantic
   <nav> landmarks on the page — e.g. the footer's <nav aria-label="Legal">
   — don't inherit position:fixed top:0 and float to the top-left of
   the viewport. The bare `nav { ... }` selector originally assumed the
   top nav was the only <nav> on the page; that assumption broke as soon
   as we added a second nav landmark for accessibility. */
#nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 20px 0;
  transition: background 220ms cubic-bezier(0.4, 0, 0.2, 1),
              border-color 220ms cubic-bezier(0.4, 0, 0.2, 1);
  border-bottom: 1px solid transparent;
}

#nav.scrolled {
  background: rgba(8, 10, 12, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom-color: #1E242C;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.nav-logo span {
  color: #5B8EF0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
  list-style: none;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  padding: 8px 4px;
  font-size: 0.88rem;
  color: #6B7A8F;
  transition: color 220ms cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 500;
  text-decoration: none;
}

.nav-links a:hover {
  color: #EDF2F7;
}

.nav-cta {
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  color: #FFFFFF !important;
  background: #5B8EF0;
  padding: 9px 22px;
  border-radius: 6px;
  transition: background 220ms cubic-bezier(0.4, 0, 0.2, 1),
              transform 220ms cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.nav-cta:hover {
  background: #3A6BD4 !important;
  transform: translateY(-1px);
}

/* Restore CTA padding — .nav-links a (0,1,1) > .nav-cta (0,1,0) so needs higher specificity */
.nav-links .nav-cta {
  padding: 9px 22px;
}

/* === Footer === */
footer,
.site-footer {
  padding: 40px 0;
  border-top: 1px solid #1E242C;
  /* Phase: footer-legal-center — establish a positioning context for the
     absolutely-centred legal menu so left:50% is relative to the footer
     itself, not to whatever ancestor happens to have position set. */
  position: relative;
}

/* Phase: footer-legal-center — absolute centring instead of grid.
   The grid layout (brand · legal · reserved) couldn't put legal at the
   TRUE horizontal centre of the footer because the brand block's width
   biased the auto-track. Absolute positioning relative to .footer-inner
   guarantees the legal menu sits at left:50% regardless of how wide
   the brand text gets. Receptionist widget is `position: fixed`
   bottom-right (different layer entirely), so removing the reserved
   grid column doesn't change widget collision — only the in-flow
   layout we own. */
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 72px;
}

.footer-logo {
  font-size: 0.95rem;
  font-weight: 700;
  color: #EDF2F7;
  letter-spacing: -0.03em;
}

.footer-logo span {
  color: #5B8EF0;
}

.footer-copy {
  font-size: 0.8rem;
  color: #4A5568;
}

.footer-links {
  display: flex;
  gap: 24px;
  list-style: none;
}

.footer-links a {
  font-size: 0.8rem;
  color: #4A5568;
  transition: color 220ms cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.footer-links a:hover {
  color: #6B7A8F;
}

/* === Hamburger button === */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: background 200ms ease;
  -webkit-tap-highlight-color: transparent;
}

.nav-hamburger:hover {
  background: rgba(255, 255, 255, 0.08);
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #FFFFFF;
  border-radius: 2px;
  transition: transform 280ms cubic-bezier(0.4, 0, 0.2, 1),
              opacity 200ms ease;
  transform-origin: center;
}

/* Animated X when open */
.nav-hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-hamburger.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.nav-hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* === Mobile full-screen overlay menu === */
.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 150;
  background: #080A0C;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-100%);
  transition: transform 320ms cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.mobile-menu.open {
  transform: translateY(0);
  pointer-events: all;
}

.mobile-menu-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0;
  margin: 0;
}

.mobile-menu-links li {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 260ms ease, transform 260ms ease;
}

.mobile-menu.open .mobile-menu-links li {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered entrance */
.mobile-menu.open .mobile-menu-links li:nth-child(1) { transition-delay: 60ms; }
.mobile-menu.open .mobile-menu-links li:nth-child(2) { transition-delay: 100ms; }
.mobile-menu.open .mobile-menu-links li:nth-child(3) { transition-delay: 140ms; }
.mobile-menu.open .mobile-menu-links li:nth-child(4) { transition-delay: 180ms; }

.mobile-menu-links a {
  font-size: 1.6rem;
  font-weight: 600;
  color: #6B7A8F;
  text-decoration: none;
  letter-spacing: -0.02em;
  transition: color 180ms ease;
  display: block;
  padding: 10px 24px;
  text-align: center;
}

.mobile-menu-links a:hover {
  color: #EDF2F7;
}

.mobile-menu-cta {
  margin-top: 16px;
  font-size: 1.3rem !important;
  color: #FFFFFF !important;
  background: #5B8EF0;
  padding: 14px 36px !important;
  border-radius: 8px;
  transition: background 220ms ease !important;
}

.mobile-menu-cta:hover {
  background: #3A6BD4;
  color: #FFFFFF !important;
}

/* === Responsive === */
@media (max-width: 900px) {
  #nav {
    z-index: 200;
  }

  .nav-links {
    display: none;
  }

  .nav-hamburger {
    display: flex;
  }
}

@media (max-width: 600px) {
  .container {
    padding: 0 20px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .footer-links {
    justify-content: flex-start;
  }

  /* Phase: footer-legal-update — keep the legal link row aligned
     with the brand block when the footer stacks vertically. */
  .footer-legal {
    justify-content: flex-start;
  }
}

/* === Footer — brand + legal columns (Phase: footer-legal-update) ===
   Hardcoded hex values match the palette used elsewhere in this file:
   #EDF2F7 bright text, #6B7A8F muted, #4A5568 faint, #5B8EF0 accent.
   No CSS variables used — matches the deliberate "self-contained"
   architecture stated at the top of this file. */

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
  /* Phase: footer-legal-center — the brand sits in normal flow (flex)
     at the left. z-index keeps it above the absolutely-positioned legal
     menu in the rare case the centred legal row visually crosses into
     the brand's territory on narrow desktops. */
  z-index: 2;
  position: relative;
}

.footer-legal {
  /* Phase: footer-legal-center — pulled OUT of the flex flow and
     pinned to the true horizontal centre of .footer-inner. The brand
     block then occupies its natural width on the left without
     pushing the legal menu off-centre. white-space: nowrap keeps the
     row predictable; the mobile media query below resets all of this
     for narrow viewports. */
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  z-index: 1;
}

/* Reserved right-column gutter for the AI receptionist widget.
   aria-hidden in the markup; nothing rendered. Collapsed away on
   narrow viewports where the footer stacks vertically (see media
   query below). */
.footer-widget-space {
  /* Phase: footer-legal-center — the reserved gutter is no longer
     needed: legal is centred via absolute positioning, brand sits left
     in flow, and the widget floats over the bottom-right corner from
     its own fixed layer. The aria-hidden <div> in footer.html is left
     in place harmlessly (hidden display, no layout impact) so we don't
     touch markup for a pure CSS adjustment. */
  display: none;
}

/* Phase: footer-legal-center — on narrow viewports we drop the absolute
   centring and let the brand + legal stack as normal flex children. At
   this width the receptionist widget (fixed bottom-right) doesn't
   compete with footer flow content — it sits over the page above the
   footer entirely. Breakpoint matches the spec (800px); the site's
   #nav switches to mobile at 900px which is one tier earlier — that's
   intentional here so the centred legal stays visible on tablet-class
   desktops where the nav has already collapsed to the hamburger. */
@media (max-width: 800px) {
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    min-height: 0;
  }
  .footer-legal {
    position: static;
    transform: none;
    justify-content: flex-start;
    white-space: normal;
    flex-wrap: wrap;
  }
}

.footer-legal a {
  font-size: 0.8rem;
  color: #6B7A8F;
  text-decoration: none;
  transition: color 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

.footer-legal a:hover {
  color: #EDF2F7;
}

.footer-sep {
  font-size: 0.8rem;
  color: #2A323D;
  user-select: none;
}

/* === Legal placeholder pages (Phase: footer-legal-update) ===
   Used by /privacy-policy.html, /terms-of-service.html,
   /cookie-policy.html. Centred card, generous breathing room,
   nav fixed-bar offset handled via min-height + flex centring
   on the section. */

.legal-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 140px 0 80px;
}

.legal-card {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

.legal-card .label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #5B8EF0;
  margin: 0 0 18px;
}

.legal-card h1 {
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #EDF2F7;
  margin: 0 0 16px;
  line-height: 1.15;
}

.legal-card .legal-subtitle {
  font-size: 1.05rem;
  font-weight: 500;
  color: #6B7A8F;
  margin: 0 0 24px;
}

.legal-card .legal-body {
  font-size: 0.95rem;
  line-height: 1.65;
  color: #6B7A8F;
  margin: 0 0 32px;
}

.legal-card .legal-body a {
  color: #5B8EF0;
  text-decoration: none;
  transition: color 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

.legal-card .legal-body a:hover {
  color: #EDF2F7;
}

.legal-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 600px) {
  .legal-page {
    padding: 100px 0 60px;
  }
  .legal-card h1 {
    font-size: 1.8rem;
  }
}
