@font-face { font-family: "Geist"; src: url("/fonts/geist.woff2") format("woff2"); font-weight: 400 800; font-style: normal; font-display: block; }
@font-face { font-family: "Geist Mono"; src: url("/fonts/geist-mono.woff2") format("woff2"); font-weight: 400 500; font-style: normal; font-display: block; }
:root {
  --bg: #151D27; --bg-2: #1C2632; --line: rgba(255,255,255,.10);
  --text: #F4F6F8; --muted: #A3ADB8;
  --green: #4ADE80; --cyan: #5BCFE6; --pink: #EC4899;
  --grad: linear-gradient(90deg, var(--green), var(--cyan));
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; color: var(--text); font-family: "Geist", system-ui, sans-serif;
  font-size: 1.0625rem; line-height: 1.65; -webkit-font-smoothing: antialiased;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,.05) 1px, transparent 0),
    radial-gradient(900px 500px at 15% 0%, rgba(74,222,128,.10), transparent 70%),
    linear-gradient(135deg, #13232B 0%, #161C28 50%, #1E1A2D 100%);
  background-size: 28px 28px, auto, auto;
  background-attachment: scroll, fixed, fixed;
}
a { color: inherit; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--cyan); color: var(--bg); }
.g { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 700px) { .wrap { padding: 0 18px; } }

