/* 微小巨兽 · 昆虫百科
   设计语言:暗夜雨林 / 自然纪录片,深绿底色 + 单一萤火绿点缀
   VARIANCE 7 / MOTION 5 / DENSITY 3 */

:root {
  --bg: #0b110d;
  --bg-raise: #121a14;
  --bg-card: #16211a;
  --line: #243528;
  --text: #e8efe6;
  --text-dim: #9db0a1;
  --text-faint: #6b7f6f;
  --accent: #a8d94e;
  --accent-deep: #6fa32c;
  --radius: 14px;
  --font-sans: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", Menlo, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

::selection { background: rgba(168, 217, 78, 0.25); }

/* ---------- 导航 ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 clamp(20px, 4vw, 56px);
  transition: background 0.35s ease, border-color 0.35s ease;
  border-bottom: 1px solid transparent;
}
.nav.is-solid {
  background: rgba(11, 17, 13, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}
.nav__brand {
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.06em;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.nav__brand-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.28em;
  color: var(--text-faint);
}
.nav__links { display: flex; gap: clamp(16px, 3vw, 36px); }
.nav__links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.25s ease;
}
.nav__links a:hover { color: var(--accent); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero__media { position: absolute; inset: 0; }
.hero__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero__scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(100deg, rgba(11, 17, 13, 0.92) 0%, rgba(11, 17, 13, 0.55) 46%, rgba(11, 17, 13, 0.15) 100%),
    linear-gradient(to top, var(--bg) 0%, transparent 26%);
}
.hero__content {
  position: relative;
  z-index: 1;
  padding: 0 clamp(20px, 6vw, 88px);
  max-width: 720px;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(52px, 9vw, 108px);
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.05;
}
.hero__sub {
  margin-top: 22px;
  font-size: clamp(15px, 1.6vw, 18px);
  color: var(--text-dim);
  max-width: 46ch;
}
.hero__actions { margin-top: 34px; display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 30px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.18s ease, background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.btn:active { transform: scale(0.97); }
.btn--primary { background: var(--accent); color: #131a09; }
.btn--primary:hover { background: #c2ec6d; }
.btn--ghost {
  color: var(--text);
  border: 1px solid rgba(232, 239, 230, 0.35);
  background: rgba(11, 17, 13, 0.35);
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- 通用区块 ---------- */
.section { padding: clamp(72px, 10vw, 130px) clamp(20px, 6vw, 88px); }
.section__title {
  font-size: clamp(30px, 4.4vw, 52px);
  font-weight: 800;
  letter-spacing: 0.02em;
  margin-bottom: clamp(32px, 4vw, 56px);
}

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- 引言 ---------- */
.intro { background: var(--bg-raise); border-block: 1px solid var(--line); }
.intro__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
}
.intro__lead {
  font-size: clamp(20px, 2.6vw, 30px);
  font-weight: 600;
  line-height: 1.55;
}
.intro__body { color: var(--text-dim); font-size: 15px; max-width: 52ch; }

/* ---------- 图鉴 ---------- */
.gallery__grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(16px, 2.4vw, 28px);
}
.card {
  grid-column: span 4;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
  padding: 0;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.35s ease;
}
.card:nth-child(6n + 1),
.card:nth-child(6n + 4) { grid-column: span 5; }
.card:nth-child(6n + 2),
.card:nth-child(6n + 5) { grid-column: span 4; }
.card:nth-child(6n + 3),
.card:nth-child(6n + 6) { grid-column: span 3; }
.card:hover { transform: translateY(-6px); border-color: var(--accent-deep); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.card__media { aspect-ratio: 3 / 2; overflow: hidden; }
.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.card:hover .card__media img { transform: scale(1.05); }
.card__body { padding: 18px 20px 22px; }
.card__latin {
  font-family: var(--font-mono);
  font-size: 11px;
  font-style: italic;
  color: var(--text-faint);
  letter-spacing: 0.04em;
}
.card__name {
  margin-top: 6px;
  font-size: 20px;
  font-weight: 700;
}
.card__tagline { margin-top: 8px; font-size: 13.5px; color: var(--text-dim); }

/* ---------- 影像 ---------- */
.film { background: var(--bg-raise); border-block: 1px solid var(--line); }
.film__layout {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
}
.film__video-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #050806;
}
.film__video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.film__copy h2 {
  font-size: clamp(26px, 3.4vw, 42px);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 18px;
}
.film__copy > p { color: var(--text-dim); font-size: 15px; }
.film__meta { margin-top: 28px; display: grid; gap: 0; }
.film__meta > div {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.film__meta dt { color: var(--text-faint); font-size: 13px; white-space: nowrap; }
.film__meta dd { font-size: 14px; text-align: right; }

/* ---------- 野趣笔记 ---------- */
.notes__grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: clamp(16px, 2.4vw, 28px);
}
.note {
  grid-column: span 2;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(22px, 3vw, 34px);
}
.note--wide { grid-column: span 3; }
.note__num {
  display: block;
  font-family: var(--font-mono);
  font-size: clamp(30px, 3.6vw, 46px);
  font-weight: 700;
  color: var(--accent);
  line-height: 1.1;
  margin-bottom: 14px;
}
.note p { font-size: 14px; color: var(--text-dim); }

/* ---------- 页脚 ---------- */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  padding: 48px clamp(20px, 6vw, 88px);
  border-top: 1px solid var(--line);
}
.footer__brand { font-weight: 700; letter-spacing: 0.05em; }
.footer__line { margin-top: 8px; font-size: 12.5px; color: var(--text-faint); }
.footer__top { color: var(--text-dim); font-size: 14px; text-decoration: none; white-space: nowrap; }
.footer__top:hover { color: var(--accent); }

/* ---------- 弹层 ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 6, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.modal__panel {
  position: relative;
  width: min(880px, 100%);
  max-height: min(86dvh, 720px);
  overflow: auto;
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}
.modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(11, 17, 13, 0.7);
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.modal__close:hover { color: var(--accent); border-color: var(--accent); }
.modal__media img { width: 100%; height: 100%; object-fit: cover; min-height: 320px; }
.modal__body { padding: clamp(24px, 3.4vw, 44px); }
.modal__latin {
  font-family: var(--font-mono);
  font-size: 12px;
  font-style: italic;
  color: var(--accent);
  letter-spacing: 0.04em;
}
.modal__body h3 { margin-top: 10px; font-size: 28px; font-weight: 800; }
.modal__body > p { margin-top: 16px; font-size: 14.5px; color: var(--text-dim); }
.modal__facts { margin-top: 24px; }
.modal__facts > div { padding: 11px 0; border-top: 1px solid var(--line); }
.modal__facts dt { font-size: 12px; color: var(--text-faint); margin-bottom: 3px; }
.modal__facts dd { font-size: 14px; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .intro__grid,
  .film__layout { grid-template-columns: 1fr; }
  .card, .card:nth-child(n) { grid-column: span 6; }
  .note, .note--wide { grid-column: span 3; }
  .modal__panel { grid-template-columns: 1fr; }
  .modal__media img { min-height: 0; max-height: 300px; }
}
@media (max-width: 600px) {
  .nav__brand-sub { display: none; }
  .card, .card:nth-child(n) { grid-column: span 12; }
  .note, .note--wide { grid-column: span 6; }
  .footer { flex-direction: column; align-items: flex-start; }
}

/* ---------- 动效降级 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .card, .card__media img, .btn { transition: none; }
}
