:root {
  color-scheme: dark;
  --ink: #0b0907;
  --panel: #15110e;
  --panel-2: #1e1813;
  --bone: #f0e8db;
  --faint: #a99e90;
  --amber: #e6b45f;
  --line: #352a20;
  --safe: #8dbb83;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 78% 8%, rgba(177, 116, 42, .18), transparent 28rem),
    linear-gradient(180deg, #0b0907 0%, #100d0a 55%, #0b0907 100%);
  color: var(--bone);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}
a { color: inherit; text-decoration: none; }
.shell { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }

.nav {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; letter-spacing: .08em; }
.brand img { width: 34px; height: 34px; border-radius: 10px; }
.brand b { color: var(--faint); font-size: 11px; letter-spacing: .16em; }
.nav nav { display: flex; gap: 24px; color: var(--faint); font-size: 13px; }
.nav nav a:hover { color: var(--amber); }

.hero {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 64px;
  align-items: center;
  min-height: 690px;
  padding-block: 74px;
}
.eyebrow { color: var(--amber); font-size: 11px; letter-spacing: .2em; font-weight: 700; }
h1 { font: 700 clamp(54px, 7.4vw, 104px)/.98 "Noto Serif SC", "Songti SC", serif; margin: 18px 0 28px; }
h1 em { color: var(--amber); font-style: normal; }
h2 { font: 600 clamp(32px, 4vw, 54px)/1.13 "Noto Serif SC", "Songti SC", serif; margin: 10px 0 14px; }
.lede { max-width: 580px; color: #c8beb1; font-size: 17px; line-height: 1.9; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 14px;
  transition: transform .2s, border-color .2s, background .2s;
}
.button:hover { transform: translateY(-1px); border-color: var(--amber); }
.button.primary { background: var(--amber); color: #1a1108; border-color: var(--amber); font-weight: 700; }
.button.quiet { background: rgba(255,255,255,.025); }
.button.full { width: 100%; }
.meta-line { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.meta-line span { color: var(--faint); border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; font-size: 11px; }
#version-badge { color: var(--amber); border-color: #5a4122; }

.hero-visual { position: relative; display: flex; justify-content: center; }
.device {
  width: min(340px, 82vw);
  padding: 10px;
  border: 1px solid #403326;
  border-radius: 34px;
  background: #050403;
  box-shadow: 0 44px 100px rgba(0,0,0,.55), 0 0 0 10px rgba(255,255,255,.025);
  transform: rotate(2.5deg);
}
.device img { display: block; width: 100%; border-radius: 26px; }
.film-label {
  position: absolute;
  bottom: 18px;
  left: -28px;
  padding: 9px 13px;
  border: 1px solid #604521;
  border-radius: 8px;
  background: rgba(10,8,6,.9);
  color: var(--amber);
  font: 10px/1.2 ui-monospace, monospace;
  letter-spacing: .1em;
  transform: rotate(-5deg);
}

.gallery-section { padding-block: 100px; border-top: 1px solid rgba(255,255,255,.07); }
.gallery-head {
  max-width: none;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 44px;
}
.gallery-head > div { flex: 0 1 560px; }
.gallery-head > p { flex: 1 1 340px; max-width: 440px; margin: 0 0 8px; }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
  min-width: 0;
}
.gallery-grid figure {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}
.gallery-grid button {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}
.gallery-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 5 / 4;
  object-fit: cover;
  transition: transform .5s ease, filter .5s ease;
}
.gallery-grid figure:hover img { transform: scale(1.025); filter: brightness(1.06); }
.gallery-grid figcaption {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 13px 15px;
  color: var(--bone);
  font-size: 12px;
}
.gallery-grid figcaption span { color: var(--amber); font: 9px/1 ui-monospace, monospace; }

.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 38px;
  background: rgba(4,3,2,.94);
  backdrop-filter: blur(12px);
}
.photo-lightbox[hidden] { display: none; }
.photo-lightbox img {
  max-width: min(94vw, 1500px);
  max-height: 88vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 30px 100px rgba(0,0,0,.65);
}
.lightbox-close {
  position: fixed;
  top: 22px;
  right: 26px;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 50%;
  background: rgba(20,16,12,.8);
  color: var(--bone);
  font-size: 26px;
  cursor: pointer;
}

