/* Birds Remain — single-page, scan-first. Inspired by henryridelogic.com rhythm. */

:root {
  --bg: #191d1c;
  --bg-2: #121615;
  --paper: #efece4;
  --paper-2: #e4e0d6;
  --ink: #141413;
  --text: #e7e2da;
  --muted: #9e9890;
  --dim: #6f6a63;
  --line: rgba(255, 255, 255, 0.12);
  --line-dark: rgba(16, 16, 16, 0.14);
  --accent: #c9a85c;
  --font-en: "Courier New", Courier, monospace;
  --font-zh: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --pad: clamp(18px, 4vw, 48px);
  --max: 1120px;
  --top: 58px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--top) + 12px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-en);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

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

button {
  font: inherit;
  cursor: pointer;
}

/* —— Top bar —— */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--top);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 0 var(--pad);
  border-bottom: 1px solid var(--line);
  background: rgba(18, 22, 21, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 1.1;
  min-width: 0;
}

.brand-zh {
  font-family: var(--font-zh);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.brand-en {
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.jump {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.jump a {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.jump a:hover,
.jump a:focus-visible,
.jump a.active {
  color: var(--text);
  border-color: var(--accent);
  outline: none;
}

.lang {
  display: flex;
  gap: 6px;
}

.lang button {
  min-width: 44px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.lang button.active {
  color: var(--text);
  border-color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

/* —— Hero —— */
.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(28px, 5vw, 56px) var(--pad) clamp(36px, 6vw, 64px);
  min-height: calc(100svh - var(--top));
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.h-zh {
  font-family: var(--font-zh);
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0.06em;
}

.h-en {
  font-size: clamp(1.1rem, 2.4vw, 1.55rem);
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.lede {
  margin: 18px 0 0;
  max-width: 38ch;
  color: var(--muted);
  font-family: var(--font-zh);
  font-size: 0.98rem;
  line-height: 1.75;
}

html[lang="en"] .lede,
html[lang="en"] .prose p,
html[lang="en"] .sub,
html[lang="en"] .brand-zh,
html[lang="en"] .h-zh {
  font-family: var(--font-en);
}

.meta-row {
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  max-width: 420px;
}

.meta-row li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 0.92rem;
  font-weight: 700;
}

.meta-row span {
  color: var(--dim);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 28px;
}

.link-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid currentColor;
  padding-bottom: 3px;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text);
}

.link-action::after {
  content: "->";
  color: var(--accent);
}

.link-action.dim {
  color: var(--muted);
}

.block.paper .link-action {
  color: #1a1814;
  border-bottom-color: #1a1814;
}

.block.paper .link-action::after {
  color: #7a5c1e;
}

.block.paper .link-action:hover,
.block.paper .link-action:focus-visible {
  color: #0d0c0a;
  border-bottom-color: #7a5c1e;
  outline: none;
}

.hero-media {
  margin: 0;
  position: relative;
}

.hero-media img {
  width: 100%;
  height: auto;
  aspect-ratio: 1100 / 1053;
  object-fit: cover;
  background: #0e1110;
  filter: saturate(0.92) contrast(1.02);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
}

/* —— Sections —— */
.block {
  padding: clamp(40px, 7vw, 72px) var(--pad);
  border-top: 1px solid var(--line);
}

.block.paper {
  background: var(--paper);
  color: var(--ink);
  border-top-color: var(--line-dark);
}

.block.dark {
  background: var(--bg);
  color: var(--text);
}

.block-head {
  max-width: var(--max);
  margin: 0 auto 28px;
}

.caption {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.block.paper .caption {
  color: #8a6d2f;
}

.block-head h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3.5vw, 2.6rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.sub {
  margin: 10px 0 0;
  color: var(--muted);
  font-family: var(--font-zh);
  font-size: 0.95rem;
}

.block.paper .sub {
  color: #5f5a53;
}

.block-grid {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: clamp(20px, 4vw, 48px);
  align-items: start;
}

.block-grid.media-first {
  grid-template-columns: 1.25fr 0.85fr;
}

#ebirds .block-grid.media-first {
  grid-template-columns: minmax(0, 2.4fr) minmax(220px, 0.7fr);
  gap: clamp(16px, 3vw, 28px);
}

#ebirds .app-frame-shell {
  min-height: 560px;
}

#ebirds .app-frame {
  height: min(82vh, 820px);
}

.prose {
  font-family: var(--font-zh);
  font-size: 0.98rem;
  line-height: 1.8;
  overflow: visible;
}

.prose p {
  margin: 0;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  display: block;
  -webkit-line-clamp: unset;
}

.prose.narrow {
  max-width: var(--max);
  margin: 0 auto 28px;
}

.block.dark .prose.narrow {
  color: var(--muted);
}

.block.paper .video-shell video {
  border-color: var(--line-dark);
}


.block.paper .prose {
  color: #3a3630;
}

.facts {
  margin: 28px 0 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
}

.facts div {
  padding-top: 10px;
  border-top: 1px solid var(--line-dark);
}

.facts dt {
  margin: 0;
  color: #8a8378;
  font-family: var(--font-en);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.facts dd {
  margin: 4px 0 0;
  font-family: var(--font-zh);
  font-size: 0.92rem;
  font-weight: 650;
  color: var(--ink);
}

.side-art {
  margin: 0;
}

.side-art img {
  width: 100%;
  height: auto;
  background: #fff;
  border: 1px solid var(--line-dark);
}

/* samples strip */
.samples-wrap {
  max-width: var(--max);
  margin: 36px auto 0;
}

.samples-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
  font-family: var(--font-en);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5f5a53;
}

.samples-label .hint {
  color: #9a948a;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}

.book-pages-wrap {
  max-width: var(--max);
  margin: 36px auto 0;
}

.book-pages {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.book-pages figure {
  margin: 0;
  position: relative;
  cursor: zoom-in;
  background: #fff;
  border: 1px solid var(--line-dark);
}

.book-pages img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  background: #f7f4ee;
  display: block;
}

.book-pages .page-no {
  position: absolute;
  left: 8px;
  top: 8px;
  padding: 2px 7px;
  background: rgba(20, 20, 19, 0.78);
  color: #f2eee6;
  font-family: var(--font-en);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.block.dark .book-pages-wrap .samples-label,
.block.dark .samples-label {
  color: var(--muted);
}

/* video */
.video-shell video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0a0c0b;
  border: 1px solid var(--line);
  object-fit: contain;
}

.app-frame-shell {
  width: 100%;
  border: 1px solid var(--line-dark);
  background: #0f1a16;
  overflow: hidden;
  min-height: 480px;
}

.app-frame {
  display: block;
  width: 100%;
  height: min(78vh, 720px);
  border: 0;
  background: #fff;
}

.block.paper .app-frame-shell {
  border-color: var(--line-dark);
}

/* bottom jump links inside each section */
.block-jump {
  max-width: var(--max);
  margin: clamp(36px, 6vw, 64px) auto 0;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  align-items: center;
}

.block.paper .block-jump {
  border-top-color: var(--line-dark);
}

.block-jump-label {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  margin-right: 4px;
}

.block.paper .block-jump-label {
  color: #8a8478;
}

.block-jump a {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.block.paper .block-jump a {
  color: #6a655c;
}

.block-jump a:hover,
.block-jump a:focus-visible {
  color: var(--text);
  border-color: var(--accent);
  outline: none;
}

.block.paper .block-jump a:hover,
.block.paper .block-jump a:focus-visible {
  color: var(--ink);
}

.block-jump a.current {
  color: var(--accent);
  border-color: var(--accent);
  pointer-events: none;
}

/* gallery */
.gallery {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.gallery figure {
  margin: 0;
  position: relative;
  overflow: hidden;
  background: #d8d3c8;
  cursor: zoom-in;
  aspect-ratio: 1 / 1;
}

.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.gallery figure:hover img {
  transform: scale(1.04);
}

.gallery figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 28px 10px 8px;
  background: linear-gradient(transparent, rgba(10, 12, 11, 0.78));
  color: #f2eee6;
  font-family: var(--font-en);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.02em;
}

.gallery .zh-name {
  display: block;
  font-family: var(--font-zh);
  font-size: 0.72rem;
  opacity: 0.9;
}

/* footer */
.site-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 22px var(--pad) 28px;
  border-top: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--muted);
  font-size: 0.78rem;
}

.site-foot strong {
  color: var(--text);
  margin-right: 10px;
}

.foot-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

/* lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(8, 10, 9, 0.92);
}

.lightbox[hidden] {
  display: none;
}

.lightbox img {
  max-width: min(920px, 92vw);
  max-height: 78vh;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.lb-close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 1.6rem;
  line-height: 1;
}

/* motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .samples img,
  .gallery img {
    transition: none;
  }
}

/* responsive */
@media (max-width: 900px) {
  .hero,
  .block-grid,
  .block-grid.media-first,
  #ebirds .block-grid.media-first {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: unset;
    padding-top: 28px;
  }

  .hero-media {
    order: -1;
    max-width: 420px;
  }

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

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

  .topbar {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    height: auto;
    padding: 10px var(--pad);
    gap: 8px 12px;
  }

  .brand {
    grid-column: 1;
    grid-row: 1;
  }

  .lang {
    grid-column: 2;
    grid-row: 1;
  }

  .jump {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 14px;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }

  .jump a {
    font-size: 0.68rem;
  }
}

@media (max-width: 560px) {
  .gallery,
  .book-pages {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .meta-row {
    grid-template-columns: 1fr 1fr;
  }
}
