@charset "UTF-8";

/* ============================================================================
   David Zeff — portfolio
   One stylesheet, no build step. Organised as:
     1. Tokens        6. Nav
     2. Reset         7. Hero
     3. Base          8. Sections (about, work, skills, experience, education)
     4. Layout        9. Contact + footer
     5. Components   10. Case study pages
                     11. Motion, print, forced colours

   Written with logical properties (margin-inline, padding-block, inset-inline,
   text-align: start) throughout, so a Hebrew RTL variant is a `dir="rtl"`
   attribute and a content pass — not a rewrite of the spacing rules.
   ========================================================================= */


/* ── 1. Tokens ───────────────────────────────────────────────────────────── */

:root {
  color-scheme: light dark;

  /* Type. One family — Inter — with a system fallback that is metrically
     close enough that a failed font load is not a layout shift. */
  --font-sans:
    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;

  /* Fluid scale. Each step interpolates between a 375px and a 1440px viewport,
     so the three tested widths are all on the curve rather than at a breakpoint. */
  --text-2xs:  0.6875rem;                                     /* 11 — eyebrows      */
  --text-xs:   0.75rem;                                       /* 12 — meta, numbers */
  --text-sm:   0.8125rem;                                     /* 13 — captions      */
  --text-base: 0.9375rem;                                     /* 15 — UI            */
  --text-body: clamp(1rem, 0.97rem + 0.13vw, 1.0625rem);      /* 16–17 — prose      */
  --text-md:   clamp(1.0625rem, 1.01rem + 0.23vw, 1.1875rem); /* 17–19             */
  --text-lg:   clamp(1.25rem, 1.13rem + 0.5vw, 1.5rem);       /* 20–24 — findings   */
  --text-xl:   clamp(1.5rem, 1.31rem + 0.79vw, 2rem);         /* 24–32              */
  --text-2xl:  clamp(1.875rem, 1.52rem + 1.5vw, 2.75rem);     /* 30–44 — page h1    */
  --text-3xl:  clamp(2.75rem, 1.99rem + 3.2vw, 4.5rem);       /* 44–72 — hero name  */

  --leading-tight: 1.08;
  --leading-snug:  1.28;
  --leading-body:  1.62;

  --tracking-tight:  -0.035em;   /* large display sizes only */
  --tracking-snug:   -0.018em;
  --tracking-normal:  0;
  --tracking-wide:    0.11em;    /* uppercase labels */

  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semi:   600;

  /* Space. A 4px base, doubling loosely, with the section step fluid. */
  --space-3xs: 0.25rem;
  --space-2xs: 0.375rem;
  --space-xs:  0.5rem;
  --space-sm:  0.75rem;
  --space-md:  1rem;
  --space-lg:  1.5rem;
  --space-xl:  2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-section: clamp(3.5rem, 7vw, 6.5rem);

  /* Layout */
  --width-page:  68rem;    /* 1088px — the outer measure          */
  --width-prose: 36rem;    /* ~66 characters at the body size      */
  --width-label: 9rem;     /* the Swiss left-hand label column     */
  --gutter: clamp(1.25rem, 5vw, 2.5rem);
  --nav-height: 3.75rem;

  --radius-sm: 2px;
  --radius-md: 4px;

  --transition-fast: 120ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 480ms cubic-bezier(0.22, 0.61, 0.36, 1);

  /* Colour — light. Neutral base, near-black ink, and a single accent that
     appears on links and nothing else. Every pairing below is >= 4.6:1. */
  --color-bg:          #fcfcfc;
  --color-surface:     #ffffff;
  --color-surface-alt: #f6f6f5;
  --color-ink:         #111111;   /* 18.9:1 on bg */
  --color-ink-muted:   #5f5f5f;   /*  6.2:1 on bg */
  --color-ink-faint:   #737373;   /*  4.6:1 on bg */
  --color-accent:      #1f3c5c;   /* 11.0:1 on bg — the CV's navy */
  --color-accent-hover:#16293f;
  --color-rule:        #e4e4e2;
  --color-rule-strong: #cfcfcc;

  /* Inverted pair, used by the primary button only. */
  --color-invert-bg:   #111111;
  --color-invert-ink:  #fcfcfc;
  --color-invert-hover:#2c2c2c;

  --shadow-none: none;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg:          #101215;
    --color-surface:     #16191d;
    --color-surface-alt: #1b1f24;
    --color-ink:         #e9eaec;   /* 15.6:1 on bg */
    --color-ink-muted:   #9aa0a8;   /*  7.2:1 on bg */
    --color-ink-faint:   #838a92;   /*  5.4:1 on bg */
    --color-accent:      #a7c1e0;   /* 10.2:1 on bg — the navy, lifted */
    --color-accent-hover:#c3d6ec;
    --color-rule:        #272b31;
    --color-rule-strong: #3a3f47;

    --color-invert-bg:   #e9eaec;
    --color-invert-ink:  #101215;
    --color-invert-hover:#ffffff;
  }
}


