/* ==========================================================================
   XEYROX GLOBAL FOOTER — footer.css
   Phase 04: Global Footer
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. GRADIENT TOKEN
   -------------------------------------------------------------------------- */
:root {
  --footer-bg: var(--x-navy-950, #071326);
  --footer-text-secondary: #B8C8DF;
  --footer-text-muted: #71809A;
  --footer-border: rgba(184, 200, 223, 0.35);
  --footer-link-default: #DCE6F2;
  --footer-gradient: linear-gradient(110deg, #155EEF 0%, #27C8F5 52%, #28D9B0 100%);
  --footer-transition: color 200ms ease, background-color 200ms ease, opacity 200ms ease, transform 200ms ease;
}

/* --------------------------------------------------------------------------
   1. FOOTER ROOT
   -------------------------------------------------------------------------- */
.site-footer {
  position: relative;
  background-color: var(--footer-bg);
  overflow: hidden;
  /* Slight atmospheric tint toward top-right */
  background-image:
    radial-gradient(ellipse 60% 40% at 85% 0%, rgba(21, 94, 239, 0.06) 0%, transparent 100%);
}

/* --------------------------------------------------------------------------
   2. DECORATIVE ARTWORK LAYERS
   -------------------------------------------------------------------------- */

/* Flow lines */
.footer-flow-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  user-select: none;
  z-index: 0;
  display: flex;
  align-items: flex-end;
}

.footer-flow-lines img {
  width: 100%;
  max-width: 900px;
  height: auto;
  display: block;
  opacity: 0.72;
  object-fit: contain;
  object-position: left bottom;
  /* Very gentle breathing movement */
  animation: footerFlowBreath 8s ease-in-out infinite alternate;
}

/* X Convergence */
.footer-x-convergence {
  position: absolute;
  right: -60px;
  bottom: 40px;
  width: clamp(260px, 30vw, 440px);
  pointer-events: none;
  user-select: none;
  z-index: 0;
  /* Gentle float */
  animation: footerXFloat 10s ease-in-out infinite alternate;
}

.footer-x-convergence img {
  width: 100%;
  height: auto;
  display: block;
  opacity: 0.55;
}

/* Corner text */
.footer-corner-text {
  position: absolute;
  right: 28px;
  bottom: 104px;
  z-index: 1;
  pointer-events: none;
  user-select: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}

.footer-corner-text span {
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--footer-text-secondary);
  line-height: 1.5;
}

.footer-corner-accent {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--footer-gradient);
  border-radius: 2px;
  margin-top: 4px;
  align-self: flex-end;
}

/* Decorative animations */
@keyframes footerFlowBreath {
  from { opacity: 0.65; transform: translateY(0); }
  to   { opacity: 0.82; transform: translateY(-6px); }
}

@keyframes footerXFloat {
  from { transform: translateY(0); }
  to   { transform: translateY(-8px); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .footer-flow-lines img,
  .footer-x-convergence {
    animation: none;
  }
}

/* --------------------------------------------------------------------------
   3. FOOTER INNER (main content wrapper)
   -------------------------------------------------------------------------- */
.footer-inner {
  position: relative;
  z-index: 2;
  padding-top: 90px;
  padding-bottom: 56px;
}

/* --------------------------------------------------------------------------
   4. MAIN GRID: Brand | Nav | Newsletter
   -------------------------------------------------------------------------- */
.footer-main-grid {
  display: grid;
  grid-template-columns: 3.2fr 5.4fr 3.4fr;
  gap: 0 44px;
  align-items: start;
}

/* --------------------------------------------------------------------------
   5. BRAND COLUMN
   -------------------------------------------------------------------------- */
.footer-brand-col {
  padding-right: 8px;
}

/* Eyebrow */
.footer-eyebrow {
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--footer-text-secondary);
  margin: 0 0 22px;
}

