/* =============================================================================
   sharmajai.com — visual system

   Direction: a radiology reading room. The page is the dark room; content sits
   on faintly lit panels; figures are presented on white "view boxes" the way a
   radiograph is read against a backlit screen. Anatomy is greyscale — the only
   warm colour on the site is --signal, borrowed from the hot-iron colormap used
   to overlay measured signal on anatomical scans, and it is used ONLY on numbers
   that represent a real measured result.
   ========================================================================== */

/* ------------------------------- tokens ---------------------------------- */
:root {
  /* surfaces — cool blue-black, the unlit light box */
  --film:        #070a0f;
  --film-1:      #0b1017;
  --film-2:      #111823;
  --film-3:      #18212e;

  /* structure */
  --line:        #1b2431;
  --line-soft:   #131b25;

  /* type */
  --bone:        #e9eef4;   /* primary — cool bone white */
  --soft:        #8d9aa9;   /* secondary */
  --dim:         #5b6775;   /* tertiary, labels */

  /* the one warm accent — measured results only */
  --signal:      #f5a25d;
  --signal-weak: #3a2a1c;

  /* backlight, used for focus + hover glow */
  --exposure:    #9fc6ef;

  /* type families */
  --display: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  --body:    'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono:    'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* rhythm */
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --max:    1180px;
  --pad-y:  clamp(4.5rem, 11vh, 9rem);

  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ------------------------------- reset ----------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }   /* beats .btn/.avail display rules */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img, svg, canvas, video { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }

body {
  background: var(--film);
  color: var(--bone);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-weight: 400;
  letter-spacing: -0.003em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* a very faint film grain so large black areas don't band on cheap monitors */
body::after {
  content: ''; position: fixed; inset: 0; z-index: 100; pointer-events: none;
  opacity: .028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--signal); color: var(--film); }

/* ---------------------------- typography --------------------------------- */
.display {
  font-family: var(--display);
  font-weight: 300;
  line-height: 0.98;
  letter-spacing: -0.028em;
  text-wrap: balance;
}
.display em { font-style: italic; font-weight: 300; }

h1.display  { font-size: clamp(2.9rem, 8.2vw, 6.6rem); }
h1.hero__display { font-size: clamp(2.2rem, 5.5vw, 4.2rem); }
h2.display  { font-size: clamp(2.1rem, 4.6vw, 3.5rem); }
h3.display  { font-size: clamp(1.5rem, 2.6vw, 2.05rem); line-height: 1.12; }

/* Introductory paragraphs are set in the display serif at a light weight — it
   reads as editorial rather than as UI text, and separates them clearly from
   the denser body copy below. */
.lede {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(1.18rem, 1.75vw, 1.45rem);
  line-height: 1.5;
  letter-spacing: -0.012em;
  color: var(--soft);
  max-width: 58ch;
  text-wrap: pretty;
}

.label {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--dim);
}

.prose p { max-width: 68ch; color: var(--soft); margin-bottom: 1.1em; text-wrap: pretty; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--bone); font-weight: 500; }
.prose em { color: var(--bone); font-style: italic; }

/* a measured result. the only warm thing on the page. */
.fig {
  font-family: var(--mono);
  font-weight: 500;
  color: var(--signal);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

a { color: inherit; text-decoration: none; }

.link {
  color: var(--bone);
  border-bottom: 1px solid var(--line);
  padding-bottom: 1px;
  transition: border-color .25s var(--ease), color .25s var(--ease);
}
.link:hover { border-bottom-color: var(--signal); color: #fff; }

/* DOI: a quiet pill that reads as a reference, not as body text */
.doi {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--mono); font-size: .74rem; letter-spacing: .02em;
  color: var(--soft);
  border: 1px solid var(--line); border-radius: 2px;
  padding: .4rem .7rem;
  transition: border-color .25s var(--ease), color .25s var(--ease), background .25s var(--ease);
}
.doi svg { flex: none; opacity: .7; }
.doi:hover { color: var(--bone); border-color: var(--signal); background: var(--film-1); }
.doi:hover svg { opacity: 1; }

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

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--film-2); color: var(--bone);
  padding: .75rem 1.25rem; font-family: var(--mono); font-size: .8rem;
}
.skip:focus { left: 1rem; top: 1rem; }

.sr { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
      clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ------------------------------ layout ----------------------------------- */
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--pad-y); }
.section--tight { padding-block: clamp(3rem, 7vh, 5rem); }
.rule { height: 1px; background: var(--line-soft); border: 0; }

/* section heading: mono label above a serif title, on a hairline */
.shead { display: flex; flex-direction: column; gap: .9rem; margin-bottom: 3.25rem; }
.shead__top { display: flex; align-items: baseline; gap: 1rem; }
.shead__top::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.shead .lede { margin-top: .35rem; }

