/* halfcyborg.com — editorial dark system (ha-02 port, see docs/jaredscheib-audit.md)
   Three colours: warm near-black ground, cream voice, single ember accent.
   Three typefaces: Fraunces display, Source Serif 4 body, DM Mono labels.

   ha-05 contrast pass, rewound: the first pass took every tint to the top of its
   ladder and read too hot, so each value here sits halfway between the ha-02
   original and that pass — brighter than the site shipped, softer than the pass.
   Headings, prose and the ember accent clear WCAG AA comfortably; the smallest
   accent-coloured lines (footer links 2.9:1, case meta and tags 3.5:1, chapter
   roles 4.2:1) sit under it, a deliberate trade for the softer read. Ratios
   measured against the ground are noted beside each token. */

:root {
  color-scheme: dark;

  --bg-rgb: 20 16 15;        /* #14100f warm near-black, a touch deeper than ha-02 */
  --cream-rgb: 244 242 238;  /* #f4f2ee — the old site's ground, now the voice */
  --ember-rgb: 228 130 83;   /* #e48253 — the ember, lifted to 6.9:1 as text */

  --bg: rgb(var(--bg-rgb));
  --cream: rgb(var(--cream-rgb));        /* 16.9:1 — headings, body */
  --ember: rgb(var(--ember-rgb));        /*  6.9:1 — accents, labels, rules */
  --muted: rgb(var(--cream-rgb) / 0.66); /*  7.7:1 — lede and long-form prose */
  --text-body: rgb(var(--cream-rgb) / 0.57); /* 6.0:1 — supporting prose */
  --text-meta: rgb(var(--cream-rgb) / 0.45); /* 4.2:1 — smallest meta lines, just under AA */
  --ember-dim: rgb(var(--ember-rgb) / 0.68); /* 3.8:1 — accent text, quieter */
  --ember-faint: rgb(var(--ember-rgb) / 0.22);
  --hairline: rgb(var(--ember-rgb) / 0.15);

  /* Text-size shortcut. 1 is the design's own scale and stays the default;
     the on-screen control steps it up without touching any type spec. */
  --type-scale: 1;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-mono: "DM Mono", "SFMono-Regular", Menlo, Consolas, monospace;

  --container: min(1100px, 92vw);
  --container-narrow: min(680px, 90vw);
  --gutter: clamp(20px, 4vw, 48px);
  --nav-gap: 28px;
  --header-pad-y: 15px;

  /* Work badge hues — the one polychrome exception to the three-colour rule */
  --badge-scale: rgba(111, 207, 151, 0.75);
  --badge-founded: rgba(255, 180, 100, 0.78);
  --badge-advisory: rgba(110, 170, 255, 0.78);
  --badge-shipped: rgba(196, 141, 255, 0.78);
}

html {
  scroll-behavior: smooth;
  /* Percentage keeps the reader's own browser text setting as the baseline. */
  font-size: calc(100% * var(--type-scale));
}
html[data-text-size="large"] { --type-scale: 1.12; }
html[data-text-size="larger"] { --type-scale: 1.26; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 1.0625rem; /* 17px at the default scale, and scales with it */
  font-weight: 400;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.7rem, 6vw, 5rem); line-height: 1; }
h2 { font-size: clamp(1.7rem, 3vw, 2.15rem); line-height: 1.3; }
h3 { font-size: 1.3rem; margin-bottom: 0.4em; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: inherit; }
strong { font-weight: 600; }
em { font-style: italic; }

::selection { background: rgb(var(--ember-rgb) / 0.35); color: var(--cream); }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgb(var(--ember-rgb) / 0.24); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgb(var(--ember-rgb) / 0.45); }

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

.text-accent { color: var(--ember); }

.icon { stroke: currentColor; fill: none; display: block; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon-fill { stroke: none; fill: currentColor; }
.icon-lg { width: 28px; height: 28px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

section { padding: clamp(84px, 12vh, 120px) 0; position: relative; }

/* ---------- ambient background ---------- */

.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.ambient-grid { position: absolute; inset: 0; opacity: 0.045; }
.ambient-grid path { stroke: var(--ember); }
.ambient-glow {
  position: absolute;
  border-radius: 50%;
}
.ambient-glow-a {
  top: 8%;
  right: -12%;
  width: 55vw;
  height: 55vw;
  background: radial-gradient(circle, rgb(var(--ember-rgb) / 0.05) 0%, transparent 70%);
  filter: blur(80px);
}
.ambient-glow-b {
  bottom: 5%;
  left: -8%;
  width: 45vw;
  height: 45vw;
  background: radial-gradient(circle, rgb(var(--ember-rgb) / 0.04) 0%, transparent 70%);
  filter: blur(100px);
}

/* ---------- mono labels & numbered section marks ---------- */

.mono-label,
.section-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ember);
  margin: 0 0 1.2em;
}
.mono-label { display: block; color: rgb(var(--cream-rgb) / 0.49); }

