:root {
  color-scheme: light;
  --ink: #202124;
  --muted: #5d6770;
  --line: #d8e0e3;
  --surface: #ffffff;
  --page: #f5f7f6;
  --header: #17201d;
  --accent: #126c64;
  --accent-strong: #0d4f49;
  --accent-soft: #d9eeea;
  --rose: #9d3d63;
  --shadow: 0 8px 28px rgba(24, 33, 30, 0.1);
  --index-thumb-width: 156px;
  --index-thumb-height: 87px;
  --index-thumb-caption-height: 30px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

a {
  color: var(--accent-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

img {
  max-width: 100%;
  display: block;
}

button,
input {
  font: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  background: var(--header);
  color: #fff;
  border-bottom: 4px solid var(--rose);
}

.site-header-inner,
.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.brand-name,
.brand-section {
  display: block;
}

.brand-name {
  font-size: 1.35rem;
  font-weight: 700;
}

.brand-section {
  color: #b7ded8;
  font-size: 0.92rem;
}

.header-link {
  color: #e8fbf8;
}

.page-shell {
  padding: 28px 0 44px;
}

.page-shell.tissue-page {
  width: min(1320px, calc(100% - 32px));
}

.home-page {
  background: var(--page);
}

.home-hero {
  position: relative;
  height: calc(100vh - 128px);
  max-height: 720px;
  min-height: 500px;
  overflow: hidden;
  background: #14201e;
}

.home-slides,
.home-slide {
  position: absolute;
  inset: 0;
}

.home-slide {
  opacity: 0;
  pointer-events: none;
  transition: opacity 1400ms ease;
}

.home-slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

.home-slide-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
  transform-origin: center;
}

.home-slide.is-animating .home-slide-image {
  animation: home-ken-burns 9200ms ease-out both;
}

.home-slide:nth-child(4n + 1) .home-slide-image {
  transform-origin: 42% 48%;
}

.home-slide:nth-child(4n + 2) .home-slide-image {
  transform-origin: 58% 44%;
}

.home-slide:nth-child(4n + 3) .home-slide-image {
  transform-origin: 50% 58%;
}

.home-slide:nth-child(4n + 4) .home-slide-image {
  transform-origin: 62% 54%;
}

@keyframes home-ken-burns {
  from {
    transform: scale(1.04);
  }

  to {
    transform: scale(1.1);
  }
}

.home-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      90deg,
      rgba(15, 28, 26, 0.7),
      rgba(15, 28, 26, 0.3),
      rgba(15, 28, 26, 0.1),
      rgba(15, 28, 26, 0)
    ),
    linear-gradient(0deg, rgba(15, 28, 26, 0.22), rgba(15, 28, 26, 0.02) 48%);
}

.home-hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
}

.home-hero-content {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.38);
  transform: translateY(clamp(-100px, -12vh, -64px));
}

.home-hero h1 {
  max-width: 740px;
  font-size: 4rem;
}

.home-lede {
  max-width: 620px;
  margin: 18px 0 0;
  color: #eef9f7;
  font-size: 1.16rem;
}

.home-usage-note {
  max-width: 620px;
  margin: 10px 0 0;
  color: #d9eeea;
  font-size: 1.04rem;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.home-sponsor-note {
  display: inline-grid;
  justify-items: start;
  gap: 6px;
  max-width: 620px;
  margin: 18px 0 0;
  color: #e8fbf8;
  font-size: 0.98rem;
  line-height: 1.2;
}

.home-sponsor-kicker {
  font-weight: 700;
}

.home-sponsor-logo-link {
  display: block;
  width: min(230px, 64vw);
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.24);
}

.home-sponsor-logo {
  width: 100%;
  height: auto;
}

.home-sponsor-tagline {
  font-weight: 600;
}

.button-link.home-primary-action {
  min-width: 178px;
  border-color: #fff4a8;
  background: #ffe66d;
  box-shadow: 0 2px 0 rgba(255, 255, 255, 0.34) inset, 0 10px 26px rgba(0, 0, 0, 0.26);
  color: #17201e;
  font-weight: 800;
  text-shadow: none;
}