/* ------------------------------ nav -------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--film) 82%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line-soft);
}
.nav__in {
  display: flex; align-items: center; justify-content: space-between;
  height: 66px;
  width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter);
}
.brand { display: flex; align-items: center; gap: .7rem; }
.brand__mark {
  width: 26px; height: 26px; flex: none; border-radius: 3px;
  border: 1px solid var(--line);
  display: grid; place-items: center;
  font-family: var(--mono); font-size: .625rem; font-weight: 500;
  letter-spacing: .04em; color: var(--soft);
  background: var(--film-2);
  transition: border-color .3s var(--ease), color .3s var(--ease);
}
.brand:hover .brand__mark { border-color: var(--signal); color: var(--signal); }
.brand__name { font-family: var(--mono); font-size: .78rem; letter-spacing: .1em;
               text-transform: uppercase; color: var(--bone); }

.nav__links { display: flex; align-items: center; gap: 2rem; }
.nav__link {
  font-family: var(--mono); font-size: .74rem; letter-spacing: .11em;
  text-transform: uppercase; color: var(--dim);
  padding-block: .4rem; position: relative;
  transition: color .25s var(--ease);
}
.nav__link:hover { color: var(--bone); }
.nav__link[aria-current='page'] { color: var(--bone); }
.nav__link[aria-current='page']::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1px; background: var(--signal);
}

.nav__toggle {
  display: none; background: none; border: 1px solid var(--line);
  width: 40px; height: 34px; border-radius: 3px; cursor: pointer;
  color: var(--soft); align-items: center; justify-content: center;
}
.nav__toggle svg { width: 16px; height: 16px; }

/* -------------------------- hero (home only) ----------------------------- */
.hero { position: relative; overflow: hidden; }
.hero__in {
  position: relative; z-index: 2;
  min-height: min(86vh, 780px);
  display: flex; flex-direction: column; justify-content: center;
  padding-block: clamp(4rem, 9vh, 7rem) clamp(3rem, 7vh, 5rem);
}
/* The role line is the first thing a recruiter reads, so it is set bright and
   wide rather than as a dim caption. */
.hero__eyebrow {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: .55rem 2.1rem; margin-bottom: 2.1rem;
}
.hero__role {
  font-family: var(--mono); font-size: .92rem; font-weight: 500;
  letter-spacing: .2em; text-transform: uppercase; color: var(--bone);
  position: relative;
}
.hero__role + .hero__role::before {
  content: ''; position: absolute; left: -1.15rem; top: 50%;
  width: 3px; height: 3px; border-radius: 50%; background: var(--signal);
  transform: translateY(-50%);
}
.hero__loc {
  font-family: var(--mono); font-size: .78rem; letter-spacing: .17em;
  text-transform: uppercase; color: var(--dim);
}

/* keeps the headline clear of the portrait rather than running into his face */
.hero h1 { max-width: 12ch; }
.hero__sub { margin-top: 2rem; max-width: 44ch; }
.hero__sub strong { color: var(--bone); font-weight: 400; }
.hero__cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2.75rem; }

/* the portrait, sitting translucent behind the type and dissolving into the page */
.hero__plate {
  position: absolute; z-index: 1; pointer-events: none;
  top: 50%; right: -2%; transform: translateY(-50%);
  width: min(42vw, 560px); aspect-ratio: 1 / 1;
}
.hero__plate img {
  width: 100%; height: 100%; object-fit: contain;
  opacity: .5;
  filter: grayscale(1) contrast(1.08);
  -webkit-mask-image: radial-gradient(ellipse 68% 62% at 52% 42%, #000 32%, transparent 78%);
          mask-image: radial-gradient(ellipse 68% 62% at 52% 42%, #000 32%, transparent 78%);
}
/* horizon glow: the light box, just barely on */
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse 60% 55% at 78% 45%,
              color-mix(in srgb, var(--exposure) 7%, transparent), transparent 70%);
}

/* ------------------------------ buttons ---------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: var(--mono); font-size: .74rem; letter-spacing: .11em;
  text-transform: uppercase;
  padding: .82rem 1.35rem; border-radius: 2px;
  border: 1px solid var(--line);
  color: var(--bone); background: transparent;
  cursor: pointer;
  transition: border-color .3s var(--ease), background .3s var(--ease),
              color .3s var(--ease), transform .3s var(--ease);
}
.btn:hover { border-color: var(--soft); background: var(--film-2); transform: translateY(-1px); }
.btn--primary { background: var(--bone); color: var(--film); border-color: var(--bone); font-weight: 500; }
.btn--primary:hover { background: #fff; border-color: #fff; color: var(--film); }
.btn__arrow { transition: transform .3s var(--ease); }
.btn:hover .btn__arrow { transform: translateX(3px); }

/* ------------------------------- panels ---------------------------------- */
.panel {
  background: var(--film-1);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
}

/* ------------------------------ pillars ---------------------------------- */
.pillars { display: grid; gap: 1px; background: var(--line-soft); border-block: 1px solid var(--line-soft); }
@media (min-width: 820px) { .pillars { grid-template-columns: repeat(3, 1fr); } }
.pillar { background: var(--film); padding: 2.5rem 2rem 2.25rem; transition: background .4s var(--ease); }
.pillar:hover { background: var(--film-1); }
.pillar h3 { font-family: var(--display); font-size: 1.42rem; font-weight: 400;
             letter-spacing: -0.02em; line-height: 1.15; margin-bottom: .95rem; }