/* Brand statement */
.footer-statement {
  font-family: var(--font-primary);
  font-weight: 800;
  font-size: clamp(38px, 4vw, 52px);
  line-height: 1.04;
  margin: 0 0 24px;
  letter-spacing: -0.01em;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.footer-statement-line {
  display: block;
}

.footer-statement-white {
  color: var(--x-white, #FFFFFF);
}

/* The gradient text treatment – only the middle line */
.footer-statement-gradient {
  background: var(--footer-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent; /* fallback */
}

.footer-statement-cyan {
  color: #27C8F5;
}

/* Supporting paragraph */
.footer-brand-copy {
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.6;
  color: var(--footer-text-secondary);
  max-width: 420px;
  margin: 0 0 40px;
}

/* Logo */
.footer-logo-wrap {
  margin-bottom: 16px;
}

.footer-logo-link {
  display: inline-block;
  line-height: 0;
  text-decoration: none;
}

.footer-logo-link:focus-visible {
  outline: 2px solid var(--x-blue-700);
  outline-offset: 4px;
  border-radius: 4px;
}

.footer-logo {
  height: 22px;
  width: auto;
  display: block;
}

/* Brand tagline */
.footer-brand-tagline {
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--footer-text-secondary);
  margin: 0;
}

/* --------------------------------------------------------------------------
   6. NAVIGATION AREA
   -------------------------------------------------------------------------- */
.footer-nav-area {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0 24px;
}

/* Column */
.footer-col {
  display: flex;
  flex-direction: column;
}

/* Column heading (desktop: static label, mobile: toggle button) */
.footer-col-heading {
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--footer-text-secondary);
  margin: 0 0 20px;
  display: block;

  /* Reset button styles when used as <button> on mobile */
  background: none;
  border: none;
  padding: 0;
  cursor: default;
  text-align: left;
  width: 100%;
}

/* Chevron hidden on desktop */
.footer-col-chevron {
  display: none;
}

@media (min-width: 769px) {
  .footer-col-heading {
    pointer-events: none;
    cursor: default;
  }

  .footer-col-chevron {
    display: none !important;
  }

  .footer-links {
    display: flex !important;
  }
}

/* Footer links list */
.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.footer-links a {
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: 15px;
  color: var(--footer-link-default);
  text-decoration: none;
  transition: var(--footer-transition);
  line-height: 1.3;
}

.footer-links a:hover {
  color: var(--x-blue-500, #2D7BFF);
  text-decoration: none;
}

.footer-links a:focus-visible {
  outline: 2px solid var(--x-blue-700);
  outline-offset: 2px;
  border-radius: 2px;
}

/* --------------------------------------------------------------------------
   7. NEWSLETTER + SOCIAL (Right Column)
   -------------------------------------------------------------------------- */
.footer-right-col {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* --- Newsletter --- */
.footer-newsletter-eyebrow {
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--footer-text-secondary);
  margin: 0 0 16px;
}

.footer-newsletter-heading {
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.2;
  color: var(--x-white, #FFFFFF);
  margin: 0 0 12px;
}

.footer-newsletter-copy {
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.6;
  color: var(--footer-text-secondary);
  margin: 0 0 20px;
}

/* Form pill container */
.footer-newsletter-field,
.footer-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(11, 23, 51, 0.5);
  border: 1px solid rgba(184, 200, 223, 0.45);
  border-radius: 999px;
  padding: 6px 6px 6px 20px;
  transition: border-color 200ms ease;
  width: 100%;
  max-width: 440px;
  box-sizing: border-box;
}

.footer-newsletter-field:focus-within,
.footer-input-wrap:focus-within {
  border-color: var(--x-blue-700);
  box-shadow: 0 0 0 3px rgba(21, 94, 239, 0.15);
}

.footer-newsletter-input,
.footer-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-primary);
  font-size: 15px;
  font-weight: 400;
  color: var(--x-white, #FFFFFF);
  min-width: 0;
  padding: 0;
}

.footer-newsletter-input::placeholder,
.footer-input::placeholder {
  color: var(--footer-text-secondary);
  opacity: 0.7;
}

/* Submit button */
.footer-newsletter-btn,
.footer-submit-btn {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--x-blue-700, #155EEF);
  color: var(--x-white, #FFFFFF);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 200ms ease, transform 200ms ease;
}

.footer-newsletter-btn:hover,
.footer-submit-btn:hover {
  background: var(--x-blue-600, #1769FF);
}

.footer-newsletter-btn:hover svg,
.footer-submit-btn:hover svg {
  transform: translateX(3px);
}

.footer-newsletter-btn svg,
.footer-submit-btn svg {
  transition: transform 200ms ease;
}

.footer-newsletter-btn:focus-visible,
.footer-submit-btn:focus-visible {
  outline: 2px solid var(--x-blue-700);
  outline-offset: 3px;
}

/* Note below form */
.footer-newsletter-note {
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: 13px;
  color: var(--footer-text-muted);
  margin: 10px 0 0;
}

/* --- Social --- */
.footer-social-eyebrow {
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--footer-text-secondary);
  margin: 0 0 14px;
}

.footer-social-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--footer-link-default);
  text-decoration: none;
  transition: background-color 200ms ease, color 200ms ease, transform 200ms ease, border-color 200ms ease;
}

