/* ==========================================================================
   sol2lin.com — stylesheet
   Plain CSS, no framework. Light + dark themes via CSS custom properties.
   ========================================================================== */

:root {
  --bg: #ffffff;
  --bg-soft: #f6f8f9;
  --bg-code: #f3f5f7;
  --text: #1c2529;
  --text-muted: #5b6b73;
  --border: #e1e6e9;
  --accent: #0f4c5c;
  --accent-strong: #0a3642;
  --accent-soft: #e6f0f2;
  --link: #0b6e83;
  --warn: #9a5b00;
  --warn-soft: #fff6e5;
  --tip: #1d6b3a;
  --tip-soft: #eaf6ee;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --w-prose: 46rem;
  --w-wide: 68rem;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
}

/* Dark theme: follows OS unless the user picked one explicitly */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1417; --bg-soft: #161d21; --bg-code: #1a2227; --text: #e3e8ea; --text-muted: #9aa8af;
    --border: #273238; --accent: #6cc3d5; --accent-strong: #9ad8e5; --accent-soft: #15292f; --link: #7fd0e1;
    --warn: #f0b455; --warn-soft: #2a2213; --tip: #7fd19a; --tip-soft: #13261a;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1417; --bg-soft: #161d21; --bg-code: #1a2227; --text: #e3e8ea; --text-muted: #9aa8af;
  --border: #273238; --accent: #6cc3d5; --accent-strong: #9ad8e5; --accent-soft: #15292f; --link: #7fd0e1;
  --warn: #f0b455; --warn-soft: #2a2213; --tip: #7fd19a; --tip-soft: #13261a;
}

/* ---- Base --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 17px/1.65 var(--font-sans);
  display: flex; flex-direction: column; min-height: 100vh;
}
main { flex: 1; padding-block: 2.5rem 4rem; }
img, svg, video { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }
h1, h2, h3, h4 { line-height: 1.25; color: var(--text); margin: 2rem 0 .75rem; }
h1 { font-size: 2.1rem; letter-spacing: -.02em; margin-top: 0; }
h2 { font-size: 1.5rem; letter-spacing: -.01em; }
h3 { font-size: 1.2rem; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }

.container { width: 100%; max-width: var(--w-wide); margin-inline: auto; padding-inline: 1.25rem; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--accent); color: #fff; padding: .5rem 1rem; z-index: 10; }
.skip-link:focus { left: 1rem; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- Header ------------------------------------------------------------- */
.site-header { border-bottom: 1px solid var(--border); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { font-family: var(--font-mono); font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: .5rem; }
.brand-logo { width: 28px; height: 28px; flex: 0 0 auto; display: block; }
.brand-prompt { color: var(--accent); }
.brand-cursor { color: var(--accent); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .brand-cursor { animation: none; } }

.site-nav { display: flex; align-items: center; gap: .5rem; }
.site-nav ul { display: flex; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.site-nav a { display: block; padding: .4rem .7rem; border-radius: 6px; color: var(--text-muted); text-decoration: none; font-size: .95rem; }
.site-nav a:hover { color: var(--text); background: var(--bg-soft); }
.site-nav a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.theme-toggle { background: none; border: 1px solid var(--border); color: var(--text-muted); border-radius: 6px; padding: .35rem .45rem; cursor: pointer; line-height: 0; }
.theme-toggle:hover { color: var(--text); }
.nav-toggle { display: none; background: none; border: 0; padding: .5rem; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); margin: 4px 0; }

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--border); flex-direction: column; align-items: stretch; padding: .5rem 1.25rem 1rem; }
  .site-nav.open { display: flex; }
  .site-nav ul { flex-direction: column; }
  .theme-toggle { align-self: flex-start; margin-top: .5rem; }
}