.pillar p { color: var(--soft); font-size: .95rem; margin-bottom: 1.4rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
  font-family: var(--mono); font-size: .66rem; letter-spacing: .06em;
  color: var(--dim); border: 1px solid var(--line);
  padding: .28rem .55rem; border-radius: 2px; white-space: nowrap;
}

/* ---------------------------- case study cards --------------------------- */
.cases { display: flex; flex-direction: column; gap: 1px; background: var(--line-soft); }
.case {
  display: grid; gap: 0; background: var(--film);
  position: relative;
  transition: background .4s var(--ease);
}
.case:hover { background: var(--film-1); }
/* 40 / 60 — write-up left, wide rectangular image right */
@media (min-width: 900px) { .case { grid-template-columns: 40% 60%; align-items: stretch; } }

.case__body { padding: clamp(2rem, 3.5vw, 3rem); display: flex; flex-direction: column; }
.case__kicker { margin-bottom: 1.15rem; }
.case__body h3 { margin-bottom: 1.1rem; }
.case__body p {
  font-family: var(--display); font-weight: 300;
  font-size: clamp(1.15rem, 1.35vw, 1.32rem); line-height: 1.55; letter-spacing: -0.013em;
  color: var(--soft); max-width: 44ch; text-wrap: pretty;
}
.case__metric { margin-top: auto; padding-top: 2rem; display: flex; align-items: baseline; gap: .85rem; }
.case__metric .fig { font-size: 1.55rem; }
.case__metric span:last-child { font-family: var(--mono); font-size: .68rem;
  letter-spacing: .1em; text-transform: uppercase; color: var(--dim); max-width: 28ch; line-height: 1.5; }
.case__more { margin-top: 1.75rem; display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--mono); font-size: .72rem; letter-spacing: .11em; text-transform: uppercase;
  color: var(--bone); }
.case__more svg { transition: transform .3s var(--ease); }
.case:hover .case__more svg { transform: translateX(4px); }

/* the view box: figures presented lit, as a radiograph is read.
   min-height keeps the panel a wide rectangle whatever the write-up's length,
   so replacement images always land in a predictable frame. */
.case__plate { position: relative; background: var(--film-2); overflow: hidden;
               border-left: 1px solid var(--line-soft); min-height: 260px; }
@media (min-width: 900px) { .case__plate { min-height: clamp(300px, 27vw, 460px); } }
/* thumbnails are purpose-built dark images, so they need framing, not filtering.
   .case__media covers both the still and the video variant. */
.case__plate .case__media {
  width: 100%; height: 100%; object-fit: cover; object-position: center;
  opacity: .86;
  transition: opacity .5s var(--ease), transform .8s var(--ease);
}
.case:hover .case__plate .case__media { opacity: 1; transform: scale(1.015); }
.case__plate--empty { display: grid; place-items: center; }
.case__plate--empty .label { color: var(--line); font-size: .62rem; }

/* --------------------------- publications -------------------------------- */
.papers { border-top: 1px solid var(--line-soft); }
.paper { border-bottom: 1px solid var(--line-soft); }
.paper__head {
  width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
  display: grid; gap: .55rem 1.75rem; padding: 1.9rem 0;
  transition: opacity .3s var(--ease);
}
@media (min-width: 860px) { .paper__head { grid-template-columns: 132px 1fr 40px; align-items: start; } }
.paper__head:hover { opacity: .78; }
.paper__venue { font-family: var(--mono); font-size: .7rem; letter-spacing: .1em;
                text-transform: uppercase; color: var(--dim); line-height: 1.7; }
.paper__venue b { display: block; color: var(--soft); font-weight: 500; }
.paper__title { font-family: var(--display); font-size: clamp(1.15rem, 1.9vw, 1.42rem);
                font-weight: 400; line-height: 1.28; letter-spacing: -0.015em; text-wrap: pretty; }
.paper__authors { font-size: .84rem; color: var(--dim); margin-top: .6rem; }
.paper__authors b { color: var(--soft); font-weight: 500; }
.paper__plus { justify-self: end; color: var(--dim); align-self: center;
               font-family: var(--mono); font-size: 1.1rem; line-height: 1;
               transition: transform .35s var(--ease), color .3s var(--ease); }
.paper__head[aria-expanded='true'] .paper__plus { transform: rotate(45deg); color: var(--signal); }

.paper__panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s var(--ease); }
.paper__panel[data-open='true'] { grid-template-rows: 1fr; }
.paper__panel > div { overflow: hidden; }
.paper__inner { padding-bottom: 3rem; display: grid; gap: 2.25rem; }
@media (min-width: 900px) { .paper__inner { grid-template-columns: 1fr 1fr; gap: 2.25rem 3.5rem; } }
.paper__lede { font-family: var(--display); font-size: 1.22rem; font-weight: 300;
               line-height: 1.4; letter-spacing: -0.015em; color: var(--bone); }
