/* ===========================================================================
   jeeve.london — design system base
   See: docs/superpowers/specs/2026-05-14-jeeve-london-design.md
   =========================================================================== */

:root {
  /* Typography */
  --font-base: 16px;
  --font-scale: 1.333;
  --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", Consolas, Monaco, monospace;
  --line-height: 1.6;

  /* Grayscale palette (hex fallback then OKLCH) */
  --c00: #262626; --c00: oklch(0.15 0 0);
  --c06: #333333; --c06: oklch(0.20 0 0);
  --c18: #525252; --c18: oklch(0.35 0 0);
  --c24: #666666; --c24: oklch(0.42 0 0);
  --c36: #7a7a7a; --c36: oklch(0.52 0 0);
  --c48: #949494; --c48: oklch(0.62 0 0);
  --c60: #adadad; --c60: oklch(0.72 0 0);
  --c72: #c4c4c4; --c72: oklch(0.80 0 0);
  --c84: #dbdbdb; --c84: oklch(0.88 0 0);
  --c90: #e8e8e8; --c90: oklch(0.92 0 0);
  --c96: #f5f5f5; --c96: oklch(0.96 0 0);
  --c99: #fcfcfc; --c99: oklch(0.99 0 0);

  /* Accents */
  --blue: #5c8ab5;  --blue: oklch(0.55 0.10 230);
  --red:  #d93025;  --red:  oklch(0.55 0.22 27);

  /* Semantic */
  --color-text: var(--c00);
  --color-text-muted: var(--c24);
  --color-text-subtle: var(--c36);
  --color-bg: var(--c99);
  --color-border: var(--c84);
  --color-accent: var(--blue);
  --shadow-scroll: rgba(0, 0, 0, 0.12);

  /* Finance portfolio tokens (xTend chrome) */
  --color-link: #1d4f86;
  --color-link-hover: #12385f;
  --color-panel: #ffffff;
  --color-panel-muted: #f6f8fb;
  --color-table-header-text: #fcfcfc;
  --shadow-subtle: 0 12px 30px rgba(15, 23, 42, 0.08);

  /* Portfolio dashboard tokens */
  --portfolio-positive: #127a48;
  --portfolio-negative: #b42318;
  --portfolio-teal: #2d9c9c;
  --portfolio-purple: #7b61c9;
  --portfolio-chart-grid: #dfe5ee;
  --portfolio-focus-ring: #1f5fbf;
  --portfolio-selected-bg: #eef5ff;
  --portfolio-row-hover: #f8fafc;
  --portfolio-panel-radius: 0.5rem;

  /* Spacing scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* Layout */
  --panel-width: 240px;
  --panel-width-mobile: 280px;
  --content-padding: clamp(1rem, 4vw, 4rem);
  --content-max: 1100px;
  --cv-content-max: 960px;

  /* Landing page tokens sampled from the supplied hero movie */
  --landing-bg: #c8cfd6;
  --landing-text: #1f252a;
  --landing-muted: #3f464b;
  --landing-accent: #314e64;
  --landing-accent-hover: #233847;
  --landing-focus: #12385f;
  --landing-button-bg: #263542;
  --landing-button-text: #f8fafc;
  --landing-button-border: rgba(31, 37, 42, 0.18);
}

@media (max-width: 480px) {
  :root { --font-base: 15px; --font-scale: 1.25; }
}
@media (min-width: 1025px) {
  :root { --font-base: 17px; }
}

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

html {
  font-size: var(--font-base);
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: var(--line-height);
  color: var(--color-text);
  background: var(--color-bg);
  letter-spacing: -0.017em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--c00);
}
h2 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--c00);
}
h3 {
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--c00);
}
h4 { font-size: 1.125rem; font-weight: 500; color: var(--c06); }

p {
  font-size: 1rem;
  color: var(--color-text-muted);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s;
}
a:hover { color: var(--blue); }

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

.visually-hidden {
  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; top: -40px; left: var(--content-padding);
  padding: var(--space-sm) var(--space-md);
  background: var(--c00); color: var(--c99);
  font-size: 0.875rem; font-weight: 500; z-index: 100;
  opacity: 0; transition: top 0.2s, opacity 0.2s;
}
.skip-link:focus { top: var(--space-md); opacity: 1; }

/* ===========================================================================
   Landing page
   =========================================================================== */

.landing-page-body {
  min-height: 100vh;
  color: var(--landing-text);
  background: var(--landing-bg);
  letter-spacing: 0;
}

.landing-main {
  min-height: 100vh;
  padding: 64px var(--space-sm) var(--space-2xl);
}

.landing-hero {
  width: min(100%, 600px);
  margin: 0 auto;
}

.landing-hero-media {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--landing-bg);
  overflow: hidden;
}

.landing-hero-video {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: var(--landing-bg);
  pointer-events: none;
  user-select: none;
}

.landing-intro {
  width: min(100%, 600px);
  margin: clamp(1.25rem, 3vw, 2rem) auto 0;
  padding: 0 var(--space-md);
  text-align: center;
}

.landing-name {
  margin: 0 0 var(--space-xs);
  color: var(--landing-text);
  font-size: clamp(1.5rem, 4vw, 1.875rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
}

.landing-intro p {
  color: var(--landing-muted);
  font-size: 1rem;
  line-height: 1.65;
  letter-spacing: 0;
}

.landing-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.landing-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: var(--space-sm) var(--space-lg);
  border: 1px solid var(--landing-button-border);
  border-radius: 0.5rem;
  background: var(--landing-button-bg);
  color: var(--landing-button-text);
  font-size: 0.875rem;
  font-weight: 650;
  letter-spacing: 0;
  transition: background-color 0.15s ease, transform 0.15s ease, color 0.15s ease;
}

.landing-nav a:hover {
  background: var(--landing-accent-hover);
  color: var(--landing-button-text);
  transform: translateY(-1px);
}

.landing-nav a:focus-visible {
  outline-color: var(--landing-focus);
}

@media (min-width: 560px) {
  .landing-nav {
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
  }

  .landing-nav a {
    min-width: 8.5rem;
  }

  .landing-intro p {
    font-size: 1.0625rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .landing-nav a {
    transition: none;
  }

  .landing-nav a:hover {
    transform: none;
  }
}

/* ===========================================================================
   Layout shell
   =========================================================================== */

.layout {
  display: flex;
  min-height: 100vh;
}

.left-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--panel-width);
  height: 100vh;
  padding: var(--space-xl) var(--space-lg);
  border-right: 1px solid var(--color-border);
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  z-index: 10;
  overflow-y: auto;
}

.left-panel-title {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--c00);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-lg);
}