/* ── 2. Reset ────────────────────────────────────────────────────────────── */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Anchor targets must clear the sticky nav. */
  scroll-padding-block-start: calc(var(--nav-height) + var(--space-lg));
}

body,
h1, h2, h3, h4, p, figure, blockquote, dl, dd, ol, ul {
  margin: 0;
}

ul[class], ol[class] { list-style: none; padding: 0; }

img, picture, svg { display: block; max-width: 100%; }

a { color: inherit; }

button, input, select, textarea { font: inherit; color: inherit; }


/* ── 3. Base ─────────────────────────────────────────────────────────────── */

body {
  background-color: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  font-weight: var(--weight-normal);
  letter-spacing: var(--tracking-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-weight: var(--weight-semi);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-snug);
  text-wrap: balance;
}

p { text-wrap: pretty; }

/* Only three weights are loaded, and font-synthesis is off, so `bold` would
   quietly resolve to 600 anyway. Saying so explicitly keeps it predictable. */
strong, b { font-weight: var(--weight-semi); }

/* Column names and identifiers in the case studies. The monospace stack is
   the system's — it costs no network request, so the page still loads exactly
   one font family. */
code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
               "Liberation Mono", monospace;
  font-size: 0.88em;
  background-color: var(--color-surface-alt);
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-sm);
  padding: 0.1em 0.32em;
  overflow-wrap: anywhere;
}

/* Figures are the one place numbers appear in running text often enough to
   want the columns to line up. */
.tabular, time, .work-number { font-variant-numeric: tabular-nums; }

::selection {
  background-color: var(--color-accent);
  color: var(--color-bg);
}

/* One focus treatment, everywhere, and it is never removed. */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Inline links: accent, underlined, with the underline sitting clear of the
   descenders rather than cutting through them. */
.link,
.prose a {
  color: var(--color-accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: color-mix(in srgb, var(--color-accent) 40%, transparent);
  transition: text-decoration-color var(--transition-fast), color var(--transition-fast);
}

.link:hover,
.prose a:hover {
  color: var(--color-accent-hover);
  text-decoration-color: currentColor;
}

.skip-link {
  position: absolute;
  inset-inline-start: var(--gutter);
  inset-block-start: -100%;
  z-index: 100;
  padding: var(--space-sm) var(--space-md);
  background-color: var(--color-invert-bg);
  color: var(--color-invert-ink);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  text-decoration: none;
  border-radius: var(--radius-md);
}

.skip-link:focus { inset-block-start: var(--space-sm); }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}


/* ── 4. Layout ───────────────────────────────────────────────────────────── */

.wrap {
  width: 100%;
  max-width: var(--width-page);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--space-section);
  border-block-start: 1px solid var(--color-rule);
}

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

/* The Swiss two-column frame: a small uppercase label in the margin, content
   to its side. Collapses to stacked below 60rem, which keeps the label useful
   on mobile instead of hiding it. */
.section-grid {
  display: grid;
  gap: var(--space-lg) var(--space-2xl);
  grid-template-columns: 1fr;
}

@media (min-width: 60rem) {
  .section-grid {
    grid-template-columns: var(--width-label) minmax(0, 1fr);
    gap: var(--space-3xl);
  }
}

.section-label {
  font-size: var(--text-2xs);
  font-weight: var(--weight-semi);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-ink-faint);
  line-height: var(--leading-snug);
  margin: 0;
}

@media (min-width: 60rem) {
  .section-label {
    position: sticky;
    inset-block-start: calc(var(--nav-height) + var(--space-lg));
    /* Optically aligns the label's cap-height with the first line beside it. */
    padding-block-start: 0.45em;
  }
}

