/* ------------------------------------------------------------------
   petarcanoski.github.io
   No framework, no build step, no reset library.
   Shared by every page.
   ------------------------------------------------------------------ */

/* === fonts ======================================================== */
/* Self-hosted (SIL OFL, licences beside the files), so the site makes no
   third-party requests. Each file is a variable font cut down to the
   characters the site uses and to the weight range it needs. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../fonts/inter-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter Tight"; font-style: normal; font-weight: 500 700; font-display: swap;
  src: url("../fonts/inter-tight-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../fonts/jetbrains-mono-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* === tokens ======================================================= */
/* One scheme for everyone: a dim dark ground (no pure black) and soft
   off-white text (no pure white) to cut glare and halation, with contrast
   still at WCAG AAA for body text. Data colours are validated for protan,
   deutan and tritan colour vision (see the chart rules). */

:root {
  --bg:          #17191d;
  --bg-band:     #1a1d22;
  --surface:     #1e2126;
  --surface-2:   #24282e;
  --surface-3:   #2b3037;
  --line:        #363b44;
  --line-soft:   #292d34;
  --line-strong: #4a515b;
  --text:        #e6e6e0;   /* 10.6–14:1 on every surface */
  --muted:       #b7bcc3;   /* >= 6.9:1 */
  --faint:       #9aa0a9;   /* >= 5.0:1 */
  --accent:      #78aef0;   /* blue: the hue every colour-vision type separates */
  --accent-ink:  #0b1a2c;   /* text on accent, 7.6:1 */
  --accent-soft: rgba(120, 174, 240, .12);
  --accent-line: #34557d;
  --warn:        #f2b33d;   /* status only, always beside a text label */
  --warn-soft:   rgba(242, 179, 61, .10);
  --warn-line:   #5d4a24;
  --good:        #46c46a;   /* status only, always beside a text label */
  --selection:   #2d4a6e;
  --shadow:      0 24px 60px -36px rgba(0, 0, 0, .8);

  /* data colours, validated with the dataviz palette checker on --surface */
  --d-1:  #3987e5;  /* categorical 1 · blue   */
  --d-2:  #d95926;  /* categorical 2 · orange */
  --d-3:  #199e70;  /* categorical 3 · aqua   */
  --d-up: #3987e5;  /* diverging, positive    */
  --d-dn: #e66767;  /* diverging, negative    */
  --o-1:  #86b6ef;  /* ordinal ramp, high     */
  --o-2:  #3987e5;  /* ordinal ramp, medium   */
  --o-3:  #1c5cab;  /* ordinal ramp, low      */

  --display: "Inter Tight", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --sans:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --wrap:    1200px;
  --gutter:  clamp(1.25rem, 4.5vw, 3rem);
  --measure: 68ch;
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 10px;
  --ease: cubic-bezier(.22, .61, .36, 1);

  color-scheme: dark;
}

/* === base ========================================================= */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: var(--selection); color: var(--text); }

img, svg, video { max-width: 100%; height: auto; display: block; }

a {
  color: var(--accent);
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  text-underline-offset: 3px;
  transition: color .15s, text-decoration-color .15s;
}
a:hover { text-decoration-color: currentColor; }

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

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0;
}
h1, h2 { text-wrap: balance; }   /* the big headings only: balancing costs a layout pass */

p { margin: 0 0 1.1em; max-width: var(--measure); }
p:last-child { margin-bottom: 0; }

/* no italics anywhere; emphasis is carried by weight */
em, i { font-style: normal; }
em { font-weight: 600; color: var(--text); }

code, .mono { font-family: var(--mono); font-size: .88em; }
code {
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  padding: .05em .38em;
  border-radius: var(--r-sm);
  color: var(--text);
}

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

.skip {
  position: absolute;
  left: -9999px; top: 0;
  z-index: 500;
  background: var(--accent);
  color: var(--accent-ink);
  padding: .7rem 1.1rem;
  font-weight: 600;
}
.skip:focus { left: 0; }

/* the hidden attribute must win over component display rules (e.g. .btn) */
[hidden] { display: none !important; }
/* JS-only buttons: shown from the first paint when JS is present (the js class is set in
   <head>), so they never pop in and push content down; hidden when JS is off */
.js [data-copy-mail][hidden], .js [data-copy-target][hidden] { display: inline-flex !important; }

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

.hl   { color: var(--accent); }
.strong { font-weight: 700; color: var(--text); }

/* === labels and headings ========================================== */

.eyebrow {
  font-family: var(--sans);
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 1rem;
  max-width: none;
}
.eyebrow b { color: var(--accent); font-weight: 600; margin-right: .5rem; }

.page-head { padding-block: clamp(3rem, 7vw, 5rem) clamp(2rem, 4vw, 3rem); border-bottom: 1px solid var(--line-soft); }
.page-title {
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 1rem;
}
.lede { color: var(--muted); font-size: clamp(1.02rem, 1.4vw, 1.14rem); max-width: 62ch; }

.sec { padding-block: clamp(3.5rem, 8vw, 6rem); position: relative; }
.band { background: var(--bg-band); border-block: 1px solid var(--line-soft); }
.sec-head { margin-bottom: clamp(1.8rem, 4vw, 2.6rem); }
.h-sec { font-size: clamp(1.8rem, 3.6vw, 2.6rem); letter-spacing: -0.025em; margin-bottom: .8rem; }

/* === header ======================================================= */

.site-head {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
  view-transition-name: site-head;
}
.site-head[data-stuck="true"] { border-bottom-color: var(--line); }
.site-head .wrap { display: flex; align-items: center; gap: 1rem; height: 4.25rem; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: var(--text);
  text-decoration: none;
  margin-right: auto;
  white-space: nowrap;
}
.brand-mark {
  width: 2rem; height: 2rem;
  border-radius: var(--r-md);
  display: grid; place-items: center;
  background: var(--text);
  color: var(--bg);
  font-family: var(--display);
  font-weight: 700;
  font-size: .82rem;
  letter-spacing: .02em;
}
.brand-name { font-family: var(--display); font-weight: 700; font-size: 1rem; letter-spacing: -0.01em; }
.brand:hover .brand-name { color: var(--accent); }

