/* Fledly blog. Monochrome like the app: white/black, one ink, quiet lines.
   Fonts are self-hosted (no third-party requests). */
@font-face { font-family: "Bricolage Grotesque"; font-weight: 500; font-display: swap; src: url(fonts/bricolage-grotesque-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Bricolage Grotesque"; font-weight: 700; font-display: swap; src: url(fonts/bricolage-grotesque-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url(fonts/ibm-plex-sans-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-style: italic; font-display: swap; src: url(fonts/ibm-plex-sans-latin-400-italic.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap; src: url(fonts/ibm-plex-sans-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url(fonts/ibm-plex-mono-latin-400-normal.woff2) format("woff2"); }

:root {
  --bg: #ffffff; --panel: #fafafa; --raised: #f2f2f2; --line: #e6e6e6; --line-strong: #cfcfcf;
  --ink: #0d0d0d; --mute: #5c5c5c; --faint: #8a8a8a; --hi: #0d0d0d; --hi-ink: #ffffff;
  --chart-1: #0d0d0d; --chart-2: #8a8a8a; --chart-3: #cfcfcf; --good: #0f7a4f; --warn: #a3650b;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0b0b; --panel: #121212; --raised: #1a1a1a; --line: #262626; --line-strong: #3a3a3a;
    --ink: #f2f2f2; --mute: #a6a6a6; --faint: #737373; --hi: #f2f2f2; --hi-ink: #0b0b0b;
    --chart-1: #f2f2f2; --chart-2: #8c8c8c; --chart-3: #3d3d3d; --good: #4fd19a; --warn: #f0b44c;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0b0b; --panel: #121212; --raised: #1a1a1a; --line: #262626; --line-strong: #3a3a3a;
  --ink: #f2f2f2; --mute: #a6a6a6; --faint: #737373; --hi: #f2f2f2; --hi-ink: #0b0b0b;
  --chart-1: #f2f2f2; --chart-2: #8c8c8c; --chart-3: #3d3d3d; --good: #4fd19a; --warn: #f0b44c;
  color-scheme: dark;
}

*, *::before, *::after { 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 "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img, svg { max-width: 100%; }
h1, h2, h3, .feature-title, .card-title, .cta-title { font-family: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif; letter-spacing: -0.02em; text-wrap: balance; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
.wrap { max-width: 1120px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.eyebrow { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); font-weight: 600; margin: 0; }

/* header / footer */
.site-head { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.head-row { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; font: 700 19px/1 "Bricolage Grotesque", sans-serif; letter-spacing: -0.02em; }
.brand svg { width: 26px; height: 26px; color: var(--ink); }
.site-head nav { display: flex; align-items: center; gap: 6px; font-size: 15px; }
.site-head nav a { text-decoration: none; padding: 8px 12px; border-radius: 999px; color: var(--mute); }
.site-head nav a:hover { color: var(--ink); }
.btn, .site-head nav a.btn { background: var(--hi); color: var(--hi-ink); text-decoration: none; padding: 8px 16px; border-radius: 999px; font-weight: 600; font-size: 15px; display: inline-block; transition: transform .15s ease, opacity .15s ease; }
.btn:hover, .site-head nav a.btn:hover { color: var(--hi-ink); opacity: .88; transform: translateY(-1px); }
.btn-lg { padding: 12px 22px; font-size: 16px; }
.site-foot { border-top: 1px solid var(--line); margin-top: 96px; padding: 40px 0 56px; color: var(--mute); font-size: 15px; }
.foot-row { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: flex-start; }
.foot-row p { margin: 10px 0 0; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.site-foot nav a { text-decoration: none; }
.site-foot nav a:hover { color: var(--ink); }

/* blog index */
.hero { padding: 72px 0 40px; max-width: 760px; }
.hero h1 { font-size: clamp(36px, 6vw, 60px); line-height: 1.04; margin: 14px 0 18px; }
.hero .dek { font-size: 19px; color: var(--mute); margin: 0; }
.feature { display: grid; gap: 12px; text-decoration: none; padding: 32px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); margin-bottom: 20px; transition: border-color .2s ease, transform .2s ease; }
.feature:hover, .card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.feature-title { font-size: clamp(26px, 3.6vw, 38px); line-height: 1.1; font-weight: 700; }
.more { font-weight: 600; font-size: 15px; }
.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.card { display: flex; flex-direction: column; gap: 10px; text-decoration: none; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg); transition: border-color .2s ease, transform .2s ease; }
.feature-text { display: grid; gap: 12px; align-content: center; }
.feature.has-thumb { grid-template-columns: 1fr; }
.feature.has-thumb .thumb { order: -1; }
@media (min-width: 820px) { .feature.has-thumb { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px; align-items: center; } .feature.has-thumb .thumb { order: 0; } }
.thumb { display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 10px; }
.card .thumb { margin: -6px -6px 4px; }
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; transition: transform .4s ease; }
.card:hover .thumb img, .feature:hover .thumb img { transform: scale(1.03); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .thumb img { filter: invert(1); mix-blend-mode: screen; } }
:root[data-theme="dark"] .thumb img { filter: invert(1); mix-blend-mode: screen; }
@media (prefers-reduced-motion: reduce) { .thumb img { transition: none; } .card:hover .thumb img, .feature:hover .thumb img { transform: none; } }
.card-title { font-size: 21px; line-height: 1.2; font-weight: 700; }
.card-desc { color: var(--mute); font-size: 15px; line-height: 1.55; }
.about { display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); margin-top: 72px; padding-top: 40px; border-top: 1px solid var(--line); color: var(--mute); font-size: 16px; }
.about p { margin: 8px 0 0; }
.about strong { color: var(--ink); }

/* post */
.post { padding-top: 40px; }
.crumbs { font-size: 14px; color: var(--faint); }
.crumbs a { text-decoration: none; color: var(--mute); }
.post > h1 { font-size: clamp(34px, 5.4vw, 56px); line-height: 1.05; margin: 16px 0 18px; max-width: 900px; }
.post > .dek { font-size: 20px; line-height: 1.55; color: var(--mute); max-width: 760px; margin: 0 0 18px; }
.byline { display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: 14px; color: var(--faint); margin: 0 0 40px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.byline a { color: var(--mute); }
.post-grid { display: grid; gap: 56px; grid-template-columns: minmax(0, 720px) minmax(0, 1fr); }
.side { position: relative; }
.toc { position: sticky; top: 84px; font-size: 14px; border-left: 1px solid var(--line); padding-left: 18px; }
.toc summary { font-weight: 600; cursor: pointer; color: var(--ink); list-style: none; margin-bottom: 10px; }
.toc summary::-webkit-details-marker { display: none; }
.toc ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.toc a { text-decoration: none; color: var(--mute); line-height: 1.4; display: block; }
.toc a:hover { color: var(--ink); }
@media (max-width: 960px) {
  .post-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .side { order: -1; }
  .toc { position: static; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 32px; }
  .toc:not([open]) summary { margin: 0; }
}

.prose { min-width: 0; }
.prose > * + * { margin-top: 1.1em; }
.prose p, .prose li { color: color-mix(in srgb, var(--ink) 88%, var(--bg)); }
.prose h2 { font-size: 30px; line-height: 1.15; margin: 2.2em 0 .6em; }
.prose h3 { font-size: 21px; line-height: 1.3; margin: 1.8em 0 .4em; }
.prose h2 + *, .prose h3 + * { margin-top: 0; }
.prose .anchor { text-decoration: none; color: var(--faint); margin-left: -1em; padding-right: .3em; opacity: 0; transition: opacity .15s; }
.prose h3:hover .anchor { opacity: 1; }
.prose a { text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.prose a:hover { text-decoration-color: var(--ink); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .4em; }
.prose code { font: 400 .88em "IBM Plex Mono", ui-monospace, monospace; background: var(--raised); padding: .12em .38em; border-radius: 6px; overflow-wrap: anywhere; }
.prose pre { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; overflow-x: auto; font-size: 14px; line-height: 1.6; }
.prose pre code { background: none; padding: 0; }
.prose blockquote { margin-left: 0; padding-left: 18px; border-left: 3px solid var(--ink); color: var(--mute); font-style: italic; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; line-height: 1.45; font-variant-numeric: tabular-nums; }
th, td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-weight: 600; background: var(--panel); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }

.box { border: 1px solid var(--line-strong); border-radius: 16px; padding: 20px 22px; background: var(--panel); }
.box > :first-child { margin-top: 0; }
.box-label { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; color: var(--faint); margin: 0 0 6px; }
.box ul { margin: 0; }
.box-note { background: transparent; border-style: dashed; }

.fig { margin: 2em 0; }
.fig svg { display: block; width: 100%; height: auto; }
.fig figcaption { font-size: 14px; color: var(--faint); margin-top: 10px; line-height: 1.5; }
/* shared figure styles: figures are inline SVG so they follow the theme */
.fig .t { font-family: "IBM Plex Sans", sans-serif; fill: var(--ink); }
.fig .tm { font-family: "IBM Plex Sans", sans-serif; fill: var(--mute); }
.fig .tf { font-family: "IBM Plex Sans", sans-serif; fill: var(--faint); }
.fig .mono { font-family: "IBM Plex Mono", monospace; }
.fig .disp { font-family: "Bricolage Grotesque", sans-serif; font-weight: 700; }
.fig .b { font-weight: 600; }
.fig .ink { fill: var(--chart-1); }
.fig .mid { fill: var(--chart-2); }
.fig .soft { fill: var(--chart-3); }
.fig .panel { fill: var(--panel); }
.fig .bgf { fill: var(--bg); }
.fig .raised { fill: var(--raised); }
.fig .inv { fill: var(--hi-ink); }
.fig .good { fill: var(--good); }
.fig .warn { fill: var(--warn); }
.fig .ln { stroke: var(--line-strong); fill: none; }
.fig .lnf { stroke: var(--line); fill: none; }
.fig .lni { stroke: var(--ink); fill: none; }
.fig .dash { stroke-dasharray: 4 4; }
.fig .anim-walk { animation: walk 7s cubic-bezier(.45,0,.55,1) infinite; }
.fig .anim-line { stroke-dasharray: 640; stroke-dashoffset: 640; animation: draw 7s cubic-bezier(.45,0,.55,1) infinite; }
.fig .pulse { transform-box: fill-box; transform-origin: center; animation: pulse 2.2s ease-out infinite; }
.fig .grow { transform-box: fill-box; transform-origin: left center; animation: grow .9s cubic-bezier(.2,.7,.2,1) both; }
@keyframes walk { 0% { transform: translateX(0); opacity: 0; } 6% { opacity: 1; } 85% { transform: translateX(640px); opacity: 1; } 100% { transform: translateX(640px); opacity: 0; } }
@keyframes draw { 0% { stroke-dashoffset: 640; } 85%, 100% { stroke-dashoffset: 0; } }
@keyframes pulse { 0% { transform: scale(1); opacity: .45; } 100% { transform: scale(2.1); opacity: 0; } }
.fig .pop { transform-box: fill-box; transform-origin: center; animation: popin .5s cubic-bezier(.2,.9,.3,1.4) both; }
@keyframes popin { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.fig .draw-once { stroke-dasharray: 1; stroke-dashoffset: 1; animation: drawonce 1.6s cubic-bezier(.3,.6,.2,1) .2s forwards; }
@keyframes drawonce { to { stroke-dashoffset: 0; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }


.cta { margin-top: 3em; border-radius: 20px; padding: 28px; background: var(--hi); color: var(--hi-ink); }
.cta p { color: color-mix(in srgb, var(--hi-ink) 78%, var(--hi)); margin: 0 0 16px; }
.cta .cta-eyebrow { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; margin-bottom: 8px; }
.cta .cta-title { font-size: 26px; line-height: 1.2; font-weight: 700; color: var(--hi-ink); margin-bottom: 10px; }
.cta .btn { background: var(--hi-ink); color: var(--hi); }
.cta .btn:hover { color: var(--hi); }
.author-box { max-width: 720px; margin-top: 48px; padding: 20px 0; border-top: 1px solid var(--line); color: var(--mute); font-size: 15px; }
.author-box p { margin: 6px 0 0; }
.author-box strong { color: var(--ink); }
.related { margin-top: 56px; }
.related h2 { font-size: 26px; margin: 0 0 18px; }

@media (max-width: 600px) {
  body { font-size: 16.5px; }
  .site-head nav a:not(.btn) { padding: 8px; }
  .feature { padding: 22px; }
  .cta { padding: 22px; }
  .prose h2 { font-size: 26px; }
}

/* header illustrations: black ink on white, blended so they follow the theme */
.hero-art { margin: -8px 0 40px; display: flex; justify-content: center; }
.hero-art img { display: block; width: 100%; max-width: 760px; height: auto; mix-blend-mode: multiply; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero-art img { filter: invert(1); mix-blend-mode: screen; } }
:root[data-theme="dark"] .hero-art img { filter: invert(1); mix-blend-mode: screen; }

/* interactive tools */
.tool { border: 1px solid var(--line-strong); border-radius: 20px; padding: 22px; background: var(--panel); margin: 0 0 2.4em; }
.tool-grid { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.field { display: grid; gap: 6px; font-size: 14px; }
.field-wide { grid-column: 1 / -1; }
.field-head { display: flex; justify-content: space-between; gap: 10px; font-weight: 600; color: var(--ink); }
.field-head em { font-weight: 400; font-style: normal; color: var(--faint); }
.field textarea { min-height: 96px; }
.field input, .field textarea, .field select { font: 400 15px/1.5 "IBM Plex Mono", ui-monospace, monospace; color: var(--ink); background: var(--bg); border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 12px; width: 100%; box-sizing: border-box; resize: vertical; transition: border-color .15s ease; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--ink); }
.field input::placeholder, .field textarea::placeholder { color: var(--faint); }
.count { font-weight: 400; color: var(--faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.count.over { color: var(--warn); font-weight: 600; }
.tool-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; }
.tool button.btn { border: 0; cursor: pointer; font-family: inherit; }
.btn-ghost, .tool button.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn-ghost:hover, .tool button.btn-ghost:hover { color: var(--ink); }
.tool-out { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 18px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stats:empty { display: none; }
.stats > div { display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); font-size: 13px; color: var(--mute); line-height: 1.35; }
.stats .big { font: 700 28px/1.1 "Bricolage Grotesque", sans-serif; color: var(--ink); font-variant-numeric: tabular-nums; }
.prose .issues { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; }
.prose .issues li { margin: 0; padding: 10px 14px 10px 36px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); position: relative; font-size: 15px; line-height: 1.5; animation: pop .3s ease both; }
.issues li::before { position: absolute; left: 13px; top: 10px; font-weight: 700; }
.issues li.bad::before { content: "×"; color: var(--warn); }
.issues li.warn::before { content: "!"; color: var(--warn); }
.issues li.ok::before { content: "✓"; color: var(--good); }
.clean { margin-top: 16px; padding: 14px; border-radius: 12px; background: var(--bg); border: 1px dashed var(--line-strong); }
.clean code { display: block; white-space: pre-wrap; word-break: break-all; background: none; padding: 0; font-size: 14px; }
@keyframes pop { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (max-width: 600px) {
  .tool { padding: 16px; margin-left: -4px; margin-right: -4px; }
  .tool-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .stats > div { grid-template-columns: auto 1fr; align-items: baseline; gap: 10px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } .fig .draw-once, .fig .anim-line { stroke-dashoffset: 0 !important; } }
