/* MatData — site styles. Colours, type and spacing follow the MatData design system tokens. */
:root {
  --surface: #f5f3ee;
  --surface-raised: #ffffff;
  --surface-sunken: #ebe8e0;
  --line: #d9d4c7;
  --line-strong: #8a8476;
  --ink: #0f1b2d;
  --ink-body: #2f3a48;
  --ink-muted: #4a5563;
  --brand: #0563bb;
  --brand-strong: #044a8c;
  --on-brand: #ffffff;
  --brand-soft: #e3eefa;
  --amber: #f2b300;
  --on-amber: #0f1b2d;
  --amber-soft: #fbefc7;
  --amber-ink: #6e4d00;
  --night: #0f1b2d;
  --night-deep: #0d141c;
  --night-raised: #16202b;
  --night-line: #26323e;
  --night-text: #c9d1da;
  --night-muted: #a3afba;
  --night-brand: #5aa8f2;
  --night-on-brand: #04172b;
  --focus: #044a8c;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-pill: 999px;
  --font-sans: "Barlow", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --shadow-raised: 0 1px 2px rgba(15, 27, 45, 0.08), 0 4px 12px rgba(15, 27, 45, 0.06);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; font-family: var(--font-sans); font-size: 16px; line-height: 26px; background: var(--surface); color: var(--ink); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; }
a { color: var(--brand); }
a:hover { color: var(--brand-strong); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--font-sans); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 16px; top: -48px; z-index: 20; padding: 8px 16px; background: var(--brand); color: var(--on-brand); border-radius: var(--radius-md); font-weight: 600; }
.skip-link:focus { top: 12px; color: var(--on-brand); }

/* Layout */
.wrap { max-width: 1200px; margin: 0 auto; padding-left: var(--space-6); padding-right: var(--space-6); }
.section { padding-top: 96px; padding-bottom: 96px; }
.section--white { background: var(--surface-raised); }
.section-head { display: flex; flex-direction: column; gap: var(--space-3); max-width: 720px; }
.split { display: flex; flex-wrap: wrap; gap: var(--space-12); }
.split > * { min-width: 0; }
.stack { display: flex; flex-direction: column; }

/* Type */
.eyebrow { margin: 0; font-size: 15px; line-height: 22px; font-weight: 500; color: var(--brand); }
.h2 { margin: 0; font-size: 40px; line-height: 46px; font-weight: 700; letter-spacing: -0.015em; }
.lead { margin: 0; font-size: 18px; line-height: 30px; color: var(--ink-muted); }
.muted { margin: 0; font-size: 16px; line-height: 26px; color: var(--ink-muted); }
.link-strong { font-weight: 600; }
.links { display: flex; flex-wrap: wrap; gap: 20px; }

/* Button */
.md-btn { display: inline-flex; align-items: center; gap: var(--space-2); height: 40px; padding: 0 var(--space-4); border-radius: var(--radius-md); border: 1px solid var(--line-strong); background: var(--surface-raised); color: var(--ink); font: 600 15px/1 var(--font-sans); cursor: pointer; text-decoration: none; }
.md-btn:hover { border-color: var(--ink); color: var(--ink); }
.md-btn-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.md-btn-primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); color: var(--on-brand); }
.md-btn-ghost { background: transparent; border-color: transparent; color: var(--brand); padding: 0 var(--space-2); }
.md-btn-ghost:hover { border-color: transparent; color: var(--brand-strong); text-decoration: underline; text-underline-offset: 4px; }
.md-btn-lg { height: 48px; padding: 0 var(--space-6); font-size: 16px; }
.md-btn .md-arrow { font-weight: 500; }

/* Tag */
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.md-tag { display: inline-flex; align-items: center; height: 24px; padding: 0 var(--space-2); border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface-raised); color: var(--ink); font-size: 13px; line-height: 1; font-weight: 500; }

