/* WD-908: the Wardesk blog, shared by the index and every post.
   Dark by default; readers whose device asks for light get the cream theme.
   Each post sets its accent with a body class (accent-pink, accent-blue, ...). */

:root {
  color-scheme: dark;
  --bg: #111113; --surface: #161619; --surface-hover: #18181c; --surface2: #222226;
  --soft: #1f1f23; --soft-hover: #26262b; --logo-bg: #232328; --logo-fg: #f5f2ed;
  --text: #f5f2ed; --text2: #e9e6e1; --body: #d9d6d1; --lede: #ece9e4;
  --muted: #a7a7ae; --faint: #8f8f98; --fainter: #8a8a93; --chip: #cfccc7;
  --primary: #f7f3ec; --on-primary: #151517; --primary-hover: #ffffff; --hi: #ffffff;
  --hover: rgba(255,255,255,0.05);
  --line-soft: rgba(255,255,255,0.07); --line: rgba(255,255,255,0.08);
  --line-strong: rgba(255,255,255,0.14); --line-hover: rgba(255,255,255,0.22);
  --nav-bg: rgba(17,17,19,0.78);
  --cover-shadow: 0 40px 90px -40px rgba(0,0,0,0.7);
  --card-shadow: none;
  --fig-node: #1c1b1d; --fig-line: rgba(255,255,255,0.22); --fig-head: rgba(255,255,255,0.4); --fig-stroke: rgba(255,255,255,0.12);
  --grad: linear-gradient(100deg, #e8792b 0%, #d6457a 55%, #8a4fe0 100%);
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --c-gold: #f2c66d; --c-pink: #f08fb8; --c-teal: #6fd3c7; --c-blue: #8fb8f2;
  --c-ember: #f59e6b; --c-violet: #c4a2f5; --c-green: #7fd6a0;
  --accent: var(--c-ember);
}
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f8f5f0; --surface: #ffffff; --surface-hover: #ffffff; --surface2: #ece7df;
    --soft: #efeae3; --soft-hover: #e6e0d7; --logo-bg: #ffffff; --logo-fg: #1b1715;
    --text: #1b1715; --text2: #2a2420; --body: #3a332f; --lede: #2a2420;
    --muted: #665d58; --faint: #71675f; --fainter: #71675f; --chip: #4a423d;
    --primary: #1b1715; --on-primary: #f8f5f0; --primary-hover: #000000; --hi: #000000;
    --hover: rgba(27,23,21,0.05);
    --line-soft: rgba(27,23,21,0.07); --line: rgba(27,23,21,0.1);
    --line-strong: rgba(27,23,21,0.16); --line-hover: rgba(27,23,21,0.28);
    --nav-bg: rgba(248,245,240,0.82);
    --cover-shadow: 0 34px 80px -40px rgba(90,50,30,0.35);
    --card-shadow: 0 1px 2px rgba(27,23,21,0.04), 0 10px 30px -14px rgba(27,23,21,0.14);
    --fig-node: #ffffff; --fig-line: rgba(27,23,21,0.28); --fig-head: rgba(27,23,21,0.45); --fig-stroke: rgba(27,23,21,0.14);
    --c-gold: #7f5f00; --c-pink: #b2366d; --c-teal: #0b7268; --c-blue: #2a5caa;
    --c-ember: #b04b16; --c-violet: #7043bd; --c-green: #1d7444;
  }
}
.accent-gold { --accent: var(--c-gold); } .accent-pink { --accent: var(--c-pink); }
.accent-teal { --accent: var(--c-teal); } .accent-blue { --accent: var(--c-blue); }
.accent-ember { --accent: var(--c-ember); } .accent-violet { --accent: var(--c-violet); }
.accent-green { --accent: var(--c-green); }
.c-gold { --c: var(--c-gold); } .c-pink { --c: var(--c-pink); } .c-teal { --c: var(--c-teal); }
.c-blue { --c: var(--c-blue); } .c-ember { --c: var(--c-ember); } .c-violet { --c: var(--c-violet); }
.c-green { --c: var(--c-green); }
body { --accent-soft: color-mix(in srgb, var(--accent) 38%, transparent); --accent-faint: color-mix(in srgb, var(--accent) 9%, transparent); }

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; } }
body { margin: 0; background: var(--bg); color: var(--text); font-family: "Inter", system-ui, -apple-system, sans-serif; font-optical-sizing: auto; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
::selection { background: color-mix(in srgb, var(--accent) 32%, transparent); }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { text-wrap: balance; }
p, li { text-wrap: pretty; }
img { max-width: 100%; }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible { outline: 2px solid var(--c-ember); outline-offset: 3px; }
.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 { position: absolute; left: 16px; top: -60px; z-index: 200; padding: 10px 16px; border-radius: 999px; background: var(--primary); color: var(--on-primary); font-weight: 600; font-size: 14px; }
.skip:focus { top: 12px; }
.container { max-width: 1232px; margin: 0 auto; padding: 0 24px; }

/* Bits */
.meta { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); font-variant-numeric: tabular-nums; line-height: 1.5; }
.cat { display: inline-flex; align-items: center; gap: 8px; color: var(--c, var(--accent)); }
.cat::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: currentColor; flex: 0 0 auto; }
.chip { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; border: 1px solid var(--line-strong); font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--chip); white-space: nowrap; }
.avatar { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; border-radius: 999px; background: linear-gradient(135deg, #e8792b, #d6457a 55%, #8a4fe0); }
.avatar svg { width: 58%; height: auto; display: block; fill: #ffffff; }
.by { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--text2); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 17px; border-radius: 999px; font-size: 14.5px; font-weight: 600; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.btn svg { width: 15px; height: 15px; }
.btn-ghost { border: 1px solid var(--line-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--line-hover); }
.btn-cream { background: var(--primary); color: var(--on-primary); }
.btn-cream:hover { background: var(--primary-hover); }
.btn-soft { background: var(--soft); color: var(--text); border: 1px solid var(--line-soft); }
.btn-soft:hover { background: var(--soft-hover); }
.round { width: 40px; height: 40px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: var(--soft); color: var(--text2); border: 1px solid var(--line-soft); cursor: pointer; font: inherit; transition: background .15s, color .15s; }
.round:hover { background: var(--soft-hover); color: var(--hi); }
.round svg { width: 15px; height: 15px; }
.ico { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-head h2 { margin: 0; font-size: 22px; font-weight: 650; letter-spacing: -0.02em; }

/* Nav */
.site-nav { position: sticky; top: 0; z-index: 50; background: var(--nav-bg); -webkit-backdrop-filter: saturate(1.4) blur(16px); backdrop-filter: saturate(1.4) blur(16px); border-bottom: 1px solid var(--line-soft); }
.site-nav .container { display: flex; align-items: center; gap: 28px; height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.logo-tile { width: 30px; height: 30px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; color: var(--logo-fg); background: var(--logo-bg); border: 1px solid var(--line-strong); box-shadow: inset 0 1px 0 var(--line-soft); }
.logo-tile svg { width: 17px; height: 9px; fill: currentColor; }
.nav-links { display: flex; gap: 4px; flex: 1 1 auto; }
.navlink { font-size: 15px; font-weight: 500; color: var(--body); padding: 8px 14px; border-radius: 999px; transition: color .15s, background .15s; }
.navlink:hover { color: var(--hi); background: var(--hover); }
.navlink.on { color: var(--hi); padding: 7px 13px; border: 1px solid transparent; background: linear-gradient(var(--bg), var(--bg)) padding-box, var(--grad) border-box; }
.nav-cta { display: flex; gap: 10px; align-items: center; }
.progress { position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: var(--grad); }
@media (max-width: 760px) {
  .site-nav .container { height: 60px; gap: 12px; padding: 0 16px; }
  .brand { font-size: 18px; }
  .nav-links .navlink:not(.on) { display: none; }
  .nav-links { justify-content: flex-end; }
  .nav-cta .btn-ghost { display: none; }
  .nav-cta .btn { height: 38px; padding: 0 14px; font-size: 14px; }
}
@media (max-width: 380px) { .nav-links { display: none; } .site-nav .container { justify-content: space-between; } }

/* Tiles (index grid and "More from the blog") */
.tile { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 10px; box-shadow: var(--card-shadow); transition: transform .25s ease, border-color .25s ease; }
.tile:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.media { display: block; overflow: hidden; aspect-ratio: 16 / 9; border-radius: 12px; background: var(--surface2); }
.media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.tile:hover .media img, .featured:hover .media img { transform: scale(1.035); }
.tile-body { display: flex; flex-direction: column; gap: 10px; padding: 18px 10px 8px; flex: 1 1 auto; }
.tile h3, .tile h4 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.3; }
.tile p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tile-foot { margin-top: auto; padding-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
@media (max-width: 1020px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .tiles { grid-template-columns: minmax(0, 1fr); gap: 16px; } .tile { padding: 8px; border-radius: 18px; } .tile-body { padding: 14px 8px 6px; } }

/* Index */
.blog-hero { padding: 76px 0 30px; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.blog-hero h1 { margin: 0 0 18px; font-size: clamp(44px, 6vw, 72px); font-weight: 700; letter-spacing: -0.04em; line-height: 0.95; display: flex; align-items: flex-end; gap: 12px; }
.title-mark { width: 26px; height: 13px; margin-bottom: 9px; }
.blog-hero p { margin: 0; max-width: 560px; font-size: 16.5px; line-height: 1.6; color: var(--muted); }
.hero-actions { display: flex; gap: 8px; align-items: center; }
.tabs { display: flex; gap: 8px; padding: 20px 0 4px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: var(--muted); font: inherit; font-size: 14px; font-weight: 500; white-space: nowrap; cursor: pointer; transition: color .15s, border-color .15s, background .15s; }
.tab:hover { color: var(--text); border-color: var(--line-hover); }
.tab .n { font-family: var(--mono); font-size: 10.5px; color: var(--faint); }
.tab[aria-pressed="true"] { color: var(--text); border-color: transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad) border-box; box-shadow: var(--card-shadow); }
.featured { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 8px; margin-top: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 26px; padding: 12px; box-shadow: var(--card-shadow); transition: border-color .25s; }
.featured:hover { border-color: var(--line-strong); }
.featured .media { border-radius: 16px; }
.featured-body { padding: 30px 30px 26px; display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.featured-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.featured h2 { margin: 0; font-size: clamp(28px, 3vw, 38px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.08; }
.featured p { margin: 0; font-size: 15.5px; line-height: 1.6; color: var(--muted); }
.featured-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; padding-top: 20px; border-top: 1px solid var(--line); }
.author-line { display: flex; align-items: center; gap: 12px; }
.author-line .name { display: block; font-size: 14.5px; font-weight: 600; margin-bottom: 3px; }
.go { width: 44px; height: 44px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: var(--primary); color: var(--on-primary); flex: 0 0 auto; transition: transform .2s; }
.go svg { width: 17px; height: 17px; }
.featured:hover .go { transform: translateX(3px); }
.latest { padding-top: 52px; }
.latest .count { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.tile[hidden] { display: none; }
@media (max-width: 900px) { .featured { grid-template-columns: minmax(0, 1fr); } .featured-body { padding: 20px 12px 10px; } }
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .blog-hero { padding: 40px 0 22px; }
  .blog-hero h1 { font-size: 46px; gap: 10px; }
  .title-mark { width: 21px; height: 11px; margin-bottom: 7px; }
  .blog-hero p { font-size: 15.5px; }
  .hero-actions .btn { display: none; }
  .tabs { margin-right: -16px; padding-right: 16px; }
  .featured { border-radius: 22px; padding: 8px; }
  .featured h2 { font-size: 26px; }
  .latest { padding-top: 40px; }
}

/* Post header */
.post-head { max-width: 728px; margin: 0 auto; padding: 56px 24px 0; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); margin-bottom: 22px; }
.crumbs a:hover { color: var(--text); }
.crumbs svg { width: 13px; height: 13px; opacity: .6; }
.post-head h1 { margin: 0 0 18px; font-size: clamp(36px, 5vw, 56px); font-weight: 700; letter-spacing: -0.035em; line-height: 1.04; }
.dek { margin: 0; font-size: 19px; line-height: 1.6; color: var(--muted); }
.byline-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 28px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.byline { display: flex; align-items: center; gap: 12px; min-width: 0; }
.byline .name { display: block; font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.share { display: flex; gap: 8px; flex: 0 0 auto; }
.uplink { margin: 18px 0 0; display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.uplink svg { width: 16px; height: 16px; color: var(--accent); flex: 0 0 auto; }
.uplink a { color: var(--text); border-bottom: 1px solid var(--accent-soft); transition: border-color .15s; }
.uplink a:hover { border-color: var(--accent); }
.post-cover { max-width: 1008px; margin: 48px auto 0; padding: 0 24px; }
.article-cover { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 20px; border: 1px solid var(--line); box-shadow: var(--cover-shadow); }
@media (max-width: 640px) {
  .post-head { padding: 32px 16px 0; }
  .crumbs { margin-bottom: 16px; }
  .post-head h1 { font-size: 34px; letter-spacing: -0.03em; }
  .dek { font-size: 17px; }
  .byline-row { flex-direction: column; align-items: flex-start; gap: 14px; }
  .post-cover { margin-top: 28px; padding: 0 16px; }
  .article-cover { border-radius: 16px; }
}

/* Post body: sticky contents on wide screens, a box above the text otherwise */
.post-body { max-width: 728px; margin: 0 auto; padding: 56px 24px 0; }
.toc { margin: 0 0 40px; padding: 20px 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--card-shadow); }
.toc-label { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); margin-bottom: 12px; }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc li { counter-increment: toc; display: flex; gap: 12px; padding: 5px 0; font-size: 14px; line-height: 1.4; }
.toc li::before { content: counter(toc, decimal-leading-zero); font-family: var(--mono); font-size: 11px; color: var(--fainter); padding-top: 2px; flex: 0 0 18px; }
.toc a { color: var(--muted); transition: color .15s; }
.toc a:hover { color: var(--text); }
.toc li.on::before { color: var(--accent); }
.toc li.on a { color: var(--text); font-weight: 500; }
@media (min-width: 1180px) {
  .post-body { max-width: none; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 680px) minmax(0, 1fr); gap: 0 48px; padding-left: 32px; padding-right: 32px; }
  .toc { grid-column: 1; justify-self: end; width: 100%; max-width: 232px; align-self: start; position: sticky; top: 104px; margin: 0; padding: 2px 6px 2px 2px; border: 0; border-radius: 0; background: none; box-shadow: none; max-height: calc(100vh - 140px); overflow-x: hidden; overflow-y: auto; scrollbar-width: none; }
  .post-body > .rule { display: none; }
  .prose { grid-column: 2; }
}
@media (max-width: 640px) { .post-body { padding: 36px 16px 0; } .toc { margin-bottom: 32px; } }

/* Prose */
.rule { display: none; }
.prose { font-size: 17.5px; line-height: 1.75; color: var(--body); }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 24px; }
.prose > p:first-of-type { font-size: 19px; color: var(--lede); }
.prose h2 { margin: 56px 0 16px; font-size: 27px; font-weight: 650; letter-spacing: -0.022em; line-height: 1.22; color: var(--text); }
.prose h3 { margin: 36px 0 12px; font-size: 20px; font-weight: 650; letter-spacing: -0.015em; line-height: 1.3; color: var(--text); }
.prose strong { color: var(--text); font-weight: 600; }
.prose em { color: var(--lede); }
.prose p a, .prose li a, .prose td a, .prose .a a, .tool-body a, .note a, .definition a { color: var(--text); border-bottom: 1px solid var(--accent-soft); transition: border-color .15s; }
.prose p a:hover, .prose li a:hover, .prose td a:hover, .prose .a a:hover, .tool-body a:hover, .note a:hover, .definition a:hover { border-color: var(--accent); }
.prose ul, .prose ol { margin: 0 0 24px; padding-left: 22px; }
.prose li { margin: 0 0 12px; padding-left: 4px; }
.prose li::marker { color: var(--accent); }
.prose ol > li::marker { font-family: var(--mono); font-size: 0.85em; }
.pullquote { margin: 48px 0; padding: 0; border: 0; font-size: 27px; line-height: 1.32; font-weight: 650; letter-spacing: -0.022em; color: var(--text); }
.pullquote::before { content: "\201C"; display: block; height: 44px; margin-bottom: 10px; font: 700 80px/1 Georgia, "Times New Roman", serif; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pullquote .who { display: block; margin-top: 14px; font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
.note, .definition { margin: 32px 0; padding: 22px 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--card-shadow); font-size: 16px; line-height: 1.7; }
.definition { border-color: var(--accent-soft); background: linear-gradient(160deg, var(--accent-faint), transparent 70%), var(--surface); }
.definition p { margin: 0 !important; font-size: 17px; color: var(--lede); }
.note-label, .d-label, .tool-label, .sources-label { display: block; font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.note p:last-child { margin-bottom: 0; }
.sec-break { margin: 48px 0; text-align: center; color: var(--accent); font-size: 14px; letter-spacing: 1.2em; padding-left: 1.2em; user-select: none; }

/* Numbered steps: consecutive ones join into one card */
.step, .week, .principle, .phase, .minute, .layer, .fmt { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 4px 16px; margin: 28px 0; padding: 22px 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--card-shadow); }
:is(.step, .week, .principle, .phase, .minute, .layer, .fmt) + :is(.step, .week, .principle, .phase, .minute, .layer, .fmt) { margin-top: -29px; border-top-left-radius: 0; border-top-right-radius: 0; border-top-color: var(--line-soft); }
:is(.step, .week, .principle, .phase, .minute, .layer, .fmt):has(+ :is(.step, .week, .principle, .phase, .minute, .layer, .fmt)) { border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom-color: transparent; }
:is(.step, .week, .principle, .phase, .minute, .layer, .fmt) .num { font-family: var(--mono); font-size: 11.5px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); padding-top: 5px; white-space: nowrap; }
:is(.step, .week, .principle, .phase, .minute, .layer, .fmt) h3 { margin: 0 0 6px !important; font-size: 18px; }
:is(.step, .week, .principle, .phase, .minute, .layer, .fmt) p { margin: 0 0 10px; font-size: 16px; line-height: 1.65; }
:is(.step, .week, .principle, .phase, .minute, .layer, .fmt) > div > :last-child { margin-bottom: 0; }
@media (max-width: 640px) {
  .step, .week, .principle, .phase, .minute, .layer, .fmt { grid-template-columns: minmax(0, 1fr); padding: 18px; }
}

/* Tables */
.table-wrap { overflow-x: auto; margin: 32px 0; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--card-shadow); }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 560px; }
.table-wrap thead th, .table-wrap thead td { text-align: left; padding: 14px 16px; font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); border-bottom: 1px solid var(--line); background: none; }
.table-wrap td, .table-wrap tbody th { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); color: var(--body); line-height: 1.6; vertical-align: top; text-align: left; }
.table-wrap tbody th[scope="row"], .table-wrap td:first-child { color: var(--text); font-weight: 600; }
.table-wrap tr:last-child td, .table-wrap tr:last-child th { border-bottom: 0; }
.table-wrap td strong { color: var(--text); }
@media (max-width: 600px) {
  .table-wrap.stack { border: 0; background: none; box-shadow: none; overflow: visible; }
  .table-wrap.stack table { min-width: 0; }
  .table-wrap.stack thead { display: none; }
  .table-wrap.stack tr { display: block; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); padding: 6px 0; box-shadow: var(--card-shadow); }
  .table-wrap.stack td, .table-wrap.stack tbody th { display: block; border: 0; padding: 6px 16px; }
  .table-wrap.stack td[data-label]::before { content: attr(data-label); display: block; font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); margin-bottom: 2px; }
  .table-wrap.stack tbody th, .table-wrap.stack td:first-child { font-size: 16px; padding-top: 10px; }
}