@media (min-width: 900px) { .paper__lede { grid-column: 1 / -1; max-width: 46ch; } }

.stepped { counter-reset: s; display: flex; flex-direction: column; gap: 1rem; }
.stepped li { position: relative; padding-left: 2.4rem; color: var(--soft); font-size: .94rem; }
.stepped li::before {
  counter-increment: s; content: counter(s, decimal-leading-zero);
  position: absolute; left: 0; top: .18em;
  font-family: var(--mono); font-size: .68rem; color: var(--dim); letter-spacing: .05em;
}

/* key/value results table */
.kv { border-top: 1px solid var(--line); }
.kv div { display: flex; justify-content: space-between; align-items: baseline; gap: 1.5rem;
          padding: .78rem 0; border-bottom: 1px solid var(--line-soft); }
.kv dt { font-family: var(--mono); font-size: .7rem; letter-spacing: .1em;
         text-transform: uppercase; color: var(--dim); }
.kv dd { font-size: .95rem; color: var(--bone); text-align: right; }

/* horizontal comparison bars — the only chart the site draws itself */
.bars { display: flex; flex-direction: column; gap: .7rem; }
.bar__row { display: grid; grid-template-columns: 1fr; gap: .3rem; }
.bar__top { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.bar__name { font-size: .85rem; color: var(--soft); }
.bar__val { font-family: var(--mono); font-size: .78rem; color: var(--dim);
            font-variant-numeric: tabular-nums; }
.bar__track { height: 3px; background: var(--line-soft); border-radius: 2px; overflow: hidden; }
.bar__fill { height: 100%; background: var(--dim); border-radius: 2px;
             transform-origin: left; transform: scaleX(0); transition: transform 1s var(--ease); }
.bar__row--lead .bar__name { color: var(--bone); }
.bar__row--lead .bar__val  { color: var(--signal); }
.bar__row--lead .bar__fill { background: var(--signal); }
.is-in .bar__fill { transform: scaleX(1); }

/* ------------------------------ projects --------------------------------- */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2.75rem; }
.filter {
  font-family: var(--mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--dim); background: none; border: 1px solid var(--line);
  padding: .5rem .9rem; border-radius: 2px; cursor: pointer;
  transition: color .25s var(--ease), border-color .25s var(--ease), background .25s var(--ease);
}
.filter:hover { color: var(--bone); border-color: var(--soft); }
.filter[aria-pressed='true'] { color: var(--film); background: var(--bone); border-color: var(--bone); }

.grid-projects { display: grid; gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); }
@media (min-width: 700px)  { .grid-projects { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .grid-projects { grid-template-columns: repeat(3, 1fr); } }

.project {
  background: var(--film); padding: 1.9rem 1.75rem 1.6rem;
  display: flex; flex-direction: column; min-height: 260px;
  transition: background .35s var(--ease);
  position: relative; overflow: hidden;
}
.project:hover { background: var(--film-1); }
.project--featured { cursor: pointer; }
.project__overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(17, 24, 35, .72); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; transition: opacity .3s var(--ease); z-index: 2; pointer-events: none;
}
.project--featured:hover .project__overlay { opacity: 1; }
.project__overlay span {
  font-family: var(--mono); font-size: .78rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--bone);
  border: 1px solid var(--line); padding: .65rem 1.4rem; border-radius: 2px;
  background: rgba(255, 255, 255, .04);
}
.project__cat { margin-bottom: 1.1rem; display: flex; align-items: center; gap: .55rem; }
.project__star { color: var(--signal); font-size: .7rem; }
.project h3 { font-family: var(--display); font-size: 1.24rem; font-weight: 400;
              letter-spacing: -0.018em; line-height: 1.2; margin-bottom: .7rem; }
.project p { font-size: .9rem; color: var(--soft); margin-bottom: 1.3rem; }
.project__foot { margin-top: auto; display: flex; flex-direction: column; gap: 1rem; }
.project__stat { font-family: var(--mono); font-size: .74rem; color: var(--signal);
                 letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.project__links { display: flex; gap: 1.1rem; align-items: center; }
.project__links a { font-family: var(--mono); font-size: .68rem; letter-spacing: .1em;
                    text-transform: uppercase; color: var(--soft);
                    border-bottom: 1px solid transparent; padding-bottom: 2px;
                    transition: color .25s var(--ease), border-color .25s var(--ease); }
.project__links a:hover { color: var(--bone); border-bottom-color: var(--line); }

/* ------------------------------ timeline --------------------------------- */
.timeline { position: relative; padding-left: 0; }
.tl { position: relative; padding: 0 0 2.75rem 2rem; border-left: 1px solid var(--line); }
.tl:last-child { padding-bottom: 0; }
.tl::before {
  content: ''; position: absolute; left: -3.5px; top: .55rem;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--film); border: 1px solid var(--soft);
}
.tl--now::before { background: var(--signal); border-color: var(--signal); }
.tl__period { margin-bottom: .5rem; }
.tl h3 { font-family: var(--display); font-size: 1.35rem; font-weight: 400;
         letter-spacing: -0.02em; line-height: 1.2; }
