/* ============================================================
   Mariusz Kotas — Design System
   Colors & Type tokens
   ------------------------------------------------------------
   Brand: dark navy + gold, modern minimalist.
   Positioning: product builder / solopreneur (evolving from
   "software craftsman").
   ============================================================ */

/* -------- TYPEFACES --------
   Display:  Fraunces      — modern serif with character
   UI/Body:  Inter         — neutral, highly legible sans
   Mono:     JetBrains Mono — code, kbd, ticker numerals
   Loaded via Google Fonts in HTML <head>. */

:root {
  /* ============= COLOR — RAW PALETTE ============= */

  /* Navy — primary brand surface */
  --navy-900: #0B1A2E;
  --navy-800: #102439;
  --navy-700: #17314F;
  --navy-600: #20406A;
  --navy-500: #2F5A8E;
  --navy-300: #6B86A8;
  --navy-100: #C9D2DE;

  /* Gold — accent. The single non-neutral hue. */
  --gold-700: #B8860D;
  --gold-600: #D4A017;
  --gold-500: #E8AE0D;
  --gold-400: #EFC149;
  --gold-200: #F7E2A0;
  --gold-50:  #FBF5E3;

  /* Warm neutrals — paper-like off-white, never pure white */
  --paper:    #FAF7F1;
  --paper-2:  #F2EEE3;
  --paper-3:  #E8E2D2;
  --ink-900:  #0B1A2E;
  --ink-700:  #2A3548;
  --ink-500:  #5A6478;
  --ink-300:  #8B94A6;

  /* Semantic */
  --success:  #1F7A4D;
  --warning:  #C97A0E;
  --danger:   #B23A3A;
  --info:     var(--navy-500);

  /* ============= COLOR — SEMANTIC ROLES ============= */
  --bg:           var(--paper);
  --bg-elevated:  #FFFFFF;
  --bg-sunken:    var(--paper-2);
  --bg-brand:     var(--navy-800);
  --bg-accent:    var(--gold-500);

  --fg:           var(--ink-900);
  --fg-muted:     var(--ink-700);
  --fg-subtle:    var(--ink-500);
  --fg-faint:     var(--ink-300);
  --fg-on-brand:  var(--paper);
  --fg-on-accent: var(--navy-900);

  --accent:       var(--gold-600);
  --accent-hover: var(--gold-500);
  --accent-press: var(--gold-700);

  --border:       var(--paper-3);
  --border-strong:var(--ink-300);
  --border-brand: var(--navy-600);

  --link:         var(--navy-800);
  --link-hover:   var(--gold-600);

  /* ============= TYPE SCALE ============= */
  --font-display: "Fraunces", "Source Serif Pro", Georgia, serif;
  --font-sans:    "Inter", "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;

  /* Sizes */
  --text-xs:    12px;
  --text-sm:    14px;
  --text-base:  16px;
  --text-md:    18px;
  --text-lg:    20px;
  --text-xl:    24px;
  --text-2xl:   30px;
  --text-3xl:   38px;
  --text-4xl:   48px;
  --text-5xl:   64px;
  --text-6xl:   84px;

  /* Weights */
  --weight-light:    300;
  --weight-regular:  400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;

  /* Leading */
  --leading-tight: 1.15;
  --leading-snug:  1.3;
  --leading-body:  1.55;
  --leading-loose: 1.75;

  /* Tracking */
  --tracking-tight:  -0.02em;
  --tracking-normal: 0;
  --tracking-wide:    0.04em;
  --tracking-caps:    0.12em;

  /* ============= SPACING (4px base) ============= */
  --space-0:  0;
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  24px;
  --space-6:  32px;
  --space-7:  48px;
  --space-8:  64px;
  --space-9:  96px;
  --space-10: 128px;

  /* ============= RADII ============= */
  --radius-xs:    2px;
  --radius-sm:    4px;
  --radius-md:    8px;
  --radius-lg:    14px;
  --radius-xl:    20px;
  --radius-pill:  999px;

  /* ============= SHADOWS / ELEVATION ============= */
  --shadow-xs: 0 1px 2px rgba(11, 26, 46, 0.06);
  --shadow-sm: 0 2px 6px rgba(11, 26, 46, 0.08);
  --shadow-md: 0 6px 18px rgba(11, 26, 46, 0.10);
  --shadow-lg: 0 18px 40px rgba(11, 26, 46, 0.14);
  --shadow-gold: 0 4px 14px rgba(212, 160, 23, 0.30);
  --shadow-inset: inset 0 1px 0 rgba(255,255,255,0.06);

  /* ============= MOTION ============= */
  --ease-standard: cubic-bezier(0.2, 0.0, 0.0, 1.0);
  --ease-emphasis: cubic-bezier(0.2, 0.8, 0.2, 1.0);
  --ease-out:      cubic-bezier(0.0, 0.0, 0.2, 1.0);
  --duration-1: 120ms;
  --duration-2: 200ms;
  --duration-3: 320ms;
  --duration-4: 500ms;
}

