/* Shared styles for the role and case-study pages.
   Tokens mirror the values inline in index.html so both look like one site.
   Light: #F5F7FA bg, #18212B text, #A78348 / #85642F accent.
   Dark:  #101318 bg, #F3F4F2 text, #D5B77D accent. */

/* Inter, self hosted. One variable latin file covers 400 to 700; no third-party font CDN. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/inter-latin-var.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+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --color-brand-50: #FAF6EE;
  --color-brand-100: #F1E7D5;
  --color-brand-300: #D5B77D;
  --color-brand-500: #A78348;
  --color-brand-700: #6E5527;
  --color-brand-900: #2A2419;
  --color-bg: #F5F7FA;
  --color-bg-subtle: #EDF0F4;
  --color-surface: #FFFFFF;
  --color-border: #E3E7EC;
  --color-text: #18212B;
  --color-text-muted: #59626E;
  --color-accent: #A78348;
  --color-interactive: #85642F;
  --color-btn-bg: #A78348;
  --color-on-btn: #18212B;
  --shadow-sm: 0 1px 2px rgba(24, 33, 43, 0.06);
  --shadow-md: 0 6px 20px rgba(24, 33, 43, 0.08);
  --radius: 12px;
  --text-sm: 0.875rem;
  --text-xs: 0.78rem;
}

[data-theme="dark"] {
  --color-bg: #101318;
  --color-bg-subtle: #15191F;
  --color-surface: #181D24;
  --color-border: #272D36;
  --color-text: #F3F4F2;
  --color-text-muted: #A6ADB7;
  --color-interactive: #D5B77D;
  --color-btn-bg: #D5B77D;
  --color-on-btn: #101318;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.45);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg: #101318;
    --color-bg-subtle: #15191F;
    --color-surface: #181D24;
    --color-border: #272D36;
    --color-text: #F3F4F2;
    --color-text-muted: #A6ADB7;
    --color-interactive: #D5B77D;
    --color-btn-bg: #D5B77D;
    --color-on-btn: #101318;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--color-interactive); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--color-accent); }

.container { width: min(100% - 2.5rem, 68rem); margin-inline: auto; }

.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--color-surface);
  color: var(--color-text); padding: 0.75rem 1rem; border: 1px solid var(--color-border);
  border-radius: 8px; z-index: 100;
}
.skip-link:focus { left: 1rem; top: 1rem; }

:where(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--color-bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}
.site-header .inner { display: flex; align-items: center; gap: 1.25rem; padding: 0.85rem 0; }
.brand { font-weight: 700; letter-spacing: -0.01em; text-decoration: none; color: var(--color-text); font-size: 1.02rem; white-space: nowrap; }
.site-nav { margin-left: auto; }
.site-nav ul { display: flex; gap: 1.15rem; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; align-items: center; }
.site-nav a { color: var(--color-text-muted); text-decoration: none; font-size: 0.86rem; }
.site-nav a:hover { color: var(--color-interactive); }
.site-nav a[aria-current="page"] { color: var(--color-interactive); font-weight: 600; }

.theme-toggle {
  display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem;
  border-radius: 8px; border: 1px solid var(--color-border); background: var(--color-surface);
  color: var(--color-text); cursor: pointer; padding: 0;
}
.theme-toggle:hover { border-color: var(--color-accent); }
.theme-toggle svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- page shell ---------- */
main { display: block; }
.page-head { padding: 3rem 0 0.5rem; }
.eyebrow {
  display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--color-interactive); margin-bottom: 0.65rem;
}
h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); line-height: 1.14; letter-spacing: -0.015em; margin: 0 0 0.75rem; }
h2 { font-size: clamp(1.25rem, 2.2vw, 1.55rem); line-height: 1.25; margin: 2.4rem 0 0.75rem; letter-spacing: -0.01em; }
h3 { font-size: 1.05rem; margin: 1.6rem 0 0.5rem; }
p { margin: 0 0 0.9rem; max-width: 68ch; }
ul, ol { margin: 0 0 1rem; padding-left: 1.15rem; max-width: 68ch; }
li { margin-bottom: 0.45rem; }
.lede { font-size: 1.06rem; color: var(--color-text-muted); max-width: 60ch; margin-bottom: 1.2rem; }
.muted { color: var(--color-text-muted); }
.small { font-size: var(--text-sm); }

.breadcrumbs { font-size: var(--text-xs); color: var(--color-text-muted); margin: 0 0 1.1rem; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 0.35rem; list-style: none; margin: 0; padding: 0; }
.breadcrumbs li { margin: 0; display: flex; gap: 0.35rem; }
.breadcrumbs a { color: var(--color-text-muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--color-interactive); }
.breadcrumbs li + li::before { content: "/"; opacity: 0.55; }