.nav { display: flex; align-items: center; gap: 1.7rem; }
.nav a {
  font-size: .9rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  position: relative;
  padding-block: .3rem;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .2s var(--ease);
}
.nav a:hover, .nav a[aria-current] { color: var(--text); }
.nav a:hover::after, .nav a[aria-current]::after { transform: scaleX(1); }

.head-cta { padding: .5rem .95rem !important; font-size: .85rem !important; }


/* mobile menu: a <details>, so it works without JS */
.m-nav { display: none; position: relative; }
.m-nav summary {
  list-style: none;
  cursor: pointer;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: .45rem .85rem;
}
.m-nav summary::-webkit-details-marker { display: none; }
.m-nav[open] summary { border-color: var(--accent-line); color: var(--accent); }
.m-nav nav {
  position: absolute;
  right: 0; top: calc(100% + .6rem);
  min-width: 13rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: .4rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.m-nav nav a {
  color: var(--text);
  text-decoration: none;
  padding: .65rem .8rem;
  border-radius: var(--r-md);
  font-size: .95rem;
  font-weight: 500;
}
.m-nav nav a:hover, .m-nav nav a[aria-current] { background: var(--surface-2); color: var(--accent); }

@media (max-width: 860px) {
  .nav, .head-cta { display: none !important; }
  .m-nav { display: block; }
}

/* === buttons ====================================================== */

.actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .72rem 1.15rem;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font: 600 .9rem/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: border-color .18s, background .18s, color .18s;
}
.btn:hover { border-color: var(--faint); background: var(--surface-2); }
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover {
  background: color-mix(in srgb, var(--accent) 86%, #fff);
  border-color: color-mix(in srgb, var(--accent) 86%, #fff);
  color: var(--accent-ink);
}
.btn-ghost { background: transparent; }
.btn .arrow { transition: transform .2s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-weight: 600;
  font-size: .92rem;
  color: var(--accent);
  text-decoration: none;
}
.link-arrow svg { width: 15px; height: 15px; transition: transform .2s var(--ease); }
.link-arrow:hover svg { transform: translateX(4px); }

/* === home: hero =================================================== */

.hero { padding-block: clamp(3rem, 8vw, 6rem) clamp(3rem, 6vw, 4.5rem); }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(200px, 22vw, 280px);
  grid-template-areas:
    "status status"
    "name   photo"
    "foot   foot";
  column-gap: clamp(1.5rem, 5vw, 4rem);
  align-items: end;
}
.hero-grid > * { min-width: 0; }

.status { grid-area: status; margin-bottom: clamp(1.4rem, 3vw, 2rem); max-width: none; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .4rem .8rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  font-size: .82rem;
  font-weight: 500;
  color: var(--text);
}
.dot-live { width: 7px; height: 7px; border-radius: 50%; background: var(--good); flex-shrink: 0; }

.name {
  grid-area: name;
  font-size: clamp(2.8rem, 7.5vw, 6rem);
  line-height: 1;
  letter-spacing: -0.035em;
  margin: 0;
}
.role {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
  color: var(--muted);
  margin: .8rem 0 0;
  letter-spacing: -0.01em;
}
.claim {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.25rem, 2.3vw, 1.75rem);
  line-height: 1.3;
  letter-spacing: -0.015em;
  max-width: 30ch;
  margin: clamp(1.4rem, 3vw, 2rem) 0 0;
}
.claim .hl { color: var(--accent); }

.hero-photo { grid-area: photo; margin: 0; align-self: end; }
.hero-photo .frame {
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  aspect-ratio: 1 / 1;
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.hero-photo figcaption {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  margin-top: .65rem;
  font-size: .78rem;
  color: var(--faint);
}

.hero-foot {
  grid-area: foot;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.5rem 3rem;
  align-items: end;
  margin-top: clamp(2rem, 4vw, 3rem);
  padding-top: clamp(1.5rem, 3vw, 2rem);
  border-top: 1px solid var(--line);
}
.hero-bio { color: var(--muted); font-size: 1.02rem; max-width: 58ch; margin: 0; }

@media (max-width: 860px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr) 34%;
    grid-template-areas: "status status" "name photo" "foot foot";
  }
  .hero-foot { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "status" "name" "photo" "foot"; }
  .hero-photo { max-width: 220px; margin-top: 2rem; }
}

/* === home: credentials ============================================ */

.creds { padding-block: 0 clamp(3.5rem, 7vw, 5rem); }
.cred-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
@media (max-width: 960px) { .cred-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .cred-grid { grid-template-columns: minmax(0, 1fr); } }
.cred { background: var(--surface); padding: clamp(1.2rem, 2.2vw, 1.6rem); display: flex; flex-direction: column; min-height: 11rem; }
.cred-k { font-size: .72rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin: 0 0 auto; }
.cred-v {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.2rem, 3.8vw, 3rem);
  line-height: 1;
  letter-spacing: -0.03em;
  margin: 1.2rem 0 .6rem;
  font-variant-numeric: tabular-nums;
}
.cred-v sup { font-size: .45em; vertical-align: super; letter-spacing: 0; color: var(--accent); margin-left: .05em; }
.cred-v small { font-size: .4em; color: var(--faint); letter-spacing: 0; font-weight: 600; margin-left: .2em; }
.cred-v.word { font-size: clamp(1.8rem, 3vw, 2.3rem); }
.cred-l { font-weight: 600; font-size: .92rem; margin: 0 0 .2rem; }
.cred-s { font-size: .84rem; color: var(--muted); margin: 0; }