.prose {
  max-width: var(--width-prose);
  font-size: var(--text-md);
  line-height: var(--leading-body);
  color: var(--color-ink);
}

.prose p + p { margin-block-start: var(--space-md); }

.stack       { display: flex; flex-direction: column; gap: var(--space-md); }
.stack-lg    { display: flex; flex-direction: column; gap: var(--space-xl); }


/* ── 5. Components ───────────────────────────────────────────────────────── */

/* Buttons. The primary is ink-on-paper inverted; the accent stays reserved
   for links, so the page has exactly one loud element per screen. */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0.7rem 1.25rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-normal);
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--transition-base),
              border-color var(--transition-base),
              color var(--transition-base);
}

.btn-primary {
  background-color: var(--color-invert-bg);
  color: var(--color-invert-ink);
}

.btn-primary:hover { background-color: var(--color-invert-hover); }

.btn-secondary {
  background-color: transparent;
  color: var(--color-ink);
  border-color: var(--color-rule-strong);
}

.btn-secondary:hover {
  border-color: var(--color-ink);
  background-color: var(--color-surface-alt);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
}

/* A text link that carries a trailing arrow which nudges on hover. The arrow
   is a pseudo-element so it never lands in the accessible name. */
.arrow-link {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4em;
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--color-accent);
  text-decoration: none;
}

.arrow-link::after {
  content: "\2192";                       /* → */
  transition: transform var(--transition-base);
}

.arrow-link:hover { color: var(--color-accent-hover); }
.arrow-link:hover::after { transform: translateX(0.2em); }

/* RTL: the arrow must point the other way, and nudge the other way. */
[dir="rtl"] .arrow-link::after { content: "\2190"; }
[dir="rtl"] .arrow-link:hover::after { transform: translateX(-0.2em); }

.arrow-link-back::after { content: none; }
.arrow-link-back::before {
  content: "\2190";
  transition: transform var(--transition-base);
}
.arrow-link-back:hover::before { transform: translateX(-0.2em); }
[dir="rtl"] .arrow-link-back::before { content: "\2192"; }
[dir="rtl"] .arrow-link-back:hover::before { transform: translateX(0.2em); }

/* External links get a small mark so a recruiter knows a tab is opening. */
.ext-link {
  font-size: var(--text-sm);
  color: var(--color-ink-muted);
  text-decoration: none;
  border-block-end: 1px solid var(--color-rule-strong);
  padding-block-end: 1px;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.ext-link::after { content: "\2197"; margin-inline-start: 0.3em; }   /* ↗ */
.ext-link:hover { color: var(--color-ink); border-color: var(--color-ink); }

.meta {
  font-size: var(--text-sm);
  color: var(--color-ink-muted);
  line-height: var(--leading-snug);
}

.meta-faint { color: var(--color-ink-faint); }

/* A dot separator that does not get read out or copied as a character. */
.sep::before {
  content: "\00B7";
  margin-inline: 0.5em;
  color: var(--color-ink-faint);
}


/* ── 6. Nav ──────────────────────────────────────────────────────────────── */

.nav {
  position: sticky;
  inset-block-start: 0;
  z-index: 50;
  background-color: var(--color-bg);
  border-block-end: 1px solid transparent;
  transition: border-color var(--transition-base);
}

/* JS adds this once the page has scrolled, so the rule appears only when
   there is something underneath it to separate from. */
.nav.is-stuck { border-block-end-color: var(--color-rule); }

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  min-height: var(--nav-height);
}

.nav-brand {
  font-size: var(--text-base);
  font-weight: var(--weight-semi);
  letter-spacing: var(--tracking-snug);
  text-decoration: none;
  color: var(--color-ink);
  white-space: nowrap;
}

.nav-brand span {
  color: var(--color-ink-faint);
  font-weight: var(--weight-normal);
}

