/* ============================================================
   Raha Mawazo — Portfolio
   Design tokens, light/dark themes, components
   ============================================================ */

/* ---------- Tokens: dark (default) ---------- */
:root,
[data-theme="dark"] {
  --bg: #0A0F14;
  --bg-elevated: #111A21;
  --bg-subtle: #0E151B;
  --text: #E6EDF3;
  --text-muted: #AEBECC;          /* nudged lighter than spec base for AA */
  --text-faint: #7C8B99;
  --border: #1E2A33;
  --border-strong: #2B3A45;
  --accent: #2DD4BF;
  --accent-strong: #5EEAD4;
  --accent-contrast: #06251F;
  --ring: rgba(45, 212, 191, 0.55);
  --shadow: none;
  --card-shadow: 0 0 0 1px var(--border);
}

/* ---------- Tokens: light ---------- */
[data-theme="light"] {
  --bg: #F8FAFA;
  --bg-elevated: #FFFFFF;
  --bg-subtle: #F1F5F5;
  --text: #0F172A;
  --text-muted: #475569;
  --text-faint: #64748B;          /* darkened for AA on light bg (was #94A3B8, 2.45:1) */
  --border: #E2E8F0;
  --border-strong: #CBD5E1;
  --accent: #0F766E;              /* darkened for AA as small text / button (was #0D9488, 3.57:1) */
  --accent-strong: #0B5F58;
  --accent-contrast: #FFFFFF;
  --ring: rgba(15, 118, 110, 0.5);
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 8px 24px rgba(15,23,42,.06);
  --card-shadow: var(--shadow);
}

/* ---------- Brand constants ---------- */
:root {
  --grad: linear-gradient(135deg, #10B981 0%, #0D9488 50%, #06B6D4 100%);
  --font-sans: "Inter", "Helvetica Neue", Arial, system-ui, sans-serif;
  --font-mono: "Geist Mono", "JetBrains Mono", "SFMono-Regular", ui-monospace, monospace;
  --r-xxs: 2px; --r-xs: 4px; --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-pill: 999px;
  --container: 1120px;
  --gutter: clamp(20px, 5vw, 48px);
  --section-y: clamp(64px, 10vw, 128px);
  --ease: cubic-bezier(.2,.7,.2,1);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}

img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; transition: color .15s var(--ease); }
a:hover { color: var(--accent-strong); }

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; font-weight: 600; margin: 0; }
p { margin: 0 0 1rem; max-width: 68ch; }

.container { max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Accessibility ---------- */
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 200;
  background: var(--accent); color: var(--accent-contrast);
  padding: 10px 16px; border-radius: var(--r-md); font-family: var(--font-mono);
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 12px; }

:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; border-radius: var(--r-xs); }

/* ---------- Kicker / section headers ---------- */
.kicker {
  font-family: var(--font-mono);
  font-size: .8125rem; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-faint); margin: 0 0 .75rem;
}
.kicker.accent { color: var(--accent); }
.section { padding-block: var(--section-y); }
.section--alt { background: var(--bg-subtle); }
.section__title { font-size: clamp(1.75rem, 3.5vw, 2.75rem); margin-bottom: .5rem; }
.section__dek { color: var(--text-muted); margin-bottom: 2.5rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5rem; padding: 12px 20px; border-radius: var(--r-md);
  font-weight: 500; font-size: .95rem; cursor: pointer; border: 1px solid transparent;
  transition: transform .15s var(--ease), background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
  white-space: nowrap;
}
.btn--primary { background: var(--accent); color: var(--accent-contrast); }
.btn--primary:hover { background: var(--accent-strong); color: var(--accent-contrast); transform: translateY(-1px); }
.btn--secondary { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn--secondary:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color .3s var(--ease), border-color .3s var(--ease), backdrop-filter .3s var(--ease);
}
.nav.is-scrolled {
  background: color-mix(in srgb, var(--bg-elevated) 85%, transparent);
  backdrop-filter: blur(12px);
  border-bottom-color: var(--border);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--text); font-weight: 600; }
