:root {
  --bg: #f3efe4;
  --panel: rgba(255, 250, 239, 0.84);
  --panel-strong: #fffaf0;
  --line: rgba(31, 42, 40, 0.14);
  --ink: #1f2a28;
  --muted: #56625c;
  --accent: #a0462d;
  --accent-soft: rgba(160, 70, 45, 0.12);
  --shadow: 0 20px 60px rgba(55, 38, 23, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(160, 70, 45, 0.12), transparent 28rem),
    radial-gradient(circle at top right, rgba(45, 107, 91, 0.16), transparent 24rem),
    linear-gradient(180deg, #f8f4ea 0%, var(--bg) 100%);
}

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

.page-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0 64px;
}

.hero {
  display: block;
  margin-bottom: 28px;
}

.hero-copy,
.legend-card,
.scene-card {
  backdrop-filter: blur(14px);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero-copy {
  border-radius: 28px;
  padding: 38px 42px 34px;
}

.eyebrow,
.scene-kicker,
.legend-label,
.scene-slug,
.table-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
}

.eyebrow,
.scene-kicker,
.legend-label,
.scene-slug {
  color: var(--accent);
  font-weight: 700;
}

h1,
.scene-title {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, serif;
  font-weight: 700;
  line-height: 1.02;
}

h1 {
  max-width: none;
  font-size: clamp(2.6rem, 4.1vw, 4.4rem);
  letter-spacing: -0.035em;
  margin-top: 10px;
}

.hero-title-line {
  display: block;
}

.hero-text {
  max-width: none;
  margin: 18px 0 0;
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--muted);
}

.hero-text span {
  color: var(--ink);
  font-weight: 700;
}

.hero-teaser {
  margin: 18px auto 0;
  width: 100%;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  box-shadow: 0 16px 40px rgba(55, 38, 23, 0.10);
}

.hero-teaser img {
  width: 100%;
  aspect-ratio: 16 / 8.8;
  object-fit: cover;
  object-position: center top;
}

.legend {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.legend-card {
  border-radius: 20px;
  padding: 18px 20px;
}

.legend-card p {
  margin: 0;
}

.legend-value {
  margin-top: 8px !important;
  font-size: 1rem;
}

.scene-list {
  display: grid;
  gap: 24px;
}

.page-footer {
  padding: 28px 4px 0;
}

.page-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  text-align: center;
}

.page-footer span {
  color: var(--accent);
  font-weight: 700;
  margin-right: 8px;
}

.page-footer a {
  color: inherit;
  text-decoration: none;
}

.page-footer a:hover {
  text-decoration: underline;
}

.scene-card {
  border-radius: 28px;
  padding: 24px;
}

.scene-card-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.scene-title {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  margin-top: 6px;
}

.scene-title-link {
  color: inherit;
  text-decoration: none;
}

.scene-title-link:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.12em;
}

.comparison-table {
  display: grid;
  grid-template-columns: 164px repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.table-label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  text-align: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 10px 12px;
}

.table-corner,
.table-column {
  font-weight: 700;
}

.viz-tile {
  position: relative;
  margin: 0;
  min-height: 248px;
  overflow: hidden;
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(34, 29, 23, 0.06), rgba(34, 29, 23, 0.02)),
    linear-gradient(180deg, rgba(201, 109, 67, 0.14), rgba(113, 141, 120, 0.10));
  border: 1px solid var(--line);
}

.viz-tile.has-image {
  cursor: zoom-in;
}

.viz-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.26) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.26) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 95%);
  pointer-events: none;
}

.viz-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.viz-tile.has-image img {
  display: block;
}

.viz-tile.has-image::before {
  display: none;
}

.viz-tile figcaption {
  display: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
}

.lightbox.is-open {
  display: block;
}

.lightbox.is-loading .lightbox-figure img {
  opacity: 0.78;
  filter: saturate(0.92);
}

.lightbox.is-loading .lightbox-figure::after {
  content: "Loading full resolution...";
  position: absolute;
  left: 16px;
  bottom: 16px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(17, 16, 13, 0.82);
  color: rgba(255, 250, 240, 0.92);
  font-size: 0.86rem;
  letter-spacing: 0.01em;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 18, 14, 0.74);
  backdrop-filter: blur(8px);
}

.lightbox-dialog {
  position: relative;
  width: min(1440px, calc(100vw - 24px));
  margin: 12px auto;
  padding: 18px;
  border-radius: 28px;
  border: 1px solid rgba(255, 250, 239, 0.18);
  background: rgba(26, 24, 21, 0.84);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
}

.lightbox-close,
.lightbox-nav {
  appearance: none;
  border: 0;
  color: #fffaf0;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

.lightbox-close:hover,
.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.lightbox-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  font-size: 1.65rem;
  line-height: 1;
}

.lightbox-header {
  padding: 6px 54px 16px 2px;
}

.lightbox-scene,
.lightbox-meta {
  margin: 0;
}

.lightbox-scene {
  color: #fffaf0;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, serif;
  font-size: clamp(1.6rem, 2.2vw, 2.3rem);
  line-height: 1.05;
}

.lightbox-meta {
  margin-top: 8px;
  color: rgba(255, 250, 240, 0.78);
  font-size: 0.98rem;
}

.lightbox-stage {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) 62px;
  gap: 14px;
  align-items: center;
}

.lightbox-figure {
  margin: 0;
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: rgba(255, 250, 239, 0.06);
  border: 1px solid rgba(255, 250, 239, 0.12);
}

.lightbox-figure img {
  width: 100%;
  max-height: calc(100vh - 120px);
  object-fit: contain;
  background: #11100d;
  transition: opacity 140ms ease, filter 140ms ease;
}

.lightbox-nav {
  width: 62px;
  height: 62px;
  border-radius: 999px;
  font-size: 2rem;
  line-height: 1;
}

@media (max-width: 1100px) {
  .legend {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .page-shell {
    width: min(100vw - 20px, 1360px);
    padding-top: 18px;
  }

  .hero-copy,
  .scene-card {
    border-radius: 22px;
  }

  .hero-copy {
    padding: 30px 26px 28px;
  }

  h1 {
    max-width: none;
    font-size: clamp(2.45rem, 10vw, 3.6rem);
  }

  .hero-text {
    max-width: none;
  }

  .hero-teaser {
    width: 100%;
    margin-top: 14px;
  }

  .lightbox-dialog {
    width: calc(100vw - 20px);
    margin: 10px auto;
    padding: 16px;
    border-radius: 22px;
  }

  .lightbox-header {
    padding-right: 48px;
  }

  .lightbox-stage {
    grid-template-columns: 1fr;
  }

  .lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
  }

  .lightbox-nav:hover {
    transform: translateY(-50%);
  }

  #lightbox-prev {
    left: 22px;
  }

  #lightbox-next {
    right: 22px;
  }

  .comparison-table {
    grid-template-columns: 1fr;
  }

  .table-corner {
    display: none;
  }

  .table-column,
  .table-row {
    justify-content: flex-start;
    padding-left: 16px;
  }

  .viz-tile {
    min-height: 220px;
  }

  .scene-card-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