/* === cards ======================================================== */

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: border-color .2s;
}
.card:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }

/* a card that is one big link, without nesting everything in <a> */
.stretch::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card .above { position: relative; z-index: 2; }

/* === home: explore ================================================ */

.explore { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 760px) { .explore { grid-template-columns: minmax(0, 1fr); } }
.ex { display: flex; flex-direction: column; }
.ex-vis {
  aspect-ratio: 16 / 8;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 1.4rem;
}
.ex-vis img { width: 100%; height: 100%; object-fit: cover; object-position: top center; border-radius: var(--r-md); border: 1px solid var(--line); }
.ex-body { padding: clamp(1.3rem, 2.4vw, 1.7rem); display: flex; flex-direction: column; flex: 1; }
.ex-k { font-size: .72rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: .6rem; max-width: none; }
.ex h3 { font-size: clamp(1.3rem, 2.2vw, 1.6rem); margin-bottom: .55rem; }
.ex h3 a { color: inherit; text-decoration: none; }
.ex-body > p:not(.ex-k):not(.ex-fact) { color: var(--muted); font-size: .95rem; }
.ex-fact {
  margin: auto 0 0;
  padding-top: 1.1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: .85rem;
  color: var(--faint);
  max-width: none;
}
.ex-fact b { font-family: var(--display); font-size: 1.25rem; color: var(--text); margin-right: .45rem; letter-spacing: -0.02em; }
.ex-fact svg { width: 18px; height: 18px; color: var(--accent); transition: transform .2s var(--ease); flex-shrink: 0; }
.ex:hover .ex-fact svg { transform: translateX(4px); }

/* static architecture sketch on the research card */
.mini-arch { width: 100%; max-width: 440px; }
.mini-arch text { font-family: var(--sans); fill: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .06em; }
.mini-arch .t-strong { fill: var(--text); font-size: 12px; letter-spacing: 0; }
.mini-arch .t-acc { fill: var(--accent); }
.mini-arch .node { fill: var(--surface); stroke: var(--line); }
.mini-arch .node-c { fill: var(--surface); stroke: var(--accent-line); }
.mini-arch .wire { stroke: var(--line); stroke-width: 1.3; fill: none; }

/* === work ========================================================= */

.work-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1rem, 2vw, 1.3rem); }
@media (max-width: 760px) { .work-grid { grid-template-columns: minmax(0, 1fr); } }

.proj { display: flex; flex-direction: column; }
.proj > * { min-width: 0; }
.proj-vis {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.proj-vis > img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.proj-vis svg { width: 100%; height: 100%; }
.proj-vis.pad { padding: 1.3rem 1.3rem 0; }
.proj-vis.pad .window { border-bottom: 0; border-radius: var(--r-md) var(--r-md) 0 0; }

.proj-body { padding: clamp(1.25rem, 2.4vw, 1.7rem); display: flex; flex-direction: column; flex: 1; }
.proj-meta {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: .65rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  max-width: none;
}
.proj :is(h2, h3) { font-size: clamp(1.3rem, 2.1vw, 1.55rem); margin-bottom: .55rem; }
.proj :is(h2, h3) a { color: inherit; text-decoration: none; }
.proj :is(h2, h3) a:hover { color: var(--accent); }
.proj-body > p:not(.proj-meta) { color: var(--muted); font-size: .93rem; }
.proj .stack { margin-top: auto; padding-top: 1.1rem; }
.proj-links { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; margin-top: 1.1rem; }

.proj-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: .4rem 0 1.2rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }
.proj-stats b { display: block; font-family: var(--display); font-size: 1.55rem; line-height: 1; letter-spacing: -0.02em; margin-bottom: .35rem; font-variant-numeric: tabular-nums; }
.proj-stats span { font-size: .78rem; color: var(--faint); line-height: 1.4; display: block; }

/* the wide feature card */
.proj.wide { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.proj.wide .proj-vis { aspect-ratio: auto; min-height: 22rem; border-bottom: 0; border-right: 1px solid var(--line); display: grid; place-items: center; padding: clamp(1.2rem, 3vw, 2.2rem); }
.proj.wide .proj-body { padding: clamp(1.5rem, 3vw, 2.3rem); }
@media (max-width: 900px) {
  .proj.wide { grid-template-columns: minmax(0, 1fr); }
  .proj.wide .proj-vis { min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }
}

.flag {
  display: inline-block;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  border-radius: var(--r-sm);
  padding: .2rem .5rem;
}

/* screenshot in a window frame */
.window { width: 100%; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); background: #0f1729; }
.window-bar {
  height: 1.6rem;
  display: flex;
  align-items: center;
  gap: .38rem;
  padding-inline: .7rem;
  background: var(--surface-3);
  border-bottom: 1px solid var(--line);
}
.window-bar i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); display: block; }
.window-bar span { margin-left: .6rem; font-family: var(--mono); font-size: .62rem; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.window img { width: 100%; }

.stack { display: flex; flex-wrap: wrap; gap: .32rem; }
.chip {
  font-family: var(--mono);
  font-size: .68rem;
  color: var(--muted);
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--r-sm);
  padding: .2rem .5rem;
  white-space: nowrap;
}
.chip.key { color: var(--text); border-color: var(--faint); }

