/* ─────────────────────────────────────────────────────────────────────────
   BLUEPRINT — a light-only variant of the Banknote system used by
   Fortunex and Vitalex: flat, hard-edged, separated by rule and colour
   change. See docs/DESIGN-SYSTEM.md; change it in the same commit.

   Every colour is measured with
   ~/Server/.claude/skills/brb-flat-poster-theme/scripts/check-palette.py
   ───────────────────────────────────────────────────────────────────────── */

:root {
  color-scheme: light;

  --paper: #fbfaf7;        /* page ground */
  --paper-2: #f1efe9;      /* alternate band; muted text 5.88, cobalt 6.67 */
  --ink: #131211;          /* 17.93 on paper */
  --ink-2: #3a3833;        /* secondary text, 11.1 on paper */
  --muted: #5e5b55;        /* meta text, 6.48 on paper */
  --rule: #d9d6ce;         /* hairlines (non-text) */

  --cobalt: #1446c8;       /* DUAL-ROLE: 7.34 as text, 7.66 under white */
  --on-cobalt: #ffffff;    /* text and rules on a cobalt fill */
  --marker: #ffd84d;       /* FILL-ONLY: 1.33 as text. Ink on it 13.53 */
  --sky: #9db6ff;          /* TEXT-ONLY on --ink: 9.42. Never a fill */
  --ink-rule: #3a3834;     /* hairlines inside the ink band */

  --font-display: "Archivo", "Hanken Grotesk", -apple-system, system-ui, sans-serif;
  --font-body: "Hanken Grotesk", -apple-system, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1200px;
  --head-h: 64px;
}

/* ── Base ────────────────────────────────────────────────────────────── */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--head-h) + 24px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.02em;
  overflow-wrap: break-word;
}

p { margin: 0; }

a { color: var(--cobalt); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

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

::selection { background: var(--marker); color: var(--ink); }

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

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: 8px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link:focus { clip-path: none; }

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

/* ── Bilingual ───────────────────────────────────────────────────────────
   Both languages ship in the DOM. The pre-paint script sets data-lang on
   <html>, so visibility is pure CSS and there is no flash. Page bodies use
   #en / #fr wrappers; short inline strings use .t-en / .t-fr spans. */

.lang-content { display: none; }
html:not([data-lang="fr"]) #en,
html[data-lang="fr"] #fr { display: block; }

html:not([data-lang="fr"]) .t-fr,
html[data-lang="fr"] .t-en { display: none; }

/* ── Header ──────────────────────────────────────────────────────────── */

.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
}

.site-head .wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: var(--head-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0;
}

.site-nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.site-nav a {
  padding: 8px 12px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: var(--ink);
  color: var(--paper);
}

.lang-switch {
  display: flex;
  border: 1px solid var(--ink);
  flex-shrink: 0;
}

.lang-switch button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 10px;
  min-height: 34px;
  cursor: pointer;
}

.lang-switch button + button { border-left: 1px solid var(--ink); }

html:not([data-lang="fr"]) .lang-switch [data-set-lang="en"],
html[data-lang="fr"] .lang-switch [data-set-lang="fr"] {
  background: var(--ink);
  color: var(--paper);
}

