/* Page shell: containers, sections, header, footer. */

.at-container {
  width: 100%;
  max-width: var(--at-container);
  margin-inline: auto;
  padding-inline: var(--at-gutter);
}

.at-container--narrow {
  max-width: var(--at-container-narrow);
}

.at-container--wide {
  max-width: var(--at-container-wide);
}

.at-main {
  display: block;
  min-height: 50vh;
}

.at-section {
  padding-block: var(--at-section-y);
}

.at-section--tight {
  padding-block: var(--at-section-y-tight);
}

.at-section--loose {
  padding-block: var(--at-section-y-loose);
}

.at-section--subtle {
  background-color: var(--at-color-bg-subtle);
}

.at-section--muted {
  background-color: var(--at-color-bg-muted);
}

/* ---------- Header ---------- */

.at-header {
  position: sticky;
  top: 0;
  z-index: var(--at-z-header);
  background-color: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--at-transition), box-shadow var(--at-transition);
}

.at-header.is-scrolled {
  border-bottom-color: var(--at-color-line);
  box-shadow: var(--at-shadow-sm);
}

.at-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--at-space-5);
  height: var(--at-header-h);
}

.at-header__logo img {
  width: auto;
  height: 30px;
}

.at-header__nav {
  display: flex;
  align-items: center;
  gap: clamp(var(--at-space-4), 2vw, var(--at-space-6));
}

.at-header__menu {
  display: flex;
  align-items: center;
  gap: clamp(var(--at-space-4), 1.8vw, var(--at-space-6));
}

.at-header__link {
  font-size: var(--at-text-sm);
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.at-header__link:hover {
  color: var(--at-color-neutral);
}

.at-header__actions {
  display: flex;
  align-items: center;
  gap: var(--at-space-3);
}

.at-header__toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  margin-right: calc(var(--at-space-2) * -1);
}

.at-header__toggle-bars,
.at-header__toggle-bars::before,
.at-header__toggle-bars::after {
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--at-color-fg-strong);
  transition: transform var(--at-transition), opacity var(--at-transition);
}

.at-header__toggle-bars::before,
.at-header__toggle-bars::after {
  content: "";
  position: relative;
}

.at-header__toggle-bars::before {
  top: -7px;
}

.at-header__toggle-bars::after {
  top: 5px;
}

.at-header__toggle[aria-expanded="true"] .at-header__toggle-bars {
  background-color: transparent;
}

.at-header__toggle[aria-expanded="true"] .at-header__toggle-bars::before {
  top: 2px;
  transform: rotate(45deg);
}

.at-header__toggle[aria-expanded="true"] .at-header__toggle-bars::after {
  top: 0;
  transform: rotate(-45deg);
}

/* Tablet and below: collapse the nav into a drawer. */
@media (max-width: 960px) {
  .at-header__toggle {
    display: flex;
  }

  .at-header__nav {
    position: fixed;
    inset: var(--at-header-h) 0 auto;
    z-index: var(--at-z-drawer);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-height: calc(100dvh - var(--at-header-h));
    padding: var(--at-space-4) var(--at-gutter) var(--at-space-8);
    background-color: var(--at-color-bg);
    border-top: 1px solid var(--at-color-line);
    overflow-y: auto;
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--at-transition), transform var(--at-transition),
      visibility var(--at-transition);
  }

  .at-header__nav.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .at-header__menu {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .at-header__link {
    display: block;
    padding-block: var(--at-space-4);
    border-bottom: 1px solid var(--at-color-line);
    font-size: var(--at-text-md);
  }

  .at-header__actions {
    flex-direction: column;
    align-items: stretch;
    margin-top: var(--at-space-6);
  }

  .at-header__actions .at-button {
    width: 100%;
  }
}

/* ---------- Footer ---------- */

.at-footer {
  background-color: var(--at-color-bg-black);
  color: var(--at-color-fg-inverse);
}

.at-footer__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--at-space-3) var(--at-space-6);
  padding: var(--at-space-6) var(--at-gutter) 0;
}

.at-footer__nav a {
  font-size: var(--at-text-sm);
  color: rgba(255, 255, 255, 0.82);
}

.at-footer__nav a:hover {
  color: var(--at-color-accent-light);
}

.at-footer__copyright {
  padding: var(--at-space-6) var(--at-gutter) var(--at-space-7);
  color: rgba(255, 255, 255, 0.56);
  font-size: var(--at-text-xs);
  text-align: center;
}