/* drawn covers for projects without screenshots */
.cover text { font-family: var(--sans); font-size: 9px; font-weight: 600; fill: var(--faint); letter-spacing: .06em; }
.cover .c-txt { fill: var(--muted); font-weight: 500; letter-spacing: .02em; }
.cover .c-strong { fill: var(--text); font-size: 12px; font-weight: 700; letter-spacing: 0; }
.cover .c-line { stroke: var(--line); fill: none; stroke-width: 1.3; }
.cover .c-box { fill: var(--surface); stroke: var(--line); }
.cover .c-acc { fill: var(--accent); }
.cover .c-acc-s { stroke: var(--accent); fill: none; }
.cover .c-acc-soft { fill: var(--accent-soft); stroke: var(--accent-line); }
.cover .c-amb { fill: var(--d-2); }
.cover .c-lab { fill: var(--text); font-size: 10px; font-weight: 700; letter-spacing: .04em; }
.cover .c-mute { fill: var(--surface-3); }
.cover .c-grid { stroke: var(--line-soft); stroke-width: 1; }
.cover .c-pos { fill: var(--d-up); }
.cover .c-neg { fill: var(--d-dn); }

.more-card { grid-column: 1 / -1; padding: clamp(1.4rem, 2.6vw, 1.9rem); }
.more-card :is(h2, h3) { font-size: 1.3rem; margin-bottom: 1rem; }
.more-list { list-style: none; padding: 0; margin: 0 0 1.3rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2.5rem; }
@media (max-width: 700px) { .more-list { grid-template-columns: minmax(0, 1fr); } }
.more-list li { border-top: 1px solid var(--line-soft); }
.more-list a { display: flex; justify-content: space-between; gap: 1rem; padding: .72rem 0; text-decoration: none; color: var(--text); font-size: .92rem; font-weight: 500; }
.more-list a span { color: var(--faint); font-size: .82rem; font-weight: 400; text-align: right; }
.more-list a:hover { color: var(--accent); }

/* === experience =================================================== */

.timeline { list-style: none; margin: 0; padding: 0; }
.tl {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: .6rem clamp(1rem, 3vw, 2.5rem);
  padding-block: 2rem;
  border-top: 1px solid var(--line);
}
.tl:last-child { border-bottom: 1px solid var(--line); }
@media (max-width: 760px) { .tl { grid-template-columns: minmax(0, 1fr); } }
.tl-when { font-family: var(--mono); font-size: .78rem; color: var(--faint); padding-top: .35rem; }
.now { display: inline-flex; align-items: center; gap: .45rem; color: var(--good); }
.now::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--good); }
.tl :is(h2, h3) { font-size: clamp(1.2rem, 2vw, 1.45rem); margin-bottom: .2rem; }
.tl-org { color: var(--accent); font-size: .92rem; font-weight: 500; margin-bottom: .75rem; }
.tl p:not(.tl-org):not(.tl-when):not(.tl-role-when) { color: var(--muted); font-size: .96rem; }
.tl .link-arrow { margin-top: .3rem; }

/* several roles at one company, joined by a rail */
.tl-roles { list-style: none; margin: 1.1rem 0 0; padding: 0; }
.tl-role { position: relative; padding: 0 0 1.6rem 1.6rem; }
.tl-role:last-child { padding-bottom: 0; }
.tl-role::before {
  content: ""; position: absolute; left: 0; top: .5rem;
  width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong);
}
.tl-role:first-child::before { background: var(--good); }
.tl-role:not(:last-child)::after {
  content: ""; position: absolute; left: 4px; width: 1px;
  top: calc(.5rem + 9px + 5px); bottom: calc(-.5rem + 5px); background: var(--line-strong);
}
.tl .tl-role h3 { font-size: 1.08rem; margin-bottom: .15rem; }
.tl-role-when { font-family: var(--mono); font-size: .78rem; color: var(--faint); margin-bottom: .6rem; }

/* === about ======================================================== */

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: minmax(0, 1fr); } }

.panel { padding: clamp(1.4rem, 2.8vw, 1.9rem); }
.panel + .panel { margin-top: 1rem; }
.panel :is(h2, h3) { font-size: 1.25rem; margin-bottom: .35rem; }
.panel .sub { font-size: .92rem; color: var(--muted); margin-bottom: 1rem; }
.panel .yrs { font-size: .72rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin-bottom: .6rem; }
.panel > p:not(.sub):not(.yrs) { font-size: .93rem; color: var(--muted); }

.grade { display: flex; align-items: baseline; gap: .7rem; border-top: 1px solid var(--line); padding-top: 1.1rem; margin-top: 1.1rem; }
.grade b { font-family: var(--display); font-weight: 700; font-size: 2.4rem; line-height: 1; color: var(--accent); letter-spacing: -0.03em; }
.grade span { font-size: .82rem; color: var(--faint); }

.skill-group { border-top: 1px solid var(--line); padding-block: 1.1rem; display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 1rem; }
.skill-group:first-child { border-top: 0; padding-top: 0; }
@media (max-width: 520px) { .skill-group { grid-template-columns: minmax(0, 1fr); gap: .4rem; } }
.skill-group :is(h3, h4) { font-family: var(--sans); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); font-weight: 600; padding-top: .25rem; }
.skill-group p { font-size: .96rem; margin: 0; }
.skill-group .sec2 { color: var(--faint); }

.bio { font-size: clamp(1.05rem, 1.5vw, 1.2rem); color: var(--text); max-width: 64ch; margin-bottom: clamp(2rem, 4vw, 3rem); line-height: 1.6; }
.bio + .bio { margin-top: -1.8rem; color: var(--muted); }

/* === contact ====================================================== */

.contact-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: minmax(0, 1fr); } }
.mail-row { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.6rem; }
.copy-btn[data-copied="true"] { background: var(--good); border-color: var(--good); color: #06170e; }

.links { list-style: none; padding: 0; margin: 0; }
.links li { border-top: 1px solid var(--line); }
.links li:last-child { border-bottom: 1px solid var(--line); }
.links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem .2rem;
  text-decoration: none;
  color: var(--text);
  font-size: 1rem;
  font-weight: 500;
}
.links a:hover { color: var(--accent); }
.links .k { font-size: .72rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.links a:hover .k { color: var(--accent); }
.links .v { display: inline-flex; align-items: center; gap: .5rem; text-align: right; overflow-wrap: anywhere; }
.links .v svg { width: 14px; height: 14px; opacity: .6; flex-shrink: 0; }


/* === footer ======================================================= */

.site-foot { border-top: 1px solid var(--line); padding-block: 2rem; font-size: .84rem; color: var(--faint); }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: .8rem 2rem; justify-content: space-between; align-items: center; }
.site-foot p { margin: 0; max-width: none; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; }
.site-foot a { color: var(--muted); text-decoration: none; }
.site-foot a:hover { color: var(--accent); }

