/* Catalog style "demo3" — "Future Studio" HUD: graphite ground, indigo/violet glow, glass panels, monospace read-outs; posts as rows of an index table, the post as a spec sheet beside a sticky screenshot. Mirrors /demo3/. */
@import url("https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700;900&display=swap");

@font-face {
    font-family: "Lazurski";
    src: url("/_fonts/LazurskiBold.woff2") format("woff2"), url("/_fonts/LazurskiBold.woff") format("woff");
    font-weight: 700;
    font-display: swap;
}

:root {
    --bg: #0d0e16;
    --bg-2: #12131e;
    --glass: rgb(22 24 38 / 0.7);
    --border: rgb(120 160 255 / 0.14);
    --border-hot: rgb(108 140 255 / 0.45);
    --accent: #6c8cff;
    --accent-2: #b46cff;
    --text: #e8ebf4;
    --dim: #8f94a9;
    --gold: #ffb500;
    --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
    --sans: "Lato", system-ui, sans-serif;
    --serif: "Lazurski", "Playfair Display", Georgia, serif;
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0; color: var(--text); font: 400 16px/1.6 var(--sans);
    background: radial-gradient(ellipse 80% 50% at 50% 0%, rgb(108 140 255 / 0.09), transparent 70%) no-repeat, var(--bg);
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
code { font: 400 0.88em/1.4 var(--mono); }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; box-shadow: 0 0 0 4px rgb(108 140 255 / 0.25); }

.skip { position: absolute; left: -9999px; top: 10px; z-index: 30; padding: 8px 14px; border: 1px solid var(--accent); border-radius: 6px; background: var(--bg-2); color: var(--text); font: 400 14px/1 var(--mono); }
.skip:focus { left: 16px; }

.page { max-width: 1320px; margin: 0 auto; padding: 0 24px; }

/* The demo's scroll-progress bar, frozen as a full gradient line on top. */
.deco { display: none; }
.deco--1 { display: block; position: fixed; inset: 0 0 auto 0; z-index: 50; height: 2px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); box-shadow: 0 0 8px rgb(108 140 255 / 0.5); pointer-events: none; }

/* ── masthead: a HUD header line ────────────────────────────────────────── */
.masthead { padding: 48px 0 24px; }
.masthead__inner { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: end; gap: 16px 40px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.brand { display: flex; flex-direction: column; gap: 10px; text-decoration: none; }
.brand__mark { font: 700 clamp(56px, 8vw, 104px)/0.85 var(--serif); color: var(--gold); letter-spacing: 0.02em; }
.brand__mark::after { content: " 2.0"; font: 400 0.24em/1 var(--mono); color: var(--accent); letter-spacing: 0.1em; vertical-align: top; }
.brand__name { font: 400 13px/1 var(--mono); letter-spacing: 0.14em; color: var(--dim); }
.brand__name::before { content: "// "; color: var(--accent); }
.masthead__tagline { max-width: 40ch; margin: 0; color: var(--dim); font-size: 16px; }
.masthead__count { margin: 0; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--glass); font: 400 12px/1.3 var(--mono); color: var(--dim); text-align: right; }
.masthead__num { display: block; font: 400 34px/1 var(--mono); color: var(--accent); text-shadow: 0 0 16px rgb(108 140 255 / 0.5); }

/* ── style bar: a glass console ─────────────────────────────────────────── */
.stylebar { margin: 0; }
.stylebar__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.stylebar__label { font: 400 12px/1 var(--mono); color: var(--accent); letter-spacing: 0.12em; }
.stylebar__label::after { content: " >"; }
.stylebar__value { flex: 1 1 280px; min-width: 0; padding: 7px 10px; overflow-x: auto; white-space: nowrap; border-radius: 6px; background: rgb(0 0 0 / 0.35); color: var(--text); }
.stylebar__copy { padding: 8px 16px; border: 1px solid var(--accent); border-radius: 6px; background: var(--accent); color: var(--bg); font: 700 13px/1 var(--mono); letter-spacing: 0.06em; cursor: pointer; box-shadow: 0 0 16px rgb(108 140 255 / 0.35); transition: box-shadow 200ms ease, background 200ms ease; }
.stylebar__copy:hover { box-shadow: 0 0 24px rgb(108 140 255 / 0.6); }
.stylebar__copy.is-done { background: var(--accent-2); border-color: var(--accent-2); }
.stylebar__list { display: flex; flex-wrap: wrap; gap: 4px 6px; width: 100%; }
.stylebar__item { padding: 2px 8px; border: 1px solid transparent; border-radius: 4px; color: var(--dim); font: 400 12px/1.6 var(--mono); text-decoration: none; }
.stylebar__item:hover { border-color: var(--border-hot); color: var(--text); }
.stylebar__item.is-active { border-color: var(--accent); color: var(--accent); }