/* LineMarker: a line number + kilometre post, like a trackside plate */
.md-line { display: inline-flex; align-items: stretch; flex: none; border-radius: var(--radius-sm); overflow: hidden; font-variant-numeric: tabular-nums; font-size: 13px; line-height: 16px; font-weight: 600; border: 1px solid var(--ink); white-space: nowrap; }
.md-line-id { background: var(--ink); color: var(--surface); padding: var(--space-1) var(--space-2); }
.md-line-km { background: var(--surface-raised); color: var(--ink); padding: var(--space-1) var(--space-2); }
.md-line-amber { border-color: var(--amber); }
.md-line-amber .md-line-id { background: var(--amber); color: var(--on-amber); }

/* TrackRule: two rails and sleepers */
.md-track { position: relative; height: 14px; background-image: repeating-linear-gradient(90deg, var(--line-strong) 0 2px, transparent 2px var(--space-6)); background-size: 100% 8px; background-position: 0 3px; background-repeat: no-repeat; }
.md-track::before, .md-track::after { content: ""; position: absolute; left: 0; right: 0; height: 2px; background: var(--ink); }
.md-track::before { top: 2px; }
.md-track::after { bottom: 2px; }

/* Graph rule: nodes and edges */
.graph-rule { display: flex; align-items: center; gap: var(--space-2); height: 14px; }
.graph-rule .n { width: 14px; height: 14px; border: 3px solid var(--brand); border-radius: var(--radius-pill); }
.graph-rule .n-solid { background: var(--brand); border: 0; }
.graph-rule .e { flex: 1; height: 2px; background: var(--line-strong); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: var(--surface-raised); border-bottom: 1px solid var(--line); }
.site-header .wrap { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: var(--space-4) var(--space-8); }
.brand-link { display: flex; align-items: center; }
.brand-link img { display: block; height: 30px; width: auto; }
.md-nav { display: flex; flex-wrap: wrap; gap: var(--space-6); }
.md-nav a { font-size: 15px; font-weight: 500; color: var(--ink-muted); text-decoration: none; padding: var(--space-2) 0; border-bottom: 2px solid transparent; }
.md-nav a[aria-current] { color: var(--ink); border-bottom-color: var(--amber); }
.md-nav a:hover { color: var(--ink); }
.header-actions { display: flex; align-items: center; gap: var(--space-4); }
.menu-toggle { display: none; width: 44px; height: 44px; align-items: center; justify-content: center; background: none; border: 1px solid var(--line-strong); border-radius: var(--radius-md); color: var(--ink); cursor: pointer; }

/* Hero */
.hero { position: relative; overflow: hidden; background: var(--surface-raised); min-height: 600px; display: flex; align-items: center; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 75% 30%; }
.hero-inner { position: relative; z-index: 1; width: 100%; padding-top: 96px; padding-bottom: 88px; }
.hero-copy { max-width: 540px; display: flex; flex-direction: column; gap: var(--space-6); }
.hero h1 { margin: 0; font-size: clamp(44px, 4.6vw, 64px); line-height: 1.05; font-weight: 700; letter-spacing: -0.02em; }
.hero-typed { margin: 0; min-height: 32px; font-size: 24px; line-height: 32px; font-weight: 600; }
.hero-typed .role { color: var(--brand); }
.caret { display: inline-block; width: 2px; height: 1em; margin-left: 3px; vertical-align: -0.12em; background: var(--amber); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .caret { animation: none; } }
.hero-intro { margin: 0; max-width: 34em; font-size: 20px; line-height: 32px; color: var(--ink-body); }
.hero-ctas { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }

/* Proof strip */
.proof { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.proof .wrap { padding-top: 28px; padding-bottom: 28px; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--space-6) var(--space-12); align-items: start; }
.proof-item { display: flex; gap: var(--space-3); align-items: flex-start; font-size: 15px; line-height: 22px; }
.proof-item--tags { flex-direction: column; gap: var(--space-2); }

/* Expertise */
.expertise { display: flex; flex-direction: column; gap: var(--space-12); }
.cards-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: var(--space-6); }
.specialism { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-8); display: flex; flex-direction: column; gap: var(--space-4); }
.specialism .md-track, .specialism .graph-rule { margin-bottom: var(--space-2); }
.specialism h3 { margin: 0; font-size: 28px; line-height: 34px; font-weight: 600; letter-spacing: -0.01em; }
.specialism .tags { margin-top: auto; }

