/* =================================================================
   PORTFOLIO — minimalist black & white scaffold

   HOW TO RESTYLE THIS SITE
   Everything visual is driven by the tokens in :root below.
   Change a token once and it updates everywhere.

     • Colours .......... --bg / --fg / --muted / --line / --accent
     • Fonts ............ --font-body / --font-head
     • Type sizes ....... --text-*
     • Spacing .......... --space-*
     • Page width ....... --container / --container-narrow / --measure
     • Corners/motion ... --radius / --transition

   Component CSS never hard-codes a colour, size or space — it only
   references tokens, so you rarely need to touch anything below :root.
   ================================================================= */

:root {
  /* ---- Colour (black & white) ------------------------------------ */
  --bg:         #ffffff;   /* page background            */
  --bg-subtle:  #f6f6f6;   /* placeholder / card fill    */
  --fg:         #0a0a0a;   /* primary text               */
  --muted:      #6f6f6f;   /* secondary text             */
  --faint:      #a6a6a6;   /* hints, captions            */
  --line:       #e6e6e6;   /* hairline borders           */
  --accent:     var(--fg); /* swap to a real colour later */
  --on-accent:  var(--bg);

  /* ---- Typography ----------------------------------------------- */
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
  --font-body: var(--font-sans);
  --font-head: var(--font-sans);

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

  /* fluid type scale — clamp(min, preferred, max) */
  --text-xs:      0.78rem;
  --text-sm:      0.875rem;
  --text-base:    1rem;
  --text-lg:      1.125rem;
  --text-xl:      clamp(1.25rem, 1.10rem + 0.7vw, 1.5rem);
  --text-2xl:     clamp(1.60rem, 1.30rem + 1.4vw, 2.25rem);
  --text-3xl:     clamp(2.20rem, 1.60rem + 2.6vw, 3.50rem);
  --text-display: clamp(2.80rem, 1.80rem + 4.5vw, 5.00rem);

  --leading-tight:  1.1;
  --leading-snug:   1.3;
  --leading-normal: 1.6;

  --tracking-tight: -0.02em;
  --tracking-wide:   0.12em;

  /* ---- Spacing scale -------------------------------------------- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --space-10: 9rem;

  /* ---- Layout --------------------------------------------------- */
  --measure: 66ch;                       /* comfortable reading width */
  --container: 1080px;                   /* page max width            */
  --container-narrow: 720px;
  --gutter: clamp(1.25rem, 5vw, 3rem);   /* side padding              */

  /* ---- Lines / corners / motion --------------------------------- */
  --hair: 1px solid var(--line);
  --radius: 0px;                         /* 0 = sharp/minimal. raise to taste */
  --transition: 200ms ease;
}

/* =================================================================
   RESET & BASE
   ================================================================= */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--space-9); /* offset sticky header on anchor jumps */
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  font-weight: var(--weight-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
  text-decoration: none;
  text-underline-offset: 0.18em;
}
a:hover { text-decoration: underline; }

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

p { text-wrap: pretty; }

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

/* =================================================================
   LAYOUT PRIMITIVES
   ================================================================= */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: var(--container-narrow); }

.section { padding-block: var(--space-9); }
.section + .section { border-top: var(--hair); }

/* vertical rhythm helper: even gaps between stacked children */
.stack > * + * { margin-top: var(--space-4); }
.stack-lg > * + * { margin-top: var(--space-6); }

.measure { max-width: var(--measure); }

/* =================================================================
   TYPOGRAPHIC UTILITIES
   ================================================================= */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--muted);
}
.lead   { font-size: var(--text-xl); line-height: var(--leading-snug); color: var(--fg); }
.muted  { color: var(--muted); }
.faint  { color: var(--faint); }

/* a bracketed inline content hint, e.g. [ replace this ] */
.hint {
  color: var(--faint);
  font-style: normal;
}
.hint::before { content: "[ "; }
.hint::after  { content: " ]"; }