.left-panel-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.left-panel-footer {
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.left-panel-footer a {
  color: var(--c36);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}
.left-panel-footer a:hover { color: var(--c00); }
.left-panel-footer svg { width: 20px; height: 20px; }

.main-content {
  margin-left: var(--panel-width);
  flex: 1;
  min-width: 0;
  padding: var(--space-2xl) var(--content-padding) var(--space-4xl);
}

.main-content > .container {
  max-width: var(--content-max);
  margin: 0 auto;
}

body:has(.cv-masthead) .main-content > .container {
  max-width: var(--cv-content-max);
}

/* ===========================================================================
   CV gateway
   =========================================================================== */

.cv-gateway {
  min-height: min(40rem, calc(100vh - 8rem));
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.cv-gateway-inner {
  display: grid;
  gap: var(--space-lg);
  justify-items: center;
}
.cv-gateway-title {
  color: var(--c00);
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  font-weight: 600;
  line-height: 1.08;
}
.cv-gateway-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center;
}
.cv-gateway-button {
  display: inline-flex;
  min-width: 9rem;
  min-height: 2.5rem;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm) var(--space-lg);
  border: 1px solid var(--c00);
  border-radius: 0.4rem;
  color: var(--c00);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.cv-gateway-button:hover {
  border-color: var(--blue);
  color: var(--blue);
}
.cv-gateway-button-primary {
  background: var(--c00);
  color: var(--c99);
}
.cv-gateway-button-primary:hover {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--c99);
}

/* ===========================================================================
   CV page (mirrors the source PDF: name, contact line, dated section rows)
   =========================================================================== */

.cv-masthead {
  --cv-headshot-width: clamp(5.5rem, 9vw, 7rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--cv-headshot-width);
  align-items: start;
  gap: var(--space-md);
  padding-bottom: var(--space-lg);
  margin-bottom: var(--space-2xl);
  border-bottom: 1px solid var(--c00);
}
.cv-masthead-identity {
  display: grid;
  min-width: 0;
  align-content: start;
}
.cv-masthead-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: var(--space-xs);
}
.cv-name {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--c00);
}
.cv-contact {
  font-size: 0.9375rem;
  color: var(--c18);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}
.cv-contact a {
  color: var(--c18);
  text-decoration: underline;
  text-decoration-color: var(--c84);
  text-underline-offset: 3px;
}
.cv-contact a:hover { color: var(--blue); text-decoration-color: var(--blue); }
.cv-contact-sep { color: var(--c60); }
.cv-summary {
  max-width: 42rem;
  margin: 0;
  color: var(--c18);
  font-size: 0.9375rem;
  line-height: 1.55;
}
.cv-masthead-controls {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-xs);
}
.cv-headshot {
  width: var(--cv-headshot-width);
  aspect-ratio: 4 / 5;
  box-sizing: border-box;
  justify-self: end;
  margin: 0;
  padding: 0.18rem;
  overflow: hidden;
  border: 1px solid var(--c72);
  border-radius: 0.25rem;
  background: var(--c99);
}
.cv-headshot img {
  display: block;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  height: 100%;
  border: 1px solid var(--c84);
  border-radius: 0.18rem;
  object-fit: cover;
  object-position: center top;
}

.pdf-button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-md);
  min-height: 2.25rem;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--c00);
  color: var(--c99);
  border: 2px solid var(--c00);
  border-radius: 0.4rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.pdf-button:hover { background: var(--c99); color: var(--c00); }
.pdf-button svg { width: 1em; height: 1em; }

.cv-section { margin-bottom: 3.25rem; }
.cv-section-title {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c00);
  padding-bottom: var(--space-xs);
  margin-bottom: var(--space-lg);
  border-bottom: 1px solid var(--c84);
}

.cv-subsection {
  margin-bottom: var(--space-xl);
}
.cv-subsection:last-child { margin-bottom: 0; }
.cv-subsection-title {
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c18);
  margin-bottom: var(--space-md);
}

.cv-entry {
  margin-bottom: 1.7rem;
  page-break-inside: avoid;
}
.cv-entry:last-child { margin-bottom: 0; }
.cv-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-md);
  flex-wrap: wrap;
}
.cv-entry-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--c00);
  line-height: 1.3;
}
.cv-entry-title-inline {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  column-gap: var(--space-sm);
  row-gap: 0.15rem;
}
.cv-entry-company,
.cv-entry-inline-role {
  min-width: 0;
}
.cv-entry-title-separator {
  flex: 0 0 1px;
  width: 1px;
  height: 0.9em;
  background: var(--c72);
}
.cv-entry-inline-role {
  color: var(--c18);
  font-size: 0.9375rem;
  font-style: italic;
  font-weight: 400;
}
.cv-entry-dates {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--c00);
  white-space: nowrap;
}
.cv-entry-summary {
  margin: 0.35rem 0 0.3rem;
  color: var(--c18);
  font-size: 0.9375rem;
  line-height: 1.58;
}
.cv-entry-subheader {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-top: 0.15rem;
  margin-bottom: var(--space-xs);
}
.cv-entry-role,
.cv-entry-location {
  font-size: 0.9375rem;
  font-style: italic;
  color: var(--c18);
}
.cv-entry-location { text-align: right; }

