:root {
  --footer-bg: #000000;
  --footer-text: #ffffff;
  --footer-text-muted: #999999;
  --reveal-width: 100%; /* <ADDITION> Define CSS variable for reveal width */
}

.site-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  position: relative;
  padding-top: 4rem;
}

.footer-hero {
  padding: 2rem 4rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  max-width: var(--container-max);
  margin: 0 auto;
}

.footer-title-wrapper {
  flex: 1;
}

/* Title with reveal animation - text stays visible during white background flash */
.footer-title {
  /* Match the header logo's brutalist system stack — same brand voice
   * top and bottom of the page, no extra webfont fetched. */
  font-family: "Helvetica Neue", "Helvetica", "Arial", system-ui, sans-serif;
  font-stretch: condensed;
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 0.9;
  margin: 0;
  text-transform: uppercase;
  position: relative;
  display: inline-block;
  cursor: pointer;
  color: var(--footer-text);
  background: var(--footer-bg);
  padding: 0.5rem 0;
  transition: none;
  overflow: hidden;
}

/* White overlay that covers text during animation */
.footer-title::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0; /* Changed from left to right to reverse animation direction */
  width: 0;
  height: 100%;
  background: var(--footer-text);
  transition: none;
  z-index: 1;
}

/* When animating, overlay covers full width then reveals in chunks */
.footer-title.animating::after {
  width: var(--reveal-width); /* <UPDATE> Use CSS variable to control width for stepped reveal */
}

/* When covering (reverse animation), position overlay from left */
.footer-title.covering::after {
  right: auto;
  left: 0;
}

/* Fixed underline that spans full width and doesn't move during animation */
.footer-title-underline {
  width: 90%;
  max-width: var(--container-max);
  height: 10px; /* Increased height from 6px to 10px for thicker line */
  background: var(--footer-text);
  margin: 0 auto;
  padding: 0 4rem;
}

.footer-title-underline::before {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  background: var(--footer-text);
}

/* Social icons repositioned to top right */
.footer-social-icons {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  align-items: flex-start;
  padding-top: 0.5rem;
}

.footer-social-icons a {
  color: var(--footer-text);
  transition: opacity 0.2s ease;
  display: flex;
  align-items: center;
}

.footer-social-icons a:hover {
  opacity: 0.7;
}

/* Simplified 4-column grid layout */
.footer-content {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3rem;
  padding: 3rem 4rem;
  max-width: var(--container-max);
  margin: 0 auto;
}

.footer-column-title {
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--footer-text);
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 0.875rem;
}

.footer-links a {
  color: var(--footer-text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
  display: flex; /* Added flex display for arrow icon alignment */
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
}

.footer-links a:hover {
  color: var(--footer-text);
}

.footer-newsletter-text {
  color: var(--footer-text-muted);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.footer-newsletter-form {
  display: flex;
  gap: 0.5rem;
}

.footer-newsletter-form input {
  flex: 1;
  background: transparent;
  border: 1px solid var(--footer-text-muted);
  color: var(--footer-text);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
}

.footer-newsletter-form input::placeholder {
  color: var(--footer-text-muted);
}

.footer-newsletter-form button {
  background: var(--footer-text);
  color: var(--footer-bg);
  border: none;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: opacity 0.2s ease;
  font-size: 1.25rem;
}

.footer-newsletter-form button:hover {
  opacity: 0.8;
}

.footer-legal {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2rem 4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--footer-text-muted);
  max-width: var(--container-max);
  margin: 0 auto;
}

.footer-legal-links {
  display: flex;
  gap: 2rem;
}

.footer-legal-links a {
  color: var(--footer-text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-legal-links a:hover {
  color: var(--footer-text);
}

@media (max-width: 1024px) {
  .footer-content {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .footer-newsletter-form {
    flex-direction: column;
  }

  .footer-newsletter-form input {
    width: 100%;
  }

  .footer-newsletter-form button {
    width: 100%;
    padding: 0.65rem 1rem;
    font-size: 1rem;
  }

  .footer-hero {
    flex-direction: column;
    padding: 2rem 1.5rem 1rem;
    gap: 2rem;
  }

  .footer-title {
    font-size: clamp(2rem, 10vw, 3rem);
  }

  .footer-title-underline {
    padding: 0 1.5rem;
  }

  .footer-social-icons {
    gap: 1.25rem;
  }

  .footer-content {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    padding: 2rem 1.5rem;
  }

  .footer-legal {
    flex-direction: column;
    text-align: center;
    padding: 2rem 1.5rem;
  }
}