.nav-list {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-link {
  font-size: var(--text-base);
  color: var(--color-ink-muted);
  text-decoration: none;
  padding-block: var(--space-2xs);
  border-block-end: 1px solid transparent;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.nav-link:hover { color: var(--color-ink); }

/* Scrollspy state. aria-current is the source of truth; the class is only
   there for browsers rendering the attribute selector slowly. */
.nav-link[aria-current="true"] {
  color: var(--color-ink);
  border-block-end-color: var(--color-ink);
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: var(--space-xs);
  background: transparent;
  border: 1px solid var(--color-rule-strong);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.75rem;
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  cursor: pointer;
}

.nav-toggle-bars {
  display: block;
  position: relative;
  inline-size: 14px;
  block-size: 1px;
  background-color: currentColor;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  block-size: 1px;
  background-color: currentColor;
  transition: transform var(--transition-base);
}

.nav-toggle-bars::before { inset-block-start: -4px; }
.nav-toggle-bars::after  { inset-block-start: 4px; }

.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background-color: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(4px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after  { transform: translateY(-4px) rotate(-45deg); }

@media (max-width: 47.99rem) {
  .nav-toggle { display: inline-flex; }

  .nav-list {
    position: absolute;
    inset-inline: 0;
    inset-block-start: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--space-xs) var(--gutter) var(--space-lg);
    background-color: var(--color-bg);
    border-block-end: 1px solid var(--color-rule);
  }

  /* Closed by default on small screens. Without JS the toggle cannot open it,
     so `.no-js` keeps the list visible and static instead of trapping links. */
  .nav-list[data-collapsed="true"] { display: none; }

  .nav-link {
    display: block;
    padding-block: var(--space-sm);
    font-size: var(--text-md);
    border-block-end: 1px solid var(--color-rule);
  }

  .nav-link[aria-current="true"] { border-block-end-color: var(--color-rule); }
}

.no-js .nav-toggle { display: none; }

@media (max-width: 47.99rem) {
  .no-js .nav-list {
    position: static;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--space-md);
    padding: 0 0 var(--space-sm);
    border: 0;
  }
  .no-js .nav-link { border: 0; padding-block: 0; font-size: var(--text-base); }
}


/* ── 7. Hero ─────────────────────────────────────────────────────────────── */

.hero {
  padding-block: clamp(3.5rem, 10vw, 7rem) var(--space-section);
}

.hero-layout {
  display: flex;
  flex-direction: column-reverse;
  gap: var(--space-xl);
}

@media (min-width: 48rem) {
  .hero-layout {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: clamp(3rem, 8vw, 8rem);
  }
}

.hero-image {
  width: 160px;
  height: 200px;
  border-radius: 12px;
  object-fit: cover;
  display: block;
  border: 4px solid var(--color-bg);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

@media (min-width: 48rem) {
  .hero-image {
    width: 320px;
    height: 420px;
  }
}

.hero-eyebrow {
  font-size: var(--text-2xs);
  font-weight: var(--weight-semi);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-ink-faint);
  margin-block-end: var(--space-lg);
}

.hero-name {
  font-size: var(--text-3xl);
  font-weight: var(--weight-semi);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  margin-block-end: var(--space-lg);
}

.hero-statement {
  max-width: 22ch;
  font-size: var(--text-xl);
  font-weight: var(--weight-normal);
  line-height: 1.34;
  letter-spacing: var(--tracking-snug);
  color: var(--color-ink);
  margin-block-end: var(--space-lg);
}

@media (min-width: 48rem) {
  .hero-statement { max-width: 26ch; }
}

.hero-location {
  font-size: var(--text-base);
  color: var(--color-ink-muted);
  margin-block-end: var(--space-xl);
}

.hero-actions { margin-block-end: var(--space-lg); }

.hero-secondary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-lg);
}


/* ── 8. Sections ─────────────────────────────────────────────────────────── */

/* Work — text-forward rows. The finding leads, because that is the only part
   a reader will remember 20 minutes later. The card is clickable as a whole
   via a stretched pseudo-element on the title link; the demo and repo links
   sit above it on the z axis so they stay independently clickable. */
.work-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.work-card {
  position: relative;
  display: grid;
  gap: var(--space-md);
  padding-block: var(--space-xl);
  border-block-start: 1px solid var(--color-rule);
  transition: background-color var(--transition-base);
}

.work-list > li:first-child .work-card { border-block-start: 0; padding-block-start: 0; }

@media (min-width: 48rem) {
  .work-card {
    grid-template-columns: 2.5rem minmax(0, 1fr);
    column-gap: var(--space-lg);
  }
  .work-card > :not(.work-number) { grid-column: 2; }
}

.work-number {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--color-ink-faint);
  letter-spacing: var(--tracking-normal);
  line-height: 2.2;
}