.section-mark {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: clamp(36px, 5vh, 56px);
}
.section-mark-center { justify-content: center; }
.section-rule { display: inline-block; width: 48px; height: 1px; background: var(--ember); flex-shrink: 0; }
.section-label { margin: 0; }

.section-lede {
  color: var(--muted);
  font-size: 1.06rem;
  max-width: 640px;
  margin-top: -0.4em;
  margin-bottom: 3em;
}

/* ---------- scroll reveal (html.js scoped: no-JS users see everything) ---------- */

html.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1) var(--rd, 0s),
    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1) var(--rd, 0s);
}
html.js .reveal.in-view { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html.js .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- buttons & chips ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 12px 20px;
  border-radius: 2px;
  border: 1px solid transparent;
  transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}
.btn .icon { width: 14px; height: 14px; }
.btn-primary {
  background: var(--ember);
  border-color: var(--ember);
  color: var(--bg);
  font-weight: 500;
}
.btn-primary:hover { background: rgb(var(--ember-rgb) / 0.85); border-color: rgb(var(--ember-rgb) / 0.85); }
.btn-ghost {
  border-color: rgb(var(--ember-rgb) / 0.45);
  color: var(--muted);
}
.btn-ghost:hover { border-color: var(--ember); color: var(--ember); }

.chip {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 6px 12px;
  border: 1px solid rgb(var(--ember-rgb) / 0.3);
  color: rgb(var(--ember-rgb) / 0.75);
  border-radius: 2px;
}

/* ---------- fixed header & scrollspy nav ---------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgb(var(--bg-rgb) / 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--hairline);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--header-pad-y);
  padding-bottom: var(--header-pad-y);
}

.brand-mono {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ember);
  transition: color 0.3s ease;
}
.brand-mono:hover { color: var(--cream); }

.primary-nav {
  display: flex;
  align-items: center;
  gap: var(--nav-gap);
}
.primary-nav a {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  color: rgb(var(--cream-rgb) / 0.49);
  padding: 4px 0 3px;
  border-bottom: 1px solid transparent;
  transition: color 0.3s ease, border-color 0.3s ease;
}
.primary-nav a:hover { color: var(--ember); }
.primary-nav a.is-active {
  color: var(--ember);
  border-bottom-color: var(--ember);
}
.nav-cta {
  color: var(--cream) !important;
  border: 1px solid rgb(var(--ember-rgb) / 0.45) !important;
  border-radius: 2px;
  padding: 7px 14px !important;
  transition: color 0.3s ease, border-color 0.3s ease !important;
}
.nav-cta:hover, .nav-cta.is-active { color: var(--ember) !important; border-color: var(--ember) !important; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.nav-toggle span { display: block; height: 1.5px; background: var(--cream); border-radius: 2px; }

/* ---------- the scribble, riding in the nav ---------- */