/* ============= SEMANTIC ELEMENT STYLES ============= */
html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  font-weight: var(--weight-regular);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, .h1 {
  font-family: var(--font-display);
  font-size: var(--text-5xl);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  margin: 0 0 var(--space-5) 0;
}
h2, .h2 {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
  margin: 0 0 var(--space-4) 0;
}
h3, .h3 {
  font-family: var(--font-sans);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  margin: 0 0 var(--space-3) 0;
}
h4, .h4 {
  font-family: var(--font-sans);
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  margin: 0 0 var(--space-2) 0;
}
p {
  margin: 0 0 var(--space-4) 0;
  text-wrap: pretty;
  max-width: 68ch;
}
small, .text-sm { font-size: var(--text-sm); color: var(--fg-muted); }
.eyebrow {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--fg-subtle);
}
code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: 0.92em;
}
code {
  background: var(--bg-sunken);
  padding: 0.12em 0.4em;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
}
a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid var(--border-strong);
  transition: color var(--duration-1) var(--ease-standard),
              border-color var(--duration-1) var(--ease-standard);
}
a:hover { color: var(--link-hover); border-bottom-color: var(--link-hover); }

::selection { background: var(--gold-200); color: var(--ink-900); }

/* ============================================================
   Blog additions (blog.mkotas.cz)
   ------------------------------------------------------------
   Everything above is copied verbatim from mkotas.cz
   (public/styles/colors-and-type.css). Below: one extra gold for
   small text that meets WCAG AA on paper, blog-specific roles,
   and the dark theme as a remap of the semantic roles.
   ============================================================ */
:root {
  --gold-800: #8A6508;          /* 5.0:1 on paper; gold text under 18px */

  --accent-text: var(--gold-800);
  --accent-line: var(--gold-600);
  --accent-display: var(--gold-700); /* large display text only (3:1) */
  --rule-strong: var(--ink-900);
  --chip-gold-border: rgba(212, 160, 23, 0.4);
  --chip-gold-bg: rgba(212, 160, 23, 0.06);
  --code-bg: var(--navy-900);
  --code-fg: #DCE3EC;
  --code-label: var(--navy-300);
  --footer-bg: var(--navy-800);
  --footer-fg: var(--navy-100);
  --footer-strong: var(--paper);
  --year-stroke: var(--ink-500);
  --focus-ring: var(--navy-800);      /* 15:1 on paper */
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:            var(--navy-900);
    --bg-elevated:   var(--navy-800);
    --bg-sunken:     var(--navy-800);
    --fg:            var(--paper);
    --fg-muted:      var(--navy-100);
    --fg-subtle:     #8FA2BD;
    --fg-faint:      var(--navy-300);
    --border:        var(--navy-700);
    --border-strong: var(--navy-600);
    --link:          var(--paper);
    --link-hover:    var(--gold-500);
    --accent-text:   var(--gold-500);
    --accent-line:   var(--gold-500);
    --accent-display: var(--gold-500);
    --rule-strong:   var(--navy-100);
    --chip-gold-border: rgba(232, 174, 13, 0.45);
    --chip-gold-bg:  rgba(232, 174, 13, 0.08);
    --code-bg:       #07111F;
    --footer-bg:     #07111F;
    --year-stroke:   var(--navy-300);
    --focus-ring: var(--gold-500);
  }
  ::selection { background: var(--gold-500); color: var(--navy-900); }
}

