/* ==========================================================================
   Blog — same ink, type and light/dark as the lab, tuned for long reading
   ========================================================================== */
@font-face { font-family: "Inter"; src: url("../fonts/inter-latin-var.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono-latin-var.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("../fonts/instrument-serif-latin.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("../fonts/instrument-serif-latin-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --bg: #FFFFFF; --bg-soft: #F6F5F1; --ink: #0A0A0A; --ink-2: #3E3C37; --ink-3: #706D66;
  --line: rgba(10, 10, 10, .09); --line-2: rgba(10, 10, 10, .18); --or: #E2580E; --or-text: #B84A0A;
  --mono: "JetBrains Mono", ui-monospace, monospace; --sans: "Inter", system-ui, -apple-system, sans-serif; --serif: "Instrument Serif", Georgia, serif;
  --ease: cubic-bezier(.2, .7, .1, 1); --pad: clamp(18px, 4vw, 40px);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0B0C0E; --bg-soft: #15171B; --ink: #EFEBE0; --ink-2: #C9C4B5; --ink-3: #8A867E;
  --line: rgba(239, 235, 224, .1); --line-2: rgba(239, 235, 224, .2); --or: #FF7A2E; --or-text: #FF7A2E;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.7 var(--sans); -webkit-font-smoothing: antialiased; transition: background .4s, color .4s; }
a { color: inherit; }
::selection { background: var(--or); color: #fff; }
:focus-visible { outline: 2px solid var(--or); outline-offset: 3px; border-radius: 4px; }
:root:not([data-theme="dark"]) .logo-d, :root[data-theme="dark"] .logo-l { display: none !important; }

/* Reading progress */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60; }
.progress span { display: block; height: 100%; width: 100%; background: var(--or); transform-origin: 0 50%; transform: scaleX(0); }

/* Header */
.top { position: sticky; top: 0; z-index: 50; display: flex; justify-content: space-between; align-items: center; padding: calc(14px + env(safe-area-inset-top)) var(--pad) 14px; background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.top__logo img { height: 20px; display: block; }
.top__nav { display: flex; align-items: center; gap: clamp(14px, 3vw, 26px); }
.top__nav a { font: 500 14px var(--sans); color: var(--ink-2); text-decoration: none; }
.top__nav a:hover, .top__nav a[aria-current] { color: var(--ink); }
.themebtn { position: relative; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-2); background: none; color: var(--ink); cursor: pointer; }
.themebtn svg { position: absolute; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; transition: transform .6s var(--ease), opacity .35s; }
.themebtn .i-moon { opacity: 0; transform: rotate(-90deg) scale(.5); }
:root[data-theme="dark"] .themebtn .i-sun { opacity: 0; transform: rotate(90deg) scale(.5); }
:root[data-theme="dark"] .themebtn .i-moon { opacity: 1; transform: none; }

/* Article */
.post { max-width: 720px; margin: 0 auto; padding: clamp(36px, 8vw, 88px) var(--pad) 40px; }
.post__kick { margin: 0 0 18px; font: 400 12px var(--mono); color: var(--ink-3); letter-spacing: .06em; text-transform: uppercase; }
.post__title { margin: 0; font: 650 clamp(2.7rem, 8vw, 5rem)/.95 var(--sans); letter-spacing: -.05em; }
.post__title span { font-weight: 400; color: var(--ink-3); }
.post__title em { font: italic 400 1.08em var(--serif); letter-spacing: -.025em; color: var(--or); }
.post__dek { margin: 22px 0 0; font: italic 400 clamp(1.45rem, 3.2vw, 1.9rem)/1.25 var(--serif); color: var(--ink-2); max-width: 30ch; }
.byline { display: flex; align-items: center; gap: 12px; margin-top: 28px; }
.byline img { width: 40px; height: 40px; flex: none; border-radius: 50%; object-fit: cover; object-position: 50% 18%; background: var(--bg-soft); }
.byline b { display: block; font: 600 14px var(--sans); }
.byline span { font: 400 12px var(--mono); color: var(--ink-3); }

/* Share */
.share { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.share button, .share a { display: inline-flex; align-items: center; gap: 7px; font: 500 12.5px/1 var(--sans); color: var(--ink-2); text-decoration: none; padding: 9px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: none; cursor: pointer; transition: border-color .2s, color .2s, background .2s; }
.share svg { width: 14px; height: 14px; fill: currentColor; }
.share button:hover, .share a:hover { border-color: var(--ink); color: var(--ink); }
.share .is-primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.share .is-primary:hover { color: var(--bg); opacity: .9; }

/* Hero */
.hero { margin: 44px 0 8px; }
.hero canvas { display: block; width: 100%; aspect-ratio: 16 / 8; border-radius: 18px; background: var(--bg-soft); }
.hero figcaption { margin-top: 10px; font: 400 12px var(--mono); color: var(--ink-3); }

/* Body */
.post__body { margin-top: 44px; }
.post__body p, .post__body li { font-size: clamp(17px, 2.1vw, 19px); line-height: 1.75; color: var(--ink-2); }
.post__body p { margin: 0 0 1.25em; }
.post__body strong, .post__body em { color: var(--ink); }
.post__body .lede { font: 500 clamp(1.4rem, 3.4vw, 1.75rem)/1.35 var(--sans); letter-spacing: -.02em; color: var(--ink); }
.post__body h2 { margin: 2.6em 0 .9em; font: 650 clamp(1.6rem, 4vw, 2.1rem)/1.1 var(--sans); letter-spacing: -.035em; color: var(--ink); }
.post__body h2 span { display: block; margin-bottom: 10px; font: 400 12px var(--mono); color: var(--or-text); letter-spacing: .06em; }
.post__body ul { padding-left: 1.1em; margin: 0 0 1.4em; }
.post__body li { margin: .5em 0; }
.post__body li::marker { color: var(--or); }
.post__body .ventures { list-style: none; padding: 0; border-top: 1px solid var(--line); }
.post__body .ventures li { display: grid; gap: 2px; padding: 14px 0; margin: 0; border-bottom: 1px solid var(--line); }
.post__body .ventures b { font: 600 17px var(--sans); color: var(--ink); }
.post__body .ventures span { font-size: 16px; }
.post__body a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--or); text-decoration-thickness: 1.5px; text-underline-offset: 4px; transition: color .2s; }
.post__body a:hover { color: var(--or); }
.post__body a[target="_blank"]::after { content: "↗"; display: inline-block; margin-left: 3px; font-size: .75em; color: var(--or); text-decoration: none; }
.post__body .ventures b a { text-decoration-color: var(--line-2); }
.post__body .ventures b a:hover { text-decoration-color: var(--or); }

/* Callout: the numbers that should stop a scroll */
.callout { margin: 2.2em 0; padding: clamp(24px, 4vw, 36px); border-radius: 20px; background: var(--ink); color: var(--bg); }
.post__body .callout__head { margin: 0 0 26px; font: 650 clamp(1.55rem, 4vw, 2.15rem)/1.12 var(--sans); letter-spacing: -.035em; color: var(--bg); }
.callout__stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; margin: 0; padding-top: 22px; border-top: 1px solid color-mix(in srgb, var(--bg) 18%, transparent); }
.callout__stats dt { font: 650 clamp(2rem, 5vw, 2.7rem)/1 var(--sans); letter-spacing: -.04em; color: var(--or); }
.callout__stats dd { margin: 8px 0 0; font-size: 14.5px; line-height: 1.45; color: color-mix(in srgb, var(--bg) 78%, transparent); }
.callout__stats cite { display: block; margin-top: 6px; font: normal 400 11px var(--mono); letter-spacing: .04em; text-transform: uppercase; color: color-mix(in srgb, var(--bg) 50%, transparent); }
@media (max-width: 620px) { .callout__stats { grid-template-columns: 1fr; gap: 18px; } .callout__stats > div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; align-items: baseline; } .callout__stats dd { margin: 0; } }