.actions { display: flex; flex-wrap: wrap; gap: 0.65rem; margin: 1.4rem 0 0; }
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.62rem 1.05rem;
  border-radius: 8px; font-size: 0.88rem; font-weight: 600; text-decoration: none;
  border: 1px solid transparent; min-height: 44px;
}
.btn-primary { background: var(--color-btn-bg); color: var(--color-on-btn); }
.btn-primary:hover { background: var(--color-accent); color: var(--color-on-btn); }
.btn-ghost { background: transparent; border-color: var(--color-border); color: var(--color-text); }
.btn-ghost:hover { border-color: var(--color-accent); color: var(--color-text); }

/* ---------- stats ---------- */
.stat-strip { display: flex; flex-wrap: wrap; gap: 0.6rem; list-style: none; margin: 1.6rem 0 0; padding: 0; }
.stat-strip li {
  border: 1px solid var(--color-border); border-radius: 9px; background: var(--color-surface);
  padding: 0.6rem 0.9rem; font-size: var(--text-xs); color: var(--color-text-muted); min-width: 8.5rem;
}
.stat-strip strong { display: block; font-size: 1.25rem; line-height: 1.15; color: var(--color-interactive); }

/* ---------- cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; margin: 1.2rem 0 0; }
.card {
  border: 1px solid var(--color-border);
  border-top: 2px solid color-mix(in srgb, var(--color-accent) 60%, transparent);
  border-radius: var(--radius); background: var(--color-surface);
  padding: 1.15rem 1.2rem 1.1rem; box-shadow: var(--shadow-sm);
}
.card h3 { margin: 0.35rem 0 0.5rem; font-size: 1rem; }
.card p { font-size: var(--text-sm); color: var(--color-text-muted); margin: 0 0 0.8rem; }
.card .kicker { font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700; color: var(--color-interactive); }
.card-link { font-size: var(--text-sm); font-weight: 600; text-decoration: none; color: var(--color-interactive); }

/* ---------- prose blocks ---------- */
.split { display: grid; grid-template-columns: 1.7fr 1fr; gap: 2rem; align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: 1rem; } }

/* Narrow screens: brand and toggle share the first row, navigation gets its own. */
@media (max-width: 720px) {
  .site-header .inner { flex-wrap: wrap; row-gap: 0.6rem; }
  .site-nav { order: 3; margin-left: 0; width: 100%; border-top: 1px solid var(--color-border); padding-top: 0.6rem; }
  .site-nav ul { gap: 1rem; }
  .site-nav a { font-size: 0.84rem; }
  .theme-toggle { margin-left: auto; }
}

.facts {
  border: 1px solid var(--color-border); border-radius: var(--radius);
  background: var(--color-bg-subtle); padding: 1rem 1.15rem; margin: 1.4rem 0 0;
}
.facts h2 { font-size: var(--text-sm); text-transform: uppercase; letter-spacing: 0.09em; color: var(--color-text-muted); margin: 0 0 0.6rem; }
.facts dl { margin: 0; }
.facts div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.45rem 0; border-bottom: 1px solid var(--color-border); font-size: var(--text-sm); }
.facts div:last-child { border-bottom: 0; }
.facts dt { color: var(--color-text-muted); }
.facts dd { margin: 0; text-align: right; font-weight: 600; }

.callout {
  border: 1px solid color-mix(in srgb, var(--color-accent) 45%, transparent);
  border-left: 3px solid var(--color-accent);
  background: color-mix(in srgb, var(--color-brand-300) 14%, transparent);
  border-radius: 9px; padding: 0.95rem 1.1rem; margin: 1.4rem 0 0; font-size: var(--text-sm);
}
.callout p:last-child { margin-bottom: 0; }

.related { list-style: none; margin: 0.6rem 0 0; padding: 0; }
.related li { border-bottom: 1px solid var(--color-border); padding: 0.65rem 0; margin: 0; }
.related li:last-child { border-bottom: 0; }
.related a { font-weight: 600; text-decoration: none; font-size: 0.95rem; }
.related span { display: block; color: var(--color-text-muted); font-size: var(--text-xs); }

.cta-band {
  margin: 3rem 0 0; padding: 2rem 0; border-top: 1px solid var(--color-border);
  background: var(--color-bg-subtle);
}
.cta-band h2 { margin-top: 0; }
.cta-band p { color: var(--color-text-muted); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--color-border); padding: 2rem 0 3rem; font-size: var(--text-sm); color: var(--color-text-muted); }
.site-footer .inner { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; }
.site-footer a { color: var(--color-interactive); text-decoration: none; }
.site-footer nav ul { display: flex; gap: 1rem; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