.mono-badge {
  display: inline-block;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background-color: transparent;
  background-size: cover;
  background-position: top center;
  background-repeat: no-repeat;
}
.mono-badge-scribble {
  background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFoAAABaBAMAAADKhlwxAAAAHlBMVEUAAAAeHh319fRcXFucnJxqamr39/egoJ8AAAAAAACoq71vAAAACHRSTlMA/v78/AwMFrwxfDYAAATDSURBVHja7VdNb+M2EKWjSLp6TCLniFLvGpHoXi2R6NnFot2retjs1UCB7d/vG8rZ3Zp0nF6LCoitRE/DNzNvPqLU/9d/+jqp5r3Q9vTvTMPwF1W/k8Zp53W1vo/x14dnIs2NGt9le+mIyI1LeBflqSNNxPYuGfFscR3NwC/jfT9fqmEgubRWdyN5nnrvvaDZ3I1h07pAZJgYTNQd42utgvPMiYqL99K/ixNrTfv0go7rm8ZPPjBpZ5ygNetW/fYGulosQOCswdwH0m9QaeoAHk53WgNNHAKN7U3jrRqY/DAzHwzYV2FydDzfSONpfRjYLXbo4+KiNjb4qddfimEEw7MKOlpceMPGxS7BWrqVorV5nCd7dXX7tujpWZ09+Wu0hVpKVNaPo9NDhuZa1eeCVqPjjIi186FVnwumbU852A46qt9z270LuoC25JqCVCvLZimg2bsSb0+g3f9gfxglRLN2mbZwmiOYDv+wK7nqdRzb3M1AJSJwcxjXXFK9Bnpw3+MY4uYmF7Lz2IFyL0x5O4Odk/fjvM+FVSsGOvk4mJSWSU7Cz0xZOUNpEElvtvx9e6WfJITHJk88+HYbB8Fcbh1s+4zI6dGRWfgShgMs2tdjep3Jaj1FRtXimXwc4oLPYUnHDFSotvMcCFxnQkjYMIJDSEB/sAHFmQX8jO5kBAIBcAS6J9pL/APF9Rr9+XE+WKBZ0Aehjp5vrHQBHfLMjwBoYULLgJh4QeMt6XBt3vZ/qQ4SiAEGJXpOmEzwMmUna2o/73D4dAkyRLKgnyAmi+30PoePvZwrOcGN/eFFXrrrsq/rqUvF4GPY2kRKj0iBlz4vtV1IRYxub1PSRcCprjnm6NOf4tSW+PS9wEstdzzkaPVxpuFH9GtNDGy7QjlIMqKoA4FPH5faJEtZLk8VkTf9wvgmj+Hwarui3dN1n60bGQeOZN5sw5U8Sm1ZkFzzU96Vd2kwYVCyS3AyaF4uYl5Nzzl6FfVh2lCaOa8z0+Mk7TPwB7UjMSwYOOjkhI0TxeHpGu1a2szhBGlYgV9/xYDLae+EajodJRDDhDqg1ytrKI3bbM3GRcCR/GchkqiN1dUIb1TiqeGf3vIyRFkkNl+zveavKqatBM8e/TBYh8Gdwi++1nkIq4tTZEzoYdi4FEtsCfny9nKueAPjYBnxSBRjo4Dj/lhaIBJxMQeHZ0pbhzBnYwv9BCEM22MohBz6sd4ShKmWX0H2FzJ4HtDyAcU7KSjI/Cnv3xS3NUZH2WhwZ2SvoX1pvTpV1bxtMV5rSVWfVHPg/VpYOupGCetZlCgc2PElSGOd96p2bZjcQfqg5pmnWcNp0ZS+sSqlACAbRx1muU8hYipvM0okAZlgxfMuwYW54xu2mQ59Crf2UqOoTOD1/KGM3lQldDEmZkFG5133ob6BFuoaYgzCA98e+/06Frf2X0mv1aXinTbsTEduVa07lzarndZrU2lhsFFawrGpP6mqvCCTfjkrzCoyHZvgyaUV/FQ9lZY85r1qG/aUekicnVebRPbFAPKxVesK78wUYzDhBX/8Cr1ROdypWis0eR+wpI7qk2izabjw30nFSRHnBwhwcQ/DZbOr1Vodb6E/KVThPE22+Sb8r398L4e/ARksD5l30oPRAAAAAElFTkSuQmCC");
}
.brand-scribble {
  width: 34px;
  height: 34px;
  background-color: #faf7f2;
  background-size: 112.5% 112.5%;
  background-position: 25% 100%;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
  will-change: transform;
}

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

.hero { padding: 0; }
.hero-inner {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 110px;
  padding-bottom: 96px;
  box-sizing: border-box;
}

.hero-meta {
  position: absolute;
  top: 104px;
  right: var(--gutter);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  line-height: 2.4;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-align: right;
  color: var(--ember-dim);
}
.hero-meta-inline { display: none; }
@media (max-height: 860px) {
  .hero-meta { display: none; }
}

.hero-greeting {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-body);
  margin-bottom: 1.6em;
}
.wave { display: inline-block; animation: wave 2.2s ease-in-out infinite; transform-origin: 70% 70%; }
@keyframes wave {
  0%, 55%, 100% { transform: rotate(0deg); }
  10% { transform: rotate(14deg); }
  20% { transform: rotate(-8deg); }
  30% { transform: rotate(14deg); }
  40% { transform: rotate(-4deg); }
}
@media (prefers-reduced-motion: reduce) {
  .wave { animation: none; }
}

.hero-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.hero-name-row h1 { margin: 0; }
.hero-portrait {
  width: clamp(70px, 9vw, 110px);
  height: clamp(70px, 9vw, 110px);
  border-radius: 50%;
  border: 2px solid var(--ember-faint);
  object-fit: cover;
  flex-shrink: 0;
}

