/* RootSploit: one stylesheet. Colour tokens on :root. */
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-latin-var.woff2?v=3100e775") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #141414;
  --text: #e2e8f0;
  --text-bright: #f1f5f9;
  --text-code: #cbd5e1;
  --accent: #7c3aed;
  --accent-soft: rgba(124, 58, 237, 0.2);
  --accent-text: #a78bfa; /* lighter violet for small text: #7c3aed on #141414 is only 3.4:1 */
  --border: rgba(124, 58, 237, 0.15);
  --border-strong: rgba(124, 58, 237, 0.3);
  --code-bg: rgba(16, 16, 16, 0.9);
  --glow: 0 0 12px rgba(124, 58, 237, 0.2);
  --glow-hover: 0 0 18px rgba(124, 58, 237, 0.3);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Monaco, Menlo, "Ubuntu Mono", Consolas, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  overflow-wrap: break-word;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }

:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; border-radius: 4px; }

.container { width: 100%; max-width: 1280px; margin: 0 auto; padding-inline: 16px; }
.narrow { max-width: 896px; margin-inline: auto; }
main.container { padding-block: 32px; flex: 1; }
body { display: flex; flex-direction: column; min-height: 100vh; }

.skip-link { position: absolute; left: 8px; top: -60px; background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 6px; z-index: 10; }
.skip-link:focus { top: 8px; }

