/* Space Kitty Archive: design system */
:root {
  --bg: #06060b;
  --bg-2: #0c0c16;
  --panel: rgba(20, 20, 36, 0.72);
  --panel-solid: #12121f;
  --line: rgba(160, 150, 255, 0.14);
  --line-strong: rgba(160, 150, 255, 0.28);
  --text: #e9e8f5;
  --muted: #a3a1bd;
  --faint: #6f6d8c;
  --violet: #9d8cff;
  --violet-2: #6e5bff;
  --cyan: #5ee7ff;
  --gold: #ffcf6e;
  --green: #6ee7a8;
  --red: #ff7a8a;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, ui-serif, serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', 'JetBrains Mono', Menlo, Consolas, 'Liberation Mono', monospace;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f6fc;
    --bg-2: #efedf9;
    --panel: rgba(255, 255, 255, 0.82);
    --panel-solid: #ffffff;
    --line: rgba(70, 55, 170, 0.12);
    --line-strong: rgba(70, 55, 170, 0.24);
    --text: #17162a;
    --muted: #55536f;
    --faint: #8a88a3;
    --violet: #5b47e8;
    --violet-2: #4733d6;
    --cyan: #0b8fb0;
    --gold: #a86b00;
    --green: #127a4a;
    --red: #c0263d;
    --shadow: 0 10px 30px rgba(40, 30, 110, 0.10);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font: 16px/1.6 var(--sans);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(110, 91, 255, 0.20), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(94, 231, 255, 0.10), transparent 60%),
    radial-gradient(700px 500px at 50% 110%, rgba(255, 207, 110, 0.07), transparent 60%),
    var(--bg);
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.55;
  background-image:
    radial-gradient(1px 1px at 20px 30px, rgba(255,255,255,.55), transparent 60%),
    radial-gradient(1px 1px at 120px 80px, rgba(255,255,255,.35), transparent 60%),
    radial-gradient(1.5px 1.5px at 200px 150px, rgba(200,190,255,.45), transparent 60%),
    radial-gradient(1px 1px at 330px 40px, rgba(255,255,255,.30), transparent 60%),
    radial-gradient(1px 1px at 400px 210px, rgba(160,240,255,.35), transparent 60%),
    radial-gradient(1px 1px at 520px 120px, rgba(255,255,255,.25), transparent 60%);
  background-size: 560px 260px;
}
@media (prefers-color-scheme: light) { body::after { opacity: 0.0; } }

a { color: var(--violet); text-decoration: none; }
a:hover { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.4rem); }
h2 { font-size: clamp(1.45rem, 2.6vw, 2rem); margin-top: 1.6em; }
h3 { font-size: 1.2rem; margin-top: 1.4em; }
p { margin: 0 0 1em; }
code, kbd, pre, .mono { font-family: var(--mono); font-size: .88em; }
code { background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px; padding: .08em .4em; }
pre { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1em 1.1em; overflow-x: auto; line-height: 1.5; }
pre code { background: none; border: 0; padding: 0; font-size: .84rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.2rem 0; }
table { width: 100%; border-collapse: collapse; font-size: .94rem; margin: 1em 0 1.4em; }
th, td { text-align: left; padding: .55em .7em; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; }
blockquote { margin: 1em 0; padding: .6em 1em; border-left: 3px solid var(--violet); background: var(--panel); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--muted); }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 99; background: var(--panel-solid); padding: .5rem 1rem; border-radius: 8px; }
.wrap { width: min(1180px, 100% - 2.5rem); margin-inline: auto; }
.narrow { width: min(860px, 100% - 2.5rem); margin-inline: auto; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; backdrop-filter: saturate(140%) blur(14px); -webkit-backdrop-filter: saturate(140%) blur(14px); background: color-mix(in srgb, var(--bg) 72%, transparent); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 1.2rem; height: 64px; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--text); font-family: var(--serif); font-size: 1.18rem; font-weight: 600; white-space: nowrap; }
.brand:hover { color: var(--text); text-decoration: none; }
.brand img { width: 34px; height: 34px; }
.brand small { font-family: var(--sans); font-size: .7rem; color: var(--faint); letter-spacing: .14em; text-transform: uppercase; font-weight: 600; }
.nav { display: flex; gap: .2rem; margin-left: auto; align-items: center; }
.nav a { color: var(--muted); padding: .45rem .7rem; border-radius: 8px; font-size: .94rem; }
.nav a:hover, .nav a[aria-current='page'] { color: var(--text); background: var(--panel); text-decoration: none; }
.nav .cta { color: var(--bg); background: linear-gradient(135deg, var(--violet), var(--cyan)); font-weight: 600; }
.nav .cta:hover { color: var(--bg); filter: brightness(1.08); }
.header-search { flex: 0 1 280px; }
.header-search input { width: 100%; }
@media (max-width: 880px) { .header-search { display: none; } .nav a.hide-sm { display: none; } }