.hero-thesis {
  font-family: var(--font-display);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(1.25rem, 3vw, 2.1rem);
  line-height: 1.35;
  color: rgb(var(--ember-rgb) / 0.83);
  max-width: 21em;
  margin: 0.9em 0 0;
}
.hero-thesis em { font-style: italic; color: var(--ember); }

.hero-sub {
  font-size: clamp(1rem, 1.4vw, 1.1rem);
  line-height: 1.85;
  color: var(--muted);
  max-width: 560px;
  margin-top: 2.2em;
}

.hero-chips { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 2em; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 2.2em; }

.hero .scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 30px;
  font-size: 20px;
  color: var(--ember);
  opacity: 0.45;
  text-decoration: none;
  transition: opacity 0.3s ease;
}
/* the reveal transform and centring share the same transform slot */
html.js .hero .scroll-cue { transform: translateX(-50%) translateY(24px); }
html.js .hero .scroll-cue.in-view,
html:not(.js) .hero .scroll-cue { transform: translateX(-50%); }
.scroll-cue:hover { opacity: 0.8; }

/* the "...and I still ❤️ it!" hover tip */
.hover-reveal { position: relative; cursor: help; }
.hover-tip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #271e1a;
  border: 1px solid rgb(var(--ember-rgb) / 0.4);
  color: var(--cream);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  padding: 7px 12px;
  border-radius: 2px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  z-index: 5;
}
.hover-tip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgb(var(--ember-rgb) / 0.4);
}
.hover-reveal:hover .hover-tip,
.hover-reveal:focus-visible .hover-tip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.heart-beat { display: inline-block; animation: heartbeat 1.1s ease-in-out infinite; }
@keyframes heartbeat {
  0%, 60%, 100% { transform: scale(1); }
  20% { transform: scale(1.25); }
  35% { transform: scale(1.08); }
}
@media (prefers-reduced-motion: reduce) {
  .heart-beat { animation: none; }
}

/* ---------- client logo band ---------- */

#clients { padding-top: 40px; padding-bottom: 64px; }

.logo-heading { margin-bottom: 34px; }

.logo-marquee {
  overflow: hidden;
  position: relative;
}
.logo-track {
  display: flex;
  align-items: center;
  gap: 56px;
}
.logo-set { display: contents; }
.logo-set-duplicate { display: none; }

.logo-marquee.is-static .logo-track { flex-wrap: wrap; row-gap: 28px; }

.logo-marquee.is-scrolling {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.logo-marquee.is-scrolling .logo-track {
  width: max-content;
  animation: logo-marquee-scroll linear infinite;
}
.logo-marquee.is-scrolling:hover .logo-track { animation-play-state: paused; }
.logo-marquee.is-scrolling .logo-set-duplicate { display: contents; }

@keyframes logo-marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .logo-marquee.is-scrolling .logo-track { animation: none; }
}

.logo-item { display: inline-flex; align-items: center; flex-shrink: 0; }
.logo-mark {
  height: 26px;
  width: auto;
  display: block;
  filter: grayscale(1) brightness(0) invert(1);
  opacity: 0.54;
  transition: opacity 0.3s ease;
}
.logo-item:hover .logo-mark { opacity: 0.93; }

/* ---------- capabilities ---------- */

.capability-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.capability {
  border: 1px solid var(--hairline);
  border-radius: 3px;
  background: rgb(var(--ember-rgb) / 0.028);
  padding: 24px;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.capability:hover {
  border-color: rgb(var(--ember-rgb) / 0.37);
  background: rgb(var(--ember-rgb) / 0.058);
}
.capability-icon { color: var(--ember); margin-bottom: 1em; }
.capability-icon .icon { width: 22px; height: 22px; }
.capability h3 { font-size: 1.2rem; color: var(--cream); }
.capability p { color: var(--text-body); font-size: 0.92rem; line-height: 1.7; }

@media (max-width: 900px) {
  .capability-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .capability-grid { grid-template-columns: 1fr; }
}

/* ---------- selected work: numbered index rows ---------- */

.case-index { border-top: 1px solid rgb(var(--ember-rgb) / 0.12); }
.case-row {
  padding: 36px 0;
  border-bottom: 1px solid rgb(var(--ember-rgb) / 0.12);
}
.case-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
}
.case-headings { flex: 1; }
.case-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgb(var(--ember-rgb) / 0.64);
  margin-bottom: 0.9em;
}
.case-badge {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 2px;
  border: 1px solid currentColor;
}
.case-badge-scale { color: var(--badge-scale); }
.case-badge-founded { color: var(--badge-founded); }
.case-badge-advisory { color: var(--badge-advisory); }
.case-badge-shipped { color: var(--badge-shipped); }