.pull { position: relative; margin: 2em 0; padding: 4px 0 4px 22px; border-left: 2px solid var(--or); font: italic 400 clamp(1.5rem, 3.6vw, 2rem)/1.22 var(--serif); color: var(--ink); }
.pull__share { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font: 500 12px/1 var(--sans); font-style: normal; color: var(--ink-3); background: none; border: 0; padding: 0; cursor: pointer; }
.pull__share:hover { color: var(--or-text); }
.pull__share svg { width: 12px; height: 12px; fill: currentColor; }
/* Next essay teaser */
.next { position: relative; margin: 2.6em 0 1.4em; padding: 26px 26px 24px; border: 1px dashed var(--line-2); border-radius: 18px; }
.post__body .next__k { margin: 0 0 10px; display: flex; align-items: center; gap: 8px; font: 500 12px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--or-text); }
.post__body .next__k::before { content: ""; width: 7px; height: 7px; border-radius: 0; background: var(--or); animation: next-pulse 1.8s ease-in-out infinite; }
.post__body .next__t { margin: 0 0 8px; font: 650 clamp(1.6rem, 4vw, 2.1rem)/1.05 var(--sans); letter-spacing: -.035em; color: var(--ink); }
.post__body .next__d { margin: 0; font-size: 16px; line-height: 1.6; }
@keyframes next-pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .post__body .next__k::before { animation: none; } }
.signoff { margin-top: 2em !important; font: italic 400 1.6rem/1.3 var(--serif) !important; color: var(--ink) !important; }
.signoff span { display: block; margin-top: 6px; font: 500 13px var(--mono); font-style: normal; color: var(--or-text); }