/* ── categories: tab strip ──────────────────────────────────────────────── */
.categories { margin: 28px 0 0; }
.categories__list { display: flex; flex-wrap: wrap; gap: 0; margin: 0; padding: 0; list-style: none; border-bottom: 1px solid var(--border); }
.categories__link { position: relative; display: inline-flex; align-items: baseline; gap: 8px; padding: 12px 16px; color: var(--dim); font: 700 15px/1 var(--sans); text-decoration: none; transition: color 200ms ease; }
.categories__link:hover { color: var(--text); }
.categories__link.is-active { color: var(--text); }
.categories__link.is-active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); box-shadow: 0 0 10px rgb(108 140 255 / 0.6); }
.categories__count { font: 400 11px/1 var(--mono); color: var(--accent); }

/* ── listing: an index table ────────────────────────────────────────────── */
.content { padding: 36px 0 72px; }
.listing__header { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 24px; margin-bottom: 18px; }
.listing__title { margin: 0; font: 900 clamp(28px, 3vw, 40px)/1.05 var(--sans); letter-spacing: -0.02em; }
.listing__intro { flex-basis: 100%; order: 3; max-width: 64ch; margin: 0; color: var(--dim); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; color: var(--dim); font: 400 12px/1 var(--mono); }
.toolbar p { margin: 0; }
.toolbar__range::before { content: "rows "; color: var(--accent); }
.toolbar__view { display: flex; align-items: center; gap: 4px; }
.toolbar__label { margin-right: 6px; }
.toolbar__opt { min-width: 30px; padding: 5px 6px; border: 1px solid var(--border); border-radius: 4px; text-align: center; text-decoration: none; color: var(--text); }
.toolbar__opt:hover { border-color: var(--border-hot); }
.toolbar__opt.is-active { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 10px rgb(108 140 255 / 0.3); }

.listing { border: 1px solid var(--border); border-radius: 12px; background: rgb(18 19 30 / 0.5); overflow: hidden; }
.listing::before {
    content: "index  /  no. · preview · demo · category · date"; display: block; padding: 10px 20px; border-bottom: 1px solid var(--border);
    font: 400 11px/1 var(--mono); letter-spacing: 0.14em; color: var(--dim); white-space: pre; overflow: hidden;
}
.post--card {
    display: grid; grid-template-columns: 64px minmax(160px, 240px) minmax(0, 1fr) 190px;
    grid-template-areas: "num thumb title cat" "num thumb excerpt date" "num thumb actions date";
    grid-template-rows: auto auto 1fr; gap: 6px 24px; align-items: start; padding: 18px 20px;
    border-bottom: 1px solid var(--border); transition: background 250ms ease, box-shadow 250ms ease;
}
.post--card:last-child { border-bottom: 0; }
.post--card:hover { background: var(--glass); box-shadow: inset 2px 0 0 var(--accent); }
.post--card .post__body, .post--card .post__meta { display: contents; }
.post__media { grid-area: thumb; display: block; aspect-ratio: 4 / 3; overflow: hidden; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-2); transition: border-color 250ms ease, box-shadow 250ms ease; }
.post--card:hover .post__media { border-color: var(--border-hot); box-shadow: 0 10px 30px -12px rgb(108 140 255 / 0.4); }
.post__thumb { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.post__num { grid-area: num; padding-top: 4px; font: 400 13px/1 var(--mono); color: var(--accent); }
.post__cat { grid-area: cat; justify-self: end; padding: 3px 8px; border: 1px solid var(--border); border-radius: 4px; font: 400 12px/1.4 var(--mono); color: var(--text); text-decoration: none; }
.post__cat:hover { border-color: var(--accent); color: var(--accent); }
.post__date { grid-area: date; justify-self: end; font: 400 12px/1.4 var(--mono); color: var(--dim); }
.post__title { grid-area: title; margin: 0; font: 700 clamp(22px, 2vw, 28px)/1.15 var(--sans); letter-spacing: -0.01em; }
.post__title a { text-decoration: none; }
.post__title a:hover { color: #fff; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 5px; }
.post__excerpt { grid-area: excerpt; max-width: 70ch; margin: 0; color: var(--dim); font-size: 15px; line-height: 1.55; }
.post__actions { grid-area: actions; display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--border-hot); border-radius: 6px; font: 400 12px/1.2 var(--mono); letter-spacing: 0.04em; text-decoration: none; color: var(--text); transition: border-color 200ms ease, box-shadow 200ms ease; }
.btn:hover { border-color: var(--accent); box-shadow: 0 0 14px rgb(108 140 255 / 0.3); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--bg); font-weight: 700; }
.btn--primary:hover { box-shadow: 0 0 20px rgb(108 140 255 / 0.55); }

.pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 28px; font: 400 13px/1 var(--mono); }
.pager__link { min-width: 38px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 6px; text-align: center; text-decoration: none; }
.pager__link:hover { border-color: var(--border-hot); }
.pager__link.is-active { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 12px rgb(108 140 255 / 0.3); }

/* ── one post: spec sheet beside a sticky screenshot ────────────────────── */
.post--full { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 0 clamp(28px, 4vw, 56px); align-items: start; }
.post--full > * { grid-column: 1 / -1; }
.post__header { padding: 8px 0 32px; border-bottom: 1px solid var(--border); margin-bottom: 32px; }
.post--full .post__meta { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 0 0 14px; align-items: center; }
.post--full .post__num { padding: 0; }
.post--full .post__cat, .post--full .post__date { justify-self: auto; }
.post--full .post__title { margin: 0 0 14px; font: 700 clamp(44px, 6vw, 84px)/0.95 var(--serif); color: var(--gold); letter-spacing: 0; }
.post--full .post__excerpt { max-width: 68ch; font-size: 18px; color: #c4c8d8; }
.post--full .post__actions { margin-top: 20px; }
.post--full .post__actions .btn { padding: 10px 16px; font-size: 13px; }
.post__shot { grid-column: 1; position: sticky; top: 24px; margin: 0; }
.post__zoom { display: block; max-height: calc(100vh - 110px); overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-2); cursor: zoom-in; box-shadow: 0 0 40px rgb(108 140 255 / 0.08); transition: border-color 250ms ease; }
.post__zoom:hover { border-color: var(--border-hot); }
.post__zoom img { width: 100%; }
.post__caption { margin-top: 10px; font: 400 12px/1.4 var(--mono); color: var(--dim); }
.post__doc { grid-column: 2; }
.tags, .post__nav { grid-column: 2; }