/* =================================================================
   HEADER / NAV
   ================================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: var(--hair);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: var(--space-8);
}
.brand {
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
}
.nav {
  display: flex;
  gap: var(--space-5);
  font-size: var(--text-sm);
}
.nav a { color: var(--muted); }
.nav a:hover { color: var(--fg); text-decoration: none; }

@media (max-width: 540px) {
  .nav { gap: var(--space-4); }
  .nav a:not(.nav__cta) { display: none; } /* keep it clean on tiny screens */
}

/* =================================================================
   HERO
   ================================================================= */
.hero { padding-block: var(--space-10) var(--space-9); }
.hero h1 {
  font-size: var(--text-display);
  max-width: 18ch;
}
.hero .lead { margin-top: var(--space-5); max-width: 46ch; }
.hero__meta {
  margin-top: var(--space-6);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  font-size: var(--text-sm);
  color: var(--muted);
}

/* =================================================================
   PLACEHOLDERS
   .ph  = image/media placeholder block
   ================================================================= */
.ph {
  display: grid;
  place-items: center;
  background: var(--bg-subtle);
  border: var(--hair);
  border-radius: var(--radius);
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  aspect-ratio: 16 / 10;
  /* faint diagonal hatch so empty media reads as "to be filled" */
  background-image: repeating-linear-gradient(
    45deg,
    transparent 0 11px,
    color-mix(in srgb, var(--line) 55%, transparent) 11px 12px
  );
}
.ph--wide   { aspect-ratio: 21 / 9; }
.ph--square { aspect-ratio: 1 / 1; }
.ph--tall   { aspect-ratio: 4 / 5; }

/* small square logo placeholder for the "more work" list */
.ph-logo {
  flex: none;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  background: var(--bg-subtle);
  border: var(--hair);
  border-radius: var(--radius);
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

/* =================================================================
   WORK TEASERS (landing)
   ================================================================= */
.work-list { display: grid; gap: var(--space-8); }

.work-card { display: grid; gap: var(--space-5); }
.work-card a.work-card__media { display: block; }
.work-card__media .ph { transition: opacity var(--transition); }
.work-card:hover .ph { opacity: 0.78; }

.work-card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.work-card__title { font-size: var(--text-2xl); }
.work-card__role  { font-size: var(--text-sm); color: var(--muted); }
.work-card__impact { font-size: var(--text-lg); max-width: var(--measure); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--muted);
  border: var(--hair);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius);
}

/* link that reads as the primary action on a card */
.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: var(--weight-medium);
}
.arrow-link::after { content: "→"; transition: transform var(--transition); }
.arrow-link:hover { text-decoration: none; }
.arrow-link:hover::after { transform: translateX(4px); }

/* =================================================================
   CASE STUDY
   ================================================================= */
.case-hero { padding-block: var(--space-9) var(--space-7); }
.case-hero h1 { font-size: var(--text-3xl); max-width: 20ch; }

/* At-a-glance key/value grid */
.glance {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-5);
  padding-block: var(--space-6);
  border-block: var(--hair);
}
.glance dt {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--space-2);
}
.glance dd { font-size: var(--text-base); }

/* big impact numbers band */
.stat-band {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-6) var(--space-5);
}
.stat__num {
  display: block;
  font-family: var(--font-head);
  font-weight: var(--weight-bold);
  font-size: var(--text-3xl);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  font-variant-numeric: tabular-nums;
}
.stat__label {
  display: block;
  margin-top: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--muted);
  text-wrap: balance;
}

/* a numbered prose block within a case study */
.case-section { padding-block: var(--space-8); border-top: var(--hair); }
.case-section__index {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--faint);
}
.case-section h2 {
  font-size: var(--text-2xl);
  margin-top: var(--space-2);
  margin-bottom: var(--space-5);
}
.case-section p { max-width: var(--measure); color: var(--fg); }
.case-section p + p { margin-top: var(--space-4); }

/* figure with caption */
.figure { margin-top: var(--space-6); }
.figure img {
  width: 100%;
  border: var(--hair);
  border-radius: var(--radius);
  background: var(--bg-subtle);
}
/* horizontal strip of screenshots — shown at size, scrolls rather than shrinks */
.shots-row {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-6);
  overflow-x: auto;
  padding-bottom: var(--space-2);
}
.shots-row img {
  max-width: none;
  width: auto;
  height: 440px;
  flex: 0 0 auto;
  border: var(--hair);
  border-radius: var(--radius);
  background: var(--bg-subtle);
}
/* a screenshot floated on a grey backdrop — image at 80% of the frame, centred */
.shot-frame {
  background: var(--bg-subtle);
  border: var(--hair);
  border-radius: var(--radius);
}
.shot-frame img {
  display: block;
  width: 80%;
  height: auto;
  margin: 10% auto;
  border: 0;
  border-radius: 0;
  background: none;
}

