
:root {
  --bg: #F4F6F9; --surface: #FFFFFF; --ink: #161A22; --muted: #5E6774; --line: #D8DEE7;
  --accent: #2B74D6; --accent-ink: #FFFFFF; --accent-soft: #E4EEFB;
  --code-bg: #0F141B; --code-ink: #E4E9F1;
  --display: "Unbounded", "Golos Text", "Arial Black", sans-serif;
  --body: "Golos Text", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1116; --surface: #161B23; --ink: #E8ECF2; --muted: #98A3B3; --line: #273040;
    --accent: #6AA8F4; --accent-ink: #0B1220; --accent-soft: #172A44;
    --code-bg: #0A0D12; --code-ink: #E4E9F1;
  }
}
:root[data-theme="dark"] {
  --bg: #0E1116; --surface: #161B23; --ink: #E8ECF2; --muted: #98A3B3; --line: #273040;
  --accent: #6AA8F4; --accent-ink: #0B1220; --accent-soft: #172A44;
  --code-bg: #0A0D12; --code-ink: #E4E9F1;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
img { max-width: 100%; }
svg { width: 17px; height: 17px; flex: none; }

.app { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100vh; }
body[data-side="min"] .app { grid-template-columns: 64px minmax(0, 1fr); }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--line); padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 10px 14px; }
.side-mark { font-family: var(--display); font-weight: 600; font-size: 12.5px; letter-spacing: .1em; color: var(--ink); text-decoration: none; white-space: nowrap; }
.side-min { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px; border-radius: 6px; display: grid; place-items: center; }
.side-min:hover { color: var(--ink); background: var(--bg); }
.snav { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 14.5px; font-weight: 500; background: none; border: 0; font-family: inherit; cursor: pointer; text-align: left; width: 100%; }
.snav:hover { background: var(--bg); }
.snav.on { background: var(--accent-soft); color: var(--accent); }
.snav .n { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.side details { margin: 0; }
.side summary { list-style: none; cursor: pointer; }
.side summary::-webkit-details-marker { display: none; }
.side .sub { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 4px; }
.side .sub .snav { padding-left: 37px; font-size: 13.5px; font-weight: 400; }
body[data-side="min"] .side { padding: 16px 10px; }
body[data-side="min"] .side .label, body[data-side="min"] .side .n, body[data-side="min"] .side-mark, body[data-side="min"] .side .sub { display: none; }
body[data-side="min"] .side-head { justify-content: center; padding-left: 0; padding-right: 0; }
body[data-side="min"] .snav { justify-content: center; padding-left: 0; padding-right: 0; }
.backdrop { display: none; }

.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 2100px; margin: 0 auto; padding: 12px clamp(24px, 2.5vw, 56px); display: flex; align-items: center; gap: 14px; }
.burger { display: none; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; color: var(--ink); padding: 7px; cursor: pointer; }
.search { flex: 1; display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 11px 18px; color: var(--muted); }
.search input { flex: 1; border: 0; background: none; color: var(--ink); font: inherit; font-size: 15px; min-width: 0; }
.search input:focus { outline: none; }
.search input::placeholder { color: var(--muted); }
.search kbd { font-family: var(--mono); font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 1px 7px; }
a.search { text-decoration: none; }
.count { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.wrap { max-width: 2100px; margin: 0 auto; padding: 0 clamp(24px, 2.5vw, 56px) 72px; }

.hero { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: clamp(14px, 1vw, 20px); padding: 28px 0 36px; border-bottom: 1px solid var(--line); }
.hero-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: clamp(28px, 2.2vw, 44px) clamp(26px, 2vw, 40px); display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.eyebrow { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin: 0; }
.eyebrow .dash { width: 34px; height: 1px; background: var(--line); }
.eyebrow .soft { color: var(--muted); letter-spacing: .04em; text-transform: none; font-family: var(--mono); font-size: 12px; }
.eyebrow .ic { width: 30px; height: 30px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
h1 { font-family: var(--display); font-weight: 600; font-size: clamp(1.7rem, 3.4vw, 2.6rem); line-height: 1.1; letter-spacing: -.01em; margin: 0; text-wrap: balance; }
.lede { color: var(--muted); margin: 0; max-width: 38rem; text-wrap: pretty; }
.cta { margin-top: auto; display: inline-block; background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 15px; text-decoration: none; border-radius: 999px; padding: 11px 22px; }
.showcase { position: relative; min-width: 0; }
.slides { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 2 * clamp(14px, 1vw, 20px)) / 3); gap: clamp(14px, 1vw, 20px); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.slides::-webkit-scrollbar { display: none; }
.slide { scroll-snap-align: start; position: relative; display: block; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: var(--code-bg); color: #fff; text-decoration: none; }
.slide img { width: 100%; height: 100%; object-fit: cover; display: block; aspect-ratio: 3/4; max-height: 560px; }
@media (prefers-reduced-motion: no-preference) {
  .slide img { transition: transform .3s ease; }
  .slide:hover img { transform: scale(1.03); }
}
.slide:hover { border-color: var(--accent); }
.slide .cap { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; gap: 3px; padding: 48px 14px 13px; background: linear-gradient(to top, rgba(8, 11, 16, .82), rgba(8, 11, 16, 0)); }
.slide .num { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; opacity: .75; }
.slide .nm { font-weight: 600; font-size: 15.5px; line-height: 1.25; text-wrap: balance; }
.slide .ct { font-family: var(--mono); font-size: 11px; opacity: .85; }
.sarrow { position: absolute; top: 50%; z-index: 2; width: 38px; height: 38px; margin-top: -19px; border-radius: 50%; border: 0; background: rgba(15, 20, 27, .6); color: #fff; display: grid; place-items: center; cursor: pointer; }
.sarrow:hover { background: rgba(15, 20, 27, .85); }
.sarrow.l { left: 10px; } .sarrow.r { right: 10px; }
@media (min-width: 901px) {
  .hero-panel { min-height: 440px; }
  .slides { position: absolute; inset: 0; grid-template-rows: 100%; }
  .slide img { aspect-ratio: auto; height: 100%; max-height: none; }
}
.collection-hero { padding: 10px 0 30px; border-bottom: 1px solid var(--line); }
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.msub { color: var(--muted); font-size: 15px; margin: -4px 0 16px; text-wrap: pretty; }
.mtext { font-size: 14.5px; line-height: 1.6; margin: 0 0 16px; text-wrap: pretty; }
.detail-info .card-cat a { color: inherit; text-decoration: none; }
a.chip { text-decoration: none; }
a.chip:hover { color: var(--accent); border-color: var(--accent); }
.chip .cn { font-family: var(--mono); font-size: 10px; color: var(--muted); letter-spacing: 0; }
.plabel h2 { font: inherit; margin: 0; }
.h2s { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; color: var(--muted); margin: 4px 0 8px; }
.howto { margin: 0 0 18px; padding-left: 20px; font-size: 14px; color: var(--ink); }
.howto li { margin: 0 0 4px; }
.about { max-width: 60rem; }
.about p { color: var(--muted); margin: 0 0 12px; text-wrap: pretty; }
.about .mtags { gap: 6px; }
.collection-hero h1 { font-size: clamp(2rem, 4.6vw, 3.2rem); margin: 14px 0 12px; }
.collection-hero .lede { max-width: 46rem; }

.filterbar { display: flex; align-items: center; gap: 10px; padding: 18px 0 22px; scroll-margin-top: 76px; }
.fscroll { flex: 1; display: flex; align-items: center; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.fscroll::-webkit-scrollbar { display: none; }
.farrow { background: var(--surface); border: 1px solid var(--line); border-radius: 50%; width: 30px; height: 30px; display: grid; place-items: center; color: var(--muted); cursor: pointer; flex: none; }
.farrow:hover { color: var(--ink); }
.fdivider { width: 1px; height: 22px; background: var(--line); flex: none; }
.chip { display: inline-flex; align-items: center; gap: 7px; font-family: var(--body); font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; font-weight: 600; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px; white-space: nowrap; }
.chip svg { width: 14px; height: 14px; }
button.chip { cursor: pointer; }
.chip.hot { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.sort { font: inherit; font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; flex: none; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: clamp(14px, 1vw, 20px); }
.card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; text-decoration: none; color: var(--ink); position: relative; }
.card:hover { border-color: var(--accent); }
.card[hidden] { display: none; }
.card-media { display: block; aspect-ratio: 3/4; background: var(--code-bg); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (prefers-reduced-motion: no-preference) {
  .card-media img { transition: transform .25s ease; }
  .card:hover .card-media img { transform: scale(1.03); }
}
.card-badge { position: absolute; top: 10px; left: 10px; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; color: var(--accent-ink); background: var(--accent); border-radius: 999px; padding: 3px 9px; }
.card-badge.redo { background: #D93F3F; color: #fff; }
.mredo { font-size: 13.5px; margin: 0 0 18px; padding: 10px 14px; border-radius: 10px; background: rgba(217, 63, 63, .1); color: #B42E2E; }
.fav { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(15, 20, 27, .55); color: #fff; display: grid; place-items: center; cursor: pointer; }
.fav:hover { background: rgba(15, 20, 27, .8); }
.fav.on { color: #FF5D73; }
.fav.on svg path { fill: currentColor; }
.card-pending { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: 13px; }
.card-body { display: flex; flex-direction: column; gap: 7px; padding: 13px 15px 15px; }
.card-cat { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; color: var(--accent); }
.card-title { font-weight: 600; font-size: 15.5px; line-height: 1.3; }
.card-meta { display: flex; gap: 5px; flex-wrap: wrap; }
.card-meta .chip { font-size: 10px; padding: 2px 8px; gap: 4px; }
.empty { display: none; border: 1px dashed var(--line); border-radius: 16px; padding: 40px; text-align: center; color: var(--muted); }
.empty.on { display: block; }

.crumbs { display: flex; align-items: center; gap: 8px; padding: 18px 0; font-size: 13.5px; color: var(--muted); flex-wrap: wrap; }
.crumbs a { text-decoration: none; font-weight: 600; }
.crumbs .sep { color: var(--line); }
.detail { display: grid; grid-template-columns: minmax(0, 1fr) clamp(380px, 34vw, 620px); gap: clamp(14px, 1vw, 20px); align-items: start; }
.detail-media { background: var(--code-bg); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: grid; place-items: center; }
.detail-media { min-height: 60vh; } .detail-media img { width: 100%; max-height: 86vh; object-fit: contain; display: block; }
.detail-info { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 26px 26px 30px; }
.detail-info h1 { font-size: clamp(1.3rem, 2.4vw, 1.7rem); margin: 6px 0 14px; }
.mtags { display: flex; gap: 5px; flex-wrap: wrap; margin: 0 0 20px; }
.plabel { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; color: var(--muted); margin: 0 0 8px; }
.copy { font: inherit; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; font-weight: 600; color: var(--accent); background: var(--accent-soft); border: 0; border-radius: 999px; padding: 5px 12px; cursor: pointer; }
.copy.done { color: var(--accent-ink); background: var(--accent); }
.detail-info pre { background: var(--code-bg); color: var(--code-ink); border-radius: 12px; padding: 16px 18px; overflow: auto; max-height: 420px; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 18px; }
.mnote { font-size: 13.5px; color: var(--muted); margin: 0 0 18px; }
.mref { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 12px; align-items: center; border-top: 1px solid var(--line); padding-top: 16px; }
.mref img { width: 84px; border-radius: 8px; display: block; }
.mref p { margin: 0; font-size: 12.5px; color: var(--muted); }
.mref code { font-family: var(--mono); font-size: 11px; background: var(--bg); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; overflow-wrap: anywhere; }
.pager { display: flex; gap: 10px; margin-top: 20px; }
.pager a { flex: 1; display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; text-decoration: none; color: var(--ink); font-size: 13.5px; min-width: 0; }
.pager a:hover { border-color: var(--accent); }
.pager .dir { display: block; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; color: var(--muted); }
.pager .next { text-align: right; }
.pager span.t { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
h2.sect { font-family: var(--display); font-weight: 500; font-size: 17px; letter-spacing: .02em; margin: 44px 0 16px; }

footer { border-top: 1px solid var(--line); margin-top: 48px; padding-top: 18px; color: var(--muted); font-size: 13.5px; display: flex; gap: 16px; flex-wrap: wrap; }
footer .spacer { flex: 1; }
footer a { color: var(--muted); }

.article { max-width: 48rem; }
.article p, .article li { line-height: 1.65; text-wrap: pretty; }
.article p { margin: 0 0 14px; }
.article ol, .article ul { margin: 0 0 18px; padding-left: 22px; }
.article li { margin: 0 0 7px; }
.article h3 { font-size: 16.5px; margin: 22px 0 8px; }
.article .note { background: var(--accent-soft); border-radius: 12px; padding: 14px 18px; }
.article strong { font-weight: 600; }
.codebox { margin: 0 0 18px; }
.codebox .plabel span { font: inherit; }
.codebox pre { background: var(--code-bg); color: var(--code-ink); border-radius: 12px; padding: 16px 18px; overflow: auto; max-height: 420px; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.faq { max-width: 48rem; }
.faq .qa { border-top: 1px solid var(--line); padding: 14px 0 2px; }
.faq h3 { font-size: 16px; margin: 0 0 6px; }
.faq p { margin: 0 0 12px; color: var(--muted); text-wrap: pretty; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: clamp(12px, 1vw, 18px); }
.tiles .slide img { aspect-ratio: 3/4; height: auto; max-height: none; }
.more { display: block; margin: 24px auto 0; font: inherit; font-size: 15px; font-weight: 600; color: var(--accent); background: var(--surface); border: 1px solid var(--accent); border-radius: 999px; padding: 11px 26px; cursor: pointer; }
.more:hover { background: var(--accent-soft); }
.more[hidden] { display: none; }
.glist { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: clamp(12px, 1vw, 18px); padding-top: 28px; }
.gitem { display: flex; flex-direction: column; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; text-decoration: none; color: var(--ink); }
.gitem:hover { border-color: var(--accent); }
.gitem .gt { font-weight: 600; font-size: 16.5px; line-height: 1.3; }
.gitem .gd { color: var(--muted); font-size: 14px; }

@media (max-width: 1000px) {
  .app { display: block; }
  .side { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 40; transform: translateX(-100%); }
  body[data-drawer="open"] .side { transform: none; }
  body[data-drawer="open"] .backdrop { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(8, 11, 16, .5); border: 0; }
  body[data-side="min"] .app { display: block; }
  body[data-side="min"] .side .label, body[data-side="min"] .side .n, body[data-side="min"] .side-mark, body[data-side="min"] .side .sub { display: revert; }
  .side-min { display: none; }
  .burger { display: grid; place-items: center; }
  @media (prefers-reduced-motion: no-preference) { .side { transition: transform .2s ease; } }
}
@media (max-width: 900px) {
  .hero, .detail { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .topbar-in { gap: 10px; }
  .search kbd { display: none; }
  .count { display: none; }
  .slides { grid-auto-columns: 64%; gap: 10px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card-title { font-size: 13.5px; }
  .card-meta { display: none; }
}
