/* ==========================================================================
   Feres Gharbi — Consultant SEO & GEO
   Design tokens → base → layout → components → pages
   ========================================================================== */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/assets/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;
}

:root {
  --bg: #ffffff;
  --bg-soft: #f6f6f3;
  --ink: #111111;
  --ink-2: #3a3a3a;
  --muted: #8b8b86;
  --line: #e9e9e4;
  --accent: #f6c83f;
  --accent-ink: #1a1400;
  --accent-soft: #fdf3d2;
  --dark: #121212;
  --dark-2: #1d1d1d;
  --dark-line: #2b2b2b;
  --ok: #1f9d55;

  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 28px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
  --shadow-lg: 0 20px 50px rgba(0,0,0,.12);

  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 32px);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.12; letter-spacing: -0.025em; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(2.4rem, 6.2vw, 4.6rem); letter-spacing: -0.04em; }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.75rem); letter-spacing: -0.035em; }
h3 { font-size: clamp(1.15rem, 1.8vw, 1.35rem); }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.2em; }
li { margin-bottom: .35em; }
strong { color: var(--ink); font-weight: 650; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.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: 16px; top: -60px; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 100; text-decoration: none; }
.skip-link:focus { top: 12px; }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(64px, 9vw, 120px); }
.section--soft { background: var(--bg-soft); }
.section--tight { padding-block: clamp(40px, 6vw, 72px); }
.center { text-align: center; }
.narrow { max-width: 760px; margin-inline: auto; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
@media (max-width: 960px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ---------- Eyebrow / headings ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; letter-spacing: .02em;
  color: var(--ink); background: var(--bg); border: 1px solid var(--line);
  padding: 6px 14px 6px 10px; border-radius: 999px; margin-bottom: 20px;
}
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.eyebrow--dark { background: var(--dark-2); color: #fff; border-color: var(--dark-line); }
.section-head { max-width: 720px; margin: 0 auto 48px; text-align: center; }
.section-head p { color: var(--muted); font-size: 1.05rem; }
.muted-word { color: #b9b9b3; }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--muted); max-width: 640px; }

/* Answer-first block: 1st paragraph under an H2 answers the heading directly (RAG chunk anchor) */
.answer {
  font-size: 1.08rem; color: var(--ink); background: var(--accent-soft);
  border-left: 4px solid var(--accent); padding: 18px 22px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 0 0 24px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: 600 15px/1 var(--font); text-decoration: none; cursor: pointer;
  padding: 14px 22px; border-radius: 999px; border: 1px solid transparent;
  transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease;
  min-height: 48px;
}
.btn:hover { transform: translateY(-1px); }
.btn--accent { background: var(--accent); color: var(--accent-ink); }
.btn--accent:hover { box-shadow: 0 8px 22px rgba(246,200,63,.45); }
.btn--dark { background: var(--ink); color: #fff; }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn--ghost-dark { background: transparent; border-color: #3a3a3a; color: #fff; }
.btn .arrow { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,.08); }
.btn--dark .arrow, .btn--ghost-dark .arrow { background: rgba(255,255,255,.12); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; padding: 12px 0; }
.nav {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: rgba(255,255,255,.86); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 8px 8px 22px;
  box-shadow: 0 2px 12px rgba(0,0,0,.04);
}
.logo { font-weight: 800; font-size: 20px; letter-spacing: -0.03em; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 2px; }
.logo span { color: var(--accent); }
.nav__links { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav__links li { margin: 0; }
.nav__links a { display: block; padding: 10px 14px; border-radius: 999px; font-size: 14.5px; font-weight: 500; color: var(--ink-2); text-decoration: none; }
.nav__links a:hover, .nav__links a[aria-current="page"] { background: var(--bg-soft); color: var(--ink); }
.nav__toggle { display: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: #fff; cursor: pointer; align-items: center; justify-content: center; }
.nav__toggle svg { width: 20px; height: 20px; }
@media (max-width: 1040px) {
  .nav__links { display: none; }
  .nav__toggle { display: inline-flex; }
  .nav .btn { display: none; }
  .nav.is-open { border-radius: 24px; flex-wrap: wrap; }
  .nav.is-open .nav__links { display: flex; flex-direction: column; width: 100%; padding: 8px 0 6px; order: 3; }
  .nav.is-open .nav__links a { padding: 12px 14px; font-size: 16px; }
  .nav.is-open .btn { display: inline-flex; order: 4; width: 100%; margin-bottom: 6px; }
}

/* ---------- Breadcrumb ---------- */
.breadcrumb { font-size: 14px; color: var(--muted); margin: 8px 0 28px; }
.breadcrumb ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumb li { margin: 0; }
.breadcrumb li + li::before { content: "/"; margin-right: 6px; color: #c9c9c3; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--ink); }
.breadcrumb [aria-current] { color: var(--ink); }

/* ---------- Hero ---------- */
.hero { padding-top: clamp(40px, 7vw, 88px); text-align: center; }
.hero h1 { max-width: 980px; margin-inline: auto; }
.hero h1 .muted-word { display: block; }
.h1-chip {
  display: inline-grid; place-items: center; vertical-align: middle;
  width: .95em; height: .95em; border-radius: .22em; background: var(--accent);
  transform: rotate(-6deg) translateY(-.06em); margin: 0 .12em;
}
.h1-chip svg { width: 55%; height: 55%; }
.hero .lead { margin: 0 auto 32px; }
.hero .btn-row { justify-content: center; }
.page-hero { padding-top: clamp(24px, 4vw, 48px); padding-bottom: clamp(40px, 6vw, 72px); }
.page-hero h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); max-width: 900px; }
.page-hero .lead { margin-bottom: 28px; }

/* Bento under hero (dark strategy card + portrait card) */
.bento { display: grid; grid-template-columns: 1.05fr 1fr; gap: 20px; margin-top: clamp(40px, 6vw, 64px); text-align: left; }
@media (max-width: 860px) { .bento { grid-template-columns: minmax(0,1fr); } }
.card-dark {
  background: var(--dark); color: #cfcfca; border-radius: var(--radius-lg);
  padding: clamp(24px, 4vw, 40px); display: flex; flex-direction: column; gap: 24px; position: relative; overflow: hidden;
}
.card-dark h2, .card-dark h3 { color: #fff; }
.card-dark .eyebrow { align-self: flex-start; margin-bottom: 0; }
.bento .btn-row { justify-content: flex-start; }
.card-dark .big { font-size: clamp(2rem, 4.2vw, 3.2rem); line-height: 1.04; letter-spacing: -0.04em; margin: 0; }
.card-dark .big span { color: #6f6f6a; display: block; }
.card-dark p { color: #a9a9a3; max-width: 440px; }
.card-dark .mini {
  margin-top: auto; display: flex; gap: 16px; align-items: center;
  background: var(--dark-2); border: 1px solid var(--dark-line); border-radius: var(--radius); padding: 14px;
}
.card-dark .mini img { width: 96px; height: 72px; object-fit: cover; object-position: top; border-radius: 12px; flex: none; }
.card-dark .mini strong { color: #fff; display: block; font-size: 15px; }
.card-dark .mini small { color: #8f8f89; font-size: 13px; }

.card-photo { margin: 0; position: relative; border-radius: var(--radius-lg); overflow: hidden; background: #d9d9d4; min-height: 460px; }
.card-photo > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.stat-float {
  position: absolute; background: rgba(255,255,255,.95); border-radius: 18px; padding: 14px 16px; box-shadow: var(--shadow-lg);
  min-width: 170px; backdrop-filter: blur(8px);
}
.stat-float b { display: block; font-size: 28px; letter-spacing: -0.03em; color: var(--ink); line-height: 1.1; }
.stat-float span { font-size: 12.5px; color: var(--muted); display: block; }
.stat-float .tag { display: inline-flex; gap: 6px; align-items: center; margin-top: 8px; font-size: 12px; background: var(--accent-soft); color: #6b5400; padding: 4px 8px; border-radius: 999px; }
.stat-float--1 { left: 16px; bottom: 16px; }
.stat-float--2 { right: 16px; bottom: 16px; }
@media (max-width: 420px) { .stat-float { min-width: 0; padding: 10px 12px; } .stat-float b { font-size: 22px; } .stat-float--2 { bottom: 120px; } }

/* ---------- Logo strip ---------- */
.logos { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: clamp(20px, 5vw, 56px); padding: 36px 0 8px; }
.logos li { list-style: none; margin: 0; }
.logos a, .logos span { font-weight: 700; font-size: clamp(16px, 2vw, 20px); color: #a3a39d; letter-spacing: -0.02em; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; transition: color .15s; }
.logos a:hover { color: var(--ink); }
.logos svg { width: 22px; height: 22px; }
.logos-title { text-align: center; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; margin-top: 40px; }

/* ---------- Cards ---------- */
.card {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; display: flex; flex-direction: column; gap: 10px; position: relative;
  transition: box-shadow .2s ease, transform .2s ease;
}
.card:hover { box-shadow: var(--shadow); }
.card h3 { margin: 0; }
.card p { margin: 0; color: var(--muted); font-size: 15.5px; }
.card .icon-tile {
  width: 100%; aspect-ratio: 16/9; border-radius: 14px; background: var(--bg-soft);
  display: grid; place-items: center; margin-bottom: 10px;
}
.icon-tile svg { width: 64px; height: 64px; color: var(--ink); }
.icon-tile .dot { fill: var(--accent); }
.card .link svg, .btn .arrow svg { width: 16px; height: 16px; flex: none; }
.card .link { margin-top: auto; padding-top: 10px; font-weight: 600; font-size: 15px; color: var(--ink); text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.card .link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card .link:hover { text-decoration: underline; }
.icon {
  width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); display: grid; place-items: center; flex: none;
}
.icon svg { width: 22px; height: 22px; color: var(--ink); }
.num { font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .08em; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; }
@media (max-width: 860px) { .stats { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.stat { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.stat b { display: block; font-size: clamp(2rem, 4vw, 2.8rem); color: var(--ink); letter-spacing: -0.04em; line-height: 1; margin-bottom: 8px; }
.stat span { font-size: 14.5px; color: var(--muted); }

/* Work / case cards */
.work { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 24px; }
@media (max-width: 760px) { .work { grid-template-columns: 1fr; } }
.work-card { border-radius: var(--radius-lg); background: var(--bg-soft); padding: 14px; display: flex; flex-direction: column; text-decoration: none; position: relative; }
.work-card figure { margin: 0; border-radius: 18px; overflow: hidden; aspect-ratio: 16/10; background: #e6e6e1; }
.work-card img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .5s ease; }
.work-card:hover img { transform: scale(1.03); }
.work-card .meta { padding: 18px 10px 8px; }
.work-card h3 { margin: 0 0 6px; }
.work-card p { color: var(--muted); font-size: 15.5px; margin: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; padding: 0; }
.tags li { list-style: none; margin: 0; font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--ink-2); }
.result { display: inline-flex; gap: 8px; align-items: center; margin-top: 12px; font-weight: 700; color: var(--ink); font-size: 15px; }
.result::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }

/* Case study long-form */
.case { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(24px, 4vw, 56px); align-items: start; padding-block: 56px; border-top: 1px solid var(--line); }
.case:first-of-type { border-top: 0; }
@media (max-width: 860px) { .case { grid-template-columns: minmax(0,1fr); } }
.case figure { margin: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); position: sticky; top: 110px; }
@media (max-width: 860px) { .case figure { position: static; } }
.case dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; font-size: 15px; margin: 18px 0; }
.case dt { font-weight: 600; color: var(--ink); }
.case dd { margin: 0; color: var(--muted); }

/* ---------- Prose (long-form content pages) ---------- */
.prose { max-width: 760px; }
.prose h2 { margin-top: 2.2em; font-size: clamp(1.6rem, 3vw, 2.2rem); }
.prose h3 { margin-top: 1.6em; }
.prose > :first-child { margin-top: 0; }
.prose ul li::marker { color: var(--accent); }
.layout-aside { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: clamp(32px, 5vw, 72px); align-items: start; }
@media (max-width: 1000px) { .layout-aside { grid-template-columns: minmax(0,1fr); } .toc { display: none; } }
.toc { position: sticky; top: 110px; background: var(--bg-soft); border-radius: var(--radius); padding: 22px; font-size: 14.5px; }
.toc strong { display: block; margin-bottom: 10px; }
.toc ol { margin: 0; padding-left: 1.1em; }
.toc a { color: var(--ink-2); text-decoration: none; }
.toc a:hover { color: var(--ink); text-decoration: underline; }
.toc .btn { width: 100%; margin-top: 18px; }

/* Key takeaways / TL;DR */
.tldr { background: var(--dark); color: #d6d6d0; border-radius: var(--radius); padding: 26px 28px; margin: 0 0 36px; }
.tldr h2 { color: #fff; font-size: 1.15rem; margin: 0 0 12px; letter-spacing: -0.01em; }
.tldr ul { margin: 0; padding-left: 1.1em; }
.tldr li::marker { color: var(--accent); }
.tldr strong { color: #fff; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); margin: 24px 0; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 560px; }
caption { text-align: left; padding: 14px 18px; font-weight: 600; color: var(--ink); background: var(--bg-soft); border-bottom: 1px solid var(--line); }
th, td { text-align: left; padding: 13px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
tbody th { color: var(--ink); font-weight: 600; }

/* Steps */
.steps { counter-reset: step; display: grid; gap: 16px; padding: 0; }
.steps li { list-style: none; counter-increment: step; margin: 0; display: grid; grid-template-columns: 52px 1fr; gap: 16px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.steps li::before { content: counter(step, decimal-leading-zero); width: 52px; height: 52px; border-radius: 14px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 800; }
.steps h3 { margin: 4px 0 6px; }
.steps p { margin: 0; color: var(--muted); font-size: 15.5px; }

/* Checklist */
.check { padding: 0; }
.check li { list-style: none; position: relative; padding-left: 30px; }
.check li::before { content: ""; position: absolute; left: 0; top: .35em; width: 18px; height: 18px; border-radius: 50%; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a1400' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center/11px no-repeat; }

/* ---------- Testimonials ---------- */
.quotes { columns: 3 300px; column-gap: 20px; }
.quote { break-inside: avoid; margin: 0 0 20px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.quote blockquote { margin: 0 0 16px; color: var(--ink); font-size: 16px; }
.quote figcaption { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); }
.quote figcaption b { color: var(--ink); display: block; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; flex: none; }

/* ---------- FAQ ---------- */
.faq { max-width: 820px; margin-inline: auto; display: grid; gap: 12px; }
.faq details { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 24px; }
.faq details[open] { box-shadow: var(--shadow); }
.faq summary { cursor: pointer; list-style: none; padding: 20px 36px 20px 0; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary h3 { font-size: 1.08rem; margin: 0; letter-spacing: -0.01em; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 50%; background: var(--bg-soft); display: grid; place-items: center; font-weight: 600; color: var(--ink); }
.faq details[open] summary::after { content: "−"; background: var(--accent); }
.faq .faq__a { padding-bottom: 20px; color: var(--ink-2); }
.faq .faq__a p:last-child { margin: 0; }

/* ---------- CTA ---------- */
.cta {
  background: var(--dark); border-radius: var(--radius-lg); padding: clamp(36px, 6vw, 72px); color: #bdbdb7;
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: center; position: relative; overflow: hidden;
}
.cta::after { content: ""; position: absolute; width: 360px; height: 360px; right: -120px; top: -140px; border-radius: 50%; background: radial-gradient(circle, rgba(246,200,63,.35), transparent 65%); pointer-events: none; }
.cta h2 { color: #fff; margin-bottom: 12px; }
.cta p { margin: 0; max-width: 520px; }
.cta .btn-row { justify-content: flex-end; position: relative; z-index: 1; }
@media (max-width: 860px) { .cta { grid-template-columns: minmax(0,1fr); } .cta .btn-row { justify-content: flex-start; } }

/* ---------- Author box (E-E-A-T) ---------- */
.author { display: flex; gap: 18px; align-items: center; background: var(--bg-soft); border-radius: var(--radius); padding: 18px; margin: 40px 0 0; }
.author img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; flex: none; }
.author p { margin: 0; font-size: 14.5px; color: var(--muted); }
.author b { color: var(--ink); }
.updated { font-size: 14px; color: var(--muted); }

/* ---------- Sitemap page ---------- */
.sitemap-list { columns: 2 280px; column-gap: 40px; padding: 0; }
.sitemap-list > li { list-style: none; break-inside: avoid; margin-bottom: 28px; }
.sitemap-list h2 { font-size: 1.15rem; letter-spacing: -0.01em; }
.sitemap-list ul { padding-left: 1.1em; }
.sitemap-list a { color: var(--ink); }
.sitemap-list small { display: block; color: var(--muted); font-size: 14px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--dark); color: #a3a39d; padding: 72px 0 28px; margin-top: clamp(64px, 9vw, 120px); font-size: 15px; }
.site-footer .logo { color: #fff; font-size: 26px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 32px; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h2 { color: #fff; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 14px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: #a3a39d; text-decoration: none; }
.site-footer a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid var(--dark-line); margin-top: 48px; padding-top: 22px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; font-size: 13.5px; }

/* ---------- Reveal on scroll (progressive enhancement) ---------- */
/* CSS scroll-driven only: content is never hidden when unsupported, so crawlers always see it */
@keyframes reveal { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal { animation: reveal linear both; animation-timeline: view(); animation-range: entry 0% entry 35%; }
  }
}

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 760px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-card { border-radius: var(--radius-lg); padding: 32px; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.contact-card.is-dark { background: var(--dark); border-color: var(--dark); color: #bdbdb7; }
.contact-card.is-dark h2 { color: #fff; }
.contact-card h2 { font-size: 1.6rem; }

/* Spacing utilities (no inline styles: keeps CSP strict) */
.mt-sm { margin-top: 20px; }
.mt-md { margin-top: 32px; }

/* Nested headings inside prose components keep their component spacing */
.prose .steps h3, .prose .card h3 { margin-top: 4px; }
.prose .faq summary h3 { margin: 0; }
.prose .faq { margin-top: 8px; }
.prose .stats { margin-top: 8px; }

/* Case quote panel (brands without a screenshot) */
.case figure.quote { position: static; padding: 32px; background: var(--bg-soft); border: 0; }
.case figure.quote blockquote { font-size: 1.3rem; letter-spacing: -0.01em; }

/* Form fields */
.field { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink); }
.field input, .field textarea {
  font: 400 16px/1.5 var(--font); color: var(--ink); background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; width: 100%;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--ink); background: #fff; }
.contact-card .btn { align-self: flex-start; }

/* ---------- 404 ---------- */
.err__code {
  font-size: clamp(6rem, 22vw, 14rem); font-weight: 800; line-height: .9; letter-spacing: -0.06em;
  color: var(--ink); margin: 0 0 24px; display: flex; justify-content: center; align-items: center;
}
.err__code .h1-chip { width: .8em; height: .8em; border-radius: .2em; margin: 0 .06em; }
.err__title { font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin-bottom: 28px; }

/* ---------- Blog ---------- */
.pill { display: inline-flex; align-items: center; font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); color: var(--ink-2); }
.pill--accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 20px; }
@media (max-width: 960px) { .post-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 640px) { .post-grid { grid-template-columns: minmax(0,1fr); } }
.post-card { position: relative; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; display: flex; flex-direction: column; gap: 12px; transition: box-shadow .2s ease, transform .2s ease; }
.post-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.post-card__meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0; font-size: 13.5px; color: var(--muted); }
.post-card h2, .post-card h3 { font-size: 1.22rem; letter-spacing: -0.02em; margin: 0; }
.post-card h2 a, .post-card h3 a { text-decoration: none; color: var(--ink); }
.post-card h2 a::after, .post-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.post-card p { margin: 0; color: var(--muted); font-size: 15.5px; }
.post-card__more { margin-top: auto; padding-top: 6px; font-weight: 600; font-size: 15px; color: var(--ink); display: inline-flex; gap: 6px; align-items: center; }
.post-card__more svg { width: 16px; height: 16px; }

.post-featured { position: relative; background: var(--dark); color: #bdbdb7; border-radius: var(--radius-lg); padding: clamp(28px, 5vw, 56px); overflow: hidden; }
.post-featured::after { content: ""; position: absolute; width: 420px; height: 420px; right: -140px; bottom: -200px; border-radius: 50%; background: radial-gradient(circle, rgba(246,200,63,.32), transparent 65%); pointer-events: none; }
.post-featured > div { position: relative; z-index: 1; max-width: 760px; display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.post-featured h2 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); margin: 0; }
.post-featured h2 a { color: #fff; text-decoration: none; }
.post-featured h2 a::after { content: ""; position: absolute; inset: 0; }
.post-featured .muted-word { color: #77776f; }
.post-featured p { margin: 0; }
.post-featured .post-card__meta { color: #8f8f89; }

.post-hero .lead { margin-bottom: 20px; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: 14px; color: var(--muted); margin: 0; }
.post-meta img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.post-meta span + span::before { content: "·"; margin-right: 16px; color: #c9c9c3; }
.post-meta a { color: var(--ink); }

.ref { font-size: .72em; line-height: 0; margin-left: 1px; }
.ref a { text-decoration: none; color: #8a6d00; font-weight: 600; }
.ref a:hover { text-decoration: underline; }
.sources { border-top: 1px solid var(--line); margin-top: 48px; padding-top: 8px; }
.sources ol { font-size: 14.5px; padding-left: 1.4em; }
.sources li { margin-bottom: 8px; color: var(--muted); }
.sources a { color: var(--ink); word-break: break-word; }
:target { scroll-margin-top: 110px; }
.sources li:target { background: var(--accent-soft); border-radius: 6px; }
.changelog ul { font-size: 14.5px; color: var(--muted); padding-left: 1.1em; }
.prose .sources h2, .prose .changelog h2 { font-size: 1.25rem; letter-spacing: -0.01em; margin-top: 1.6em; }

.callout { background: var(--bg-soft); border-radius: var(--radius); padding: 20px 22px; margin: 24px 0; }
.callout strong:first-child { display: block; margin-bottom: 4px; }
.prose pre { background: var(--dark); color: #e9e9e4; border-radius: var(--radius-sm); padding: 18px 20px; overflow-x: auto; font-size: 14px; line-height: 1.6; }
.prose code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .92em; }
.prose :not(pre) > code { background: var(--bg-soft); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; }

/* Study chart: single series, horizontal bars (magnitude), direct labels, hover tooltip */
.barchart { margin: 24px 0; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); }
.barchart figcaption { font-weight: 650; color: var(--ink); margin-bottom: 4px; }
.barchart .sub { font-size: 13.5px; color: var(--muted); margin: 0 0 16px; }
.barchart ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.barchart li { display: grid; grid-template-columns: minmax(0, 15em) 1fr 3.2em; gap: 12px; align-items: center; margin: 0; font-size: 14.5px; position: relative; }
.barchart .lbl { color: var(--ink-2); }
.barchart .track { height: 14px; background: var(--bg-soft); border-radius: 4px; position: relative; }
.barchart .bar { display: block; height: 100%; min-width: 3px; background: var(--ink); border-radius: 0 4px 4px 0; transition: background-color .15s; }
.barchart .val { font-weight: 700; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.barchart li:hover .bar, .barchart li:focus-within .bar { background: #8a6d00; }
.barchart .tip { position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); background: var(--ink); color: #fff; font-size: 12.5px; padding: 6px 10px; border-radius: 8px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 2; }
.barchart li:hover .tip, .barchart li:focus-within .tip { opacity: 1; }
@media (max-width: 560px) { .barchart li { grid-template-columns: minmax(0,1fr) 3.2em; } .barchart .track { grid-column: 1 / -1; order: 3; } }
/* bar widths (CSP-safe, no inline styles) */
.w-0{width:0%}.w-1{width:1%}.w-2{width:2%}.w-3{width:3%}.w-4{width:4%}.w-5{width:5%}.w-6{width:6%}.w-7{width:7%}.w-8{width:8%}.w-9{width:9%}.w-10{width:10%}.w-11{width:11%}.w-12{width:12%}.w-13{width:13%}.w-14{width:14%}.w-15{width:15%}.w-16{width:16%}.w-17{width:17%}.w-18{width:18%}.w-19{width:19%}.w-20{width:20%}.w-21{width:21%}.w-22{width:22%}.w-23{width:23%}.w-24{width:24%}.w-25{width:25%}.w-26{width:26%}.w-27{width:27%}.w-28{width:28%}.w-29{width:29%}.w-30{width:30%}.w-31{width:31%}.w-32{width:32%}.w-33{width:33%}.w-34{width:34%}.w-35{width:35%}.w-36{width:36%}.w-37{width:37%}.w-38{width:38%}.w-39{width:39%}.w-40{width:40%}.w-41{width:41%}.w-42{width:42%}.w-43{width:43%}.w-44{width:44%}.w-45{width:45%}.w-46{width:46%}.w-47{width:47%}.w-48{width:48%}.w-49{width:49%}.w-50{width:50%}.w-51{width:51%}.w-52{width:52%}.w-53{width:53%}.w-54{width:54%}.w-55{width:55%}.w-56{width:56%}.w-57{width:57%}.w-58{width:58%}.w-59{width:59%}.w-60{width:60%}.w-61{width:61%}.w-62{width:62%}.w-63{width:63%}.w-64{width:64%}.w-65{width:65%}.w-66{width:66%}.w-67{width:67%}.w-68{width:68%}.w-69{width:69%}.w-70{width:70%}.w-71{width:71%}.w-72{width:72%}.w-73{width:73%}.w-74{width:74%}.w-75{width:75%}.w-76{width:76%}.w-77{width:77%}.w-78{width:78%}.w-79{width:79%}.w-80{width:80%}.w-81{width:81%}.w-82{width:82%}.w-83{width:83%}.w-84{width:84%}.w-85{width:85%}.w-86{width:86%}.w-87{width:87%}.w-88{width:88%}.w-89{width:89%}.w-90{width:90%}.w-91{width:91%}.w-92{width:92%}.w-93{width:93%}.w-94{width:94%}.w-95{width:95%}.w-96{width:96%}.w-97{width:97%}.w-98{width:98%}.w-99{width:99%}.w-100{width:100%}

@media (max-width: 640px) { .post-meta span + span::before { display: none; } .post-meta { gap: 4px 14px; } }
