/* Wordie content pages: blog, glossary, tools. Lean, readable, fast. */
:root {
    --bg: #f5f5ed;
    --fg: #2b2b2b;
    --muted: #666;
    --border: #dcdccb;
    --card: #fff;
    --accent: #a1b9ed;
    --accent-soft: #e3eafa;
    --mark: #fbe7a1;
    --radius: 14px;
    --measure: 720px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--fg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: #000; color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 10; }

/* ===== Header ===== */
.site-header { border-bottom: 1px solid var(--border); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; letter-spacing: -0.03em; font-size: 18px; }
.brand img { width: 28px; height: 28px; }
.site-nav { display: flex; align-items: center; gap: 22px; font-size: 14px; font-weight: 600; }
.site-nav a { text-decoration: none; color: var(--muted); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--fg); }
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--fg); color: #fff !important; text-decoration: none;
    padding: 10px 18px; border-radius: 999px; font-weight: 700; font-size: 14px;
    border: 0; cursor: pointer; font-family: inherit;
}
.btn:hover { background: #000; }
.btn-ghost { background: transparent; color: var(--fg) !important; border: 1.5px solid var(--fg); }
.btn-ghost:hover { background: var(--fg); color: #fff !important; }
@media (max-width: 720px) {
    .site-nav a.hide-sm { display: none; }
    .site-nav { gap: 14px; }
}

/* ===== Breadcrumbs ===== */
.crumbs { font-size: 13px; color: var(--muted); margin: 28px 0 0; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs li:not(:last-child)::after { content: "/"; margin-left: 6px; opacity: .5; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

/* ===== Article ===== */
.article { max-width: var(--measure); margin: 0 auto; padding: 0 0 40px; }
.article-head { padding: 24px 0 8px; }
.kicker {
    display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
    background: var(--fg); color: #fff; padding: 5px 12px; border-radius: 999px; text-decoration: none;
}
.article h1 { font-size: clamp(32px, 5.5vw, 48px); line-height: 1.08; letter-spacing: -0.035em; font-weight: 900; margin: 18px 0 14px; }
.lede { font-size: 20px; color: #444; line-height: 1.5; }

.byline { display: flex; align-items: center; gap: 12px; margin: 22px 0 0; font-size: 14px; color: var(--muted); flex-wrap: wrap; }
.byline .avatar {
    width: 40px; height: 40px; border-radius: 50%; background: var(--fg); color: #fff;
    display: grid; place-items: center; font-weight: 800; font-size: 14px; flex: none;
}
.byline strong a { color: var(--fg); text-decoration: none; }
.byline strong a:hover { text-decoration: underline; }
.byline .sep { opacity: .4; }

.hero-img { margin: 28px 0 8px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }

.answer-box, .takeaways {
    background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--accent);
    border-radius: var(--radius); padding: 20px 22px; margin: 28px 0;
}
.answer-box p { font-size: 18px; line-height: 1.55; }
.box-label { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; display: block; }
.takeaways ul { padding-left: 20px; }
.takeaways li { margin: 6px 0; }

.toc { margin: 28px 0; padding: 18px 22px; border: 1px dashed var(--border); border-radius: var(--radius); font-size: 15px; }
.toc ol { padding-left: 20px; }
.toc li { margin: 4px 0; }
.toc a { text-decoration: none; color: #444; }
.toc a:hover { color: var(--fg); text-decoration: underline; }

.prose { font-size: 18px; line-height: 1.75; color: #2f2f2f; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: 28px; line-height: 1.2; letter-spacing: -0.025em; font-weight: 850; margin-top: 2em; scroll-margin-top: 80px; }
.prose h3 { font-size: 21px; line-height: 1.3; letter-spacing: -0.015em; font-weight: 800; margin-top: 1.6em; scroll-margin-top: 80px; }
.prose a { color: var(--fg); text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.prose a:hover { background: var(--accent-soft); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: .4em; }
.prose strong { font-weight: 750; color: #1d1d1d; }
.prose mark { background: linear-gradient(transparent 55%, var(--mark) 55%); color: inherit; padding: 0 2px; }
.prose blockquote { border-left: 3px solid var(--fg); padding: 4px 0 4px 18px; font-style: italic; color: #444; }
.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; background: #ecece0; padding: 2px 6px; border-radius: 6px; overflow-wrap: anywhere; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }
.prose figure { margin: 1.6em 0; }
.prose figcaption { font-size: 14px; color: var(--muted); margin-top: 8px; text-align: center; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.prose table { border-collapse: collapse; width: 100%; font-size: 15px; line-height: 1.5; }
.prose th, .prose td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { background: #fafaf4; font-weight: 750; white-space: nowrap; }
.prose tr:last-child td { border-bottom: 0; }

.callout { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; font-size: 16.5px; }
.callout.tip { border-left: 4px solid #10b981; }
.callout.warn { border-left: 4px solid #f59e0b; }
.callout.note { border-left: 4px solid var(--accent); }
.callout > strong:first-child { display: block; margin-bottom: 4px; }
.example { background: #fffdf3; border: 1px solid #efe6c2; border-radius: var(--radius); padding: 16px 20px; font-size: 16.5px; }
.steps { counter-reset: step; list-style: none; padding-left: 0 !important; }
.steps > li { counter-increment: step; position: relative; padding-left: 44px; }
.steps > li::before {
    content: counter(step); position: absolute; left: 0; top: 2px; width: 28px; height: 28px; border-radius: 50%;
    background: var(--fg); color: #fff; font-size: 14px; font-weight: 800; display: grid; place-items: center;
}

/* ===== FAQ ===== */
.faq { margin: 48px 0 0; }
.faq h2 { font-size: 28px; letter-spacing: -0.025em; font-weight: 850; margin-bottom: 14px; }
.faq details { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 0; margin: 10px 0; }
.faq summary { cursor: pointer; padding: 16px 18px; font-weight: 700; font-size: 17px; list-style: none; position: relative; padding-right: 44px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 18px; top: 13px; font-size: 22px; font-weight: 400; }
.faq details[open] summary::after { content: "–"; }
.faq details p { padding: 0 18px 16px; font-size: 16.5px; line-height: 1.65; color: #3a3a3a; }

/* ===== Author box ===== */
.author-box { display: flex; gap: 16px; margin: 48px 0 0; padding: 22px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.author-box .avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--fg); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 18px; flex: none; }
.author-box h2 { font-size: 17px; font-weight: 800; }
.author-box p { font-size: 15px; color: #444; margin-top: 4px; }
.author-box a { font-weight: 700; }

/* ===== CTA ===== */
.cta { margin: 48px 0 0; background: var(--fg); color: #fff; border-radius: 22px; padding: 36px 30px; text-align: center; }
.cta h2 { font-size: 28px; font-weight: 900; letter-spacing: -0.03em; }
.cta p { opacity: .8; margin: 8px auto 20px; max-width: 460px; }
.cta .btn { background: #fff; color: var(--fg) !important; }
.cta .btn:hover { background: var(--accent); }

/* ===== Related / cards ===== */
.section-title { font-size: 24px; font-weight: 850; letter-spacing: -0.025em; margin: 56px 0 16px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card {
    display: flex; flex-direction: column; gap: 8px; background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px; text-decoration: none; transition: transform .15s, box-shadow .15s;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.06); }
.card .meta { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.card h3 { font-size: 18px; line-height: 1.3; letter-spacing: -0.015em; font-weight: 800; }
.card p { font-size: 14.5px; color: #555; line-height: 1.5; }
.card .thumb { margin: -20px -20px 6px; border-bottom: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; aspect-ratio: 1200/630; background: #eee; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ===== Hub pages ===== */
.hub-head { padding: 40px 0 8px; max-width: 760px; }
.hub-head h1 { font-size: clamp(36px, 6vw, 56px); font-weight: 900; letter-spacing: -0.04em; line-height: 1.05; margin: 14px 0 12px; }
.hub-head p { font-size: 19px; color: #444; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 6px; }
.chip { font-size: 13px; font-weight: 700; text-decoration: none; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); }
.chip:hover, .chip[aria-current="page"] { background: var(--fg); color: #fff; border-color: var(--fg); }
.az { display: flex; flex-wrap: wrap; gap: 6px; margin: 24px 0; }
.az a { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 8px; text-decoration: none; font-weight: 800; background: var(--card); font-size: 14px; }
.az a:hover { background: var(--fg); color: #fff; }
.az span { width: 34px; height: 34px; display: grid; place-items: center; color: #bbb; font-weight: 800; font-size: 14px; }
.letter-group { margin-top: 36px; }
.letter-group h2 { font-size: 28px; font-weight: 900; border-bottom: 2px solid var(--fg); padding-bottom: 6px; margin-bottom: 14px; scroll-margin-top: 80px; }
.term-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; list-style: none; }
.term-list a { display: block; padding: 14px 16px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; text-decoration: none; height: 100%; }
.term-list a:hover { border-color: var(--fg); }
.term-list strong { display: block; font-size: 16px; }
.term-list span { font-size: 14px; color: #555; line-height: 1.45; display: block; margin-top: 4px; }

/* ===== Tool widget ===== */
.tool-app { background: var(--card); border: 1.5px solid var(--fg); border-radius: 20px; padding: 26px; margin: 28px 0; box-shadow: 6px 6px 0 var(--fg); font-size: 16px; }
.tool-app h2:first-child, .tool-app h3:first-child { margin-top: 0; }
.tool-app label { display: block; font-weight: 700; font-size: 14px; margin: 14px 0 6px; }
.tool-app input[type="text"], .tool-app input[type="number"], .tool-app input[type="date"], .tool-app select, .tool-app textarea {
    width: 100%; font: inherit; font-size: 16px; padding: 11px 13px; border: 1px solid var(--border); border-radius: 10px; background: #fcfcf8; color: var(--fg);
}
.tool-app textarea { min-height: 160px; resize: vertical; line-height: 1.5; }
.tool-app input:focus, .tool-app select:focus, .tool-app textarea:focus { outline: 2px solid var(--accent); border-color: var(--fg); }
.tool-app input[type="range"] { width: 100%; accent-color: var(--fg); }
.tool-app .row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.tool-app .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.tool-app .stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-top: 20px; }
.tool-app .stat { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.tool-app .stat b { display: block; font-size: 26px; font-weight: 900; letter-spacing: -0.03em; line-height: 1.1; }
.tool-app .stat span { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.tool-app .result { margin-top: 18px; padding: 16px; border-radius: 12px; background: var(--accent-soft); font-size: 16px; }
.tool-app .result:empty { display: none; }
.tool-app table { width: 100%; border-collapse: collapse; font-size: 14.5px; margin-top: 14px; }
.tool-app th, .tool-app td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; }
.tool-app .muted { color: var(--muted); font-size: 14px; }
.tool-app canvas, .tool-app svg { width: 100%; max-width: 100%; }
@media (max-width: 560px) { .tool-app { padding: 18px; box-shadow: 4px 4px 0 var(--fg); } }

/* ===== Footer ===== */
.site-footer { border-top: 1px solid var(--border); margin-top: 80px; padding: 48px 0 32px; font-size: 14px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 28px; }
.foot-grid h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; margin-bottom: 12px; color: var(--muted); }
.foot-grid ul { list-style: none; }
.foot-grid li { margin: 7px 0; }
.foot-grid a { text-decoration: none; color: #444; }
.foot-grid a:hover { color: var(--fg); text-decoration: underline; }
.foot-brand p { color: var(--muted); margin-top: 10px; max-width: 280px; }
.foot-bottom { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; color: var(--muted); }
.foot-bottom a { color: var(--muted); }
@media (max-width: 860px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-brand { grid-column: 1 / -1; } }