/* === case-study pages (research, ontora) ========================== */

.cs-hero { padding-block: clamp(3rem, 7vw, 5rem) clamp(2.5rem, 5vw, 4rem); border-bottom: 1px solid var(--line-soft); }
.crumbs { font-size: .8rem; color: var(--faint); margin-bottom: 1.8rem; display: flex; gap: .55rem; flex-wrap: wrap; max-width: none; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }

.venue {
  display: inline-flex;
  flex-wrap: wrap;
  gap: .3rem .8rem;
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  border-radius: var(--r-md);
  padding: .4rem .8rem;
  margin-bottom: 1.5rem;
}
.cs-title { font-size: clamp(2.1rem, 4.8vw, 3.6rem); line-height: 1.06; letter-spacing: -0.03em; max-width: 22ch; margin-bottom: 1.2rem; }
.cs-title.xl { font-size: clamp(3rem, 9vw, 6.5rem); letter-spacing: -0.04em; line-height: 1; }
.cs-sub { font-family: var(--display); font-weight: 500; font-size: clamp(1.1rem, 2vw, 1.4rem); line-height: 1.4; color: var(--muted); max-width: 46ch; letter-spacing: -0.01em; }
.cs-sub em { color: var(--text); font-weight: 600; }
.authors { font-size: .95rem; color: var(--muted); margin-bottom: .3rem; max-width: none; }
.authors b { color: var(--text); font-weight: 600; }
.authors .role { color: var(--accent); font-size: .88rem; font-weight: 500; }
.affil { font-size: .86rem; color: var(--faint); max-width: none; margin-bottom: 2rem; }
.cs-hero .actions { margin-top: .5rem; }

.cs-layout { display: grid; grid-template-columns: 13rem minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.cs-layout > article { min-width: 0; }
@media (max-width: 1060px) { .cs-layout { grid-template-columns: minmax(0, 1fr); } .toc { display: none; } }

.toc { position: sticky; top: 6rem; font-size: .86rem; }
.toc p { font-size: .72rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin-bottom: .9rem; }
.toc ol { list-style: none; margin: 0 0 1.6rem; padding: 0; border-left: 1px solid var(--line); }
.toc a {
  display: flex;
  gap: .6rem;
  padding: .38rem 0 .38rem .95rem;
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--muted);
  text-decoration: none;
  line-height: 1.35;
}
.toc a span { font-family: var(--mono); font-size: .7rem; color: var(--faint); padding-top: .12rem; }
.toc a:hover { color: var(--text); }
.toc a[aria-current] { color: var(--accent); border-left-color: var(--accent); }
.toc a[aria-current] span { color: var(--accent); }
.toc .btn { width: 100%; justify-content: center; font-size: .84rem; padding: .6rem .9rem; }
.toc .btn + .btn { margin-top: .5rem; }

.cs-sec { padding-block: clamp(2.8rem, 6vw, 4.2rem); border-top: 1px solid var(--line-soft); }
.cs-sec:first-child { border-top: 0; padding-top: 0; }
.cs-sec > h2 { font-size: clamp(1.7rem, 3.2vw, 2.3rem); letter-spacing: -0.025em; margin-bottom: 1.2rem; display: flex; gap: .9rem; align-items: baseline; }
.cs-sec > h2 .n { font-family: var(--mono); font-size: .82rem; color: var(--accent); font-weight: 500; letter-spacing: 0; flex-shrink: 0; }
.cs-sec h3 { font-size: 1.3rem; margin: 2.2rem 0 .8rem; }
.cs-sec > p, .cs-sec .prose p { color: var(--muted); }
.cs-sec > p b { color: var(--text); font-weight: 600; }

.pull {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  line-height: 1.45;
  letter-spacing: -0.01em;
  border-left: 3px solid var(--accent);
  padding-left: 1.3rem;
  margin: 2rem 0;
  max-width: 52ch;
  color: var(--text);
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin: 2.2rem 0 0;
}
.stat { background: var(--surface); padding: 1.15rem 1.3rem; margin: 0; }
.stat dt { font-size: .7rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin-bottom: .55rem; }
.stat dd { margin: 0; font-family: var(--display); font-weight: 700; font-size: 1.9rem; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat dd small { font-size: .8rem; color: var(--muted); font-family: var(--sans); font-weight: 500; letter-spacing: 0; margin-left: .2rem; }
.stat dd.note { font-family: var(--sans); font-size: .78rem; font-weight: 400; letter-spacing: 0; color: var(--muted); margin-top: .5rem; line-height: 1.4; }

.fig { margin: 2.2rem 0; }
.fig-body { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); padding: clamp(1rem, 3vw, 1.8rem); overflow-x: auto; }
.fig-body img { width: 100%; }
.fig figcaption { font-size: .84rem; color: var(--faint); margin-top: .85rem; max-width: 76ch; line-height: 1.6; }
.fig figcaption b { color: var(--muted); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; margin-right: .45rem; }

.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: 2rem 0; }
@media (max-width: 760px) { .gallery { grid-template-columns: minmax(0, 1fr); } }
.gallery figure { margin: 0; }
.gallery a { display: block; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); transition: border-color .2s; }
.gallery a:hover { border-color: var(--accent-line); }
.gallery figcaption { font-size: .82rem; color: var(--faint); margin-top: .6rem; line-height: 1.5; }
.gallery figcaption b { color: var(--text); font-weight: 600; }

