/* ==========================================================================
   Krishnaraj Venkatesan — design system
   One stylesheet for the whole site: the profile page (/) and the long-form
   case studies (/case-studies/). The .prose rules near the bottom
   style Markdown rendered by kramdown; everything above is shared.
   ========================================================================== */

:root {
  --bg: #ffffff;
  --bg-subtle: #f8fafc;
  --text: #0f172a;
  --muted: #475569;
  --faint: #64748b;
  --border: #e2e8f0;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.09);
  --accent-ink: #ffffff;
  --card: #ffffff;
  --code-bg: #0f172a;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco,
    Consolas, "Liberation Mono", monospace;

  --measure: 1040px;
  /* Reading column for long-form pages. The page header, contents rail and
     prose all share this so they align on the same left edge. */
  --prose-measure: 78ch;
  --resume-measure: 860px;
  --radius: 14px;
}

:root:not([data-theme="light"]) {
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220;
    --bg-subtle: #0f172a;
    --text: #e5e7eb;
    --muted: #94a3b8;
    --faint: #8593a8;
    --border: #1e293b;
    --accent: #60a5fa;
    --accent-soft: rgba(96, 165, 250, 0.12);
    --accent-ink: #0b1220;
    --card: #0f172a;
    --code-bg: #020617;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0b1220;
  --bg-subtle: #0f172a;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --faint: #8593a8;
  --border: #1e293b;
  --accent: #60a5fa;
  --accent-soft: rgba(96, 165, 250, 0.12);
  --accent-ink: #0b1220;
  --card: #0f172a;
  --code-bg: #020617;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

/* --------------------------------------------------------------- base --- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.container {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 24px;
}

/* Narrow the container to the reading column. Applied to the page header AND
   the content wrapper on long-form pages so both share one left edge — the
   nav stays full width, as site chrome should. */
.container--prose { max-width: calc(var(--prose-measure) + 48px); }
.container--resume { max-width: var(--resume-measure); }

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  font-weight: 600;
}

.skip-link:focus {
  left: 0;
  text-decoration: none;
}

/* --------------------------------------------------------------- nav ---- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 60px;
}

.nav__brand {
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  white-space: nowrap;
  margin-right: auto;
}

.nav__brand:hover { text-decoration: none; color: var(--accent); }

.nav__links {
  display: flex;
  align-items: center;
  gap: 22px;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav__links::-webkit-scrollbar { display: none; }

.nav__links a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}

.nav__links a:hover {
  color: var(--text);
  border-bottom-color: var(--accent);
  text-decoration: none;
}

.theme-toggle {
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}

.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: none; }
}

@media (max-width: 720px) {
  .nav__links a:not(.nav__cta) { display: none; }
}

/* ------------------------------------------------------------- layout --- */

.section {
  padding: 56px 0;
  border-top: 1px solid var(--border);
}

.section:first-of-type { border-top: 0; }

.section__eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 8px;
}

.section__title {
  font-size: clamp(24px, 3.4vw, 30px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}

.section__lede {
  color: var(--muted);
  margin: 0 0 28px;
  max-width: 68ch;
}

/* --------------------------------------------------------------- hero --- */

.hero {
  padding: 72px 0 56px;
  background:
    radial-gradient(900px 420px at 12% -8%, var(--accent-soft), transparent 70%);
}

.hero__status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 999px;
  padding: 5px 13px;
  margin-bottom: 22px;
}

.hero__status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.hero__name {
  font-size: clamp(34px, 6vw, 54px);
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin: 0 0 14px;
  font-weight: 700;
}

.hero__role {
  font-size: clamp(17px, 2.4vw, 21px);
  color: var(--muted);
  margin: 0 0 20px;
  max-width: 60ch;
  line-height: 1.5;
}

.hero__role strong { color: var(--text); font-weight: 600; }

/* Scope of the role — team size, org reach. Sits below the positioning line. */
.hero__scope {
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 64ch;
  margin: 0 0 22px;
  padding-left: 16px;
  border-left: 2px solid var(--accent);
}

.hero__scope strong { color: var(--text); font-weight: 600; }

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  color: var(--faint);
  font-size: 14px;
  margin: 0 0 28px;
}

