/* PORTFOLIO — SPLIT RAIL (won the 2026-10 redesign as 01-split-rail-evolved)
   A fixed identity column and a scrolling work column. IBM Plex Sans for the voice,
   IBM Plex Sans Condensed for metadata. One mint accent, no shadows.
   Every colour is defined in both themes; contrast measured against bg AND surfaces. */

:root,
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B0D10;
  --surface: #111418;      /* card hover */
  --surface-2: #171A1F;    /* tags, placeholders */
  --line: #252A31;
  --text: #E6E8EB;         /* 15.9:1 on bg, 14.2 worst surface */
  --muted: #9AA1AA;        /* 7.5:1, 6.7 worst */
  --faint: #828993;        /* 5.5:1, 4.9 worst (on surface-2) */
  --accent: #5EEAD4;       /* 13.2:1, 11.8 worst */
  --accent-soft: rgba(94, 234, 212, .12);
  --glow: rgba(94, 234, 212, .38);
  --on-accent: #0B0D10;
}
[data-theme="light"] {
  color-scheme: light;
  --bg: #FAFAF9;
  --surface: #FFFFFF;
  --surface-2: #F1F2F4;
  --line: #E2E5E9;
  --text: #101215;         /* 18.0:1, 16.8 worst */
  --muted: #5A616B;        /* 6.0:1, 5.6 worst */
  --faint: #5F6772;        /* 5.5:1, 5.1 worst */
  --accent: #0F766E;       /* 5.2:1, 4.9 worst */
  --accent-soft: rgba(15, 118, 110, .09);
  --glow: rgba(15, 118, 110, .30);
  --on-accent: #FFFFFF;
}

:root {
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --cond: "IBM Plex Sans Condensed", "Arial Narrow", "Roboto Condensed", var(--sans);

  --s1: .25rem; --s2: .5rem; --s3: .75rem; --s4: 1rem;
  --s5: 1.5rem; --s6: 2.25rem; --s7: 3.5rem; --s8: 5.5rem;

  --r-card: 8px;
  --r-pill: 999px;
  --ease: cubic-bezier(.4, 0, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scrollbar-gutter: stable; background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 16px; line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s ease, color .3s ease;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 3px; }

.skip { position: absolute; left: -9999px; top: 0; z-index: 100; background: var(--accent); color: var(--on-accent); padding: var(--s3) var(--s4); font-weight: 500; border-radius: 4px; text-decoration: none; }
.skip:focus { left: var(--s4); top: var(--s4); }

/* ============================ SHELL ============================ */
.shell { max-width: 1400px; margin: 0 auto; padding: 0 clamp(1.25rem, 4vw, 3.5rem); }
@media (min-width: 1024px) {
  .shell { display: grid; grid-template-columns: minmax(360px, 40%) 1fr; gap: clamp(2rem, 5vw, 5rem); }
}

/* ============================ RAIL ============================ */
.rail { padding: var(--s7) 0 var(--s6); display: flex; flex-direction: column; }
@media (min-width: 1024px) {
  .rail {
    position: sticky; top: 0; height: 100vh; height: 100dvh;
    padding: clamp(3rem, 8vh, 6rem) 0 clamp(2rem, 5vh, 3.5rem);
    justify-content: space-between;
  }
}

.portrait { position: relative; width: 92px; margin: 0 0 var(--s5); }
.portrait::before {
  content: ""; position: absolute; inset: -34%; z-index: 0; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, var(--glow), transparent 68%);
  filter: blur(14px); opacity: 0; transition: opacity .5s ease;
}
.portrait-frame {
  position: relative; z-index: 1; width: 92px; height: 92px; border-radius: 50%; overflow: hidden;
  border: 1px solid var(--line); background: var(--surface-2);
  display: grid; place-items: center;
  transition: border-color .5s ease;
}
.portrait-ph { font-family: var(--cond); font-size: 11px; line-height: 1.3; text-align: center; color: var(--faint); }
.pimg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

h1 { margin: 0 0 var(--s5); font-weight: 400; }
.name {
  display: block; font-weight: 200;
  font-size: clamp(2.3rem, 4.4vw, 3.5rem); line-height: 1.04; letter-spacing: -.03em;
}
.role {
  display: block; margin-top: var(--s3);
  font-family: var(--cond); font-weight: 500; font-size: 15px; letter-spacing: .01em;
  color: var(--accent);
}
.rail-lede { margin: 0 0 var(--s6); max-width: 38ch; color: var(--muted); }
.intro-hint { display: none; }