/* horizontal bars, drawn in HTML so they reflow on any width */
.bars { display: grid; gap: .9rem; }
.bar-row { display: grid; grid-template-columns: minmax(8rem, 13rem) minmax(0, 1fr) 4.5rem; gap: .4rem 1rem; align-items: center; }
@media (max-width: 560px) { .bar-row { grid-template-columns: minmax(0, 1fr) 4rem; } .bar-row .track { grid-column: 1 / -1; grid-row: 2; } }
.bar-row .lbl { font-size: .9rem; font-weight: 500; line-height: 1.3; }
.bar-row .lbl small { display: block; color: var(--faint); font-size: .78rem; font-weight: 400; }
.bar-row .val { font-family: var(--mono); font-size: .88rem; text-align: right; font-variant-numeric: tabular-nums; }
.track { height: .6rem; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.track i { display: block; height: 100%; width: calc(var(--v) * 1%); border-radius: inherit; background: var(--accent); transform-origin: left; }
.track i.r1 { background: var(--o-1); }   /* ordinal: high */
.track i.r2 { background: var(--o-2); }   /* ordinal: medium */
.track i.r3 { background: var(--o-3); }   /* ordinal: low */
.track i.mute { background: var(--faint); opacity: .5; }
.js .bars.reveal .track i { transform: scaleX(0); }
.js .bars.reveal.in .track i { transform: scaleX(1); transition: transform 1s var(--ease) .1s; }

.diverge { display: grid; gap: .85rem; }
.dv-row { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) 5.5rem; gap: 1rem; align-items: center; }
.dv-row .lbl { font-family: var(--mono); font-size: .84rem; }
.dv-row .val { font-family: var(--mono); font-size: .86rem; text-align: right; font-variant-numeric: tabular-nums; }
.dv-track { position: relative; height: 1.5rem; }
.dv-track::before { content: ""; position: absolute; left: 50%; top: -.3rem; bottom: -.3rem; width: 1px; background: var(--faint); opacity: .6; }
.dv-track i { position: absolute; top: .25rem; bottom: .25rem; border-radius: 2px; width: calc(var(--v) / var(--max) * 50%); }
.dv-track i.up   { left: 50%; background: var(--d-up); }
.dv-track i.down { right: 50%; background: var(--d-dn); }

.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); margin: 1.6rem 0; background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 520px; }
table.data th, table.data td { padding: .72rem 1rem; text-align: right; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data td.wrap-cell { white-space: normal; text-align: left; min-width: 16rem; color: var(--muted); }
table.data thead th { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); font-weight: 600; background: var(--surface-2); border-bottom-color: var(--line); }
table.data tbody th { font-weight: 600; }
table.data tbody tr:last-child > * { border-bottom: 0; }
table.data .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
table.data tr.hi > * { background: var(--accent-soft); }
table.data tr.hi > :first-child { box-shadow: inset 3px 0 0 var(--accent); }
table.data .strong { font-weight: 700; color: var(--text); }
.table-note { font-size: .82rem; color: var(--faint); max-width: 76ch; }

.formula { font-family: var(--mono); font-size: clamp(.82rem, 1.8vw, .98rem); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 1.1rem 1.3rem; margin: 1.2rem 0; overflow-x: auto; white-space: nowrap; }
.formula .c { color: var(--accent); }
.formula .cm { color: var(--faint); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; margin: 2rem 0; list-style: none; padding: 0; }
.tile { padding: 1.35rem 1.45rem; }
.tile .num { font-family: var(--mono); font-size: .7rem; color: var(--accent); display: block; margin-bottom: .7rem; letter-spacing: .04em; }
.tile h3 { font-size: 1.12rem !important; margin: 0 0 .55rem !important; line-height: 1.25; }
.tile p { font-size: .9rem; color: var(--muted); }

.caveat { border: 1px solid var(--line); border-left: 3px solid var(--warn); border-radius: var(--r-lg); background: var(--surface); padding: clamp(1.3rem, 3vw, 2rem); margin-top: 2rem; }
.caveat .tag { display: inline-block; font-size: .7rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--warn); border: 1px solid var(--warn-line); background: var(--warn-soft); border-radius: var(--r-sm); padding: .18rem .5rem; margin-bottom: .9rem; }
.caveat h3 { margin: 0 0 1rem !important; }
.caveat ol, .caveat ul { margin: 0 0 1.1rem; padding-left: 1.15rem; color: var(--muted); font-size: .93rem; }
.caveat li { margin-bottom: .6rem; }
.caveat li b { color: var(--text); font-weight: 600; }
.caveat > p { font-size: .93rem; color: var(--muted); }

.cite { font-family: var(--mono); font-size: .82rem; line-height: 1.7; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.2rem 1.3rem; color: var(--muted); margin: 1.2rem 0; }
.cite p { max-width: none; margin: 0 0 1rem; }

