.gallery-page {
  background: var(--color-frost-white);
}

.gallery-page section[id] {
  scroll-margin-top: 6rem;
}

.gallery-hero {
  padding-block: var(--space-8);
}

.gallery-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: var(--space-8);
  align-items: center;
  min-height: 35rem;
}

.gallery-hero__content,
.gallery-hero__figure,
.gallery-legend__heading,
.gallery-index__heading,
.gallery-case__intro,
.gallery-case__content,
.gallery-case__figure,
.gallery-comparison__heading,
.gallery-final__copy,
.gallery-final__action {
  min-width: 0;
}

.gallery-hero__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-5);
}

.gallery-hero__content h1,
.gallery-hero__content p,
.gallery-hero__content ul,
.gallery-hero__content .actions {
  margin: 0;
}

.gallery-hero__content h1 {
  max-width: 25ch;
}

.gallery-hero__lead {
  max-width: 62ch;
  color: var(--color-muted-steel);
  font-size: var(--text-lg);
}

.gallery-hero__notice {
  width: 100%;
  max-width: 64ch;
  border: var(--border-dark);
  border-inline-start: 3px solid var(--color-warm-amber);
  padding: var(--space-4);
}

.gallery-hero__notice ul {
  margin-top: var(--space-3);
  margin-bottom: 0;
}

.gallery-hero__actions > * {
  width: auto;
  min-width: 0;
}

.gallery-figure {
  margin: 0;
  width: 100%;
}

.gallery-figure__media {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: var(--border);
  background: var(--color-steel-blue);
}

.gallery-figure__media--hero {
  aspect-ratio: 16 / 10;
  box-shadow: var(--shadow-panel);
}

.gallery-figure__media--four-three {
  aspect-ratio: 4 / 3;
}

.gallery-figure__media img {
  width: 100%;
  max-width: none;
  height: 100%;
  object-fit: cover;
}

.gallery-figure__media--hero img {
  object-position: right center;
}

.gallery-figure__tag,
.gallery-document-tag {
  display: inline-flex;
  position: absolute;
  z-index: 2;
  top: var(--space-3);
  left: var(--space-3);
  max-width: calc(100% - 1.5rem);
  border: 1px solid rgb(240 244 248 / 35%);
  padding: var(--space-2) var(--space-3);
  background: rgb(21 26 33 / 88%);
  color: var(--color-frost-white);
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: .08em;
  line-height: 1.333;
  text-transform: uppercase;
}

.gallery-figure figcaption {
  margin-top: var(--space-3);
  color: var(--color-muted-steel);
  font-size: var(--text-sm);
  line-height: 1.43;
}

.gallery-legend__heading {
  max-width: 52ch;
}

.gallery-legend__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-5);
  margin-top: var(--space-6);
}

.gallery-legend__card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
  border: var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
}

.gallery-legend__card h3,
.gallery-legend__card p {
  margin: 0;
}

.gallery-legend__card p {
  max-width: 45ch;
}

.gallery-annotation-sample {
  position: relative;
  width: 100%;
  height: 2.5rem;
  border-bottom: 1px solid var(--color-line-steel);
}

.gallery-annotation-sample span {
  position: absolute;
  bottom: -.1rem;
  left: 10%;
  width: 58%;
  height: 2px;
  background: var(--color-warm-amber);
  transform: rotate(-12deg);
  transform-origin: left center;
}

.gallery-annotation-sample i {
  position: absolute;
  right: 23%;
  bottom: .32rem;
  width: .7rem;
  height: .7rem;
  border: 2px solid var(--color-warm-amber);
  border-radius: 50%;
  background: var(--color-frost-white);
}

.gallery-document-tag {
  position: static;
  background: var(--color-graphite);
}

.gallery-index__heading {
  max-width: 56ch;
}

.gallery-index__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-6);
}

.gallery-index__card {
  display: flex;
  min-width: 0;
  min-height: 18rem;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
  border: var(--border-dark);
  border-top: 3px solid transparent;
  border-radius: var(--radius-md);
  padding: var(--space-5);
  color: var(--color-frost-white);
  text-decoration: none;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.gallery-index__card:hover,
.gallery-index__card:focus-visible {
  border-color: var(--color-warm-amber);
  background: var(--color-steel-blue);
}

.gallery-index__card h3,
.gallery-index__card p {
  margin: 0;
}

.gallery-index__card p {
  max-width: 36ch;
  color: var(--color-muted-steel);
  font-size: var(--text-sm);
}

.gallery-index__code,
.gallery-case__code {
  color: var(--color-warm-amber);
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: .1em;
}

.gallery-index__link {
  margin-top: auto;
  font-family: var(--font-heading);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: .16em;
}

.gallery-case__grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  column-gap: var(--space-7);
  row-gap: var(--space-5);
  align-items: start;
}