.cv-module-heading {
  margin: var(--space-xs) 0 0;
  color: var(--c24);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

ul.project-tech-list.cv-module-list {
  gap: 0.3rem;
  margin: 0.35rem 0 var(--space-md);
}

ul.project-tech-list.cv-module-list > li.project-tech-tag {
  min-height: 1.35rem;
  padding: 0.08rem 0.38rem;
  border-radius: 0.32rem;
  font-size: 0.6875rem;
}

.cv-bullets {
  list-style: none;
  padding: 0;
  margin: 0.35rem 0 0;
}
.cv-bullets li {
  position: relative;
  padding-left: 1.1rem;
  margin-bottom: 0.28rem;
  font-size: 0.9375rem;
  line-height: 1.62;
  color: var(--c06);
}
.cv-bullets li::before {
  content: "•";
  position: absolute;
  left: 0.15rem;
  top: 0;
  color: var(--c24);
  font-weight: 700;
}

.cv-extras {
  list-style: none;
  padding: 0;
  margin: 0;
}
.cv-extra {
  position: relative;
  padding-left: 1.1rem;
  margin-bottom: 0.45rem;
  font-size: 0.9375rem;
  line-height: 1.62;
  color: var(--c06);
}
.cv-extra::before {
  content: "•";
  position: absolute;
  left: 0.15rem;
  top: 0;
  color: var(--c24);
  font-weight: 700;
}
.cv-extra-label { font-weight: 700; color: var(--c00); }

.page-footer {
  border-top: 1px solid var(--c84);
  padding: var(--space-md) 0;
  margin-top: var(--space-2xl);
  font-size: 0.8125rem;
  color: var(--c36);
}

.nav-item {
  display: block;
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.875rem;
  color: var(--c18);
  border-left: 3px solid transparent;
  margin-left: -3px;
  transition: color 0.15s, border-color 0.15s;
}
.nav-item:hover { color: var(--c00); }
.nav-item.is-active { color: var(--c00); border-left-color: var(--c00); }

.nav-projects,
.nav-spreadsheets { margin-bottom: var(--space-xs); }
.nav-projects-summary,
.nav-spreadsheets-summary {
  width: 100%;
  padding-right: var(--space-xl);
  cursor: pointer;
  list-style: none;
  position: relative;
  user-select: none;
}
.nav-projects summary::-webkit-details-marker,
.nav-spreadsheets summary::-webkit-details-marker { display: none; }
.nav-projects summary::after,
.nav-spreadsheets summary::after {
  content: "▸";
  position: absolute;
  right: var(--space-sm);
  top: 50%;
  font-size: 1.05rem;
  line-height: 1;
  font-weight: 700;
  color: var(--c36);
  transition: transform 0.15s;
  transform: translateY(-50%);
}
.nav-projects[open] summary::after,
.nav-spreadsheets[open] summary::after { transform: translateY(-50%) rotate(90deg); }
.nav-sublist {
  list-style: none;
  padding-left: var(--space-md);
  margin-top: var(--space-xs);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-projects:not([open]) .nav-sublist,
.nav-spreadsheets:not([open]) .nav-sublist { display: none; }
.nav-sublist-label {
  display: block;
  font-size: 0.75rem;
  padding: 2px var(--space-sm);
  color: var(--c48);
}
.nav-sublist a {
  display: block;
  font-size: 0.8125rem;
  padding: 2px var(--space-sm);
  color: var(--c36);
  border-left: 3px solid transparent;
  margin-left: -3px;
}
.nav-sublist a:hover { color: var(--c00); }
.nav-sublist a.is-active { color: var(--c00); border-left-color: var(--c00); }

.page-heading {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0;
  margin-bottom: var(--space-md);
}

.tag-filter {
  display: flex;
  gap: var(--space-md);
  font-size: 0.875rem;
  color: var(--c36);
  margin-bottom: var(--space-lg);
}
.tag-filter a {
  color: var(--c36);
  padding: var(--space-xs) 0;
  border-bottom: 1px solid transparent;
}
.tag-filter a.is-active {
  color: var(--c00);
  border-bottom-color: var(--c00);
}
.tag-filter a:hover { color: var(--c00); }

.entry-list {
  list-style: none;
  border-top: 1px solid var(--c84);
}
.entry-list li {
  border-bottom: 1px solid var(--c84);
}
.entry-list a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: var(--space-md) var(--space-md);
  gap: var(--space-md);
  transition: background 0.15s, color 0.15s;
}
.entry-list a:hover {
  background: #ffffff;
  color: var(--blue);
}
.entry-list .entry-title { font-size: 0.9375rem; font-weight: 500; }
.entry-list .entry-meta { font-size: 0.8125rem; color: var(--c36); white-space: nowrap; }
.entry-list .entry-arrow {
  margin-left: var(--space-sm);
  opacity: 0;
  transition: opacity 0.15s;
}
.entry-list a:hover .entry-arrow { opacity: 1; }

.projects-index {
  display: grid;
  gap: var(--space-xl);
}

.projects-index-header {
  display: grid;
  gap: var(--space-sm);
  padding-bottom: var(--space-md);
}

.projects-index-list {
  display: grid;
  gap: var(--space-md);
}

.projects-index-lead {
  max-width: 42rem;
  color: var(--color-text-muted);
  font-size: 1.0625rem;
  line-height: 1.55;
}

.projects-index .page-heading {
  font-size: clamp(2.75rem, 5vw, 4rem);
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.025em;
}

.projects-index-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(10rem, auto);
  gap: var(--space-xl);
  align-items: center;
  padding: var(--space-lg);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  background: var(--color-panel);
}

.projects-index-title-block {
  display: grid;
  gap: var(--space-sm);
  min-width: 0;
}

.projects-index-heading-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.75rem;
}

.projects-index-title {
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.15;
}

.projects-index-year {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--color-text-subtle);
  font-size: 0.95rem;
  white-space: nowrap;
}

.projects-index-year::before {
  width: 1px;
  height: 1.35rem;
  background: var(--color-border);
  content: "";
}

.projects-index-summary {
  color: var(--color-text-muted);
  font-size: 1rem;
  line-height: 1.6;
  max-width: 42rem;
}

.projects-index-row .project-tech-list {
  margin: 0;
}

.projects-index-actions {
  display: grid;
  gap: var(--space-sm);
  justify-items: end;
  min-width: 9rem;
}

.projects-index-actions a {
  display: inline-flex;
  min-height: 2rem;
  align-items: center;
  gap: var(--space-xs);
  color: var(--color-link);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
}

.projects-index-actions a:hover,
.projects-index-actions a:focus-visible {
  color: var(--color-link-hover);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.projects-index-launch {
  color: var(--color-text-muted) !important;
  font-weight: 500 !important;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.875rem;
  color: var(--c36);
  margin-bottom: var(--space-lg);
}
.back-link:hover { color: var(--c00); }

.post-title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 500;
  margin-bottom: var(--space-sm);
}
.post-meta {
  font-size: 0.875rem;
  color: var(--c36);
  margin-bottom: var(--space-md);
}
.post-divider {
  border: 0;
  border-top: 1px solid var(--c84);
  margin: var(--space-md) 0 var(--space-2xl);
}
.post-body {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--c18);
  max-width: 38rem;
}
.post-body p { margin-bottom: var(--space-md); color: var(--c18); font-size: inherit; }
.post-body ul,
.post-body ol {
  margin: 0 0 var(--space-md) 1.25rem;
  padding-left: var(--space-md);
}
.post-body li {
  margin-bottom: var(--space-sm);
  color: var(--c18);
}
.post-body h2, .post-body h3 { margin: var(--space-xl) 0 var(--space-sm); }
.post-body a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.post-body code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--c96);
  padding: 0.125rem 0.375rem;
  border-radius: 2px;
}
.post-body pre {
  background: var(--c96);
  padding: var(--space-md);
  border-radius: 4px;
  overflow-x: auto;
  margin-bottom: var(--space-md);
}
.post-body pre code { background: none; padding: 0; }

.project-page {
  display: grid;
  gap: var(--space-xl);
}

.project-hero {
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
}

.project-hero-main {
  max-width: 48rem;
}

.project-hero .post-title {
  font-size: clamp(2.25rem, 4.5vw, 4rem);
  line-height: 1;
  margin-bottom: var(--space-sm);
}

.project-hero .post-meta {
  font-size: 1.35rem;
  margin-bottom: var(--space-sm);
}

.project-hero-actions {
  margin: var(--space-md) 0 0;
}

.project-overview {
  grid-column: 1;
  max-width: 48rem;
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
}

.project-overview h2,
.project-article > h2,
.project-detail-sidebar h2 {
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-sm);
}

.project-overview .project-tagline {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 1.0625rem;
  font-style: normal;
  line-height: 1.65;
}

.project-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 20rem);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.project-article {
  grid-column: 1;
  min-width: 0;
}

.project-article .post-body {
  max-width: 44rem;
}

.project-detail-intro {
  color: var(--color-text-muted) !important;
}

.project-detail-sidebar {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: grid;
  gap: var(--space-xl);
  min-width: 0;
  padding-left: var(--space-xl);
  border-left: 1px solid var(--color-border);
}

.project-sidebar-section {
  display: grid;
  gap: var(--space-sm);
}

.project-detail-sidebar .project-tech-list {
  margin: 0;
}

.project-sidebar-facts {
  display: grid;
  gap: var(--space-md);
}