.brand:hover { color: var(--text); }
.brand__mark {
  display: inline-grid; place-items: center; width: 34px; height: 34px;
  border: 1px solid var(--accent); border-radius: var(--r-sm);
  font-family: var(--font-mono); font-weight: 600; font-size: .85rem; color: var(--accent);
}
.brand__name { font-size: 1rem; letter-spacing: -0.01em; }
.nav__links { display: flex; gap: 1.6rem; }
.nav__links a { color: var(--text-muted); font-size: .9rem; }
.nav__links a:hover { color: var(--text); }
.nav__actions { display: flex; align-items: center; gap: .75rem; }

.theme-toggle {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  background: transparent; border: 1px solid var(--border-strong); border-radius: var(--r-md);
  color: var(--text); cursor: pointer; transition: border-color .15s var(--ease), color .15s var(--ease);
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

.nav__burger { display: none; flex-direction: column; gap: 5px; width: 40px; height: 40px; background: transparent; border: 1px solid var(--border-strong); border-radius: var(--r-md); cursor: pointer; align-items: center; justify-content: center; }
.nav__burger span { width: 18px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .2s var(--ease), opacity .2s var(--ease); }
.nav__burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu { display: none; flex-direction: column; padding: 8px var(--gutter) 20px; gap: 2px; background: var(--bg-elevated); border-bottom: 1px solid var(--border); }
.mobile-menu a { color: var(--text); padding: 12px 4px; border-radius: var(--r-sm); }
.mobile-menu a:hover { color: var(--accent); }

/* ---------- Hero ---------- */
.hero { position: relative; padding-block: clamp(48px, 9vw, 110px); overflow: hidden; }
.hero__beam {
  position: absolute; inset: -20% -10% auto auto; width: 70vw; height: 70vw; max-width: 760px; max-height: 760px;
  background: var(--grad); filter: blur(120px); opacity: .14; border-radius: 50%; pointer-events: none;
}
[data-theme="light"] .hero__beam { opacity: .12; }
.hero__inner { position: relative; display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(24px, 5vw, 64px); align-items: center; }
.hero h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); line-height: 1.08; letter-spacing: -0.02em; margin-bottom: 1.25rem; }
.hero__sub { font-size: 1.125rem; color: var(--text-muted); margin-bottom: 1.75rem; }
.hero__cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.5rem; }

.availability {
  display: inline-flex; align-items: center; gap: .5rem; margin: 0 0 1.5rem;
  font-family: var(--font-mono); font-size: .8rem; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: var(--r-pill); padding: 6px 14px;
}
.availability .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent); animation: pulse 2.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.trust { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; list-style: none; margin: 0; padding: 0; }
.trust li { font-family: var(--font-mono); font-size: .8rem; color: var(--text-faint); position: relative; }
.trust li:not(:last-child)::after { content: "·"; position: absolute; right: -.7rem; color: var(--border-strong); }

.hero__media { display: flex; justify-content: center; }
.hero__photo {
  position: relative; width: min(360px, 80%); aspect-ratio: 4 / 5; border-radius: var(--r-lg);
  overflow: hidden; border: 1px solid var(--border); background: var(--bg-elevated); box-shadow: var(--card-shadow);
}
.hero__photo img { width: 100%; height: 100%; object-fit: cover; }
.hero__photo-fallback { display: none; }
.hero__photo.is-placeholder { display: grid; place-items: center; background: var(--grad); }
.hero__photo.is-placeholder .hero__photo-fallback { display: block; font-family: var(--font-mono); font-size: 4rem; font-weight: 600; color: #fff; opacity: .9; }

/* ---------- Stats ---------- */
.stats { background: var(--bg-subtle); border-block: 1px solid var(--border); }
.stats__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(16px, 3vw, 40px); padding-block: clamp(40px, 6vw, 64px); }
.stat { display: flex; flex-direction: column; gap: .35rem; }
.stat__num { font-size: clamp(2rem, 4vw, 3rem); font-weight: 600; letter-spacing: -0.02em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; width: max-content; }
.stat__cap { font-family: var(--font-mono); font-size: .8rem; color: var(--text-muted); line-height: 1.4; }