.footer-social-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--x-white, #FFFFFF);
  transform: translateY(-2px);
}

.footer-social-btn:focus-visible {
  outline: 2px solid var(--x-blue-700);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .footer-social-btn:hover {
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   8. FOOTER BOTTOM BAR
   -------------------------------------------------------------------------- */
.footer-bottom-bar {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--footer-border);
}

.footer-bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 24px;
  padding-bottom: 32px;
}

.footer-copyright {
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: 14px;
  color: var(--footer-text-secondary);
  margin: 0;
}

.footer-legal-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-legal-list li a {
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: 14px;
  color: var(--footer-text-secondary);
  text-decoration: none;
  transition: color 200ms ease;
}

.footer-legal-list li a:hover {
  color: var(--x-blue-500, #2D7BFF);
}

.footer-legal-list li a:focus-visible {
  outline: 2px solid var(--x-blue-700);
  outline-offset: 2px;
  border-radius: 2px;
}

.footer-legal-sep {
  font-size: 12px;
  color: var(--footer-border);
  user-select: none;
}

/* --------------------------------------------------------------------------
   9. TABLET (769px – 1024px)
   -------------------------------------------------------------------------- */
@media (min-width: 769px) and (max-width: 1100px) {
  .footer-main-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 56px 48px;
  }

  .footer-brand-col {
    grid-column: 1 / -1;
    padding-right: 0;
  }

  .footer-nav-area {
    grid-template-columns: repeat(2, 1fr);
    gap: 40px 24px;
    grid-column: 1;
  }

  .footer-right-col {
    grid-column: 2;
    align-self: start;
  }

  .footer-x-convergence {
    width: clamp(180px, 22vw, 300px);
    right: -40px;
  }

  .footer-corner-text {
    display: none;
  }

  .footer-bottom-inner {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 12px;
    padding-top: 24px;
    padding-bottom: 32px;
  }

  .footer-legal-list {
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 10px;
  }
}

