/* Dexlinker — editorial stylesheet */
:root {
  --navy: #0f1b2d;
  --navy-2: #16253b;
  --paper: #f7f3ec;
  --paper-2: #efe8dc;
  --ink: #17202e;
  --ink-soft: #4a5466;
  --rule: #d9cfbf;
  --accent: #c2642c;
  --accent-ink: #9a4718;
  --accent-soft: #f3e1d2;
  --code-bg: #ebe3d6;
  --bg: var(--paper);
  --bg-2: var(--paper-2);
  --text: var(--ink);
  --muted: var(--ink-soft);
  --link: var(--accent-ink);
  --head-font: "Fraunces", Georgia, "Times New Roman", serif;
  --body-font: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1626;
    --bg-2: #13213a;
    --text: #e8e2d6;
    --muted: #a6afbf;
    --rule: #26354f;
    --link: #f0a46c;
    --accent: #e8874a;
    --accent-soft: #2a2a33;
    --code-bg: #1a2a45;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body-font);
  font-size: 1.125rem;
  line-height: 1.68;
}
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
img, svg { max-width: 100%; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--accent); color: #fff; padding: 6px 10px; z-index: 10; }

/* Masthead (always navy) */
.masthead { background: var(--navy); color: #efe8dc; border-bottom: 4px solid var(--accent); }
.masthead .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; padding-top: 18px; padding-bottom: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: #f7f3ec; text-decoration: none; }
.brand svg { width: 34px; height: 34px; flex: none; }
.brand-name { font-family: var(--head-font); font-size: 1.6rem; font-weight: 600; letter-spacing: -0.01em; }
.brand-tag { display: block; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: #b9b2a6; margin-top: -4px; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 0.95rem; }
.nav a { color: #e9e1d4; text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--accent); }

/* Breadcrumb */
.crumbs { font-size: 0.88rem; color: var(--muted); margin: 22px 0 0; }
.crumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.crumbs li + li::before { content: "/"; margin-right: 4px; color: var(--rule); }
.crumbs a { color: var(--muted); }

/* Home */
.hero { padding: 48px 0 34px; border-bottom: 1px solid var(--rule); }
.kicker { font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); font-weight: 700; margin: 0 0 10px; }
.hero h1 { font-family: var(--head-font); font-weight: 500; font-size: clamp(2.1rem, 6vw, 3.6rem); line-height: 1.08; letter-spacing: -0.02em; margin: 0 0 18px; max-width: 18ch; }
.hero h1 em { color: var(--accent); font-style: italic; }
.hero p.lede { font-size: 1.22rem; color: var(--muted); max-width: 60ch; margin: 0; }
.principles { display: grid; gap: 0; grid-template-columns: 1fr; margin: 34px 0 0; border-top: 1px solid var(--rule); }
.principles div { padding: 16px 0; border-bottom: 1px solid var(--rule); }
.principles b { font-family: var(--head-font); font-weight: 600; display: block; font-size: 1.1rem; }
.principles span { color: var(--muted); font-size: 1rem; }
@media (min-width: 760px) {
  .principles { grid-template-columns: repeat(3, 1fr); border-top: 0; }
  .principles div { border-bottom: 0; border-left: 1px solid var(--rule); padding: 4px 22px; }
  .principles div:first-child { border-left: 0; padding-left: 0; }
}
.section-title { font-family: var(--head-font); font-size: 1.05rem; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 600; margin: 42px 0 8px; color: var(--muted); }
.index { list-style: none; padding: 0; margin: 0 0 56px; counter-reset: item; }
.index li { display: grid; grid-template-columns: 3.2rem 1fr; gap: 0 14px; padding: 22px 0; border-bottom: 1px solid var(--rule); counter-increment: item; }
.index li::before { content: counter(item, decimal-leading-zero); font-family: var(--head-font); font-size: 2rem; line-height: 1; color: var(--accent); font-weight: 400; }
.index h3 { font-family: var(--head-font); font-weight: 600; font-size: 1.42rem; line-height: 1.22; margin: 0 0 6px; }
.index h3 a { color: var(--text); text-decoration: none; }
.index h3 a:hover { color: var(--link); text-decoration: underline; }
.index p { margin: 0; color: var(--muted); font-size: 1.02rem; }
.index .meta { font-size: 0.85rem; margin-top: 6px; color: var(--muted); }
@media (min-width: 760px) { .index li { grid-template-columns: 5rem 1fr; } .index li::before { font-size: 2.8rem; } }

/* Article */
.article-head { padding: 26px 0 26px; border-bottom: 1px solid var(--rule); max-width: 760px; }
.article-head h1 { font-family: var(--head-font); font-weight: 500; font-size: clamp(2rem, 5.4vw, 3rem); line-height: 1.1; letter-spacing: -0.015em; margin: 0 0 14px; }
.article-head .dek { font-size: 1.2rem; color: var(--muted); margin: 0 0 14px; }
.byline { font-size: 0.9rem; color: var(--muted); }
.layout { display: grid; grid-template-columns: 1fr; gap: 28px; padding: 28px 0 60px; }
@media (min-width: 1000px) { .layout { grid-template-columns: minmax(0, 720px) 280px; gap: 64px; } }
.prose { min-width: 0; }
.prose h2 { font-family: var(--head-font); font-weight: 600; font-size: 1.65rem; line-height: 1.2; margin: 2.2em 0 0.5em; letter-spacing: -0.01em; scroll-margin-top: 16px; }
.prose h3 { font-family: var(--head-font); font-weight: 600; font-size: 1.25rem; margin: 1.6em 0 0.4em; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.1em; }
.prose li { margin-bottom: 0.4em; }
.prose > p:first-child::first-letter { font-family: var(--head-font); float: left; font-size: 3.6em; line-height: 0.82; padding: 6px 8px 0 0; color: var(--accent); }
.prose blockquote, .callout { margin: 1.6em 0; padding: 14px 18px; border-left: 4px solid var(--accent); background: var(--bg-2); }
.callout p:last-child { margin-bottom: 0; }
.callout strong:first-child { font-family: var(--head-font); }
.prose code { background: var(--code-bg); padding: 1px 5px; border-radius: 3px; font-size: 0.92em; }
.table-wrap { overflow-x: auto; margin: 1.4em 0 1.6em; border-top: 2px solid var(--text); }
table { border-collapse: collapse; width: 100%; font-size: 0.98rem; min-width: 520px; }
th, td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--rule); }
th { font-family: var(--head-font); font-weight: 600; }
.aside { font-size: 0.98rem; }
.aside .box { position: sticky; top: 16px; border-top: 2px solid var(--text); padding-top: 12px; }
.aside h2 { font-family: var(--head-font); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.12em; margin: 0 0 8px; color: var(--muted); font-weight: 600; }
.aside ol { margin: 0 0 22px; padding-left: 1.2em; }
.aside li { margin-bottom: 6px; }
.aside a { color: var(--text); text-decoration: none; }
.aside a:hover { color: var(--link); text-decoration: underline; }
.faq { margin-top: 2.4em; border-top: 2px solid var(--text); padding-top: 4px; }
.faq h3 { font-size: 1.15rem; }
.related { margin-top: 2.6em; padding: 18px 20px; background: var(--bg-2); }
.related h2 { margin-top: 0; font-size: 1.2rem; }
.related ul { margin: 0; padding-left: 1.1em; }

/* Plain pages */
.page { max-width: 720px; padding: 30px 0 70px; }
.page h1 { font-family: var(--head-font); font-weight: 500; font-size: clamp(2rem, 5vw, 2.8rem); line-height: 1.12; margin: 0 0 18px; }
.page h2 { font-family: var(--head-font); font-weight: 600; font-size: 1.4rem; margin: 1.8em 0 0.4em; }

/* Footer */
.footer { border-top: 1px solid var(--rule); padding: 22px 0 34px; color: var(--muted); font-size: 0.9rem; }
.footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: space-between; }
.footer a { color: var(--muted); }