.button-link.home-primary-action:hover,
.button-link.home-primary-action:focus-visible {
  border-color: #fff8c9;
  background: #fff0a3;
  box-shadow: 0 2px 0 rgba(255, 255, 255, 0.46) inset, 0 12px 30px rgba(0, 0, 0, 0.3);
  color: #111817;
}

.home-slide-controls {
  position: absolute;
  z-index: 2;
  right: max(16px, calc((100vw - 1180px) / 2));
  bottom: 28px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.home-slide-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  background: rgba(11, 24, 22, 0.48);
  color: #fff;
  cursor: pointer;
}

.home-slide-button:hover,
.home-slide-button:focus-visible {
  background: rgba(244, 255, 249, 0.18);
}

.home-slide-button svg {
  display: block;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (prefers-reduced-motion: reduce) {
  .home-slide {
    transition: none;
  }

  .home-slide.is-animating .home-slide-image {
    animation: none;
  }
}

.home-entry-band {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.home-entry-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
  display: grid;
  grid-template-columns: minmax(280px, 560px);
  justify-content: end;
  gap: 24px;
  align-items: center;
}

.home-search-form {
  box-shadow: none;
}

.index-heading,
.tissue-intro {
  display: grid;
  gap: 18px;
  align-items: end;
  margin-bottom: 22px;
}

.index-heading {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 460px);
}

h1,
h2 {
  line-height: 1.15;
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.35rem);
}

h2 {
  font-size: 1.12rem;
}

.index-heading p,
.metadata,
.result-count,
.gallery-heading p,
.description,
.licence-note p {
  color: var(--muted);
}

.search-form {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  box-shadow: var(--shadow);
}

.search-form input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  padding: 11px 10px;
  background: transparent;
}

.search-form button,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  padding: 8px 14px;
  text-decoration: none;
  cursor: pointer;
}

.search-form button:hover,
.button-link:hover {
  background: var(--accent-strong);
}

.text-link {
  color: var(--accent-strong);
  white-space: nowrap;
}

.tissue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(520px, 1fr));
  gap: 14px;
}

.tissue-card {
  position: relative;
  display: grid;
  grid-template-columns: var(--index-thumb-width) minmax(0, 1fr);
  gap: 18px;
  min-height: 134px;
  padding: 12px 64px 12px 12px;
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 3px 18px rgba(24, 33, 30, 0.06);
}

.thumb-link {
  width: var(--index-thumb-width);
  display: grid;
  grid-template-rows: auto var(--index-thumb-caption-height);
  align-self: start;
  color: #fff;
  text-decoration: none;
  border-radius: 7px;
  overflow: hidden;
  background: #e6ecea;
}

.thumb-link:focus-visible {
  outline: 3px solid var(--rose);
  outline-offset: 3px;
}

.thumb-media,
.thumb-placeholder {
  display: grid;
  place-items: center;
  background: #eef2f1;
}

.thumb-media {
  width: var(--index-thumb-width);
  height: var(--index-thumb-height);
  overflow: hidden;
}

.thumb-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.thumb-placeholder {
  width: 100%;
  height: 100%;
}

.thumb-caption {
  display: grid;
  min-height: var(--index-thumb-caption-height);
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1;
}

.thumb-link:hover .thumb-caption {
  background: var(--accent-strong);
}

.image-count-loupe {
  position: absolute;
  top: 14px;
  right: 18px;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 5px solid #123f77;
  border-radius: 50%;
  background: #fff;
  color: #123f77;
  font-size: 1.18rem;
  font-weight: 700;
  line-height: 1;
}

.image-count-loupe::after {
  content: "";
  position: absolute;
  right: -13px;
  bottom: 1px;
  width: 19px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(45deg);
  transform-origin: left center;
}

.image-count-loupe span {
  transform: translateY(1px);
}

.tissue-card-body {
  min-width: 0;
  padding-top: 1px;
}

