/* Dr.techn. Osman Bodur, MSc. | shared styles
   Design: a fixed navy identity rail beside a Swiss-grid content column.
   Navy carries structure, a single brass accent marks what is active. */

/* Source Sans 3 by Adobe, SIL Open Font License 1.1 (fonts/OFL.txt).
   Self-hosted, no requests to third-party servers.
   Weights in use: 300 light, 400 regular, 600 semibold. */
@font-face {
  font-family: "Source Sans 3";
  src: url("fonts/source-sans-3-roman-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  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: "Source Sans 3";
  src: url("fonts/source-sans-3-roman-latin-ext.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("fonts/source-sans-3-italic-latin.woff2") format("woff2");
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  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: "Source Sans 3";
  src: url("fonts/source-sans-3-italic-latin-ext.woff2") format("woff2");
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ------------------------------------------------------------------ tokens */
:root {
  color-scheme: light dark;

  /* content column */
  --paper: #f7f8fa;
  --ink: #101b2b;
  --muted: #4b596b;
  --rule: #d6dce4;
  --tint: #edf0f4;
  --link: #1b4a7a;
  --link-line: #a9bdd3;
  --accent: #a67a22;            /* brass: marks, dots, thumbs (never body text) */

  /* identity rail */
  --rail: #12263f;
  --rail-ink: #eaf0f6;
  --rail-muted: #a9b8cb;
  --rail-rule: #2a4060;
  --rail-accent: #e3b661;

  --rail-width: 19rem;
  --gutter: clamp(1.25rem, 0.4rem + 3.6vw, 4.5rem);
  --bar: 3.25rem;
  --font: "Source Sans 3", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0c131d;
    --ink: #e7ecf2;
    --muted: #a0aec0;
    --rule: #243247;
    --tint: #131d2b;
    --link: #8fc1f0;
    --link-line: #35557a;
    --accent: #e3b661;

    --rail: #0a1626;
    --rail-ink: #e7ecf2;
    --rail-muted: #9fb0c5;
    --rail-rule: #1e3049;
    --rail-accent: #e3b661;
  }
}

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

[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
  font-size-adjust: 0.478;
  font-weight: 400;
  line-height: 1.6;
  font-kerning: normal;
  font-variant-numeric: lining-nums;
  overflow-wrap: break-word;
}

::selection { background: color-mix(in srgb, var(--accent) 30%, var(--paper)); }

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

/* German and Turkish build long words: on narrow screens hyphenate running text,
   never headings, display type or references */
@media (max-width: 52rem) {
  :where(html:lang(de), html:lang(tr)) main :is(p, dd, li) {
    hyphens: auto;
    hyphenate-limit-chars: 10 4 4;
  }
}
h1, h2, h3,
.statement,
.figures li,
.rows.years dd { hyphens: manual; }

a,
.textbutton {
  color: var(--link);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--link-line);
  text-underline-offset: 0.22em;
  transition: text-decoration-color 0.15s ease, color 0.15s ease;
}
a:hover,
.textbutton:hover { text-decoration-color: var(--accent); }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}
.textbutton {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  cursor: pointer;
}

.nowrap { white-space: nowrap; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 40;
  padding: 0.6rem 1rem;
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
}
.skip:focus { top: 1rem; }

/* ------------------------------------------------------------------ layout */
.layout {
  display: grid;
  grid-template-columns: var(--rail-width) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}
.page { min-width: 0; }
main,
.colophon {
  width: min(100% - 2 * var(--gutter), 62rem);
  margin-inline: auto;
}

/* -------------------------------------------------------------------- rail */
.rail {
  position: sticky;
  top: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  padding: 2.25rem 2rem 1.5rem;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--rail-rule) transparent;
  background: var(--rail);
  color: var(--rail-ink);
  font-size: 1.0625rem;
}
.rail :focus-visible,
.topbar :focus-visible,
.contactband :focus-visible { outline-color: var(--rail-accent); }

.portrait {
  display: block;
  width: 6rem;
  height: auto;
  margin: 6px 6px 1.4rem;
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  background: var(--rail-rule);
  outline: 1px solid var(--rail-rule);
  outline-offset: 5px;
}

.who {
  font-size: 1.875rem;
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.015em;
}
.who a {
  color: inherit;
  text-decoration: none;
}
.who .pre,
.who .post {
  color: var(--rail-muted);
  font-size: 0.47em;
  font-weight: 400;
  letter-spacing: 0;
}
.who .pre {
  display: block;
  margin-bottom: 0.3rem;
}
.who .name { white-space: nowrap; }

