:root {
  --paper: #f6efe3;
  --paper-deep: #eadcc7;
  --ink: #2b251f;
  --ink-soft: #6e6254;
  --seal: #9d2d21;
  --seal-dark: #6f2018;
  --jade: #245b51;
  --moss: #6f7b5d;
  --gold: #b98c46;
  --line: rgba(68, 48, 34, 0.16);
  --shadow: 0 18px 48px rgba(46, 32, 21, 0.16);
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "SimSun", serif;
  --kai: "Kaiti SC", "STKaiti", "KaiTi", var(--serif);
  --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  letter-spacing: 0;
  background:
    linear-gradient(90deg, rgba(126, 91, 47, 0.04) 1px, transparent 1px),
    linear-gradient(var(--paper), #f9f4ea 46%, #efe1cb);
  background-size: 34px 34px, auto;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.38;
  background-image:
    linear-gradient(rgba(67, 48, 34, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(67, 48, 34, 0.025) 1px, transparent 1px);
  background-size: 100% 8px, 9px 100%;
  mix-blend-mode: multiply;
  z-index: -1;
}

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

button {
  color: inherit;
  font: inherit;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  min-height: 72px;
  padding: 0 42px;
  border-bottom: 1px solid rgba(81, 56, 34, 0.14);
  background: rgba(249, 242, 230, 0.9);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 700;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 2px solid var(--seal);
  border-radius: 50%;
  color: #fff6e8;
  background: var(--seal);
  font-family: var(--kai);
  font-size: 1.15rem;
  line-height: 1;
}

.site-nav {
  display: flex;
  justify-content: center;
  gap: 34px;
  min-width: 0;
  font-family: var(--serif);
  font-size: 0.96rem;
}

.site-nav a {
  position: relative;
  padding: 26px 0 23px;
  color: #47382e;
  white-space: nowrap;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 15px;
  height: 2px;
  transform: scaleX(0);
  transform-origin: center;
  background: var(--seal);
  transition: transform 180ms ease;
}

.site-nav a:hover::after,
.site-nav a.is-active::after {
  transform: scaleX(1);
}

.enter-link,
.primary-action,
.secondary-action,
.outline-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 20px;
  border: 1px solid var(--seal);
  border-radius: 4px;
  font-family: var(--serif);
  white-space: nowrap;
}

.enter-link,
.primary-action {
  color: #fff8eb;
  background: var(--seal);
  box-shadow: 0 10px 24px rgba(157, 45, 33, 0.18);
}

.secondary-action,
.outline-action {
  color: var(--seal-dark);
  background: rgba(255, 248, 235, 0.7);
}

.hero {
  position: relative;
  min-height: 630px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  isolation: isolate;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-image: url("assets/hero-lotus.jpg");
  background-position: right center;
  background-size: cover;
  opacity: 0.42;
  filter: saturate(0.78) sepia(0.12);
  z-index: -3;
}

.hero-wash {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(250, 243, 231, 0.98) 0%, rgba(250, 243, 231, 0.88) 42%, rgba(250, 243, 231, 0.35) 68%, rgba(250, 243, 231, 0.12) 100%),
    linear-gradient(180deg, rgba(250, 243, 231, 0.08), rgba(96, 72, 50, 0.1));
  z-index: -2;
}

.hero-content {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding-top: 116px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  color: var(--seal);
  font-family: var(--serif);
  font-size: 0.95rem;
}

.eyebrow span {
  width: 34px;
  height: 2px;
  background: var(--gold);
}

.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 4.5rem;
  line-height: 1.05;
  font-weight: 700;
}

.hero-line {
  margin: 18px 0 0;
  font-family: var(--kai);
  font-size: 2.65rem;
  line-height: 1.18;
  color: var(--ink);
}

.hero-copy {
  width: min(650px, 100%);
  margin: 24px 0 0;
  color: #514337;
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.9;
}

.hero-actions {
  display: flex;
  gap: 14px;
  margin-top: 34px;
}

.hero-stats {
  position: absolute;
  left: 50%;
  bottom: 36px;
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr));
  width: min(540px, calc(100% - 48px));
  transform: translateX(-50%);
  border: 1px solid rgba(104, 75, 44, 0.24);
  background: rgba(255, 250, 241, 0.78);
  box-shadow: var(--shadow);
}

.hero-stats div {
  padding: 18px 20px;
  text-align: center;
}

.hero-stats div + div {
  border-left: 1px solid rgba(104, 75, 44, 0.18);
}

.hero-stats strong {
  display: block;
  color: var(--seal);
  font-family: var(--serif);
  font-size: 2rem;
  line-height: 1;
}