.tl__where { font-size: .95rem; color: var(--soft); margin-top: .3rem; }
.tl__detail { font-size: .93rem; color: var(--soft); margin-top: .85rem; max-width: 60ch; }
.tl__bullets { margin-top: 1rem; display: flex; flex-direction: column; gap: .5rem; }
.tl__bullets li { position: relative; padding-left: 1.1rem; font-size: .93rem; color: var(--soft); }
.tl__bullets li::before { content: ''; position: absolute; left: 0; top: .68em;
                          width: 4px; height: 1px; background: var(--dim); }
.tl .chips { margin-top: 1.1rem; }

/* schematic that sits under a role — a visual anchor while scanning, sized so
   it never outweighs the words above it */
.tl__fig { margin: 1.6rem 0 0; max-width: 640px; }
.tl__fig img {
  width: 100%; height: auto; border-radius: 4px;
  border: 1px solid var(--line-soft);
  opacity: .9; transition: opacity .4s var(--ease), border-color .4s var(--ease);
}
.tl:hover .tl__fig img { opacity: 1; border-color: var(--line); }
/* the enlarge hint only earns its place where the figure is actually too small */
.tl__fig figcaption { display: none; }
@media (max-width: 860px) {
  .tl__fig figcaption {
    display: block; margin-top: .55rem;
    font-family: var(--mono); font-size: .68rem; letter-spacing: .12em;
    text-transform: uppercase; color: var(--dim);
  }
}

/* ------------------------------ case pages ------------------------------- */
.page-head { padding-block: clamp(3.5rem, 8vh, 6rem) clamp(2.5rem, 5vh, 3.5rem); }
.page-head .label { margin-bottom: 1.4rem; display: block; }
.page-head h1 { max-width: 20ch; }
.page-head .lede { margin-top: 1.75rem; }

.back { display: inline-flex; align-items: center; gap: .55rem; margin-bottom: 2.25rem;
        font-family: var(--mono); font-size: .72rem; letter-spacing: .11em;
        text-transform: uppercase; color: var(--dim); transition: color .25s var(--ease); }
.back:hover { color: var(--bone); }
.back svg { transition: transform .3s var(--ease); }
.back:hover svg { transform: translateX(-3px); }

/* the headline stats strip */
.stats { display: grid; gap: 1px; background: var(--line-soft);
         border-block: 1px solid var(--line-soft); }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 940px) { .stats { grid-template-columns: repeat(4, 1fr); } }
/* flex column + margin-top:auto keeps every label bottom-aligned across the row
   even when one value wraps to two lines */
.stat { background: var(--film); padding: 1.9rem 1.5rem;
        display: flex; flex-direction: column; }
.stat__v { font-family: var(--mono); font-size: clamp(1.25rem, 2.2vw, 1.65rem);
           font-weight: 500; color: var(--signal); font-variant-numeric: tabular-nums;
           letter-spacing: -0.025em; line-height: 1.15; }
.stat__l { margin-top: auto; padding-top: .8rem; display: block; line-height: 1.6; }

/* the pipeline rail — a real sequence, so it earns its numbers */
.pipe { display: flex; flex-wrap: wrap; gap: .5rem; align-items: stretch; }
.pipe__node {
  flex: 1 1 130px; background: var(--film-1); border: 1px solid var(--line-soft);
  border-radius: 3px; padding: .95rem 1rem; position: relative;
}
.pipe__node .label { font-size: .6rem; letter-spacing: .16em; }
.pipe__node b { display: block; margin-top: .45rem; font-family: var(--mono);
                font-size: .78rem; font-weight: 400; color: var(--bone); line-height: 1.45;
                hyphens: none; }
.pipe__node:last-child { border-color: var(--signal-weak); }
.pipe__node:last-child b { color: var(--signal); }

/* content blocks inside case studies */
.block { display: grid; gap: 1.5rem 3.5rem; padding-block: clamp(2.5rem, 5vh, 3.75rem);
         border-top: 1px solid var(--line-soft); }
@media (min-width: 900px) { .block { grid-template-columns: 200px 1fr; } }
.block__label { position: sticky; top: 96px; align-self: start; }

/* figure on a lit view box */
figure.plate { margin: 0; }
figure.plate .plate__img {
  background: #f4f6f8; border: 1px solid var(--line); border-radius: 3px;
  padding: 1rem; overflow: hidden;
}
figure.plate img { width: 100%; height: auto; border-radius: 1px; }
figure.plate figcaption {
  margin-top: .9rem; font-size: .85rem; color: var(--dim); line-height: 1.6;
  max-width: 68ch;
}
figure.plate figcaption b { color: var(--soft); font-weight: 500; }
.plate-grid { display: grid; gap: 2rem; }
@media (min-width: 860px) { .plate-grid--2 { grid-template-columns: 1fr 1fr; } }

/* results table */
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th, .table td { text-align: left; padding: .8rem 1rem .8rem 0;
                       border-bottom: 1px solid var(--line-soft); }
