:root {
  color-scheme: dark;
  --page: #111310;
  --surface: #181b16;
  --line: #2c3228;
  --ink: #f3f4ed;
  --muted: #b0b7a9;
  --soft: #90998a;
  --accent: #d3f75e;
  --mono: "Cascadia Mono", Consolas, monospace;
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.wrap { width: min(100% - 96px, 1160px); margin-inline: auto; }
.skip-link {
  position: fixed;
  z-index: 3;
  top: 12px;
  left: 12px;
  padding: 12px 18px;
  color: #181e0e;
  background: var(--accent);
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.topbar { border-bottom: 1px solid var(--line); }
.topbar-inner {
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font: 700 13px / 1 var(--mono);
  letter-spacing: .045em;
  white-space: nowrap;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: var(--accent);
  color: #151a0b;
  font: 700 17px / 1 var(--mono);
}
.brand-divider { margin-inline: 5px; color: var(--accent); }
.site-domain {
  min-width: 0;
  color: var(--soft);
  font: 12px / 1.4 var(--mono);
  letter-spacing: .12em;
  overflow-wrap: anywhere;
  text-align: right;
}
.back-link { color: var(--muted); font-size: 14px; white-space: nowrap; }
.back-link span { margin-right: 5px; color: var(--accent); }
.back-link:hover { color: var(--accent); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .95fr);
  align-items: center;
  gap: clamp(32px, 5.5vw, 84px);
  padding-block: clamp(56px, 8.5vw, 112px);
}
.hero-copy { min-width: 0; }
.eyebrow {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--accent);
  margin: 0 0 25px;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: .12em;
}
.eyebrow > span { width: 17px; height: 1px; flex: none; background: currentColor; }
h1 { font-weight: 800; margin: 0; }
.hero h1 {
  font-size: clamp(3.6rem, 7.25vw, 6.7rem);
  line-height: 1.075;
  letter-spacing: -.06em;
}
.hero h1 > span { display: block; white-space: nowrap; }
.cursor {
  display: inline-block;
  margin-left: .14em;
  color: var(--accent);
  font: 650 .69em / .75 var(--mono);
  vertical-align: .04em;
}
.hero-description {
  max-width: 25em;
  margin: 27px 0 34px;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.125rem);
  line-height: 1.8;
}
.hero-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  max-width: 454px;
}
.gateway {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 64px;
  padding: 11px 13px;
  border: 1px solid #3a4435;
  border-radius: 8px;
  background: #1a1e17;
  font-size: 15px;
  font-weight: 680;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}