/* rail nav: tick extends 28 -> 56px on hover and when active */
.rail-nav { display: none; }
@media (min-width: 1024px) { .rail-nav { display: block; } }
.rail-nav ul { list-style: none; margin: 0; padding: 0; }
.rail-nav a {
  display: flex; align-items: center; gap: var(--s3);
  padding: 6px 0; text-decoration: none;
  font-family: var(--cond); font-weight: 500; font-size: 14px; color: var(--faint);
  transition: color .25s ease;
}
.tick { display: block; width: 28px; height: 1px; background: var(--line); transition: width .25s var(--ease), background-color .25s ease; }
.rail-nav a:hover, .rail-nav a[aria-current="true"] { color: var(--text); }
.rail-nav a:hover .tick, .rail-nav a[aria-current="true"] .tick { width: 56px; background: var(--accent); }

@media (min-width: 1024px) and (max-height: 780px) {
  .rail { padding: clamp(1.75rem, 4vh, 3rem) 0 clamp(1.25rem, 3vh, 2rem); }
  .portrait, .portrait-frame { width: 68px; }
  .portrait-frame { height: 68px; }
  .portrait { margin-bottom: var(--s3); }
  .name { font-size: clamp(2.1rem, 3.6vw, 2.8rem); }
  h1 { margin-bottom: var(--s4); }
  .rail-lede { margin-bottom: var(--s5); font-size: 15px; }
  .rail-nav a { padding: 3px 0; }
}

.rail-bottom { margin-top: var(--s6); transition: opacity .5s ease .2s; }
@media (min-width: 1024px) { .rail-bottom { margin-top: 0; } }
.avail { margin: 0 0 var(--s4); display: flex; align-items: center; gap: var(--s2); font-size: 14px; color: var(--muted); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); outline: 3px solid var(--accent-soft); flex: none; }

.socials { list-style: none; margin: 0 0 0 calc(var(--s3) * -1); padding: 0; display: flex; align-items: center; gap: var(--s1); }
.socials .grow { flex: 1; }
.socials a, .theme {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  color: var(--faint); text-decoration: none;
  border: 1px solid transparent; background: transparent; cursor: pointer; padding: 0;
  transition: color .2s, border-color .2s, background-color .2s;
}
.socials svg, .theme svg { width: 16px; height: 16px; fill: currentColor; }
.socials a:hover, .theme:hover { color: var(--accent); border-color: var(--line); background: var(--surface); }
.ic-sun { display: none; }
[data-theme="light"] .ic-sun { display: block; }
[data-theme="light"] .ic-moon { display: none; }

/* ============================ CONTENT ============================ */
main { padding: 0 0 var(--s8); }
@media (min-width: 1024px) { main { padding: clamp(3rem, 8vh, 6rem) 0 var(--s8); } }
section { margin-bottom: var(--s8); scroll-margin-top: var(--s5); }
section:last-child { margin-bottom: 0; }

.sh {
  margin: 0 0 var(--s5); padding-bottom: var(--s3); border-bottom: 1px solid var(--line);
  font-family: var(--cond); font-weight: 500; font-size: 14px; letter-spacing: .02em; color: var(--faint);
}

.p { margin: 0 0 var(--s4); color: var(--muted); max-width: 62ch; }
.p.sm { font-size: 15px; }
.p.lead { font-size: 18px; color: var(--text); }

/* ---------- cards ---------- */
.cards { list-style: none; margin: 0; padding: 0; }
.card {
  display: grid; gap: var(--s2);
  padding: var(--s5) var(--s4); margin: 0 calc(var(--s4) * -1) var(--s2);
  border: 1px solid transparent; border-radius: var(--r-card);
  transition: background-color .25s ease, border-color .25s ease;
}
@media (min-width: 700px) { .card { grid-template-columns: 118px 1fr; gap: var(--s5); } }
.card:hover { background: var(--surface); border-color: var(--line); }
.years {
  margin: 0; padding-top: 3px;
  font-family: var(--cond); font-weight: 600; font-size: 13px; color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.card h3 { margin: 0 0 var(--s2); font-size: 1.2rem; font-weight: 500; line-height: 1.35; }
.card-t { text-decoration: none; transition: color .2s ease; }
a.card-t::after { content: " \2197"; font-size: .8em; color: var(--faint); }
.card:hover .card-t, .card-t:hover { color: var(--accent); }
.role-t { font-size: 1.05rem !important; }
.org { margin: -4px 0 var(--s3); font-family: var(--cond); font-size: 14px; color: var(--faint); }

.metric { margin: 0 0 var(--s4); font-family: var(--cond); font-size: 14px; color: var(--muted); }
.metric b { color: var(--accent); font-weight: 600; }

.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s1); }
.tags li {
  padding: 2px var(--s3); border-radius: var(--r-pill); background: var(--surface-2);
  font-family: var(--cond); font-size: 12px; color: var(--muted);
}