.tissue-card h2 a {
  color: var(--ink);
  text-decoration: none;
}

.tissue-card h2 a:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

.metadata {
  margin: 5px 0 8px;
  font-size: 0.94rem;
}

.description {
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.breadcrumb {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--muted);
}

.tissue-intro {
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 1.1fr);
  align-items: start;
}

.tissue-intro > p {
  margin: 8px 0 0;
  font-size: 1.08rem;
}

.viewer-section {
  margin: 20px 0 30px;
}

.viewer-frame,
.viewer-placeholder {
  width: 100%;
  height: 68vh;
  min-height: 460px;
  max-height: 1100px;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.viewer-frame {
  display: block;
  background: #fafafa;
  color-scheme: light;
}

.viewer-placeholder {
  display: grid;
  place-items: center;
  gap: 8px;
  background: #101614;
  color: #f1fbf9;
  text-align: center;
  padding: 24px;
}

.viewer-placeholder span {
  color: #b7c5c1;
}

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

.section-heading h2,
.gallery-heading h2 {
  font-size: 1.55rem;
}

.image-gallery {
  display: grid;
  gap: 22px;
}

.image-card {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.image-stage {
  background: #eef2f1;
  padding: 10px;
}

.image-stage img {
  width: auto;
  max-width: min(100%, 1280px);
  height: auto;
  margin: 0 auto;
  border: 1px solid #2f3835;
  background: #fff;
}

.image-stage.is-full-bleed {
  padding: 0;
  background: #fff;
}

.image-stage.is-full-bleed img {
  width: 100%;
  max-width: none;
  border: 0;
  margin: 0;
}

.image-card figcaption {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.image-card figcaption p {
  margin: 0;
}

.lesson-rich-text .def {
  color: inherit;
  cursor: pointer;
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-color: #8aa39f;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.lesson-rich-text .def:hover,
.lesson-rich-text .def:focus-visible,
.lesson-rich-text .def.is-definition-open {
  color: var(--accent-strong);
  text-decoration-color: var(--accent);
}

.lesson-rich-text .def:focus-visible {
  outline: 2px solid rgba(18, 108, 100, 0.28);
  outline-offset: 2px;
  border-radius: 3px;
}

.definition-popover {
  position: fixed;
  z-index: 10000;
  max-width: min(430px, calc(100vw - 24px));
  padding: 12px 14px;
  border: 1px solid #94bdb6;
  border-radius: 6px;
  background: #e8f6f3;
  box-shadow: 0 12px 26px rgba(17, 24, 23, 0.22);
  color: #1d2c29;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.48;
}

.image-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.segmented-control {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.image-version-button {
  min-height: 36px;
  border: 0;
  border-right: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 7px 12px;
  cursor: pointer;
}

.image-version-button:last-child {
  border-right: 0;
}

.image-version-button.is-active {
  background: var(--accent);
  color: #fff;
}

.licence-note {
  margin-top: 26px;
  padding: 16px;
  border-left: 4px solid var(--rose);
  background: var(--surface);
}

.licence-note p {
  margin: 0 0 8px;
}

.licence-note p:last-child {
  margin-bottom: 0;
}

.slide-funding-footer {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
  color: var(--muted);
}

.slide-funding-footer p {
  margin: 0 0 14px;
  color: var(--ink);
  font-weight: 700;
}

.slide-funding-supporters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.slide-funding-supporter {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 8px;
  min-height: 118px;
  padding: 14px;
  border: 1px solid #d9e3df;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
}

.slide-funding-supporter:hover {
  border-color: #b7cdc7;
}

.slide-funding-supporter img {
  display: block;
  max-width: min(100%, 216px);
  max-height: 72px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.slide-funding-supporter span:first-child {
  font-weight: 700;
}

.slide-funding-supporter span:last-child {
  color: var(--muted);
}

.slide-funding-supporter-text {
  font-weight: 700;
}

.curation-paths,
.curation-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.curation-paths {
  display: grid;
  gap: 8px;
  margin: 18px 0 22px;
  padding: 14px;
}

.curation-paths p {
  margin: 0;
  overflow-wrap: anywhere;
}

.curation-list {
  display: grid;
  gap: 20px;
}

.curation-card {
  padding: 16px;
}

.curation-card h2,
.curation-card h3 {
  margin: 0 0 8px;
}

.curation-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
  margin-top: 14px;
}

.curation-panel {
  min-width: 0;
}

.curation-panel img {
  width: 100%;
  border: 1px solid var(--line);
  background: #f7f9f8;
}

.curation-panel figure {
  margin: 0 0 14px;
}

.curation-panel figcaption,
.approved-list,
.caption-review {
  overflow-wrap: anywhere;
}

.caption-review {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.caption-review pre {
  max-width: 100%;
  overflow: auto;
  background: #f0f4f3;
  padding: 12px;
  border-radius: 6px;
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.error-page {
  max-width: 720px;
}

.error-code {
  color: var(--rose);
  font-weight: 700;
}

@media (max-width: 760px) {
  .site-header-inner,
  .page-shell,
  .home-hero-content,
  .home-entry-inner {
    width: min(100% - 20px, 1180px);
  }

  .page-shell.tissue-page {
    width: min(100% - 20px, 1320px);
  }

  .index-heading,
  .tissue-intro,
  .home-entry-inner {
    grid-template-columns: 1fr;
  }

  .home-hero {
    height: calc(100vh - 112px);
    height: calc(100svh - 112px);
    max-height: 660px;
    min-height: 440px;
  }

  .home-slide::after {
    background:
      linear-gradient(0deg, rgba(15, 28, 26, 0.78), rgba(15, 28, 26, 0.24) 74%, rgba(15, 28, 26, 0.06)),
      linear-gradient(90deg, rgba(15, 28, 26, 0.4), rgba(15, 28, 26, 0.08));
  }

  .home-hero-overlay {
    align-items: flex-start;
  }

  .home-hero-content {
    padding-top: 24px;
    padding-bottom: 92px;
    transform: none;
  }

  .home-hero h1 {
    font-size: 3rem;
  }

  .home-lede {
    margin-top: 14px;
    font-size: 1rem;
  }

  .home-usage-note {
    margin-top: 8px;
    font-size: 0.96rem;
  }

  .home-actions {
    margin-top: 22px;
  }

  .home-sponsor-note {
    margin-top: 12px;
    font-size: 0.92rem;
  }

  .home-sponsor-logo-link {
    width: min(205px, 58vw);
  }

  .home-slide-controls {
    right: 20px;
    bottom: 24px;
    left: auto;
    transform: none;
  }

  .search-form {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .search-form input {
    flex-basis: 100%;
  }

  .tissue-grid {
    grid-template-columns: 1fr;
  }

  .tissue-card {
    grid-template-columns: var(--index-thumb-width) minmax(0, 1fr);
    gap: 12px;
    min-height: 124px;
    padding: 10px 52px 10px 10px;
  }

  .image-count-loupe {
    top: 12px;
    right: 14px;
    width: 36px;
    height: 36px;
    border-width: 4px;
    font-size: 0.96rem;
  }

  .image-count-loupe::after {
    right: -10px;
    bottom: 0;
    width: 15px;
    height: 5px;
  }

  .tissue-card h2 {
    font-size: 1.04rem;
  }

  .viewer-frame,
  .viewer-placeholder {
    height: 62vh;
    min-height: 340px;
    max-height: 1100px;
  }

  .gallery-heading,
  .curation-columns {
    grid-template-columns: 1fr;
  }

  .gallery-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .slide-funding-supporters {
    grid-template-columns: 1fr;
  }

  .slide-funding-supporter {
    min-height: auto;
  }
}

@media (max-width: 480px) {
  .tissue-card {
    grid-template-columns: 1fr;
    padding: 10px 52px 12px 10px;
  }

  .thumb-link {
    max-width: var(--index-thumb-width);
  }

  .tissue-card-body {
    padding-top: 0;
  }
}