.table th { font-family: var(--mono); font-size: .68rem; letter-spacing: .12em;
            text-transform: uppercase; color: var(--dim); font-weight: 500;
            border-bottom-color: var(--line); }
.table td { color: var(--soft); }
.table td:last-child { text-align: right; color: var(--bone);
                       font-family: var(--mono); font-size: .88rem;
                       font-variant-numeric: tabular-nums; }
.table tr:last-child td { border-bottom: 0; }

/* a pulled-out conclusion */
.finding {
  border-left: 2px solid var(--signal);
  padding: .25rem 0 .25rem 1.75rem;
  font-family: var(--display); font-size: clamp(1.2rem, 2.1vw, 1.5rem);
  font-weight: 300; line-height: 1.42; letter-spacing: -0.017em;
  color: var(--bone); max-width: 50ch;
}

/* ----------------------------- interests --------------------------------- */
.interests { display: grid; gap: 1px; background: var(--line-soft);
             border: 1px solid var(--line-soft); }
@media (min-width: 700px)  { .interests { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .interests { grid-template-columns: repeat(3, 1fr); } }
.interest { background: var(--film); padding: 2rem 1.85rem 2.1rem;
            transition: background .35s var(--ease); }
.interest:hover { background: var(--film-1); }
.interest h3 { font-family: var(--display); font-size: 1.3rem; font-weight: 400;
               letter-spacing: -0.018em; line-height: 1.18; margin-bottom: .85rem; }
.interest p { font-size: .94rem; color: var(--soft); }

/* ------------------------------- life ------------------------------------ */
.life { display: grid; gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); }
@media (min-width: 780px)  { .life { grid-template-columns: repeat(2, 1fr); } }
.life__item { background: var(--film); padding: 2rem 1.85rem; }
.life__item h3 { font-family: var(--display); font-size: 1.28rem; font-weight: 400;
                 letter-spacing: -0.018em; margin-bottom: .4rem; }
.life__meta { margin-bottom: 1.1rem; display: block; }
.life__item p { font-size: .92rem; color: var(--soft); margin-bottom: 1rem; }
.life__why { border-left: 1px solid var(--line); padding-left: 1rem;
             font-size: .9rem; color: var(--dim); font-style: italic; }

/* ------------------------------ contact ---------------------------------- */
.form { display: grid; gap: 1.4rem; max-width: 560px; }
.field { display: grid; gap: .55rem; }
.field > label { font-family: var(--mono); font-size: .68rem; letter-spacing: .12em;
                 text-transform: uppercase; color: var(--dim); }
.field input, .field textarea {
  background: var(--film-1); border: 1px solid var(--line); border-radius: 3px;
  padding: .8rem .95rem; color: var(--bone); font-size: .97rem; width: 100%;
  transition: border-color .25s var(--ease), background .25s var(--ease);
}
.field input:hover, .field textarea:hover { border-color: var(--film-3); }
.field input:focus, .field textarea:focus { border-color: var(--exposure); background: var(--film-2); outline: none; }
.field textarea { resize: vertical; min-height: 140px; line-height: 1.6; }
.form__note { font-size: .82rem; color: var(--dim); }
.form__status { font-family: var(--mono); font-size: .78rem; letter-spacing: .04em; min-height: 1.2em; }
.form__status[data-state='ok']   { color: var(--signal); }
.form__status[data-state='err']  { color: #e2725b; }
.form__status[data-state='busy'] { color: var(--dim); }

.contact-links { display: grid; gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); }
@media (min-width: 620px) { .contact-links { grid-template-columns: repeat(2, 1fr); } }
.contact-link { background: var(--film); padding: 1.5rem 1.6rem; display: flex;
                flex-direction: column; gap: .4rem; transition: background .3s var(--ease); }
.contact-link:hover { background: var(--film-1); }
.contact-link b { font-size: 1rem; font-weight: 500; color: var(--bone); }

/* availability strip */
.avail { display: flex; flex-wrap: wrap; gap: 1.25rem 2.5rem; align-items: center;
         padding: 1.6rem 0; border-block: 1px solid var(--line-soft); }
.avail__dot { display: inline-flex; align-items: center; gap: .6rem; }
.avail__dot i { width: 6px; height: 6px; border-radius: 50%; background: var(--signal); }

/* --------------------------- documents list ------------------------------ */
.docs { display: grid; gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); }
@media (min-width: 700px) { .docs { grid-template-columns: repeat(2, 1fr); } }
.doc { background: var(--film); padding: 1.25rem 1.5rem; display: flex;
       align-items: center; justify-content: space-between; gap: 1.5rem;
       transition: background .3s var(--ease); }
.doc:hover { background: var(--film-1); }
.doc__kind { font-family: var(--mono); font-size: .64rem; letter-spacing: .12em;
             color: var(--dim); border: 1px solid var(--line); padding: .22rem .45rem;
             border-radius: 2px; flex: none; }

/* ------------------------------ writing ---------------------------------- */
.posts { display: grid; gap: 1px; background: var(--line-soft);
         border: 1px solid var(--line-soft); }