@media (max-width: 860px) {
  .site-head .wrap { flex-wrap: wrap; gap: 0 16px; }
  .lang-switch { margin-left: auto; }
  .site-nav {
    order: 3;
    flex-basis: 100%;
    margin: 0 calc(var(--gutter) * -1);
    padding: 0 calc(var(--gutter) - 12px);
    border-top: 1px solid var(--rule);
    overflow-x: auto;
    scrollbar-width: none;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { padding: 10px 12px; }
  html { scroll-padding-top: 120px; }
}

/* Five links fit a phone without scrolling; Stack sits right after Experience. */
@media (max-width: 480px) {
  .site-nav a { padding: 10px 8px; font-size: 14px; }
  .site-nav .nav-optional { display: none; }
}

/* ── Type helpers ────────────────────────────────────────────────────── */

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow::before {
  content: "";
  width: 10px;
  height: 10px;
  background: var(--cobalt);
  flex-shrink: 0;
}

.mono { font-family: var(--font-mono); }

/* The single use of --marker: a highlighter stroke behind one phrase. */
.hl {
  background: var(--marker);
  color: var(--ink);
  padding: 0 0.12em;
  white-space: nowrap;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* ── Buttons ─────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border: 2px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  transition: background-color 0.12s, color 0.12s, border-color 0.12s;
}

.btn:hover { background: var(--ink); color: var(--paper); }

.btn-primary { background: var(--cobalt); border-color: var(--cobalt); color: var(--on-cobalt); }
.btn-primary:hover { background: var(--ink); border-color: var(--ink); }

.btn svg { flex-shrink: 0; }

/* ── Hero ────────────────────────────────────────────────────────────── */

.hero { padding-block: clamp(40px, 7vw, 96px) clamp(40px, 6vw, 72px); }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(24px, 5vw, 72px);
  align-items: end;
  margin-top: clamp(24px, 3vw, 36px);
}

.hero h1 {
  margin-top: 20px;
  font-size: clamp(3rem, 8.6vw, 7.25rem);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.045em;
}

.hero-lede {
  max-width: 32ch;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.8vw, 2.25rem);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.02em;
}

.hero-note {
  margin-top: 20px;
  max-width: 54ch;
  color: var(--ink-2);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-top: 32px;
}

.text-links {
  display: flex;
  gap: 18px;
  font-weight: 600;
  font-size: 15px;
}

.text-links a { color: var(--ink); }

.portrait { margin: 0; }

.portrait img {
  width: 168px;
  height: 168px;
  object-fit: cover;
  border: 1px solid var(--ink);
}