/* inline product video — sits where a .ph media block would, native 16:9 so
   the app screens never get cropped. Dark fill matches the clip's background. */
.case-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #000;
  border: var(--hair);
  border-radius: var(--radius);
}

.figure figcaption {
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  color: var(--muted);
}
.figure-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-5);
  margin-top: var(--space-6);
}

/* =================================================================
   BENTO — UI craft gallery
   Justified rows: every tile in a row shares one height while widths
   scale to each image's aspect ratio (set per-figure via --ar), so the
   screens tile cleanly with no cropping.
   ================================================================= */
.bento {
  margin-top: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.bento__row {
  display: flex;
  gap: var(--space-3);
}
.bento__row figure {
  margin: 0;
  min-width: 0;
  flex: var(--ar, 1) 1 0;   /* grow ∝ aspect ratio, basis 0 → equal heights */
}
.bento__row img {
  width: 100%;
  height: auto;
  display: block;
  background: var(--bg-subtle);
  border: var(--hair);
  border-radius: var(--radius);
}
.bento__row video {
  width: 100%;
  height: auto;
  display: block;
  background: #000;
  border: var(--hair);
  border-radius: var(--radius);
}
@media (max-width: 640px) {
  .bento__row { flex-wrap: wrap; }
  /* two per row; a lone third tile grows to fill the line */
  .bento__row figure { flex: 1 1 calc(50% - var(--space-3)); }
}

/* gated / locked content block (Encompass details) */
.gate {
  margin-top: var(--space-6);
  padding: var(--space-7);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
  background: var(--bg-subtle);
}
.gate__lock { font-size: var(--text-2xl); line-height: 1; }
.gate h3 { margin-top: var(--space-3); font-size: var(--text-lg); }
.gate p { margin: var(--space-2) auto 0; max-width: 44ch; color: var(--muted); font-size: var(--text-sm); }
.gate form {
  margin-top: var(--space-5);
  display: flex;
  gap: var(--space-2);
  justify-content: center;
  flex-wrap: wrap;
}
.gate input {
  font: inherit;
  padding: var(--space-2) var(--space-3);
  border: var(--hair);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--fg);
  min-width: 220px;
}

/* =================================================================
   BUTTONS
   ================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  padding: var(--space-3) var(--space-5);
  border: 1px solid var(--fg);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--fg);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.btn:hover { background: var(--accent); color: var(--on-accent); text-decoration: none; }
.btn--solid { background: var(--accent); color: var(--on-accent); }
.btn--solid:hover { background: var(--bg); color: var(--fg); }

/* =================================================================
   MORE WORK (light mentions)
   ================================================================= */
.more-list { display: grid; gap: 0; }
.more-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding-block: var(--space-5);
  border-top: var(--hair);
}
.more-item:last-child { border-bottom: var(--hair); }
.more-item__title { font-size: var(--text-lg); }
.more-item__line  { color: var(--muted); font-size: var(--text-sm); }

/* =================================================================
   CONTACT / FOOTER
   ================================================================= */
.contact h2 { font-size: var(--text-3xl); max-width: 16ch; }
.contact .lead { margin-top: var(--space-4); }
.contact__links {
  margin-top: var(--space-6);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
  font-size: var(--text-lg);
}
.contact__links a { border-bottom: 1px solid var(--line); }
.contact__links a:hover { border-color: var(--fg); text-decoration: none; }

.site-footer {
  border-top: var(--hair);
  padding-block: var(--space-6);
  color: var(--muted);
  font-size: var(--text-sm);
}
.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

/* =================================================================
   SECTION HEADERS (shared)
   ================================================================= */
.section-head { margin-bottom: var(--space-7); }
.section-head h2 { font-size: var(--text-2xl); margin-top: var(--space-2); }