@media (min-width: 48rem) {
  .work-number { grid-row: 1 / span 5; line-height: 1.9; }
}

.work-heading { display: flex; flex-direction: column; gap: var(--space-3xs); }

.work-title {
  font-size: var(--text-md);
  font-weight: var(--weight-semi);
  letter-spacing: var(--tracking-snug);
  margin: 0;
}

.work-title a {
  text-decoration: none;
  color: var(--color-ink);
}

/* The stretched hit area. */
.work-title a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.work-subtitle {
  font-size: var(--text-sm);
  color: var(--color-ink-muted);
}

.work-finding {
  max-width: 30ch;
  font-size: var(--text-lg);
  font-weight: var(--weight-normal);
  line-height: 1.36;
  letter-spacing: var(--tracking-snug);
  color: var(--color-ink);
  margin: 0;
}

.work-scale {
  font-size: var(--text-sm);
  color: var(--color-ink-muted);
  font-variant-numeric: tabular-nums;
}

.work-methods {
  font-size: var(--text-sm);
  color: var(--color-ink-faint);
}

.work-links {
  position: relative;   /* lifts these above the stretched ::after */
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-lg);
  margin-block-start: var(--space-3xs);
}

@media (hover: hover) {
  .work-card:hover { background-color: var(--color-surface-alt); }
  .work-card:hover .arrow-link::after { transform: translateX(0.2em); }
}

/* Keyboard parity: focusing the title ring-lights the whole row, not a
   40-pixel word at the top of it. */
.work-card:has(.work-title a:focus-visible) {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}
.work-card .work-title a:focus-visible { outline: none; }

/* Padding so the hover fill does not run flush to the text on wide screens. */
@media (min-width: 48rem) and (hover: hover) {
  .work-card {
    padding-inline: var(--space-md);
    margin-inline: calc(var(--space-md) * -1);
  }
}

/* Skills — labelled rows, deliberately not bars or ratings. The grouping is
   the signal; a percentage next to "SQL" would mean nothing. */
.skill-rows {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
}

.skill-row {
  display: grid;
  gap: var(--space-3xs) var(--space-lg);
  padding-block: var(--space-md);
  border-block-start: 1px solid var(--color-rule);
}

.skill-row:first-child { border-block-start: 0; padding-block-start: 0; }

@media (min-width: 34rem) {
  .skill-row { grid-template-columns: 10.5rem minmax(0, 1fr); }
}

.skill-label {
  font-size: var(--text-2xs);
  font-weight: var(--weight-semi);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-ink-faint);
  line-height: 1.9;
  margin: 0;
}

.skill-value {
  font-size: var(--text-base);
  color: var(--color-ink);
  line-height: 1.65;
  margin: 0;
}

/* Experience + education — shared timeline-less list. No vertical rule, no
   dots: reverse chronology and a date column carry it. */
.entry-list { display: flex; flex-direction: column; }

.entry {
  display: grid;
  gap: var(--space-2xs) var(--space-lg);
  padding-block: var(--space-xl);
  border-block-start: 1px solid var(--color-rule);
}

.entry:first-child { border-block-start: 0; padding-block-start: 0; }

@media (min-width: 40rem) {
  .entry {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
  }
  .entry-body { grid-column: 1 / -1; }
}

.entry-title {
  font-size: var(--text-md);
  font-weight: var(--weight-semi);
  letter-spacing: var(--tracking-snug);
  margin: 0;
}

.entry-org {
  font-weight: var(--weight-normal);
  color: var(--color-ink-muted);
}

