/* Outcome blog theme. Tokens and components mirror runoutcome.com (src/styles/global.css). */

@font-face { font-family: 'Inter Variable'; font-style: normal; font-weight: 100 900; font-display: swap; src: url(../fonts/inter-latin-wght-normal.woff2) format('woff2'); }
@font-face { font-family: 'Inter Variable'; font-style: italic; font-weight: 100 900; font-display: swap; src: url(../fonts/inter-latin-wght-italic.woff2) format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 600; font-display: swap; src: url(../fonts/plus-jakarta-sans-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 700; font-display: swap; src: url(../fonts/plus-jakarta-sans-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 800; font-display: swap; src: url(../fonts/plus-jakarta-sans-latin-800-normal.woff2) format('woff2'); }

:root {
  --bg: #0a0a16;
  --bg-2: #0d0c1c;
  --surface: rgba(21, 20, 42, .72);
  --line: rgba(167, 139, 250, .16);
  --text: #f5f3ff;
  --body: #d6d3e4;
  --muted: #b7b4cc;
  --dim: #8d89a8;
  --violet: #7c3aed;
  --lavender: #a78bfa;
  --accent: #b69cff;
  /* Ghost's Settings > Design > Brand fonts override these via --gh-font-body / --gh-font-heading. */
  --font: var(--gh-font-body, 'Inter Variable', Inter, system-ui, -apple-system, 'Segoe UI', sans-serif);
  --heading: var(--gh-font-heading, 'Inter Variable', Inter, system-ui, sans-serif);
  --display: 'Plus Jakarta Sans', 'Inter Variable', system-ui, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, monospace;
  --wrap: 1680px;
  --gutter: clamp(16px, 4.3vw, 80px);
  --content: 720px;
  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: 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--heading); margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-narrow { max-width: calc(var(--content) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-wide { max-width: calc(1200px + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.accent { color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--lavender); outline-offset: 3px; border-radius: 6px; }
.eyebrow { font: 600 13px/1 var(--font); letter-spacing: .24em; text-transform: uppercase; color: #b8a6f5; margin-bottom: 16px; }
.eyebrow a:hover { color: #fff; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 46px; padding: 0 20px; border-radius: 8px; font: 500 16px/1 var(--font); border: 1.5px solid transparent; cursor: pointer; white-space: nowrap; transition: background .18s, border-color .18s, transform .18s; }
.btn-primary { background: linear-gradient(180deg, #8448f5, #6d2ee6); color: #fff; box-shadow: 0 8px 28px -10px rgba(124, 58, 237, .8); }
.btn-primary:hover { background: linear-gradient(180deg, #9258ff, #7a3af0); transform: translateY(-1px); }
.btn-outline { border-color: rgba(255, 255, 255, .78); color: #fff; background: rgba(10, 10, 22, .35); }
.btn-outline:hover { border-color: #fff; background: rgba(255, 255, 255, .06); }
.btn-ghost { border-color: rgba(167, 139, 250, .5); color: #fff; background: rgba(124, 58, 237, .06); }
.btn-ghost:hover { border-color: var(--lavender); background: rgba(124, 58, 237, .16); }

/* Header */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(10, 10, 22, .82); backdrop-filter: saturate(140%) blur(14px); -webkit-backdrop-filter: saturate(140%) blur(14px); border-bottom: 1px solid rgba(255, 255, 255, .05); }
.nav-inner { height: 72px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.brand-word, .brand span { font: 700 29px/1 var(--display); letter-spacing: -0.03em; }
.brand.small span { font-size: 23px; }
.links { display: flex; align-items: center; gap: 6px; margin-left: 52px; }
.menu { position: relative; }
.menu-btn { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; color: #ecebf5; cursor: pointer; font: 500 17px/1 var(--font); padding: 12px; border-radius: 8px; }
.menu-btn:hover { color: #fff; background: rgba(255, 255, 255, .04); }
.menu-btn.on { color: #fff; box-shadow: inset 0 -2px 0 var(--lavender); border-radius: 0; }
.menu-btn svg { opacity: .85; transition: transform .2s; }
.panel { position: absolute; top: calc(100% + 6px); left: 0; min-width: 300px; display: grid; gap: 2px; padding: 8px; background: #14132a; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .8); opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .16s, transform .16s, visibility .16s; }
.panel::before { content: ''; position: absolute; inset: -10px 0 auto; height: 10px; }
.menu:hover .panel, .menu:focus-within .panel { opacity: 1; visibility: visible; transform: none; }
.menu:hover .menu-btn svg, .menu:focus-within .menu-btn svg { transform: rotate(180deg); }
.panel a { display: grid; gap: 2px; padding: 10px 12px; border-radius: 8px; }
.panel a:hover, .panel a:focus-visible { background: rgba(124, 58, 237, .14); }
.panel strong { font-weight: 600; font-size: 15px; }
.panel span { color: var(--dim); font-size: 13.5px; }
.actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.gh { display: grid; place-items: center; width: 44px; height: 44px; margin-right: 24px; color: #fff; }
.actions .btn { height: 47px; padding: 0 19px; font-size: 17px; }
.mobile { display: none; margin-left: auto; }
.mobile summary { list-style: none; cursor: pointer; padding: 8px; color: #fff; }
.mobile summary::-webkit-details-marker { display: none; }
.sheet { position: absolute; left: 0; right: 0; top: 72px; background: #0e0d1d; border-bottom: 1px solid var(--line); padding: 12px 16px 20px; display: grid; gap: 4px; max-height: calc(100vh - 72px); overflow-y: auto; }
.sheet a { padding: 10px 4px; font-weight: 500; }
.sheet-group p { color: var(--dim); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; margin: 10px 0 2px; }
.sheet .btn { margin-top: 12px; }
@media (max-width: 1240px) { .links { margin-left: 16px; gap: 0; } .gh { margin-right: 4px; } }
@media (max-width: 1080px) { .links, .actions { display: none; } .mobile { display: block; } }
@media (max-width: 420px) { .brand-word { font-size: 25px; } .brand img { width: 36px; height: 36px; } }

/* Blog home */
.blog-hero { padding: 72px 0 44px; background: radial-gradient(55% 90% at 80% 0%, rgba(91, 33, 182, .3), transparent 70%), var(--bg); }
.blog-hero h1 { font-size: clamp(38px, 4.2vw, 60px); font-weight: 700; line-height: 1.06; letter-spacing: -0.03em; max-width: 900px; }
.blog-hero .lede { color: var(--muted); font-size: clamp(17px, 1.4vw, 20px); line-height: 1.5; margin-top: 18px; max-width: 680px; }
.author-head { display: flex; gap: 28px; align-items: center; }
.author-img { border-radius: 50%; border: 2px solid rgba(167, 139, 250, .45); }

.posts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; padding-top: 8px; padding-bottom: 32px; }
.posts.three { padding: 0; }
.empty { color: var(--muted); padding: 40px 0; }

.card { border-radius: 16px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; transition: border-color .2s, transform .2s, box-shadow .2s; }
.card:hover { border-color: rgba(167, 139, 250, .45); transform: translateY(-2px); box-shadow: 0 24px 60px -30px rgba(124, 58, 237, .7); }
.card-link { display: flex; flex-direction: column; height: 100%; }
.card-media { aspect-ratio: 16 / 9; overflow: hidden; background: #13122a; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-placeholder { width: 100%; height: 100%; display: grid; place-items: center; background: radial-gradient(60% 80% at 50% 40%, rgba(124, 58, 237, .35), #100f21 70%); }
.card-placeholder img { width: 22%; height: auto; opacity: .9; filter: drop-shadow(0 0 24px rgba(167, 139, 250, .6)); }
.card-body { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-tag { font: 600 12px/1 var(--font); letter-spacing: .18em; text-transform: uppercase; color: #b8a6f5; }
.card-title { font-size: 21px; font-weight: 700; line-height: 1.25; letter-spacing: -0.02em; }
.card-excerpt { color: var(--muted); font-size: 15.5px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-lead .card-excerpt { -webkit-line-clamp: 4; line-clamp: 4; }
.card-meta { margin-top: auto; padding-top: 6px; color: var(--dim); font-size: 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.lock { font-size: 12px; color: #ddd6fe; border: 1px solid rgba(167, 139, 250, .4); border-radius: 999px; padding: 2px 8px; }

.card-lead { grid-column: 1 / -1; }
.card-lead .card-link { display: grid; grid-template-columns: 1.35fr 1fr; }
.card-lead .card-media { aspect-ratio: auto; min-height: 340px; }
.card-lead .card-body { padding: 40px; justify-content: center; }
.card-lead .card-title { font-size: clamp(26px, 2.4vw, 36px); }
.card-lead .card-excerpt { font-size: 17px; }

.pagination { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 8px 0 24px; }
.pagination .btn:last-child { justify-self: end; }
.page-num { color: var(--dim); font-size: 14px; }

/* Subscribe */
.subscribe { margin: 40px 0 72px; padding: 36px 40px; border-radius: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: center; border: 1px solid rgba(167, 139, 250, .4); background: linear-gradient(120deg, rgba(91, 33, 182, .35), rgba(21, 20, 42, .7) 65%); }
.subscribe h2 { font-size: clamp(22px, 2vw, 28px); font-weight: 700; }
.subscribe p { color: var(--muted); margin-top: 8px; }
.subscribe-form { display: flex; flex-wrap: wrap; gap: 12px; }
.subscribe-form input { flex: 1 1 240px; height: 46px; padding: 0 16px; border-radius: 8px; border: 1px solid rgba(167, 139, 250, .35); background: rgba(10, 10, 22, .6); color: #fff; font: 16px var(--font); }
.subscribe-form input::placeholder { color: var(--dim); }
.subscribe-form input:focus { outline: none; border-color: var(--lavender); box-shadow: 0 0 0 3px rgba(124, 58, 237, .25); }
.when-loading, .form-msg { display: none; }
.subscribe-form.loading .when-idle { display: none; }
.subscribe-form.loading .when-loading { display: inline; }
.subscribe-form.success .ok, .subscribe-form.error .err { display: block; flex-basis: 100%; margin: 0; font-size: 14px; }
.subscribe-form .ok { color: #6ee7b7; }
.subscribe-form .err { color: #fca5a5; }

/* Article */
.article { padding: 56px 0 24px; }
.back { display: inline-block; color: var(--dim); font-size: 14px; margin-bottom: 28px; }
.back:hover { color: #fff; }
.article-head h1 { font-size: clamp(34px, 3.8vw, 54px); font-weight: 700; line-height: 1.08; letter-spacing: -0.03em; }
.article-head .lede { color: var(--muted); font-size: 20px; line-height: 1.5; margin-top: 18px; }
.byline { display: flex; gap: 14px; align-items: center; margin-top: 28px; color: #e9e7f5; font-weight: 600; font-size: 15px; }
.byline span { color: var(--dim); font-weight: 400; }
.byline a:hover { color: var(--accent); }
.avatars { display: flex; }
.avatars img { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--bg); object-fit: cover; }
.avatars img + img { margin-left: -10px; }
.avatar-fallback { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #1c1a36; border: 2px solid var(--bg); box-shadow: 0 0 0 1px var(--line); }
.avatar-fallback img { width: 22px; height: 22px; border: 0; border-radius: 0; }
.article-image { margin: 44px auto 0; }
.article-image img { width: 100%; border-radius: 18px; border: 1px solid var(--line); }
.article-image figcaption, .content figcaption { color: var(--dim); font-size: 14px; text-align: center; margin-top: 12px; }
.article-tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 40px; }
.chip { font-size: 14px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.chip:hover { color: #fff; border-color: var(--lavender); }
.comments { margin-top: 48px; }
.more { padding-bottom: 72px; }
.more h2 { font-size: 26px; font-weight: 700; margin-bottom: 24px; }

/* Post content: Ghost cards need the width classes on a grid. */
.content { display: grid; grid-template-columns: [full-start] minmax(var(--gutter), 1fr) [wide-start] minmax(0, 240px) [main-start] min(var(--content), calc(100% - 2 * var(--gutter))) [main-end] minmax(0, 240px) [wide-end] minmax(var(--gutter), 1fr) [full-end]; margin-top: 44px; color: var(--body); font-size: 18.5px; line-height: 1.75; }
.content > * { grid-column: main-start / main-end; margin: 0 0 1.4em; }
.content > .kg-width-wide { grid-column: wide-start / wide-end; }
.content > .kg-width-full { grid-column: full-start / full-end; }
.content > .kg-width-full img { width: 100%; }
.content h2 { color: #fff; font-size: 30px; font-weight: 700; line-height: 1.25; margin: 1.6em 0 .6em; }
.content h3 { color: #fff; font-size: 23px; font-weight: 700; line-height: 1.3; margin: 1.5em 0 .5em; }
.content h4 { color: #fff; font-size: 19px; font-weight: 600; margin: 1.4em 0 .4em; }
.content a { color: #c4b5fd; text-decoration: underline; text-decoration-color: rgba(196, 181, 253, .45); text-underline-offset: 3px; }
.content a:hover { text-decoration-color: currentColor; }
.content strong { color: #fff; }
.content ul, .content ol { padding-left: 1.3em; }
.content li { margin-bottom: .45em; }
.content li::marker { color: var(--lavender); }
.content blockquote:not([class]) { border-left: 3px solid var(--lavender); padding: 4px 0 4px 22px; color: #ece9ff; font-style: italic; }
.content blockquote.kg-blockquote-alt { text-align: center; font-size: 26px; line-height: 1.45; color: #fff; font-style: italic; padding: 0 2em; }
.content hr { border: 0; height: 1px; background: var(--line); margin: 2.4em 0; }
.content code { font-family: var(--mono); font-size: .86em; color: #ddd6fe; background: rgba(124, 58, 237, .18); padding: 2px 6px; border-radius: 5px; }
.content pre { background: #0f0e1f; border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; overflow-x: auto; font-size: 15px; line-height: 1.65; }
.content pre code { background: none; padding: 0; color: #e9e7f5; font-size: inherit; }
.content img { border-radius: 12px; }
.content table { width: 100%; border-collapse: collapse; font-size: 16px; }
.content th, .content td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.content th { color: #fff; }
.content .kg-image-card, .content .kg-gallery-card, .content .kg-embed-card { margin-top: 2em; margin-bottom: 2em; }
.content .kg-callout-card { border-radius: 12px; }
.content .kg-bookmark-card a.kg-bookmark-container { color: var(--text); background: var(--surface); border-color: var(--line); text-decoration: none; }
.content .kg-bookmark-description, .content .kg-bookmark-metadata { color: var(--muted); }
.content .kg-toggle-card, .content .kg-product-card-container, .content .kg-file-card-container { background: var(--surface); border-color: var(--line); color: var(--text); }
.content .kg-btn-accent, .content .kg-header-card-button { background: var(--violet); }

/* Footer */
.site-footer { border-top: 1px solid rgba(167, 139, 250, .14); padding: 56px 0 32px; margin-top: 24px; }
.footer-top { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 32px; }
.brand-col p { color: var(--dim); margin-top: 12px; }
.site-footer h4 { margin: 0 0 14px; font: 600 13px/1 var(--font); letter-spacing: .16em; text-transform: uppercase; color: #a7a3c2; }
.site-footer nav { display: grid; gap: 10px; align-content: start; }
.site-footer nav a { color: #d6d3e4; font-size: 15px; }
.site-footer nav a:hover { color: #fff; }
.legal { margin-top: 48px; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, .06); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; color: var(--dim); font-size: 13.5px; }
.legal a { color: #c4b5fd; }
.site-footer .legal-links { display: flex; gap: 20px; }
.site-footer .legal-links a { color: var(--muted); font-size: 13.5px; }

/* Error page */
.error-page { padding: 140px 0; text-align: center; }
.error-page .code { font: 700 18px/1 var(--mono); color: var(--lavender); letter-spacing: .2em; }
.error-page h1 { font-size: clamp(32px, 3.4vw, 46px); margin-top: 16px; }
.error-page p:last-child { color: var(--muted); margin-top: 14px; }
.error-page a { color: #c4b5fd; text-decoration: underline; }

@media (max-width: 1100px) { .posts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .card-lead .card-link { grid-template-columns: 1fr; }
  .card-lead .card-media { min-height: 0; aspect-ratio: 16 / 9; }
  .card-lead .card-body { padding: 24px; }
  .subscribe { grid-template-columns: 1fr; padding: 28px 22px; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .brand-col { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .posts { grid-template-columns: 1fr; }
  .content { font-size: 17px; }
  .author-head { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }

/* Ghost comments render in an iframe with a light color-scheme; matching it keeps the frame transparent on our dark page. */
.comments iframe { color-scheme: normal; }