.portrait figcaption {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

@media (max-width: 720px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .portrait { order: -1; display: flex; align-items: flex-end; gap: 14px; }
  .portrait img { width: 96px; height: 96px; }
}

/* ── Facts strip ─────────────────────────────────────────────────────── */

.facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  border-top: 3px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.fact { padding: 20px 20px 22px; }
.fact:first-child { padding-left: 0; }
.fact + .fact { border-left: 1px solid var(--rule); }

.fact dt {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.fact dd {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

@media (max-width: 720px) {
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fact:nth-child(odd) { padding-left: 0; border-left: 0; }
  .fact:nth-child(n + 3) { border-top: 1px solid var(--rule); }
}

/* ── Sections ────────────────────────────────────────────────────────── */

.section { padding-block: clamp(56px, 9vw, 112px); }
.section--band { background: var(--paper-2); }

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 16px clamp(24px, 5vw, 72px);
  align-items: end;
  margin-bottom: clamp(28px, 4vw, 48px);
}

.section-head .eyebrow { grid-column: 1 / -1; }

.section-head h2 {
  font-size: clamp(2rem, 5vw, 3.75rem);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.035em;
}

.section-lede {
  max-width: 52ch;
  color: var(--ink-2);
}

@media (max-width: 720px) {
  .section-head { grid-template-columns: minmax(0, 1fr); }
}

/* ── Integration flow (the "what I do" diagram) ──────────────────────── */

.flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px minmax(0, 1.35fr) 48px minmax(0, 1fr);
  align-items: stretch;
}

.flow-node {
  border: 1px solid var(--ink);
  background: var(--paper);
  padding: 22px 22px 24px;
}

.flow-node--core {
  background: var(--cobalt);
  border-color: var(--cobalt);
  color: var(--on-cobalt);
}

.flow-node .flow-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.flow-node--core .flow-label,
.flow-node--core h3 { color: var(--on-cobalt); }

.flow-node h3 {
  margin-top: 8px;
  font-size: clamp(1.3rem, 2.2vw, 1.75rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.flow-node ul {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  font-size: 15px;
}

.flow-node li { padding: 7px 0; border-top: 1px solid var(--rule); }
.flow-node--core li { border-top-color: var(--on-cobalt); }

.flow-link {
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 20px;
  color: var(--ink);
}

.flow-link::before {
  content: "";
  grid-area: 1 / 1;
  width: 100%;
  height: 2px;
  background: var(--ink);
}

.flow-link span {
  grid-area: 1 / 1;
  background: var(--paper);
  padding: 0 4px;
  line-height: 1;
}

.section--band .flow-link span { background: var(--paper-2); }

.flow-caption {
  margin-top: 20px;
  max-width: 70ch;
  color: var(--ink-2);
}

@media (max-width: 860px) {
  .flow { grid-template-columns: minmax(0, 1fr); }
  .flow-link { height: 40px; }
  .flow-link::before { width: 2px; height: 100%; }
  .flow-link span { transform: rotate(90deg); }
}

/* ── Case studies ────────────────────────────────────────────────────── */

.case {
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
  gap: 16px 32px;
  padding-block: 32px 36px;
  border-top: 1px solid var(--ink);
}

.case:last-child { border-bottom: 1px solid var(--ink); }

.case-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
}

.case-num {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--cobalt);
}

.case-status {
  align-self: flex-start;
  padding: 2px 8px;
  border: 1px solid var(--ink);
  color: var(--ink);
}

.case-status--live { background: var(--ink); color: var(--paper); }

.case h3 {
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.case--lead h3 { font-size: clamp(1.75rem, 3.6vw, 2.75rem); }

.psi {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px 28px;
  margin-top: 20px;
}

.psi dt {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 6px;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 10px;
}

.psi dd { margin: 0; font-size: 16px; color: var(--ink-2); }

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

.tags li {
  padding: 3px 8px;
  border: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-2);
}

@media (max-width: 860px) {
  .case { grid-template-columns: minmax(0, 1fr); }
  .case-meta { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; }
  .case-num { font-size: 2rem; }
  .psi { grid-template-columns: minmax(0, 1fr); }
}

/* ── Project index (side projects) ───────────────────────────────────── */

.index { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }

.index a {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 2fr) minmax(0, 1fr) 24px;
  gap: 8px 24px;
  align-items: baseline;
  padding: 20px 12px;
  margin-inline: -12px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
  text-decoration: none;
  transition: background-color 0.12s, color 0.12s;
}

.index a:hover { background: var(--ink); color: var(--paper); }
.index a:hover .index-stack { color: var(--paper); }

.index-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
}

.index-desc { font-size: 16px; }

.index-stack {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

.index-arrow { font-family: var(--font-mono); text-align: right; }

.upstream {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: baseline;
  margin-top: 28px;
  font-size: 16px;
}

.upstream .eyebrow { margin-right: 4px; }

@media (max-width: 860px) {
  .index a { grid-template-columns: minmax(0, 1fr) 24px; }
  .index-name { grid-column: 1; }
  .index-arrow { grid-column: 2; grid-row: 1; }
  .index-desc, .index-stack { grid-column: 1 / -1; }
}

/* ── Experience ──────────────────────────────────────────────────────── */

.xp { border-top: 1px solid var(--ink); }

.xp-row {
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
  gap: 8px 32px;
  padding-block: 28px;
  border-bottom: 1px solid var(--rule);
}

.xp-when { font-family: var(--font-mono); font-size: 13px; color: var(--muted); padding-top: 6px; }

.xp-row h3 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.025em; }

.xp-role { margin-top: 2px; font-weight: 600; color: var(--ink-2); }

.xp-row ul { margin: 12px 0 0; padding: 0; list-style: none; }

.xp-row li {
  position: relative;
  padding-left: 22px;
  margin-top: 6px;
  font-size: 16px;
  color: var(--ink-2);
}

.xp-row li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 10px;
  height: 2px;
  background: var(--ink);
}

@media (max-width: 720px) {
  .xp-row { grid-template-columns: minmax(0, 1fr); }
  .xp-when { padding-top: 0; }
}