.entry-dates {
  font-size: var(--text-sm);
  color: var(--color-ink-faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.entry-body { margin-block-start: var(--space-xs); }

.bullets {
  margin: 0;
  padding-inline-start: 1.1em;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  max-width: var(--width-prose);
}

.bullets li {
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-ink);
}

.bullets li::marker { color: var(--color-ink-faint); }


/* ── 9. Contact + footer ─────────────────────────────────────────────────── */

.contact-grid {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: 1fr;
}

@media (min-width: 34rem) {
  .contact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.contact-item { display: flex; flex-direction: column; gap: var(--space-3xs); }

.contact-key {
  font-size: var(--text-2xs);
  font-weight: var(--weight-semi);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-ink-faint);
}

.contact-value {
  font-size: var(--text-md);
  color: var(--color-accent);
  text-decoration: none;
  border-block-end: 1px solid color-mix(in srgb, var(--color-accent) 30%, transparent);
  padding-block-end: 2px;
  align-self: start;
  /* Long emails and URLs must not push the page sideways at 375px. */
  overflow-wrap: anywhere;
  transition: border-color var(--transition-fast);
}

.contact-value:hover { border-block-end-color: currentColor; }

.resume-list {
  display: grid;
  gap: var(--space-sm);
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 34rem) {
  .resume-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.resume-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-md);
  padding-block: var(--space-sm);
  border-block-start: 1px solid var(--color-rule);
  font-size: var(--text-base);
  text-decoration: none;
  color: var(--color-ink);
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.resume-item:hover { color: var(--color-accent); border-block-start-color: var(--color-rule-strong); }

.resume-item span:last-child {
  font-size: var(--text-xs);
  color: var(--color-ink-faint);
  white-space: nowrap;
}

.footer {
  padding-block: var(--space-xl) var(--space-2xl);
  border-block-start: 1px solid var(--color-rule);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-lg);
  align-items: baseline;
  justify-content: space-between;
  font-size: var(--text-sm);
  color: var(--color-ink-faint);
}

.footer a { color: var(--color-ink-muted); text-decoration: none; }
.footer a:hover { color: var(--color-ink); }


/* ── 10. Case study pages ────────────────────────────────────────────────── */

.case-header { padding-block: var(--space-xl) var(--space-section); }

.case-back { margin-block-end: var(--space-2xl); display: inline-flex; }

.case-eyebrow {
  font-size: var(--text-2xs);
  font-weight: var(--weight-semi);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-ink-faint);
  margin-block-end: var(--space-md);
}

.case-title {
  font-size: var(--text-2xl);
  line-height: 1.1;
  letter-spacing: var(--tracking-tight);
  margin-block-end: var(--space-lg);
  max-width: 18ch;
}

.case-dek {
  max-width: 34ch;
  font-size: var(--text-lg);
  font-weight: var(--weight-normal);
  line-height: 1.38;
  letter-spacing: var(--tracking-snug);
  color: var(--color-ink);
  margin-block-end: var(--space-xl);
}

/* The facts strip: scale, role, provenance. Reverses the usual order — the
   reader gets the shape of the dataset before the prose starts. */
.case-facts {
  display: grid;
  gap: var(--space-lg);
  padding-block: var(--space-lg);
  border-block: 1px solid var(--color-rule);
  margin: 0;
}

@media (min-width: 40rem) {
  .case-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.case-fact { display: flex; flex-direction: column; gap: var(--space-3xs); }

.case-fact dt {
  font-size: var(--text-2xs);
  font-weight: var(--weight-semi);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-ink-faint);
}

.case-fact dd {
  margin: 0;
  font-size: var(--text-base);
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

/* Charts are captured from live dashboards, three of them on near-black
   panels and one on light grey. Rather than fight that, each figure carries
   its own matte — set per-figure with --chart-bg — so the letterboxing around
   a 1300px-wide capture is invisible instead of a grey band. */
.case-figure {
  margin-block: var(--space-2xl);
}

.case-figure-frame {
  background-color: var(--chart-bg, var(--color-surface-alt));
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-md);
  padding: clamp(0.5rem, 2vw, 1rem);
  overflow: hidden;
}

.case-figure img {
  inline-size: 100%;
  block-size: auto;
  border-radius: var(--radius-sm);
}

.case-figure figcaption {
  margin-block-start: var(--space-sm);
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--color-ink-muted);
  max-width: var(--width-prose);
}

/* A pull-out for the single number the case study exists to deliver. */
.case-result {
  margin-block: var(--space-lg);
  padding-inline-start: var(--space-lg);
  border-inline-start: 2px solid var(--color-accent);
}

.case-result p {
  font-size: var(--text-lg);
  line-height: 1.36;
  letter-spacing: var(--tracking-snug);
  max-width: 30ch;
}

.stack-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs) var(--space-md);
  margin: 0;
  padding: 0;
  list-style: none;
}

.stack-tags li {
  font-size: var(--text-base);
  color: var(--color-ink);
  padding-block-end: var(--space-3xs);
  border-block-end: 1px solid var(--color-rule-strong);
}

