/* Site-wide header and footer based on the current Figma components.
   All desktop measurements scale from their 1600 px Figma variant. */
:root {
  --shell-paper: #faf5ec;
  --shell-ink: #1d1a17;
  --shell-rust: #963013;
}

.global-header,
.global-footer {
  color: var(--shell-ink);
}

.global-header {
  position: absolute;
  z-index: 30;
  top: 0;
  left: 50%;
  width: 100%;
  height: 15.52734375cqw;
  overflow: visible;
  transform: translateX(-50%);
  color: var(--shell-ink);
  font-family: "EB Garamond", Georgia, serif;
  --brand-focus-left: 2.34375cqw;
  --brand-focus-top: 2.001953125cqw;
  --brand-focus-width: 22.216796875cqw;
}

.global-header:has(.global-wordmark:focus-visible)::after {
  position: absolute;
  z-index: 10;
  top: var(--brand-focus-top);
  left: var(--brand-focus-left);
  width: var(--brand-focus-width);
  aspect-ratio: 355.46875 / 136.71875;
  outline: 2px solid var(--shell-rust);
  outline-offset: 4px;
  content: "";
  pointer-events: none;
}

.global-header-art {
  position: absolute;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask: url("assets/shell/header-watercolor-mask.svg") 0 0 / 100% 100% no-repeat;
  mask: url("assets/shell/header-watercolor-mask.svg") 0 0 / 100% 100% no-repeat;
}

.global-header-art::before {
  position: absolute;
  top: -57.55%;
  left: 0;
  width: 100%;
  height: 214.78%;
  background: url("assets/shell/header-watercolor.webp") 0 0 / 100% 100% no-repeat;
  content: "";
}

.global-wordmark {
  position: absolute;
  z-index: 2;
  top: 2.001953125cqw;
  left: 2.34375cqw;
  display: block;
  width: 22.216796875cqw;
  height: 8.544921875cqw;
  overflow: hidden;
  text-decoration: none;
  -webkit-mask: url("assets/shell/header-logo-mask.svg") 0 0 / 100% 100% no-repeat;
  mask: url("assets/shell/header-logo-mask.svg") 0 0 / 100% 100% no-repeat;
}

.global-wordmark img {
  position: absolute;
  top: -137.14%;
  left: -10.55%;
  display: block;
  width: 450.11%;
  max-width: none;
  height: 390.29%;
  object-fit: fill;
}

.global-nav {
  position: absolute;
  z-index: 2;
  top: 4.5409cqw;
  left: 26.3671875cqw;
  display: flex;
  width: 54.39453125cqw;
  height: 3.22265625cqw;
  align-items: center;
  gap: .9765625cqw;
  overflow: visible;
  color: #1d1a17;
  font-family: "EB Garamond", Georgia, serif;
  font-size: 1.26953125cqw;
  font-weight: 400;
  line-height: 1.66015625cqw;
  white-space: nowrap;
}

.global-nav a {
  position: relative;
  display: flex;
  width: 6.0546875cqw;
  height: 3.125cqw;
  flex: 0 0 6.0546875cqw;
  align-items: center;
  justify-content: center;
  color: inherit;
  text-align: center;
  text-decoration: none;
}

.global-nav .nav-divider {
  display: block;
  width: .048828125cqw;
  height: 1.5625cqw;
  flex: 0 0 .048828125cqw;
  background: rgba(29, 26, 23, .5);
}

.global-nav a[aria-current="page"] {
  color: var(--shell-rust);
}

.global-nav a[aria-current="page"]::after {
  position: absolute;
  right: 19%;
  bottom: .09765625cqw;
  left: 19%;
  height: .0732421875cqw;
  background: currentColor;
  content: "";
}

.global-wordmark:focus-visible,
.global-nav a:focus-visible,
.global-footer a:focus-visible {
  outline: 2px solid var(--shell-rust);
  outline-offset: 4px;
}