/* ---------- About ---------- */
.about__grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: clamp(24px, 5vw, 56px); align-items: start; }
.about__body p { color: var(--text-muted); }
.pullquote { position: relative; margin: 1.75rem 0 0; padding-left: 2.4rem; font-size: 1.2rem; line-height: 1.55; color: var(--text); font-style: normal; max-width: 60ch; }
.pullquote::before { content: "\201C"; position: absolute; left: 0; top: 0; font-size: 3.25rem; line-height: 1; font-weight: 600; color: var(--accent); }
.about__aside { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 24px 26px; box-shadow: var(--card-shadow); }
.about__aside-title { font-family: var(--font-mono); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 1rem; }
.ticklist { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.ticklist li { position: relative; padding-left: 1.5rem; color: var(--text-muted); font-size: .95rem; }
.ticklist li::before { content: "›"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 1px; background: var(--border); }
.tl { position: relative; padding-left: 36px; padding-bottom: 2.5rem; }
.tl:last-child { padding-bottom: 0; }
.tl::before { content: ""; position: absolute; left: 0; top: 6px; width: 15px; height: 15px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); }
.tl__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .5rem; }
.tl__role { font-size: clamp(1.15rem, 2vw, 1.4rem); }
.tl__date { font-family: var(--font-mono); font-size: .8rem; color: var(--text-faint); white-space: nowrap; }
.tl__org { color: var(--accent); font-size: .95rem; margin: .25rem 0 .5rem; }
.tl__framing { color: var(--text); font-size: .98rem; margin: 0 0 .75rem; opacity: .85; }
.tl__sublabel { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin: 1.1rem 0 .5rem; }
.tl__points { margin: 0; padding: 0; list-style: none; display: grid; gap: .6rem; }
.tl__points li { position: relative; padding-left: 1.25rem; color: var(--text-muted); font-size: .95rem; max-width: 75ch; }
.tl__points li::before { content: ""; position: absolute; left: 0; top: .65em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.tl__points strong { color: var(--text); font-weight: 600; }

/* ---------- Projects ---------- */
.projects { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(16px, 2.5vw, 24px); }
.project {
  position: relative; background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 26px 28px; box-shadow: var(--card-shadow);
  transition: transform .2s var(--ease), border-color .2s var(--ease);
}
.project:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.project--flag { border-top: 2px solid transparent; background-image: linear-gradient(var(--bg-elevated), var(--bg-elevated)), var(--grad); background-origin: border-box; background-clip: padding-box, border-box; }
.project__ribbon { position: absolute; top: 18px; right: 18px; font-family: var(--font-mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-contrast); background: var(--accent); padding: 3px 9px; border-radius: var(--r-pill); }
.project__cat { font-family: var(--font-mono); font-size: .72rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: .6rem; }
.project__title { font-size: 1.25rem; margin-bottom: .5rem; padding-right: 70px; }
.project__status { display: inline-flex; align-items: center; gap: .45rem; margin: 0 0 .85rem; font-family: var(--font-mono); font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); }
.project__status .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.project__status.is-progress .dot { background: #F59E0B; }
.project__status.is-live .dot { background: #22C55E; box-shadow: 0 0 0 0 rgba(34,197,94,.55); animation: pulse-green 2.2s infinite; }
.project__pitch { color: var(--text-muted); font-size: .95rem; }
.project__proves { color: var(--text-muted); font-size: .88rem; }
.project__proves strong { color: var(--text); }
.project__link { display: inline-block; margin-top: .75rem; font-family: var(--font-mono); font-size: .85rem; }
.project__link--muted { color: var(--text-faint); cursor: default; }
.project__link--muted:hover { color: var(--text-faint); }

/* ---------- Tags ---------- */
.tags { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; margin: 1rem 0 0; padding: 0; }
.tags li { font-family: var(--font-mono); font-size: .75rem; color: var(--text-muted); background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--r-pill); padding: 4px 10px; }

/* ---------- Certifications ---------- */
.certs { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-bottom: 3rem; }
.cert { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--r-md); padding: 16px 18px; box-shadow: var(--card-shadow); display: grid; gap: 2px; }
.cert__name { font-weight: 600; }
.cert__body { color: var(--accent); font-size: .85rem; }
.cert__date { font-family: var(--font-mono); font-size: .78rem; color: var(--text-faint); }
.cert__status { font-family: var(--font-mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin-top: 4px; }
.cert--expired { opacity: .62; }
.cert--expired .cert__body, .cert--expired .cert__status { color: var(--text-faint); }

.edu { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.edu__item { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--r-md); padding: 18px 20px; box-shadow: var(--card-shadow); }
.edu__item h3 { font-size: 1.05rem; }
.edu__item p { color: var(--text-muted); font-size: .9rem; margin: .25rem 0 0; }

/* ---------- Skills ---------- */
.skills { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(20px, 3vw, 32px); }
.skillgroup h3 { font-size: 1.05rem; margin-bottom: .25rem; }
.skillgroup .tags { margin-top: .75rem; }

/* ---------- Writing ---------- */
.writing { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 2.5vw, 24px); }
.post { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 24px 26px; box-shadow: var(--card-shadow); transition: transform .2s var(--ease), border-color .2s var(--ease); }
.post:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.post h3 { font-size: 1.1rem; margin-bottom: .5rem; }
.post p { color: var(--text-muted); font-size: .92rem; }
.post__tag { font-family: var(--font-mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint); }