.bul { margin: 0; padding-left: 1.1em; color: var(--muted); font-size: 15px; }
.bul li { margin-bottom: var(--s2); }

/* ---------- image slots ---------- */
.shot {
  position: relative; margin: 0 0 var(--s4);
  aspect-ratio: var(--ratio, 16 / 10); overflow: hidden;
  border: 1px solid var(--line); border-radius: 6px;
  background:
    repeating-linear-gradient(135deg, transparent 0 11px, var(--line) 11px 12px),
    var(--surface-2);
  display: grid; place-items: center;
}
.shot-ph {
  max-width: 80%; padding: var(--s1) var(--s3); text-align: center;
  font-family: var(--cond); font-size: 13px; color: var(--faint);
  background: var(--surface-2); border-radius: 4px;
}
.shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---------- stack ---------- */
.stack { margin: 0; }
.stack > div { display: grid; gap: 2px; padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
@media (min-width: 700px) { .stack > div { grid-template-columns: 160px 1fr; gap: var(--s5); } }
.stack dt { font-family: var(--cond); font-weight: 600; font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; padding-top: 2px; }
.stack dd { margin: 0; color: var(--muted); font-size: 15px; }
.stack dd b { color: var(--text); font-weight: 500; }

/* ---------- seminars ---------- */
.more { margin-top: var(--s5); }
.more summary {
  cursor: pointer; display: inline-flex; align-items: center; gap: var(--s2); min-height: 40px;
  font-family: var(--cond); font-weight: 500; font-size: 14px; color: var(--muted);
  list-style: none;
}
.more summary::-webkit-details-marker { display: none; }
.more summary::before { content: "+"; width: 1ch; color: var(--accent); }
.more[open] summary::before { content: "\2212"; }
.more summary:hover { color: var(--text); }
.seminars { list-style: none; margin: var(--s3) 0 0; padding: 0; font-size: 14px; color: var(--muted); }
.seminars li { display: grid; grid-template-columns: 76px 1fr; gap: var(--s3); padding: 6px 0; border-bottom: 1px solid var(--line); }
.seminars span { font-family: var(--cond); font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; }

/* ---------- links ---------- */
.ulink {
  text-decoration: none; color: var(--text);
  /* Two 1px layers, no box-shadow: a resting --line rule, and the accent rule that grows over it. */
  background-image: linear-gradient(var(--accent), var(--accent)), linear-gradient(var(--line), var(--line));
  background-size: 0 1px, 100% 1px; background-position: 0 100%, 0 100%; background-repeat: no-repeat;
  padding-bottom: 1px;
  transition: background-size .3s var(--ease), color .2s ease;
}
.ulink:hover { background-size: 100% 1px, 100% 1px; color: var(--accent); }
.cv-inline { margin: var(--s5) 0 0; font-size: 15px; }

.mail-line { margin: 0 0 var(--s6); }
.mail {
  font-weight: 200; font-size: clamp(1.5rem, 4.2vw, 2.5rem); letter-spacing: -.02em;
  text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 4px;
  overflow-wrap: anywhere; transition: border-color .25s ease, color .25s ease;
}
.mail:hover { border-color: var(--accent); color: var(--accent); }
.colophon { margin: var(--s7) 0 0; max-width: 54ch; font-size: 13px; color: var(--faint); }

/* ============================ REVEAL ============================ */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .55s cubic-bezier(.2,.7,.3,1), transform .55s cubic-bezier(.2,.7,.3,1); }
.reveal.in { opacity: 1; transform: none; }

/* ============================ INTRO ============================ */
html.intro, html.intro body { overflow: hidden; }
.intro .rail-top {
  position: fixed; z-index: 3; top: 50%; left: 50%; translate: -50% -50%;
  width: min(30rem, calc(100vw - 2.5rem));
}
.intro .rail-bottom, .intro main, .intro .skip { opacity: 0; visibility: hidden; pointer-events: none; }
.intro .rail-nav { display: none; }
.intro .rail-lede { margin-bottom: var(--s4); }
.intro .intro-hint {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4);
  margin: 0; font-family: var(--cond); font-size: 14px; color: var(--faint);
}
/* Say "tap" to touch users and "click" to everyone else. */
.hint-touch { display: none; }
@media (pointer: coarse) { .hint-fine { display: none; } .hint-touch { display: inline; } }
/* The escape hatch: a real button, so nobody depends on discovering the portrait gate. */
.intro-skip {
  min-height: 40px; padding: 0 var(--s4); border-radius: var(--r-pill);
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  font: 500 14px var(--cond); cursor: pointer;
  transition: color .2s ease, border-color .2s ease;
}
.intro-skip:hover { color: var(--accent); border-color: var(--accent); }
.intro .portrait::before { opacity: 1; animation: glow-breathe 4s ease-in-out infinite; }
.intro .portrait-frame { border-color: var(--accent); }
@keyframes glow-breathe {
  0%, 100% { opacity: .55; transform: scale(.96); }
  50% { opacity: 1; transform: scale(1.05); }
}
.intro-go { display: none; }
.intro .intro-go {
  display: block; position: absolute; inset: 0; z-index: 2;
  padding: 0; border: 0; background: transparent; border-radius: 50%; cursor: pointer;
}