/* Header */
.site-header { padding-block: 16px; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo-link { display: inline-flex; border-radius: 4px; }
.logo-link img { height: 32px; width: auto; }
nav[aria-label="Main"] { display: flex; align-items: center; gap: 8px; font-size: 14px; }
nav[aria-label="Main"] a { text-decoration: none; padding: 8px 16px; border-radius: 8px; transition: color 0.2s, box-shadow 0.2s, background 0.2s; }
nav[aria-label="Main"] a:hover { color: var(--accent-text); }
nav[aria-label="Main"] a[aria-current="page"] {
  color: var(--text-bright);
  background: rgba(124, 58, 237, 0.08);
  box-shadow: 0 0 10px rgba(124, 58, 237, 0.25);
}

/* Headings */
h1 { font-size: 30px; line-height: 1.2; font-weight: 700; color: var(--text-bright); }
h2 { color: var(--text-bright); }
.page-intro { margin-bottom: 32px; }
.page-intro h1 { margin-bottom: 8px; }

/* Home cards */
.card-list { display: grid; gap: 24px; }
.card {
  position: relative;
  display: grid;
  grid-template-columns: 400px 1fr;
  background: rgba(20, 20, 20, 0.9);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--glow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card:hover, .card:focus-within { transform: translateY(-2px); box-shadow: var(--glow-hover); }
.card-media img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 8 / 5; }
.card-body { padding: 24px; display: flex; flex-direction: column; min-width: 0; }
.card-category { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--accent-text); margin-bottom: 8px; }
.card-title { font-size: 20px; line-height: 1.3; font-weight: 600; margin-bottom: 12px; }
.card-title a { text-decoration: none; color: var(--text-bright); transition: color 0.2s; }
.card-title a::after { content: ""; position: absolute; inset: 0; }
.card:hover .card-title a { color: var(--accent-text); }
.card-title a:focus-visible { outline: none; }
.card:has(.card-title a:focus-visible) { outline: 2px solid var(--accent-text); outline-offset: 3px; }
.card-excerpt {
  margin-bottom: 16px;
  display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.card-meta p, .post-meta { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 4px; }
.tag-list li { font-size: 12px; padding: 4px 8px; background: var(--accent-soft); color: var(--accent-text); border-radius: 999px; }
.icon { flex-shrink: 0; }
.accent { color: var(--accent-text); }
.bright { color: var(--text-bright); }

/* Post */
.post-wrap { max-width: 768px; margin-inline: auto; }
.back-link { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; margin-bottom: 32px; transition: color 0.2s; }
.back-link:hover { color: var(--accent-text); }
.post-header h1 { font-size: 36px; margin-bottom: 16px; }
.post-meta { flex-wrap: wrap; margin-bottom: 24px; }
.post-cover {
  width: 100%; height: auto; aspect-ratio: 8 / 5; object-fit: cover;
  border-radius: 8px; box-shadow: var(--glow); margin-bottom: 32px;
}
.post-tags { margin-top: 32px; }

.prose { max-width: 70ch; color: var(--text-code); line-height: 1.7; font-size: 17px; }
.prose > * + * { margin-top: 1.15em; }
.prose h2 { font-size: 26px; line-height: 1.3; margin-top: 2em; color: var(--text-bright); }
.prose h3 { font-size: 21px; line-height: 1.35; margin-top: 1.75em; color: var(--text); }
.prose h4 { font-size: 18px; margin-top: 1.5em; color: var(--text); }
.prose strong { color: var(--text-bright); }
.prose a { color: var(--accent-text); text-decoration: underline; text-decoration-color: rgba(167, 139, 250, 0.5); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--accent-text); }
.prose ul, .prose ol { padding-left: 1.5em; }
.prose ul { list-style: disc; }
.prose li + li { margin-top: 0.4em; }
.prose figure { margin-block: 1.75em; }
.prose img { border-radius: 6px; margin-inline: auto; }
.prose figcaption { margin-top: 8px; font-size: 14px; text-align: center; color: #94a3b8; }
.prose blockquote { margin-inline: 0; padding: 1rem 1.25rem; border-left: 4px solid var(--accent); background: rgba(16, 16, 16, 0.3); color: var(--text); }
.prose blockquote > * + * { margin-top: 0.75em; }
.prose hr { border: 0; border-top: 1px solid var(--border-strong); margin-block: 2em; }
.prose table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 15px; }
.prose th, .prose td { border: 1px solid var(--border-strong); padding: 6px 10px; text-align: left; }
code { font-family: var(--mono); font-size: 0.9em; background: rgba(16, 16, 16, 0.7); color: var(--text-code); padding: 0.15rem 0.4rem; border-radius: 4px; overflow-wrap: anywhere; }
pre {
  max-width: 100%; overflow-x: auto; background: var(--code-bg); border: 1px solid var(--border-strong);
  border-radius: 8px; padding: 1rem; font-size: 14px; line-height: 1.55; tab-size: 4;
}
pre code { background: transparent; padding: 0; font-size: inherit; overflow-wrap: normal; white-space: pre; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 48px; }
.pager a {
  display: flex; flex-direction: column; gap: 4px; text-decoration: none; padding: 16px;
  background: rgba(20, 20, 20, 0.9); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: var(--glow); transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.pager a:hover { transform: translateY(-2px); box-shadow: var(--glow-hover); }
.pager-next { text-align: right; grid-column: 2; }
.pager-label { font-size: 12px; color: var(--accent-text); }
.pager-title { font-weight: 600; color: var(--text-bright); }

/* About */
.about { padding-block: 16px; }
.about-hero { text-align: center; margin-bottom: 48px; }
.avatar { width: 192px; height: 192px; object-fit: cover; border-radius: 50%; margin: 0 auto 32px; box-shadow: var(--glow); }
.about-hero h1 { font-size: 36px; margin-bottom: 16px; }
.tagline { font-size: 18px; font-weight: 500; color: var(--accent-text); }
.panel { background: rgba(20, 20, 20, 0.9); border: 1px solid var(--border); border-radius: 8px; padding: 32px; margin-bottom: 32px; }
.panel.glow { box-shadow: var(--glow); }
.about-copy { font-size: 18px; line-height: 1.75; }
.about-copy p + p { margin-top: 24px; }
.expertise { padding: 24px; margin-bottom: 48px; transition: box-shadow 0.3s; }
.expertise:hover { box-shadow: var(--glow-hover); }
.h-sm { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 700; margin-bottom: 16px; }
.expertise ul { display: grid; gap: 12px; }
.expertise li { display: flex; align-items: flex-start; gap: 8px; }
.expertise li .icon { margin-top: 5px; }
.expertise strong { color: var(--accent-text); }
.panel h2:not(.h-sm) { font-size: 24px; font-weight: 700; margin-bottom: 24px; }
.profile-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.profile-card {
  display: block; text-align: center; text-decoration: none; padding: 16px;
  background: rgba(20, 20, 20, 0.9); border: 1px solid var(--border); border-radius: 8px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.profile-card:hover { transform: translateY(-2px); box-shadow: var(--glow-hover); }
.profile-icon { margin: 0 auto 12px; transition: transform 0.3s; }
.profile-card:hover .profile-icon { transform: scale(1.1); }
.profile-card h3 { font-weight: 700; color: var(--text-bright); margin-bottom: 8px; }
.profile-card p { font-size: 14px; margin-bottom: 12px; }
.profile-handle { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; color: var(--accent-text); }

/* 404 */
.notfound { text-align: center; padding-block: 64px; }
.notfound p { margin-top: 16px; }
.button { display: inline-block; padding: 10px 20px; background: var(--accent); color: #fff; text-decoration: none; border-radius: 8px; font-weight: 600; }
.button:hover { background: #6d28d9; }

/* Footer */
.site-footer { padding-block: 32px; margin-top: 48px; }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.footer-brand { display: flex; align-items: center; gap: 16px; }
.footer-mark { width: 48px; height: 48px; border-radius: 50%; box-shadow: var(--glow); }
.footer-name { font-weight: 700; color: var(--text-bright); text-decoration: none; }
.footer-brand p { font-size: 12px; }
.footer-social { display: flex; gap: 16px; }
.footer-social a { display: inline-flex; padding: 4px; transition: color 0.2s; }
.footer-social a:hover { color: var(--accent-text); }
.copyright { margin-top: 24px; padding-top: 24px; text-align: center; font-size: 14px; }

@media (max-width: 900px) {
  .profile-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
  .card { grid-template-columns: 1fr; }
  .card-media img { height: auto; }
  .card-body { padding: 20px; }
  .post-header h1 { font-size: 28px; }
  .about-hero h1 { font-size: 30px; }
  .panel { padding: 20px; }
  .about-copy { font-size: 17px; }
  .pager { grid-template-columns: 1fr; }
  .pager-next { grid-column: auto; }
  .footer-row { justify-content: center; flex-direction: column; text-align: left; }
}
@media (max-width: 480px) {
  .profile-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .card:hover, .card:focus-within, .pager a:hover, .profile-card:hover { transform: none; }
}

/* Template parity: header spans the full width; footer aligns with the content column */
.site-header .container { max-width: none; padding-inline: 36px; }
.site-footer .container { padding-inline: 0; }
@media (max-width: 767px) {
  .site-header .container { padding-inline: 16px; }
  .site-footer .container { padding-inline: 16px; }
}