/* ---------- Awards ---------- */
.awards { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.awards li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; padding: 1.1rem 0; border-bottom: 1px solid var(--border); }
.awards li:first-child { border-top: 1px solid var(--border); }
.awards__what { font-weight: 500; max-width: 60ch; }
.awards__who { font-family: var(--font-mono); font-size: .82rem; color: var(--text-faint); }

/* ---------- Contact ---------- */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.contact__intro .section__title { font-size: clamp(2.25rem, 5vw, 3.75rem); line-height: 1.05; margin-bottom: 1.25rem; }
.contact__lead { color: var(--text-muted); max-width: 42ch; margin-bottom: 1.75rem; }
.contact__status { display: inline-flex; align-items: center; gap: .5rem; margin: 0; font-family: var(--font-mono); font-size: .76rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); }
.contact__status .dot { width: 9px; height: 9px; border-radius: 50%; background: #22C55E; box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: pulse-green 2.2s infinite; }
@keyframes pulse-green { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.55); } 70% { box-shadow: 0 0 0 9px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }

.contact__card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--r-lg); padding: clamp(20px, 3vw, 32px); box-shadow: var(--card-shadow); }
.contact__rows { margin: 0 0 1.25rem; padding: 0; }
.contact__row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--border); }
.contact__row:first-child { padding-top: 0; }
.contact__row dt { margin: 0; font-family: var(--font-mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); }
.contact__row dd { margin: 0; text-align: right; font-size: .95rem; color: var(--text); word-break: break-word; }
.contact__row dd a { color: var(--text); }
.contact__row dd a:hover { color: var(--accent); }
.contact__btn { width: 100%; margin-top: .75rem; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding-block: 32px; }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.footer__links { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.footer__links a { color: var(--text-muted); font-size: .88rem; }
.footer__links a:hover { color: var(--accent); }
.footer__copy { color: var(--text-faint); font-size: .82rem; margin: 0; width: 100%; }

/* ---------- Reveal animation ---------- */
.reveal { transition: opacity .5s var(--ease), transform .5s var(--ease); }
.js .reveal { opacity: 0; transform: translateY(12px); }         /* hide only when JS is present */
.js .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .availability .dot, .project__status.is-live .dot { animation: none; }
  .btn:hover, .project:hover, .post:hover { transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .hero__inner { grid-template-columns: 1.2fr 1fr; }
}
@media (max-width: 860px) {
  .nav__links { display: none; }
  .nav__cta { display: none; }
  .nav__burger { display: flex; }
  .mobile-menu.is-open { display: flex; }
  .hero__inner { grid-template-columns: 1fr; }
  .hero__media { order: -1; justify-content: flex-start; }
  .hero__photo { width: min(280px, 70%); }
  .about__grid { grid-template-columns: 1fr; }
  .stats__grid { grid-template-columns: repeat(2, 1fr); }
  .projects { grid-template-columns: 1fr; }
  .skills { grid-template-columns: 1fr; }
  .writing { grid-template-columns: 1fr; }
  .edu { grid-template-columns: 1fr; }
  .contact { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .stats__grid { grid-template-columns: 1fr 1fr; }
  .tl__head { flex-direction: column; }
  .project__title { padding-right: 0; }
  .project--flag .project__title { padding-right: 70px; }
}

/* ============================================================
   MULTI-PAGE SURFACES
   Added for the Eleventy multi-page build. Extends the existing
   Control Room system: one teal signal, hairline borders (no
   shadows in dark), mono as instrumentation only.
   ============================================================ */

/* ---------- Utilities ---------- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.container--reading { max-width: 760px; }
.section--tight { padding-block: clamp(40px, 6vw, 72px); }
h1, h2, h3 { text-wrap: balance; }

/* ---------- Active nav state ---------- */
.nav__links a.is-active { color: var(--text); position: relative; }
.nav__links a.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px;
  height: 2px; background: var(--accent); border-radius: 2px;
}
.mobile-menu a.is-active { color: var(--accent); }

/* ---------- Section head (title + "all →" link) ---------- */
.section__head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1.5rem; flex-wrap: wrap; margin-bottom: 2.5rem;
}
.section__head .section__title { margin-bottom: 0; }
.section__more {
  font-family: var(--font-mono); font-size: .85rem; white-space: nowrap;
  padding-bottom: .25rem;
}

