/* MGB — shared styles */
:root {
  --bg: #07080c;
  --fg: #eef2f7;
  --text: #c9d1dd;
  --muted: #8a93a6;
  --line: rgba(255,255,255,.08);
  --line-strong: rgba(255,255,255,.14);
  --panel: rgba(12,14,20,.72);
  --cyan: #22d3ee;
  --violet: #8b5cf6;
  --blue: #3b82f6;
  --amber: #fbbf24;
  --red: #f87171;
  --mx: 50%;
  --my: 50%;
  --display: "Inter Tight", "Inter", system-ui, sans-serif;
  --sans: "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: inherit; }
::selection { background: rgba(34,211,238,.3); color: #fff; }

/* ---------- Background layers ---------- */
.aurora { position: fixed; inset: -20%; z-index: 0; filter: blur(80px); opacity: .55; pointer-events: none; }
.aurora i { position: absolute; border-radius: 50%; mix-blend-mode: screen; }
.aurora i:nth-child(1) { width: 45vw; height: 45vw; background: var(--violet); top: 15%; left: 18%; animation: drift1 18s ease-in-out infinite alternate; }
.aurora i:nth-child(2) { width: 38vw; height: 38vw; background: var(--cyan); top: 35%; left: 48%; opacity: .7; animation: drift2 22s ease-in-out infinite alternate; }
.aurora i:nth-child(3) { width: 30vw; height: 30vw; background: var(--blue); top: 50%; left: 25%; opacity: .6; animation: drift3 20s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(12vw, 8vh) scale(1.1); } }
@keyframes drift2 { to { transform: translate(-14vw, -10vh) scale(.9); } }
@keyframes drift3 { to { transform: translate(10vw, -12vh) scale(1.15); } }

.veil { position: fixed; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(ellipse at center, rgba(7,8,12,.35) 0%, rgba(7,8,12,.92) 70%); }
.page-article .veil { background: rgba(7,8,12,.86); }

.dots, .dots-lit {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.14) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 30%, transparent 80%);
}
.dots-lit {
  background-image: radial-gradient(rgba(34,211,238,.9) 1.2px, transparent 1.2px);
  mask-image: radial-gradient(220px circle at var(--mx) var(--my), #000, transparent 70%);
  -webkit-mask-image: radial-gradient(220px circle at var(--mx) var(--my), #000, transparent 70%);
}
#net { position: fixed; inset: 0; z-index: 2; opacity: .5; pointer-events: none; }
.grain {
  position: fixed; inset: 0; z-index: 3; pointer-events: none; opacity: .06; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Shell ---------- */
.wrap { position: relative; z-index: 4; }
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: clamp(1.2rem, 3vw, 2rem) clamp(1.2rem, 4vw, 2.8rem);
  font-family: var(--mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.topbar a { text-decoration: none; }
.topbar .brand { color: var(--fg); font-family: var(--display); font-weight: 900; font-size: 1.05rem; letter-spacing: -.02em; }
.topbar nav { display: flex; gap: 1.4rem; align-items: center; }
.topbar nav a:hover { color: var(--cyan); }
.pill {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .5rem .9rem;
  border: 1px solid var(--line); border-radius: 2px;
  background: rgba(255,255,255,.03);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  color: var(--fg);
}
.pulse { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); }
.pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--cyan); animation: ping 2s cubic-bezier(0,0,.2,1) infinite; }
@keyframes ping { 75%, 100% { transform: scale(3); opacity: 0; } }

/* ---------- Hero ---------- */
.hero {
  min-height: calc(88vh - 80px);
  display: grid; place-items: center; text-align: center;
  padding: 2rem 1.2rem 4rem;
}
.eyebrow {
  font-family: var(--mono); font-size: .78rem; letter-spacing: .3em; text-transform: uppercase;
  color: var(--cyan); margin-bottom: 1.6rem;
}
.wordmark {
  position: relative; display: inline-block;
  font-family: var(--display); font-weight: 900;
  font-size: clamp(5.5rem, 22vw, 15.5rem);
  line-height: .82; letter-spacing: -.045em; text-transform: uppercase;
  color: #fff; text-rendering: geometricPrecision; padding: 0 .04em;
}
.wordmark::after {
  content: ""; position: absolute; left: .06em; bottom: -.16em;
  width: 28%; height: .07em; min-height: 6px;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}
.lede { margin-top: clamp(2.6rem, 6vw, 4rem); font-size: clamp(1rem, 2vw, 1.2rem); color: var(--muted); }
.lede strong { color: var(--fg); font-weight: 500; }

.terminal {
  display: inline-flex; align-items: center; gap: .6rem;
  margin-top: 1.6rem; padding: .75rem 1.1rem;
  min-width: min(440px, 86vw); max-width: 100%;
  border: 1px solid var(--line); border-radius: 2px;
  background: rgba(10,12,18,.6);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 40px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.04);
  font-family: var(--mono); font-size: clamp(.78rem, 1.8vw, .9rem); text-align: left;
}
.terminal .lights { display: inline-flex; gap: 5px; margin-right: .3rem; }
.terminal .lights i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.12); }
.terminal .lights i:first-child { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.terminal .prompt { color: var(--cyan); white-space: nowrap; }
.terminal .prompt em { color: var(--violet); font-style: normal; }
#type { color: var(--fg); white-space: nowrap; overflow: hidden; min-width: 0; flex: 0 1 auto; }
.terminal .lights, .terminal .prompt, .cursor { flex-shrink: 0; }
.cursor { display: inline-block; width: .55em; height: 1.1em; margin-left: -2px; background: var(--cyan); border-radius: 1px; box-shadow: 0 0 10px rgba(34,211,238,.7); animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }

.chips { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; margin-top: 1.8rem; }
.chip {
  font-family: var(--mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase;
  padding: .45rem .8rem; border-radius: 2px;
  border: 1px solid var(--line); background: rgba(255,255,255,.025); color: var(--muted);
}
.chip.cyan { color: var(--cyan); border-color: rgba(34,211,238,.3); }
.chip.red { color: var(--red); border-color: rgba(248,113,113,.35); }

.scroll-cue {
  display: inline-flex; flex-direction: column; align-items: center; gap: .5rem;
  margin-top: 3rem; font-family: var(--mono); font-size: .68rem; letter-spacing: .25em; text-transform: uppercase;
  color: var(--muted); text-decoration: none;
}
.scroll-cue::after { content: ""; width: 1px; height: 34px; background: linear-gradient(var(--cyan), transparent); animation: cue 2s ease-in-out infinite; }
@keyframes cue { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }
.scroll-cue:hover { color: var(--cyan); }

/* Entrance */
.rise { opacity: 0; animation: rise .9s cubic-bezier(.2,.7,.2,1) forwards; }
.d1 { animation-delay: .2s; } .d2 { animation-delay: .35s; } .d3 { animation-delay: .6s; } .d4 { animation-delay: .8s; } .d5 { animation-delay: 1s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ---------- Blog list ---------- */
.section { max-width: 1080px; margin: 0 auto; padding: 2rem clamp(1.2rem, 4vw, 2.8rem) 5rem; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); padding-bottom: 1rem; margin-bottom: 2rem; }
.section-head h2 { font-family: var(--display); font-weight: 800; font-size: clamp(1.6rem, 3.5vw, 2.2rem); letter-spacing: -.03em; }
.section-head h2 span { color: var(--cyan); }
.section-head p { font-family: var(--mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

.posts { display: grid; gap: 1.2rem; }
.post-card {
  position: relative; display: grid; grid-template-columns: 1fr auto; gap: 1.5rem; align-items: center;
  padding: clamp(1.4rem, 3vw, 2rem);
  border: 1px solid var(--line); border-radius: 2px;
  background: var(--panel);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  text-decoration: none;
  transition: border-color .25s ease, transform .25s ease, background .25s ease;
  overflow: hidden;
}
.post-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(var(--cyan), var(--violet));
  transform: scaleY(0); transform-origin: top; transition: transform .3s ease;
}
.post-card:hover { border-color: var(--line-strong); transform: translateY(-2px); background: rgba(16,19,27,.8); }
.post-card:hover::before { transform: scaleY(1); }
.post-meta { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .9rem; }
.post-meta time, .post-meta .read { font-family: var(--mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.post-meta .sep { color: var(--line-strong); }
.post-card h3 { font-family: var(--display); font-weight: 800; font-size: clamp(1.3rem, 2.6vw, 1.7rem); letter-spacing: -.02em; line-height: 1.2; color: #fff; }
.post-card p { margin-top: .7rem; color: var(--muted); line-height: 1.65; max-width: 62ch; }
.post-card .arrow {
  width: 46px; height: 46px; display: grid; place-items: center;
  border: 1px solid var(--line-strong); border-radius: 2px;
  font-family: var(--mono); color: var(--cyan); font-size: 1.1rem;
  transition: background .25s ease, color .25s ease;
}
.post-card:hover .arrow { background: var(--cyan); color: var(--bg); }

.foot {
  max-width: 1080px; margin: 0 auto;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 1.6rem clamp(1.2rem, 4vw, 2.8rem) 2.2rem;
  border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}

/* ---------- Article ---------- */
.article { max-width: 760px; margin: 0 auto; padding: 2rem clamp(1.2rem, 4vw, 2rem) 4rem; }
.back { display: inline-flex; gap: .5rem; align-items: center; font-family: var(--mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); text-decoration: none; margin-bottom: 2.4rem; }
.back:hover { color: var(--cyan); }
.article-head .post-meta { margin-bottom: 1.2rem; }
.article h1 {
  font-family: var(--display); font-weight: 900;
  font-size: clamp(2.2rem, 6vw, 3.6rem); line-height: 1.04; letter-spacing: -.035em; color: #fff;
}
.article .standfirst { margin-top: 1.2rem; font-size: clamp(1.05rem, 2.2vw, 1.25rem); line-height: 1.6; color: var(--text); }
.byline { display: flex; gap: .8rem; align-items: center; margin-top: 1.8rem; padding-bottom: 2rem; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: .75rem; letter-spacing: .08em; color: var(--muted); }
.byline .mark { width: 34px; height: 34px; display: grid; place-items: center; background: linear-gradient(135deg, var(--cyan), var(--violet)); color: var(--bg); font-family: var(--display); font-weight: 900; font-size: .72rem; letter-spacing: -.02em; border-radius: 2px; }

.prose { margin-top: 2.4rem; color: var(--text); font-size: 1.04rem; line-height: 1.78; }
.prose > * + * { margin-top: 1.15rem; }
.prose h2 { font-family: var(--display); font-weight: 800; font-size: clamp(1.4rem, 3vw, 1.75rem); letter-spacing: -.025em; color: #fff; margin-top: 3rem; line-height: 1.2; }
.prose h2::before { content: "// "; color: var(--cyan); font-family: var(--mono); font-weight: 400; font-size: .7em; letter-spacing: 0; }
.prose h3 { font-family: var(--display); font-weight: 700; font-size: 1.15rem; color: var(--fg); margin-top: 2rem; }
.prose strong { color: var(--fg); font-weight: 600; }
.prose a { color: var(--cyan); text-decoration: underline; text-decoration-color: rgba(34,211,238,.35); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--cyan); }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li + li { margin-top: .45rem; }
.prose li::marker { color: var(--cyan); }
.prose code { font-family: var(--mono); font-size: .86em; padding: .12em .4em; border-radius: 2px; background: rgba(255,255,255,.06); border: 1px solid var(--line); color: #e6f9fd; }
.prose pre {
  font-family: var(--mono); font-size: .85rem; line-height: 1.6;
  padding: 1.1rem 1.2rem; overflow-x: auto;
  border: 1px solid var(--line); border-left: 2px solid var(--cyan); border-radius: 2px;
  background: rgba(4,6,10,.85); color: #d7e3ee;
}
.prose pre code { padding: 0; border: 0; background: none; font-size: inherit; }
.prose pre .c { color: var(--muted); }

.callout {
  padding: 1.3rem 1.4rem; border-radius: 2px;
  border: 1px solid rgba(34,211,238,.25); border-left: 3px solid var(--cyan);
  background: rgba(34,211,238,.05);
}
.callout.warn { border-color: rgba(251,191,36,.28); border-left-color: var(--amber); background: rgba(251,191,36,.05); }
.callout .label { display: block; font-family: var(--mono); font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--cyan); margin-bottom: .6rem; }
.callout.warn .label { color: var(--amber); }
.callout ul { margin-top: .2rem; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; }
.stat { padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: 2px; background: var(--panel); }
.stat b { display: block; font-family: var(--display); font-weight: 900; font-size: 1.7rem; letter-spacing: -.03em; color: #fff; line-height: 1.1; }
.stat span { font-family: var(--mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 2px; }
.prose table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.prose th, .prose td { text-align: left; padding: .7rem 1rem; border-bottom: 1px solid var(--line); }
.prose th { font-family: var(--mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 500; background: rgba(255,255,255,.03); }
.prose tr:last-child td { border-bottom: 0; }
.prose td code { white-space: nowrap; }
.ok { color: #4ade80; } .bad { color: var(--red); }

.timeline { list-style: none; padding-left: 0 !important; border-left: 1px solid var(--line-strong); margin-left: .3rem; }
.timeline li { position: relative; padding-left: 1.4rem; }
.timeline li + li { margin-top: 1rem; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: .62em; width: 9px; height: 9px; background: var(--bg); border: 2px solid var(--cyan); border-radius: 50%; }
.timeline time { display: block; font-family: var(--mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--cyan); }

.sources { margin-top: 3.4rem; padding-top: 1.6rem; border-top: 1px solid var(--line); font-size: .9rem; }
.sources h2 { margin-top: 0; font-size: 1.1rem; }
.sources ol { color: var(--muted); }

/* ---------- Responsive / motion ---------- */
@media (max-width: 640px) {
  .hide-sm { display: none; }
  .terminal .lights { display: none; }
  .hero { padding-left: 1rem; padding-right: 1rem; }
  .post-card { grid-template-columns: 1fr; }
  .post-card .arrow { display: none; }
  .section-head { flex-direction: column; align-items: start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0s !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition: none !important; }
  .rise { opacity: 1; }
  #net { display: none; }
  html { scroll-behavior: auto; }
}
.prose small { font-family: var(--mono); font-size: .72rem; letter-spacing: .04em; color: var(--muted); }
.callout ol { padding-left: 1.2rem; }
.stat span { display: block; line-height: 1.5; margin-top: .35rem; }
.prose small { display: block; line-height: 1.6; }

/* ---------- Navigation upgrades ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(7,8,12,.55);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, background .3s ease;
}
.topbar.scrolled { border-bottom-color: var(--line); background: rgba(7,8,12,.8); }
.topbar nav a.active { color: var(--fg); }
.topbar nav a.active::after { content: ""; display: block; height: 2px; margin-top: 4px; background: linear-gradient(90deg, var(--cyan), var(--violet)); }

/* Shorter home hero so posts sit closer to the top */
.page-home .hero { min-height: auto; padding: clamp(2rem, 6vh, 4rem) 1.2rem clamp(2rem, 5vh, 3rem); }
.page-home .wordmark { font-size: clamp(4.5rem, 16vw, 11rem); }
.page-home .lede { margin-top: clamp(2.2rem, 5vw, 3.2rem); }
.page-home .scroll-cue { margin-top: 2rem; }
.page-home .section { padding-top: 1rem; }

/* Article mini hero */
.page-article #net { opacity: .3; }
.mini-hero {
  max-width: 1080px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
  padding: 2rem clamp(1.2rem, 4vw, 2.8rem) 2.2rem;
  border-bottom: 1px solid var(--line);
}
.mini-mark {
  position: relative; display: inline-block; text-decoration: none;
  font-family: var(--display); font-weight: 900; font-size: clamp(3rem, 8vw, 4.6rem);
  line-height: .82; letter-spacing: -.045em; color: #fff;
}
.mini-mark::after {
  content: ""; position: absolute; left: .04em; bottom: -.22em;
  width: 34%; height: .08em; min-height: 4px;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  clip-path: polygon(0 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}
.mini-hero .mini-sub { display: block; margin-top: 1.1rem; font-family: var(--mono); font-size: .7rem; letter-spacing: .25em; text-transform: uppercase; color: var(--cyan); }
.mini-hero .right { display: flex; flex-direction: column; align-items: flex-end; gap: .7rem; }
.mini-hero .terminal { margin-top: 0; min-width: min(420px, 86vw); }

/* Post-to-post navigation */
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3rem; }
.post-nav a {
  display: block; padding: 1.1rem 1.2rem; text-decoration: none;
  border: 1px solid var(--line); border-radius: 2px; background: var(--panel);
  transition: border-color .25s ease;
}
.post-nav a:hover { border-color: rgba(34,211,238,.4); }
.post-nav span { display: block; font-family: var(--mono); font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--cyan); }
.post-nav b { display: block; margin-top: .4rem; font-family: var(--display); font-weight: 800; font-size: 1rem; line-height: 1.3; color: #fff; }
.post-nav .next { text-align: right; grid-column: 2; }
.more-posts { max-width: 1080px; margin: 0 auto; padding: 1rem clamp(1.2rem, 4vw, 2.8rem) 4rem; }
.more-posts .section-head { margin-bottom: 1.4rem; }

@media (max-width: 640px) {
  .mini-hero { flex-direction: column; align-items: flex-start; }
  .mini-hero .right { align-items: flex-start; width: 100%; }
  .mini-hero .terminal { min-width: 0; width: 100%; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .next { grid-column: 1; }
}
.mini-hero .mini-sub { margin-top: 1.7rem; }
.topbar { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.topbar.scrolled { background: rgba(7,8,12,.8); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }

/* ---------- Checklists & resource links ---------- */
.checklist { list-style: none; padding-left: 0 !important; }
.checklist li { position: relative; padding-left: 2rem; }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: .32em; width: 1.05rem; height: 1.05rem;
  border: 1.5px solid rgba(34,211,238,.55); border-radius: 2px; background: rgba(34,211,238,.06);
}
.checklist li::after {
  content: ""; position: absolute; left: .34rem; top: .5em; width: .35rem; height: .6rem;
  border: solid var(--cyan); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.res-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .8rem; }
.prose .res-grid a {
  display: block; padding: 1rem 1.1rem; text-decoration: none; color: inherit;
  border: 1px solid var(--line); border-radius: 2px; background: var(--panel);
  transition: border-color .25s ease, transform .25s ease;
}
.prose .res-grid a:hover { border-color: rgba(34,211,238,.45); transform: translateY(-2px); }
.res-grid b { display: block; font-family: var(--display); font-weight: 800; color: #fff; font-size: 1rem; }
.res-grid span { display: block; margin-top: .3rem; font-size: .88rem; line-height: 1.5; color: var(--muted); }
.res-grid em { display: block; margin-top: .55rem; font-style: normal; font-family: var(--mono); font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--cyan); }
.toc { display: flex; flex-wrap: wrap; gap: .5rem; }
.prose .toc a { text-decoration: none; }
@media (max-width: 640px) {
  .topbar nav { gap: .85rem; font-size: .66rem; letter-spacing: .08em; }
}

/* ---------- Posts archive and home explore tiles ---------- */
.archive { padding-top: 2.4rem; }
.archive-title { font-family: var(--display); font-weight: 900; font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -.035em; line-height: 1; color: #fff; }
.archive-title span { color: var(--cyan); }
.explore-head { margin-top: 3.5rem; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.tile {
  position: relative; display: flex; flex-direction: column; gap: .55rem;
  padding: 1.4rem 1.4rem 3.2rem; text-decoration: none;
  border: 1px solid var(--line); border-radius: 2px; background: var(--panel);
  transition: border-color .25s ease, transform .25s ease, background .25s ease;
}
.tile:hover { border-color: var(--line-strong); transform: translateY(-2px); background: rgba(16,19,27,.8); }
.tile-label { font-family: var(--mono); font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; color: var(--cyan); }
.tile h3 { font-family: var(--display); font-weight: 800; font-size: 1.25rem; letter-spacing: -.02em; line-height: 1.2; color: #fff; }
.tile p { color: var(--muted); line-height: 1.6; font-size: .95rem; }
.tile .arrow { position: absolute; left: 1.4rem; bottom: 1.2rem; color: var(--cyan); font-family: var(--mono); transition: transform .25s ease; }
.tile:hover .arrow { transform: translateX(4px); }
@media (max-width: 800px) { .tiles { grid-template-columns: 1fr; } }

/* ---------- Centred top navigation ---------- */
.topbar nav {
  position: absolute; top: 0; bottom: 0; left: 0; right: 0;
  justify-content: center; pointer-events: none;
}
.topbar nav > * { pointer-events: auto; }
.topbar nav .pill {
  position: absolute; right: clamp(1.2rem, 4vw, 2.8rem); top: 50%; transform: translateY(-50%);
}
@media (max-width: 640px) {
  .topbar nav { position: static; flex: 1; justify-content: center; pointer-events: auto; }
}

/* ---------- Larger nav with animated active state ---------- */
.topbar { font-size: .8rem; }
.topbar .brand { font-size: 1.3rem; }
.topbar nav { gap: 2.1rem; letter-spacing: .16em; }
.topbar nav .pill { padding: .6rem 1rem; }
.topbar nav a { position: relative; padding: .55rem 0; transition: color .25s ease, text-shadow .25s ease; }
.topbar nav a::after,
.topbar nav a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; display: block; height: 2px; margin: 0;
  background: linear-gradient(90deg, var(--cyan), var(--violet), var(--cyan)); background-size: 200% 100%;
  transform: scaleX(0); transform-origin: left; transition: transform .35s ease;
}
.topbar nav a:hover::after { transform: scaleX(1); }
.topbar nav a.active { color: var(--fg); text-shadow: 0 0 14px rgba(34,211,238,.35); }
.topbar nav a.active::after { transform: scaleX(1); animation: nav-draw .7s ease-out both, nav-flow 6s linear .7s infinite; }
@keyframes nav-draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes nav-flow { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  .topbar nav a.active::after { animation: none; }
}
@media (max-width: 640px) {
  .topbar { font-size: .7rem; }
  .topbar .brand { font-size: 1.15rem; }
  .topbar nav { gap: .8rem; font-size: .68rem; letter-spacing: .08em; }
}