.global-footer {
  position: relative;
  z-index: 20;
  display: block;
  width: min(100%, var(--page-max-width));
  aspect-ratio: 1600 / 260;
  overflow: hidden;
  margin: 0 auto;
  container-type: inline-size;
  background: transparent;
  font-family: "Crimson Pro", Georgia, serif;
}

.global-footer-art {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 13.427734375cqw;
  overflow: hidden;
  background: #faf0e2;
  pointer-events: none;
}

.global-footer-art img {
  position: absolute;
  top: -12.841796875cqw;
  left: 0;
  display: block;
  width: 100%;
  max-width: none;
  height: 33.349609375cqw;
  object-fit: fill;
  -webkit-mask-image: url("assets/shell/footer-art-mask.svg");
  -webkit-mask-position: -.34375cqw 12.4980625cqw;
  -webkit-mask-size: 100.6875cqw 14.11525cqw;
  -webkit-mask-repeat: no-repeat;
  mask-image: url("assets/shell/footer-art-mask.svg");
  mask-position: -.34375cqw 12.4980625cqw;
  mask-size: 100.6875cqw 14.11525cqw;
  mask-repeat: no-repeat;
}

.global-footer-nav {
  position: absolute;
  top: 3.3125cqw;
  left: 36.625cqw;
  display: flex;
  width: 32.125cqw;
  height: 6.875cqw;
  align-items: flex-start;
  gap: .625cqw;
}

.global-footer-link {
  display: flex;
  width: 7.375cqw;
  height: 6.875cqw;
  flex: 0 0 7.375cqw;
  flex-direction: column;
  align-items: center;
  gap: .3125cqw;
  color: var(--shell-ink);
  text-align: center;
  text-decoration: none;
}

.global-footer-link:last-child {
  width: 8.125cqw;
  flex-basis: 8.125cqw;
}

.global-footer-icon {
  position: relative;
  display: block;
  width: 2.75cqw;
  height: 2.75cqw;
  flex: 0 0 2.75cqw;
  overflow: hidden;
}

.global-footer-icon img {
  position: absolute;
  top: -14.6339286cqw;
  left: calc(var(--icon-sprite-left) * 1cqw);
  display: block;
  width: 100.5714286cqw;
  max-width: none;
  height: 33.5401786cqw;
  object-fit: fill;
  pointer-events: none;
}

.global-footer-icon--romans { --icon-sprite-left: -37.5669643; }
.global-footer-icon--author { --icon-sprite-left: -45.4732143; }
.global-footer-icon--contact { --icon-sprite-left: -53.3303571; }
.global-footer-icon--top { --icon-sprite-left: -61.4821429; }

.global-footer-link-label {
  display: block;
  color: inherit;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.5cqw;
  font-weight: 400;
  line-height: 1.875cqw;
  white-space: nowrap;
}

.global-footer-link:hover,
.global-footer-link:focus-visible {
  color: var(--shell-rust);
}

.global-footer-copyright {
  position: absolute;
  right: 5.625cqw;
  bottom: .375cqw;
  left: 5.625cqw;
  display: flex;
  min-height: 2.125cqw;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(158, 117, 82, .22);
  color: var(--shell-ink);
  font-family: "Crimson Pro", Georgia, serif;
  font-size: .9375cqw;
  font-weight: 400;
  letter-spacing: .025em;
  line-height: 1.4375cqw;
}

.global-footer-hat {
  display: block;
  width: 2.625cqw;
  height: 2cqw;
  object-fit: contain;
}

