@font-face {
  font-family: 'Manrope';
  src: url('/fonts/manrope-latin.woff2') format('woff2');
  font-weight: 200 800;
  font-display: swap;
}

/* Same palette as the main site; the theme is set on <html data-theme> by theme.js. */
:root {
  --bg: #05070a;
  --panel: #0f1319;
  --panel-2: #151b23;
  --fg: 238 241 244;
  --accent: 63 214 232;
  --accent-2: 34 212 137;
  --on-accent: 5 7 10;
  --glow-a: rgba(63, 214, 232, 0.12);
  --glow-b: rgba(34, 212, 137, 0.09);
  --shadow: 0 24px 50px -28px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}
:root[data-theme='light'] {
  --bg: #f6f7f3;
  --panel: #ffffff;
  --panel-2: #eef1ed;
  --fg: 12 20 27;
  --accent: 10 124 138;
  --accent-2: 11 132 88;
  --on-accent: 255 255 255;
  --glow-a: rgba(10, 124, 138, 0.12);
  --glow-b: rgba(11, 132, 88, 0.09);
  --shadow: 0 22px 44px -28px rgba(12, 20, 27, 0.28);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: rgb(var(--fg));
  font: 17px/1.7 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
img, video, iframe { max-width: 100%; }
a { color: rgb(var(--accent)); }
a:focus-visible, button:focus-visible { outline: 2px solid rgb(var(--accent)); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; margin: 0; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }

/* --- Header ------------------------------------------------------------ */
.bar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid rgb(var(--fg) / 0.1); }
.bar-in { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 68px; }
.bar nav { display: flex; align-items: center; gap: 6px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-text { display: grid; line-height: 1.15; }
.brand-text strong { font-size: 16px; font-weight: 800; letter-spacing: 0.01em; }
.brand-text small { font: 600 10.5px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.2em; text-transform: uppercase; color: rgb(var(--accent)); }
.nav-link { padding: 8px 12px; border-radius: 10px; color: rgb(var(--fg) / 0.7); font-weight: 600; font-size: 15px; text-decoration: none; }
.nav-link:hover, .nav-link[aria-current] { color: rgb(var(--fg)); background: rgb(var(--fg) / 0.07); }
.pill { padding: 7px 14px; border-radius: 999px; border: 1px solid rgb(var(--fg) / 0.18); color: rgb(var(--fg)); font-weight: 700; font-size: 14px; text-decoration: none; }
.pill:hover { border-color: rgb(var(--accent)); color: rgb(var(--accent)); }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgb(var(--fg) / 0.18); background: transparent; color: rgb(var(--fg)); cursor: pointer; }
.icon-btn:hover { border-color: rgb(var(--accent)); color: rgb(var(--accent)); }
:root[data-theme='dark'] .i-moon, :root:not([data-theme='light']) .i-moon { display: none; }
:root[data-theme='light'] .i-sun { display: none; }

.progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 30; background: linear-gradient(90deg, rgb(var(--accent)), rgb(var(--accent-2))); transform: scaleX(0); transform-origin: left; }

/* --- Hero (list) ------------------------------------------------------- */
.hero { position: relative; padding: clamp(48px, 9vw, 96px) 0 clamp(28px, 5vw, 48px); overflow: hidden; border-bottom: 1px solid rgb(var(--fg) / 0.07); }
.hero::before { content: ''; position: absolute; inset: 0; background:
  radial-gradient(ellipse 60% 80% at 15% 0%, var(--glow-a), transparent 70%),
  radial-gradient(ellipse 50% 70% at 90% 20%, var(--glow-b), transparent 70%),
  linear-gradient(to right, rgb(var(--fg) / 0.035) 1px, transparent 1px) 0 0 / 44px 44px,
  linear-gradient(to bottom, rgb(var(--fg) / 0.035) 1px, transparent 1px) 0 0 / 44px 44px; }
.hero .wrap { position: relative; }
.eyebrow { margin: 0 0 14px; font: 700 12.5px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.22em; text-transform: uppercase; color: rgb(var(--accent)); }
.hero h1 { font-size: clamp(34px, 6.2vw, 62px); max-width: 16ch; font-weight: 800; }
.lead { margin: 16px 0 0; max-width: 60ch; color: rgb(var(--fg) / 0.72); font-size: clamp(17px, 2.2vw, 20px); }

.listing { padding-top: 40px; padding-bottom: 88px; }
.section-label { margin: 36px 0 16px; font: 700 12.5px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.18em; text-transform: uppercase; color: rgb(var(--fg) / 0.55); }
.section-label:first-child { margin-top: 0; }