/* back link on case pages */
.backlink {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--muted);
}
.backlink::before { content: "←"; }
.backlink:hover { color: var(--fg); }

/* =================================================================
   DIAGRAM — conceptual, NDA-safe systems diagrams (B&W, no images)
   A way to show a model/structure in a case study without exposing
   real screens. Pure layout + tokens; flow reads top-to-bottom, so
   no drawn arrows — short mono labels tie the boxes together.
   ================================================================= */
.diagram {
  border: var(--hair);
  background: var(--bg-subtle);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}
.diagram__title {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--space-2);
}
.dgm-box {
  width: 100%;
  max-width: 360px;
  text-align: center;
  border: 1px solid var(--fg);
  background: var(--bg);
  padding: var(--space-3) var(--space-4);
}
.dgm-box--solid { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.dgm-box__label { font-weight: var(--weight-medium); }
.dgm-box__sub {
  display: block;
  margin-top: var(--space-1);
  font-size: var(--text-sm);
  color: var(--muted);
}
.dgm-box--solid .dgm-box__sub { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.dgm-split {
  width: 100%;
  max-width: 360px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}
.dgm-split .dgm-box { max-width: none; }
/* multi-level model diagram — wider boxes so a 3-up tier of teams fits,
   and the tiers line up under one another */
.diagram--stack .dgm-box,
.diagram--stack .dgm-split { max-width: 480px; }
.dgm-split--3 { grid-template-columns: 1fr 1fr 1fr; gap: var(--space-2); }
@media (max-width: 540px) {
  .dgm-split--3 { grid-template-columns: 1fr; }
}

/* credit-model meters — the pool and team caps as real bars with fills,
   so proportion (composition + spend-vs-cap) is visible, not just labelled */
.cm { width: 100%; max-width: 480px; }
.cm__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}
.cm__label { font-weight: var(--weight-medium); }
.cm__hint {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  color: var(--muted);
}
.cm-bar { display: flex; height: 46px; border: 1px solid var(--fg); }
.cm-bar__seg {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--space-2);
  font-size: var(--text-xs);
  line-height: 1.2;
  text-align: center;
}
.cm-bar__seg--sub { background: var(--fg); color: var(--bg); }
.cm-bar__seg--top { color: var(--muted); border-left: 1px dashed var(--fg); }
.cm__note {
  margin-top: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--muted);
}
.cm-teams {
  width: 100%;
  max-width: 480px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}
.cm-team { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.cm-meter { height: 30px; border: 1px solid var(--fg); background: var(--bg); }
.cm-meter__fill { height: 100%; background: var(--fg); }
.cm-team__cap { font-size: var(--text-xs); color: var(--muted); }
@media (max-width: 540px) {
  .cm-teams { grid-template-columns: 1fr; }
}

/* a compact, scannable list of decisions / cases inside a case section */
.case-list {
  list-style: none;
  margin: var(--space-5) 0 0;
  padding: 0;
  display: grid;
  gap: var(--space-4);
}
.case-list li {
  padding-left: var(--space-4);
  border-left: var(--hair);
}
.case-list strong { font-weight: var(--weight-medium); }

/* sub-problem heading inside a case section — splits a long section into
   clearly separated problems, each numbered with a hairline above */
.case-sub {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  margin-top: var(--space-8);
  margin-bottom: var(--space-5);
  padding-top: var(--space-6);
  border-top: var(--hair);
  font-size: var(--text-xl);
  font-weight: var(--weight-medium);
}
.case-sub__n {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: var(--weight-normal);
  color: var(--muted);
}

/* problem → solution pairs — frames a decision as the tension it resolves */
.ps { margin-top: var(--space-6); }
.ps__title {
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
  margin-bottom: var(--space-3);
}
.ps__line {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: var(--space-3);
  align-items: baseline;
}
.ps__line + .ps__line { margin-top: var(--space-2); }
.ps__tag {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--muted);
}
.ps__line--sol .ps__tag { color: var(--fg); }
@media (max-width: 540px) {
  .ps__line { grid-template-columns: 1fr; gap: var(--space-1); }
}