@media (max-width: 1100px) {
  .global-header {
    position: relative;
    top: auto;
    left: auto;
    width: 100%;
    height: max(164px, calc(15.52734375cqw + 60px));
    transform: none;
    background: var(--shell-paper);
    --brand-focus-left: clamp(18px, 3vw, 32px);
    --brand-focus-top: 7px;
    --brand-focus-width: clamp(180px, 24vw, 230px);
  }

  .global-header-art {
    right: 0;
    width: 100%;
    height: calc(15.52734375cqw + 30px);
    max-height: none;
    -webkit-mask-position: 0 30px;
    -webkit-mask-size: 100% 15.52734375cqw;
    mask-position: 0 30px;
    mask-size: 100% 15.52734375cqw;
  }

  .global-header-art::before {
    top: calc(-8.9375cqw + 30px);
    height: 33.349609375cqw;
  }

  .global-wordmark {
    top: 7px;
    left: clamp(18px, 3vw, 32px);
    width: clamp(180px, 24vw, 230px);
    height: auto;
    aspect-ratio: 355.46875 / 136.71875;
  }

  .global-nav {
    top: max(106px, calc(15.52734375cqw + 10px));
    right: 18px;
    left: 18px;
    width: auto;
    height: 40px;
    gap: clamp(9px, 1.35vw, 15px);
    overflow-x: auto;
    padding: 0 2px 4px;
    font-size: 17px;
    line-height: 24px;
    scrollbar-width: none;
    overscroll-behavior-inline: contain;
  }

  .global-nav::-webkit-scrollbar { display: none; }

  .global-nav a {
    width: max-content;
    min-width: max-content;
    height: 36px;
    flex: 0 0 auto;
    padding-inline: 4px;
  }

  .global-nav .nav-divider {
    width: 1px;
    height: 19px;
    flex-basis: 1px;
  }

  .global-nav a[aria-current="page"]::after {
    right: 4px;
    bottom: 1px;
    left: 4px;
    height: 1px;
  }

  .global-footer {
    min-height: max(230px, calc(max(13.427734375cqw, 52px) + 132px));
    aspect-ratio: auto;
  }

  .global-footer-art {
    height: max(13.427734375cqw, 52px);
  }

  .global-footer-nav {
    top: calc(max(13.427734375cqw, 52px) + 16px);
    right: 16px;
    left: 16px;
    width: auto;
    height: 68px;
    justify-content: space-between;
    gap: 8px;
  }

  .global-footer-link,
  .global-footer-link:last-child {
    width: auto;
    height: 64px;
    flex: 1 1 0;
    gap: 5px;
  }

  .global-footer-icon {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }

  .global-footer-icon img {
    top: -159.64px;
    width: 1097px;
    height: 365.66px;
  }

  .global-footer-icon--romans img { left: -409.82px; }
  .global-footer-icon--author img { left: -496.07px; }
  .global-footer-icon--contact img { left: -581.79px; }
  .global-footer-icon--top img { left: -670.71px; }

  .global-footer-link-label {
    font-size: 16px;
    line-height: 21px;
  }

  .global-footer-copyright {
    right: 22px;
    bottom: 9px;
    left: 22px;
    min-height: 34px;
    font-size: 14px;
    line-height: 20px;
  }

  .global-footer-hat {
    width: 32px;
    height: 25px;
  }
}

@media (max-width: 420px) {
  .global-header { height: 164px; }
  .global-wordmark { width: 180px; }
  .global-nav { left: 12px; right: 12px; gap: 8px; font-size: 16px; }
  .global-footer { min-height: max(225px, calc(max(13.427734375cqw, 52px) + 127px)); }
  .global-footer-nav { right: 10px; left: 10px; gap: 2px; }
  .global-footer-link-label { font-size: 14px; }
  .global-footer-copyright { right: 16px; left: 16px; font-size: 13px; }
}

@media (max-width: 680px) {
  .global-header {
    height: max(198px, calc(15.52734375cqw + 108px));
  }

  .global-nav {
    top: max(106px, calc(15.52734375cqw + 30px));
    right: 12px;
    left: 12px;
    display: grid;
    height: auto;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-flow: row;
    gap: 2px 4px;
    overflow: visible;
    padding: 0;
    scrollbar-width: auto;
  }

  .global-nav a {
    width: 100%;
    min-width: 0;
    height: 32px;
    justify-self: stretch;
    padding-inline: 2px;
    white-space: nowrap;
  }

  .global-nav .nav-divider { display: none; }

  .global-nav a[aria-current="page"]::after {
    right: 10%;
    bottom: 0;
    left: 10%;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .global-nav a,
  .global-footer a { transition: color .18s ease; }
}