.gallery-case__grid--media-first .gallery-case__intro {
  grid-column: 1 / -1;
}

.gallery-case__grid--media-first .gallery-case__figure {
  grid-column: 1;
}

.gallery-case__grid--media-first .gallery-case__content {
  grid-column: 2;
}

.gallery-case__grid--text-first {
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
}

.gallery-case__grid--text-first .gallery-case__intro {
  grid-column: 1 / -1;
}

.gallery-case__grid--text-first .gallery-case__content {
  grid-column: 1;
}

.gallery-case__grid--text-first .gallery-case__figure {
  grid-column: 2;
}

.gallery-case__intro {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
}

.gallery-case__intro h2 {
  margin: 0;
  max-width: 25ch;
}

.gallery-case__content {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-5);
}

.gallery-case__content p {
  margin: 0;
}

.gallery-case__lead {
  max-width: 62ch;
  font-size: var(--text-lg);
}

.gallery-case__cards {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--space-4);
}

.gallery-info-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
  border: var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-4);
  background: #e6ebf0;
  color: var(--color-ink);
}

.gallery-info-card h3,
.gallery-info-card p,
.gallery-info-card ul,
.gallery-info-card a {
  margin: 0;
}

.gallery-info-card p,
.gallery-info-card ul {
  max-width: 48ch;
}

.gallery-info-card ul {
  padding-inline-start: 1.3rem;
}

.gallery-info-card a:not(.button) {
  font-weight: 700;
}

.gallery-info-card--dark,
.gallery-info-card--steel {
  border-color: rgb(240 244 248 / 12%);
  background: var(--color-steel-blue);
  color: var(--color-frost-white);
}

.gallery-info-card--dark p,
.gallery-info-card--steel p {
  color: var(--color-muted-steel);
}

.gallery-info-card--light {
  background: var(--color-frost-white);
  color: var(--color-ink);
}

.gallery-case--dark .gallery-case__lead,
.gallery-case--dark .gallery-figure figcaption {
  color: var(--color-muted-steel);
}

.gallery-case__cards--electric {
  gap: var(--space-4);
}

.gallery-callout {
  position: absolute;
  z-index: 2;
  border-top: 2px solid var(--color-warm-amber);
  padding-top: var(--space-1);
  color: var(--color-frost-white);
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: .06em;
  text-shadow: 0 1px 2px rgb(0 0 0 / 80%);
  text-transform: uppercase;
}

.gallery-callout::after {
  position: absolute;
  width: .55rem;
  height: .55rem;
  border: 2px solid var(--color-warm-amber);
  border-radius: 50%;
  background: var(--color-graphite);
  content: "";
}

.gallery-callout--top {
  top: 27%;
  right: 8%;
  width: 34%;
}

.gallery-callout--top::after {
  bottom: -2.7rem;
  left: 4%;
}

.gallery-callout--right {
  top: 48%;
  right: 5%;
  width: 36%;
}

.gallery-callout--right::after {
  bottom: -2.2rem;
  left: 15%;
}

.gallery-callout--left {
  top: 37%;
  left: 6%;
  width: 34%;
}

.gallery-callout--left::after {
  right: 8%;
  bottom: -2.3rem;
}

.gallery-comparison__heading {
  max-width: 60ch;
}

.gallery-comparison__heading p {
  max-width: 60ch;
  color: var(--color-muted-steel);
}

.gallery-comparison__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5);
  margin-top: var(--space-6);
}

.gallery-comparison__card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
  border: var(--border-dark);
  border-radius: var(--radius-md);
  padding: var(--space-5);
}

.gallery-comparison__card h3,
.gallery-comparison__card p,
.gallery-comparison__card div {
  margin: 0;
}

.gallery-comparison__card div {
  width: 100%;
  border-top: 1px solid rgb(240 244 248 / 20%);
  padding-top: var(--space-4);
}

.gallery-comparison__card div p {
  margin-top: var(--space-2);
  max-width: 46ch;
  color: var(--color-muted-steel);
}

.gallery-faq__container {
  width: min(var(--container-inline), 50rem);
}

.gallery-faq__container > .eyebrow,
.gallery-faq__container > h2,
.gallery-faq__container > .gallery-faq__link {
  display: block;
}