/* Service cards */
.services { display: flex; flex-direction: column; gap: 40px; }
.cards-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: var(--space-6); }
.md-card { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-6); background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-md); }
.md-card:hover { box-shadow: var(--shadow-raised); }
.md-card h3 { margin: 0; font-size: 20px; line-height: 28px; font-weight: 600; }
.md-card p { margin: 0; font-size: 16px; line-height: 26px; color: var(--ink-muted); }
.md-card .tags { margin-top: var(--space-1); }

/* Projects */
.projects { display: flex; flex-direction: column; gap: 40px; }
.projects .section-head > a { align-self: flex-start; }
.cards-projects { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: var(--space-6); }
.project { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; display: flex; flex-direction: column; }
.project-img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; border-bottom: 1px solid var(--line); }
.project-sparql { aspect-ratio: 16 / 10; background: var(--night); border-bottom: 1px solid var(--line); padding: var(--space-8); display: flex; flex-direction: column; justify-content: center; gap: var(--space-1); font-family: var(--font-mono); font-size: 15px; line-height: 26px; color: #eef1ef; overflow: hidden; white-space: pre; }
.project-sparql .k { color: var(--amber); }
.project-sparql .i { color: var(--night-brand); }
.project-body { padding: 28px; display: flex; flex-direction: column; gap: var(--space-3); flex: 1; }
.project-body h3 { margin: 0; font-size: 28px; line-height: 34px; font-weight: 600; letter-spacing: -0.01em; }
.project-body .links { margin-top: auto; padding-top: var(--space-2); }

/* Linked Data example */
.example { align-items: flex-start; }
.example-copy { flex: 1 1 340px; display: flex; flex-direction: column; gap: 20px; }
.example-figure { flex: 1.6 1 600px; }

/* Network explorer */
.nx { width: 100%; background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 20px 20px 16px; display: flex; flex-direction: column; gap: 14px; color: var(--ink); }
.nx-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.nx-title { font-size: 15px; font-weight: 600; color: var(--brand); }
.nx-play { height: 32px; padding: 0 var(--space-3); display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--surface-raised); color: var(--ink); font: 600 13px/1 var(--font-sans); cursor: pointer; }
.nx-svg { width: 100%; height: auto; display: block; font-family: var(--font-sans); }
.nx-svg .fade { transition: opacity .6s; }
.nx-svg .ne { transition: d 1.1s ease-in-out, opacity .6s, stroke-width .6s; }
.nx-svg .halo { transition: d 1.1s ease-in-out; }
.nx-stops { position: relative; padding-top: var(--space-1); }
.nx-rail { position: absolute; left: 7%; right: 7%; top: 17px; height: 3px; background: var(--ink); }
.nx-stops-grid { position: relative; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--space-1); }
.nx-stop { min-height: 52px; padding: 0 2px; display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: 0; cursor: pointer; font: inherit; color: var(--ink-muted); }
.nx-dot { width: 26px; height: 26px; border-radius: var(--radius-pill); border: 4px solid var(--line-strong); background: var(--surface-raised); transition: background .3s, border-color .3s; }
.nx-stop-label { font-size: 14px; font-weight: 600; }
.nx-stop.is-past .nx-dot { border-color: var(--brand); }
.nx-stop[aria-current] { color: var(--ink); }
.nx-stop[aria-current] .nx-dot { border-color: var(--brand); background: var(--brand); }
.nx-caption { min-height: 52px; display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--line); padding-top: var(--space-3); }
.nx-caption-head { display: flex; align-items: baseline; gap: var(--space-2); }
.nx-step-no { font-size: 14px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.nx-step-title { font-size: 17px; line-height: 24px; }
.nx-step-sub { font-size: 15px; line-height: 22px; color: var(--ink-muted); }
.nx-source { align-self: flex-start; font-size: 13px; }

/* Timelines (track record, talks) */
.timeline-intro { flex: 1 1 300px; display: flex; flex-direction: column; gap: var(--space-3); }
.timeline-intro .md-btn { align-self: flex-start; margin-top: var(--space-2); }
.timeline { flex: 2 1 560px; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline > li { display: grid; grid-template-columns: 150px 1fr; gap: 6px var(--space-6); padding: 20px 0; border-bottom: 1px solid var(--line); }
.timeline > li:last-child { border-bottom: 0; }
.timeline h3 { margin: 0; font-size: 20px; line-height: 28px; font-weight: 600; }
.timeline p { margin: 4px 0 0; color: var(--ink-muted); line-height: 24px; }
.timeline--talks h3 { font-size: 19px; line-height: 27px; }
.timeline--talks p { margin-top: 2px; }
.talk-when { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; font-weight: 600; font-variant-numeric: tabular-nums; }
.badge-upcoming { font-size: 13px; line-height: 20px; font-weight: 600; padding: 2px 8px; border-radius: var(--radius-sm); background: var(--amber); color: var(--on-amber); }
.talk-slides { font-size: 15px; font-weight: 600; }

/* Clients */
.clients { display: flex; flex-direction: column; gap: var(--space-8); padding-top: 80px; padding-bottom: 80px; }
.clients-title { margin: 0; font-size: 15px; line-height: 22px; font-weight: 500; color: var(--ink-muted); }
.clients-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--space-4); }
.client { height: 88px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-raised); display: flex; align-items: center; justify-content: center; padding: var(--space-4) 20px; transition: border-color .2s, box-shadow .2s; }
.client:hover { border-color: var(--line-strong); box-shadow: var(--shadow-raised); }
.client img { display: block; max-width: 100%; max-height: 48px; width: auto; height: auto; object-fit: contain; }