@media (min-width: 820px) { .posts { grid-template-columns: repeat(2, 1fr); } }
.post-card { background: var(--film); display: flex; flex-direction: column;
             transition: background .35s var(--ease); }
.post-card:hover { background: var(--film-1); }
.post-card__cover { display: block; overflow: hidden; background: var(--film-2);
                    aspect-ratio: 16 / 9; }
.post-card__cover img { width: 100%; height: 100%; object-fit: cover;
                        opacity: .86; transition: opacity .5s var(--ease), transform .8s var(--ease); }
.post-card:hover .post-card__cover img { opacity: 1; transform: scale(1.015); }
.post-card__body { padding: 1.9rem 1.75rem 2rem; display: flex;
                   flex-direction: column; gap: .8rem; }
.post-card__body h3 { font-family: var(--display); font-size: 1.45rem; font-weight: 400;
                      letter-spacing: -0.02em; line-height: 1.18; }
.post-card__body p { font-size: .94rem; color: var(--soft); }
.post-card__body .chips { margin-top: .3rem; }

/* a single post — Medium-style reading experience */
.post { max-width: 720px; padding-block: clamp(3rem, 7vh, 5rem) clamp(4rem, 8vh, 6rem); }
.post__meta { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.6rem; }
.post__date { display: block; margin-bottom: 0; }
.post__reading { font-family: var(--mono); font-size: .78rem; color: var(--dim);
                 letter-spacing: .04em; }
.post__meta .post__date + .post__reading::before { content: '·'; margin-right: 1rem;
                                                    color: var(--dim); }
.post h1 { font-size: clamp(2.4rem, 5.5vw, 3.2rem); line-height: 1.12;
           letter-spacing: -0.02em; margin-bottom: 1.6rem; }
.post__subtitle { font-family: var(--display); font-size: clamp(1.2rem, 2.5vw, 1.5rem);
                  font-weight: 300; line-height: 1.45; color: var(--soft);
                  margin-bottom: 2.8rem; max-width: 46ch; }
.post__body { font-family: var(--display); font-size: clamp(1.15rem, 1.8vw, 1.32rem);
              line-height: 1.82; color: var(--soft); }
.post__body h2 { font-family: var(--display); font-size: clamp(1.6rem, 3vw, 2rem);
                 font-weight: 400; letter-spacing: -0.022em; line-height: 1.22;
                 color: var(--bone); margin: 3.2rem 0 1.2rem; }
.post__body h3 { font-family: var(--display); font-size: clamp(1.25rem, 2vw, 1.5rem);
                 font-weight: 400; letter-spacing: -0.018em; color: var(--bone);
                 margin: 2.8rem 0 1rem; }
.post__body h4 { font-family: var(--mono); font-size: .78rem; letter-spacing: .14em;
                 text-transform: uppercase; color: var(--dim); margin: 2.4rem 0 .9rem; }
.post__body p { max-width: none; margin-bottom: 1.4em; }
.post__body > p:first-child { font-size: 1.15em; color: var(--bone); line-height: 1.7; }
.post__body strong { color: var(--bone); }
.post__body a.link { color: var(--bone); text-decoration: underline;
                     text-decoration-color: var(--dim); text-underline-offset: 3px;
                     transition: text-decoration-color .2s; }
.post__body a.link:hover { text-decoration-color: var(--bone); }
.post__list { margin: .4rem 0 1.8rem; display: flex; flex-direction: column; gap: .75rem; }
.post__list li { position: relative; padding-left: 1.6rem; color: var(--soft);
                 line-height: 1.75; }
ul.post__list li::before { content: ''; position: absolute; left: 0; top: .82em;
                           width: 6px; height: 1px; background: var(--signal); }
ol.post__list { counter-reset: pl; }
ol.post__list li::before { counter-increment: pl; content: counter(pl) '.';
                           position: absolute; left: 0; top: 0;
                           font-family: var(--mono); font-size: .82rem; color: var(--dim); }
.post__quote { border-left: 2px solid var(--signal); padding: .4rem 0 .4rem 1.8rem;
               margin: 2.4rem 0; font-family: var(--display); font-size: 1.35rem;
               font-weight: 300; line-height: 1.5; color: var(--bone);
               font-style: italic; }
.post__fig { margin: 2.8rem -2rem; }
.post__fig img { width: 100%; height: auto; border-radius: 6px;
                 border: 1px solid var(--line-soft); background: var(--film-2); }
.post__fig figcaption { margin: 1rem 2rem 0; font-size: .88rem; color: var(--dim);
                        line-height: 1.6; text-align: center; font-style: italic; }
.post__foot { margin-top: 4rem; padding-top: 2.5rem;
              border-top: 1px solid var(--line-soft); }
.post__tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2rem; }
.post__tag { font-family: var(--mono); font-size: .75rem; letter-spacing: .06em;
             color: var(--dim); background: var(--film-2); border: 1px solid var(--line);
             padding: .35rem .8rem; border-radius: 100px; }