/* Footer */
.post__foot { margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line); }
.share--end { margin: 0 0 32px; }
.author { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 18px; align-items: start; padding: 22px; border-radius: 18px; background: var(--bg-soft); }
.author img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; object-position: 50% 18%; background: var(--bg); }
.author__name { margin: 0; font: 600 17px var(--sans); }
.author__bio { margin: 6px 0 12px; font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.author__cta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0; }
.author__cta a { font: 500 14px var(--sans); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 4px; }
.author__cta a:first-child { color: var(--or-text); text-decoration-color: currentColor; }
.site-foot { max-width: 720px; margin: 0 auto; padding: 28px var(--pad) calc(36px + env(safe-area-inset-bottom)); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; font: 400 12px var(--mono); color: var(--ink-3); }
.site-foot span:last-child { display: flex; gap: 16px; }
.site-foot a { text-decoration: none; }
.site-foot a:hover { color: var(--or-text); }

/* Blog home */
.blog { max-width: 720px; margin: 0 auto; padding: clamp(40px, 9vw, 96px) var(--pad) 40px; }
.blog__title { margin: 0; font: 650 clamp(2.7rem, 8vw, 4.6rem)/.95 var(--sans); letter-spacing: -.05em; }
.blog__title em { font: italic 400 1.08em var(--serif); color: var(--ink-3); letter-spacing: -.02em; }
.blog__intro { margin: 18px 0 0; font-size: 18px; color: var(--ink-2); max-width: 46ch; }
.entries { list-style: none; padding: 0; margin: 48px 0 0; border-top: 1px solid var(--line); }
.entry a { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 30px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.entry__meta { font: 400 12px var(--mono); color: var(--ink-3); letter-spacing: .04em; text-transform: uppercase; }
.entry__title { font: 650 clamp(1.8rem, 5vw, 2.6rem)/1.02 var(--sans); letter-spacing: -.04em; color: var(--ink); transition: color .25s; }
.entry__title em { font: italic 400 1.08em var(--serif); color: var(--or); }
.entry__dek { font-size: 17px; color: var(--ink-2); max-width: 56ch; }
.entry__go { font: 500 14px var(--sans); color: var(--ink); }
.entry a:hover .entry__go { color: var(--or-text); }
.entry img { width: 100%; height: auto; border-radius: 14px; box-shadow: 0 0 0 1px var(--line); aspect-ratio: 1200 / 630; object-fit: cover; background: var(--bg-soft); }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 70; transform: translate(-50%, 90px); background: var(--ink); color: var(--bg); font: 500 13px var(--sans); padding: 10px 16px; border-radius: 999px; transition: transform .4s var(--ease); visibility: hidden; }
.toast.is-on { transform: translate(-50%, 0); visibility: visible; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .001ms !important; } }

/* Skip link: hidden until a keyboard or screen-reader user reaches it */
.skip { position: fixed; z-index: 100; top: 10px; left: 10px; padding: 10px 14px; border-radius: 10px; background: var(--ink); color: var(--bg); font: 500 14px "Inter", system-ui, sans-serif; text-decoration: none; transform: translateY(-160%); transition: transform .2s; }
.skip:focus { transform: none; }
