/* ── Footer ─────────────────────────────────────────────────────────────── */

/* <site-footer> host adds no box: footer sits in normal flow as before */
site-footer { display: contents; }

.footer {
  position: relative;
  background: var(--almost-black);
  /* margin-top: 80px; */
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 1500px;
  background:
    linear-gradient(to right, var(--almost-black) 0%, color-mix(in srgb, var(--almost-black) 85%, transparent) 5%, transparent 18%, transparent 82%, color-mix(in srgb, var(--almost-black) 85%, transparent) 95%, var(--almost-black) 100%),
    radial-gradient(ellipse 140% 120% at 48% 120%, #FF9020 0%, rgba(255, 144, 32, 0.4) 38%, rgba(255, 144, 32, 0) 69%),
    radial-gradient(ellipse 160% 160% at 48% 115%, #E07818 15%, rgba(210, 108, 18, 0.5) 31%, rgba(180, 85, 10, 0.15) 60%, rgba(160, 75, 0, 0) 80%);
  pointer-events: none;
  z-index: 0;
}

/* ── Nav grid ────────────────────────────────────────────────────────────── */

.footer__nav {
  position: relative;
  z-index: 1;
  width: var(--col-width);
  max-width: 100%;
  margin: 0 auto;
  padding: 56px 38px 48px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 32px;
}

.footer__col-heading {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 16px;
}

.footer__col-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer__col-links a {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.45);
  text-decoration: none;
  transition: color 0.15s;
}

.footer__col-links a:hover {
  color: rgba(255, 255, 255, 0.9);
}

/* ── Separator ───────────────────────────────────────────────────────────── */

.footer__bottom {
  position: relative;
  z-index: 1;
  width: var(--col-width);
  max-width: 100%;
  margin: 0 auto;
  padding: 100px 38px 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer__bottom::before,
.footer__bottom::after {
  content: '';
  position: absolute;
  top: 0;
  width: var(--bracket);
  height: var(--bracket);
  border-top: var(--bracket-w) solid var(--orange);
}

.footer__bottom::before {
  left: var(--rail-edge);
  border-left: var(--bracket-w) solid var(--orange);
}

.footer__bottom::after {
  right: var(--rail-edge);
  border-right: var(--bracket-w) solid var(--orange);
}

/* ── Bottom rows ─────────────────────────────────────────────────────────── */

.footer__bottom-row {
  display: flex;
  align-items: center;
}

.footer__bottom-row--main {
  padding-top: 32px;
  padding-bottom: 20px;
  justify-content: space-between;
  align-items: flex-end;
}

.footer__bottom-row--legal {
  justify-content: space-between;
  padding-top: 16px;
}

/* ── Bottom rule ─────────────────────────────────────────────────────────── */

.footer__rule {
  position: relative;
  height: 1px;
  margin: 0 -38px;
}

.footer__rule::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
}

/* L-shape from the shared .bracket primitive (css/brackets.css); these rules
   only position the brackets on the tram lines. */
.footer__rule-bracket--l {
  top: -4px;
  left: var(--rail-edge);
}

.footer__rule-bracket--r {
  top: -4px;
  right: var(--rail-edge);
}

/* ── Logo ────────────────────────────────────────────────────────────────── */

.footer__logo img {
  height: 100px;
  width: auto;
  display: block;
}

/* ── Social icons ────────────────────────────────────────────────────────── */

.footer__social {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.footer__social-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
}

.footer__social-icons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer__social-link {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}

.footer__social-link:hover {
  border-color: rgba(255, 255, 255, 0.5);
  color: rgba(255, 255, 255, 0.95);
}

/* ── Legal row ───────────────────────────────────────────────────────────── */

.footer__copyright {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.3);
  text-transform: uppercase;
}

/* Copyright + legal links grouped on the left; the partner badge sits on the
   right (the --legal row is space-between). */
.footer__legal-left {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.footer__legal-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* MathWorks Connections Program partner badge (white/reversed art on the dark
   footer). Self-hosted in logos/; links to the MathWorks product listing. */
.footer__partner-badge {
  display: inline-flex;
  flex: none;
  opacity: 0.85;
  transition: opacity 0.15s;
}
.footer__partner-badge:hover { opacity: 1; }
.footer__partner-badge img {
  height: 44px;
  width: auto;
  display: block;
}

.footer__legal-links a {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.3);
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.15s;
}

.footer__legal-links a:hover {
  color: rgba(255, 255, 255, 0.7);
}