/* spend-path flow — shows the mechanism of one spend, not a static balance.
   Two gates in sequence, each with a "no → blocked" side branch. */
.spend-flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  max-width: 460px;
  margin-inline: auto;
}
.sf-node {
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  border: 1px solid var(--fg);
  background: var(--bg);
  padding: var(--space-3) var(--space-4);
}
.sf-node--accent { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.sf-node__sub { display: block; margin-top: 2px; font-size: var(--text-sm); color: var(--muted); }
.sf-gate {
  width: 100%;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--space-4);
  border: 1px solid var(--fg);
  background: var(--bg);
  padding: var(--space-3) var(--space-4);
}
.sf-gate__q { font-weight: var(--weight-medium); }
.sf-gate__no {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--muted);
  border-left: var(--hair);
  padding-left: var(--space-4);
}
.sf-yes {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--faint);
}
@media (max-width: 540px) {
  .sf-gate { grid-template-columns: 1fr; gap: var(--space-2); }
  .sf-gate__no { border-left: 0; border-top: var(--hair); padding-left: 0; padding-top: var(--space-2); }
}

/* Mermaid flowcharts — themed to the B&W system in the init script on the page */
.mermaid {
  margin: 0;
  padding: var(--space-6);
  background: var(--bg-subtle);
  border: var(--hair);
  text-align: center;
  overflow-x: auto;
}
.mermaid svg { max-width: 100%; height: auto; }
.dgm-tie {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--faint);
}
.dgm-foot {
  margin-top: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--fg);
  text-align: center;
}
/* a principle set apart from the diagram by a hairline — a separate idea,
   not another node in the flow */
.dgm-note {
  width: 100%;
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: var(--hair);
  text-align: center;
  font-size: var(--text-sm);
  color: var(--muted);
}
/* horizontal step row inside a diagram — reads as a left-to-right flow,
   stacks to vertical on narrow screens */
.dgm-row {
  display: flex;
  align-items: stretch;
  gap: var(--space-3);
  width: 100%;
}
.dgm-row .dgm-box {
  max-width: none;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.dgm-row .dgm-tie { align-self: center; white-space: nowrap; }
@media (max-width: 640px) {
  .dgm-row { flex-direction: column; align-items: stretch; }
}

/* =================================================================
   GATED TEASER — blurred faux screens behind a lock overlay.
   The real screens live on the Cloudflare-Access page; this blur is
   only a teaser (never real NDA art — CSS blur is reversible).
   ================================================================= */
.gate-wrap {
  position: relative;
  margin-top: var(--space-6);
  border: var(--hair);
  overflow: hidden;
}
.gate-blur {
  filter: blur(8px);
  pointer-events: none;
  user-select: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
  padding: var(--space-7);
  background: var(--bg-subtle);
}
@media (max-width: 640px) { .gate-blur { grid-template-columns: 1fr 1fr; } }
.faux-screen {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
  aspect-ratio: 4 / 5;
  padding: var(--space-4);
  background: var(--bg);
  border: var(--hair);
}
.faux-line { display: block; width: 100%; height: 10px; background: var(--line); }
.faux-line--title { height: 14px; width: 70%; background: var(--muted); }
.faux-line--mid { width: 80%; }
.faux-line--short { width: 45%; }
.faux-block { display: block; width: 100%; flex: 1; background: var(--bg-subtle); border: var(--hair); }
.faux-pill { display: block; width: 55%; height: 26px; background: var(--fg); }

/* the lock card, laid over the blurred preview */
.gate--overlay {
  position: absolute;
  inset: 0;
  margin: 0;
  border: none;
  background: color-mix(in srgb, var(--bg) 62%, transparent);
  backdrop-filter: saturate(120%) blur(2px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* compact, wide variant used as a locked cover on a landing work-card */
.gate-blur--cover {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: var(--space-3);
  height: 100%;
  padding: var(--space-5) var(--space-6);
}
.gate--compact { padding: var(--space-5); }
.gate__hint {
  margin-top: var(--space-2);
  max-width: none;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}
.work-card__media .gate-wrap { transition: opacity var(--transition); }
.work-card:hover .gate-wrap { opacity: 0.85; }