/* interactive architecture (research page) */
.arch { margin: 2.2rem 0; }
.arch-board { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); padding: clamp(1.1rem, 3vw, 2rem); }
.arch-hint { font-size: .72rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin-bottom: 1.2rem; max-width: none; }
.arch-agents { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; }
.arch-node {
  text-align: left;
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 1rem 1.05rem 1.05rem;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.arch-node:hover { border-color: var(--faint); }
.arch-node[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.arch-node .an-n { font-size: .68rem; font-weight: 600; color: var(--faint); letter-spacing: .1em; display: block; margin-bottom: .45rem; }
.arch-node .an-t { display: block; font-family: var(--display); font-weight: 700; font-size: 1rem; margin-bottom: .25rem; }
.arch-node .an-m { display: block; font-family: var(--mono); font-size: .76rem; color: var(--accent); }
.arch-node .an-w { display: block; font-family: var(--mono); font-size: .72rem; color: var(--faint); margin-top: .5rem; }
.arch-bus { position: relative; height: 3.2rem; }
.arch-bus::before { content: ""; position: absolute; left: calc(100% / 6); right: calc(100% / 6); top: 1.2rem; height: 1.2rem; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 6px 6px; }
.arch-bus::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--line); }
.arch-bus span { position: absolute; left: 50%; bottom: -.05rem; transform: translateX(-50%); width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 7px solid var(--line); }
.arch-coord { display: grid; grid-template-columns: minmax(0, 1fr); max-width: 30rem; margin-inline: auto; }
.arch-coord .arch-node { border-color: var(--accent-line); }
.arch-out { max-width: none; text-align: center; margin-top: 1rem; font-size: .82rem; color: var(--faint); }
.arch-out b { color: var(--text); font-family: var(--mono); font-weight: 500; font-size: .92rem; }
.arch-out::before { content: ""; display: block; width: 1px; height: 1.2rem; margin: -1rem auto .45rem; background: var(--line); }
@media (max-width: 640px) { .arch-agents { grid-template-columns: minmax(0, 1fr); } .arch-bus::before { display: none; } }

.arch-panel { margin-top: 1rem; }
.agent-card { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg); padding: 1.1rem 1.25rem; font-family: var(--mono); font-size: .8rem; line-height: 1.75; overflow-x: auto; }
.agent-card + .agent-card { margin-top: .75rem; }
.js .agent-card { display: none; }
.js .agent-card.on { display: block; animation: fadein .3s var(--ease); }
.agent-card .ac-h { font-family: var(--display); font-size: .95rem; font-weight: 700; color: var(--text); margin-bottom: .6rem; }
.agent-card dl { margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .1rem 1.2rem; }
.agent-card dt { color: var(--accent); }
.agent-card dd { margin: 0; color: var(--muted); min-width: 0; }
.agent-card dd b { color: var(--text); font-weight: 500; }
@media (max-width: 520px) { .agent-card dl { grid-template-columns: minmax(0, 1fr); } .agent-card dd { margin-bottom: .4rem; } }

/* ontora: three local codes converge on one LOINC code */
.hook {
  margin-top: clamp(2rem, 5vw, 3rem);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  padding: clamp(1.2rem, 3vw, 2rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 5rem minmax(0, .8fr);
  align-items: center;
  gap: 1rem;
}
.hook-src { display: grid; gap: .6rem; }
.hook-code { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; border: 1px dashed var(--line); border-radius: var(--r-md); padding: .6rem .85rem; background: var(--surface-2); }
.hook-code code { background: none; border: 0; padding: 0; font-size: .86rem; color: var(--text); overflow-wrap: anywhere; }
.hook-code span { font-size: .76rem; color: var(--faint); white-space: nowrap; }
.hook-mid svg { width: 100%; height: 9rem; }
.hook-mid path { stroke: var(--line); stroke-width: 1.5; fill: none; }
.hook-mid .run { stroke: var(--accent); stroke-dasharray: 120; stroke-dashoffset: 120; }
.hook-mid .run { animation: draw 1.1s var(--ease) .2s forwards; }   /* first screen: plays on load, no script needed */
@keyframes draw { to { stroke-dashoffset: 0; } }
.hook-dst { border: 1px solid var(--accent-line); background: var(--accent-soft); border-radius: var(--r-md); padding: 1.1rem 1.2rem; }
.hook-dst small { font-size: .7rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); display: block; margin-bottom: .35rem; }
.hook-dst b { font-family: var(--mono); font-size: 1.5rem; color: var(--accent); font-weight: 500; display: block; line-height: 1.2; }
.hook-dst span { font-size: .84rem; color: var(--muted); display: block; margin-top: .35rem; line-height: 1.4; }
@media (max-width: 720px) { .hook { grid-template-columns: minmax(0, 1fr); } .hook-mid { display: none; } }

.flow { display: grid; grid-template-columns: minmax(0, .8fr) 2rem minmax(0, 1fr) 2rem minmax(0, 1fr); align-items: center; gap: .4rem; }
.flow-col { display: grid; gap: .6rem; }
.flow-box { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); padding: .8rem .95rem; font-size: .84rem; line-height: 1.4; }
.flow-box b { display: block; font-family: var(--display); font-size: .95rem; margin-bottom: .15rem; }
.flow-box span { color: var(--faint); font-family: var(--mono); font-size: .72rem; }
.flow-box.core { border-color: var(--accent-line); background: var(--accent-soft); }
.flow-box.core b { color: var(--accent); }
.flow-arrow { text-align: center; color: var(--faint); font-family: var(--mono); }
@media (max-width: 760px) { .flow { grid-template-columns: minmax(0, 1fr); } .flow-arrow { transform: rotate(90deg); } }

.splitbar { display: flex; height: 2.5rem; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); margin: 1.4rem 0 .9rem; font-family: var(--mono); font-size: .74rem; }
.splitbar div { display: flex; align-items: center; padding: 0 .75rem; white-space: nowrap; overflow: hidden; min-width: 0; }
.splitbar div + div { border-left: 2px solid var(--bg); }
.splitbar .tr { background: color-mix(in srgb, var(--d-1) 38%, var(--surface)); color: var(--text); }
.splitbar .va { background: color-mix(in srgb, var(--d-2) 42%, var(--surface)); color: var(--text); }
.splitbar .te { background: color-mix(in srgb, var(--d-3) 42%, var(--surface)); color: var(--text); }
.split-legend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; font-size: .82rem; color: var(--faint); }
.split-legend b { display: block; color: var(--text); font-weight: 500; font-family: var(--mono); font-size: .82rem; }
@media (max-width: 560px) { .split-legend { grid-template-columns: minmax(0, 1fr); } }

