/* Shared layout: header, navigation, spacing, footer. */
.container {
  width: min(var(--max-width), calc(100% - var(--gutter) * 2));
  margin-inline: auto;
}

.section {
  margin-block: clamp(56px, 7vw, 96px);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 28px;
}

.section-heading h2 {
  margin-top: 9px;
}

.section-heading > p {
  max-width: 320px;
  font-size: 14px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--border);
  background: var(--header);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.header-inner {
  display: flex;
  align-items: center;
  min-height: 88px;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: #2463eb;
  color: white;
  border-radius: 14px;
  box-shadow: 0 5px 15px -8px #2463eb;
  transform: rotate(-4deg);
}

.brand-mark .icon {
  width: 26px;
  height: 26px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-text strong {
  font-size: 18px;
  letter-spacing: -.65px;
  line-height: 1.35;
}

.brand-text strong span {
  color: var(--blue);
}

.brand-text small {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: .015em;
}

.desktop-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.desktop-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 13px;
  font-size: 13px;
  font-weight: 650;
  border-radius: 12px;
  color: var(--muted);
  white-space: nowrap;
  transition: background .2s, color .2s;
}

.desktop-nav a[aria-current="page"] {
  background: var(--blue-soft);
  color: var(--blue);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.header-cta {
  padding: 12px 16px;
  min-height: 44px;
  font-size: 12px;
}

.header-cta .icon {
  width: 17px;
}

.theme-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
}

.theme-button [data-theme-icon] {
  display: flex;
  color: var(--gold);
}

.theme-button .icon {
  width: 18px;
  height: 18px;
}

.theme-label {
  font-size: 11px;
  font-weight: 700;
}

.theme-track {
  width: 28px;
  height: 17px;
  border-radius: 20px;
  background: #d8e3f4;
  padding: 3px;
}

.theme-track i {
  display: block;
  width: 11px;
  height: 11px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px #14213c30;
  transition: transform .22s;
}

[data-theme="dark"] .theme-track {
  background: #4f79da;
}

[data-theme="dark"] .theme-track i {
  transform: translateX(11px);
}

.mobile-toggle {
  display: none;
}

.mobile-nav {
  padding: 12px var(--gutter) 20px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.mobile-nav a {
  display: block;
  padding: 11px 14px;
  min-height: 46px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 650;
}

.mobile-nav a[aria-current] {
  color: var(--blue);
  background: var(--blue-soft);
}

.site-footer {
  padding: 36px 0 20px;
  margin-top: 76px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.footer-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding-bottom: 26px;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
  font-size: 12px;
}

.footer-bottom small {
  font-size: inherit;
}

.footer-bottom a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}

.footer-bottom .icon {
  width: 16px;
  height: 16px;
}

@media (hover: hover) {
  .desktop-nav a:hover, .footer-nav a:hover, .mobile-nav a:hover {
    color: var(--blue);
    background: var(--blue-soft);
  }
}

@media (max-width: 1190px) {
  .header-inner {
    gap: 16px;
  }
  .header-cta {
    display: none;
  }
  .desktop-nav {
    margin-left: auto;
  }
}

@media (max-width: 900px) {
  .header-inner {
    min-height: 76px;
    justify-content: space-between;
    gap: 12px;
  }
  .desktop-nav {
    display: none;
  }
  .mobile-toggle {
    display: inline-flex;
  }
  .no-js .header-inner {
    flex-wrap: wrap;
    padding-block: 12px;
  }
  .no-js .desktop-nav {
    display: flex;
    order: 3;
    width: 100%;
    justify-content: start;
    margin: 0;
  }
  .section-heading {
    align-items: start;
    flex-direction: column;
    gap: 12px;
  }
  .section-heading > p {
    max-width: 100%;
  }
}

@media (max-width: 540px) {
  .header-inner {
    min-height: 70px;
    gap: 6px;
  }
  .brand {
    gap: 8px;
  }
  .brand-mark {
    width: 35px;
    height: 35px;
    border-radius: 11px;
  }
  .brand-mark .icon {
    width: 22px;
    height: 22px;
  }
  .brand-text strong {
    font-size: 14px;
  }
  .brand-text small {
    font-size: 8px;
  }
  .header-actions {
    gap: 4px;
  }
  .header-actions .icon-button {
    min-width: 40px;
    min-height: 44px;
    border-color: transparent;
    background: transparent;
  }
  .theme-button {
    padding: 8px;
    min-width: 44px;
  }
  .theme-label, .theme-track {
    display: none;
  }
  .search-button {
    display: none;
  }
  .footer-main, .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }
  .footer-main .brand-text strong {
    font-size: 17px;
  }
  .footer-main .brand-text small {
    font-size: 10px;
  }
  .footer-bottom a {
    min-height: 35px;
  }
  .site-footer {
    margin-top: 55px;
  }
}

.mobile-nav button {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 11px 14px;
  min-height: 46px;
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 14px;
  font-weight: 650;
  text-align: left;
  margin-top: 7px;
}

@media (min-width: 901px) and (max-width: 1100px) {
  .desktop-nav { display: none; }
  .mobile-toggle { display: inline-flex; }
  .header-inner { justify-content: space-between; }
  .no-js .header-inner { flex-wrap: wrap; padding-block: 12px; }
  .no-js .desktop-nav { display: flex; order: 3; width: 100%; flex-wrap: wrap; margin: 0; }
}