.project-sidebar-facts div {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr);
  gap: var(--space-md);
  align-items: baseline;
}

.project-sidebar-label {
  color: var(--color-text-subtle);
  font-size: 0.875rem;
}

.project-sidebar-value {
  color: var(--color-text);
  font-size: 0.95rem;
}

@media (max-width: 768px) {
  .projects-index-row {
    grid-template-columns: 1fr;
    gap: var(--space-md);
    padding: var(--space-md);
  }

  .projects-index-actions {
    justify-items: start;
  }

  .projects-index-year::before {
    height: 1rem;
  }

  .project-main-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .project-overview,
  .project-article,
  .project-detail-sidebar {
    grid-column: 1;
    grid-row: auto;
  }

  .project-detail-sidebar {
    order: 2;
    padding: var(--space-lg) 0 0;
    border-top: 0;
    border-left: 0;
  }

  .project-overview {
    order: 1;
  }

  .project-article {
    order: 3;
  }

  .project-hero .post-title {
    font-size: clamp(2rem, 12vw, 3.1rem);
  }

  .project-hero .post-meta {
    font-size: 1.125rem;
  }
}

/* ===========================================================================
   xTend employer-facing chrome (case-study layer above the source archive)
   =========================================================================== */

.xtend-case-page {
  display: grid;
  gap: var(--space-xl);
}

.xtend-case-page,
.xtend-case-page > *,
.xtend-workbook-page,
.xtend-documents-page,
.xtend-overview-page,
.xtend-workbook-block,
.xtend-sheet,
.xtend-sheet-scroll {
  min-width: 0;
}

.xtend-case-page,
.xtend-case-page h1,
.xtend-case-page h2,
.xtend-case-page h3,
.xtend-case-page p,
.xtend-case-page a,
.xtend-case-page button {
  letter-spacing: 0;
}