.suites { display: flex; height: 3rem; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); margin: 1.4rem 0 .8rem; }
.suites div { display: flex; flex-direction: column; justify-content: center; padding: 0 .8rem; min-width: 0; font-family: var(--mono); font-size: .72rem; white-space: nowrap; overflow: hidden; }
.suites b { font-size: .95rem; font-weight: 500; }
.suites div + div { border-left: 2px solid var(--bg); }
.suites .s1 { background: color-mix(in srgb, var(--d-1) 38%, var(--surface)); color: var(--text); }
.suites .s2 { background: color-mix(in srgb, var(--d-2) 42%, var(--surface)); color: var(--text); }
.suites .s3 { background: color-mix(in srgb, var(--d-3) 42%, var(--surface)); color: var(--text); }

.journey { list-style: none; margin: 1.6rem 0; padding: 0; counter-reset: j; display: grid; gap: .55rem; }
.journey li { counter-increment: j; position: relative; padding: .7rem .9rem .7rem 3.3rem; font-size: .93rem; color: var(--muted); border: 1px solid var(--line-soft); border-radius: var(--r-md); background: var(--surface); }
.journey li::before { content: counter(j, decimal-leading-zero); position: absolute; left: .95rem; top: .8rem; font-family: var(--mono); font-size: .74rem; color: var(--accent); }
.journey li.alt { border-style: dashed; }
.journey b { color: var(--text); font-weight: 600; }

.next-list { margin: 1rem 0 0; padding-left: 1.2rem; color: var(--muted); font-size: .93rem; }
.next-list li { margin-bottom: .45rem; }
.next-list b { color: var(--text); font-weight: 600; }
.footnote { font-size: .8rem; color: var(--faint); max-width: 80ch; margin-top: 2.5rem; }


.next { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; }
@media (max-width: 640px) { .next { grid-template-columns: minmax(0, 1fr); } }
.next a { display: block; padding: 1.4rem 1.5rem; text-decoration: none; color: var(--text); }
.next small { font-size: .72rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); display: block; margin-bottom: .5rem; }
.next b { font-family: var(--display); font-weight: 700; font-size: 1.3rem; letter-spacing: -0.02em; display: block; line-height: 1.2; }
.next a:hover b { color: var(--accent); }

/* === 404 ========================================================== */

.lost { min-height: 70vh; display: grid; place-items: center; text-align: center; }
.lost h1 { font-size: clamp(5rem, 18vw, 11rem); line-height: 1; letter-spacing: -0.05em; margin-bottom: 1rem; }
.lost p { margin-inline: auto; color: var(--muted); }
.lost .actions { justify-content: center; margin-top: 2rem; }

/* === motion ======================================================= */

/* hidden only while JS is present to reveal them again */
.js .reveal { opacity: 0; transform: translateY(12px); }
.js .reveal.in { opacity: 1; transform: none; transition: opacity .6s var(--ease), transform .6s var(--ease); }
.js .hero-grid > * { animation: fadein .7s var(--ease) both; }
.js .hero-grid > .hero-photo { animation-delay: .1s; }
.js .hero-grid > .hero-foot { animation-delay: .2s; }
@keyframes fadein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .3s; }


@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .js .reveal, .js .hero-grid > * { opacity: 1 !important; transform: none !important; }
  .js .bars.reveal .track i { transform: none !important; }
  .hook-mid .run { stroke-dashoffset: 0; animation: none; }
  @view-transition { navigation: none; }
}

/* === print ======================================================== */

@media print {
  .site-head, .m-nav { display: none !important; }
  body { background: #fff; color: #000; }
  .js .reveal { opacity: 1; transform: none; }
}

/* hero: name and role share the "name" grid area */
.hero-id { grid-area: name; min-width: 0; }

/* a section straight after a page header needs less air on top */
.page-head + .sec { padding-top: clamp(2rem, 4vw, 3rem); }

/* balance the name block against the portrait */
.hero-id { align-self: center; }

/* short pages (contact, 404): keep the footer at the bottom of the window */
body { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
main { flex: 1 0 auto; }

/* a white application screenshot would flash on the dim page */
.dim-img { filter: brightness(.88) contrast(.96); }

/* === reader preferences =========================================== */

/* asked for more contrast: brighter text, firmer borders */
@media (prefers-contrast: more) {
  :root {
    --text: #f4f4f0; --muted: #d4d8dd; --faint: #bcc1c8;
    --line: #5a616b; --line-soft: #474d56; --accent: #9cc4f4;
  }
  .dim-img { filter: none; }
}

/* Windows high contrast and similar: the system palette replaces ours, so
   bars, borders and focus must stay visible */
@media (forced-colors: active) {
  .track, .dv-track, .splitbar, .suites, .card, .btn, .chip, .window, .cred-grid { border: 1px solid CanvasText; }
  .track i, .dv-track i { forced-color-adjust: none; background: CanvasText !important; }
  .splitbar div, .suites div { forced-color-adjust: none; background: Canvas !important; color: CanvasText !important; }
  :focus-visible { outline-color: Highlight; }
}

/* Long write-ups: sections far below the fold skip layout until the reader
   scrolls near them. Still searchable, linkable and in the accessibility
   tree; "auto" remembers each section's real size once it has rendered. */
.cs-sec + .cs-sec { content-visibility: auto; contain-intrinsic-size: auto 900px; }

/* === brand and file icons ========================================= */
.ico { display: inline-block; width: 1em; height: 1em; flex-shrink: 0; vertical-align: -0.125em; }
.site-foot nav a { display: inline-flex; align-items: center; gap: .4rem; }
.links .k { display: inline-flex; align-items: center; gap: .6rem; }
.links .k .ico { width: 1.05rem; height: 1.05rem; color: var(--muted); }
.links a:hover .k .ico { color: var(--accent); }
/* only the trailing arrow nudges on hover, never the brand mark */
.link-arrow .ico, .link-arrow:hover .ico { transform: none; }
