/* Fractiona blog — static stylesheet. Palette follows the public site shell
   (slate-50 / #0B1120 surfaces, sky accent). Light and dark follow the OS setting. */
:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --faint: #64748b;
  --border: #e2e8f0;
  --accent: #0369a1;
  --accent-soft: #e0f2fe;
  --code-bg: #f1f5f9;
  --shadow: 0 1px 2px rgb(15 23 42 / 0.06), 0 8px 24px rgb(15 23 42 / 0.06);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120;
    --surface: #111a2e;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --faint: #7c8ba1;
    --border: rgb(255 255 255 / 0.08);
    --accent: #7dd3fc;
    --accent-soft: rgb(56 189 248 / 0.12);
    --code-bg: #0f172a;
    --shadow: none;
  }
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  /* System stack (Inter first when installed): no web-font request, so nothing blocks render. */
  font:
    400 17px/1.7 Inter,
    system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    'Helvetica Neue',
    Arial,
    sans-serif;
  -webkit-font-smoothing: antialiased;
}
a {
  color: var(--accent);
  text-underline-offset: 3px;
}
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}
img {
  max-width: 100%;
  height: auto;
}
.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}
@media (min-width: 640px) {
  .wrap {
    padding: 0 24px;
  }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}
.site-header nav {
  display: flex;
  gap: 20px;
  font-size: 14px;
  font-weight: 500;
}
.site-header nav a {
  color: var(--muted);
  text-decoration: none;
}
.site-header nav a:hover {
  color: var(--text);
}

.intro {
  padding: 56px 0 32px;
  max-width: 760px;
}
.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
h1 {
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  text-wrap: balance;
}
.subtitle {
  color: var(--accent);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.4;
  margin: -4px 0 14px;
  text-wrap: balance;
}
.card-subtitle {
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}
.lede {
  color: var(--muted);
  font-size: 19px;
  margin: 0 0 24px;
}

.cards {
  list-style: none;
  padding: 0;
  margin: 0 0 72px;
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}
.card img {
  aspect-ratio: 3 / 2;
  object-fit: cover;
  width: 100%;
  display: block;
}
.card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 20px 22px;
}
.card-title {
  font-size: 20px;
  font-weight: 650;
  line-height: 1.3;
}
.card-desc {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}
.card-more {
  margin-top: auto;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}
.empty {
  color: var(--muted);
}

.kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: var(--faint);
  font-size: 13px;
  margin: 0;
}
.chip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  font-size: 12px;
}

.post {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 0 72px;
}
.crumbs {
  font-size: 13px;
  color: var(--faint);
  margin-bottom: 20px;
}
.crumbs a {
  color: var(--faint);
}
.post .kicker {
  margin-bottom: 14px;
}
.hero {
  margin: 8px 0 32px;
}
.hero img {
  display: block;
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--border);
}
.toc {
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 18px;
  margin: 0 0 32px;
  font-size: 15px;
}
.toc-title {
  font-weight: 600;
  margin: 0 0 4px;
}
.toc ol {
  margin: 0;
  padding-left: 20px;
}
/* Touch: each contents link gets a 48px target so adjacent entries are not mis-tapped. */
@media (max-width: 640px) {
  .toc a {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
  }
}

.prose h2 {
  font-size: 27px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 48px 0 12px;
  scroll-margin-top: 80px;
}
.prose h3 {
  font-size: 21px;
  margin: 32px 0 8px;
  scroll-margin-top: 80px;
}
.prose h4 {
  font-size: 18px;
  margin: 24px 0 8px;
}
.prose p,
.prose ul,
.prose ol {
  margin: 0 0 18px;
}
.prose li {
  margin: 6px 0;
}
.prose blockquote {
  margin: 24px 0;
  padding: 4px 20px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}
.prose code {
  font:
    0.88em ui-monospace,
    SFMono-Regular,
    Menlo,
    Consolas,
    'Liberation Mono',
    monospace;
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 5px;
}
.prose pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.55;
}
.prose pre code {
  background: none;
  padding: 0;
}
.prose figure {
  margin: 28px 0;
}
.prose figure img {
  display: block;
  margin: 0 auto;
  border-radius: 10px;
}
.prose figcaption {
  text-align: center;
  color: var(--faint);
  font-size: 14px;
  margin-top: 8px;
}
.table-wrap {
  overflow-x: auto;
  margin: 24px 0;
}
.prose table {
  border-collapse: collapse;
  width: 100%;
  font-size: 15px;
}
.prose th,
.prose td {
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}
.prose th {
  font-weight: 600;
}
.prose hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 40px 0;
}
.cite {
  font-size: 0.72em;
  line-height: 0;
}
.cite a {
  text-decoration: none;
}

.sources {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 15px;
}
.sources h2 {
  font-size: 20px;
  margin: 0 0 12px;
}
.sources li {
  margin: 8px 0;
  scroll-margin-top: 80px;
}
.sources li:target {
  background: var(--accent-soft);
  border-radius: 6px;
}
.badge {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
}
.accessed {
  color: var(--faint);
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0 40px;
  font-size: 14px;
  color: var(--faint);
}
.disclaimer {
  max-width: 760px;
  margin: 0 0 12px;
}
.footer-links a {
  color: var(--muted);
}
