:root {
  --ink: #101216;
  --muted: #5e6670;
  --soft: #e6e9ed;
  --paper: #fbfcfd;
  --card: #ffffff;
  --blue: #155ee8;
  --blue-dark: #0d3b99;
  --blue-pale: #eaf1ff;
  --evidence-surface: #ffffff;
  --max: 1180px;
  --radius: 18px;
  --shadow: 0 20px 60px rgba(17, 27, 46, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .32;
  background-image: linear-gradient(rgba(16, 18, 22, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(16, 18, 22, .045) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
img { display: block; max-width: 100%; }

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 20;
  padding: 10px 14px;
  color: #fff;
  background: var(--ink);
  transform: translateY(-160%);
  transition: transform .2s ease;
}
.skip-link:focus { transform: translateY(0); }

.site-header, .site-footer, main, .page-band { width: min(calc(100% - 40px), var(--max)); margin-inline: auto; }
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 86px;
  border-bottom: 1px solid var(--soft);
}
.brand { font-size: .9rem; font-weight: 850; letter-spacing: .17em; text-decoration: none; }
.brand span { color: var(--blue); }
.site-nav { display: flex; align-items: center; gap: 26px; font-size: .76rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.site-nav a { text-decoration: none; }
.site-nav a:not(.button):hover, .site-nav a[aria-current="page"] { color: var(--blue); }

.button, .button-primary, .button-quiet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 17px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-decoration: none;
  text-transform: uppercase;
  transition: transform .18s ease, background .18s ease, color .18s ease;
}
.button:hover, .button-primary:hover, .button-quiet:hover { transform: translateY(-2px); }
.button-primary { color: #fff; border-color: var(--blue); background: var(--blue); }
.button-primary:hover { background: var(--blue-dark); }
.button-quiet { border-color: var(--soft); background: #fff; }
.button-quiet:hover { border-color: var(--blue); color: var(--blue); }

.eyebrow, .mono, .card-kicker, .section-number {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.eyebrow { color: var(--blue); }
.mono, .card-kicker { color: var(--muted); }

.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr); gap: 72px; align-items: center; padding: 92px 0 72px; }
.hero h1, .page-hero h1 { max-width: 850px; margin: 15px 0 22px; font-size: clamp(3.2rem, 7vw, 6.6rem); line-height: .96; letter-spacing: -.075em; }
.hero h1 { font-size: clamp(3rem, 6.3vw, 6rem); }
.lede { max-width: 680px; margin: 0; color: #3e464f; font-size: clamp(1.1rem, 1.7vw, 1.35rem); line-height: 1.55; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-media { position: relative; min-height: 470px; padding: 20px; border: 1px solid var(--soft); background: linear-gradient(135deg, #eaf1ff, #f8fbff 56%, #dce8ff); box-shadow: var(--shadow); }
.hero-media::before { content: "PROFILE / 01"; position: absolute; top: 14px; left: 18px; color: var(--blue); font: 700 .7rem/1 "SFMono-Regular", Consolas, monospace; letter-spacing: .14em; }
.hero-media img { width: 100%; height: 100%; min-height: 430px; object-fit: cover; object-position: 50% 38%; filter: saturate(.88); }
.hero-index { position: absolute; right: 20px; bottom: 17px; color: var(--blue); font: 700 .7rem/1 "SFMono-Regular", Consolas, monospace; letter-spacing: .12em; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.stat { padding: 25px 18px 24px 0; border-right: 1px solid var(--soft); }
.stat:not(:first-child) { padding-left: 18px; }
.stat:last-child { border-right: 0; }
.stat strong { display: block; font-size: clamp(2rem, 4vw, 3.5rem); line-height: 1; letter-spacing: -.06em; }
.stat span { display: block; margin-top: 10px; color: var(--muted); }

.section { padding: 112px 0; }
.section-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 40px; border-bottom: 1px solid var(--soft); }
.section-head h2 { margin: 0 0 18px; font-size: clamp(2rem, 4vw, 3.8rem); line-height: 1; letter-spacing: -.065em; }
.section-number { color: var(--blue); }
.section-intro { max-width: 690px; margin: -18px 0 38px; color: var(--muted); font-size: 1.05rem; }

.work-teaser { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.teaser { min-height: 260px; padding: 26px; border: 1px solid var(--soft); background: rgba(255,255,255,.84); text-decoration: none; transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease; }
.teaser:hover { border-color: var(--blue); box-shadow: var(--shadow); transform: translateY(-4px); }
.teaser h3 { margin: 36px 0 9px; font-size: 1.45rem; letter-spacing: -.045em; }
.teaser p { margin: 0; color: var(--muted); }
.teaser-arrow { color: var(--blue); font-size: 1.4rem; }

.timeline { border-top: 1px solid var(--ink); }
.timeline-item { display: grid; grid-template-columns: 180px 1fr; gap: 38px; padding: 28px 0; border-bottom: 1px solid var(--soft); }
.timeline-item h3 { margin: 0 0 5px; font-size: 1.6rem; letter-spacing: -.04em; }
.timeline-item p { max-width: 780px; margin: 0; color: var(--muted); }
.timeline-item .org { margin-bottom: 10px; color: var(--ink); font-weight: 750; }

.expertise-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 26px; border-top: 1px solid var(--ink); }
.expertise-item { padding: 24px 0; border-bottom: 1px solid var(--soft); }
.expertise-item h3 { margin: 0 0 9px; font-size: 1.18rem; }
.expertise-item p { margin: 0; color: var(--muted); }

.callout { display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: center; padding: 35px; color: #fff; background: var(--ink); }
.callout h2 { max-width: 650px; margin: 0; font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1; letter-spacing: -.065em; }
.callout p { max-width: 650px; margin: 14px 0 0; color: #bac1cc; }
.callout .button-primary { color: var(--ink); border-color: #fff; background: #fff; }
.callout .button-primary:hover { color: #fff; background: var(--blue); border-color: var(--blue); }

.page-hero { padding: 82px 0 50px; }
.page-hero h1 { max-width: 900px; font-size: clamp(3.2rem, 7vw, 6.8rem); }
.page-hero .lede { max-width: 700px; }
.portfolio-metrics { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 70px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.portfolio-metric { padding: 24px 18px 24px 0; border-right: 1px solid var(--soft); }
.portfolio-metric:not(:first-child) { padding-left: 18px; }
.portfolio-metric:last-child { border-right: 0; }
.portfolio-metric strong { display: block; color: var(--blue); font-size: 2.4rem; line-height: 1; }
.portfolio-metric span { display: block; margin-top: 8px; color: var(--muted); }
.evidence-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.evidence-card { display: grid; grid-template-rows: auto 1fr; overflow: hidden; min-width: 0; border: 1px solid var(--soft); background: var(--card); }
.evidence-visual { display: grid; grid-template-rows: 64px auto; gap: 18px; padding: 20px; border-bottom: 1px solid var(--soft); background: var(--evidence-surface); }
.company-mark { display: flex; align-items: center; height: 64px; }
.company-mark > img { width: 190px; height: 56px; object-fit: contain; object-position: left center; }
/* Frame original artwork without its source-file margins; never redraw the marks. */
.logo-crop { position: relative; display: block; flex: 0 0 auto; overflow: hidden; width: 190px; height: 56px; }
.logo-crop img { position: absolute; max-width: none; }
.logo-ximedica img { width: 190px; height: auto; left: 0; top: -41px; }
.logo-xhale img { width: 204px; height: auto; left: -14px; top: -12px; }
.company-mark-pair { gap: 20px; }
.logo-assurance { width: 142px; }
.logo-assurance img { width: 324px; height: auto; left: -88px; top: -76px; }
.logo-philips { width: 142px; height: 40px; }
.logo-philips img { width: 148px; height: auto; left: -3px; top: 4px; }
.device-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.device-gallery:has(> figure:nth-child(4)) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.device-gallery figure { display: grid; grid-template-rows: 170px auto; align-content: start; min-width: 0; margin: 0; padding: 12px 8px; border: 1px solid var(--soft); background: #fff; }
.device-gallery figure:only-child { grid-column: 1 / -1; }
.device-gallery img { display: block; width: 100%; height: 170px; object-fit: contain; }
.device-gallery figcaption { padding-top: 12px; color: var(--ink); font-size: .78rem; font-weight: 750; line-height: 1.35; text-align: center; }
.device-gallery figcaption span { display: block; margin-top: 4px; color: var(--muted); font-size: .69rem; font-weight: 400; }
.evidence-copy { display: flex; flex-direction: column; padding: 26px; }
.evidence-copy h2 { margin: 9px 0 11px; font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.02; letter-spacing: -.06em; }
.evidence-copy p { margin: 0 0 14px; color: var(--muted); }
.evidence-copy .role { margin-bottom: 19px; color: var(--ink); font-size: .9rem; font-weight: 750; }
.evidence-facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; margin-top: auto; padding-top: 20px; border-top: 1px solid var(--soft); }
.fact strong { display: block; color: var(--blue); font-size: 1rem; }
.fact span { display: block; color: var(--muted); font-size: .77rem; }
.asset-note { margin: 22px 0 0; color: var(--muted); font-size: .82rem; }

.link-hub { max-width: 630px; margin: 0 auto; padding: 76px 0 108px; text-align: center; }
.link-avatar { width: 104px; height: 104px; margin: 0 auto 24px; border: 4px solid #fff; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px var(--soft), var(--shadow); }
.link-hub h1 { margin: 0; font-size: clamp(2.4rem, 7vw, 4.8rem); line-height: .95; letter-spacing: -.07em; }
.link-hub .lede { margin: 18px auto 34px; font-size: 1rem; }
.link-list { display: grid; gap: 12px; text-align: left; }
.link-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 70px; padding: 0 20px; border: 1px solid var(--soft); background: #fff; text-decoration: none; transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease; }
a.link-row:hover { border-color: var(--blue); box-shadow: var(--shadow); transform: translateY(-3px); }
.link-row strong { display: block; font-size: 1rem; }
.link-row small { display: block; margin-top: 2px; color: var(--muted); }
.link-arrow { color: var(--blue); font-size: 1.3rem; }
.link-row.is-muted { color: var(--muted); background: transparent; }
.link-row.is-muted .link-arrow { color: var(--soft); }
.link-footnote { margin-top: 28px; color: var(--muted); font-size: .77rem; }

.site-footer { display: flex; justify-content: space-between; gap: 20px; padding: 28px 0 38px; border-top: 1px solid var(--soft); color: var(--muted); font-size: .78rem; }
.site-footer a { color: var(--ink); font-weight: 750; text-decoration: none; }

@media (min-width: 821px) and (max-width: 1100px) {
  .device-gallery:has(> figure:nth-child(4)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .site-header, .site-footer, main, .page-band { width: min(calc(100% - 28px), var(--max)); }
  .site-header { align-items: flex-start; gap: 18px; padding: 20px 0; }
  .site-nav { flex-wrap: wrap; justify-content: flex-end; gap: 11px 16px; font-size: .68rem; }
  .site-nav .button { min-height: 34px; padding: 0 11px; }
  .hero { grid-template-columns: 1fr; gap: 42px; padding-top: 64px; }
  .hero-media { min-height: 360px; }
  .hero-media img { min-height: 320px; }
  .stats, .portfolio-metrics { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2), .portfolio-metric:nth-child(2) { border-right: 0; }
  .stat:nth-child(n+3), .portfolio-metric:nth-child(n+3) { border-top: 1px solid var(--soft); }
  .stat:nth-child(3), .portfolio-metric:nth-child(3) { padding-left: 0; }
  .stat:nth-child(4), .portfolio-metric:nth-child(4) { padding-left: 18px; }
  .work-teaser, .evidence-grid, .expertise-grid { grid-template-columns: 1fr; }
  .timeline-item { grid-template-columns: 1fr; gap: 8px; }
  .callout { grid-template-columns: 1fr; }
  .page-hero { padding-top: 60px; }
}

@media (max-width: 520px) {
  .site-header { display: block; }
  .site-nav { justify-content: flex-start; margin-top: 16px; }
  .hero h1, .page-hero h1 { font-size: clamp(2.9rem, 16vw, 4.4rem); }
  .section { padding: 76px 0; }
  .evidence-visual { padding: 16px; }
  .device-gallery, .device-gallery:has(> figure:nth-child(4)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .device-gallery figure { grid-template-rows: 145px auto; }
  .device-gallery img { height: 145px; }
  .device-gallery figure:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .evidence-copy { padding: 22px; }
  .company-mark-pair { gap: 10px; }
  .site-footer { display: block; }
  .site-footer p + p { margin-top: 8px; }
}

@media (max-width: 360px) {
  .company-mark-pair { gap: 8px; }
  .logo-assurance { width: 114px; height: 48px; }
  .logo-assurance img { width: 260px; left: -70px; top: -62px; }
  .logo-philips { width: 114px; height: 34px; }
  .logo-philips img { width: 119px; left: -3px; top: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