.gallery-faq__list {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.gallery-faq__item {
  min-width: 0;
  border: var(--border);
  border-radius: var(--radius-md);
}

.gallery-faq__item h3 {
  margin: 0;
}

.gallery-faq__button {
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 3rem;
  justify-content: space-between;
  gap: var(--space-4);
  border: 0;
  border-radius: var(--radius-md);
  padding: var(--space-4);
  background: transparent;
  color: var(--color-ink);
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  line-height: 1.3;
  text-align: left;
}

.gallery-faq__button:hover {
  background: #e6ebf0;
}

.gallery-faq__button span {
  flex: 0 0 auto;
  color: var(--color-warm-amber-hover);
  font-size: 1.5rem;
  line-height: 1;
}

.gallery-faq__answer {
  border-top: var(--border);
  padding: var(--space-4);
}

.gallery-faq__answer p {
  margin: 0;
  max-width: 66ch;
}

.gallery-faq__link {
  width: fit-content;
  margin-top: var(--space-5);
  font-weight: 700;
}

.gallery-final__panel {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: var(--space-7);
  border: var(--border-dark);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  background: var(--color-steel-blue);
}

.gallery-final__copy,
.gallery-final__action {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-4);
}

.gallery-final__copy h2,
.gallery-final__copy p,
.gallery-final__copy ul,
.gallery-final__action p,
.gallery-final__action .button {
  margin: 0;
}

.gallery-final__copy h2 {
  max-width: 28ch;
}

.gallery-final__copy p {
  max-width: 52ch;
  color: var(--color-muted-steel);
}

.gallery-final__copy ul {
  max-width: 44ch;
}

.gallery-final__action {
  justify-content: flex-end;
}

.gallery-final__action p {
  max-width: 44ch;
  color: var(--color-muted-steel);
}

.gallery-final__action .button {
  width: 100%;
}

@media (max-width: 1099px) {
  .gallery-index__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1023px) {
  .gallery-hero__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-6);
    min-height: auto;
  }

  .gallery-hero__content h1 {
    max-width: 22ch;
  }

  .gallery-case__grid,
  .gallery-case__grid--text-first {
    grid-template-columns: minmax(0, 1fr);
  }

  .gallery-case__grid--media-first .gallery-case__intro,
  .gallery-case__grid--media-first .gallery-case__figure,
  .gallery-case__grid--media-first .gallery-case__content,
  .gallery-case__grid--text-first .gallery-case__intro,
  .gallery-case__grid--text-first .gallery-case__content,
  .gallery-case__grid--text-first .gallery-case__figure {
    grid-column: 1;
  }

  .gallery-case__grid--text-first .gallery-case__figure {
    grid-row: 3;
  }

  .gallery-case__grid--text-first .gallery-case__content {
    grid-row: 2;
  }

  .gallery-legend__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery-legend__card:nth-child(3) {
    grid-column: 1 / -1;
  }

  .gallery-final__panel {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (min-width: 1160px) {
  .gallery-case__cards--electric {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 899px) {
  .gallery-hero__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .gallery-hero__content h1 {
    max-width: 25ch;
  }

  .gallery-hero__figure {
    max-width: 42rem;
  }

  .gallery-comparison__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 767px) {
  .gallery-hero {
    padding-block: var(--space-7);
  }

  .gallery-hero__grid {
    gap: var(--space-5);
  }

  .gallery-hero__content {
    gap: var(--space-4);
  }

  .gallery-hero__content h1 {
    font-size: 2.125rem;
    line-height: 1.12;
  }

  .gallery-hero__lead {
    font-size: var(--text-base);
  }

  .gallery-hero__notice {
    padding: var(--space-3);
  }

  .gallery-hero__actions {
    width: 100%;
  }

  .gallery-hero__actions > * {
    width: 100%;
  }

  .gallery-legend__grid,
  .gallery-index__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .gallery-legend__card:nth-child(3) {
    grid-column: 1;
  }

  .gallery-index__card {
    min-height: auto;
  }

  .gallery-case__grid {
    row-gap: var(--space-4);
  }

  .gallery-case__intro h2 {
    font-size: 2rem;
  }

  .gallery-case__lead {
    font-size: var(--text-base);
  }

  .gallery-callout {
    font-size: .65rem;
  }

  .gallery-comparison__card {
    padding: var(--space-4);
  }

  .gallery-faq__container {
    width: var(--container-inline);
  }

  .gallery-faq__button {
    padding: var(--space-3);
    font-size: var(--text-base);
  }

  .gallery-final__panel {
    gap: var(--space-5);
    padding: var(--space-4);
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-index__card {
    transition: opacity 150ms ease-out, color 150ms ease-out;
  }
}