/* ── Stack + credentials ─────────────────────────────────────────────── */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 88px);
}

.split h2 {
  font-size: clamp(1.75rem, 3.6vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.stack { margin: 0; border-top: 1px solid var(--ink); }

.stack div {
  display: grid;
  grid-template-columns: minmax(0, 150px) minmax(0, 1fr);
  gap: 4px 20px;
  padding-block: 14px;
  border-bottom: 1px solid var(--rule);
}

.stack dt {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 3px;
}

.stack dd { margin: 0; font-size: 16px; }

.creds { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }

.creds li {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 12px;
  padding-block: 14px;
  border-bottom: 1px solid var(--rule);
  font-size: 16px;
}

.creds .mono { font-size: 13px; color: var(--cobalt); font-weight: 500; padding-top: 2px; }

.creds-verify {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  padding-top: 3px;
  white-space: nowrap;
}

.creds-note { margin-top: 14px; font-size: 15px; color: var(--muted); }

@media (max-width: 860px) {
  .split { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 480px) {
  .stack div { grid-template-columns: minmax(0, 1fr); }
  .creds li { grid-template-columns: 52px minmax(0, 1fr); row-gap: 4px; }
  .creds-verify { grid-column: 2; padding-top: 0; }
}

/* ── Contact band + footer (the one ink block) ───────────────────────── */

.contact {
  background: var(--ink);
  color: var(--paper);
  padding-block: clamp(64px, 10vw, 128px) 0;
}

.contact :focus-visible { outline-color: var(--sky); }

.contact .eyebrow { color: var(--paper); }

.contact h2 {
  margin-top: 20px;
  max-width: 16ch;
  color: var(--paper);
  font-size: clamp(2.25rem, 6.5vw, 5.25rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.contact-mail {
  display: inline-block;
  margin-top: clamp(28px, 4vw, 44px);
  color: var(--paper);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.25rem, 4vw, 2.5rem);
  letter-spacing: -0.02em;
  text-decoration: underline;
  text-decoration-color: var(--sky);
  text-decoration-thickness: 3px;
  text-underline-offset: 0.2em;
  overflow-wrap: anywhere;
}

.contact-mail:hover { color: var(--sky); }

.contact-sub {
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--paper);
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-top: 28px;
  font-weight: 600;
}

.contact-links a { color: var(--sky); }

.site-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: clamp(56px, 8vw, 96px);
  padding-block: 20px 28px;
  border-top: 1px solid var(--ink-rule);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--paper);
}

.site-foot a { color: var(--sky); }

/* ── About page ──────────────────────────────────────────────────────── */

.page-intro { padding-block: clamp(48px, 8vw, 104px) clamp(32px, 5vw, 56px); }

.page-intro h1 {
  margin-top: 20px;
  font-size: clamp(2.75rem, 8vw, 6rem);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.045em;
}

.page-intro .hero-lede { max-width: 30ch; }

.prose-grid {
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
  gap: 12px 32px;
  padding-block: 36px;
  border-top: 1px solid var(--ink);
}

.prose-grid h2 {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.prose { max-width: 66ch; }
.prose p + p { margin-top: 1em; }
.prose p { color: var(--ink-2); }

.prose ul { margin: 1em 0 0; padding: 0; list-style: none; }
.prose li { position: relative; padding-left: 22px; margin-top: 8px; color: var(--ink-2); }
.prose li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 10px;
  height: 2px;
  background: var(--ink);
}

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li:first-child { padding-top: 4px; }

.timeline li {
  display: grid;
  grid-template-columns: minmax(0, 120px) minmax(0, 1fr);
  gap: 16px;
  padding-block: 12px;
  border-bottom: 1px solid var(--rule);
  font-size: 16px;
}

.timeline .mono { font-size: 13px; color: var(--cobalt); font-weight: 500; padding-top: 2px; }

@media (max-width: 720px) {
  .prose-grid { grid-template-columns: minmax(0, 1fr); }
}