/* Figures */
.figure { margin: 40px 0; padding: 24px 20px 18px; border: 1px solid var(--line); border-radius: 20px; background: radial-gradient(28rem 16rem at 50% 45%, var(--accent-faint), transparent 70%), var(--surface); box-shadow: var(--card-shadow); }
.figure svg { display: block; width: 100%; height: auto; max-width: 520px; margin: 0 auto; }
.figure figcaption { margin-top: 14px; font-size: 14px; line-height: 1.6; color: var(--muted); text-align: center; }
.fig-arc { fill: none; stroke: var(--fig-line); stroke-width: 1.6; }
.fig-arrowhead { fill: var(--fig-head); }
.fig-node { fill: var(--fig-node); stroke: var(--fig-stroke); stroke-width: 1; }
.fig-t1 { fill: var(--text); font: 700 17px "Inter", sans-serif; letter-spacing: -0.01em; }
.fig-t2 { fill: var(--muted); font: 400 13px "Inter", sans-serif; }
.fig-cut { fill: var(--surface); stroke: var(--accent); stroke-width: 2.4; }
.fig-lead { stroke: var(--accent-soft); stroke-width: 1.2; stroke-dasharray: 2 3; }
.fig-l1 { fill: var(--accent); font: 800 11.5px "Inter", sans-serif; letter-spacing: 0.08em; }
.fig-l2 { fill: var(--text); font: 600 16px "Inter", sans-serif; }
.fig-center { fill: var(--muted); font: 700 11px "Inter", sans-serif; letter-spacing: 0.24em; }
@media (max-width: 600px) {
  .figure { padding: 16px 8px 14px; }
  .figure svg { max-width: none; }
  .fig-t1 { font-size: 19px; } .fig-t2 { font-size: 15px; } .fig-l1 { font-size: 14px; } .fig-l2 { font-size: 17px; } .fig-center { font-size: 12px; letter-spacing: 0.16em; }
}