.download-section, .changes, .about { padding-block: 100px; border-top: 1px solid rgba(255,255,255,.07); }
.section-head { max-width: 680px; margin-bottom: 34px; }
.section-head > p:last-child { color: var(--faint); line-height: 1.8; }
.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}
.download-card {
  min-height: 260px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, var(--panel-2), var(--panel));
}
.download-card.featured { border-color: #7b5727; box-shadow: inset 0 1px rgba(255,255,255,.05); }
.download-card .tag { color: var(--amber); font-size: 10px; letter-spacing: .14em; }
.download-card h3 { margin: 18px 0 8px; font-size: 22px; }
.download-card p { color: var(--faint); font-size: 13px; line-height: 1.7; flex: 1; }
.download-card small { color: #7f7468; text-align: center; margin-top: 9px; }

.checksum {
  margin-top: 14px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #0e0b09;
}
.checksum span { display: block; color: var(--faint); font-size: 10px; margin-bottom: 6px; }
code { color: var(--safe); font: 11px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }
.checksum button {
  flex: none;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: transparent;
  color: var(--bone);
  padding: 9px 12px;
  cursor: pointer;
}

.changes-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 34px;
}
.changes-head .section-head { margin-bottom: 0; }
.changes-tools {
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 6px;
}
.github-star-link {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 9px;
  min-width: 160px;
  padding: 9px 12px;
  border: 1px solid #6a4b22;
  border-radius: 11px;
  background: rgba(230,180,95,.07);
}
.github-star-link > span {
  grid-row: 1 / 3;
  color: var(--amber);
  font-size: 22px;
}
.github-star-link b { font-size: 12px; }
.github-star-link small { color: var(--faint); font-size: 9px; }
.github-star-link:hover { border-color: var(--amber); }
.carousel-controls {
  flex: none;
  display: flex;
  align-items: center;
  gap: 9px;
  padding-bottom: 6px;
}
.carousel-controls button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  color: var(--bone);
  font-size: 19px;
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
.carousel-controls button:hover { border-color: var(--amber); color: var(--amber); }
.carousel-controls button:disabled { opacity: .3; cursor: default; }
.carousel-controls span { min-width: 48px; color: var(--faint); font: 10px/1 ui-monospace, monospace; text-align: center; }

.changelog-viewport {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 67%, rgba(0,0,0,.58) 88%, transparent 100%);
  mask-image: linear-gradient(90deg, #000 0%, #000 67%, rgba(0,0,0,.58) 88%, transparent 100%);
}
.changelog-track {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 2px 14vw 14px 2px;
}
.changelog-track::-webkit-scrollbar { display: none; }
.release-card {
  flex: 0 0 min(440px, calc(100vw - 68px));
  min-height: 400px;
  padding: 30px;
  scroll-snap-align: start;
  transform-origin: left center;
  transition: opacity .25s ease, filter .25s ease, transform .25s ease;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(155deg, rgba(255,255,255,.035), transparent 42%),
    linear-gradient(145deg, #1b1510, #100d0a);
  box-shadow: 0 22px 70px rgba(0,0,0,.25);
}
.release-card.latest { border-color: #765326; }
.release-card.release-loading { color: var(--faint); align-items: center; justify-content: center; }
.release-topline { display: flex; align-items: center; gap: 9px; color: var(--faint); font: 10px/1 ui-monospace, monospace; }
.latest-badge { padding: 5px 8px; border: 1px solid #6c4d25; border-radius: 999px; color: var(--amber); background: rgba(230,180,95,.08); }
.release-card h3 { margin: 20px 0 8px; font-size: 27px; font-weight: 600; }
.release-summary { min-height: 48px; margin: 0 0 22px; color: var(--faint); font-size: 13px; line-height: 1.75; }
.release-group + .release-group { margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.07); }
.release-group h4 { margin: 0 0 8px; color: var(--amber); font-size: 11px; letter-spacing: .08em; }
.release-group ul { margin: 0; padding-left: 18px; color: #c9bfb3; font-size: 13px; line-height: 1.8; }
.release-group li + li { margin-top: 4px; }
.features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: var(--panel);
}
.features article { padding: 28px; border-right: 1px solid var(--line); }
.features article:last-child { border-right: 0; }
.features b { display: block; color: var(--amber); font: 600 30px/1.1 "Noto Serif SC", serif; }
.features span { display: block; margin-top: 10px; color: var(--faint); font-size: 12px; line-height: 1.6; }

.about { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; }
.about-copy { color: var(--faint); line-height: 1.9; }
.about-copy code { display: block; margin-top: 10px; }

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-block: 28px 40px;
  color: #766b60;
  font-size: 11px;
}

@media (max-width: 820px) {
  .shell { width: min(100% - 28px, 680px); }
  .nav nav { gap: 12px; }
  .hero { grid-template-columns: 1fr; min-height: auto; gap: 44px; padding-block: 60px; }
  .hero-copy { order: 1; }
  .hero-visual { order: 2; }
  .gallery-head { align-items: flex-start; flex-direction: column; gap: 8px; }
  .gallery-head > div { flex-basis: auto; }
  .gallery-head > p { max-width: 620px; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .download-grid { grid-template-columns: 1fr; }
  .download-card { min-height: 220px; }
  .about { grid-template-columns: 1fr; gap: 24px; }
  .changes-head { align-items: flex-start; flex-direction: column; }
  .changes-tools { width: 100%; align-items: stretch; flex-direction: column-reverse; }
  .carousel-controls { width: 100%; justify-content: flex-end; }
  .github-star-link { justify-content: center; }
  .release-card { flex-basis: min(390px, calc(100vw - 88px)); padding: 24px; }
  .features { grid-template-columns: 1fr 1fr; }
  .features article:nth-child(2) { border-right: 0; }
  .features article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .checksum, footer { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 480px) {
  h1 { font-size: 52px; }
  .brand b { display: none; }
  .nav nav { font-size: 12px; }
  .features { grid-template-columns: 1fr; }
  .features article { border-right: 0; border-bottom: 1px solid var(--line); }
  .features article:last-child { border-bottom: 0; }
  .gallery-grid { grid-template-columns: minmax(0, 1fr); }
  .photo-lightbox { padding: 18px; }
  .lightbox-close { top: 14px; right: 14px; }
  .film-label { left: 0; }
}