.case-row h3 {
  font-size: clamp(1.3rem, 2.2vw, 1.55rem);
  margin: 0;
  color: var(--cream);
  transition: color 0.3s ease;
}
.case-row:hover h3 { color: var(--ember); }

.case-number {
  font-family: var(--font-mono);
  font-weight: 300;
  font-size: 1.75rem;
  color: rgb(var(--ember-rgb) / 0.36); /* decorative numerals, half-way back down */
  flex-shrink: 0;
  transition: color 0.3s ease;
  line-height: 1.2;
}
.case-row:hover .case-number { color: rgb(var(--ember-rgb) / 0.6); }

.case-body {
  color: var(--text-body);
  font-size: 0.97rem;
  line-height: 1.8;
  max-width: 640px;
  margin: 0.9em 0;
}
.case-outcome {
  color: var(--muted);
  font-size: 0.94rem;
  max-width: 640px;
  margin-bottom: 1.2em;
}
.case-outcome strong {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ember);
  margin-right: 10px;
}

.tag-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  padding: 3px 10px;
  border: 1px solid var(--hairline);
  color: rgb(var(--ember-rgb) / 0.64);
  border-radius: 2px;
  transition: background 0.3s ease;
}
.case-row:hover .tag { background: rgb(var(--ember-rgb) / 0.07); }

/* ---------- about ---------- */

.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(36px, 6vw, 72px);
  align-items: start;
}
.about-copy p { color: var(--muted); font-size: 1.02rem; max-width: 620px; }
.about-copy h2 { color: var(--cream); max-width: 520px; }

.about-card {
  border-left: 1px solid rgb(var(--ember-rgb) / 0.4);
  padding-left: 28px;
  margin-top: 0.4em;
}
.about-card .icon { color: var(--ember); margin-bottom: 0.9em; }
.about-card h3 { color: var(--cream); font-size: 1.25rem; }
.about-card p { color: var(--text-body); font-size: 0.95rem; line-height: 1.75; }

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

/* ---------- journey timeline + expanders ---------- */

.timeline {
  position: relative;
  padding-left: 40px;
  max-width: 760px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: rgb(var(--ember-rgb) / 0.22);
}
.chapter { position: relative; margin-bottom: 52px; }
.chapter:last-child { margin-bottom: 0; }

.chapter-node {
  position: absolute;
  left: -40px;
  top: 5px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1.5px solid rgb(var(--ember-rgb) / 0.4);
  background: var(--bg);
  box-sizing: border-box;
}
.chapter-current .chapter-node {
  border-color: var(--ember);
  background: rgb(var(--ember-rgb) / 0.2);
}
.chapter-current .chapter-node::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--ember);
}

.chapter-meta {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 0.7em;
}
.chapter-index {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ember);
}
.chapter-role {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  color: var(--text-meta);
}
.chapter-role a { color: inherit; }
.chapter h3 { font-size: 1.3rem; color: var(--cream); margin-bottom: 0.45em; }
.chapter p { color: var(--text-body); font-size: 0.97rem; line-height: 1.8; max-width: 620px; }

@media (max-width: 720px) {
  .timeline { padding-left: 30px; }
  .chapter-node { left: -30px; }
}

/* ---------- read more / show less swap ----------
   No JS: the full detail shows and the button stays hidden.
   With JS: the one-liner shows until the button swaps in the detail. */

.exp-short { display: none; }
html.js .expander:not(.is-expanded) .exp-short { display: block; }
html.js .expander:not(.is-expanded) .exp-detail { display: none; }

.exp-toggle {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ember-dim);
  background: transparent;
  border: none;
  padding: 0;
  margin-top: 2px;
  cursor: pointer;
  transition: color 0.3s ease;
}
.exp-toggle:hover { color: var(--ember); }

/* ---------- beyond ---------- */

.beyond-inner { text-align: center; margin: 0 auto; }
.headshot-circle {
  width: clamp(180px, 26vw, 260px);
  height: clamp(180px, 26vw, 260px);
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--ember-faint);
  margin-bottom: 2em;
}
.beyond-inner p:not(.mono-label) {
  color: var(--muted);
  font-size: 1.02rem;
  max-width: 58ch;
  margin-left: auto;
  margin-right: auto;
}
.beyond-inner .flair-row { justify-content: center; margin-top: 2em; }