.hero__meta span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ------------------------------------------------------------ buttons --- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
  border-color: var(--accent);
  color: var(--accent);
}

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.btn--primary:hover {
  color: var(--accent-ink);
  filter: brightness(1.08);
}

.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

/* -------------------------------------------------------------- stats --- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 44px;
}

.stat {
  background: var(--card);
  padding: 20px 22px;
}

.stat__value {
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  display: block;
}

.stat__label {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
  display: block;
  line-height: 1.4;
}

/* -------------------------------------------------------------- cards --- */

.grid {
  display: grid;
  gap: 18px;
}

.grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.card--link:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.card__kicker {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 10px;
}

.card__title {
  font-size: 18px;
  letter-spacing: -0.015em;
  margin: 0 0 10px;
  line-height: 1.3;
}

.card__title a { color: var(--text); }
.card__title a:hover { color: var(--accent); text-decoration: none; }

.card__body {
  color: var(--muted);
  font-size: 15px;
  margin: 0;
}

.card__body + .card__body { margin-top: 10px; }

.card ul {
  color: var(--muted);
  font-size: 15px;
  margin: 0;
  padding-left: 20px;
}

.card li { margin: 7px 0; }

.card strong { color: var(--text); font-weight: 600; }

.card__foot {
  margin-top: auto;
  padding-top: 16px;
}

/* --------------------------------------------------------------- tags --- */

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tag {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 3px 9px;
  white-space: nowrap;
}

.tag--accent {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: transparent;
}

/* ----------------------------------------------------------- timeline --- */

.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 26px;
  border-left: 2px solid var(--border);
}

.timeline > li {
  position: relative;
  padding-bottom: 38px;
}

.timeline > li:last-child { padding-bottom: 0; }

.timeline > li::before {
  content: "";
  position: absolute;
  left: -33px;
  top: 7px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border);
}

.timeline > li.is-current::before {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.role__title {
  font-size: 18px;
  margin: 0 0 3px;
  letter-spacing: -0.015em;
}

.role__org { color: var(--accent); font-weight: 600; }

.role__meta {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--faint);
  margin: 0 0 12px;
}

.role__list {
  color: var(--muted);
  font-size: 15px;
  margin: 0 0 14px;
  padding-left: 20px;
}

.role__list li { margin: 8px 0; }
.role__list strong { color: var(--text); font-weight: 600; }

/* --------------------------------------------------------- definition --- */

.stack {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.stack__group {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--card);
}

.stack__heading {
  font-size: 14px;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}

/* --------------------------------------------------------------- misc --- */

.callout {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  background: var(--card);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 20px 24px;
}

.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  color: var(--faint);
  font-size: 14px;
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.footer a { color: var(--muted); }

