:root {
  --bg: #fbfcfa;
  --paper: #ffffff;
  --ink: #18211f;
  --muted: #5d6964;
  --line: #dce6df;
  --soft: #eef4ef;
  --green: #1f7a55;
  --green-dark: #145b41;
  --blue: #39758f;
  --coral: #d9644a;
  --shadow: 0 18px 50px rgba(25, 41, 34, 0.1);
  --radius: 8px;
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(251, 252, 250, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.nav {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 760;
  white-space: nowrap;
}

.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--green);
  color: var(--green);
  border-radius: 50%;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.nav-links a {
  padding: 9px 11px;
  color: var(--muted);
  border-radius: 6px;
  font-size: 0.92rem;
  font-weight: 650;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--green-dark);
  background: var(--soft);
}

.page {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  min-height: 590px;
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(420px, 1.25fr);
  gap: 36px;
  align-items: center;
  padding: 54px 0 34px;
}

.home-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: clamp(540px, calc(100vh - 160px), 690px);
  margin: 32px 0 28px;
  padding: 54px 56px;
  overflow: hidden;
  border-radius: var(--radius);
  background: #0d1815;
  color: #fff;
  box-shadow: var(--shadow);
}

.home-hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(9, 19, 17, 0.9) 0%, rgba(9, 19, 17, 0.72) 36%, rgba(9, 19, 17, 0.22) 68%, rgba(9, 19, 17, 0.08) 100%),
    linear-gradient(0deg, rgba(9, 19, 17, 0.6) 0%, rgba(9, 19, 17, 0.08) 58%);
}

.home-hero-content {
  position: relative;
  z-index: 1;
  max-width: 740px;
}

.hero h1,
.detail-hero h1,
.page-title h1,
.section-head h2 {
  margin: 0;
  line-height: 1;
  letter-spacing: 0;
}

.hero h1 {
  font-size: clamp(2.4rem, 5vw, 5.2rem);
}

.home-hero h1 {
  max-width: 740px;
  color: #fff;
  font-size: 4.35rem;
}

.hero p,
.page-title p,
.section-head p,
.detail-hero p,
.card p {
  color: var(--muted);
}

.home-hero p {
  max-width: 670px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.14rem;
  line-height: 1.55;
}

.hero-actions,
.button-row {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.9rem;
}

.button.primary {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.home-hero .button {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.48);
  color: #fff;
  backdrop-filter: blur(8px);
}

.home-hero .button.primary {
  background: #f0c431;
  border-color: #f0c431;
  color: #13211c;
}

.hero-media,
.detail-media {
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--soft);
  box-shadow: var(--shadow);
}

.hero-media img {
  width: 100%;
  height: 100%;
  min-height: 440px;
  object-fit: cover;
}

.hero-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 0 0 46px;
}

.stat,
.card,
.connection-item,
.layer-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.stat {
  padding: 18px;
}

.stat strong {
  display: block;
  font-size: 1.72rem;
  line-height: 1;
}

.stat span,
.meta {
  color: var(--muted);
  font-size: 0.82rem;
}

.section {
  padding: 50px 0;
  border-top: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.section-head h2,
.page-title h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
}

.page-title {
  padding: 52px 0 30px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px) minmax(160px, 220px);
  gap: 12px;
  margin: 0 0 22px;
}

.toolbar input,
.toolbar select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  color: var(--ink);
  padding: 0 13px;
  font: inherit;
  font-size: 0.94rem;
}

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

.grid.system-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card {
  overflow: hidden;
  min-width: 0;
}

.thumb {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  background: var(--soft);
  overflow: hidden;
  color: #fff;
}

.thumb img,
.detail-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb.thumb-contain img {
  object-fit: contain;
  background: #101a17;
}

.labelled-thumb::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 62%;
  background: linear-gradient(180deg, rgba(8, 17, 14, 0), rgba(8, 17, 14, 0.86));
  pointer-events: none;
}

.thumb-label {
  position: absolute;
  z-index: 2;
  left: 10px;
  right: 10px;
  bottom: 10px;
  display: grid;
  gap: 2px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}

.thumb-label strong,
.thumb-label span {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
}

.thumb-label strong {
  -webkit-line-clamp: 2;
  color: #fff;
  font-size: 0.88rem;
  line-height: 1.15;
  font-weight: 800;
}

.thumb-label span {
  -webkit-line-clamp: 1;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.72rem;
  line-height: 1.25;
}

.card-body {
  padding: 14px;
}

.card-actions,
.caption-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 12px;
  margin-top: 12px;
  font-size: 0.82rem;
  font-weight: 760;
}

.card-actions a,
.caption-actions a {
  color: var(--green-dark);
  text-decoration: none;
}

.card-actions a:hover,
.caption-actions a:hover {
  text-decoration: underline;
}

.card h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--green-dark);
  font-weight: 680;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

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

.image-card .thumb {
  aspect-ratio: 1 / 1;
}

.image-card figcaption {
  padding: 10px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.image-card figcaption span {
  display: block;
  overflow-wrap: anywhere;
}

.image-card figcaption .caption-actions {
  display: flex;
}

.image-card figcaption a {
  color: var(--green-dark);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.image-card strong {
  display: block;
  color: var(--ink);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.image-card .thumb-label strong {
  display: -webkit-box;
  color: #fff;
  font-size: 0.82rem;
  line-height: 1.15;
}

.image-card .thumb-label span {
  display: -webkit-box;
}

.layer-list,
.connection-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.layer-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  padding: 14px;
}

.layer-card img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--soft);
}