/* Keep-this card */
.tool-card { margin: 36px 0; padding: 22px 24px 24px; border: 1px solid var(--accent-soft); border-radius: 20px; background: linear-gradient(160deg, var(--accent-faint), transparent 70%), var(--surface); box-shadow: var(--card-shadow); }
.tool-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.tool-head .tool-label { margin: 0; }
.tool-copy { height: 32px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--soft); color: var(--text); font: 600 13px "Inter", sans-serif; cursor: pointer; transition: background .15s, border-color .15s; }
.tool-copy:hover { background: var(--soft-hover); border-color: var(--line-hover); }
.tool-body { font-size: 16px; line-height: 1.7; color: var(--body); }
.tool-body .tool-title { margin: 0 0 10px !important; font-size: 19px; font-weight: 650; letter-spacing: -0.015em; color: var(--text); }
.tool-body ol, .tool-body ul { list-style: none; margin: 0 0 12px !important; padding: 0; }
.tool-body li { margin: 0 0 8px !important; padding: 0; }
.tool-body p { margin: 0 0 10px; }
.tool-body .tool-foot { margin: 0 !important; font-size: 14.5px; color: var(--muted); }

/* FAQ, sources */
.faq { margin: 16px 0 0; display: flex; flex-direction: column; gap: 10px; }
.faq details { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--card-shadow); overflow: hidden; }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 20px; font-size: 16.5px; font-weight: 600; color: var(--text); line-height: 1.4; border-radius: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; width: 9px; height: 9px; flex: 0 0 auto; margin-right: 4px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-3px) rotate(45deg); transition: transform .2s; }
.faq details[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.faq .a { padding: 0 20px 20px; font-size: 16px; line-height: 1.7; color: var(--body); }
.sources { margin: 48px 0 0; padding-top: 24px; border-top: 1px solid var(--line); font-size: 13.5px; line-height: 1.65; color: var(--muted); }
.sources .sources-label { color: var(--faint); margin-bottom: 12px; }
.sources ol { margin: 0 !important; padding-left: 20px; }
.sources li { margin: 0 0 8px !important; }
.sources li::marker { color: var(--fainter) !important; font-family: var(--mono); font-size: 11px; }
.sources em { color: var(--muted) !important; }
.sources a { color: var(--muted); border-bottom: 1px solid var(--line-strong); word-break: break-word; }
.sources a:hover { color: var(--text); }

/* About the author, share, the closing card */
.post-end { margin: 48px 0 0; padding: 22px 0 0; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.author { display: flex; gap: 14px; align-items: flex-start; max-width: 460px; }
.author p { margin: 0 !important; font-size: 14.5px !important; line-height: 1.6; color: var(--muted); }
.author strong { color: var(--text); }
.share-block { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.share-block .label { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
@media (max-width: 640px) { .share-block { align-items: flex-start; } }
.cta { position: relative; overflow: hidden; margin: 40px 0 0; padding: 24px; display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 4px 18px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--card-shadow); }
.cta::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(60% 120% at 0% 0%, rgba(232,121,43,0.10), transparent 60%), radial-gradient(50% 120% at 100% 100%, rgba(138,79,224,0.10), transparent 60%); }
.cta > * { position: relative; }
.cta-mark { grid-row: span 4; width: 56px; height: 56px; border-radius: 16px; display: flex; align-items: center; justify-content: center; background: var(--grad); box-shadow: 0 10px 26px -10px rgba(214,69,122,0.6); }
.cta-mark svg { width: 30px; height: auto; fill: #ffffff; }
.cta-kick { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
.cta h2 { margin: 2px 0 4px; font-size: 21px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.25; color: var(--text); }
.cta p { margin: 0 0 14px; font-size: 15px; line-height: 1.6; color: var(--muted); }
.cta-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.cta small { font-size: 12.5px; color: var(--faint); }
@media (max-width: 520px) { .cta { grid-template-columns: minmax(0, 1fr); } .cta-mark { grid-row: auto; width: 48px; height: 48px; border-radius: 14px; margin-bottom: 10px; } }

/* The monthly letter */
.letter { position: relative; overflow: hidden; text-align: center; border-radius: 28px; padding: 60px 24px 48px; color: #1b1715;
  background: radial-gradient(55% 75% at 50% -5%, #fffaf3 0%, rgba(255,250,243,0) 70%), radial-gradient(60% 95% at -5% 105%, #f6a160 0%, rgba(246,161,96,0) 70%), radial-gradient(60% 95% at 105% 105%, #b493f3 0%, rgba(180,147,243,0) 70%), radial-gradient(45% 70% at 50% 120%, #f08cb6 0%, rgba(240,140,182,0) 75%), #fbf3ea;
  box-shadow: 0 40px 100px -40px rgba(214,69,122,0.55), inset 0 1px 0 rgba(255,255,255,0.8);
  --l-kick: #4a403b; --l-title: #1b1715; --l-body: #3d3430; --l-fine: #554a45; }
.letter .rays { position: absolute; inset: 0; pointer-events: none; opacity: 0.9; background: repeating-conic-gradient(from 180deg at 50% -40%, rgba(255,255,255,0) 0deg 4.2deg, rgba(255,255,255,0.7) 4.2deg 4.6deg, rgba(255,255,255,0) 4.6deg 9deg); -webkit-mask-image: radial-gradient(70% 95% at 50% 0%, #000 0%, rgba(0,0,0,0) 80%); mask-image: radial-gradient(70% 95% at 50% 0%, #000 0%, rgba(0,0,0,0) 80%); }
.letter-in { position: relative; max-width: 520px; margin: 0 auto; }
.emblem { width: 48px; height: 48px; border-radius: 999px; margin: 0 auto 18px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.72); box-shadow: 0 1px 2px rgba(27,23,21,0.08), 0 8px 24px -8px rgba(214,69,122,0.45), inset 0 1px 0 #ffffff; }
.emblem svg { width: 22px; height: auto; }
.letter .kick { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--l-kick); }
.letter h2 { margin: 12px 0 12px; font-size: clamp(30px, 4vw, 44px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.08; color: var(--l-title); }
.letter p { margin: 0 auto; max-width: 440px; font-size: 16px; line-height: 1.55; color: var(--l-body); }
.capsule { display: flex; align-items: center; gap: 6px; max-width: 440px; margin: 26px auto 14px; padding: 5px; border-radius: 999px; background: rgba(255,255,255,0.8); border: 1px solid rgba(27,23,21,0.08); box-shadow: 0 1px 2px rgba(27,23,21,0.06), inset 0 1px 0 #ffffff; transition: box-shadow .15s; }
.capsule:focus-within { box-shadow: 0 0 0 3px rgba(232,121,43,0.35), inset 0 1px 0 #ffffff; }
.capsule input { flex: 1 1 auto; min-width: 0; height: 44px; border: 0; background: transparent; padding: 0 8px 0 16px; font: inherit; font-size: 15px; color: #1b1715; outline: none; }
.capsule input::placeholder { color: #6f6560; }
.capsule button { height: 44px; padding: 0 20px; border-radius: 999px; border: 0; background: #1b1715; color: #fbf4ec; font: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer; transition: background .15s; }
.capsule button:hover { background: #000000; }
.letter .fine { font-size: 12.5px; color: var(--l-fine); }
.letter .nl-msg:empty { display: none; }
.letter .nl-msg { margin: 0 auto 10px; font-size: 14px; font-weight: 500; color: var(--l-title); }
@media (prefers-color-scheme: light) {
  .letter { color: #fbf6ef; --l-kick: #d8cfc9; --l-title: #fbf6ef; --l-body: #e3dbd5; --l-fine: #bfb5ae;
    background: radial-gradient(60% 80% at 50% -10%, rgba(255,236,214,0.16) 0%, rgba(255,236,214,0) 70%), radial-gradient(65% 100% at -5% 110%, rgba(242,140,60,0.8) 0%, rgba(242,140,60,0) 66%), radial-gradient(65% 100% at 105% 110%, rgba(138,79,224,0.75) 0%, rgba(138,79,224,0) 68%), radial-gradient(50% 75% at 50% 125%, rgba(214,69,122,0.85) 0%, rgba(214,69,122,0) 72%), #17141a;
    box-shadow: 0 34px 90px -36px rgba(138,79,224,0.45), 0 20px 60px -30px rgba(232,121,43,0.35), inset 0 1px 0 rgba(255,255,255,0.08); }
  .letter .rays { opacity: 0.14; }
  .emblem { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12); box-shadow: inset 0 1px 0 rgba(255,255,255,0.14), 0 8px 24px -8px rgba(214,69,122,0.6); }
  .capsule { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.16); box-shadow: inset 0 1px 0 rgba(255,255,255,0.08); }
  .capsule:focus-within { box-shadow: 0 0 0 3px rgba(246,161,96,0.45); }
  .capsule input { color: #fbf6ef; }
  .capsule input::placeholder { color: #b3aaa4; }
  .capsule button { background: #fbf6ef; color: #1b1715; }
  .capsule button:hover { background: #ffffff; }
}
.letter-wrap { margin: 96px auto 0; }
.post-letter { max-width: 728px; margin: 72px auto 0; padding: 0 24px; }
@media (max-width: 640px) {
  .letter { border-radius: 24px; padding: 40px 20px 32px; }
  .letter p { font-size: 15px; }
  .capsule { flex-direction: column; align-items: stretch; background: none !important; border: 0; box-shadow: none !important; padding: 0; gap: 8px; }
  .capsule input { height: 48px; border-radius: 999px; padding: 0 18px; background: rgba(255,255,255,0.8); border: 1px solid rgba(27,23,21,0.1); }
  .capsule button { height: 48px; }
  .letter-wrap { margin-top: 64px; }
  .post-letter { margin-top: 56px; padding: 0 16px; }
}
@media (max-width: 640px) and (prefers-color-scheme: light) {
  .capsule input { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.18); }
}

/* Guides and "More from the blog" */
.more { max-width: 1232px; margin: 96px auto 0; padding: 0 24px; }
.more + .more { margin-top: 64px; }
.guides { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; list-style: none; margin: 0; padding: 0; }
.guide { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--card-shadow); transition: transform .25s ease, border-color .25s ease; }
.guide:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.guide-ico { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c); }
.guide-ico svg { width: 18px; height: 18px; }
.guide .k { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
.guide strong { font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
@media (max-width: 1020px) { .guides { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .more { margin-top: 64px; padding: 0 16px; }
  .guides { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .guide { padding: 14px; }
}

/* Footer */
.site-footer { margin-top: 112px; border-top: 1px solid var(--line-soft); }
.foot-grid { display: flex; flex-wrap: wrap; gap: 40px; padding: 56px 0 36px; }
.foot-brand { flex: 1 1 300px; }
.foot-brand p { margin: 16px 0 0; font-size: 14px; line-height: 1.6; color: var(--muted); }
.foot-col { flex: 0 1 180px; display: flex; flex-direction: column; gap: 12px; }
.foot-col h2 { margin: 0 0 2px; font-size: 14px; font-weight: 600; color: var(--text); }
.foot-col a, .foot-legal a { font-size: 14px; color: var(--muted); transition: color .15s; }
.foot-col a:hover, .foot-legal a:hover { color: var(--text); }
.foot-legal { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 22px 0 36px; border-top: 1px solid var(--line); font-size: 13px; color: var(--faint); }
.foot-legal nav { display: flex; gap: 18px; flex-wrap: wrap; }
.foot-legal nav a { font-size: 13px; }
@media (max-width: 640px) {
  .site-footer { margin-top: 80px; }
  .foot-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 16px; padding: 40px 0 28px; }
  .foot-brand { grid-column: 1 / -1; }
}
.featured[hidden] { display: none; }
.nw { white-space: nowrap; }
@media (max-width: 640px) { .byline .meta { gap: 2px 12px; } .byline .meta > [aria-hidden="true"] { display: none; } }