.xtend-case-page a {
  color: var(--color-link);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.xtend-case-page a:hover,
.xtend-case-page a:focus-visible {
  color: var(--color-link-hover);
}

.xtend-overview-brief,
.xtend-start-card,
.xtend-model-row {
  border: 1px solid var(--color-border);
  background: var(--color-panel);
}

.xtend-workbook-header {
  border: 1px solid var(--color-border);
  background: var(--color-panel);
}

.xtend-overview-brief,
.xtend-start-card {
  padding: clamp(1rem, 2vw, 1.75rem);
  display: grid;
  gap: var(--space-sm);
}

.xtend-start-card {
  grid-template-columns: minmax(0, 1.4fr) minmax(16rem, 0.9fr);
  align-items: start;
}

.xtend-workbook-header {
  padding: clamp(1.25rem, 2.5vw, 2.25rem);
  display: grid;
  gap: var(--space-sm);
}

.xtend-page-kicker,
.xtend-section-kicker,
.xtend-card-kicker {
  margin: 0 0 var(--space-xs);
  color: var(--color-link);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

.xtend-reader-note {
  max-width: 68ch;
  color: var(--color-text-muted);
  font-size: 1rem;
  line-height: 1.55;
}

.xtend-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.xtend-breadcrumb a {
  color: var(--color-link);
}

.xtend-metric-strip {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-xs);
}

.xtend-metric-pill {
  border: 1px solid var(--color-border);
  background: var(--color-panel-muted);
  padding: var(--space-sm);
  display: grid;
  gap: 2px;
}

.xtend-metric-pill strong {
  color: var(--color-text);
  font-size: 1.15rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.xtend-metric-pill span {
  color: var(--color-text-muted);
  font-size: 0.82rem;
}

.xtend-hero-actions,
.xtend-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
}

.xtend-primary-action,
.xtend-secondary-action,
.xtend-action-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0 var(--space-md);
  border: 1px solid var(--color-border);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.xtend-primary-action {
  background: var(--color-link);
  color: #ffffff;
  border-color: var(--color-link);
}

.xtend-primary-action:hover,
.xtend-primary-action:focus-visible {
  background: var(--color-link-hover);
  border-color: var(--color-link-hover);
  color: #ffffff;
}

.xtend-secondary-action,
.xtend-action-link {
  background: var(--color-panel);
  color: var(--color-text);
}

.xtend-secondary-action:hover,
.xtend-secondary-action:focus-visible,
.xtend-action-link:hover,
.xtend-action-link:focus-visible {
  background: var(--color-panel-muted);
  border-color: var(--color-text);
  color: var(--color-text);
}

.xtend-case-page .xtend-primary-action,
.xtend-case-page .xtend-primary-action:visited {
  background: var(--color-link);
  border-color: var(--color-link);
  color: #ffffff;
  text-decoration: none;
}

.xtend-case-page .xtend-primary-action:hover,
.xtend-case-page .xtend-primary-action:focus-visible {
  background: var(--color-link-hover);
  border-color: var(--color-link-hover);
  color: #ffffff;
  text-decoration: none;
}

.xtend-case-page .xtend-secondary-action,
.xtend-case-page .xtend-secondary-action:visited,
.xtend-case-page .xtend-action-link,
.xtend-case-page .xtend-action-link:visited {
  background: var(--color-panel);
  color: var(--color-text);
  text-decoration: none;
}

.xtend-case-page .xtend-secondary-action:hover,
.xtend-case-page .xtend-secondary-action:focus-visible,
.xtend-case-page .xtend-action-link:hover,
.xtend-case-page .xtend-action-link:focus-visible {
  background: var(--color-panel-muted);
  border-color: var(--color-text);
  color: var(--color-text);
  text-decoration: none;
}

.xtend-case-page .xtend-primary-action,
.xtend-case-page .xtend-secondary-action,
.xtend-case-page .xtend-action-link {
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.xtend-case-page .xtend-primary-action:focus-visible,
.xtend-case-page .xtend-secondary-action:focus-visible,
.xtend-case-page .xtend-action-link:focus-visible,
.xtend-case-page .xtend-sheet-anchor-strip a:focus-visible,
.xtend-case-page .xtend-document-anchors a:focus-visible {
  outline: 3px solid rgba(15, 23, 42, 0.35);
  outline-offset: 3px;
}

.xtend-overview-register {
  display: grid;
  gap: var(--space-md);
}

.xtend-workbook-index {
  display: grid;
  gap: var(--space-md);
}

.xtend-workbook-index-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: var(--space-md);
  padding: 0;
  margin: 0;
  list-style: none;
}

.xtend-workbook-card {
  min-width: 0;
  display: grid;
  align-content: space-between;
  gap: var(--space-md);
  padding: var(--space-md);
  border: 1px solid var(--color-border);
  background: var(--color-panel);
}

.xtend-workbook-card h2 {
  font-size: 1.05rem;
  line-height: 1.25;
}

.xtend-workbook-card p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.xtend-landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.xtend-case-page .xtend-button-link,
.xtend-case-page .xtend-button-link:visited {
  min-height: 44px;
  width: fit-content;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--space-md);
  border: 1px solid var(--color-text);
  background: var(--color-text);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.xtend-case-page .xtend-button-link:hover,
.xtend-case-page .xtend-button-link:focus-visible {
  background: var(--color-link-hover);
  border-color: var(--color-link-hover);
  color: #ffffff;
  text-decoration: none;
}

.xtend-case-page .xtend-button-link:focus-visible {
  outline: 3px solid rgba(15, 23, 42, 0.35);
  outline-offset: 3px;
}

.xtend-case-page .xtend-button-link-secondary,
.xtend-case-page .xtend-button-link-secondary:visited {
  background: var(--color-panel);
  border-color: var(--color-border);
  color: var(--color-text);
}

.xtend-case-page .xtend-button-link-secondary:hover,
.xtend-case-page .xtend-button-link-secondary:focus-visible {
  background: var(--color-panel-muted);
  border-color: var(--color-text);
  color: var(--color-text);
}

.xtend-section-heading {
  display: grid;
  gap: var(--space-xs);
}

.xtend-section-heading p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.xtend-model-list {
  display: grid;
  gap: var(--space-sm);
}

.xtend-model-row {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(14rem, 0.65fr);
  gap: var(--space-md);
  padding: var(--space-md);
}

.xtend-model-row h3 {
  font-size: 1.08rem;
  line-height: 1.25;
}

.xtend-model-row h3 a {
  color: var(--color-text);
  text-decoration: none;
}

.xtend-model-row h3 a:hover,
.xtend-model-row h3 a:focus-visible {
  color: var(--color-link);
  text-decoration: underline;
}

.xtend-model-row-main,
.xtend-model-row-side {
  min-width: 0;
}

.xtend-model-row-main p,
.xtend-model-row-side p {
  color: var(--color-text-muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.xtend-executive-read {
  border: 1px solid var(--color-border);
  background: var(--color-panel-muted);
  padding: clamp(1rem, 2vw, 1.5rem);
  display: grid;
  gap: var(--space-md);
  min-width: 0;
}

.xtend-executive-copy h2 {
  max-width: 62ch;
  color: var(--color-text);
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  line-height: 1.35;
}

.xtend-executive-points {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-md);
}

.xtend-executive-points dt {
  color: var(--color-text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.xtend-executive-points dd {
  color: var(--color-text);
  font-size: 0.94rem;
  line-height: 1.45;
}

.xtend-document-anchors {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin: var(--space-md) 0;
  max-width: 100%;
  min-width: 0;
}

.xtend-document-anchors a {
  min-height: 44px;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  white-space: normal;
  overflow-wrap: anywhere;
  padding: 0 var(--space-sm);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  color: var(--color-link);
  font-size: 0.85rem;
  text-decoration: none;
}

.xtend-document-anchors a:hover,
.xtend-document-anchors a:focus-visible {
  color: var(--color-link-hover);
  border-color: var(--color-link);
}

.xtend-table-scroll {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  margin: var(--space-md) 0;
}

.xtend-document-table {
  width: max-content;
  min-width: 100%;
  border: 1px solid var(--color-border);
  border-collapse: collapse;
  background: var(--color-panel);
}

.xtend-document-table th,
.xtend-document-table td {
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--color-border);
  vertical-align: top;
  text-align: left;
  font-size: 0.9rem;
  line-height: 1.45;
}

.xtend-document-table th {
  background: var(--color-panel-muted);
  font-weight: 700;
}

.xtend-document-block {
  margin-top: var(--space-xl);
  padding-top: var(--space-md);
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
}

.xtend-document-header {
  display: grid;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
}

.xtend-document-header h2 {
  font-size: 1.5rem;
  line-height: 1.2;
}

.xtend-sheet-source {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin: 0 0 var(--space-sm);
}

.xtend-sheet-source code {
  background: var(--color-panel-muted);
  padding: 0 var(--space-xs);
  border-radius: 3px;
}

.xtend-scroll-hint {
  margin: 0 0 var(--space-xs);
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.xtend-cell-dark-fill {
  color: var(--color-table-header-text);
}

.xtend-workbook-block {
  margin-top: var(--space-xl);
  max-width: 100%;
  min-width: 0;
}

.xtend-workbook-profile {
  margin: var(--space-xl) 0;
  padding: clamp(1.25rem, 2.5vw, 2rem);
  border: 1px solid var(--color-border);
  background: var(--color-panel);
}

.xtend-workbook-profile .post-title {
  max-width: 18ch;
  font-size: clamp(1.65rem, 3vw, 2.25rem);
}

.xtend-workbook-profile .post-meta {
  color: var(--color-text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

.xtend-workbook-profile .project-tagline {
  max-width: 46rem;
  color: var(--color-text);
  font-style: normal;
}

.xtend-workbook-profile .project-tech-list {
  margin-bottom: var(--space-lg);
}

.xtend-workbook-profile .launch-panel {
  margin: var(--space-lg) 0;
}

.xtend-workbook-profile .xtend-open-spreadsheet {
  min-height: 44px;
  color: var(--c99);
  letter-spacing: 0;
  text-decoration: none;
  text-transform: none;
}

.xtend-workbook-profile .xtend-open-spreadsheet:hover,
.xtend-workbook-profile .xtend-open-spreadsheet:focus-visible {
  color: var(--c00);
  text-decoration: none;
}

.xtend-workbook-profile .post-divider {
  margin: var(--space-md) 0 var(--space-lg);
}

.xtend-workbook-profile .post-body {
  max-width: 46rem;
}

.xtend-workbook-profile .post-body p + p {
  margin-top: var(--space-md);
}

.xtend-source-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  min-width: 0;
  padding: var(--space-sm) 0;
  border-top: 1px solid var(--c84);
  border-bottom: 1px solid var(--c84);
  color: var(--c18);
  font-size: 0.875rem;
}

.xtend-source-strip a {
  color: var(--color-link);
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.xtend-case-page .xtend-source-strip a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 var(--space-sm);
  border: 1px solid var(--color-border);
  background: var(--color-panel);
  color: var(--color-text);
  font-weight: 600;
  text-decoration: none;
}

.xtend-source-strip a:hover,
.xtend-source-strip a:focus-visible {
  color: var(--color-link-hover);
}

.xtend-case-page .xtend-source-strip a:hover,
.xtend-case-page .xtend-source-strip a:focus-visible {
  border-color: var(--color-text);
  background: var(--color-panel-muted);
  color: var(--color-text);
  text-decoration: none;
}

.xtend-sheet-anchor-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin: var(--space-md) 0 var(--space-lg);
}

.xtend-sheet-anchor-strip a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--c84);
  border-radius: 4px;
  color: var(--color-link);
  font-size: 0.8125rem;
  line-height: 1.3;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.xtend-case-page .xtend-sheet-anchor-strip a {
  background: var(--color-panel);
  color: var(--color-text);
  font-weight: 600;
  text-decoration: none;
}

.xtend-sheet-anchor-strip a:hover,
.xtend-sheet-anchor-strip a:focus-visible {
  color: var(--c00);
  border-color: var(--blue);
  background: var(--c99);
}

.xtend-case-page .xtend-sheet-anchor-strip a:hover,
.xtend-case-page .xtend-sheet-anchor-strip a:focus-visible {
  border-color: var(--color-text);
  background: var(--color-panel-muted);
  color: var(--color-text);
  text-decoration: none;
}

.xtend-sheet {
  margin-top: var(--space-xl);
  max-width: 100%;
  min-width: 0;
}

.xtend-sheet-scroll {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  background:
    linear-gradient(to right, var(--c99) 30%, transparent),
    linear-gradient(to right, transparent, var(--c99) 70%) 100% 0,
    linear-gradient(to right, var(--shadow-scroll), transparent),
    linear-gradient(to left, var(--shadow-scroll), transparent) 100% 0;
  background-repeat: no-repeat;
  background-size: 2rem 100%, 2rem 100%, 1rem 100%, 1rem 100%;
  background-attachment: local, local, scroll, scroll;
}

.xtend-grid {
  width: max-content;
  min-width: 100%;
  border: 1px solid var(--c84);
  border-collapse: separate;
  border-spacing: 0;
}

.xtend-grid caption {
  text-align: left;
  padding: 0 0 var(--space-sm);
  color: var(--c36);
  font-size: 0.8125rem;
}

.xtend-cell {
  padding: var(--space-xs) var(--space-sm);
  vertical-align: top;
  background: var(--c99);
}

.xtend-cell-number {
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.xtend-cell-text { text-align: left; }

.xtend-row-odd .xtend-cell {
  background: var(--c96);
}

.xtend-sheet thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--c96);
  border-bottom: 1px solid var(--c84);
}

.xtend-sheet td:first-child,
.xtend-sheet th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
}

.xtend-sheet thead th:first-child { z-index: 3; }

.xtend-formula-indicator {
  margin-left: var(--space-xs);
  color: var(--c48);
  font-family: var(--font-mono);
}

.xtend-case-page h1,
.xtend-case-page h2,
.xtend-case-page h3,
.xtend-case-page p,
.xtend-case-page dd,
.xtend-case-page li {
  overflow-wrap: anywhere;
}

.xtend-case-page h1 {
  max-width: 18ch;
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  line-height: 1.05;
}

.xtend-workbook-header h1 {
  max-width: 20ch;
}

@media (max-width: 48rem) {
  .xtend-metric-strip,
  .xtend-executive-points {
    grid-template-columns: 1fr;
  }

  .xtend-case-page {
    gap: var(--space-md);
  }

  .xtend-model-row {
    grid-template-columns: 1fr;
  }

  .xtend-overview-page {
    gap: var(--space-md);
  }

  .xtend-start-card {
    grid-template-columns: minmax(0, 1.15fr) minmax(7.5rem, 0.85fr);
  }

  .xtend-start-card .xtend-metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .xtend-overview-brief,
  .xtend-start-card,
  .xtend-model-row,
  .xtend-workbook-header,
  .xtend-executive-read {
    padding: var(--space-md);
  }

  .xtend-case-page h1 {
    font-size: 2rem;
    line-height: 1.08;
  }

  .xtend-reader-note {
    font-size: 0.95rem;
    line-height: 1.5;
  }

  .xtend-hero-actions,
  .xtend-card-actions {
    align-items: stretch;
  }

  .xtend-hero-actions > a,
  .xtend-card-actions > a {
    justify-content: center;
  }

  .xtend-overview-page .xtend-overview-brief,
  .xtend-overview-page .xtend-start-card,
  .xtend-overview-page .xtend-model-row {
    padding: var(--space-sm);
  }

  .xtend-workbook-index-list {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
  }

  .xtend-workbook-card {
    padding: var(--space-sm);
    gap: var(--space-sm);
  }

  .xtend-case-page .xtend-button-link {
    width: 100%;
  }

  .xtend-overview-brief h1 {
    font-size: clamp(1.55rem, 8vw, 2rem);
  }

  .xtend-overview-brief .xtend-reader-note {
    font-size: 0.92rem;
    line-height: 1.45;
  }

  .xtend-overview-page .xtend-hero-actions {
    gap: var(--space-xs);
  }

  .xtend-overview-page .xtend-primary-action,
  .xtend-overview-page .xtend-secondary-action {
    padding: 0 var(--space-sm);
    font-size: 0.84rem;
  }

  .xtend-start-card h2 {
    font-size: 1.25rem;
    line-height: 1.15;
  }

  .xtend-start-card > div > p:not(.xtend-section-kicker) {
    font-size: 0.88rem;
    line-height: 1.4;
  }

  .xtend-metric-pill {
    padding: var(--space-xs);
  }

  .xtend-metric-pill strong {
    font-size: 1rem;
  }

  .xtend-metric-pill span {
    font-size: 0.72rem;
    line-height: 1.2;
  }

  .xtend-overview-register {
    gap: var(--space-xs);
  }

  .xtend-overview-page .xtend-section-heading {
    gap: 0;
  }

  .xtend-sheet-anchor-strip,
  .xtend-document-anchors {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: var(--space-xs);
  }

  .xtend-sheet-anchor-strip a,
  .xtend-document-anchors a {
    flex: 0 0 auto;
  }
}

@media (max-width: 23.5rem) {
  .xtend-case-page h1 {
    font-size: 1.8rem;
  }

  .xtend-metric-strip {
    grid-template-columns: 1fr;
  }

  .xtend-start-card .xtend-metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ===========================================================================
   Mobile layout
   =========================================================================== */

.mobile-toggle {
  display: none;
  position: fixed;
  bottom: var(--space-md);
  right: var(--space-md);
  width: 44px;
  height: 44px;
  background: var(--c99);
  border: 1px solid var(--c84);
  border-radius: 0.25rem;
  color: var(--c00);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.mobile-toggle svg { width: 20px; height: 20px; }

@media (max-width: 768px) {
  .landing-nav a {
    width: 100%;
  }

  .left-panel {
    transform: translateX(-100%);
    width: var(--panel-width-mobile);
    transition: transform 0.25s ease;
    z-index: 200;
  }
  body.is-panel-open .left-panel { transform: translateX(0); }
  body.is-panel-open::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 150;
  }
  .main-content { margin-left: 0; }
  .mobile-toggle { display: inline-flex; }

  body:has(.cv-masthead) .main-content {
    padding: calc(var(--space-xl) + 3rem) clamp(0.95rem, 4vw, 1.25rem) var(--space-2xl);
  }

  body:has(.cv-masthead) .mobile-toggle {
    top: var(--space-md);
    bottom: auto;
  }

  .cv-masthead {
    --cv-headshot-width: clamp(4.5rem, 18vw, 5.5rem);
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-md);
  }

  .cv-name {
    font-size: clamp(2rem, 10vw, 2.6rem);
    line-height: 1;
  }

  .cv-contact {
    gap: 0.2rem 0.4rem;
    line-height: 1.45;
  }

  .cv-masthead-controls {
    margin-top: var(--space-xs);
  }

  .cv-section {
    margin-bottom: 2.75rem;
  }

  .cv-section-title {
    margin-bottom: 1.15rem;
  }

  .cv-subsection {
    margin-bottom: 2rem;
  }

  .cv-subsection-title {
    margin-bottom: 0.9rem;
  }

  .cv-entry {
    display: grid;
    margin-bottom: 1.9rem;
  }

  .cv-entry-header {
    display: contents;
  }

  .cv-entry-title {
    order: 1;
    line-height: 1.35;
  }

  .cv-entry-summary {
    order: 4;
    margin: 0.35rem 0 0.25rem;
    line-height: 1.6;
  }

  .cv-entry-dates {
    order: 2;
    margin-top: 0.1rem;
    color: var(--c18);
    font-size: 0.85rem;
    line-height: 1.35;
    white-space: normal;
  }

  .cv-entry-subheader {
    order: 3;
    align-items: flex-start;
    flex-direction: column;
    gap: 0.1rem;
    margin-top: 0.1rem;
    margin-bottom: 0;
  }

  .cv-entry-location {
    text-align: left;
  }

  .cv-module-heading {
    order: 5;
  }

  .cv-module-list {
    order: 6;
  }

  .cv-bullets {
    order: 5;
    margin-top: 0.25rem;
  }

  .cv-bullets li,
  .cv-extra {
    padding-left: 1rem;
    margin-bottom: 0.36rem;
    line-height: 1.62;
  }
}

/* ===========================================================================
   Portfolio dashboard
   =========================================================================== */

.main-content > .container:has(.portfolio-page) {
  max-width: 1280px;
}

.main-content:has(.portfolio-page) {
  padding: var(--space-lg) var(--space-lg) var(--space-2xl);
}

.portfolio-page,
.portfolio-page *,
.portfolio-page h1,
.portfolio-page h2,
.portfolio-page h3,
.portfolio-page p,
.portfolio-page button {
  letter-spacing: 0;
}

.portfolio-page {
  display: grid;
  gap: var(--space-md);
  min-width: 0;
}

.portfolio-header {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
  align-items: end;
}

.portfolio-header h1 {
  font-size: clamp(2rem, 3vw, 2.55rem);
  font-weight: 600;
  line-height: 1.05;
}

.portfolio-header p,
.portfolio-note {
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.portfolio-section {
  display: grid;
  gap: var(--space-sm);
  min-width: 0;
}

.portfolio-section-title {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--c00);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: var(--space-xs);
}

.portfolio-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-sm);
}