/* A caveat block. Stating what a result cannot prove is the point, so it gets
   real styling rather than a footnote. */
.case-caveat {
  margin-block-start: var(--space-lg);
  padding: var(--space-md) var(--space-lg);
  background-color: var(--color-surface-alt);
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-ink-muted);
  max-width: var(--width-prose);
}

.case-caveat strong { color: var(--color-ink); font-weight: var(--weight-semi); }

/* Next / previous case study */
.case-nav {
  display: grid;
  gap: var(--space-md);
  padding-block: var(--space-2xl);
  border-block-start: 1px solid var(--color-rule);
}

@media (min-width: 40rem) {
  .case-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.case-nav-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-3xs);
  padding: var(--space-md);
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: border-color var(--transition-base), background-color var(--transition-base);
}

.case-nav-item:hover {
  border-color: var(--color-rule-strong);
  background-color: var(--color-surface-alt);
}

.case-nav-key {
  font-size: var(--text-2xs);
  font-weight: var(--weight-semi);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-ink-faint);
}

.case-nav-title {
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--color-ink);
}

/* Placeholder marker. Deliberately loud — a [[REPLACE]] left on a live site
   is worse than a broken layout, so it should be impossible to miss. */
.todo {
  background-color: #fff2a8;
  color: #3d2f00;
  padding: 0.1em 0.35em;
  border-radius: var(--radius-sm);
  font-size: 0.92em;
  font-weight: var(--weight-medium);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

@media (prefers-color-scheme: dark) {
  .todo { background-color: #6b5a00; color: #fff6c2; }
}


/* ── 11. Motion, print, forced colours ───────────────────────────────────── */

/* Reveal on scroll. Content is visible by default; the hidden start state is
   applied only when JS is running AND the reader has not asked for less
   motion — so no-JS and reduced-motion both get a fully readable page. */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
  }

  .js [data-reveal].is-visible {
    opacity: 1;
    transform: none;
  }
}

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

/* Recruiters print things. */
@media print {
  :root {
    --color-bg: #fff;
    --color-ink: #000;
    --color-ink-muted: #333;
    --color-ink-faint: #555;
    --color-accent: #1f3c5c;
    --color-rule: #ccc;
  }

  .nav, .skip-link, .case-nav, .hero-actions, .footer { display: none; }

  body { font-size: 10.5pt; line-height: 1.45; }

  .section { padding-block: 1.25rem; break-inside: avoid; }
  .work-card, .entry, .case-figure { break-inside: avoid; }

  /* Print the destination of links, since a printed page cannot be clicked. */
  .prose a::after,
  .contact-value::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #555;
    word-break: break-all;
  }

  .todo { background: none; border: 1px solid #000; }
}

@media (forced-colors: active) {
  .work-card:hover,
  .case-nav-item:hover { background-color: Canvas; }

  .btn-primary { border-color: ButtonText; }

  .nav.is-stuck { border-block-end-color: CanvasText; }
}


/* ============================================================================
   12. Advertisement layer — stat band, capability cards, work showcase
   Added so the landing page carries proof above the fold: numbers and charts
   are visible without a click, and the case studies become optional depth.
   ========================================================================= */

/* ── Stat band ───────────────────────────────────────────────────────────── */

.stat-band {
  border-block: 1px solid var(--color-rule);
  background-color: var(--color-surface-alt);
  padding-block: var(--space-2xl);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-xl) var(--space-lg);
}

@media (min-width: 48rem) {
  .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Source order is dt (label) then dd (value) for correct <dl> semantics and
   screen-reader output; column-reverse puts the number on top visually. */
.stat {
  display: flex;
  flex-direction: column-reverse;
}

.stat-value {
  display: block;
  margin: 0;
  font-size: var(--text-xl);
  font-weight: var(--weight-semi);
  letter-spacing: var(--tracking-tight);
  line-height: 1.05;
  color: var(--color-ink);
  font-variant-numeric: tabular-nums;
}

.stat-label {
  display: block;
  margin: var(--space-xs) 0 0;
  font-size: var(--text-sm);
  line-height: 1.45;
  color: var(--color-ink-muted);
  text-wrap: balance;
}

/* ── Capability cards ────────────────────────────────────────────────────── */

.cap-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-lg);
}

