html { scroll-padding-top: var(--header-height, 4.5rem); }
body > header {
  position: sticky;
  top: 0;
  z-index: 10;
}
body > .skip { z-index: 11; }
.hero-visual, .territory-image-window { display: contents; }
.hero-visual-photo[hidden] { display: none; }
.territory.is-sticky .territory-panel {
  top: var(--header-height, 4.5rem);
  height: calc(100svh - var(--header-height, 4.5rem));
  min-height: 0;
}

@media (max-width: 768px) {
  #main-nav {
    position: absolute;
    top: calc(100% - 1px);
    inset-inline: clamp(1rem, 3vw, 1.5rem);
    max-height: calc(100dvh - var(--header-height, 4.5rem) - 1rem);
    overflow-y: auto;
    box-shadow: 0 14px 30px #172b2455;
  }

  .hero { margin: 0; border-radius: 0; }
  .hero > .hero-landscape, .hero::after { display: none; }
  .hero-grid { padding: clamp(2.25rem, 8vw, 4rem) 0 1.5rem; gap: 1.5rem; }
  .hero-copy h1 {
    font-size: clamp(2.15rem, 8.3vw, 4rem);
    line-height: 1.03;
    max-width: 17ch;
    overflow-wrap: normal;
  }
  .hero-copy .lead { color: #e1ebe0; max-width: 48ch; line-height: 1.52; }
  .hero-copy .actions { align-items: stretch; }
  .hero-visual {
    position: relative;
    display: grid;
    isolation: isolate;
    align-items: end;
    padding: .75rem;
    min-height: clamp(22rem, 89vw, 29rem);
    overflow: clip;
    border-radius: 1.1rem;
    background: var(--forest);
  }
  .hero-visual::after {
    position: absolute;
    z-index: -1;
    inset: 0;
    content: "";
    background: linear-gradient(180deg, transparent 10%, #132a2052 39%, #132a20e8);
  }
  .hero-visual-photo[hidden] {
    display: block;
    position: absolute;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
  }
  .hero-visual .hero-cards { justify-self: stretch; }

  .territory-panel[data-point] {
    isolation: isolate;
    display: block;
    width: 100%;
    height: max(28rem, calc(100svh - var(--header-height, 4.5rem)));
    min-height: 0;
    padding: 0;
    overflow: clip;
    border-radius: 0;
  }
  .territory.is-sticky .territory-panel[data-point] {
    min-height: 0;
    height: calc(100svh - var(--header-height, 4.5rem));
  }
  .territory-panel[data-point] .territory-copy {
    position: absolute;
    inset: clamp(.85rem, 3svh, 1.5rem) clamp(1rem, 5vw, 2rem) auto;
    width: auto;
    max-width: 34rem;
    z-index: 3;
  }
  .territory-copy h2 { font-size: clamp(1.65rem, 6vw, 2.65rem); }
  .territory-copy p { line-height: 1.4; }
  .territory-panel[data-point] :is(.territory-explorer, .territory-scene) {
    position: absolute;
    inset: 0;
    width: 100%;
  }
  .territory-panel[data-point] .territory-scene {
    overflow: clip;
    container-type: size;
  }
  .territory-panel[data-point] .territory-scene::after {
    content: "";
    z-index: 1;
    background: linear-gradient(180deg, #14271fea 0%, #14271f75 27%, transparent 43%, transparent 58%, #14271fe8 100%);
  }
  .territory-panel[data-point] .territory-scene {
    background: #172b24 url("/assets/paisagem-territorial.2f35379f1c14.webp") center / cover;
  }
  .territory-panel[data-point] .territory-image-plane {
    position: absolute;
    inset: 0;
    width: 100%;
    margin: 0;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 0;
  }
  .territory-panel[data-point] .territory-image-window {
    position: relative;
    display: block;
    overflow: clip;
    min-height: 0;
    container-type: size;
  }
  .territory-image-plane .territory-picture {
    --photo-width: max(100cqw, 150cqh);
    --photo-height: max(100cqh, 66.667cqw);
    position: absolute;
    width: var(--photo-width);
    height: var(--photo-height);
    left: clamp(calc(100cqw - var(--photo-width)), calc(50cqw - var(--focus-x) * var(--photo-width)), 0px);
    top: clamp(calc(100cqh - var(--photo-height)), calc(54cqh - var(--focus-y) * var(--photo-height)), 0px);
    border-radius: 0;
    overflow: visible;
  }
  .territory-panel[data-point="0"] { --focus-x: .245; --focus-y: .485; }
  .territory-panel[data-point="1"] { --focus-x: .685; --focus-y: .465; }
  .territory-panel[data-point="2"] { --focus-x: .49; --focus-y: .79; }
  .territory-picture .territory-photo {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    filter: brightness(.88);
  }
  .territory.is-sticky .territory-picture :is(.territory-photo, .territory-hotspots) { transform: none; transition: none; }
  .territory-picture .territory-hotspots { z-index: 2; }
  .territory-point {
    --frame-width: min(var(--point-width), calc(100cqw - 2.5rem));
    left: calc(var(--point-x) + (var(--point-width) - var(--frame-width)) / 2);
    width: var(--frame-width);
  }
  .territory-point:not([aria-pressed="true"]):not(:focus-visible) { opacity: .4; }
  .territory-panel[data-point] .territory-readings {
    position: relative;
    inset: auto;
    z-index: 2;
    max-width: none;
    padding: .6rem clamp(1rem, 5vw, 2rem) 2.4rem;
    background: #172b24e8;
  }
  .territory-panel[data-point] .territory-reading {
    max-width: 28rem;
    background: transparent;
    padding-block: 0;
    padding-left: 1rem;
  }
  .territory-panel[data-point] .territory-reading::before { left: 0; top: .4rem; }
  .territory-scroll-hint {
    position: absolute;
    z-index: 3;
    left: clamp(1rem, 5vw, 2rem);
    bottom: .8rem;
    margin: 0;
  }
  .territory + .figures { border-top: clamp(1.75rem, 6vw, 3rem) solid #fff; }
  .mz-differences {
    width: 100%;
    padding-inline: clamp(1rem, 5vw, 2.25rem);
    background: var(--forest);
    color: white;
  }
  .mz-differences .cards article {
    background: var(--brand);
    border-color: #ffffff30;
    box-shadow: none;
  }
  .mz-differences .cards article p { color: #e1ebe0; }
  .mz-differences .card-symbol { color: var(--gold); background: #ffffff0e; border-color: #ffffff33; }
  @media (prefers-reduced-motion: no-preference) {
    .territory-image-plane .territory-picture { transition: left .55s ease, top .55s ease; }
  }
}

body > header .brand { width: fit-content; }
body > header .brand img { width: 5rem; height: auto; }
@media (max-width: 768px) {
  body > header .brand img { width: 3.75rem; }
}