/* About */
.about { align-items: center; }
.about-figure { flex: 1 1 420px; margin: 0; }
.about-figure img { display: block; width: 100%; height: auto; max-width: 400px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: var(--radius-md); }
.about-copy { flex: 1 1 420px; display: flex; flex-direction: column; gap: 20px; }
.about-copy .about-text { margin: 0; font-size: 18px; line-height: 30px; }

/* Contact */
.contact { background: var(--night); color: var(--surface); }
.contact .split { gap: 56px; }
.contact-copy { flex: 1 1 380px; display: flex; flex-direction: column; gap: 20px; }
.contact .eyebrow { color: var(--amber); }
.contact h2 { margin: 0; font-size: 48px; line-height: 54px; font-weight: 700; letter-spacing: -0.02em; color: #ffffff; }
.contact-intro { margin: 0; font-size: 18px; line-height: 30px; color: var(--night-text); }
.contact-details { margin: var(--space-2) 0 0; display: grid; grid-template-columns: 110px 1fr; gap: var(--space-3) var(--space-4); font-size: 16px; line-height: 24px; }
.contact-details dt { color: var(--night-muted); font-size: 15px; }
.contact-details dd { margin: 0; display: flex; align-items: center; gap: var(--space-2); }
.status-dot { width: 10px; height: 10px; border-radius: var(--radius-pill); background: var(--night-brand); }
.contact-actions { flex: 1 1 440px; display: flex; flex-direction: column; gap: var(--space-3); }
.contact-card { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-6) 28px; border-radius: var(--radius-md); text-decoration: none; }
.contact-card-text { display: flex; flex-direction: column; gap: var(--space-1); }
.contact-card-title { font-size: 20px; line-height: 28px; font-weight: 700; }
.contact-card-note { font-size: 15px; line-height: 22px; overflow-wrap: anywhere; }
.contact-card-arrow { font-size: 24px; font-weight: 600; }
.contact-card--primary, .contact-card--primary:hover { background: var(--night-brand); color: var(--night-on-brand); }
.contact-card--primary:hover { background: #7bbaf5; }
.contact-card--secondary { background: var(--night-raised); border: 1px solid var(--night-line); color: #ffffff; }
.contact-card--secondary:hover { color: #ffffff; border-color: var(--line-strong); }
.contact-card--secondary .contact-card-title { font-weight: 600; }
.contact-card--secondary .contact-card-note { color: var(--night-text); }
.contact-card--secondary .contact-card-arrow { color: var(--night-brand); }
.contact :focus-visible { outline-color: var(--amber); }

/* Footer */
.site-footer { background: var(--night-deep); color: var(--night-muted); border-top: 1px solid var(--night-line); }
.site-footer .wrap { padding-top: var(--space-8); padding-bottom: var(--space-8); display: flex; flex-wrap: wrap; gap: var(--space-4) var(--space-8); align-items: center; justify-content: space-between; font-size: 14px; line-height: 22px; }
.site-footer img { display: block; height: 24px; width: auto; }
.site-footer a { color: var(--night-muted); }
.site-footer a:hover { color: #ffffff; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 20px; }
.site-footer :focus-visible { outline-color: var(--amber); }

/* Simple content pages (privacy, 404) */
.page { max-width: 760px; margin: 0 auto; padding: 72px var(--space-6) 96px; }
.page h1 { margin: 0 0 var(--space-2); font-size: 48px; line-height: 54px; font-weight: 700; letter-spacing: -0.02em; }
.page h2 { margin: 40px 0 var(--space-3); font-size: 28px; line-height: 34px; font-weight: 600; letter-spacing: -0.01em; }
.page h3 { margin: var(--space-6) 0 var(--space-2); font-size: 20px; line-height: 28px; font-weight: 600; }
.page p, .page li { color: var(--ink-body); }
.page-meta { color: var(--ink-muted); font-size: 15px; }
.page-actions { margin-top: 40px; }

/* Phone */
@media (max-width: 900px) {
  .menu-toggle { display: inline-flex; }
  .site-header .wrap { min-height: 64px; flex-wrap: wrap; padding-left: var(--space-4); padding-right: var(--space-4); }
  .brand-link img { height: 24px; }
  .header-actions .md-btn { display: none; }
  .md-nav { display: none; order: 3; width: 100%; flex-direction: column; gap: 0; padding-bottom: var(--space-3); }
  .md-nav a { padding: var(--space-3) 0; border-bottom: 1px solid var(--line); }
  .md-nav a[aria-current] { border-bottom-color: var(--line); box-shadow: inset 3px 0 0 var(--amber); padding-left: var(--space-3); }
  .site-header.is-open .md-nav { display: flex; }
}
@media (max-width: 760px) {
  .wrap { padding-left: var(--space-4); padding-right: var(--space-4); }
  .section { padding-top: var(--space-12); padding-bottom: var(--space-12); }
  .h2 { font-size: 34px; line-height: 38px; }
  .hero { display: block; min-height: 0; }
  .hero-inner { padding-top: 40px; padding-bottom: var(--space-8); }
  .hero-copy { gap: 20px; }
  .hero h1 { font-size: 40px; line-height: 44px; }
  .hero-typed { font-size: 20px; line-height: 28px; min-height: 28px; }
  .hero-intro { font-size: 18px; line-height: 28px; color: var(--ink-muted); }
  .hero-ctas .md-btn-primary { width: 100%; justify-content: center; }
  .hero-img { position: static; display: block; height: 280px; width: calc(100% - 32px); margin: 0 auto var(--space-8); border-radius: var(--radius-md); object-position: 80% 30%; }
  .specialism { padding: var(--space-6); }
  .timeline > li { grid-template-columns: 1fr; }
  .contact h2 { font-size: 40px; line-height: 42px; }
  .contact-card { padding: 20px; }
  .contact-details { grid-template-columns: 90px 1fr; }
  .nx { padding: var(--space-3); }
  .nx-stop-label { font-size: 11px; }
  .nx-dot { width: 20px; height: 20px; border-width: 3px; }
  .nx-rail { top: 14px; }
  .page h1 { font-size: 36px; line-height: 42px; }
}
@media (max-width: 520px) {
  /* Only the current stop keeps its label on narrow screens; the caption below names it. */
  .nx-stop:not([aria-current]) .nx-stop-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .nx-stop[aria-current] .nx-stop-label { white-space: nowrap; }
}