/* ============================ CURSOR ============================ */
.cur-dot, .cur-ring { position: fixed; top: 0; left: 0; pointer-events: none; opacity: 0; }
.cur-dot {
  z-index: 92; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: var(--accent);
  transform: translate3d(-100px, -100px, 0); transition: opacity .2s ease;
}
.cur-ring {
  z-index: 91; width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border: 1px solid var(--accent); border-radius: 50%;
  transform: translate3d(-100px, -100px, 0);
  transition: opacity .2s ease, width .3s cubic-bezier(.2,.8,.3,1), height .3s cubic-bezier(.2,.8,.3,1),
              margin .3s cubic-bezier(.2,.8,.3,1), border-radius .3s ease, background-color .3s ease;
}
.cur-dot.on, .cur-ring.on { opacity: 1; }
.cur-ring.snap { background: var(--accent-soft); border-radius: 6px; }
.cur-dot.snap { opacity: 0; }
html.cursor-active, html.cursor-active * { cursor: none; }
@media (pointer: coarse) { .cur-dot, .cur-ring { display: none; } }

/* ============================ REDUCED MOTION ============================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body { transition: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .tick, .rail-bottom, .card, .ulink, .mail { transition: none; }
  .intro .portrait::before { animation: none; opacity: .8; }
}

/* ============================ PHONES AND TABLETS (< 1024px) ============================
   Below 1024 the rail is a plain block at the top that scrolls away: no sticky, no 100dvh,
   no rail nav. Tighten the gap between the lede and the availability line, which reads as
   a hole once the two halves of the rail are stacked instead of pinned apart. */
@media (max-width: 1023px) {
  .rail { padding-bottom: var(--s5); }
  .rail-lede { margin-bottom: var(--s5); }
  .rail-bottom { margin-top: 0; }
}

/* Touch: standalone links get a 40px-tall hit area. Links inside running prose keep their
   line height; WCAG 2.5.8 exempts inline targets, and padding them would wreck the rhythm. */
@media (pointer: coarse) {
  .card-t, .stack .ulink, .cv-inline .ulink, .mail {
    display: inline-block; padding-top: var(--s2); padding-bottom: var(--s2);
    background-position: 0 calc(100% - var(--s2)), 0 calc(100% - var(--s2));
  }
  .stack > div { align-items: center; }
}

/* ====================== LANDING PAGES (landing-pages.html) ======================
   A second page, one column, no rail. It borrows every token and the .ulink / .theme /
   .shot components; only the grid of phone cards is new. */
.lp-shell { max-width: 1120px; margin: 0 auto; padding: 0 clamp(1.25rem, 4vw, 3.5rem) var(--s8); }
.lp-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); padding: var(--s5) 0; }
.lp-back { font-size: 15px; }
.lp-head { padding: var(--s6) 0 var(--s7); border-bottom: 1px solid var(--line); margin-bottom: var(--s7); }
.lp-head h1 { margin: 0 0 var(--s3); font-weight: 400; font-size: clamp(2rem, 5vw, 2.8rem); letter-spacing: -.02em; line-height: 1.15; }
.lp-head .p { margin: 0; }
.lp-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s6) var(--s4); grid-template-columns: repeat(2, 1fr); }
@media (max-width: 559px) { .lp-t { font-size: .95rem; } }
@media (min-width: 960px) { .lp-grid { grid-template-columns: repeat(3, 1fr); } }
.lp-card { display: block; text-decoration: none; border-radius: var(--r-card); }
.lp-card .shot { margin: 0 0 var(--s3); border-radius: var(--r-card); transition: border-color .25s ease; }
.lp-card .shot img { object-position: top; }
.lp-card:hover .shot { border-color: var(--accent); }
.lp-t { display: block; font-weight: 500; font-size: 1.05rem; line-height: 1.4; transition: color .2s ease; }
.lp-t::after { content: " \2197"; font-size: .8em; color: var(--faint); }
.lp-card:hover .lp-t { color: var(--accent); }
.lp-m { display: block; margin-top: 2px; font-family: var(--cond); font-size: 13px; color: var(--faint); }
@media (prefers-reduced-motion: reduce) { .lp-card .shot, .lp-t { transition: none; } }
