:root {
  color-scheme: dark;
  --bg: #111315;
  --panel: #1b1e21;
  --line: #33373a;
  --text: #f2f2ef;
  --muted: #a7acae;
  --accent: #d4ff75;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.55; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { color: inherit; cursor: pointer; }
img { display: block; max-width: 100%; object-fit: cover; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.wrap { width: min(1340px, calc(100% - 104px)); margin-inline: auto; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1, h2, h3 { line-height: 1.08; letter-spacing: -.035em; }
h1 { font-size: clamp(2.5rem, 6vw, 5.8rem); font-weight: 670; }
h2 { font-size: clamp(1.65rem, 3vw, 2.65rem); font-weight: 620; }
h3 { font-size: clamp(1.05rem, 1.7vw, 1.3rem); }
p { color: var(--muted); }
.skip { position: fixed; z-index: 4; top: 8px; left: 8px; transform: translateY(-150%); padding: 8px 12px; background: var(--accent); color: var(--bg); }
.skip:focus { transform: translateY(0); }
.top { position: sticky; top: 0; z-index: 3; background: #111315f5; border-bottom: 1px solid var(--line); }
.top-inner { min-height: 69px; display: flex; align-items: center; gap: 46px; }
.mark { flex: none; width: 34px; height: 34px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 3px; padding: 4px; }
.mark i { background: var(--accent); border-radius: 1px; }
.mark i:last-child { background: transparent; border: 1px solid var(--accent); }
.top nav, .footer nav { display: flex; align-items: center; flex-wrap: wrap; gap: 16px 29px; }
.top nav a, .footer a { color: var(--muted); font-size: .91rem; }
.top a:hover, .footer a:hover, .top a[aria-current] { color: var(--accent); }
.hero { display: grid; grid-template-columns: 1fr 1.12fr; gap: clamp(26px, 4.3vw, 72px); align-items: center; padding: 56px 0 50px; }
.kicker { color: var(--accent); font-size: .73rem; letter-spacing: .14em; font-weight: 700; margin-bottom: 16px; }
.lede { font-size: clamp(1rem, 1.65vw, 1.22rem); max-width: 57ch; margin-top: 18px; }
.primary, .secondary { display: inline-flex; align-items: center; justify-content: space-between; gap: 18px; border-radius: 5px; padding: 12px 16px; font-size: .93rem; font-weight: 650; min-height: 47px; }
.primary { background: var(--accent); color: #171e0e; }
.primary:hover { background: #e4ffac; }
.secondary { border: 1px solid var(--line); background: var(--panel); }
.secondary:hover { border-color: var(--accent); color: var(--accent); }
.hero .primary { margin-top: 26px; }
.stats { display: flex; flex-wrap: wrap; gap: 12px 28px; border-top: 1px solid var(--line); margin-top: 32px; padding-top: 17px; }
.stats dt { color: var(--text); font-size: 1.16rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.stats dd { font-size: .82rem; color: var(--muted); }
.samples { min-height: 390px; height: clamp(390px, 40vw, 570px); display: grid; grid-template-columns: 1.52fr 1fr; grid-template-rows: 1fr 1fr; gap: 8px; }
.sample { min-width: 0; min-height: 0; position: relative; display: block; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; }
.sample:first-child { grid-row: 1 / 3; }
.sample img, .category img { width: 100%; height: 100%; transition: transform .28s ease; }
.sample:hover img, .category:hover img, .card a:hover img { transform: scale(1.035); }
.sample span { position: absolute; inset: auto 8px 8px; display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 7px 9px; background: #151719e8; border: 1px solid #ffffff26; border-radius: 4px; font-size: .85rem; }
.sample b { color: var(--accent); }
.section { padding-block: 35px; border-top: 1px solid var(--line); }
.section-head { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 15px; margin-bottom: 22px; }
.section-head p { margin-top: 8px; }
.category-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.category { display: flex; position: relative; isolation: isolate; align-items: end; justify-content: space-between; gap: 5px; overflow: hidden; padding: 16px; min-height: 143px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.category img { position: absolute; z-index: -2; inset: 0; }
.category::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, #111315f2, #11131518 88%); }
.category p { font-size: .83rem; margin-top: 4px; color: #e0e2df; }
.category:hover, .card:hover { border-color: var(--accent); }
.category-page .category { min-height: 190px; }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.card a { display: block; height: 100%; }
.card a:focus-visible { outline-offset: -3px; }
.card-image { aspect-ratio: 1; position: relative; overflow: hidden; background: #262a2c; }
.card-image img { width: 100%; height: 100%; transition: transform .28s ease; }
.card-image span { position: absolute; top: 9px; right: 9px; padding: 2px 7px; color: white; background: #141719eb; border-radius: 3px; font-size: .76rem; font-weight: 650; }
.card-info { display: flex; justify-content: space-between; align-items: center; gap: 5px; padding: 13px; }
.card-info p { font-size: .8rem; margin-top: 5px; }
.arrow { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border: 1px solid #a7acae60; border-radius: 100%; color: var(--accent); font-size: .85rem; }
.callout { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; }
.callout p { max-width: 65ch; margin-top: 9px; }
.page-head { padding: 45px 0 28px; }
.page-head h1 { font-size: clamp(2.5rem, 5.5vw, 4.75rem); }
.controls { display: grid; grid-template-columns: 1.6fr repeat(4, minmax(0, 1fr)); gap: 11px; padding: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
.controls label { min-width: 0; color: var(--muted); font-size: .8rem; }
.controls input, .controls select { display: block; width: 100%; margin-top: 5px; color: var(--text); border: 1px solid var(--line); border-radius: 4px; background: var(--bg); padding: 9px; min-height: 44px; font-size: .93rem; }
.results { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding-block: 16px; font-size: .89rem; }
.results a, .crumbs a, .prose p a, .panel a, .tip a { color: var(--accent); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 20px; }
.panel h2, .tip h2 { font-size: 1.25rem; }
.panel p, .tip p { margin-block: 8px; }
.empty { padding: 32px; text-align: center; }
.crumbs { display: flex; gap: 9px; flex-wrap: wrap; padding-block: 24px; font-size: .9rem; color: var(--muted); }
.crumbs + .page-head { padding-top: 0; }
.detail { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(24px, 5vw, 70px); margin-bottom: 35px; }
.detail-info h1 { font-size: clamp(2.1rem, 4.3vw, 4.25rem); overflow-wrap: anywhere; }
.preview { position: relative; display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: var(--panel); touch-action: pan-y; }
.preview img { aspect-ratio: 1; height: auto; width: 100%; }
.preview span { position: absolute; bottom: 10px; right: 10px; padding: 6px 10px; background: #111315ee; color: var(--text); border-radius: 4px; font-size: .84rem; }
.maps { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.maps button { min-width: 0; padding: 4px; display: grid; gap: 3px; justify-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 5px; font-size: .7rem; }
.maps img { width: 100%; height: auto; aspect-ratio: 1; border-radius: 3px; }
.maps button[aria-pressed=true], .maps button:hover { border-color: var(--accent); color: var(--accent); }
.specs { margin-block: 19px; border-top: 1px solid var(--line); }
.specs div { display: flex; justify-content: space-between; gap: 12px; padding-block: 9px; border-bottom: 1px solid var(--line); }
.specs dt { color: var(--muted); }
.specs dd { text-align: right; }
.specs a:hover { color: var(--accent); }
.download { width: min(100%, 320px); }
.muted { margin-top: 7px; font-size: .87rem; }
.tip { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 16px; }
dialog { position: fixed; max-width: calc(100% - 20px); max-height: calc(100% - 20px); padding: 0; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
dialog::backdrop { background: #090b0de8; }
dialog img { object-fit: contain; width: auto; height: auto; max-height: calc(100dvh - 22px); touch-action: pan-y; }
dialog button { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 5px; background: var(--bg); font-size: 1.5rem; }
.guide-layout, .about-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 290px); align-items: start; gap: 35px; }
.toc { display: grid; gap: 10px; position: sticky; top: 90px; }
.prose { max-width: 78ch; }
.prose section { padding-block: 20px; border-top: 1px solid var(--line); scroll-margin-top: 112px; }
.prose section p { margin-top: 10px; }
.prose section .secondary { margin-top: 14px; }
.map-guide { margin-top: 12px; display: grid; gap: 9px; }
.map-guide > div { padding: 10px; display: flex; align-items: center; gap: 13px; background: var(--panel); border: 1px solid var(--line); border-radius: 5px; }
.map-guide img { flex: none; width: clamp(52px, 10vw, 88px); height: auto; }
.table-wrap { overflow-x: auto; margin-top: 14px; }
table { width: 100%; border-collapse: collapse; }
th, td { border: 1px solid var(--line); padding: 9px; text-align: left; vertical-align: top; }
th { background: var(--panel); }
main { min-height: 65vh; }
.footer { margin-top: 45px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding-block: 23px; }

@media (max-width: 1050px) {
  .wrap { width: calc(100% - 56px); }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .controls { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .controls label:first-child { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .wrap { width: calc(100% - 32px); }
  .hero { grid-template-columns: 1fr; padding-top: 33px; gap: 22px; }
  .samples { min-height: 0; height: clamp(218px, 60vw, 400px); }
  .category-grid, .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .detail, .guide-layout, .about-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .detail-info { grid-row: 1; }
  .toc { display: none; }
  .top-inner { gap: 12px; }
  .top nav, .footer nav { gap: 6px 13px; }
  .top nav a { font-size: .8rem; }
  .category { min-height: 117px; padding: 10px; }
  .category-page .category { min-height: 140px; }
  .page-head { padding-top: 30px; }
  .stats { gap: 9px 18px; }
}
@media (max-width: 510px) {
  .controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .maps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .maps img { max-height: 58px; }
  .card-info { padding: 8px; }
  .card-info .arrow { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
