:root {
  color-scheme: light;
  --ink: #18201b;
  --muted: #657168;
  --paper: #fbfaf6;
  --surface: #ffffff;
  --line: #dce3da;
  --leaf: #2d6a4f;
  --moss: #7a8b3a;
  --water: #2f6f8f;
  --sun: #d89b34;
  --shadow: 0 18px 50px rgba(24, 32, 27, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Hiragino Sans", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  line-height: 1.7;
}

a {
  color: inherit;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(18px, 4vw, 56px);
  background: rgba(251, 250, 246, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  width: 18px;
  height: 18px;
  border: 2px solid var(--leaf);
  border-radius: 50% 50% 44% 44%;
  background: linear-gradient(135deg, var(--leaf), var(--moss));
}

nav {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: 0.94rem;
}

nav a {
  text-decoration: none;
}

main {
  min-height: 72vh;
}

.hero {
  position: relative;
  overflow: hidden;
  display: block;
  min-height: 58vh;
  padding: clamp(64px, 9vw, 120px) clamp(18px, 5vw, 72px) clamp(42px, 6vw, 78px);
  background:
    linear-gradient(90deg, rgba(10, 18, 14, 0.52), rgba(10, 18, 14, 0.2) 48%, rgba(10, 18, 14, 0.06)),
    linear-gradient(0deg, rgba(10, 18, 14, 0.28), rgba(10, 18, 14, 0.02) 50%),
    url("/images/site/hero-insects.png") center / cover no-repeat;
  border-bottom: 1px solid var(--line);
}

.hero-copy,
.hero-panel {
  position: absolute;
  z-index: 1;
}

.hero-copy {
  left: clamp(18px, 5vw, 72px);
  right: clamp(18px, 5vw, 72px);
  bottom: clamp(42px, 6vw, 78px);
  max-width: 900px;
}

.hero h1,
.page-title h1 {
  margin: 0;
  font-size: clamp(2.6rem, 8vw, 6.8rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero p {
  max-width: 820px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.08rem;
  text-wrap: pretty;
}

.hero h1 {
  color: #ffffff;
  font-size: clamp(2.7rem, 6.7vw, 5.8rem);
  text-shadow: 0 3px 28px rgba(0, 0, 0, 0.42);
}

.hero .eyebrow {
  color: rgba(255, 255, 255, 0.78);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--water);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-panel {
  top: clamp(22px, 4vw, 42px);
  right: clamp(18px, 5vw, 72px);
  width: min(100%, 220px);
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(24, 32, 27, 0.16);
  backdrop-filter: blur(14px);
}

.hero-panel span {
  display: block;
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1;
}

.hero-panel small {
  color: var(--muted);
}

.section,
.page-title,
.text-section {
  padding: clamp(36px, 6vw, 72px) clamp(18px, 5vw, 72px);
}

.page-title {
  max-width: 980px;
}

.page-title p:not(.eyebrow) {
  max-width: 680px;
  color: var(--muted);
}

.narrow {
  max-width: 760px;
}

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

.section-heading h2,
.text-section h2 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
}

.section-heading a {
  color: var(--leaf);
  font-weight: 700;
}

.observation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}

.observation-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.observation-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.observation-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #edf0e8;
}

.card-body {
  display: grid;
  gap: 4px;
  padding: 14px;
}

.card-title {
  font-weight: 800;
}

.card-meta,
.card-note {
  color: var(--muted);
  font-size: 0.9rem;
}

.pill-list,
.tag-row,
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.finder-groups {
  display: grid;
  gap: 22px;
}

.finder-groups h3 {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.98rem;
}

.pill-list a,
.tag-row a,
.tag-cloud a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--leaf);
  font-weight: 700;
  text-decoration: none;
}

.tag-cloud small {
  color: var(--muted);
}

.list-panel {
  display: grid;
  gap: 10px;
  padding: 0 clamp(18px, 5vw, 72px) clamp(48px, 6vw, 80px);
  max-width: 780px;
}

.directory-block {
  max-width: 780px;
  padding: 0 clamp(18px, 5vw, 72px) 34px;
}

.directory-block h2 {
  margin: 0 0 12px;
  font-size: 1.35rem;
}

.directory-block .list-panel {
  padding: 0;
  max-width: none;
}

.list-panel a {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
}

.list-panel span {
  font-weight: 800;
}

.list-panel small {
  color: var(--muted);
}

.detail {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: clamp(24px, 5vw, 64px);
  padding: clamp(18px, 5vw, 72px) clamp(18px, 5vw, 72px) clamp(28px, 5vw, 56px);
}

.detail-image {
  margin: 0;
}

.detail-image img {
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
  background: #eef1ea;
  border-radius: 8px;
}

.detail-body {
  align-self: start;
  position: sticky;
  top: 92px;
}

.detail-body h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.08;
}

.scientific {
  color: var(--muted);
}

.facts {
  display: grid;
  gap: 10px;
  margin: 28px 0;
}

.facts div {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.facts dt {
  color: var(--muted);
}

.facts dd {
  margin: 0;
  font-weight: 700;
}

.top-photo-nav {
  position: sticky;
  top: 58px;
  z-index: 9;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  padding: 10px clamp(18px, 5vw, 72px);
  background: rgba(251, 250, 246, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.top-photo-nav-link,
.top-photo-nav-index {
  min-height: 44px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
}

.top-photo-nav-link {
  display: grid;
  gap: 1px;
  width: 220px;
}

.top-photo-nav-link span {
  color: var(--muted);
  font-size: 0.78rem;
}

.top-photo-nav-link strong {
  overflow: hidden;
  font-size: 0.94rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-photo-nav-link.next {
  text-align: right;
}

.top-photo-nav-index {
  display: inline-grid;
  place-items: center;
  color: var(--leaf);
  font-weight: 800;
  white-space: nowrap;
  width: 120px;
}

.top-photo-nav-placeholder {
  width: 220px;
  min-height: 44px;
}

.empty-state {
  display: grid;
  justify-items: start;
  gap: 12px;
  padding: clamp(24px, 5vw, 46px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.empty-state h2,
.empty-state p {
  margin: 0;
}

.empty-state p {
  color: var(--muted);
}

.empty-visual {
  width: min(100%, 520px);
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background:
    linear-gradient(140deg, rgba(45, 106, 79, 0.28), rgba(47, 111, 143, 0.12)),
    repeating-linear-gradient(90deg, transparent 0 28px, rgba(24, 32, 27, 0.06) 28px 29px);
}

.text-section {
  max-width: 780px;
}

.text-section p {
  color: var(--muted);
}

.site-footer {
  padding: 28px clamp(18px, 5vw, 72px);
  color: var(--muted);
  border-top: 1px solid var(--line);
}

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

  .site-header {
    align-items: flex-start;
  }

  nav {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .detail-body {
    position: static;
  }

}

@media (max-width: 560px) {
  .site-header {
    position: static;
  }

  .section-heading,
  .facts div {
    grid-template-columns: 1fr;
  }

  .top-photo-nav {
    top: 0;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .top-photo-nav-index {
    display: none;
  }
}
