.site-footer {
  position: relative;
  z-index: 20; /* ensure footer visually sits above illustrations that extend past the content */
  background: linear-gradient(135deg, var(--color-primary), var(--color-bg-dark-mid));
  color: var(--color-surface);
  padding: clamp(40px, 8vw, 60px) 0 clamp(15px, 3vw, 20px) 0;
  font-family: "Montserrat", BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  position: relative;
}

.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(56, 178, 172, 0.5), transparent);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 20px);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: clamp(30px, 6vw, 50px);
  padding-bottom: clamp(30px, 6vw, 50px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.15);
}

.footer-grid h4 {
  color: #ffffff;
  font-size: clamp(1.1rem, 3vw, 1.3rem);
  font-weight: 600;
  margin-bottom: clamp(16px, 3vw, 20px);
  letter-spacing: -0.025em;
  position: relative;
}

.footer-grid h4::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 30px;
  height: 2px;
  background: var(--color-accent-3);
  border-radius: 1px;
}

.footer-about p {
  color: var(--color-muted-2);
  line-height: 1.7;
  margin-bottom: clamp(20px, 4vw, 25px);
  font-size: clamp(0.9rem, 2vw, 0.95rem);
  word-break: break-word;
  hyphens: auto;
}

.footer-about a {
  color: var(--color-accent-3);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  padding: clamp(6px, 2vw, 8px) clamp(12px, 3vw, 16px);
  border: 1px solid var(--accent-2-03);
  border-radius: 6px;
  background: rgba(56, 178, 172, 0.1);
  font-size: clamp(0.85rem, 2vw, 0.9rem);
  min-height: 44px;
  justify-content: center;
  -webkit-tap-highlight-color: rgba(56, 178, 172, 0.3);
  tap-highlight-color: rgba(56, 178, 172, 0.3);
}

@media (hover: hover) {
  .footer-about a:hover {
    color: #ffffff;
    background: #38b2ac;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(56, 178, 172, 0.3);
  }

  .footer-about a:hover::after {
    transform: translateX(3px);
  }
}

.footer-about a:active {
  color: #ffffff;
  background: #2d8a7f;
  transform: translateY(0) scale(0.98);
}

.footer-about a::after {
  content: " →";
  margin-left: 6px;
  transition: transform 0.3s ease;
}

.footer-categories ul {
  list-style: none;
  padding: 0;
  margin-bottom: clamp(16px, 3vw, 20px);
}

.footer-categories ul li {
  margin-bottom: clamp(10px, 2vw, 12px);
}

.footer-categories ul li a {
  color: var(--color-muted-2);
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-block;
  position: relative;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: clamp(0.9rem, 2vw, 0.95rem);
  min-height: 44px;
  display: flex;
  align-items: center;
  -webkit-tap-highlight-color: rgba(56, 178, 172, 0.3);
  tap-highlight-color: rgba(56, 178, 172, 0.3);
}

.footer-categories ul li a::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 8px;
  width: 0;
  height: 1px;
  background: var(--color-accent-3);
  transition: width 0.3s ease;
}

@media (hover: hover) {
  .footer-categories ul li a:hover {
    color: #38b2ac;
    transform: translateX(8px);
  }

  .footer-categories ul li a:hover::before {
    width: calc(100% - 16px);
  }
}

.footer-categories ul li a:active {
  color: #38b2ac;
  background: rgba(56, 178, 172, 0.1);
  transform: scale(0.98);
}

#allCatLink {
  color: var(--color-accent-3);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: clamp(6px, 2vw, 8px) clamp(12px, 3vw, 16px);
  border: 1px solid var(--accent-2-03);
  border-radius: 6px;
  background: rgba(56, 178, 172, 0.1);
  font-size: clamp(0.85rem, 2vw, 0.9rem);
  min-height: 44px;
  -webkit-tap-highlight-color: rgba(56, 178, 172, 0.3);
  tap-highlight-color: rgba(56, 178, 172, 0.3);
}

@media (hover: hover) {
  #allCatLink:hover {
    color: #ffffff;
    background: #38b2ac;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(56, 178, 172, 0.3);
  }

  #allCatLink:hover::after {
    transform: translateX(3px);
  }
}

#allCatLink:active {
  color: #ffffff;
  background: #2d8a7f;
  transform: translateY(0) scale(0.98);
}

#allCatLink::after {
  content: " →";
  margin-left: 6px;
  transition: transform 0.3s ease;
}

.social-icons {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 2vw, 12px);
}

.social-icons a {
  color: var(--color-surface);
  background: rgba(255, 255, 255, 0.05);
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  padding: clamp(8px, 2vw, 10px) clamp(10px, 2vw, 12px);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
  font-size: clamp(0.9rem, 2vw, 0.95rem);
  min-height: 44px;
  -webkit-tap-highlight-color: rgba(56, 178, 172, 0.3);
  tap-highlight-color: rgba(56, 178, 172, 0.3);
}

.social-icons a::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(56, 178, 172, 0.2), transparent);
  transition: left 0.5s ease;
}

@media (hover: hover) {
  .social-icons a:hover::before {
    left: 100%;
  }

  .social-icons a:hover {
    color: #38b2ac;
    background: rgba(56, 178, 172, 0.15);
    transform: translateX(8px);
  }
}

.social-icons a:active {
  color: #38b2ac;
  background: rgba(56, 178, 172, 0.2);
  transform: scale(0.98);
}

.social-icons a i {
  margin-right: clamp(6px, 1vw, 8px);
  color: white;
  font-size: clamp(0.9rem, 2vw, 1rem);
}