@media print {
  .nav, .theme-toggle, .hero__actions, .skip-link { display: none !important; }
  body { font-size: 11pt; }
  .section { padding: 18px 0; page-break-inside: avoid; }
  .card { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}

/* ==========================================================================
   Long-form prose — the case-study page at /case-studies/, rendered
   from Markdown by kramdown. Kramdown emits a flat heading/paragraph stream
   with no wrapper elements, so these rules style that stream directly.
   ========================================================================== */

.prose {
  max-width: var(--prose-measure);
  margin: 0 auto;
  padding-bottom: 40px;
}

/* Each `## ` case study becomes a self-contained panel. Kramdown gives us no
   wrapper, so the rules below style the flat heading/paragraph stream. */
.prose > h2 {
  font-size: clamp(23px, 3.2vw, 29px);
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin: 64px 0 20px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  scroll-margin-top: 84px;
}

.prose > h2:first-child { margin-top: 8px; border-top: 0; padding-top: 0; }

/* Case-study section labels — "Problem", "Solution & Architecture", "Role".
   These must be real headings: an earlier version inferred them from
   `p > strong:only-child`, but :only-child ignores text nodes, so any sentence
   containing a single bold phrase was reformatted as a label. */
.prose > h3 {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 28px 0 10px;
}

.prose > h3 { font-size: 12px; }

.prose p { margin: 12px 0; color: var(--muted); }

/* A paragraph that is only italic text, directly under a case-study heading, is
   the period/team line — render it as metadata rather than body copy. */
.prose > h2 + p > em:only-child {
  display: block;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-style: normal;
  letter-spacing: 0.02em;
  color: var(--faint);
  margin: -10px 0 6px;
}
.prose strong { color: var(--text); font-weight: 600; }
.prose em { color: var(--muted); }

.prose ul, .prose ol { padding-left: 22px; color: var(--muted); margin: 12px 0; }
.prose li { margin: 8px 0; }

.prose a { border-bottom: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.prose a:hover { text-decoration: none; border-bottom-color: var(--accent); }

.prose hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 40px 0;
  opacity: 0;
}

.prose blockquote {
  margin: 20px 0;
  padding: 14px 20px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 10px 10px 0;
  color: var(--muted);
}

.prose table {
  border-collapse: collapse;
  width: 100%;
  margin: 18px 0;
  font-size: 14.5px;
  display: block;
  overflow-x: auto;
}

.prose th, .prose td {
  border: 1px solid var(--border);
  padding: 10px 13px;
  text-align: left;
  white-space: nowrap;
}

.prose th { background: var(--accent-soft); font-weight: 600; color: var(--text); }
.prose td { color: var(--muted); }

.prose code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 6px;
  color: var(--text);
}

.prose pre {
  background: var(--code-bg);
  color: #e2e8f0;
  padding: 18px;
  border-radius: 12px;
  overflow-x: auto;
  font-size: 13px;
  border: 1px solid var(--border);
}

.prose pre code { background: none; border: 0; padding: 0; color: inherit; }

/* Architecture diagrams are base64 PNGs inlined in the Markdown. */
.prose img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 20px auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
  padding: 10px;
}

/* Long-form page header */
.page-header {
  padding: 56px 0 40px;
  background: radial-gradient(900px 380px at 15% -10%, var(--accent-soft), transparent 70%);
  border-bottom: 1px solid var(--border);
}

.page-title {
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0 0 12px;
}

.page-tagline {
  color: var(--muted);
  font-size: 17px;
  margin: 0;
  max-width: 62ch;
}

/* Sticky in-page contents rail */
.toc {
  max-width: var(--prose-measure);
  margin-inline: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  padding: 18px 22px;
  margin: 32px auto 0;
  max-width: 78ch;
}

.toc__heading {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 12px;
}

.toc ol {
  margin: 0;
  padding-left: 20px;
  columns: 2;
  column-gap: 28px;
}

.toc li { margin: 5px 0; font-size: 14.5px; }
.toc a { color: var(--muted); }
.toc a:hover { color: var(--accent); text-decoration: none; }

@media (max-width: 640px) {
  .toc ol { columns: 1; }
  .prose th, .prose td { white-space: normal; }
}

/* ==========================================================================
   Résumé (/resume/) — screen styles first, print rules at the end.
   Target: two A4 pages. Tuned via --resume-scale below.
   ========================================================================== */

.resume-bar {
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
  padding: 14px 0;
}

.resume-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.resume-bar p { margin: 0; font-size: 14px; color: var(--muted); }

.resume {
  max-width: var(--resume-measure);
  margin: 0 auto;
  padding: 44px 24px 64px;
  font-size: 14px;
  line-height: 1.5;
}

.resume__head { border-bottom: 2px solid var(--text); padding-bottom: 14px; }

.resume__name {
  font-size: 30px;
  letter-spacing: -0.025em;
  margin: 0 0 4px;
  line-height: 1.1;
}

.resume__title {
  margin: 0 0 10px;
  font-size: 14.5px;
  color: var(--muted);
  font-weight: 500;
}

.resume__contact {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.resume__contact a { color: var(--accent); }

.resume__section { margin-top: 22px; }

.resume__section > h2 {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 9px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--border);
}

.resume__summary { margin: 0; color: var(--muted); }

/* Fixed 2 columns rather than auto-fit: with four metrics, auto-fit resolves to
   three across and strands the fourth alone on a second row. */
.resume__metrics {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 26px;
}