.layer-card .thumb {
  width: 120px;
  height: 120px;
  aspect-ratio: auto;
  border-radius: 6px;
}

.layer-card .thumb-label {
  left: 8px;
  right: 8px;
  bottom: 8px;
}

.layer-card .thumb-label strong {
  font-size: 0.74rem;
}

.layer-card .thumb-label span {
  display: none;
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(420px, 1.08fr);
  gap: 32px;
  align-items: center;
  padding: 48px 0 34px;
}

.detail-hero h1 {
  font-size: clamp(2.2rem, 4.4vw, 4.4rem);
}

.detail-media {
  aspect-ratio: 16 / 10;
}

.info-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.info-table th,
.info-table td {
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  font-size: 0.92rem;
}

.info-table th {
  width: 180px;
  color: var(--muted);
}

.connection-item {
  padding: 16px;
}

.connection-item.card-link {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.connection-item.card-link:hover,
.connection-item.card-link:focus-visible {
  border-color: rgba(31, 128, 88, 0.42);
  box-shadow: 0 12px 28px rgba(25, 41, 34, 0.1);
  transform: translateY(-1px);
  outline: none;
}

.connection-item.card-link p {
  margin-bottom: 0;
}

.bridge-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.bridge-card {
  display: grid;
  grid-template-columns: minmax(150px, 0.42fr) minmax(0, 1fr);
  min-width: 0;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 36px rgba(25, 41, 34, 0.07);
}

.bridge-media {
  display: grid;
  min-height: 100%;
  background: var(--soft);
}

.bridge-media img {
  width: 100%;
  height: 100%;
  min-height: 92px;
  object-fit: cover;
  border-bottom: 1px solid rgba(255, 255, 255, 0.36);
}

.bridge-body {
  padding: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--coral);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.bridge-body h3,
.field-clue-card h3 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.25;
}

.bridge-body p,
.field-clue-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.system-chip-list,
.map-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.system-chip,
.map-chip-list span {
  min-width: 0;
  max-width: 100%;
  border-radius: 7px;
  background: var(--soft);
  color: var(--ink);
}

.system-chip {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--line);
}

.system-chip span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
}

.system-chip strong {
  color: var(--green-dark);
  font-size: 0.82rem;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

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

.field-clue-card {
  min-width: 0;
  padding: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.map-chip-list span {
  padding: 6px 8px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.pager-nav {
  width: min(var(--max), calc(100% - 32px));
  margin: 34px auto 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.pager-inner {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.pager-link,
.pager-index {
  display: flex;
  min-width: 0;
  min-height: 56px;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 8px 20px rgba(25, 41, 34, 0.05);
}

.pager-link.next {
  text-align: right;
  align-items: flex-end;
}

.pager-index {
  align-items: center;
  text-align: center;
}

.pager-link span,
.pager-index span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

.pager-link strong,
.pager-index strong {
  display: -webkit-box;
  overflow: hidden;
  color: var(--green-dark);
  font-size: 0.92rem;
  line-height: 1.24;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow-wrap: anywhere;
}

.pager-spacer {
  min-height: 1px;
}

.footer {
  margin-top: 60px;
  border-top: 1px solid var(--line);
  padding: 30px 0 50px;
  color: var(--muted);
}

.footer-inner {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer a {
  color: var(--green-dark);
  font-weight: 700;
}

.back-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--green-dark);
  box-shadow: 0 10px 24px rgba(25, 41, 34, 0.14);
  cursor: pointer;
  font-size: 1.1rem;
}

.hidden {
  display: none !important;
}

@media (max-width: 980px) {
  .hero,
  .detail-hero {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .home-hero {
    min-height: 560px;
    padding: 38px;
  }

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

  .hero-strip,
  .grid.system-grid,
  .grid,
  .image-grid,
  .layer-list,
  .connection-list,
  .bridge-grid,
  .field-clue-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toolbar {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 680px) {
  .nav {
    min-height: auto;
    padding: 14px 0;
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    justify-content: flex-start;
  }

  .hero h1,
  .detail-hero h1,
  .page-title h1 {
    font-size: 2.35rem;
  }

  .home-hero {
    min-height: 540px;
    margin-top: 16px;
    padding: 26px 20px;
  }

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

  .home-hero p {
    font-size: 1rem;
  }

  .home-hero::after {
    background:
      linear-gradient(90deg, rgba(9, 19, 17, 0.92) 0%, rgba(9, 19, 17, 0.78) 56%, rgba(9, 19, 17, 0.38) 100%),
      linear-gradient(0deg, rgba(9, 19, 17, 0.68) 0%, rgba(9, 19, 17, 0.12) 62%);
  }

  .hero-media img {
    min-height: 300px;
  }

  .hero-strip,
  .grid.system-grid,
  .grid,
  .image-grid,
  .layer-list,
  .connection-list,
  .bridge-grid,
  .field-clue-grid,
  .layer-card {
    grid-template-columns: 1fr;
  }

  .bridge-card {
    grid-template-columns: 1fr;
  }

  .bridge-media {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .bridge-media img {
    aspect-ratio: 4 / 3;
  }

  .layer-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .layer-card .thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .pager-inner {
    grid-template-columns: 1fr;
  }

  .pager-link.next,
  .pager-index {
    align-items: flex-start;
    text-align: left;
  }

  .pager-spacer {
    display: none;
  }
}