/* ---------- Page head (interior page hero) ---------- */
.pagehead {
  position: relative;
  padding-block: clamp(48px, 8vw, 96px) clamp(24px, 4vw, 40px);
  border-bottom: 1px solid var(--border);
}
.pagehead__title { font-size: clamp(2.25rem, 5vw, 3.5rem); line-height: 1.1; letter-spacing: -0.02em; margin-bottom: .75rem; }
.pagehead__dek { color: var(--text-muted); font-size: 1.075rem; max-width: 62ch; margin: 0; text-wrap: pretty; }

/* ---------- Breadcrumb ---------- */
.breadcrumb { margin-bottom: 1.5rem; }
.breadcrumb a {
  font-family: var(--font-mono); font-size: .8rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-faint);
}
.breadcrumb a:hover { color: var(--accent); }

/* ---------- Credentials strip (home) ---------- */
.credstrip__inner { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 72px); align-items: center; }
.credstrip .section__dek { margin-bottom: 1.75rem; }
.credstrip__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.credstrip__list li {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  padding: 1.05rem 0; border-bottom: 1px solid var(--border);
}
.credstrip__list li:first-child { border-top: 1px solid var(--border); }
.credstrip__name { font-weight: 600; }
.credstrip__by { font-family: var(--font-mono); font-size: .8rem; color: var(--text-faint); text-align: right; }

/* ---------- CTA band ---------- */
.cta__inner { display: flex; align-items: center; justify-content: space-between; gap: clamp(24px, 5vw, 64px); flex-wrap: wrap; }
.cta__text { max-width: 54ch; }
.cta__text .section__dek { margin-bottom: 0; }
.cta__actions { display: flex; gap: .75rem; flex-wrap: wrap; }

/* ---------- Article cards (writing index + home) ---------- */
.writing { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.acard {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--card-shadow);
  transition: transform .2s var(--ease), border-color .2s var(--ease);
}
.acard:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.acard__media {
  display: block; aspect-ratio: 16 / 9; background: var(--bg-subtle);
  border-bottom: 1px solid var(--border); overflow: hidden;
}
.acard__media img { width: 100%; height: 100%; object-fit: cover; }
.acard__media-fallback {
  display: grid; place-items: center; width: 100%; height: 100%;
  background: var(--grad); position: relative;
}
[data-theme="dark"] .acard__media-fallback { opacity: .92; }
.acard__media-glyph {
  font-family: var(--font-mono); font-size: .78rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: #06251F;
  background: rgba(255,255,255,.82); padding: 5px 12px; border-radius: var(--r-pill);
}
.acard__body { padding: 22px 24px 24px; display: flex; flex-direction: column; flex: 1; }
.acard__meta {
  font-family: var(--font-mono); font-size: .74rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-faint); margin: 0 0 .6rem;
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
}
.acard__meta-sep { color: var(--border-strong); }
.acard__title { font-size: 1.15rem; line-height: 1.28; margin-bottom: .5rem; }
.acard__title a { color: var(--text); }
.acard__title a:hover { color: var(--accent); }
.acard__dek { color: var(--text-muted); font-size: .93rem; margin-bottom: 1rem; }
.acard__tags { margin-top: auto; }