@media (max-width: 860px) {
  .post__fig { margin-inline: -1rem; }
  .post__fig figcaption { margin-inline: 1rem; }
}

/* ------------------------------ footer ----------------------------------- */
.foot { border-top: 1px solid var(--line-soft); padding-block: 3.5rem 2.5rem; margin-top: 2rem; }
.foot__in { display: grid; gap: 2.5rem; }
@media (min-width: 780px) { .foot__in { grid-template-columns: 1.4fr 1fr 1fr; } }
.foot h2 { font-family: var(--display); font-size: 1.6rem; font-weight: 300;
           letter-spacing: -0.02em; margin-bottom: .75rem; }
.foot p { color: var(--soft); font-size: .93rem; max-width: 34ch; }
.foot__col h3 { margin-bottom: 1rem; }
.foot__col ul { display: flex; flex-direction: column; gap: .6rem; }
.foot__col a { font-size: .93rem; color: var(--soft); transition: color .25s var(--ease); }
.foot__col a:hover { color: var(--bone); }
.foot__base { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line-soft);
              display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between;
              font-family: var(--mono); font-size: .68rem; letter-spacing: .1em;
              text-transform: uppercase; color: var(--dim); }

/* ------------------------------ reveal ----------------------------------- */
.reveal { opacity: 0; transform: translateY(14px);
          transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* ------------------------------ mobile ----------------------------------- */
@media (max-width: 860px) {
  .nav__toggle { display: inline-flex; }
  /* absolute (not fixed) — .nav carries a backdrop-filter, which makes it the
     containing block for fixed children and breaks their stacking */
  .nav__links {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 1;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--film); border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .55);
    padding: .5rem var(--gutter) 1.5rem;
    transform: translateY(-8px); opacity: 0; pointer-events: none;
    transition: opacity .3s var(--ease), transform .3s var(--ease);
  }
  .nav__links[data-open='true'] { opacity: 1; transform: none; pointer-events: auto; }
  .nav__link { padding: .95rem 0; border-bottom: 1px solid var(--line-soft); font-size: .85rem; }
  .nav__link[aria-current='page']::after { display: none; }

  .hero__plate { top: auto; bottom: -6%; right: -18%; transform: none;
                 width: min(78vw, 420px); }
  .hero__plate img { opacity: .15; }
  .hero__in { min-height: min(80vh, 660px); }
  .hero__role { font-size: .82rem; letter-spacing: .16em; }
  .block__label { position: static; }
}

@media (max-width: 520px) {
  .case__metric { flex-direction: column; gap: .4rem; }
  .doc { flex-direction: column; align-items: flex-start; gap: .6rem; }
}

/* ------------------------ touch & small screens -------------------------- */
/* Everything below is mobile-only. Desktop sizing is untouched. */
@media (max-width: 860px) {

  /* iOS Safari zooms the whole page when you focus a field whose text is under
     16px, and never zooms back out. 16px exactly is the threshold. This is the
     single most important mobile fix on the site — it's the contact form. */
  .field input,
  .field textarea { font-size: 16px; }

  /* Tap targets. Apple and Google both put the floor at ~44px; several controls
     were 19–36px, which on a phone means mis-taps rather than impossible taps.
     Padding is used rather than height so nothing shifts on desktop. */
  .nav__toggle { width: 44px; height: 44px; }
  .brand { padding-block: .6rem; }

  .case__more,
  .back { padding-block: .8rem; }
  .back { margin-bottom: 1.6rem; }

  .project__links a { padding-block: .75rem; }
  .filter { padding-block: .75rem; }
  .doi { padding-block: .68rem; }
  .foot__col a { display: inline-block; padding-block: .6rem; }
  .foot p .link { display: inline-block; padding-block: .5rem; }
  /* Inline links inside a sentence stay as they are — padding them to 44px
     would break the line rhythm of the paragraph they live in. */

  /* Legibility. 10–11px uppercase mono reads fine on a monitor at arm's length
     and poorly on a phone; nudged up without changing the typographic voice. */
  .label { font-size: .78rem; }        /* 11 → 12.5px */
  .chip { font-size: .76rem; padding: .34rem .62rem; }
  .stat__l { font-size: .74rem; }
  .brand__mark { font-size: .7rem; }

  /* Long unbroken strings — DOIs, URLs — must never force a sideways scroll. */
  .doi, .paper__authors, .contact-link b { overflow-wrap: anywhere; }
}

/* Mobile browsers change viewport height as the address bar hides, which makes
   a vh-based hero jump mid-scroll. dvh tracks the visible area instead. */
@supports (height: 100dvh) {
  .hero__in { min-height: min(86dvh, 780px); }
  @media (max-width: 860px) {
    .hero__in { min-height: min(80dvh, 660px); }
  }
}

/* --------------------------- reduced motion ------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .bar__fill { transform: scaleX(1); }
}

/* ------------------------------- print ----------------------------------- */
@media print {
  body { background: #fff; color: #000; }
  .nav, .hero__plate, .foot, .btn { display: none; }
  .display, .paper__title { color: #000; }
}