.doc { font-size: 16px; line-height: 1.7; color: #d2d5e2; }
.doc h2 { display: flex; align-items: baseline; gap: 12px; margin: 44px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); font: 900 24px/1.2 var(--sans); color: var(--text); }
.doc h2::before { content: "▸"; font: 400 14px/1 var(--mono); color: var(--accent); }
.doc > :first-child { margin-top: 0; }
.doc h3 { margin: 28px 0 8px; font: 700 18px/1.3 var(--sans); color: var(--text); }
.doc h4, .doc h5, .doc h6 { margin: 22px 0 6px; font: 400 13px/1.3 var(--mono); color: var(--accent); }
.doc p, .doc ul, .doc ol { margin: 0 0 14px; }
.doc li::marker { color: var(--accent); }
.doc strong { color: #fff; }
.doc a { color: var(--accent); text-underline-offset: 3px; }
.doc a:hover { color: #9db2ff; }
.doc code { padding: 1px 6px; border: 1px solid var(--border); border-radius: 4px; background: rgb(0 0 0 / 0.3); color: #c9d4ff; }
.doc pre { margin: 0 0 18px; padding: 14px 16px; overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; background: rgb(0 0 0 / 0.4); }
.doc pre code { padding: 0; border: 0; background: none; }
.doc blockquote { margin: 0 0 18px; padding: 14px 18px; border: 1px solid var(--border); border-left: 2px solid var(--accent-2); border-radius: 8px; background: var(--glass); color: #dcdff0; }
.doc blockquote p:last-child { margin-bottom: 0; }
.doc hr { margin: 32px 0; border: 0; border-top: 1px solid var(--border); }
.doc-table { margin: 0 0 18px; overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; }
.doc table { width: 100%; border-collapse: collapse; font-size: 14px; }
.doc th, .doc td { padding: 8px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.doc tr:last-child td { border-bottom: 0; }
.doc th { font: 400 11px/1.2 var(--mono); letter-spacing: 0.12em; text-transform: lowercase; color: var(--accent); background: rgb(0 0 0 / 0.25); }
.doc td:first-child { font-family: var(--mono); font-size: 13px; color: var(--dim); white-space: nowrap; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 32px 0 0; padding: 0; list-style: none; }
.tags__item { padding: 3px 9px; border: 1px solid var(--border); border-radius: 4px; font: 400 12px/1.5 var(--mono); color: var(--dim); }
.tags__item::before { content: "#"; color: var(--accent); }
.post__nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 40px; }
.post__nav-link { padding: 14px 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--glass); font-weight: 700; text-decoration: none; transition: border-color 200ms ease; }
.post__nav-link:hover { border-color: var(--accent); }
.post__nav-link--older { grid-column: 2; text-align: right; }
.post__nav-label { display: block; font: 400 11px/1.4 var(--mono); letter-spacing: 0.12em; color: var(--accent); }

.notice { padding: 18px 20px; border: 1px solid var(--border); border-radius: 10px; background: var(--glass); font-family: var(--mono); font-size: 14px; }
.notice p { margin: 0; }
.notice a { color: var(--accent); }
.notice--error { border-color: rgb(255 120 140 / 0.5); color: #ffb0bd; }
.notice--error p::before { content: "error: "; color: #ff7a8f; }

.colophon { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding: 20px 0 40px; border-top: 1px solid var(--border); color: var(--dim); font: 400 12px/1.5 var(--mono); }
.colophon p { margin: 0; }
.colophon a { color: var(--accent); }

/* ── screenshot dialog ──────────────────────────────────────────────────── */
.zoom { width: min(1480px, 96vw); max-width: none; height: 94vh; max-height: none; padding: 0; border: 1px solid var(--border-hot); border-radius: 12px; background: var(--bg); color: var(--text); box-shadow: 0 0 60px rgb(108 140 255 / 0.2); }
.zoom::backdrop { background: rgb(6 7 14 / 0.85); backdrop-filter: blur(6px); }
.zoom__bar { position: sticky; top: 0; z-index: 1; display: flex; justify-content: flex-end; padding: 10px; border-bottom: 1px solid var(--border); background: var(--bg-2); }
.zoom__close { padding: 8px 14px; border: 1px solid var(--accent); border-radius: 6px; background: transparent; color: var(--accent); font: 400 13px/1 var(--mono); cursor: pointer; }
.zoom__close:hover { background: var(--accent); color: var(--bg); }
.zoom__scroll { height: calc(94vh - 58px); overflow: auto; }
.zoom__img { width: 100%; }

@media (max-width: 1020px) {
    .post--card { grid-template-columns: 48px minmax(140px, 200px) minmax(0, 1fr); grid-template-areas: "num thumb title" "num thumb excerpt" "num thumb actions" "num thumb meta"; }
    .post--card .post__meta { display: flex; grid-area: meta; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 0; }
    .post--card .post__num { display: none; }
    .post--card .post__cat, .post--card .post__date { justify-self: auto; }
    .post--full { grid-template-columns: minmax(0, 1fr); }
    .post__shot { position: static; margin-bottom: 32px; }
    .post__zoom { max-height: 560px; }
    .post__doc, .tags, .post__nav { grid-column: 1; }
}
@media (max-width: 720px) {
    .page { padding: 0 16px; }
    .masthead__inner { grid-template-columns: minmax(0, 1fr); }
    .masthead__count { justify-self: start; text-align: left; }
    .listing::before { content: "index"; }
    .post--card { grid-template-columns: minmax(0, 1fr); grid-template-areas: "thumb" "meta" "title" "excerpt" "actions"; padding: 16px; }
    .categories__list { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
    .categories__link { flex: none; white-space: nowrap; }
    .post__nav { grid-template-columns: 1fr; }
    .post__nav-link--older { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
.doc p, .doc li, .doc blockquote, .post__excerpt { overflow-wrap: break-word; }

/* long words and URLs in the doc and comments wrap instead of widening the page */
.doc p, .doc li, .doc blockquote, .doc td, .doc th, .comment__body { overflow-wrap: anywhere; }
.doc pre, .doc-table { max-width: 100%; }
