footer {
  margin-top: clamp(70px, 9vw, 112px);
  padding: 24px 0;
  border-top: 1px solid var(--line);
}

.footer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "links brand"
    "meta brand";
  align-items: start;
  gap: 6px 22px;
  padding-top: 0;
  border-top: 0;
  text-align: left;
}

.footer-brand {
  grid-area: brand;
  justify-self: end;
  align-self: stretch;
  display: flex;
  align-items: center;
}

.footer-brand strong {
  display: inline-block;
  color: var(--footer-brand-ink, color-mix(in srgb, var(--ink) 28%, transparent));
  font-size: var(--footer-brand-size, clamp(1.72rem, 2.6vw, 2.32rem));
  font-weight: 700;
  line-height: 0.94;
  letter-spacing: 0;
}

.footer-meta {
  grid-area: meta;
  margin: 0;
  color: var(--footer-meta-ink, var(--muted));
  font-size: 0.88rem;
  line-height: var(--copy-line-height);
}

.footer-links {
  grid-area: links;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 10px 16px;
  max-width: none;
  color: var(--footer-link-ink, var(--muted));
  font-size: 0.88rem;
  line-height: var(--copy-line-height);
}

.footer-links a,
.footer-legal summary,
.footer-legal-panel a {
  color: var(--footer-link-ink, var(--muted));
  transition:
    color 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease;
}

.footer-links a,
.footer-legal summary {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  cursor: pointer;
}

.footer-legal {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 16px;
}

.footer-legal summary {
  display: none;
  list-style: none;
  font: inherit;
}

.footer-legal summary::-webkit-details-marker {
  display: none;
}

.footer-legal-panel {
  position: static;
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.footer-legal-panel a {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 24px;
  padding: 0;
  border-radius: 0;
  background: transparent;
}

@media (hover: hover) {
  .footer-links a:hover,
  .footer-legal summary:hover,
  .footer-legal-panel a:hover {
    color: var(--ink);
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    transform: none;
  }
}

@media (max-width: 768px) {
  .footer-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "links brand"
      "meta brand";
    gap: 10px 18px;
  }

  .footer-brand {
    justify-self: end;
    align-self: center;
  }

  .footer-links {
    gap: 10px 14px;
    min-width: 0;
  }

  .footer-legal {
    display: inline-block;
  }

  .footer-legal summary {
    display: inline-flex;
    padding: 0;
    color: var(--footer-link-ink, var(--muted));
  }

  .footer-legal-panel {
    position: absolute;
    left: 0;
    bottom: calc(100% + 12px);
    z-index: 12;
    width: min(260px, calc(100vw - 48px));
    min-width: 0;
    padding: 8px;
    border: 1px solid var(--panel-border, var(--line));
    border-radius: 18px;
    background: var(--panel-bg, rgba(255, 255, 255, 0.96));
    box-shadow: var(--panel-shadow, 0 18px 36px rgba(22, 32, 42, 0.12));
    backdrop-filter: blur(18px);
    display: grid;
    gap: 4px;
  }

  .footer-legal-panel a {
    justify-content: flex-start;
    min-height: 38px;
    padding: 0 10px;
    border-radius: 12px;
    color: color-mix(in srgb, var(--footer-link-ink, var(--muted)) 88%, var(--ink));
  }

  .footer-legal-panel a:hover {
    background: var(--interactive-surface-hover, color-mix(in srgb, var(--surface-solid) 88%, transparent));
    color: var(--ink);
  }
}