.gateway:hover { border-color: var(--accent); transform: translateY(-2px); background: #242b1c; }
.gateway-primary { border-color: var(--accent); background: var(--accent); color: #19200c; }
.gateway-primary:hover { border-color: #e0ff90; background: #e0ff90; }
.gateway-icon {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 5px;
  background: #303925;
  color: var(--accent);
  font: 700 14px / 1 var(--mono);
}
.gateway-primary .gateway-icon { background: #19200c; color: var(--accent); font-size: 19px; }
.gateway-arrow { color: var(--accent); font-size: 16px; }
.gateway-primary .gateway-arrow { color: currentColor; }

.hero-art {
  position: relative;
  display: grid;
  aspect-ratio: 1;
  overflow: hidden;
  align-items: center;
  border: 1px solid #363e2c;
  border-radius: 12px;
  background: #11130f;
  box-shadow: 0 18px 65px #0005;
}
.hero-art img { display: block; width: 100%; height: auto; }
.frame-corner { position: absolute; width: 13px; height: 13px; border: solid #d3f75e80; }
.corner-tl { top: 13px; left: 13px; border-width: 1px 0 0 1px; }
.corner-tr { top: 13px; right: 13px; border-width: 1px 1px 0 0; }
.corner-bl { bottom: 13px; left: 13px; border-width: 0 0 1px 1px; }
.corner-br { bottom: 13px; right: 13px; border-width: 0 1px 1px 0; }

.footer { margin-top: auto; border-top: 1px solid var(--line); color: var(--soft); font-size: 12px; }
.footer-inner, .footer-links { display: flex; align-items: center; flex-wrap: wrap; }
.footer-inner { min-height: 78px; justify-content: space-between; gap: 12px 24px; padding-block: 18px; }
.footer-divider { padding-inline: 5px; color: #71816a; }
.footer-links { gap: 10px 20px; }
.footer-links a { display: inline-flex; align-items: center; gap: 5px; }
.footer-links a:hover { color: var(--accent); }

.library { padding-bottom: 70px; }
.library-hero { padding-block: clamp(46px, 6.8vw, 86px) clamp(32px, 4.8vw, 59px); }
.library-hero h1 { font-size: clamp(3rem, 7vw, 5.15rem); line-height: 1.12; letter-spacing: -.055em; }
.library-hero > p:last-child { margin: 16px 0 0; color: var(--muted); font-size: 16px; line-height: 1.65; }
.listing {
  padding: clamp(15px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.library-controls { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.filters { display: flex; flex-wrap: wrap; gap: 7px; }
.filters button, .download-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 7px 13px;
  border: 1px solid #343e2f;
  border-radius: 6px;
  color: var(--muted);
  background: #1e241b;
  font-size: 14px;
  white-space: nowrap;
}
.filters button:hover, .download-link:hover { border-color: var(--accent); color: var(--accent); }
.filters button[aria-pressed="true"] { background: var(--accent); color: #19200c; border-color: var(--accent); font-weight: 700; }
.search {
  display: flex;
  align-items: center;
  gap: 11px;
  width: min(100%, 300px);
  min-height: 42px;
  padding-inline: 13px;
  border: 1px solid #3b4537;
  border-radius: 6px;
  background: var(--page);
}
.search:focus-within { border-color: var(--accent); }
.search-icon {
  width: 12px;
  height: 12px;
  flex: none;
  border: 1.5px solid var(--muted);
  border-radius: 50%;
  position: relative;
}
.search-icon::after {
  content: "";
  width: 6px;
  height: 1.5px;
  position: absolute;
  background: var(--muted);
  inset: 8px auto auto 8px;
  transform: rotate(45deg);
  transform-origin: left center;
}
.search input { width: 100%; min-height: 40px; padding: 0; border: none; color: var(--ink); background: transparent; font-size: 14px; outline: none; }
.search input::placeholder { color: var(--soft); }
.result-count { margin: 19px 0 10px; color: var(--soft); font-size: 13px; }
.resource-list { list-style: none; margin: 0; padding: 0; }
.resource-list > li {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 125px auto;
  align-items: center;
  gap: 17px;
  min-height: 82px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}
.file-type {
  display: grid;
  min-height: 43px;
  place-items: center;
  color: var(--accent);
  border: 1px solid #3a472b;
  border-radius: 6px;
  background: #242d1b;
  font: 600 11px / 1 var(--mono);
}
.resource-info h2 { margin: 0 0 4px; font-size: 16px; line-height: 1.4; overflow-wrap: anywhere; }
.resource-info p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.resource-meta { display: grid; gap: 5px; color: var(--soft); font-size: 12px; }
.resource-meta > span:last-child { font-family: var(--mono); }
.download-link { color: var(--ink); }
.download-link span { color: var(--accent); }
.empty-state { padding-block: 28px 30px; border-top: 1px solid var(--line); text-align: center; color: var(--muted); }
.empty-state p { margin: 0 0 13px; }

@media (max-width: 950px) {
  .wrap { width: calc(100% - 64px); }
  .hero { gap: 32px; }
  .hero h1 { font-size: clamp(3.5rem, 8vw, 5.5rem); }
  .gateway { min-height: 57px; padding-inline: 9px; gap: 7px; }
}
@media (max-width: 700px) {
  .wrap { width: calc(100% - 40px); }
  .topbar-inner { min-height: 64px; }
  .hero { grid-template-columns: 1fr; padding-block: 44px; gap: 30px; }
  .hero h1 { font-size: clamp(3rem, 12.5vw, 5rem); }
  .hero-description { margin-block: 19px 24px; }
  .eyebrow { margin-bottom: 19px; }
  .hero-art { width: min(100%, 510px); justify-self: center; }
  .library { padding-bottom: 42px; }
  .library-controls { align-items: stretch; flex-direction: column-reverse; gap: 11px; }
  .search { width: 100%; }
  .filters { display: grid; grid-template-columns: .7fr 1.2fr 1fr 1.2fr; gap: 5px; }
  .filters button { padding-inline: 5px; font-size: 12px; }
  .resource-list > li { grid-template-columns: 42px minmax(0, 1fr) auto; gap: 4px 11px; }
  .file-type, .download-link { grid-row: span 2; }
  .resource-meta { grid-area: 2 / 2; display: flex; gap: 4px 9px; flex-wrap: wrap; }
}
@media (max-width: 365px) {
  .wrap { width: calc(100% - 32px); }
  .brand { gap: 7px; font-size: 11px; }
  .brand-mark { width: 30px; height: 30px; }
  .site-domain { font-size: 10px; }
  .gateway { font-size: 14px; }
  .gateway-icon { width: 25px; height: 25px; }
  .resource-list > li { grid-template-columns: 33px minmax(0, 1fr) auto; column-gap: 8px; }
  .download-link { padding-inline: 8px; }
}
@media (max-width: 350px) {
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
