.site-footer {
  --footer-accent: #68c9a7;
  --footer-ink: #e9ede7;
  --footer-muted: rgba(185, 196, 189, .58);
  --footer-control-bg: #1b2524;
  --footer-control-border: #34433f;
  position: relative;
  z-index: 4;
  width: 100%;
  margin-inline: auto;
  border-top: 1px solid var(--section-rule);
  color: var(--footer-ink);
}

:root[data-theme="light"] .site-footer {
  --footer-accent: #087f80;
  --footer-ink: #1f2a2a;
  --footer-muted: rgba(31, 42, 42, .56);
  --footer-control-bg: #e5e9e3;
  --footer-control-border: #cdd5cc;
}

.footer-inner {
  width: 100%;
  max-width: var(--site-stage-max);
  margin-inline: auto;
  padding: clamp(32px, 4vw, 48px) var(--site-frame-gutter) 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) repeat(2, minmax(0, .65fr));
  gap: clamp(54px, 7vw, 112px);
  align-items: start;
}

.footer-brand-column {
  min-width: 0;
  padding-right: clamp(34px, 5vw, 72px);
  border-right: 1px solid var(--section-rule);
}

.footer-brand {
  display: block;
  width: min(230px, 100%);
  border-radius: 3px;
}

.footer-brand img {
  display: block;
  width: 100%;
  height: auto;
}

:root[data-theme="light"] .footer-brand img { filter: brightness(.18); }

.footer-brand:focus-visible,
.footer-link-column :is(a, button):focus-visible {
  outline: 2px solid var(--footer-accent);
  outline-offset: 5px;
}

.footer-motto {
  max-width: 360px;
  margin: 18px 0 0;
  color: var(--footer-muted);
  font: 300 15px/1.55 var(--grundverk-font);
  letter-spacing: -.005em;
}

.footer-socials {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.footer-social-link {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--footer-control-border);
  border-radius: 12px;
  background: var(--footer-control-bg);
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.footer-social-link svg {
  color: var(--contact-launcher-ink);
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: var(--appearance-icon-stroke);
  stroke-linecap: round;
  stroke-linejoin: round;
}

.footer-social-link .footer-icon-dot { fill: currentColor; stroke: none; }

.footer-link-column h2 {
  margin: 3px 0 0;
  color: var(--footer-ink);
  font: 500 12px/1.2 var(--grundverk-font);
  letter-spacing: .16em;
  text-transform: uppercase;
}

.footer-heading-rule {
  display: block;
  width: 30px;
  height: 1px;
  margin-top: 14px;
  background: var(--footer-accent);
  opacity: .8;
}

.footer-link-column ul {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 5px;
}

.footer-link-column li { min-width: 0; }

.footer-link-column :is(a, button, .footer-link) {
  appearance: none;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--footer-muted);
  font: 300 15px/1.35 var(--grundverk-font);
  letter-spacing: -.005em;
  text-align: left;
  text-decoration: none;
  transition: color 180ms ease, transform 180ms ease;
}

.footer-link-column :is(a, button) { cursor: pointer; }
.footer-link-column .is-pending { opacity: .82; cursor: default; }

@media (hover: hover) and (pointer: fine) {
  .footer-link-column :is(a, button):hover {
    color: var(--footer-accent);
    transform: translateX(3px);
  }
}

.footer-bottom {
  width: calc(100% - 2 * var(--site-frame-gutter));
  max-width: calc(var(--site-stage-max) - 2 * var(--site-frame-gutter));
  margin-inline: auto;
  margin-top: 32px;
  padding: 18px 0 max(18px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--section-rule);
}

.footer-bottom p {
  margin: 0;
  color: var(--footer-muted);
  font: 300 12px/1.5 var(--grundverk-font);
  letter-spacing: .01em;
}

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: minmax(280px, 1.35fr) repeat(2, minmax(150px, .65fr));
    gap: 38px;
  }
  .footer-brand-column { padding-right: 34px; }
}

@media (max-width: 700px) {
  .footer-inner { padding-top: 32px; }
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 26px;
  }
  .footer-brand-column {
    grid-column: 1 / -1;
    padding: 0 0 24px;
    border-right: 0;
    border-bottom: 1px solid var(--section-rule);
  }
  .footer-brand { width: 210px; }
  .footer-motto { max-width: 320px; }
  .footer-bottom { margin-top: 64px; padding-bottom: max(4px, env(safe-area-inset-bottom)); }
}

@media (max-width: 340px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-brand-column { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .footer-link-column :is(a, button) { transition: none; }
}

/* Align columns, bottom rule and copyright with the header content. */
.footer-inner { padding-bottom: 0; }
.footer-brand { display:flex; align-items:center; gap:12px; width:max-content; }
.footer-brand img.brand-logo { position:absolute; height:auto; max-width:none; }
.footer-brand .brand-symbol { width:24.1px; height:26px; }
.footer-brand .brand-symbol img { width:106.267px; left:-2.976px; top:-2.905px; }
.footer-brand .brand-wordmark { width:138px; height:12px; }
.footer-brand .brand-wordmark img { width:214.286px; left:-70.429px; top:-26.143px; }
@media (hover: hover) and (pointer: fine) {
  .footer-social-link:hover:not(:active) svg { color: var(--footer-accent); }
  :root[data-theme="light"] .footer-social-link:hover:not(:active) svg {
    color: #68c9a7;
  }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .footer-social-link:hover { transform: translateY(-3px); }
}
.back-to-top { position:fixed; z-index:110; display:grid; place-items:center; padding:0; border:1px solid #34433f; border-radius:50%; background:#1b2524; color:#a0ada7; cursor:pointer; opacity:0; visibility:hidden; transform:translateY(8px); transition:opacity 180ms ease, visibility 180ms ease, transform 180ms ease, background-color 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease; }
.back-to-top[data-visible="true"] { opacity:1; visibility:visible; transform:none; }
.back-to-top svg { width:23px; height:23px; fill:none; stroke:currentColor; stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round; }
[data-theme="light"] .back-to-top { background:#e5e9e3; border-color:#cdd5cc; color:#66756b; }
.back-to-top:focus-visible { outline:2px solid var(--nav-accent); outline-offset:3px; }
[data-contact-open] .back-to-top { visibility:hidden; }
@media(max-width:760px) {
  .footer-inner { padding-inline:16px; }
  .footer-bottom { width:calc(100% - 32px); }
  .back-to-top svg { width:32px; height:32px; }
  .back-to-top path { stroke-width:1.65px; vector-effect:non-scaling-stroke; }
}
@media(prefers-reduced-motion:reduce) { .back-to-top, .footer-social-link { transition:none; } }