/* ---------- Header (matches the homepage) ---------- */
header { position: sticky; top: 0; z-index: 10; background: rgba(17,26,34,.72); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; justify-content: space-between; height: 66px; gap: 16px; }
.brand { font-weight: 600; letter-spacing: .02em; text-decoration: none; font-size: 1.15rem; line-height: 1.15; display: inline-flex; flex-direction: column; gap: 4px; }
.brand .ln { display: flex; align-items: center; height: 8px; }
.brand .wv { flex: none; width: 22px; height: 8px; fill: none; stroke: #F7C873; stroke-width: 2; stroke-linecap: round; }
.brand .ln i:first-of-type { flex: 1; height: 2px; margin-left: -1px; background: var(--green); border-radius: 1px; }
.brand .ln i:last-of-type { flex: none; width: 7px; height: 7px; margin-left: 3px; border-radius: 50%; background: var(--pink); }
nav ul { list-style: none; display: flex; gap: 2px; margin: 0; padding: 0; }
nav a { display: block; padding: 8px 13px; border-radius: 8px; text-decoration: none; color: var(--text); }
nav a:hover, nav a[aria-current] { color: var(--green); }
.menu-btn { display: none; }
@media (max-width: 780px) {
  .menu-btn { display: inline-flex; background: none; border: 1px solid var(--line); color: var(--text); font: inherit; font-size: .9rem; padding: 6px 14px; border-radius: 8px; }
  nav ul { display: none; position: absolute; left: 0; right: 0; top: 66px; flex-direction: column; padding: 8px 18px 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
  nav.open ul { display: flex; }
  nav a { padding: 12px 4px; font-size: 1.05rem; }
}

/* Tools: a highlighted pill in the nav */
nav .tools-link a { display: inline-flex; align-items: center; gap: 7px; margin-left: 6px; padding: 6px 14px; border-radius: 10px;
  border: 2px solid var(--green); background: rgba(74,222,128,.06); color: var(--green); font-weight: 500;
  box-shadow: 0 0 18px -2px rgba(74,222,128,.45), inset 0 0 12px -4px rgba(74,222,128,.3); transition: box-shadow .2s, background .2s; }
nav .tools-link a:hover { color: var(--green); background: rgba(74,222,128,.12); box-shadow: 0 0 28px 0 rgba(74,222,128,.55), inset 0 0 14px -4px rgba(74,222,128,.4); }
nav .tools-link .tools-ic { flex: none; }
@media (min-width: 781px) and (max-width: 980px) { nav a { padding: 8px 8px; font-size: .95rem; } nav .tools-link a { padding: 6px 11px; margin-left: 4px; } .brand { font-size: 1.05rem; } }
nav a, .brand { white-space: nowrap; }
@media (max-width: 780px) { nav .tools-link a { margin: 8px 0 4px; padding: 9px 16px; width: fit-content; font-size: 1rem; } }

/* Mobile menu open: soften and dim the page behind it, so the menu reads as its own layer */
body > :not(header):not(.toast) { transition: filter .25s ease; }
body.menu-open > :not(header):not(.toast) { filter: blur(6px) brightness(.45); pointer-events: none; user-select: none; }
@media (prefers-reduced-motion: reduce) { body > :not(header):not(.toast) { transition: none; } }
@media (max-width: 780px) { nav ul { box-shadow: 0 24px 40px -18px rgba(0,0,0,.75); } }

/* ---------- Blog page ---------- */
.blog-head { padding: 96px 0 40px; }
.blog-head h1 { margin: 0; font-size: clamp(2.2rem, 5.4vw, 3.8rem); line-height: 1.08; letter-spacing: -.035em; font-weight: 800; max-width: 18ch; }
.blog-head p { margin: 20px 0 0; color: var(--muted); font-size: 1.15rem; max-width: 52ch; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; padding: 0; list-style: none; }
.filters button {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  font: inherit; font-size: .95rem; font-weight: 500; color: var(--text);
  padding: 9px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg);
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.filters button img { width: 20px; height: 20px; }
.filters button:hover { border-color: rgba(91,207,230,.5); }
.filters button[aria-pressed="true"] { border-color: var(--cyan); background: rgba(91,207,230,.12); box-shadow: 0 0 18px -6px var(--cyan); }
.filters .count { color: var(--muted); font-family: var(--mono); font-size: .78rem; }

.posts { list-style: none; margin: 40px 0 0; padding: 0; }
.post-card { border-top: 1px solid var(--line); }
.post-card:last-child { border-bottom: 1px solid var(--line); }
.post-card a { display: grid; grid-template-columns: 1fr auto; gap: 8px 40px; padding: 30px 0; text-decoration: none; }
.post-card .tags { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: .88rem; }
.post-card .tags img { width: 18px; height: 18px; }
.post-card h2 { margin: 0; font-size: clamp(1.3rem, 2.6vw, 1.75rem); line-height: 1.25; letter-spacing: -.02em; font-weight: 800; max-width: 30ch; transition: color .2s; }
.post-card a:hover h2 { color: var(--green); }
.post-card p { margin: 0; color: var(--muted); max-width: 62ch; grid-column: 1; }
.post-card .read { grid-row: 2 / span 2; grid-column: 2; align-self: center; color: var(--cyan); font-family: var(--mono); font-size: .85rem; font-weight: 500; white-space: nowrap; }
@media (max-width: 700px) {
  .post-card a { grid-template-columns: 1fr; }
  .post-card .read { grid-column: 1; grid-row: auto; }
}
.empty { margin: 40px 0 0; padding: 28px; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); }
.empty strong { color: var(--text); }
.blog-foot { padding: 72px 0; }

/* ---------- Post ---------- */
.post { position: relative; max-width: 760px; margin: 0 auto; padding: 80px 24px 40px 72px; }
@media (max-width: 700px) { .post { padding: 56px 18px 32px 40px; } }
/* Reading line: lights up as you read, ends in a pink dot */
.read-line { position: absolute; left: 30px; top: 92px; bottom: 120px; width: 2px; background: var(--line); }
.read-line::after { content: ""; position: absolute; inset: 0; background: #52D7B3; box-shadow: 0 0 10px rgba(82,215,179,.55); transform-origin: top; transform: scaleY(var(--read, 0)); }
.read-line b { position: absolute; left: -5px; bottom: -6px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--pink); background: var(--bg); transition: background .4s, box-shadow .4s; }
.read-line.done b { background: var(--pink); box-shadow: 0 0 16px var(--pink); }
.read-line b, .read-line i { z-index: 1; }
.read-line i { position: absolute; left: -5px; top: -6px; width: 12px; height: 12px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
@media (max-width: 700px) { .read-line { left: 14px; top: 68px; } }

.crumbs { font-size: .92rem; color: var(--muted); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.crumbs a { text-decoration: none; color: var(--cyan); }
.crumbs img { width: 18px; height: 18px; }
.post h1 { margin: 18px 0 0; font-size: clamp(2rem, 4.8vw, 3rem); line-height: 1.1; letter-spacing: -.03em; font-weight: 800; }
.meta { margin-top: 16px; color: var(--muted); font-family: var(--mono); font-size: .85rem; display: flex; gap: 18px; }

.short { margin: 32px 0 0; padding: 20px 22px; border-radius: 10px; border: 1px solid rgba(74,222,128,.45); background: linear-gradient(135deg, rgba(74,222,128,.10), rgba(91,207,230,.05)); }
.short span { display: block; font-family: var(--mono); font-size: .8rem; font-weight: 500; color: var(--green); margin-bottom: 6px; }
.short p { margin: 0; }

.post h2 { margin: 52px 0 0; font-size: 1.5rem; line-height: 1.25; letter-spacing: -.02em; font-weight: 800; }
.post h3 { margin: 32px 0 0; font-size: 1.12rem; font-weight: 700; }
.post p, .post ul, .post ol { margin: 16px 0 0; }
.post li + li { margin-top: 8px; }
.post p a, .post li a { color: var(--cyan); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.post code { font-family: var(--mono); font-size: .9em; padding: 1px 6px; border-radius: 5px; background: rgba(91,207,230,.10); color: #CFF3FB; }
.tip { margin: 20px 0 0; padding: 14px 18px; border-left: 2px solid var(--cyan); background: rgba(91,207,230,.06); border-radius: 0 8px 8px 0; color: var(--muted); font-size: .98rem; }
.tip strong { color: var(--text); }

/* Code block */
.code { margin: 24px 0 0; border: 1px solid var(--line); border-radius: 10px; background: #0F161E; overflow: hidden; }
.code-bar { display: flex; justify-content: space-between; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: .8rem; color: var(--muted); }
.code-bar button { font: inherit; font-size: .85rem; color: var(--text); background: none; border: 1px solid var(--line); border-radius: 6px; padding: 4px 12px; cursor: pointer; }
.code-bar button:hover { border-color: var(--green); color: var(--green); }
.code pre { margin: 0; padding: 18px 0; overflow-x: auto; font-family: var(--mono); font-size: .88rem; line-height: 1.7; counter-reset: ln; }
.code pre span.l { display: block; padding: 0 18px 0 0; }
.code pre span.l::before { counter-increment: ln; content: counter(ln); display: inline-block; width: 3.2em; padding-right: 1.2em; text-align: right; color: #4A5866; user-select: none; }
.code.collapsible:not(.open) pre { max-height: 340px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.code .expand { display: block; width: 100%; font: inherit; font-size: .9rem; font-weight: 500; color: var(--cyan); background: none; border: 0; border-top: 1px solid var(--line); padding: 11px; cursor: pointer; }
.code .expand:hover { color: var(--green); }
.tk-key { color: #7FD8EC; } .tk-n { color: #F7C873; }
.tk-s { color: #A5E8B4; } .tk-k { color: #F38BC6; } .tk-f { color: #7FD8EC; } .tk-p { color: #F7C873; } .tk-c { color: #6F7E8C; font-style: italic; }

/* Response fields table */
.fields { width: 100%; margin: 20px 0 0; border-collapse: collapse; font-size: .95rem; }
.fields th, .fields td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.fields th { color: var(--muted); font-weight: 500; font-size: .85rem; }
.fields td:first-child { white-space: nowrap; }
@media (max-width: 560px) {
  .fields.stack thead { display: none; }
  .fields.stack tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .fields.stack td { display: block; padding: 2px 0; border: 0; }
  .fields.stack td:first-child { margin-bottom: 4px; }
}

/* Before / after for the post */
.ba { margin: 36px 0 0; padding: 22px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.03); }
.ba-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.ba-head strong { font-size: 1rem; }
.toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; padding: 3px; background: var(--bg); }
.toggle button { font: inherit; font-size: .85rem; border: 0; background: none; color: var(--muted); padding: 6px 14px; border-radius: 7px; cursor: pointer; }
.toggle button[aria-pressed="true"] { background: var(--grad); color: #0E1A1F; font-weight: 600; }
.chain { list-style: none; margin: 20px 0 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; row-gap: 12px; }
.chain li { display: flex; align-items: center; }
.chain li + li::before { content: ""; width: 22px; height: 2px; background: var(--line); margin: 0 4px; }
.chain .n { padding: 8px 12px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); font-family: var(--mono); font-size: .8rem; font-weight: 500; white-space: nowrap; }
.chain .n.new { border-color: rgba(91,207,230,.55); background: rgba(91,207,230,.10); }
.chain .n.bad { border-style: dashed; border-color: rgba(247,200,115,.6); color: #FBDDA6; }
.chain .n.good { border-color: var(--pink); background: rgba(236,72,153,.14); }
.chain[hidden] { display: none; }
.after-chain li + li::before { background: var(--grad); }
@media (max-width: 560px) {
  .chain { flex-direction: column; align-items: flex-start; row-gap: 0; }
  .chain li { flex-direction: column; align-items: flex-start; }
  .chain li + li::before { width: 2px; height: 14px; margin: 3px 0 3px 18px; }
}

/* End of post */
.end { margin: 64px 0 0; padding: 26px; border-radius: 10px; border: 1px solid rgba(236,72,153,.45); background: linear-gradient(135deg, rgba(236,72,153,.10), rgba(91,207,230,.04)); }
.end h2 { margin: 0; font-size: 1.35rem; }
.end p { margin: 10px 0 0; color: var(--muted); }
.btn {
  display: inline-block; margin-top: 18px; padding: 12px 24px; border-radius: 10px; text-decoration: none;
  border: 2px solid var(--green); color: var(--green); font-weight: 500; background: rgba(74,222,128,.06);
  box-shadow: 0 0 18px -2px rgba(74,222,128,.45), inset 0 0 12px -4px rgba(74,222,128,.3);
}
.btn:hover { background: rgba(74,222,128,.12); }
.back { display: inline-block; margin-top: 28px; color: var(--cyan); text-decoration: none; font-size: .95rem; }

footer { border-top: 1px solid var(--line); padding: 32px 0 40px; color: var(--muted); font-size: .9rem; }

/* ---------- Case studies ---------- */
.stack-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.stack-tags span { font-family: var(--mono); font-size: .78rem; padding: 4px 10px; border-radius: 6px; border: 1px solid var(--line); color: var(--muted); }
.apps { list-style: none; margin: 26px 0 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 14px; }
.app { padding: 20px 22px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.03); }
.app h3 { margin: 0; font-size: 1.1rem; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.app h3 small { font-family: var(--mono); font-size: .75rem; font-weight: 500; color: var(--cyan); letter-spacing: .04em; }
.app ul { margin: 12px 0 0; padding-left: 1.1em; }
.app li { margin: 6px 0; color: var(--muted); }
.app li strong { color: var(--text); font-weight: 600; }
.results { list-style: none; margin: 22px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.results li, .post .results li, .post .apps > li { margin: 0; }
.results li { padding: 16px 18px; border-radius: 10px; border: 1px solid rgba(236,72,153,.35); background: rgba(236,72,153,.06); }
.results b { display: block; font-size: 1.05rem; }
.results span { display: block; margin-top: 4px; color: var(--muted); font-size: .95rem; }
@media (max-width: 640px) { .results { grid-template-columns: 1fr; } }