.hero-stats span {
  display: block;
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.category-band {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  width: min(1120px, calc(100% - 48px));
  margin: -28px auto 74px;
  border: 1px solid rgba(104, 75, 44, 0.18);
  background: rgba(255, 250, 241, 0.94);
  box-shadow: var(--shadow);
}

.category-card {
  display: grid;
  grid-template-columns: 86px 1fr;
  grid-template-rows: auto auto;
  column-gap: 16px;
  align-items: center;
  min-height: 128px;
  padding: 20px;
  border-right: 1px solid rgba(104, 75, 44, 0.14);
}

.category-card:last-child {
  border-right: 0;
}

.category-card img {
  grid-row: 1 / 3;
  width: 86px;
  aspect-ratio: 1.25;
  object-fit: cover;
  border-radius: 4px;
}

.category-card span {
  align-self: end;
  font-family: var(--serif);
  font-size: 1.32rem;
  font-weight: 700;
}

.category-card small {
  align-self: start;
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.5;
}

.section-wrap,
.poster-section {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto 82px;
}

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

.section-heading.compact {
  align-items: center;
}

.section-heading h2,
.feature-copy h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 2.45rem;
  line-height: 1.15;
}

.section-heading p:not(.eyebrow),
.feature-copy p:not(.eyebrow) {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 1rem;
}

.rail-controls {
  display: flex;
  gap: 10px;
}

.rail-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(68, 48, 34, 0.2);
  border-radius: 50%;
  color: var(--paper);
  background: #594137;
  cursor: pointer;
}

.art-rail {
  display: grid;
  grid-auto-columns: minmax(210px, 1fr);
  grid-auto-flow: column;
  gap: 18px;
  overflow-x: auto;
  padding: 2px 2px 18px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.art-card,
.letter-card,
.browse-card {
  border: 1px solid rgba(104, 75, 44, 0.16);
  border-radius: 6px;
  background: rgba(255, 250, 241, 0.74);
  box-shadow: 0 10px 26px rgba(64, 42, 26, 0.08);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.art-card:hover,
.letter-card:hover,
.browse-card:hover,
.poster-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 34px rgba(64, 42, 26, 0.15);
}

.art-card {
  min-width: 210px;
  padding: 14px;
  scroll-snap-align: start;
}

.art-card img {
  width: 100%;
  aspect-ratio: 0.78;
  object-fit: cover;
  object-position: top center;
  border-radius: 4px;
  background: #f5efe3;
}

.art-card h3,
.letter-card h3,
.browse-card h3 {
  margin: 14px 0 7px;
  font-family: var(--serif);
  font-size: 1.08rem;
  line-height: 1.35;
}

.art-card p,
.art-card small,
.letter-card p,
.browse-card p {
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.55;
}

.art-card p,
.letter-card p,
.browse-card p {
  margin: 0;
}

.feature-panel {
  display: grid;
  grid-template-columns: 0.42fr 0.58fr;
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto 82px;
  overflow: hidden;
  border: 1px solid rgba(104, 75, 44, 0.18);
  background: #33251f;
  box-shadow: var(--shadow);
}

.feature-copy {
  padding: 54px 48px;
  color: #fff8ea;
  background:
    linear-gradient(rgba(45, 30, 24, 0.88), rgba(45, 30, 24, 0.88)),
    url("assets/ink-banner.jpg") center / cover;
}

.feature-copy .eyebrow,
.feature-copy p:not(.eyebrow) {
  color: #eadcc7;
}

.feature-copy h2 {
  color: #fffaf0;
}

.feature-copy .outline-action {
  margin-top: 28px;
  border-color: rgba(255, 248, 235, 0.46);
  color: #fff8ea;
  background: transparent;
}

.feature-panel > img {
  width: 100%;
  height: 100%;
  min-height: 360px;
  object-fit: cover;
  object-position: center;
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.filter-tab {
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid rgba(68, 48, 34, 0.18);
  border-radius: 999px;
  background: rgba(255, 250, 241, 0.72);
  cursor: pointer;
}

.filter-tab.is-active {
  border-color: var(--seal);
  color: #fff8eb;
  background: var(--seal);
}

.browse-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.browse-card {
  overflow: hidden;
}

.browse-card.is-hidden {
  display: none;
}

.browse-card img {
  width: 100%;
  aspect-ratio: 1.26;
  object-fit: cover;
  object-position: center;
}

.browse-card div {
  padding: 16px 16px 18px;
}

.letter-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.letter-card {
  overflow: hidden;
}

.letter-card img {
  width: 100%;
  aspect-ratio: 1.32;
  object-fit: cover;
  object-position: top center;
}

.letter-card h3,
.letter-card p {
  padding: 0 16px;
}

.letter-card h3 {
  min-height: 3.1em;
}

.letter-card p {
  padding-bottom: 18px;
}

.text-link {
  color: var(--seal);
  font-family: var(--serif);
  white-space: nowrap;
}

.poster-wall {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 220px;
  gap: 16px;
}

.poster-tile {
  position: relative;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(104, 75, 44, 0.16);
  border-radius: 6px;
  background: #f8f1e5;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.poster-tile.tall {
  grid-row: span 2;
}

.poster-tile.wide {
  grid-column: span 2;
}

.poster-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 28px 42px;
  color: #eadcc7;
  background:
    linear-gradient(rgba(42, 29, 23, 0.96), rgba(42, 29, 23, 0.96)),
    url("assets/hero-lotus.jpg") center / cover;
}

.site-footer p {
  margin: 0;
  color: rgba(234, 220, 199, 0.78);
  font-size: 0.88rem;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.modal.is-open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(29, 21, 18, 0.72);
}

.modal-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(260px, 0.58fr) minmax(260px, 0.42fr);
  width: min(980px, 100%);
  max-height: min(760px, calc(100vh - 56px));
  overflow: hidden;
  border-radius: 8px;
  background: #fff8ec;
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.32);
}