.portfolio-kpi,
.portfolio-chart-panel,
.portfolio-holdings-panel,
.portfolio-options-panel {
  border: 1px solid var(--color-border);
  border-radius: var(--portfolio-panel-radius);
  background: var(--color-panel);
}

.portfolio-kpi {
  display: grid;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  min-width: 0;
}

.portfolio-kpi p,
.portfolio-kpi span {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.portfolio-kpi strong {
  font-size: clamp(1.2rem, 2vw, 1.7rem);
  line-height: 1.1;
  color: var(--c00);
}

.portfolio-kpi[data-tone="positive"] span,
.portfolio-move[data-tone="positive"] {
  color: var(--portfolio-positive);
}

.portfolio-kpi[data-tone="negative"] span,
.portfolio-move[data-tone="negative"] {
  color: var(--portfolio-negative);
}

.portfolio-analysis-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(24rem, 0.85fr);
  gap: var(--space-sm);
  align-items: stretch;
}

.portfolio-chart-panel {
  padding: var(--space-sm) var(--space-md);
  min-width: 0;
}

.portfolio-chart-head,
.portfolio-filter-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-sm);
  align-items: center;
  flex-wrap: wrap;
}

.portfolio-chart-panel figcaption {
  font-size: 1rem;
  font-weight: 700;
  color: var(--c00);
}