/* ---- Footer ------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-soft); color: var(--text-muted); font-size: .9rem; }
.footer-inner { padding-block: 1.75rem; }
.footer-inner p { margin: .3rem 0; }
.footer-links a { margin-right: 1rem; }
.footer-note { font-size: .82rem; }

/* ---- Home --------------------------------------------------------------- */
.hero { display: grid; grid-template-columns: 1fr auto; gap: 2.5rem; align-items: center; padding-block: 1rem 2.5rem; border-bottom: 1px solid var(--border); }
.hero h1 { font-size: 2.5rem; margin-bottom: .5rem; }
.hero .role { font-family: var(--font-mono); color: var(--accent); font-size: 1rem; margin: 0 0 1rem; }
.hero p.intro { font-size: 1.15rem; color: var(--text-muted); max-width: 40rem; margin: 0 0 1.5rem; }
.hero img { width: 180px; height: 180px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); }
@media (max-width: 760px) { .hero { grid-template-columns: 1fr; } .hero img { width: 120px; height: 120px; order: -1; } .hero h1 { font-size: 2rem; } }

.btn { display: inline-block; padding: .6rem 1.1rem; border-radius: 6px; text-decoration: none; font-weight: 600; font-size: .95rem; border: 1px solid var(--accent); margin: 0 .5rem .5rem 0; }
.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover { background: var(--accent-strong); color: var(--bg); }
.btn-secondary { color: var(--accent); }
.btn-secondary:hover { background: var(--accent-soft); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: 2rem 0; }
.stat { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.stat-value { display: block; font-size: 1.6rem; font-weight: 700; color: var(--accent); }
.stat-label { font-size: .85rem; color: var(--text-muted); }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, 1fr); } }

.section { margin-top: 3rem; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--border); margin-bottom: 1.25rem; }
.section-head h2 { margin: 0 0 .5rem; font-size: 1.3rem; }
.section-head a { font-size: .9rem; }

/* ---- Cards / grids ------------------------------------------------------ */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); gap: 1.25rem; }
.card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.35rem; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.card:hover { border-color: var(--accent); }
.card-meta { font-size: .82rem; color: var(--text-muted); margin: 0 0 .4rem; }
.card-title { margin: 0 0 .5rem; font-size: 1.12rem; }
.card-title a { color: var(--text); text-decoration: none; }
.card-title a:hover { color: var(--accent); }
.card-summary { margin: 0 0 .9rem; color: var(--text-muted); font-size: .95rem; flex: 1; }
.list { display: grid; gap: 1rem; }

.badge { display: inline-block; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); background: var(--accent-soft); padding: .1rem .45rem; border-radius: 4px; }
.badge-draft { color: var(--warn); background: var(--warn-soft); }

.tag-list { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; margin: 0; }
.tag-list a { display: inline-block; font-size: .78rem; font-family: var(--font-mono); color: var(--text-muted); border: 1px solid var(--border); border-radius: 999px; padding: .1rem .6rem; text-decoration: none; }
.tag-list a:hover { color: var(--accent); border-color: var(--accent); }