.rail .role {
  margin-top: 0.8rem;
  font-weight: 600;
  line-height: 1.35;
}
.rail .affiliation {
  margin-top: 0.4rem;
  color: var(--rail-muted);
  font-size: 0.9375em;
  line-height: 1.4;
}

.rail-nav { margin-top: 1.75rem; }
.rail-nav ul { display: grid; }
.rail-nav a {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.28rem 0 0.28rem 1rem;
  border-left: 2px solid var(--rail-rule);
  color: var(--rail-muted);
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.rail-nav a:hover { color: var(--rail-ink); }
.rail-nav a[aria-current] {
  border-left-color: var(--rail-accent);
  color: var(--rail-ink);
  font-weight: 600;
}
.rail-nav .count {
  font-weight: 400;
  font-variant-numeric: tabular-nums lining-nums;
}
.rail-nav .apart { margin-top: 0.75rem; }

.contact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.1rem 1.1rem;
  margin-top: auto;
  padding-top: 1.5rem;
  font-size: 0.9375rem;
}
.contact li:first-child { flex-basis: 100%; }
.contact a {
  color: var(--rail-muted);
  text-decoration-color: var(--rail-rule);
  overflow-wrap: anywhere;
}
.contact a:hover {
  color: var(--rail-ink);
  text-decoration-color: var(--rail-accent);
}

/* Language switcher: top right of the rail, or in the top bar on small screens */
.langs {
  display: flex;
  gap: 0.1rem;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.langs a {
  display: grid;
  place-items: center;
  min-width: 2rem;
  min-height: 2rem;
  color: var(--rail-muted);
  text-decoration: none;
}
.langs a:hover { color: var(--rail-ink); }
.langs a[aria-current] {
  color: var(--rail-ink);
  box-shadow: inset 0 -2px 0 var(--rail-accent);
}
.rail .langs {
  position: absolute;
  top: 2rem;
  right: 1.5rem;
}

/* top bar: phones and tablets only */
.topbar { display: none; }
.menu summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.75rem;
  padding-left: 1rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after {
  content: "";
  width: 1.15rem;
  height: 0.55rem;
  border-block: 2px solid currentColor;
}
.menu[open] summary::after {
  height: 0;
  border-bottom: 0;
}
.menu nav {
  position: absolute;
  inset: 100% 0 auto;
  max-height: calc(100vh - var(--bar));
  max-height: calc(100dvh - var(--bar));
  padding: 0.25rem var(--gutter) 1.25rem;
  overflow-y: auto;
  border-bottom: 1px solid var(--rail-rule);
  background: var(--rail);
}
.menu nav a {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--rail-rule);
  color: var(--rail-ink);
  text-decoration: none;
}
.menu nav a[aria-current] { color: var(--rail-accent); }

/* -------------------------------------------------------------------- hero */
.hero { padding-top: clamp(2.5rem, 1.25rem + 5vw, 5.75rem); }

.statement {
  max-width: 47rem;
  font-size: clamp(1.5rem, 1.05rem + 1.8vw, 2.5rem);
  font-weight: 300;
  line-height: 1.22;
  letter-spacing: -0.012em;
  text-wrap: pretty;
}