.portfolio-range-controls,
.portfolio-filter-row {
  display: flex;
  gap: var(--space-xs);
}

.portfolio-range-controls button,
.portfolio-filter-row button {
  min-height: 44px;
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  background: var(--color-panel);
  color: var(--color-text-muted);
  font: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
}

.portfolio-range-controls button[aria-pressed="true"],
.portfolio-filter-row button[aria-pressed="true"] {
  color: var(--color-link);
  border-color: var(--color-link);
  background: var(--portfolio-selected-bg);
}

.portfolio-range-controls button:focus-visible,
.portfolio-filter-row button:focus-visible,
.portfolio-table-scroll:focus-visible,
.portfolio-option-detail summary:focus-visible {
  outline: 3px solid var(--portfolio-focus-ring);
  outline-offset: 2px;
}

.portfolio-chart-legend {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-sm);
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.portfolio-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}

.portfolio-chart-legend span::before {
  content: "";
  width: 1.25rem;
  height: 2px;
  background: currentColor;
}

.portfolio-legend-value { color: var(--color-link); }
.portfolio-legend-capital { color: var(--c48); }

.portfolio-line-chart {
  width: 100%;
  height: 210px;
  margin-top: var(--space-sm);
}

.portfolio-grid line {
  stroke: var(--portfolio-chart-grid);
  stroke-width: 1;
}

.portfolio-line {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.portfolio-line-value {
  stroke: var(--color-link);
}

.portfolio-line-capital {
  stroke: var(--c48);
  stroke-dasharray: 8 8;
}

.portfolio-chart-axis {
  display: flex;
  justify-content: space-between;
  color: var(--color-text-muted);
  font-size: 0.75rem;
  padding: 0 var(--space-sm);
}

.portfolio-chart-data {
  margin-top: var(--space-sm);
  font-size: 0.8125rem;
}

.portfolio-chart-data summary {
  cursor: pointer;
  color: var(--color-link);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.portfolio-chart-data table,
.portfolio-allocation-table,
.portfolio-holdings-table {
  width: 100%;
  border-collapse: collapse;
}

.portfolio-chart-data th,
.portfolio-chart-data td,
.portfolio-allocation-table th,
.portfolio-allocation-table td,
.portfolio-holdings-table th,
.portfolio-holdings-table td {
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-xs) var(--space-sm);
  text-align: left;
  vertical-align: top;
  font-size: 0.8125rem;
}

.portfolio-chart-data th,
.portfolio-allocation-table th,
.portfolio-holdings-table thead th {
  color: var(--color-text-muted);
  font-weight: 700;
}

.portfolio-allocation-layout {
  display: grid;
  grid-template-columns: minmax(10rem, 0.7fr) minmax(0, 1fr);
  gap: var(--space-md);
  align-items: center;
}

.portfolio-donut {
  width: 100%;
  max-width: 11.5rem;
  justify-self: center;
}

.portfolio-allocation-table th:first-child,
.portfolio-allocation-table td:first-child {
  min-width: 6.75rem;
  text-wrap: nowrap;
}

.portfolio-donut-base {
  fill: none;
  stroke: var(--color-panel-muted);
  stroke-width: 34;
}

.portfolio-donut-segment {
  fill: none;
  stroke-width: 34;
  transform: rotate(-90deg);
  transform-origin: 110px 110px;
}

.portfolio-donut-stocks { stroke: var(--color-link); }
.portfolio-donut-sipp { stroke: var(--portfolio-teal); }
.portfolio-donut-options { stroke: var(--portfolio-purple); }
.portfolio-donut-cash { stroke: var(--c72); }

.portfolio-donut text:first-of-type {
  font-size: 1rem;
  font-weight: 700;
  fill: var(--c00);
}

.portfolio-donut text:last-of-type {
  font-size: 0.75rem;
  fill: var(--color-text-muted);
}

.portfolio-dot {
  display: inline-block;
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 999px;
  margin-right: var(--space-xs);
  vertical-align: middle;
}

.portfolio-dot-stocks { background: var(--color-link); }
.portfolio-dot-sipp { background: var(--portfolio-teal); }
.portfolio-dot-options { background: var(--portfolio-purple); }
.portfolio-dot-cash { background: var(--c72); }

.portfolio-holdings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(19rem, 0.32fr);
  gap: var(--space-sm);
  align-items: start;
}