@media (min-width: 48rem) {
  .cap-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.cap {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-lg);
  background-color: var(--color-surface);
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-md);
}

.cap-title {
  font-size: var(--text-md);
  font-weight: var(--weight-semi);
  letter-spacing: var(--tracking-snug);
  margin: 0;
}

.cap-body {
  font-size: var(--text-base);
  line-height: 1.55;
  color: var(--color-ink-muted);
  margin: 0;
}

.cap-tools {
  margin-block-start: auto;
  padding-block-start: var(--space-sm);
  border-block-start: 1px solid var(--color-rule);
  font-size: var(--text-sm);
  color: var(--color-ink-faint);
}

/* ── Work showcase — alternating chart / copy rows ───────────────────────── */

.showcase {
  display: flex;
  flex-direction: column;
  gap: var(--space-3xl);
  margin: 0;
  padding: 0;
  list-style: none;
}

.showcase-item {
  position: relative;
  display: grid;
  gap: var(--space-lg);
  align-items: center;
}

/* The showcase spans both columns of .section-grid, so the charts get the full
   page measure instead of the ~800px left over beside the label column. At
   1088px that is a 660px chart rather than a 350px one — the difference
   between readable axis labels and decoration. */
@media (min-width: 60rem) {
  .showcase-wide { grid-column: 1 / -1; }

  .showcase-item {
    grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr);
    gap: var(--space-2xl);
  }

  /* Alternate the chart side. Swapping the track sizes as well as the
     placement keeps the chart in the wide column on every row — using `order`
     alone would hand even rows the narrow one. */
  .showcase-item:nth-child(even) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.75fr);
  }
  .showcase-item:nth-child(even) .showcase-media { grid-column: 2; grid-row: 1; }
  .showcase-item:nth-child(even) .showcase-body  { grid-column: 1; grid-row: 1; }
}

.showcase-media {
  background-color: var(--chart-bg, var(--color-surface-alt));
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-md);
  padding: clamp(0.5rem, 1.5vw, 0.875rem);
  overflow: hidden;
}

.showcase-media img {
  display: block;
  inline-size: 100%;
  block-size: auto;
  border-radius: var(--radius-sm);
}

.showcase-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.showcase-eyebrow {
  font-size: var(--text-2xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-ink-faint);
  margin: 0;
}

.showcase-title {
  font-size: var(--text-lg);
  font-weight: var(--weight-semi);
  letter-spacing: var(--tracking-snug);
  margin: 0;
}

.showcase-title a { text-decoration: none; color: var(--color-ink); }

/* Stretched hit area, matching .work-card's behaviour. */
.showcase-title a::after { content: ""; position: absolute; inset: 0; }

.showcase-finding {
  font-size: var(--text-md);
  line-height: 1.4;
  letter-spacing: var(--tracking-snug);
  color: var(--color-ink);
  margin: 0;
  text-wrap: pretty;
}

.showcase-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
  margin-block: var(--space-2xs);
  padding-block: var(--space-sm);
  border-block: 1px solid var(--color-rule);
}

.showcase-stat-value {
  display: block;
  font-size: var(--text-md);
  font-weight: var(--weight-semi);
  letter-spacing: var(--tracking-snug);
  color: var(--color-ink);
  font-variant-numeric: tabular-nums;
}

.showcase-stat-label {
  display: block;
  margin-block-start: 2px;
  font-size: var(--text-xs);
  color: var(--color-ink-faint);
}

.showcase-meta {
  font-size: var(--text-sm);
  color: var(--color-ink-faint);
  margin: 0;
}

.showcase-links {
  position: relative;   /* above the stretched ::after */
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-lg);
  margin-block-start: var(--space-2xs);
}

@media (hover: hover) {
  .showcase-item:hover .arrow-link::after { transform: translateX(0.2em); }
}

.showcase-item:has(.showcase-title a:focus-visible) {
  outline: 2px solid var(--color-accent);
  outline-offset: 8px;
  border-radius: var(--radius-sm);
}
.showcase-item .showcase-title a:focus-visible { outline: none; }

/* Hero support line — sits under the statement, wider measure. */
.hero-support {
  max-width: 46ch;
  font-size: var(--text-base);
  line-height: 1.55;
  color: var(--color-ink-muted);
  margin-block-end: var(--space-md);
}