@media (max-width: 520px) {
  .resume__metrics { grid-template-columns: 1fr; }
}

.resume__metrics li { color: var(--muted); font-size: 13.5px; }
.resume__metrics b { color: var(--text); font-size: 15px; margin-right: 4px; }

.resume__role { margin-bottom: 16px; }
.resume__role:last-child { margin-bottom: 0; }

.resume__role-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.resume__role-head h3 {
  margin: 0;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.resume__role-head h3 span { color: var(--accent); }

.resume__dates {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--faint);
  white-space: nowrap;
}

.resume__role ul,
.resume__compact {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.resume__role li,
.resume__compact li { margin: 4px 0; }

.resume strong, .resume b { color: var(--text); font-weight: 600; }

.resume__section--split {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 26px;
}

.resume__section--split > div > h2 {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 9px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--border);
}

.resume__inline { margin: 0; color: var(--muted); font-size: 13.5px; }

@media (max-width: 620px) {
  .resume__section--split { grid-template-columns: 1fr; }
  .resume__dates { white-space: normal; }
}

/* ------------------------------------------------------------------ print -- */

@page {
  size: A4;
  margin: 12mm 14mm;
}

@media print {
  /* Force the light palette — dark backgrounds waste ink and print grey. */
  :root, :root[data-theme="dark"] {
    --bg: #ffffff;
    --bg-subtle: #ffffff;
    --text: #000000;
    --muted: #1f2937;
    --faint: #4b5563;
    --border: #9ca3af;
    --accent: #1d4ed8;
    --card: #ffffff;
  }

  .nav, .footer, .resume-bar, .skip-link { display: none !important; }

  body { font-size: 10pt; line-height: 1.38; }

  .resume {
    max-width: none;
    margin: 0;
    padding: 0;
    font-size: 9.6pt;
    line-height: 1.38;
  }

  .resume__name { font-size: 19pt; }
  .resume__title { font-size: 10pt; margin-bottom: 6px; }
  .resume__contact { font-size: 8.4pt; gap: 2px 12px; }
  .resume__head { padding-bottom: 8px; }

  .resume__section { margin-top: 12px; }
  .resume__section > h2,
  .resume__section--split > div > h2 { font-size: 8.4pt; margin-bottom: 6px; padding-bottom: 3px; }

  .resume__metrics li { font-size: 9pt; }
  .resume__metrics b { font-size: 10pt; }

  .resume__role { margin-bottom: 10px; }
  .resume__role-head h3 { font-size: 10.5pt; }
  .resume__dates { font-size: 8.2pt; }
  .resume__role li, .resume__compact li { margin: 2.5px 0; }
  .resume__inline { font-size: 9pt; }

  /* Never split a role or a list item across a page break. */
  .resume__role, .resume__section--split { break-inside: avoid; }
  .resume__role-head { break-after: avoid; }
  li { break-inside: avoid; }
  h2 { break-after: avoid; }

  a { color: var(--accent); text-decoration: none; }
}

/* --------------------------------------------------------------- mermaid --- */

.mermaid-figure {
  margin: 22px 0 26px;
  padding: 20px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  overflow-x: auto;
  text-align: center;
}

.mermaid-figure svg { max-width: 100%; height: auto; }

/* Before the module runs, the raw fence would flash as code. */
.prose pre > code.language-mermaid { visibility: hidden; }

.mermaid-error {
  margin: 0;
  font-size: 14px;
  color: var(--faint);
}

@media print {
  .mermaid-figure { break-inside: avoid; border-color: #9ca3af; }
}

/* Subsection heading inside a section (e.g. "Outside work" under Foundations). */
.subsection { margin-top: 44px; }

.subsection__title {
  font-size: 20px;
  letter-spacing: -0.015em;
  line-height: 1.25;
  margin: 0 0 8px;
}

.callout__body {
  font-size: 16px;
  color: var(--muted);
  margin: 0 0 12px;
}

.callout__body:last-of-type { margin-bottom: 0; }
.callout__body strong { color: var(--text); font-weight: 600; }
.callout__actions { margin-top: 20px; }
.footer__line { margin: 0; }