.modal-image {
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: contain;
  background: #2d211c;
}

.modal-copy {
  padding: 42px 38px;
  overflow: auto;
}

.modal-copy h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 2rem;
  line-height: 1.2;
}

.modal-meta {
  margin: 16px 0 0;
  color: var(--seal-dark);
  font-family: var(--serif);
}

.modal-desc {
  margin: 18px 0 0;
  color: var(--ink-soft);
  line-height: 1.8;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(68, 48, 34, 0.24);
  border-radius: 50%;
  color: var(--ink);
  background: rgba(255, 248, 235, 0.88);
  cursor: pointer;
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: 1fr auto;
    gap: 16px;
    padding: 0 24px;
  }

  .site-nav {
    grid-column: 1 / -1;
    order: 3;
    justify-content: flex-start;
    gap: 22px;
    overflow-x: auto;
    padding-bottom: 8px;
  }

  .site-nav a {
    padding: 8px 0 12px;
  }

  .site-nav a::after {
    bottom: 5px;
  }

  .hero {
    min-height: 610px;
  }

  .hero-content {
    padding-top: 86px;
  }

  .hero h1 {
    font-size: 3.35rem;
  }

  .hero-line {
    font-size: 2rem;
  }

  .category-band,
  .browse-grid,
  .letter-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .category-card:nth-child(2) {
    border-right: 0;
  }

  .category-card:nth-child(-n + 2) {
    border-bottom: 1px solid rgba(104, 75, 44, 0.14);
  }

  .feature-panel,
  .modal-panel {
    grid-template-columns: 1fr;
  }

  .feature-panel > img {
    min-height: 300px;
  }

  .poster-wall {
    grid-template-columns: repeat(2, 1fr);
  }

  .poster-tile.wide {
    grid-column: span 1;
  }
}

@media (max-width: 640px) {
  .site-header {
    min-height: 66px;
    padding: 0 16px;
  }

  .brand {
    font-size: 1.25rem;
  }

  .enter-link {
    min-height: 34px;
    padding: 0 12px;
    font-size: 0.88rem;
  }

  .hero {
    min-height: 590px;
  }

  .hero-bg {
    background-position: 63% center;
    opacity: 0.34;
  }

  .hero-content {
    width: calc(100% - 32px);
    padding-top: 72px;
  }

  .hero h1 {
    font-size: 2.7rem;
  }

  .hero-line {
    font-size: 1.65rem;
  }

  .hero-copy {
    font-size: 1rem;
  }

  .hero-actions {
    flex-wrap: wrap;
  }

  .hero-stats {
    bottom: 24px;
    grid-template-columns: repeat(3, 1fr);
    width: calc(100% - 32px);
  }

  .hero-stats div {
    padding: 14px 8px;
  }

  .hero-stats strong {
    font-size: 1.55rem;
  }

  .category-band,
  .browse-grid,
  .letter-row {
    grid-template-columns: 1fr;
    width: calc(100% - 32px);
  }

  .category-card {
    border-right: 0;
    border-bottom: 1px solid rgba(104, 75, 44, 0.14);
  }

  .category-card:last-child {
    border-bottom: 0;
  }

  .section-wrap,
  .poster-section,
  .feature-panel {
    width: calc(100% - 32px);
    margin-bottom: 62px;
  }

  .section-heading,
  .section-heading.compact {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-heading h2,
  .feature-copy h2 {
    font-size: 2rem;
  }

  .filter-tabs {
    justify-content: flex-start;
  }

  .feature-copy {
    padding: 38px 24px;
  }

  .poster-wall {
    grid-template-columns: 1fr;
    grid-auto-rows: 260px;
  }

  .poster-tile.tall,
  .poster-tile.wide {
    grid-row: span 1;
    grid-column: span 1;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    padding: 26px 18px;
  }

  .modal {
    padding: 16px;
  }

  .modal-panel {
    max-height: calc(100vh - 32px);
  }

  .modal-image {
    min-height: 260px;
    max-height: 48vh;
  }

  .modal-copy {
    padding: 28px 22px;
  }
}