/* --- Cards ------------------------------------------------------------- */
.grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.card { display: flex; flex-direction: column; background: var(--panel); border: 1px solid rgb(var(--fg) / 0.1); border-radius: 22px; overflow: hidden; box-shadow: var(--shadow); transition: transform 0.2s, border-color 0.2s; }
.card:hover { transform: translateY(-3px); border-color: rgb(var(--accent) / 0.5); }
.cover { display: block; aspect-ratio: 16 / 9; background: var(--panel-2); overflow: hidden; }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s; }
.card:hover .cover img { transform: scale(1.04); }
.cover.placeholder { display: grid; place-items: center; background: linear-gradient(125deg, #064e57 0%, #0a7c8a 45%, #0b8458 85%); }
.mark { font: 800 44px/1 'Manrope', sans-serif; letter-spacing: 0.04em; color: rgb(255 255 255 / 0.92); }
.mark.big { font-size: 56px; width: 120px; height: 120px; display: grid; place-items: center; border-radius: 32px; background: linear-gradient(125deg, #064e57, #0a7c8a 50%, #0b8458); margin: 0 auto 22px; }
.card-body { display: flex; flex-direction: column; gap: 10px; padding: 22px 24px 26px; flex: 1; }
.card h2, .card h3 { font-size: 22px; line-height: 1.3; }
.card h2 a, .card h3 a { color: inherit; text-decoration: none; }
.card h2 a:hover, .card h3 a:hover { color: rgb(var(--accent)); }
.excerpt { margin: 0; color: rgb(var(--fg) / 0.7); font-size: 16px; line-height: 1.6; }
.more { margin-top: auto; padding-top: 6px; font-weight: 800; text-decoration: none; }
.more:hover { text-decoration: underline; text-underline-offset: 4px; }
.meta { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; font: 700 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.1em; text-transform: uppercase; color: rgb(var(--accent)); }
.meta span + span::before, .meta time + span::before { content: '·'; margin-right: 12px; color: rgb(var(--fg) / 0.4); }

.card.featured { display: grid; }
.card.featured .cover { aspect-ratio: 16 / 10; }
.card.featured h2 { font-size: clamp(26px, 3.4vw, 36px); }
.card.featured .excerpt { font-size: 17px; }
@media (min-width: 860px) {
  .card.featured { grid-template-columns: 1.15fr 1fr; }
  .card.featured .cover { aspect-ratio: auto; min-height: 340px; height: 100%; }
  .card.featured .card-body { justify-content: center; padding: 36px; }
}

.empty-state { text-align: center; padding: 56px 0 24px; }
.empty-state h1, .empty-state h2 { font-size: clamp(26px, 4vw, 34px); margin-bottom: 8px; }
.empty-state p { color: rgb(var(--fg) / 0.7); margin: 0 0 24px; }

/* --- Buttons ----------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 24px; border-radius: 14px; background: linear-gradient(90deg, #0a7c8a, #0b8458); color: #fff; font-weight: 800; text-decoration: none; border: 0; cursor: pointer; font-size: 16px; }
.btn:hover { filter: brightness(1.1); }
.btn.light { background: #fff; color: #064e57; }
.btn.light:hover { background: #b6fff0; filter: none; }

/* --- Article ----------------------------------------------------------- */
.post-head { padding-top: 40px; }
.back { display: inline-block; margin-bottom: 22px; font-weight: 700; color: rgb(var(--fg) / 0.6); text-decoration: none; }
.back:hover { color: rgb(var(--fg)); }
.post h1 { margin: 12px 0 0; font-size: clamp(32px, 5.6vw, 52px); font-weight: 800; }
.post .lead { margin-top: 18px; }
.hero-cover { margin-top: 36px; max-width: 1000px; }
.hero-cover img { display: block; width: 100%; height: auto; max-height: 560px; object-fit: cover; border-radius: 26px; box-shadow: var(--shadow); }

.prose { margin-top: 40px; overflow-wrap: anywhere; font-size: 18px; line-height: 1.8; }
.prose > :first-child { margin-top: 0; }
.prose h2 { margin: 52px 0 12px; font-size: clamp(25px, 3.4vw, 32px); }
.prose h3 { margin: 36px 0 8px; font-size: 22px; }
.prose p { margin: 0 0 22px; }
.prose ul, .prose ol { margin: 0 0 22px; padding-left: 26px; }
.prose li { margin-bottom: 8px; padding-left: 4px; }
.prose li::marker { color: rgb(var(--accent)); font-weight: 800; }
.prose strong { font-weight: 800; }
.prose blockquote { margin: 32px 0; padding: 6px 0 6px 24px; border-left: 4px solid rgb(var(--accent)); font-size: 21px; line-height: 1.6; font-weight: 600; }
.prose blockquote p { margin: 0; }
.prose hr { border: 0; height: 1px; margin: 44px 0; background: linear-gradient(90deg, transparent, rgb(var(--fg) / 0.25), transparent); }
.prose a:not(.btn) { text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.prose figure { margin: 36px 0; }
.prose figure img, .prose figure video { display: block; width: 100%; height: auto; border-radius: 18px; background: var(--panel-2); }
.prose figcaption { margin-top: 10px; text-align: center; font-size: 14.5px; color: rgb(var(--fg) / 0.6); }
.prose figure.embed { position: relative; aspect-ratio: 16 / 9; }
.prose figure.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 18px; }
.prose .gallery { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); margin: 36px 0; }
.prose .gallery figure { margin: 0; }
.prose .gallery img { aspect-ratio: 4 / 3; object-fit: cover; }
.prose .callout { margin: 32px 0; padding: 20px 24px; border-radius: 18px; border: 1px solid rgb(var(--accent) / 0.4); background: linear-gradient(135deg, rgb(var(--accent) / 0.12), rgb(var(--accent-2) / 0.1)); }
.prose .callout p { margin: 0; font-weight: 600; }
.prose .button-row { margin: 32px 0; }
.prose .missing { color: rgb(var(--fg) / 0.5); font-style: italic; }

.share { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 56px; padding-top: 28px; border-top: 1px solid rgb(var(--fg) / 0.12); }
.share-label { font-weight: 800; margin-right: 6px; }
.chip { display: inline-flex; align-items: center; min-height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid rgb(var(--fg) / 0.2); background: transparent; color: rgb(var(--fg)); font: 700 14px/1 'Manrope', sans-serif; text-decoration: none; cursor: pointer; }
.chip:hover { border-color: rgb(var(--accent)); color: rgb(var(--accent)); }
.other { margin: 22px 0 0; font-weight: 700; }

.author { display: flex; gap: 18px; align-items: center; margin-top: 36px; padding: 22px; border-radius: 20px; background: var(--panel); border: 1px solid rgb(var(--fg) / 0.1); }
.author img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex: none; }
.author p { margin: 0; }
.author-label { font: 700 11.5px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.14em; text-transform: uppercase; color: rgb(var(--accent)); }
.author-name { font-weight: 800; font-size: 18px; }
.author-bio { color: rgb(var(--fg) / 0.7); font-size: 15.5px; line-height: 1.55; margin-top: 2px !important; }

.cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; margin-top: 64px; margin-bottom: 8px; padding: 34px clamp(22px, 4vw, 44px); max-width: 1000px; border-radius: 26px; background: linear-gradient(125deg, #064e57 0%, #0a7c8a 45%, #0b8458 85%); color: #fff; box-shadow: var(--shadow); }
.cta h2 { font-size: clamp(22px, 3vw, 30px); }
.cta p { margin: 6px 0 0; color: rgb(255 255 255 / 0.85); }

.related { margin-top: 64px; padding-bottom: 88px; }
.related h2 { font-size: 26px; margin-bottom: 22px; }

/* --- Footer ------------------------------------------------------------ */
.foot { border-top: 1px solid rgb(var(--fg) / 0.1); background: var(--panel); padding-top: 44px; }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px 56px; }
.foot-brand { max-width: 320px; }
.foot-brand p { margin: 12px 0 0; color: rgb(var(--fg) / 0.65); font-size: 15px; line-height: 1.6; }
.foot-links { display: grid; gap: 8px; align-content: start; font-size: 15px; }
.foot-links a { color: rgb(var(--fg) / 0.75); text-decoration: none; }
.foot-links a:hover { color: rgb(var(--accent)); }
.copy { margin: 36px auto 0; padding-top: 18px; padding-bottom: 24px; border-top: 1px solid rgb(var(--fg) / 0.08); color: rgb(var(--fg) / 0.5); font-size: 14px; }

@media (max-width: 640px) {
  body { font-size: 16.5px; }
  .meta { font-size: 11px; letter-spacing: 0.03em; gap: 2px 8px; }
  .meta span + span::before, .meta time + span::before { margin-right: 8px; }
  .hide-sm { display: none; }
  .brand-text small { display: none; }
  .prose { font-size: 17px; }
  .author { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card, .cover img { transition: none; }
  .card:hover { transform: none; }
}