/* Self-hosted brand fonts (Google Fonts, OFL). Generated by scripts/fetch-fonts.mjs. */
@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-weight: 400 600;
  font-display: swap;
  src: url(/fonts/fraunces-italic-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-weight: 400 600;
  font-display: swap;
  src: url(/fonts/fraunces-italic-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/fonts/fraunces-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/fonts/fraunces-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/fonts/inter-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/fonts/inter-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url(/fonts/jetbrains-mono-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url(/fonts/jetbrains-mono-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ============================================================
   blog.mkotas.cz — "Editorial" layout
   Tokens live in tokens.css (shared with mkotas.cz). This file
   only uses semantic roles, so dark mode is a token remap.
   ============================================================ */

:root {
  --page-max: 1120px;
  --gutter: 44px;
  --measure: 68ch;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
}
main {
  flex: 1;
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
img, svg, video { max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; border-radius: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -100px; z-index: 100;
  padding: 10px 14px; border: 0; border-radius: var(--radius-md);
  background: var(--navy-800); color: var(--paper); font-size: 14px; font-weight: 600;
}
.skip-link:focus { top: 12px; color: var(--paper); }

/* ---------- Header ---------- */
.site-header {
  width: 100%; max-width: var(--page-max); margin: 0 auto;
  padding: 18px var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px; flex: none; white-space: nowrap;
  border: 0; color: var(--fg); font-size: 14px; font-weight: 600;
}
.brand:hover { color: var(--fg); }
.brand img { width: 28px; height: 28px; }
.brand-sub {
  font-family: var(--font-display); font-style: italic; font-weight: 400;
  font-size: 15px; color: var(--fg-subtle);
}
.site-nav { display: flex; align-items: center; gap: 26px; }
.site-nav a {
  border: 0; padding: 4px 0;
  font-size: 14px; font-weight: 500; color: var(--fg-muted);
}
.site-nav a:hover { color: var(--fg); }
.site-nav a[aria-current="page"] { color: var(--fg); box-shadow: inset 0 -2px 0 var(--accent-line); }
.site-nav .nav-rss {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0;
  border: 1px solid var(--border); border-radius: var(--radius-md);
}
.site-nav .nav-rss:hover { border-color: var(--accent-line); color: var(--accent-text); }

/* ---------- Masthead ---------- */
.masthead {
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; align-items: end;
  padding: 44px 0 30px;
  border-bottom: 3px solid var(--rule-strong);
}
.masthead-title {
  margin: 0; overflow-wrap: anywhere;
  font-family: var(--font-display); font-weight: 500;
  font-size: 92px; line-height: 0.95; letter-spacing: -0.035em;
  color: var(--fg);
}
.masthead-title em { font-style: italic; font-weight: 400; color: var(--accent-display); }
.masthead-small .masthead-title { font-size: 64px; line-height: 1; }
.masthead-intro p {
  margin: 0 0 10px; max-width: 52ch;
  font-size: 15.5px; line-height: 1.6; color: var(--fg-muted);
}
.masthead-intro p:last-child { margin-bottom: 0; }
.masthead-intro a { color: var(--fg); border-bottom-color: var(--accent-line); }
.masthead-intro a:hover { color: var(--accent-text); }
.masthead-intro .masthead-meta {
  display: flex; flex-wrap: wrap; gap: 6px 16px;
  font-family: var(--font-mono); font-size: 12px; color: var(--fg-subtle);
}

/* ---------- Topic chips ---------- */
.topics-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.topics-label {
  margin-right: 8px;
  font-size: 11px; font-weight: 600; letter-spacing: var(--tracking-caps); text-transform: uppercase;
  color: var(--fg-subtle);
}
.chip {
  display: inline-block; padding: 3px 10px;
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  background: var(--bg); color: var(--fg-muted);
  font-family: var(--font-sans); font-size: 12px; font-weight: 500; line-height: 1.5;
  letter-spacing: 0; text-transform: none; white-space: nowrap;
}
a.chip:hover { border-color: var(--accent-line); color: var(--fg); }
.chip.gold { border-color: var(--chip-gold-border); background: var(--chip-gold-bg); color: var(--accent-text); }

/* ---------- Year groups and rows ---------- */
.year {
  display: flex; align-items: baseline; gap: 16px;
  margin: 34px 0 0;
  font-family: var(--font-display); font-size: 44px; font-weight: 600;
  line-height: 1; letter-spacing: -0.02em;
}
.year span { color: var(--fg-subtle); }
@supports (-webkit-text-stroke: 1px black) {
  .year span { color: transparent; -webkit-text-stroke: 1px var(--year-stroke); }
}
.year::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.row {
  display: grid; grid-template-columns: 110px minmax(0, 1fr) 190px; gap: 28px; align-items: baseline;
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
  color: inherit;
}
.row:hover { color: inherit; border-bottom-color: var(--border); }
.row:hover .row-title { color: var(--accent-text); }
.row-date { font-family: var(--font-mono); font-size: 12px; color: var(--fg-subtle); }
.row-main { min-width: 0; overflow-wrap: break-word; }
.row-title {
  margin: 0 0 6px; overflow-wrap: anywhere;
  font-family: var(--font-display); font-weight: 500;
  font-size: 25px; line-height: 1.2; letter-spacing: -0.02em;
  color: var(--fg); text-wrap: balance;
  transition: color var(--duration-1) var(--ease-standard);
}
.row-desc { margin: 0; max-width: 62ch; font-size: 14.5px; line-height: 1.55; color: var(--fg-muted); }
.row-meta {
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
  font-family: var(--font-mono); font-size: 11.5px; color: var(--fg-subtle);
}
.row.lead .row-title { font-size: 34px; line-height: 1.12; }
.row.lead .row-desc { font-size: 15.5px; }

.topic-list { padding: 8px 0 0; }
.topic-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  color: inherit;
}
.topic-row:hover { color: inherit; border-bottom-color: var(--border); }
.topic-name {
  min-width: 0; overflow-wrap: anywhere;
  font-family: var(--font-display); font-weight: 500;
  font-size: 28px; letter-spacing: -0.02em; color: var(--fg);
  transition: color var(--duration-1) var(--ease-standard);
}
.topic-row:hover .topic-name { color: var(--accent-text); }
.topic-count { font-family: var(--font-mono); font-size: 12px; color: var(--fg-subtle); }

/* ---------- Post ---------- */
.post { max-width: 760px; margin: 0 auto; padding: 40px 0 8px; }
.post-header { margin-bottom: 36px; }
.post-eyebrow {
  margin: 0 0 16px; max-width: none;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: var(--tracking-wide); text-transform: uppercase;
  color: var(--accent-text);
}
.post-title {
  margin: 0 0 18px; overflow-wrap: anywhere;
  font-family: var(--font-display); font-weight: 500;
  font-size: 56px; line-height: 1.04; letter-spacing: -0.03em;
  color: var(--fg); text-wrap: balance;
}
.post-dek {
  margin: 0 0 24px; max-width: none;
  font-family: var(--font-display); font-style: italic; font-size: 22px; line-height: 1.45;
  color: var(--fg-muted); text-wrap: pretty;
}
.post-byline {
  display: flex; flex-wrap: wrap; gap: 4px 18px;
  margin: 0; max-width: none; padding: 12px 0;
  border-top: 1px solid var(--rule-strong); border-bottom: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: var(--tracking-wide); text-transform: uppercase;
  color: var(--fg-subtle);
}

.post-body { font-size: 18px; line-height: 1.7; color: var(--fg-muted); overflow-wrap: break-word; }
.post-body > * { max-width: var(--measure); }
.post-body > figure, .post-body > .table-wrap, .post-body > .footnotes { max-width: none; }
.post-body p { margin: 0 0 1.15em; max-width: var(--measure); }
.post-body > p:first-of-type::first-letter {
  float: left; padding: 0.07em 0.1em 0 0;
  font-family: var(--font-display); font-weight: 600; font-size: 4.1em; line-height: 0.82;
  color: var(--fg);
}
.post-body h2, .post-body h3, .post-body h4 { color: var(--fg); scroll-margin-top: 16px; }
.post-body h2 {
  margin: 2em 0 0.6em;
  font-family: var(--font-display); font-size: 32px; font-weight: 600; line-height: 1.2; letter-spacing: -0.02em;
}
.post-body h3 {
  margin: 1.6em 0 0.5em;
  font-family: var(--font-display); font-size: 24px; font-weight: 600; line-height: 1.25; letter-spacing: -0.015em;
}
.post-body h4 { margin: 1.6em 0 0.5em; font-size: 14px; letter-spacing: var(--tracking-wide); }
.post-body .anchor {
  margin-left: 0.2em; border: 0; opacity: 0;
  font-family: var(--font-sans); font-weight: 400; color: var(--fg-subtle);
  transition: opacity var(--duration-1) var(--ease-standard);
}
.post-body h2:hover .anchor, .post-body h3:hover .anchor, .post-body .anchor:focus-visible { opacity: 1; }
.post-body .anchor:hover { color: var(--accent-text); }
@media (hover: none) { .post-body .anchor { display: none; } }

.post-body a { color: var(--fg); border-bottom: 1px solid var(--accent-line); }
.post-body a:hover { color: var(--accent-text); }
.post-body strong { color: var(--fg); font-weight: 600; }
.post-body ul, .post-body ol { margin: 0 0 1.15em; padding-left: 1.3em; }
.post-body li { margin: 0.35em 0; }
.post-body li::marker { color: var(--accent-line); }
.post-body ol li::marker { font-family: var(--font-mono); font-size: 0.85em; }
.post-body hr { margin: 2.4em 0; border: 0; border-top: 1px solid var(--border); }

.post-body blockquote {
  margin: 1.6em 0; padding: 4px 0 4px 20px;
  border-left: 3px solid var(--accent-line);
  font-family: var(--font-display); font-size: 21px; line-height: 1.45; color: var(--fg);
}
.post-body blockquote p { margin: 0 0 0.6em; }
.post-body blockquote p:last-child { margin-bottom: 0; }
.post-body blockquote a { font-family: var(--font-sans); font-size: 0.8em; }

.post-body :not(pre) > code { font-size: 0.86em; color: var(--fg); overflow-wrap: anywhere; }

.post-body figure { margin: 1.8em 0; }
.post-body figure img { display: block; border: 1px solid var(--border); border-radius: var(--radius-md); }
.post-body figcaption { margin-top: 8px; font-family: var(--font-mono); font-size: 12.5px; color: var(--fg-subtle); }

.post-body figure.code {
  position: relative; margin: 1.6em 0;
  background: var(--code-bg); border-radius: 10px;
}
.post-body figure.code figcaption {
  position: absolute; top: 8px; right: 12px; margin: 0;
  font-size: 11px; letter-spacing: var(--tracking-wide); text-transform: uppercase;
  color: var(--code-label);
}
.post-body pre {
  margin: 0; padding: 22px 22px 20px; overflow-x: auto;
  font-size: 13.5px; line-height: 1.65; color: var(--code-fg); tab-size: 2;
}
.post-body figure.code figcaption + pre { padding-top: 34px; }
.post-body pre code { padding: 0; border: 0; background: none; font-size: inherit; color: inherit; white-space: pre; }
.hljs-keyword, .hljs-built_in, .hljs-selector-tag, .hljs-literal, .hljs-type, .hljs-doctag { color: var(--gold-400); }
.hljs-string, .hljs-regexp, .hljs-symbol, .hljs-addition, .hljs-template-tag { color: #9FD3B5; }
.hljs-comment, .hljs-quote, .hljs-meta { color: #8FA2BD; font-style: italic; }
.hljs-title, .hljs-section, .hljs-name, .hljs-selector-id, .hljs-selector-class { color: #9CC2F0; }
.hljs-number, .hljs-attr, .hljs-attribute, .hljs-bullet, .hljs-link { color: #F2B880; }
.hljs-variable, .hljs-template-variable, .hljs-params, .hljs-property { color: var(--code-fg); }
.hljs-deletion { color: #F19999; }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 600; }

.table-wrap { margin: 1.6em 0; overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
/* Size to content and scroll inside .table-wrap rather than squeezing words mid-hyphen. */
.post-body table { width: max-content; min-width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.post-body td { max-width: 36ch; }
.post-body th, .post-body td { padding: 10px 14px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.post-body th {
  background: var(--bg-sunken); color: var(--fg);
  font-size: 13px; font-weight: 600; white-space: nowrap;
}
.post-body tr:last-child td { border-bottom: 0; }

.post-body .footnotes { margin-top: 3em; padding-top: 1em; border-top: 1px solid var(--border); font-size: 15px; }
.post-body .footnotes ol { margin: 0; }

/* ---------- End of post ---------- */
.post-end {
  display: grid; gap: 28px;
  margin-top: 56px; padding-top: 28px;
  border-top: 3px solid var(--rule-strong);
}
.post-topics { display: flex; flex-wrap: wrap; gap: 8px; }
.author-card { display: flex; align-items: center; gap: 16px; }
.author-card img {
  width: 64px; height: 64px; flex: none; border-radius: 50%;
  border: 2px solid var(--gold-600); filter: grayscale(1) contrast(1.05);
}
.author-card p { margin: 0; max-width: 52ch; font-size: 15px; line-height: 1.55; color: var(--fg-muted); }
.author-card strong { color: var(--fg); font-weight: 600; }
.author-card a { color: var(--fg); border-bottom-color: var(--accent-line); }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.post-nav a {
  display: flex; flex-direction: column; gap: 4px; min-width: 0;
  padding: 16px 18px;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  color: inherit;
}
.post-nav a:hover { border-color: var(--accent-line); color: inherit; }
.post-nav-next { grid-column: 2; text-align: right; }
.post-nav-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--fg-subtle); }
.post-nav-title { overflow-wrap: anywhere; font-family: var(--font-display); font-size: 18px; font-weight: 500; line-height: 1.3; color: var(--fg); }
.post-subscribe { margin: 0; font-size: 14px; color: var(--fg-subtle); }
.post-subscribe a { color: var(--fg); border-bottom-color: var(--accent-line); }

/* ---------- Footer ---------- */
.site-footer {
  position: relative; overflow: hidden;
  margin-top: 72px;
  background: var(--footer-bg); color: var(--footer-fg);
}
.site-footer::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: url("/images/maze-pattern.png") repeat; opacity: 0.06; mix-blend-mode: overlay;
}
.footer-inner {
  position: relative;
  display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 18px 32px;
  max-width: var(--page-max); margin: 0 auto; padding: 34px var(--gutter) 38px;
  font-size: 13px;
}
.footer-name { margin: 0 0 4px; font-family: var(--font-display); font-size: 18px; font-weight: 600; color: var(--footer-strong); }
.footer-meta { margin: 0; color: var(--footer-fg); }
.footer-meta a { color: var(--footer-fg); border-bottom-color: rgba(201, 210, 222, 0.35); }
.footer-links { display: flex; flex-wrap: wrap; gap: 10px 20px; }
.footer-links a, .footer-meta a:hover { border: 0; color: var(--footer-fg); }
.footer-links a:hover { color: var(--gold-500); }
.footer-copy { grid-column: 1 / -1; margin: 0; font-family: var(--font-mono); font-size: 11.5px; color: #8FA2BD; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  :root { --gutter: 20px; }
  .site-header { padding-top: 14px; padding-bottom: 14px; }
  .site-nav { gap: 16px; }
  .site-nav .nav-ext { display: none; }
  .masthead { grid-template-columns: 1fr; gap: 20px; padding: 28px 0 22px; }
  .masthead-title { font-size: 56px; }
  .masthead-small .masthead-title { font-size: 44px; }
  .year { margin-top: 26px; font-size: 36px; }
  .row { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 18px 0; }
  .row-meta { flex-direction: row; align-items: center; gap: 10px; }
  .row-title { font-size: 22px; }
  .row.lead .row-title { font-size: 27px; }
  .topic-name { font-size: 22px; }
  .post { padding-top: 20px; }
  .post-title { font-size: 36px; line-height: 1.08; }
  .post-dek { font-size: 18px; }
  .post-body { font-size: 17px; }
  .post-body h2 { font-size: 26px; }
  .post-body h3 { font-size: 21px; }
  .post-body blockquote { font-size: 19px; }
  .post-body pre { padding: 18px 16px 16px; font-size: 12.5px; }
  .post-nav { grid-template-columns: minmax(0, 1fr); }
  .post-nav-next { grid-column: auto; text-align: left; }
  .footer-inner { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 430px) {
  .brand-sub { display: none; }
}
@media (max-width: 380px) {
  .masthead-title { font-size: 48px; }
}
@media (max-width: 359px) {
  .brand-name { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