/* --fit is the length of the longest word: the title shrinks until that word fits the column */
h1.title {
  font-size: min(clamp(2.5rem, 1.6rem + 5vw, 4.75rem), (100vw - 2 * var(--gutter)) / (var(--fit, 10) * 0.5));
  font-weight: 300;
  line-height: 1.02;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
.crumb {
  margin-bottom: 1.1rem;
  font-size: 0.9375em;
}
.crumb a { color: var(--muted); }
.title + .statement {
  margin-top: 1.5rem;
  font-size: clamp(1.25rem, 1.05rem + 0.8vw, 1.625rem);
  line-height: 1.35;
}

/* The roughness profile and its stylus */
.gauge { margin-top: 2.75rem; }
.block .gauge { margin-top: 0; }
.gauge-stage {
  position: relative;
  margin-block: -0.75rem;
  padding-block: 0.75rem;
  touch-action: pan-y;
}
.gauge-stage.is-live { cursor: ew-resize; }
.gauge-stage:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}
.trace {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.trace .mean {
  stroke: var(--link);
  stroke-width: 1;
  stroke-dasharray: 18 4 2 4;
  opacity: 0.7;
  vector-effect: non-scaling-stroke;
}
.trace .profile {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.25;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.trace .shaft {
  stroke: var(--muted);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.trace .tip {
  fill: var(--accent);
  stroke: var(--paper);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}
.trace.is-armed .profile,
.trace.is-armed .stylus { visibility: hidden; }
.probe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}
.gauge figcaption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.1rem 2rem;
  margin-top: 0.9rem;
  color: var(--muted);
  font-size: 0.875em;
  font-variant-numeric: tabular-nums lining-nums;
}
.gauge figcaption b {
  color: var(--ink);
  font-weight: 600;
}
.gauge-readout { white-space: nowrap; }

/* Key figures */
.figures {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: clamp(2.5rem, 2rem + 2.5vw, 4rem);
  border-block: 1px solid var(--rule);
}
.figures li { padding: 1.35rem 1.25rem 1.5rem 0; }
.figures li + li {
  padding-left: 1.25rem;
  border-left: 1px solid var(--rule);
}
.figures b {
  display: block;
  font-size: clamp(2.25rem, 1.6rem + 2.4vw, 3.5rem);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.figures span {
  display: block;
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.9375em;
  line-height: 1.35;
}

/* ------------------------------------------------------------------ blocks */
.block {
  margin-top: clamp(4rem, 3rem + 4.5vw, 7rem);
  scroll-margin-top: 2.5rem;
}
.block h2 {
  font-size: clamp(1.75rem, 1.4rem + 1.3vw, 2.5rem);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.012em;
}
.block h2::before {
  content: "";
  display: block;
  width: 2.75rem;
  height: 3px;
  margin-bottom: 1.15rem;
  background: var(--accent);
}
.block > h2 { margin-bottom: 2rem; }
.block h2 .count {
  margin-left: 0.2em;
  color: var(--muted);
  font-size: 0.55em;
  letter-spacing: 0;
}
.block-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-bottom: 2rem;
}

.block h3 {
  font-size: 1em;
  font-weight: 600;
  line-height: 1.35;
}
.sub {
  margin-bottom: 1rem;
  color: var(--muted);
}

.prose p {
  max-width: 40rem;
  text-wrap: pretty;
}
.prose p + p { margin-top: 1em; }

.cols {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  column-gap: clamp(2rem, 1rem + 4vw, 4.5rem);
  align-items: start;
}

.facts { border-top: 1px solid var(--rule); }
.facts > div {
  padding-block: 0.7rem 0.75rem;
  border-bottom: 1px solid var(--rule);
}
.facts dt {
  color: var(--muted);
  font-size: 0.875em;
}
.facts dd { line-height: 1.4; }

/* Research */
.lead {
  max-width: 40rem;
  color: var(--muted);
  text-wrap: pretty;
}
/* The two core areas side by side, the three fields where they are applied below */
.areas {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  column-gap: clamp(1.5rem, 0.5rem + 2.5vw, 2.75rem);
  margin-top: 2rem;
}
.areas li {
  grid-column: span 2;
  position: relative;
  padding-block: 1.15rem 1.75rem;
  border-top: 1px solid var(--ink);
  transition: border-color 0.15s ease;
}
.areas .core {
  grid-column: span 3;
  padding-block: 1.25rem 2.25rem;
  border-top-width: 3px;
}
.areas li:hover { border-top-color: var(--accent); }
.areas h3 {
  font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.areas .core h3 { font-size: clamp(1.625rem, 1.25rem + 1.2vw, 2.25rem); }
.areas a::after {                /* the whole cell is the link */
  content: "";
  position: absolute;
  inset: 0;
}
.areas p {
  max-width: 30rem;
  margin-top: 0.55rem;
  color: var(--muted);
}

.focus {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem clamp(2rem, 1rem + 4vw, 4.5rem);
}
.focus li {
  position: relative;
  padding-left: 1.6rem;
}
.focus li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.78em;
  width: 0.85rem;
  border-top: 2px solid var(--accent);
}
.focus.single {
  grid-template-columns: minmax(0, 1fr);
  row-gap: 0.6rem;
}

.labs-intro {
  margin-top: 3rem;
  color: var(--muted);
}
.labs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3rem clamp(1.5rem, 0.5rem + 2.5vw, 2.75rem);
  margin-top: 1.25rem;
}
.labs:not(.solo) .lab-figure { width: min(100%, 22rem); }
.lab {
  display: flex;
  flex-direction: column;
  padding-top: 1.25rem;
  border-top: 1px solid var(--ink);
}
.lab-figure {
  display: block;
  width: 100%;
  height: auto;
  margin-block: 1rem 0.85rem;
  overflow: visible;
}
.lab-text { color: var(--muted); }
.lab-controls {
  display: grid;
  gap: 0.3rem;
  margin-top: 1rem;
}
.lab-controls label {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 1rem;
  align-items: baseline;
  color: var(--muted);
  font-size: 0.9375em;
}
.lab-controls output {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums lining-nums;
}
.lab-controls input[type="range"] {
  grid-column: 1 / -1;
  width: 100%;
  height: 1.75rem;
  margin: 0;
  background: transparent;
  cursor: ew-resize;
  -webkit-appearance: none;
  appearance: none;
}
.lab-controls input[type="range"]::-webkit-slider-runnable-track {
  height: 1px;
  background: var(--muted);
}
.lab-controls input[type="range"]::-moz-range-track {
  height: 1px;
  background: var(--muted);
}
.lab-controls input[type="range"]::-webkit-slider-thumb {
  width: 1rem;
  height: 1rem;
  margin-top: calc(-0.5rem + 0.5px);
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--accent);
  -webkit-appearance: none;
  appearance: none;
}
.lab-controls input[type="range"]::-moz-range-thumb {
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--accent);
}
.lab-result {
  margin-top: 0.9rem;
  font-variant-numeric: tabular-nums lining-nums;
}
.lab-result b { font-weight: 600; }
.lab-note {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.875em;
}
.lab-figure .axis {
  stroke: var(--muted);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.lab-figure .layer {
  stroke: var(--muted);
  stroke-width: 1;
  opacity: 0.45;
  vector-effect: non-scaling-stroke;
}
.lab-figure .part {
  fill: color-mix(in srgb, var(--ink) 9%, transparent);
  stroke: var(--ink);
  stroke-width: 1.25;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.lab-figure .curve {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.4;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.lab-figure .twin {
  fill: none;
  stroke: var(--link);
  stroke-width: 1.4;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.lab-figure .nominal {
  stroke: var(--link);
  stroke-width: 1;
  stroke-dasharray: 9 3 2 3;
  vector-effect: non-scaling-stroke;
}
.lab-figure .gap {
  stroke: var(--accent);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}
.lab-figure .limit {
  stroke: var(--ink);
  stroke-width: 1.25;
  vector-effect: non-scaling-stroke;
}
.lab-figure .tail {
  fill: color-mix(in srgb, var(--accent) 45%, transparent);
  stroke: none;
}
.lab-figure .dot {
  fill: var(--accent);
  stroke: var(--paper);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}
.lab-figure text {
  fill: var(--muted);
  font-size: 8.5px;
  font-variant-numeric: tabular-nums lining-nums;
}

/* One model on its own page: figure beside the controls */
.labs.solo {
  grid-template-columns: minmax(0, 1fr);
  margin-top: 0;
}
.labs.solo .lab {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  column-gap: clamp(2rem, 1rem + 4vw, 4.5rem);
  align-content: start;
  padding-top: 0;
  border-top: 0;
}
.labs.solo .lab-figure {
  grid-row: 1 / span 4;
  margin-block: 0.25rem 0;
}
.labs.solo .lab > :not(.lab-figure) { grid-column: 2; }
.labs.solo .lab-text {
  color: var(--ink);
  text-wrap: pretty;
}
.labs.solo .lab-controls { margin-top: 1.5rem; }
.tooltext {
  max-width: 40rem;
  margin-top: 1.75rem;
  color: var(--muted);
  text-wrap: pretty;
}
.formula {
  display: flex;
  flex-wrap: wrap;
  gap: 0.1rem 1.5rem;
  max-width: 40rem;
  margin-top: 0.9rem;
  padding-left: 1rem;
  border-left: 2px solid var(--accent);
  font-size: 0.9375em;
  font-variant-numeric: tabular-nums lining-nums;
}
.formula span { white-space: nowrap; }
.formula .equation {
  flex-basis: 100%;
  font-weight: 600;
}
.formula sub {
  font-size: 0.75em;
  line-height: 0;
}

/* Questions and answers */
.qa { border-bottom: 1px solid var(--rule); }
.qa > div {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  column-gap: clamp(2rem, 1rem + 4vw, 4.5rem);
  padding-block: 1.25rem 1.4rem;
  border-top: 1px solid var(--rule);
}
.qa dt {
  font-weight: 600;
  line-height: 1.35;
  text-wrap: balance;
}
.qa dd {
  max-width: 40rem;
  text-wrap: pretty;
}

/* Projects */
.segmented {
  display: inline-flex;
  border: 1px solid var(--ink);
}
.segmented button {
  min-height: 2.5rem;
  padding: 0.3rem 0.95rem;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-variant-numeric: tabular-nums lining-nums;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.segmented button + button { border-left: 1px solid var(--ink); }
.segmented button:hover { background: var(--tint); }
.segmented button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}
.segmented button:focus-visible { outline-offset: -4px; }

.projects { border-bottom: 1px solid var(--rule); }
.projects li {
  display: grid;
  grid-template-columns: 11.5rem minmax(0, 1fr) 13.5rem 7.5rem;
  column-gap: 1.75rem;
  align-items: baseline;
  padding-block: 1rem 1.1rem;
  border-top: 1px solid var(--rule);
}
.projects .meta,
.projects .period {
  color: var(--muted);
  font-size: 0.9375em;
  line-height: 1.4;
}
.projects .period {
  font-variant-numeric: tabular-nums lining-nums;
  text-align: right;
}
.status {
  display: block;
  color: var(--ink);
}
.status::before {
  content: "";
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  margin-right: 0.45rem;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  vertical-align: 0.05em;
}
[data-status="ongoing"] .status::before { background: var(--accent); }

/* Career */
.duo {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(2rem, 1rem + 4vw, 4.5rem);
}

/* Rows: a short label (years) next to the content */
.rows {
  display: grid;
  gap: 1.1rem;
}
.rows > div {
  display: grid;
  grid-template-columns: 6.75rem minmax(0, 1fr);
  column-gap: 1.25rem;
}
.rows.years > div { grid-template-columns: 3.5rem minmax(0, 1fr); }
.rows dt {
  color: var(--muted);
  font-variant-numeric: tabular-nums lining-nums;
}
.rows .what {
  display: block;
  font-weight: 600;
  line-height: 1.4;
}
.rows .where {
  display: block;
  color: var(--muted);
}
.note {
  display: block;
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.9375em;
  font-style: italic;
  line-height: 1.45;
}

/* Publications: semibold title, regular authors, italic venue */
.pub-title {
  display: block;
  font-weight: 600;
  line-height: 1.4;
  text-wrap: pretty;
}
.pub-meta {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
}
.pub-meta b {
  color: var(--ink);
  font-weight: 600;
}
.pub-meta i { color: var(--ink); }
.pub-links {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.1rem 1.25rem;
  margin-top: 0.3rem;
  font-size: 0.9375em;
}
.pub-links a { overflow-wrap: anywhere; }
.pub-links .pdf {
  padding: 0 0.5rem;
  border: 1px solid var(--link);
  font-weight: 600;
  text-decoration: none;
}
.pub-links .pdf:hover {
  background: var(--link);
  color: var(--paper);
}
.cited { color: var(--muted); }

.button {
  display: inline-block;
  margin-top: 2rem;
  padding: 0.7rem 1.2rem;
  border: 1px solid var(--ink);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.button:hover {
  background: var(--ink);
  color: var(--paper);
}
button.button {
  background: transparent;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.prose code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.9em;
}

/* Recognition */
.awards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: clamp(1.5rem, 0.5rem + 2.5vw, 2.75rem);
}
.awards li {
  padding-top: 1.1rem;
  border-top: 1px solid var(--ink);
}
/* The certificate or trophy, shown whole in a quiet frame; a click opens the full-size image */
.award-image {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  margin-bottom: 1rem;
  border: 1px solid var(--rule);
  background: var(--tint);
  transition: border-color 0.15s ease;
}
.award-image:hover { border-color: var(--accent); }
.award-image img {
  position: absolute;
  inset: 0.75rem;
  width: calc(100% - 1.5rem);
  height: calc(100% - 1.5rem);
  object-fit: contain;
}
.awards .year {
  display: block;
  color: var(--muted);
  font-variant-numeric: tabular-nums lining-nums;
}
.awards .what {
  display: block;
  margin-top: 0.15rem;
  font-weight: 600;
  line-height: 1.35;
}
.awards .where {
  display: block;
  margin-top: 0.3rem;
  color: var(--muted);
  line-height: 1.45;
}

/* Contact band */
.contactband {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  column-gap: clamp(2rem, 1rem + 4vw, 4.5rem);
  align-items: end;
  padding: clamp(1.75rem, 1rem + 3vw, 3.25rem);
  border: 1px solid var(--rail-rule);
  background: var(--rail);
  color: var(--rail-ink);
}
.contactband h2::before { background: var(--rail-accent); }
.contactband p {
  max-width: 30rem;
  margin-top: 1rem;
  color: var(--rail-muted);
}
.contactband .mail {
  display: inline-block;
  margin-top: 1.25rem;
  color: var(--rail-ink);
  font-size: clamp(1.25rem, 1.05rem + 0.9vw, 1.75rem);
  font-weight: 300;
  text-decoration-color: var(--rail-accent);
  overflow-wrap: anywhere;
}
.contactband ul {
  display: grid;
  gap: 0.25rem;
}
.contactband ul a {
  color: var(--rail-muted);
  text-decoration-color: var(--rail-rule);
}
.contactband ul a:hover {
  color: var(--rail-ink);
  text-decoration-color: var(--rail-accent);
}

/* ------------------------------------------------------- publications page */
.metrics {
  max-width: 40rem;
  margin-top: 2.5rem;
}
.metrics table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums lining-nums;
}
.metrics th,
.metrics td {
  padding: 0.55rem 1rem 0.55rem 0;
  border-bottom: 1px solid var(--rule);
  font-weight: 400;
  text-align: left;
  vertical-align: baseline;
}
.metrics thead th {
  border-bottom-color: var(--ink);
  color: var(--muted);
  font-size: 0.875em;
}
.metrics .num {
  font-size: 1.15em;
  font-weight: 600;
}
.metrics .when {
  padding-right: 0;
  color: var(--muted);
  font-size: 0.875em;
}
.metrics p {
  margin-top: 0.85rem;
  color: var(--muted);
  font-size: 0.9375em;
}

.filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1.75rem;
  margin-top: 2.5rem;
}
.filter .field {
  display: flex;
  flex: 1 1 18rem;
  align-items: baseline;
  gap: 0.75rem;
  border-bottom: 1px solid var(--ink);
}
.filter .field:focus-within {
  border-bottom-color: var(--accent);
  box-shadow: 0 1px 0 var(--accent);
}
.filter .field label { font-weight: 600; }
.filter input[type="search"] {
  flex: 1;
  min-width: 0;
  min-height: 2.75rem;
  padding: 0.35rem 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font: inherit;
}
.filter input[type="search"]::placeholder {
  color: var(--muted);
  opacity: 1;
}
.filter .check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  cursor: pointer;
}
.filter input[type="checkbox"] {
  width: 1.1em;
  height: 1.1em;
  margin: 0;
  accent-color: var(--link);
}
.filter-status {
  flex-basis: 100%;
  min-height: 1.6em;
  color: var(--muted);
  font-variant-numeric: tabular-nums lining-nums;
}
.empty {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

.colophon {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 2rem;
  margin-top: clamp(4rem, 3rem + 4vw, 6rem);
  padding-block: 1.5rem 2.5rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.875em;
}
.colophon .legal {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
}
.colophon a,
.colophon .textbutton { color: var(--muted); }

/* Consent: a small navy note in the corner. Both answers carry the same weight. */
.consent {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 30;
  width: min(29rem, 100% - 2.5rem);
  padding: 1.1rem 1.25rem 1.25rem;
  border: 1px solid var(--rail-rule);
  border-top: 3px solid var(--rail-accent);
  background: var(--rail);
  color: var(--rail-ink);
  font-size: 0.9375rem;
  line-height: 1.5;
  box-shadow: 0 0.75rem 2.5rem rgb(0 0 0 / 0.28);
}
.consent a {
  color: var(--rail-ink);
  text-decoration-color: var(--rail-accent);
}
.consent :focus-visible { outline-color: var(--rail-accent); }
.consent-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}
.consent-actions button {
  flex: 1;
  min-height: 2.75rem;
  padding: 0.4rem 1rem;
  border: 1px solid var(--rail-ink);
  background: transparent;
  color: var(--rail-ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.consent-actions button:hover {
  background: var(--rail-ink);
  color: var(--rail);
}
@media (max-width: 38rem) {
  .consent {
    right: 0;
    bottom: 0;
    width: 100%;
    border-inline: 0;
    border-bottom: 0;
    padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  }
}

/* -------------------------------------------------------------- responsive */
@media (max-width: 80rem) {
  .projects li { grid-template-columns: 10.5rem minmax(0, 1fr) 7.5rem; }
  .projects .meta {
    grid-column: 2;
    grid-row: 2;
    margin-top: 0.2rem;
  }
  .projects .period { grid-row: 1; grid-column: 3; }
}

@media (max-width: 72rem) {
  .cols,
  .duo,
  .contactband { grid-template-columns: minmax(0, 1fr); row-gap: 2.5rem; }
  .facts { max-width: 34rem; }
  .labs.solo .lab { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* The rail folds into a header; a sticky bar keeps the navigation at hand */
@media (max-width: 63.99rem) {
  .layout { display: block; }
  .rail {
    position: static;
    height: auto;
    padding: 2rem var(--gutter) 2.25rem;
    overflow: visible;
  }
  .rail-nav,
  .rail .langs { display: none; }
  .contact {
    gap: 0.3rem 1.4rem;
    margin-top: 1.5rem;
    padding-top: 0;
  }
  .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    min-height: var(--bar);
    padding-inline: var(--gutter);
    border-bottom: 1px solid var(--rail-rule);
    background: var(--rail);
    color: var(--rail-ink);
  }
  .topbar-name {
    min-width: 0;
    overflow: hidden;
    color: inherit;
    font-weight: 600;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .topbar .langs { margin-left: auto; }
  .topbar .langs a {
    min-width: 2.25rem;
    min-height: 2.75rem;
  }
  .block,
  .pubs { scroll-margin-top: calc(var(--bar) + 1.5rem); }
}

@media (max-width: 52rem) {
  .areas li,
  .areas .core { grid-column: 1 / -1; }
  .labs.solo .lab,
  .qa > div { grid-template-columns: minmax(0, 1fr); }
  .labs.solo .lab-figure { grid-row: auto; }
  .labs.solo .lab > :not(.lab-figure) { grid-column: 1; }
  .qa > div { row-gap: 0.4rem; }
  .awards { grid-template-columns: minmax(0, 1fr); row-gap: 1.5rem; }
  .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .figures li:nth-child(odd) {
    padding-left: 0;
    border-left: 0;
  }
  .figures li:nth-child(n + 3) { border-top: 1px solid var(--rule); }
}

@media (max-width: 38rem) {
  .rail {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 1.25rem;
    align-items: center;
  }
  .portrait {
    width: 5rem;
    margin-bottom: 6px;
    grid-row: span 1;
  }
  .who { font-size: 1.75rem; }
  .rail .role,
  .rail .affiliation,
  .contact { grid-column: 1 / -1; }
  .rail .role { margin-top: 1.25rem; }
  .focus,
  .labs { grid-template-columns: minmax(0, 1fr); }
  .projects li {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 0.2rem;
  }
  .projects .meta,
  .projects .period {
    grid-column: 1;
    grid-row: auto;
    margin-top: 0;
    text-align: left;
  }
  .status { display: inline; margin-right: 0.6rem; }
  .rows.timeline > div { grid-template-columns: minmax(0, 1fr); }
  .trace .tip { r: 11px; }
  .metrics { overflow-x: auto; }
  .metrics th,
  .metrics td { padding-right: 0.4rem; }
  .metrics .when { display: none; }
  .segmented { width: 100%; }
  .segmented button { flex: 1 1 auto; padding-inline: 0.4rem; }
}

@media (max-width: 21.25rem) {
  .portrait { width: 4.25rem; }
  .who { font-size: 1.5rem; }
}

@media print {
  :root {
    --paper: #fff;
    --ink: #000;
    --muted: #444;
    --rule: #bbb;
    --link: #000;
    --rail: #fff;
    --rail-ink: #000;
    --rail-muted: #444;
  }
  .layout { display: block; }
  .rail {
    position: static;
    height: auto;
  }
  .topbar,
  .rail-nav,
  .langs,
  .skip,
  .gauge,
  .labs,
  .labs-intro,
  .filter,
  .segmented,
  .consent,
  .textbutton { display: none; }
  a { text-decoration: none; }
  .block { break-inside: avoid; }
}