/* ---------- Empty state ---------- */
.emptystate {
  border: 1px dashed var(--border-strong); border-radius: var(--r-lg);
  padding: clamp(32px, 6vw, 64px); text-align: center;
}
.emptystate h2 { font-size: 1.35rem; margin-bottom: .5rem; }
.emptystate p { color: var(--text-muted); max-width: 46ch; margin-inline: auto; margin-bottom: 1.5rem; }

/* ============================================================
   CASE STUDY
   ============================================================ */
.cs__head { padding-block: clamp(40px, 7vw, 80px) clamp(20px, 3vw, 32px); }
.cs__cat {
  font-family: var(--font-mono); font-size: .78rem; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin: 0 0 .75rem;
}
.cs__title { font-size: clamp(2.5rem, 6vw, 4rem); line-height: 1.05; letter-spacing: -0.025em; margin-bottom: 1rem; }
.cs__standfirst { font-size: 1.2rem; line-height: 1.55; color: var(--text-muted); max-width: 60ch; margin-bottom: 1.25rem; }
.cs__status { margin: 0; }

.cs__facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0; margin: 0 0 clamp(32px, 5vw, 56px); padding: 0;
  border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden;
}
.cs__fact { padding: 18px 22px; border-right: 1px solid var(--border); }
.cs__fact:last-child { border-right: 0; }
.cs__fact dt {
  font-family: var(--font-mono); font-size: .7rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text-faint); margin-bottom: .4rem;
}
.cs__fact dd { margin: 0; font-size: .92rem; color: var(--text); }

.cs__body > section { margin-bottom: clamp(40px, 6vw, 72px); }
.cs__body h2 {
  font-size: clamp(1.5rem, 2.8vw, 2rem); margin-bottom: 1rem;
  padding-top: 1.5rem; border-top: 1px solid var(--border);
}
.cs__body p { color: var(--text-muted); max-width: 70ch; text-wrap: pretty; }
.cs__body .pullquote { color: var(--text); }
.ticklist--flow li { margin-bottom: .35rem; }
.ticklist--flow strong { color: var(--text); }

/* Column count is fixed (not auto-fit) so the module count divides evenly and
   no empty cell renders as a stray filled block — the 1px gaps expose the
   container background to draw the hairlines. Keep module counts a multiple
   of 3 (desktop) / 2 (tablet). */
.cs__modules { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; margin: 1.5rem 0; }
.cs__module { background: var(--bg); padding: 20px 22px; }
.cs__module h3 { font-size: 1rem; margin-bottom: .35rem; color: var(--accent); }
.cs__module p { color: var(--text-muted); font-size: .9rem; margin: 0; }
.cs__note { font-family: var(--font-mono); font-size: .8rem; color: var(--text-faint); }

.cs__proves { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 26px 28px; box-shadow: var(--card-shadow); }
.cs__proves .tags { margin-top: 0; margin-bottom: 1rem; }
.cs__proves p { margin: 0; }

/* ============================================================
   LONG-FORM ARTICLE
   ============================================================ */
.post-full__head { padding-block: clamp(40px, 7vw, 80px) clamp(16px, 2.5vw, 24px); }
.post-full__title { font-size: clamp(2.1rem, 4.6vw, 3.25rem); line-height: 1.1; letter-spacing: -0.022em; margin-bottom: .85rem; }
.post-full__dek { font-size: 1.175rem; line-height: 1.55; color: var(--text-muted); margin-bottom: 1.25rem; text-wrap: pretty; }
.post-full__meta {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin: 0 0 1rem;
  font-family: var(--font-mono); font-size: .78rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-faint);
}
.post-full__meta-sep { color: var(--border-strong); }
.post-full__tags { margin-top: 0; }

