/* cyberdeath.net - public site styles. System fonts only (no third-party requests). */
:root {
  --bg: #0c0f14;
  --bg-2: #11151c;
  --surface: #161b24;
  --surface-2: #1d2430;
  --border: #283142;
  --text: #e7eaf0;
  --muted: #98a2b3;
  --accent: #f0a431;
  --accent-ink: #1a1204;
  --accent-soft: rgba(240, 164, 49, 0.14);
  --link: #ffbe5c;
  --ok: #3ccf8e;
  --warn: #f5c451;
  --danger: #ff6b6b;
  --code-bg: #0a0d12;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.25);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f5f6f8;
  --bg-2: #eceef2;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --border: #dde1e8;
  --text: #161a22;
  --muted: #5d6676;
  --accent: #d9860b;
  --accent-ink: #ffffff;
  --accent-soft: rgba(217, 134, 11, 0.12);
  --link: #b36a00;
  --code-bg: #f3f4f7;
  --shadow: 0 1px 2px rgba(20,30,50,.06), 0 8px 24px rgba(20,30,50,.06);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.65 var(--font);
  background-image: radial-gradient(1200px 400px at 50% -200px, var(--accent-soft), transparent 70%);
  background-repeat: no-repeat;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; }
h1, h2, h3, h4 { line-height: 1.25; margin: 1.6em 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.8rem, 1.2rem + 2vw, 2.5rem); margin-top: .2em; }
h2 { font-size: 1.5rem; } h3 { font-size: 1.2rem; } h4 { font-size: 1.05rem; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.skip-link { position: absolute; left: -9999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }

/* ---- Header ------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); margin-right: auto; }
.brand img { border-radius: 50%; background: #fff; border: 2px solid var(--accent); width: 44px; height: 44px; object-fit: cover; }
.brand-text { font-weight: 800; font-size: 1.15rem; letter-spacing: .08em; text-transform: none; }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a { color: var(--muted); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 500; }
.site-nav a:hover { color: var(--text); background: var(--surface-2); }
.site-nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); box-shadow: inset 0 -2px 0 var(--accent); }
.nav-search input {
  width: 170px; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-size: .9rem;
}
.nav-search input:focus { border-color: var(--accent); outline: none; width: 220px; }
.theme-toggle { background: none; border: 1px solid var(--border); color: var(--muted); border-radius: 999px; width: 36px; height: 36px; display: grid; place-items: center; cursor: pointer; }
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.nav-toggle, .nav-toggle-label { display: none; }

@media (max-width: 820px) {
  .nav-toggle-label { display: flex; flex-direction: column; gap: 5px; cursor: pointer; padding: 10px; }
  .nav-toggle-label span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 64px; flex-direction: column; align-items: stretch;
    background: var(--bg-2); border-bottom: 1px solid var(--border); padding: 12px 16px 16px;
  }
  .nav-toggle:checked ~ .site-nav { display: flex; }
  .nav-search input, .nav-search input:focus { width: 100%; margin: 6px 0; }
}

/* ---- Layout ------------------------------------------------------------- */
.main { flex: 1; padding-top: 28px; padding-bottom: 56px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 32px; align-items: start; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }
.section-head { display: flex; align-items: baseline; justify-content: space-between; }
.section-head h2 { margin: 0 0 14px; font-size: 1.1rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.page-head { margin-bottom: 20px; }
.page-head h1 { margin-bottom: .2em; }

/* ---- Hero --------------------------------------------------------------- */
.hero {
  display: flex; gap: 28px; align-items: center; padding: 28px; margin-bottom: 36px;
  background: linear-gradient(135deg, var(--surface), var(--bg-2)); border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 6px); box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.hero::after { content: ""; position: absolute; inset: auto -60px -80px auto; width: 260px; height: 260px; background: radial-gradient(circle, var(--accent-soft), transparent 70%); pointer-events: none; }
.hero-logo { width: 128px; height: 128px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); flex-shrink: 0; object-fit: cover; }
.hero-title { margin: 0; text-transform: none; letter-spacing: .08em; font-weight: 900; }
.hero-tagline { color: var(--accent); font-weight: 600; margin: .2em 0 .6em; }
.hero-intro { color: var(--muted); max-width: 60ch; }
@media (max-width: 600px) { .hero { flex-direction: column; text-align: center; padding: 24px 16px; } .hero-logo { width: 96px; height: 96px; } }

/* ---- Cards ------------------------------------------------------------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.card {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); box-shadow: var(--shadow); }
.card.is-pinned { border-color: color-mix(in srgb, var(--accent) 60%, var(--border)); }
.card-media { display: block; text-decoration: none; aspect-ratio: 16 / 9; background: var(--surface-2); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-placeholder {
  display: grid; place-items: center; width: 100%; height: 100%; font-weight: 800; font-size: 1.05rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent); background: repeating-linear-gradient(135deg, var(--surface-2) 0 14px, var(--surface) 14px 28px);
}
.card-placeholder span { padding: 6px 14px; border: 2px solid var(--accent); border-radius: 8px; background: var(--surface); }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; }
.card-title { margin: 0; font-size: 1.12rem; }
.card-title a { color: var(--text); text-decoration: none; }
.card-title a:hover { color: var(--accent); }
.card-summary { margin: 0; color: var(--muted); font-size: .93rem; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .82rem; color: var(--muted); }
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 600; letter-spacing: .02em;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); text-decoration: none;
}
a.badge:hover { color: var(--accent); border-color: var(--accent); }
.badge-accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* ---- Sidebar ------------------------------------------------------------- */
.sidebar { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 84px; }
@media (max-width: 900px) { .sidebar { position: static; } }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.panel-title { margin: 0 0 10px; font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.cat-list { list-style: none; margin: 0; padding: 0; }
.cat-list a { display: flex; justify-content: space-between; padding: 7px 10px; margin: 0 -10px; border-radius: 8px; color: var(--text); text-decoration: none; }
.cat-list a:hover, .cat-list a[aria-current="page"] { background: var(--surface-2); color: var(--accent); }
.count { color: var(--muted); font-size: .85rem; }

/* ---- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 10px; font: inherit; font-weight: 600; font-size: .92rem;
  background: var(--accent); color: var(--accent-ink); border: 1px solid transparent; text-decoration: none; cursor: pointer;
}
.btn:hover { filter: brightness(1.08); color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 6px 12px; font-size: .85rem; }

/* ---- Article ------------------------------------------------------------- */
.article { max-width: 780px; margin: 0 auto; }
.article-head { margin-bottom: 24px; }
.article-head h1 { margin: .35em 0 .3em; }
.lead { font-size: 1.15rem; color: var(--muted); margin: 0 0 1em; }
.cover { margin: 0 0 28px; }
.cover img { border-radius: var(--radius); border: 1px solid var(--border); width: 100%; }
.article-foot { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--border); }

.prose { font-size: 1.05rem; overflow-wrap: break-word; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose pre, .prose table, .prose figure { margin: 0 0 1.15em; }
.prose h2 { padding-bottom: .3em; border-bottom: 1px solid var(--border); }
.prose h2::before { content: ""; display: inline-block; width: 4px; height: .9em; background: var(--accent); margin-right: 10px; border-radius: 2px; vertical-align: -0.05em; }
.prose img { border-radius: 10px; border: 1px solid var(--border); display: block; margin: 1.2em auto; }
.prose blockquote { border-left: 4px solid var(--accent); background: var(--surface); margin-left: 0; padding: 12px 18px; border-radius: 0 10px 10px 0; color: var(--muted); }
.prose ul, .prose ol { padding-left: 1.5em; }
.prose li { margin: .25em 0; }
.prose li[data-list="bullet"] { list-style-type: disc; }
.prose code {
  font-family: var(--mono); font-size: .88em; background: var(--surface-2); border: 1px solid var(--border);
  padding: .1em .4em; border-radius: 6px;
}
.prose code.copyable { cursor: copy; }
.prose code.copied { border-color: var(--ok); color: var(--ok); }
.code-wrap { position: relative; margin: 0 0 1.15em; }
.code-wrap pre { margin: 0; }
.prose pre {
  font-family: var(--mono); font-size: .9rem; line-height: 1.55; background: var(--code-bg); color: var(--text);
  border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 10px;
  padding: 16px 18px; overflow-x: auto; white-space: pre; tab-size: 4;
}
.prose pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.copy-btn {
  position: absolute; top: 8px; right: 8px; padding: 4px 10px; font: 600 .75rem var(--font); border-radius: 7px;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); cursor: pointer; opacity: .85;
}
.copy-btn:hover { color: var(--accent); border-color: var(--accent); opacity: 1; }
.copy-btn.ok { color: var(--ok); border-color: var(--ok); }
.prose table { width: 100%; border-collapse: collapse; font-size: .95rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.prose th { background: var(--surface-2); }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }
.prose iframe, .prose .ql-video { display: block; width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 10px; margin: 1.2em 0; background: #000; }
.prose .ql-align-center { text-align: center; }
.prose .ql-align-right { text-align: right; }
.prose .ql-align-justify { text-align: justify; }
.prose .ql-indent-1 { padding-left: 3em; } .prose .ql-indent-2 { padding-left: 6em; } .prose .ql-indent-3 { padding-left: 9em; }
.prose .ql-indent-4 { padding-left: 12em; } .prose .ql-indent-5 { padding-left: 15em; }
.prose .callout { padding: 12px 16px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); }
.prose .callout-tip { border-color: var(--ok); } .prose .callout-warn { border-color: var(--warn); }
.prose mark { background: var(--accent-soft); color: inherit; padding: 0 .2em; border-radius: 3px; }
.prose kbd { font-family: var(--mono); font-size: .85em; padding: .1em .45em; border: 1px solid var(--border); border-bottom-width: 3px; border-radius: 5px; background: var(--surface-2); }

/* ---- Lists, search, alerts ----------------------------------------------- */
.pagination { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 32px; }
.empty { padding: 40px; text-align: center; color: var(--muted); border: 1px dashed var(--border); border-radius: var(--radius); }
.search-big { display: flex; gap: 10px; max-width: 620px; }
.search-big input { flex: 1; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; }
.search-big input:focus { outline: none; border-color: var(--accent); }
.result-list { list-style: none; padding: 0; margin: 16px 0; }
.result-list li { padding: 14px 0; border-bottom: 1px solid var(--border); }
.result-title { font-weight: 700; font-size: 1.1rem; margin-right: 8px; }
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 20px; border: 1px solid var(--border); background: var(--surface); }
.alert-warn { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, var(--surface)); }
.notfound { text-align: center; padding: 60px 0; }
.notfound-code { font-size: 6rem; font-weight: 900; margin: 0; color: var(--accent); line-height: 1; letter-spacing: .05em; }

/* ---- Footer ------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-2); padding: 28px 0 18px; }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-inner p { margin: 6px 0 0; }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.footer-links a { color: var(--muted); text-decoration: none; font-weight: 500; }
.footer-links a:hover { color: var(--accent); }
.copyright { margin-top: 18px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