/* ---- Prose (articles) --------------------------------------------------- */
.prose { max-width: var(--w-prose); margin-inline: auto; }
.page-header { margin-bottom: 2rem; }
.eyebrow { margin: 0 0 .5rem; font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.eyebrow a { text-decoration: none; color: var(--accent); }
.lede { font-size: 1.2rem; color: var(--text-muted); margin: .25rem 0 1rem; }
.post-meta { font-size: .88rem; color: var(--text-muted); margin: 0 0 .75rem; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin: .3rem 0; }
.prose blockquote { margin: 1.5rem 0; padding: .25rem 1.25rem; border-left: 3px solid var(--accent); color: var(--text-muted); }
.prose table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: .93rem; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: .55rem .75rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { background: var(--bg-soft); font-weight: 600; }

figure { margin: 2rem 0; }
figure img { display: block; margin-inline: auto; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
figcaption { font-size: .86rem; color: var(--text-muted); text-align: center; margin-top: .6rem; }

/* Code */
code, pre { font-family: var(--font-mono); font-size: .88em; }
:not(pre) > code { background: var(--bg-code); border: 1px solid var(--border); padding: .08rem .35rem; border-radius: 4px; }
pre[class*="language-"], pre { background: #0f1720; color: #e2e8f0; padding: 1rem 1.15rem; border-radius: var(--radius); overflow-x: auto; line-height: 1.55; margin: 1.5rem 0; }
pre code { background: none; border: 0; padding: 0; font-size: .85rem; }
/* Build-time Prism tokens (dark palette, works in both themes) */
.token.comment, .token.prolog { color: #7c8b99; font-style: italic; }
.token.keyword, .token.builtin, .token.selector { color: #7dd3fc; }
.token.string, .token.attr-value, .token.char { color: #a7f3a0; }
.token.number, .token.boolean, .token.constant { color: #fbbf77; }
.token.function, .token.class-name { color: #f0abfc; }
.token.variable, .token.parameter { color: #fde68a; }
.token.operator, .token.punctuation { color: #cbd5e1; }
.token.shebang, .token.important { color: #fca5a5; }

/* Callouts */
.callout { border: 1px solid var(--border); border-left: 4px solid var(--accent); background: var(--accent-soft); border-radius: var(--radius); padding: .85rem 1.1rem; margin: 1.5rem 0; }
.callout > strong { display: block; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.callout div > :first-child { margin-top: .25rem; }
.callout div > :last-child { margin-bottom: 0; }
.callout-warning { border-left-color: var(--warn); background: var(--warn-soft); }
.callout-warning > strong { color: var(--warn); }
.callout-tip { border-left-color: var(--tip); background: var(--tip-soft); }
.callout-tip > strong { color: var(--tip); }

/* Scenario card + case study facts */
.scenario, .facts { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.35rem; margin: 0 0 2rem; }
.scenario-title { margin: 0 0 .75rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.scenario dl, .facts dl { margin: 0; display: grid; gap: .65rem; }
.scenario dl > div, .facts dl > div { display: grid; grid-template-columns: 8.5rem 1fr; gap: 1rem; }
.scenario dt, .facts dt { font-weight: 600; font-size: .9rem; }
.scenario dd, .facts dd { margin: 0; font-size: .95rem; }
@media (max-width: 560px) { .scenario dl > div, .facts dl > div { grid-template-columns: 1fr; gap: 0; } }

.outcomes { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 1rem; margin: 0 0 2.5rem; }
.outcome { border: 1px solid var(--border); border-top: 3px solid var(--accent); border-radius: var(--radius); padding: .9rem 1rem; }
.outcome-value { display: block; font-size: 1.5rem; font-weight: 700; color: var(--accent); }
.outcome-label { font-size: .85rem; color: var(--text-muted); }
.casestudy-footer { margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.post-nav a { text-decoration: none; border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem 1rem; color: var(--text); font-weight: 600; font-size: .95rem; }
.post-nav a:hover { border-color: var(--accent); }
.post-nav span { display: block; font-size: .75rem; font-weight: 400; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.post-nav .next { text-align: right; }

/* Timeline (About page) */
.timeline { list-style: none; padding: 0; border-left: 2px solid var(--border); margin-left: .4rem; }
.timeline li { position: relative; padding: 0 0 1.4rem 1.4rem; margin: 0; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: .45rem; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); }
.timeline .when { font-family: var(--font-mono); font-size: .82rem; color: var(--text-muted); display: block; }

/* Pagination */
.pagination { display: flex; justify-content: space-between; margin-top: 2rem; }

/* Print: clean article output (useful for evidence bundles) */
@media print {
  .site-header, .site-footer, .post-nav, .theme-toggle { display: none !important; }
  body { font-size: 11pt; }
  a { color: inherit; }
  pre { white-space: pre-wrap; }
}

/* Fixes */
.prose .tag-list { padding-left: 0; }
.stat-value-sm { font-size: 1.15rem; line-height: 1.4; padding-block: .2rem; }