/* ---------- Prose ---------- */
.prose { padding-block: clamp(8px, 2vw, 16px) clamp(24px, 4vw, 40px); }
.prose > * + * { margin-top: 1.15rem; }
.prose p { color: var(--text-muted); font-size: 1.05rem; line-height: 1.75; max-width: none; text-wrap: pretty; }
.prose h2 {
  font-size: clamp(1.45rem, 2.6vw, 1.85rem); line-height: 1.25; color: var(--text);
  margin-top: 2.75rem; margin-bottom: .25rem; padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.prose h3 { font-size: 1.2rem; color: var(--text); margin-top: 2rem; margin-bottom: .25rem; }
.prose a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose strong { color: var(--text); font-weight: 600; }
.prose ul, .prose ol { color: var(--text-muted); padding-left: 1.25rem; font-size: 1.05rem; line-height: 1.75; }
.prose li + li { margin-top: .5rem; }
.prose li::marker { color: var(--accent); }
.prose hr { border: 0; border-top: 1px solid var(--border); margin-block: 2.5rem; }
.prose img { border-radius: var(--r-md); border: 1px solid var(--border); }
.prose figure { margin: 2rem 0; }
.prose figcaption { font-family: var(--font-mono); font-size: .78rem; color: var(--text-faint); margin-top: .6rem; }

.prose blockquote {
  margin: 2rem 0; padding-left: 2.4rem; position: relative;
  font-size: 1.15rem; line-height: 1.6; color: var(--text); max-width: 60ch;
}
.prose blockquote::before {
  content: "\201C"; position: absolute; left: 0; top: 0;
  font-size: 3.25rem; line-height: 1; font-weight: 600; color: var(--accent);
}
.prose blockquote p { color: inherit; font-size: inherit; }

.prose code {
  font-family: var(--font-mono); font-size: .875em; color: var(--text);
  background: var(--bg-subtle); border: 1px solid var(--border);
  border-radius: var(--r-xs); padding: .12em .38em;
}
.prose pre {
  background: var(--bg-subtle); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 18px 20px; overflow-x: auto;
  font-family: var(--font-mono); font-size: .875rem; line-height: 1.6;
}
.prose pre code { background: none; border: 0; padding: 0; font-size: inherit; }

/* ---------- Article foot ---------- */
.post-full__canonical {
  font-family: var(--font-mono); font-size: .82rem; color: var(--text-faint);
  border-top: 1px solid var(--border); padding-top: 1.25rem; margin-bottom: 1.5rem;
}
.post-full__sig {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 20px 24px; box-shadow: var(--card-shadow);
}
.post-full__sig p { color: var(--text-muted); font-size: .93rem; margin: 0; }
/* Links inside prose-like paragraphs must not rely on colour alone (WCAG 1.4.1). */
.post-full__canonical a, .post-full__sig a {
  text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px;
}

.postnav { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-block: 2rem clamp(40px, 6vw, 72px); }
.postnav__item {
  display: flex; flex-direction: column; gap: .35rem;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 16px 18px; box-shadow: var(--card-shadow);
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.postnav__item:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); transform: translateY(-2px); }
.postnav__item--next { text-align: right; }
.postnav__dir {
  font-family: var(--font-mono); font-size: .7rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent);
}
.postnav__title { color: var(--text); font-weight: 500; font-size: .95rem; line-height: 1.35; }

/* ---------- Contact page extras ---------- */
.contact__avail {
  display: inline-flex; align-items: center; gap: .5rem; margin: .75rem 0 0;
  font-family: var(--font-mono); font-size: .76rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text-faint);
}
.contact__avail .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); animation: pulse 2.2s infinite; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .acard:hover, .postnav__item:hover { transform: none; }
  .contact__avail .dot { animation: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .credstrip__inner { grid-template-columns: 1fr; }
  .cta__inner { flex-direction: column; align-items: flex-start; }
  .cs__fact { border-right: 0; border-bottom: 1px solid var(--border); }
  .cs__fact:last-child { border-bottom: 0; }
  .postnav__item--next { text-align: left; }
}
@media (max-width: 560px) {
  .section__head { flex-direction: column; align-items: flex-start; gap: .75rem; }
}