/* --------------------------------------------------------------------------
   10. MOBILE (max-width: 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .footer-inner {
    padding-top: 56px;
    padding-bottom: 0;
  }

  /* Stack everything */
  .footer-main-grid {
    grid-template-columns: 1fr;
    gap: 48px 0;
  }

  .footer-brand-col {
    padding-right: 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .footer-eyebrow {
    text-align: center;
    width: 100%;
  }

  /* Smaller statement on mobile */
  .footer-statement {
    font-size: clamp(34px, 9vw, 42px);
    align-items: center;
    text-align: center;
    width: 100%;
  }

  .footer-statement-line {
    text-align: center;
  }

  .footer-brand-copy {
    text-align: center;
    margin: 0 auto 32px auto;
    max-width: 440px;
  }

  .footer-logo-wrap {
    display: flex;
    justify-content: center;
    width: 100%;
  }

  .footer-brand-tagline {
    text-align: center;
    width: 100%;
  }

  /* Nav: accordion layout centered */
  .footer-nav-area {
    grid-template-columns: 1fr;
    gap: 0;
    text-align: center;
  }

  .footer-col {
    border-bottom: 1px solid var(--footer-border);
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  /* Make heading a real toggle button */
  .footer-col-heading {
    cursor: pointer;
    pointer-events: auto;
    padding: 18px 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    letter-spacing: 0.12em;
    color: var(--footer-text-secondary);
    transition: color 200ms ease;
    width: 100%;
    background: none;
    border: none;
    text-align: center;
    min-height: 48px;
  }

  .footer-col-heading:hover {
    color: var(--x-white, #FFFFFF);
  }

  .footer-col-heading:focus-visible {
    outline: 2px solid var(--x-blue-700);
    outline-offset: 2px;
  }

  /* Show chevron on mobile */
  .footer-col-chevron {
    display: block !important;
    color: var(--footer-text-secondary);
    transition: transform 220ms ease;
    flex-shrink: 0;
  }

  .footer-col.is-open .footer-col-chevron,
  .footer-col-heading[aria-expanded="true"] .footer-col-chevron {
    transform: rotate(180deg);
  }

  /* Accordion panels centered */
  .footer-links {
    display: none;
    padding-bottom: 20px;
    gap: 14px;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
  }

  .footer-links.is-open,
  .footer-col.is-open .footer-links {
    display: flex !important;
  }

  .footer-links li {
    text-align: center;
    width: 100%;
  }

  .footer-links li a {
    display: inline-block;
    padding: 6px 0;
    min-height: 40px;
    line-height: 28px;
    font-size: 15px;
    text-align: center;
  }

  /* Right column: Newsletter & Social centered */
  .footer-right-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
  }

  .footer-newsletter {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
  }

  .footer-newsletter-eyebrow {
    text-align: center;
    width: 100%;
  }

  .footer-newsletter-heading {
    font-size: clamp(22px, 6vw, 28px);
    text-align: center;
  }

  .footer-newsletter-copy {
    text-align: center;
    margin: 0 auto 20px auto;
    max-width: 380px;
  }

  .footer-newsletter-form {
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
  }

  .footer-newsletter-field,
  .footer-input-wrap {
    margin: 0 auto;
    width: 100%;
  }

  .footer-social-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    margin-top: 32px;
  }

  .footer-social-section .footer-col-heading {
    justify-content: center;
    text-align: center;
    padding-bottom: 8px;
    min-height: auto;
    cursor: default;
  }

  /* Social */
  .footer-social-list {
    gap: 12px;
    justify-content: center;
    margin: 0 auto;
  }

  .footer-social-btn {
    width: 44px;
    height: 44px;
  }

  /* Hide large X artwork on mobile */
  .footer-x-convergence {
    display: none;
  }

  /* Keep flow lines but reduce opacity */
  .footer-flow-lines img {
    opacity: 0.45;
    max-width: 100%;
  }

  /* Corner text */
  .footer-corner-text {
    display: none;
  }

  /* Bottom bar stacks */
  .footer-bottom-inner {
    flex-direction: column;
    gap: 16px;
    text-align: center;
    align-items: center;
    justify-content: center;
    padding-top: 24px;
    padding-bottom: 28px;
  }

  .footer-copyright {
    text-align: center;
  }

  .footer-legal-nav {
    display: flex;
    justify-content: center;
    width: 100%;
  }

  .footer-legal-list {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
    gap: 12px;
  }
}

/* --------------------------------------------------------------------------
   11. VERY WIDE SCREENS – let artwork breathe
   -------------------------------------------------------------------------- */
@media (min-width: 1400px) {
  .footer-x-convergence {
    right: -80px;
    width: clamp(380px, 28vw, 520px);
  }

  .footer-corner-text {
    right: 48px;
    bottom: 112px;
  }
}