.flair-row { display: flex; gap: 8px; flex-wrap: wrap; }
.flair-badge {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  padding: 6px 12px;
  border: 1px solid var(--hairline);
  color: var(--text-body);
  border-radius: 2px;
  transition: border-color 0.3s ease, color 0.3s ease;
}
.flair-badge:hover { border-color: rgb(var(--ember-rgb) / 0.45); color: var(--cream); }

.inline-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgb(var(--ember-rgb) / 0.65);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.3s ease, color 0.3s ease;
}
.inline-link:hover { color: var(--ember); text-decoration-color: var(--ember); }

/* ---------- contact ---------- */

.cta-section { padding-bottom: 72px; }
.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: clamp(36px, 6vw, 72px);
  align-items: start;
}
.contact-lede { color: var(--muted); font-size: 1.02rem; max-width: 420px; }
#contact h2 { font-size: clamp(1.8rem, 3.4vw, 2.4rem); color: var(--cream); }

.contact-links { display: flex; flex-direction: column; gap: 18px; margin-top: 0.4em; }
.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.3s ease;
}
.contact-arrow { display: inline-block; transition: transform 0.3s ease; }
.contact-link:hover { color: var(--ember); }
.contact-link:hover .contact-arrow { transform: translateX(4px); }

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

/* ---------- footer ---------- */

/* the tail padding keeps the fixed text-size control clear of the footer */
.site-footer { border-top: 1px solid rgb(var(--ember-rgb) / 0.12); padding: 30px 0 84px; }
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-meta,
.footer-links a {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgb(var(--ember-rgb) / 0.55);
  text-decoration: none;
}
.footer-links { display: flex; gap: 22px; }
.footer-links a { transition: color 0.3s ease; }
.footer-links a:hover { color: var(--ember); }

/* ---------- text-size shortcut ----------
   The default step is the design's own scale and changes nothing; the two
   steps above it lift --type-scale, which the root font-size multiplies, so
   every rem-based size on the page grows together. The control itself is
   specified in px so it never grows with what it is scaling. */

.reading-control {
  position: fixed;
  right: var(--gutter);
  bottom: 20px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 6px 14px;
  border: 1px solid rgb(var(--ember-rgb) / 0.32);
  border-radius: 2px;
  background: rgb(var(--bg-rgb) / 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 28px rgb(0 0 0 / 0.5);
}
.reading-control[hidden] { display: none; }

.reading-control-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.reading-steps { display: flex; align-items: center; gap: 4px; }

.reading-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 32px;
  padding: 0 6px;
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1;
  color: var(--muted);
  background: transparent;
  border: 1px solid rgb(var(--ember-rgb) / 0.2);
  border-radius: 2px;
  cursor: pointer;
  transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}
.reading-step:hover { color: var(--cream); border-color: var(--ember); }
.reading-step:active { transform: translateY(1px); }
.reading-step[aria-pressed="true"] {
  color: var(--bg);
  background: var(--ember);
  border-color: var(--ember);
}
.reading-step-sm { font-size: 13px; }
.reading-step-md { font-size: 16px; }
.reading-step-lg { font-size: 20px; }

@media (max-width: 560px) {
  .reading-control {
    gap: 6px;
    padding: 6px 8px;
    bottom: 14px;
  }
  .reading-control-label { display: none; }
  .reading-step { min-width: 40px; height: 38px; }
}

/* ---------- small screens ---------- */

/* the larger text steps grow the nav too, so give its gaps a little back */
html[data-text-size="large"] { --nav-gap: 22px; }
html[data-text-size="larger"] { --nav-gap: 16px; }

@media (max-width: 780px) {
  .nav-toggle { display: flex; }
  .primary-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 10px var(--gutter) 20px;
    background: rgb(var(--bg-rgb) / 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--hairline);
    display: none;
  }
  .primary-nav.open { display: flex; }
  .primary-nav a { padding: 10px 0; border-bottom: none; }
  .primary-nav a.is-active { border-bottom: none; }
  .nav-cta { margin-top: 6px; }

  .hero { padding-top: 96px; }
  .hero-meta { display: none; }
  .hero-meta-inline {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    line-height: 2;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ember-dim);
    margin-top: 1.2em;
  }

  .case-head { gap: 20px; }
  .case-number { font-size: 1.4rem; }

  section { padding: 72px 0; }
}