.portfolio-holdings-panel {
  min-width: 0;
}

.portfolio-filter-row {
  padding: var(--space-sm);
  border-bottom: 1px solid var(--color-border);
}

.portfolio-table-scroll {
  overflow-x: auto;
  max-width: 100%;
}

.portfolio-holdings-table {
  min-width: 58rem;
}

.portfolio-holdings-table tbody tr:hover {
  background: var(--portfolio-row-hover);
}

.portfolio-row-hidden {
  display: none;
}

.portfolio-option-detail summary {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--color-link);
  cursor: pointer;
}

.portfolio-option-detail p {
  margin: var(--space-xs) 0;
  font-size: 0.8125rem;
}

.portfolio-option-detail dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-sm);
  padding: var(--space-sm);
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  background: var(--color-panel-muted);
}

.portfolio-option-detail dt {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.portfolio-option-detail dd {
  font-size: 0.8125rem;
  color: var(--c00);
}

.portfolio-options-panel {
  padding: var(--space-md);
  display: grid;
  gap: var(--space-md);
}

.portfolio-greek-list {
  display: grid;
  gap: var(--space-sm);
}

.portfolio-greek-row {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr) 4.75rem;
  gap: var(--space-sm);
  align-items: center;
  font-size: 0.8125rem;
}

.portfolio-greek-row strong {
  font-size: 0.8125rem;
  text-align: right;
  color: var(--c00);
}

.portfolio-greek-track {
  height: 0.5rem;
  border-radius: 999px;
  background: var(--color-panel-muted);
  overflow: hidden;
}

.portfolio-greek-track i {
  display: block;
  width: var(--bar-size);
  height: 100%;
  background: var(--color-link);
}

.portfolio-greek-row[data-tone="negative"] .portfolio-greek-track i {
  background: var(--portfolio-purple);
}

.portfolio-expiry-panel h3 {
  font-size: 0.9375rem;
  margin-bottom: var(--space-sm);
}

.portfolio-expiry-chart {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-sm);
  align-items: end;
  min-height: 9rem;
}

.portfolio-expiry-bar {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: var(--space-xs);
  height: 8rem;
  align-items: end;
  text-align: center;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.portfolio-expiry-bar i {
  width: 100%;
  height: var(--bar-size);
  min-height: 2px;
  background: var(--portfolio-purple);
  border-radius: 0.25rem 0.25rem 0 0;
}

@media (max-width: 980px) {
  .portfolio-kpi-grid,
  .portfolio-analysis-grid,
  .portfolio-holdings-layout {
    grid-template-columns: 1fr;
  }

  .portfolio-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body:has(.portfolio-page) .mobile-toggle {
    top: var(--space-md);
    bottom: auto;
  }

  .portfolio-header {
    align-items: start;
  }

  .portfolio-kpi-grid {
    grid-template-columns: 1fr;
  }

  .portfolio-allocation-layout,
  .portfolio-option-detail dl {
    grid-template-columns: 1fr;
  }

  .portfolio-range-controls,
  .portfolio-filter-row {
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
  }

  .portfolio-chart-panel,
  .portfolio-options-panel {
    padding: var(--space-sm);
  }

  .portfolio-greek-row {
    grid-template-columns: 3.5rem minmax(0, 1fr) 4.25rem;
  }
}

/* ===========================================================================
   Reduced motion
   =========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .line-over::after { clip-path: inset(0 0 0 0); }
  .landing-hero-video {
    animation: none !important;
  }
}

/* ===========================================================================
   Project page — launch panel
   =========================================================================== */

.project-tagline {
  font-size: 1.125rem;
  line-height: 1.5;
  color: var(--c18);
  font-style: italic;
  margin: var(--space-sm) 0 var(--space-md);
  max-width: 44rem;
}

ul.project-tech-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  list-style: none;
  padding: 0;
  margin: var(--space-md) 0 var(--space-lg);
}

ul.project-tech-list > li.project-tech-tag {
  display: inline-flex;
  align-items: center;
  min-height: 1.75rem;
  padding: 0.15rem 0.55rem;
  border: 1px solid var(--c84);
  border-radius: 0.4rem;
  background: var(--c99);
  color: var(--c18);
  font-size: 0.8125rem;
  line-height: 1.2;
}

ul.project-tech-list > li.project-tech-tag::marker {
  content: "";
}

.launch-panel {
  margin: var(--space-xl) 0 var(--space-lg);
}

.launch-button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  text-decoration: none;
}

.launch-mobile-note {
  display: none;
  font-size: 0.9375rem;
  color: var(--c24);
  font-style: italic;
  margin-top: var(--space-sm);
}

@media (max-width: 768px) {
  .launch-panel .launch-button,
  .launch-panel .pdf-button,
  .launch-panel a.launch-button.pdf-button {
    display: none !important;
  }
  .launch-panel .launch-mobile-note { display: block; }

  .xtend-workbook-profile .launch-panel .launch-button,
  .xtend-workbook-profile .launch-panel .pdf-button,
  .xtend-workbook-profile .launch-panel a.launch-button.pdf-button {
    display: inline-flex !important;
  }
}

/* ===========================================================================
   Print styles
   =========================================================================== */

@media print {
  @page {
    size: A4 portrait;
    margin: 1.5cm 1.5cm 1.5cm 1.5cm;
  }

  *, *::before, *::after {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  html { font-size: 10pt; orphans: 4; widows: 4; }

  body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.4;
  }

  .left-panel,
  .mobile-toggle,
  .pdf-button,
  .skip-link,
  .page-footer {
    display: none !important;
  }

  .main-content { margin-left: 0; padding: 0; }
  .main-content > .container { max-width: none; }

  a {
    text-decoration: none !important;
    color: #000 !important;
  }

  .cv-masthead {
    --cv-headshot-width: 0.75in;
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--cv-headshot-width);
    gap: 0.2in;
    border-bottom: 1px solid #000;
    margin-bottom: 0.5rem;
    padding-bottom: 0.4rem;
  }
  .cv-headshot { width: 0.75in; border-color: #000; }
  .cv-section { margin-bottom: 0.8rem; }
  .cv-section-title { border-bottom: 1px solid #000; margin-bottom: 0.4rem; padding-bottom: 0.15rem; }
  .cv-entry { margin-bottom: 0.5rem; page-break-inside: avoid; }
  .cv-bullets li, .cv-extra { margin-bottom: 0.1rem; }

  p { orphans: 3; widows: 3; }
}