.footer-feedback p {
  color: var(--color-muted-2);
  line-height: 1.6;
  margin: 0;
  font-size: clamp(0.9rem, 2vw, 0.95rem);
  word-break: break-word;
  hyphens: auto;
}

.footer-feedback a {
  color: #38b2ac;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  border-bottom: 1px solid rgba(56, 178, 172, 0.3);
  padding: 2px 4px;
  border-radius: 3px;
  -webkit-tap-highlight-color: rgba(56, 178, 172, 0.3);
  tap-highlight-color: rgba(56, 178, 172, 0.3);
}

.website-important-detail {
  background-color: rgba(56, 178, 172, 0.1);
  border-left: 4px solid var(--color-accent-3);
  color: var(--color-surface);
  padding: 12px 16px;
  font-size: clamp(0.95rem, 2vw, 1.10rem);
  line-height: 1.6;
  margin-top: clamp(20px, 3vw, 30px);
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}


@media (hover: hover) {
  .footer-feedback a:hover {
    color: #4fd1c7;
    border-bottom-color: #4fd1c7;
    background: rgba(56, 178, 172, 0.1);
  }
}

.footer-feedback a:active {
  color: #4fd1c7;
  background: rgba(56, 178, 172, 0.15);
  transform: scale(0.98);
}

.copyright {
  text-align: center;
  padding-top: clamp(20px, 4vw, 30px);
}

.copyright p {
  color: var(--color-muted-2);
  font-size: clamp(0.85rem, 2vw, 0.9rem);
  margin: 0;
  opacity: 0.8;
}

@media (max-width: 1200px) {
  .footer-grid {
    grid-template-columns: 1.8fr 1fr 1fr 1fr;
    gap: 40px;
  }
}

@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: clamp(30px, 5vw, 40px);
  }

  .footer-about {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .site-footer {
    padding: clamp(30px, 6vw, 40px) 0 clamp(15px, 3vw, 20px) 0;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: clamp(25px, 5vw, 35px);
  }

  .footer-grid h4 {
    font-size: clamp(1.1rem, 4vw, 1.2rem);
    margin-bottom: clamp(12px, 3vw, 16px);
  }

  .social-icons {
    flex-direction: row;
    flex-wrap: wrap;
    gap: clamp(8px, 2vw, 12px);
  }

  .social-icons a {
    flex: 1;
    min-width: 120px;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .site-footer {
    padding: clamp(25px, 5vw, 30px) 0 clamp(12px, 2vw, 15px) 0;
  }

  .footer-grid {
    gap: clamp(20px, 4vw, 30px);
  }

  .footer-about a,
  #allCatLink {
    padding: 8px 14px;
    font-size: 0.9rem;
    width: 100%;
    max-width: 200px;
  }

  .social-icons {
    flex-direction: column;
    gap: 10px;
  }

  .social-icons a {
    min-width: auto;
    width: 100%;
  }

  .copyright {
    padding-top: clamp(15px, 3vw, 25px);
  }
}

@media (max-width: 360px) {
  .footer-grid h4 {
    font-size: 1.1rem;
  }

  .footer-about p,
  .footer-feedback p {
    font-size: 0.9rem;
  }

  .footer-categories ul li a {
    font-size: 0.9rem;
    padding: 6px 8px;
  }

  .social-icons a {
    padding: 10px 12px;
    font-size: 0.9rem;
  }
}

body.dark-theme .site-footer {
  background: linear-gradient(135deg, var(--color-bg-dark-start), var(--color-bg-dark-mid));
}

body.dark-theme .footer-grid h4 {
  color: var(--color-surface);
}

body.dark-theme .footer-about p,
body.dark-theme .footer-feedback p {
  color: var(--color-surface);
}

body.dark-theme .footer-categories ul li a {
  color: #e2e8f0;
}

body.dark-theme .social-icons a {
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.08);
}

body.dark-theme .copyright p {
  color: var(--color-muted-2);
}

.footer-grid a:focus-visible {
  outline: 2px solid var(--color-accent-2);
  outline-offset: 3px;
  border-radius: 6px;
}

@media (prefers-contrast: high) {
  .footer-grid a:focus-visible {
    outline: 3px solid;
    outline-offset: 2px;
  }

  .footer-grid h4::after {
    height: 3px;
  }
}

@media (prefers-reduced-motion: reduce) {

  .footer-grid a,
  .social-icons a::before {
    transition: none !important;
  }

  @media (hover: hover) {

    .footer-grid a:hover,
    .social-icons a:hover {
      transform: none !important;
    }
  }
}

@media print {
  .site-footer {
    background: white !important;
    color: black !important;
    padding: 20px 0;
  }

  .site-footer::before {
    display: none;
  }

  .footer-grid h4 {
    color: black !important;
  }

  .footer-grid h4::after {
    background: black !important;
  }

  .footer-about p,
  .footer-feedback p,
  .footer-categories ul li a {
    color: black !important;
  }

  .social-icons a {
    background: none !important;
    color: black !important;
  }

  .copyright p {
    color: #666 !important;
  }
}

* {
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

@media (hover: none) and (pointer: coarse) {
  .footer-grid a {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
  }

  .footer-about a,
  #allCatLink {
    justify-content: center;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .site-footer {
    padding: 20px 0 10px 0;
  }

  .footer-grid {
    gap: 20px;
    padding-bottom: 20px;
  }

  .footer-grid h4 {
    margin-bottom: 10px;
  }

  .copyright {
    padding-top: 15px;
  }
}