/* Forms */
input[type='search'], input[type='text'], select {
  font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line-strong);
  border-radius: 10px; padding: .55rem .8rem; outline: none;
}
input[type='search']:focus, select:focus { border-color: var(--violet); box-shadow: 0 0 0 3px color-mix(in srgb, var(--violet) 25%, transparent); }
.btn { display: inline-flex; align-items: center; gap: .5rem; font: inherit; font-weight: 600; cursor: pointer; border-radius: 11px; padding: .7rem 1.15rem; border: 1px solid var(--line-strong); color: var(--text); background: var(--panel); }
.btn:hover { text-decoration: none; border-color: var(--violet); color: var(--text); }
.btn.primary { color: #0b0a14; border: 0; background: linear-gradient(135deg, var(--violet), var(--cyan)); }
.btn.primary:hover { filter: brightness(1.08); color: #0b0a14; }
.btn.gold { color: #1a1200; border: 0; background: linear-gradient(135deg, #ffe2a1, var(--gold)); }
.btn[disabled] { opacity: .55; cursor: progress; }

/* Hero */
.hero { padding: 4.5rem 0 2.5rem; position: relative; }
.hero .eyebrow, .eyebrow { display: inline-flex; gap: .5rem; align-items: center; font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; color: var(--cyan); font-weight: 700; margin-bottom: 1rem; }
.hero h1 { max-width: 15ch; background: linear-gradient(120deg, var(--text) 30%, var(--violet) 70%, var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lede { font-size: 1.2rem; color: var(--muted); max-width: 62ch; }
.hero .actions { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.6rem; }
.hero-grid { display: grid; grid-template-columns: 1.25fr .9fr; gap: 2.5rem; align-items: center; }
@media (max-width: 960px) { .hero-grid { grid-template-columns: 1fr; } }
.terminal { background: var(--panel-solid); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.terminal header { display: flex; gap: 6px; padding: .7rem .9rem; border-bottom: 1px solid var(--line); }
.terminal header i { width: 11px; height: 11px; border-radius: 50%; background: var(--line-strong); display: block; }
.terminal pre { margin: 0; border: 0; border-radius: 0; background: transparent; font-size: .8rem; }
.t-dim { color: var(--faint); } .t-violet { color: var(--violet); } .t-cyan { color: var(--cyan); } .t-gold { color: var(--gold); } .t-green { color: var(--green); }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: 2rem 0 1rem; }
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { padding: 1.1rem 1.2rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.stat b { display: block; font-family: var(--serif); font-size: 1.9rem; line-height: 1.1; }
.stat span { color: var(--muted); font-size: .86rem; }

/* Cards & grids */
.section { padding: 2.2rem 0; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.section-head h2 { margin: 0; }
.section-head p { color: var(--muted); margin: 0; max-width: 70ch; }
.grid { display: grid; gap: 1rem; }
.grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); }
@media (max-width: 520px) { .grid.cols-2 { grid-template-columns: 1fr; } }
.card { position: relative; display: block; padding: 1.25rem 1.3rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--text); transition: border-color .15s ease, transform .15s ease; }
a.card:hover { text-decoration: none; color: var(--text); border-color: var(--line-strong); transform: translateY(-2px); }
.card h3 { margin: 0 0 .35rem; font-size: 1.12rem; }
.card p { color: var(--muted); font-size: .94rem; margin: 0; }
.card .meta { margin-top: .9rem; display: flex; gap: .5rem; flex-wrap: wrap; }
.card.feature { background: linear-gradient(160deg, color-mix(in srgb, var(--violet) 14%, var(--panel)), var(--panel)); }

.badge { display: inline-flex; align-items: center; gap: .3rem; font-size: .74rem; font-weight: 600; letter-spacing: .02em; padding: .2rem .55rem; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); white-space: nowrap; }
.badge.price { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 40%, transparent); }
.badge.free { color: var(--green); border-color: color-mix(in srgb, var(--green) 40%, transparent); }
.badge.verified { color: var(--cyan); border-color: color-mix(in srgb, var(--cyan) 40%, transparent); }
.badge.kind { color: var(--violet); }

/* Paper list */
.papers { list-style: none; padding: 0; margin: 0; }
.paper { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.paper:last-child { border-bottom: 0; }
.paper .title { font-family: var(--serif); font-size: 1.06rem; font-weight: 600; color: var(--text); }
.paper .title:hover { color: var(--cyan); }
.paper .byline { color: var(--muted); font-size: .88rem; margin-top: .15rem; }
.paper .snippet { color: var(--muted); font-size: .9rem; margin-top: .35rem; }
.paper .snippet mark { background: color-mix(in srgb, var(--violet) 30%, transparent); color: var(--text); border-radius: 3px; padding: 0 .15em; }
.paper .ids { display: flex; gap: .45rem; flex-wrap: wrap; margin-top: .45rem; }

/* Layout with sidebar */
.with-aside { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 2.2rem; align-items: start; }
@media (max-width: 980px) { .with-aside { grid-template-columns: 1fr; } }
.aside { position: sticky; top: 84px; display: grid; gap: 1rem; }

.breadcrumbs { font-size: .86rem; color: var(--faint); margin: 1.6rem 0 .6rem; }
.breadcrumbs a { color: var(--muted); }
.page-head { padding: .5rem 0 1.2rem; border-bottom: 1px solid var(--line); margin-bottom: 1.4rem; }
.page-head .lede { color: var(--muted); font-size: 1.08rem; max-width: 75ch; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; font-size: .92rem; }
.kv dt { color: var(--faint); }
.kv dd { margin: 0; word-break: break-word; }

/* Dossier */
.toc { list-style: none; padding: 0; margin: 0; font-size: .92rem; }
.toc li { padding: .22rem 0; color: var(--muted); }
.toc li.l3 { padding-left: 1rem; font-size: .86rem; }
.paywall { border: 1px solid color-mix(in srgb, var(--gold) 35%, var(--line)); background: linear-gradient(160deg, color-mix(in srgb, var(--gold) 9%, var(--panel)), var(--panel)); border-radius: var(--radius); padding: 1.4rem; }
.paywall h3 { margin-top: 0; }
.paywall .price { font-family: var(--serif); font-size: 2.2rem; color: var(--gold); }
.paywall .status { font-size: .9rem; color: var(--muted); min-height: 1.4em; margin-top: .6rem; }
.paywall .status.error { color: var(--red); }
.paywall .status.ok { color: var(--green); }
.dossier-body { font-size: 1.04rem; }
.dossier-body h2 { border-top: 1px solid var(--line); padding-top: 1.2rem; }
.dossier-body sup a, a.cite { font-size: .72em; font-family: var(--mono); color: var(--cyan); }
.dossier-body table { font-size: .9rem; }
.locked { position: relative; max-height: 380px; overflow: hidden; }
.locked::after { content: ''; position: absolute; inset: 40% 0 0; background: linear-gradient(transparent, var(--bg)); }
.teaser-claims li { margin-bottom: .5rem; color: var(--muted); }

/* Docs */
.endpoint { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .9rem 1rem; margin: .8rem 0; background: var(--panel); }
.endpoint .sig { font-family: var(--mono); font-size: .9rem; }
.method { font-family: var(--mono); font-size: .74rem; font-weight: 700; padding: .15rem .45rem; border-radius: 6px; background: color-mix(in srgb, var(--cyan) 18%, transparent); color: var(--cyan); margin-right: .5rem; }
.method.post { background: color-mix(in srgb, var(--violet) 22%, transparent); color: var(--violet); }

/* Footer */
.site-footer { margin-top: 4rem; border-top: 1px solid var(--line); padding: 2.5rem 0 3rem; color: var(--muted); font-size: .9rem; }
.site-footer .cols { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 2rem; }
@media (max-width: 760px) { .site-footer .cols { grid-template-columns: 1fr 1fr; } }
.site-footer h4 { font-family: var(--sans); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin-bottom: .8rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .35rem; }
.site-footer a { color: var(--muted); }
.fineprint { margin-top: 2rem; font-size: .8rem; color: var(--faint); max-width: 100ch; }

.notice { border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: .8rem 1rem; background: var(--panel); color: var(--muted); font-size: .92rem; }
.notice.warn { border-color: color-mix(in srgb, var(--gold) 45%, transparent); }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: .86rem; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.spacer { height: 1rem; }
.pager { display: flex; gap: .6rem; justify-content: space-between; margin-top: 1.4rem; }
.search-big { display: flex; gap: .6rem; margin: 1rem 0 1.6rem; }
.search-big input { flex: 1; font-size: 1.05rem; padding: .8rem 1rem; }
.filters { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.domain-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--violet) 18%, transparent); color: var(--violet); font-family: var(--serif); font-weight: 700; margin-bottom: .8rem; }
.tags { display: flex; gap: .35rem; flex-wrap: wrap; }

.mt { margin-top: .8rem; } .mt-lg { margin-top: 1.6rem; } .mb0 { margin-bottom: 0; }
.paper .credit { margin: .15rem 0 0; font-size: .74rem; color: var(--muted); }
