/* ===========================================================================
   Istiaque Ahmed — academic site
   Ink on warm off-white, one deep-teal accent. Hairlines and tints, no shadows.
   =========================================================================== */

:root {
  --bg:        #FCFCFA;
  --surface:   #FFFFFF;
  --text:      #14171A;
  --muted:     #5B6472;
  --rule:      #E6E4DE;
  --accent:    #0B6B5F;
  --accent-bg: #E8F2F0;

  --font-head: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  --max: 1120px;
  --nav: 60px;
  --r:   10px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:        #0F1115;
    --surface:   #171A1F;
    --text:      #E8E8E4;
    --muted:     #9AA3AE;
    --rule:      #262A31;
    --accent:    #5EC8B8;
    --accent-bg: #16302D;
  }
}

:root[data-theme="dark"] {
  --bg:        #0F1115;
  --surface:   #171A1F;
  --text:      #E8E8E4;
  --muted:     #9AA3AE;
  --rule:      #262A31;
  --accent:    #5EC8B8;
  --accent-bg: #16302D;
}

/* --------------------------------- base ---------------------------------- */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
/* Smooth cross-fade on same-origin navigation (Chrome/Edge); other browsers
   simply ignore it and navigate as usual. */
@view-transition { navigation: auto; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  ::view-transition-group(*), ::view-transition-old(*),
  ::view-transition-new(*) { animation: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.25; }
p { margin: 0 0 1rem; }
img { max-width: 100%; display: block; }

a { color: var(--accent); text-decoration: none; }
a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px; text-underline-offset: 3px;
}

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

/* ------------------------------ interaction ------------------------------
   One shared timing for every state change. Properties are named rather than
   using `all`, which would animate layout and cause jank. --------------- */

a, .btn, .chip, .iconbtn, .pub__link, .card__ico, .person,
a.card, .card--link, .nav__links a, .tl h3,
.nav__links a::after, .linkrow a::after,
.pub::before, .newsline li::before, .tl li::before {
  transition: color .15s ease, background-color .15s ease,
              border-color .15s ease, transform .15s ease;
}
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px;
}

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 2rem; }
.narrow { max-width: 68ch; }

.vh {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 60;
  padding: .6rem 1rem; background: var(--accent); color: var(--bg);
}
.skip:focus { left: .5rem; top: .5rem; }

.eyebrow {
  margin: 0 0 .7rem;
  font: 500 .76rem/1.4 var(--font-mono);
  text-transform: uppercase; letter-spacing: .14em; color: var(--accent);
}

/* ---------------------------------- nav ---------------------------------- */

.nav {
  position: sticky; top: 0; z-index: 30;
  height: var(--nav);
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.nav__in {
  max-width: var(--max); height: 100%; margin: 0 auto; padding: 0 2rem;
  display: flex; align-items: center; gap: 1.5rem;
}
.nav__brand {
  display: flex; align-items: center; gap: .6rem;
  font-family: var(--font-head); font-weight: 600; font-size: 1rem;
  color: var(--text); white-space: nowrap;
}
.nav__brand:hover { text-decoration: none; color: var(--accent); }
.nav__mono {
  display: grid; place-items: center;
  width: 28px; height: 28px; border-radius: 6px;
  background: var(--accent); color: var(--bg);
  font-size: .82rem; letter-spacing: .02em;
}
.nav__links { display: flex; align-items: center; gap: 1.5rem; margin-left: auto; }
.nav__links a {
  position: relative; padding: .2rem 0;
  font-size: .9rem; color: var(--muted);
}
.nav__links a:hover { color: var(--text); text-decoration: none; }
.nav__links a.is-on { color: var(--text); }
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 2px; background: var(--accent); border-radius: 2px;
  transform: scaleX(0); transform-origin: left;
}
.nav__links a:hover::after,
.nav__links a.is-on::after { transform: scaleX(1); }
/* Marks a nav item that leaves the site. */
.nav__ext { margin-left: .22rem; font-size: .78em; opacity: .65; }

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

.iconbtn {
  display: grid; place-items: center;
  width: 32px; height: 32px; padding: 0;
  background: none; border: 1px solid var(--rule); border-radius: 6px;
  color: var(--muted); cursor: pointer;
}
.iconbtn:hover { color: var(--accent); border-color: var(--accent); }
.iconbtn svg {
  width: 16px; height: 16px; fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: none; }
  :root:not([data-theme="light"]) .i-moon { display: block; }
  :root[data-theme="light"] .i-sun { display: block; }
  :root[data-theme="light"] .i-moon { display: none; }
}
.burger { display: none; }

/* -------------------------------- buttons -------------------------------- */

.btn {
  display: inline-block;
  padding: .55rem 1.1rem;
  background: var(--accent); color: var(--bg);
  border: 1px solid var(--accent); border-radius: 7px;
  font: 500 .9rem/1.5 var(--font-body); cursor: pointer;
}
.btn:hover {
  text-decoration: none; filter: brightness(1.1);
  transform: translateY(-1px);
}
.btn:active { transform: translateY(0); }
.btn--ghost {
  background: none; color: var(--text); border-color: var(--rule);
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); filter: none; }
.btn--sm { padding: .36rem .8rem; font-size: .84rem; }

/* --------------------------------- hero ---------------------------------- */

.hero { padding: 4.2rem 0 3.4rem; }
.hero__in {
  display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 4rem;
  align-items: center;
}
.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.3rem, 5.4vw, 3.3rem);
  letter-spacing: -.02em;
}
.hero__lede {
  max-width: 54ch;
  font-size: 1.14rem; line-height: 1.6; color: var(--muted);
}
.hero__lede strong { color: var(--text); font-weight: 500; }
.hero__where {
  margin: 1.2rem 0 0;
  font-size: .93rem; line-height: 1.6; color: var(--muted);
}
.hero__where b { color: var(--text); font-weight: 500; }
.hero__cta { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.8rem; }

.hero__media { position: relative; }
.hero__media::before {
  content: ""; position: absolute; inset: 14px -14px -14px 14px;
  background: var(--accent-bg); border-radius: var(--r);
}
.hero__img {
  position: relative;
  /* height:auto is required — the width/height attributes on the <img> become
     presentational hints, and without this the height hint beats aspect-ratio. */
  width: 100%; height: auto; aspect-ratio: 1;
  border-radius: var(--r);
  border: 1px solid var(--rule);
  object-fit: cover; object-position: center 20%;
  background: var(--surface);
}
.hero__img--mono {
  display: grid; place-items: center;
  color: var(--accent); background: var(--surface);
  font-family: var(--font-head); font-weight: 600; font-size: 4.4rem;
  letter-spacing: .02em;
}

.linkrow { display: flex; flex-wrap: wrap; gap: 1.1rem; margin: 1.6rem 0 0; }
.linkrow a {
  position: relative; padding-bottom: 3px;
  font-size: .88rem; color: var(--muted);
}
/* Growing underline, same as the nav. text-decoration is suppressed so the
   default underline does not double up with it. */
.linkrow a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 2px; background: var(--accent); border-radius: 2px;
  transform: scaleX(0); transform-origin: left;
}
.linkrow a:hover { color: var(--accent); text-decoration: none; }
.linkrow a:hover::after { transform: scaleX(1); }

/* --------------------------------- stats --------------------------------- */

.stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
}
.stats > div { padding: 1.5rem 0; position: relative; }
.stats > div + div { padding-left: 1.6rem; }
/* Drawn as an inset pseudo-element rather than a border, so the dividers stop
   short of the top and bottom rules instead of running into them. */
.stats > div + div::before {
  content: ""; position: absolute; left: 0; top: 1rem; bottom: 1rem;
  width: 1px; background: var(--rule);
}
.stats b {
  display: block;
  font: 500 1.75rem/1.1 var(--font-mono);
  color: var(--accent); font-variant-numeric: tabular-nums;
}
.stats span {
  display: block; margin-top: .35rem;
  font-size: .8rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted);
}

/* --------------------------------- bands --------------------------------- */

.band {
  padding-top: 4rem; padding-bottom: 4rem;
  border-top: 1px solid var(--rule);
}
.band:first-of-type { border-top: 0; }
.band__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; margin-bottom: 2rem;
}
.band__head h2 { margin: 0; font-size: 1.55rem; letter-spacing: -.01em; }
.band__head p { margin: .4rem 0 0; font-size: .95rem; color: var(--muted); }
.band__more { font-size: .88rem; white-space: nowrap; }

.grid { display: grid; gap: 1.1rem; }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.card {
  display: flex; flex-direction: column;
  padding: 1.6rem;
  background: var(--surface);
  border: 1px solid var(--rule); border-radius: var(--r);
}
a.card, .card--link { color: inherit; }
a.card:hover, .card--link:hover {
  border-color: var(--accent); text-decoration: none;
  transform: translateY(-2px);
}
a.card:active { transform: translateY(0); }
/* Not clickable — a border shift only, no lift, so it makes no false promise. */
.person:hover { border-color: var(--muted); }
.card__ico {
  display: grid; place-items: center;
  width: 40px; height: 40px; margin-bottom: 1.2rem;
  background: var(--accent-bg); border-radius: 9px;
  color: var(--accent);
}
.card__ico svg {
  width: 21px; height: 21px; fill: none; stroke: currentColor;
  stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}
a.card:hover .card__ico, .card--link:hover .card__ico {
  background: var(--accent); color: var(--bg);
}
.card h3 { margin: 0 0 .5rem; font-size: 1.12rem; }
.card p { margin: 0 0 1.3rem; font-size: .94rem; color: var(--muted); }
.card > :last-child { margin-bottom: 0; }
.card__tags { margin: 1.1rem 0 1.3rem; }
.card__foot {
  margin-top: auto; padding-top: .9rem;
  border-top: 1px solid var(--rule);
  font: 400 .78rem/1.5 var(--font-mono); color: var(--accent);
}

/* Anchored sections clear the sticky nav. */
main [id] { scroll-margin-top: calc(var(--nav) + 1.5rem); }

/* --------------------- dated lists: news + selected work ----------------- */

.newsline { list-style: none; margin: 0; padding: 0; }
.newsline li {
  position: relative;
  display: grid; grid-template-columns: 6rem minmax(0, 1fr); gap: 0 1.2rem;
  padding: .95rem 0; border-top: 1px solid var(--rule);
  font-size: .96rem; color: var(--muted);
}
.newsline li::before {
  content: ""; position: absolute; inset: 0 -1rem;
  border-radius: 6px; background: transparent;
}
.newsline li:hover::before { background: var(--accent-bg); }
.newsline li > * { position: relative; }
.newsline li:first-child { border-top: 0; padding-top: 0; }
.newsline time {
  font: 400 .78rem/1.85 var(--font-mono); color: var(--accent);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.newsline strong, .newsline em { color: var(--text); }
.newsline strong { font-weight: 500; }

/* Publication rows reuse the same shape, with a title line on top. */
.newsline h3 {
  margin: 0 0 .3rem;
  font-size: 1.04rem; line-height: 1.4; color: var(--text);
}
.sw__authors { margin: 0 0 .15rem; }
.sw__authors .me { color: var(--text); font-weight: 600; }
.sw__venue { margin: 0; font-style: italic; }
.newsline .pub__links { margin-top: .6rem; }

/* ---------------------------------- cta ---------------------------------- */

.cta {
  margin: 1rem 0 4.5rem;
  padding: 3rem 2rem;
  background: var(--accent-bg); border-radius: 14px;
  text-align: center;
}
.cta h2 { margin: 0 0 .7rem; font-size: 1.5rem; }
.cta p { max-width: 52ch; margin: 0 auto 1.6rem; color: var(--muted); }
:root[data-theme="dark"] .cta p { color: var(--text); }
.cta__actions {
  display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem;
  max-width: none; margin: 0;
}

/* ------------------------------- page head ------------------------------- */

.phead {
  padding-top: 3.2rem; padding-bottom: 2.6rem;
  border-bottom: 1px solid var(--rule);
}
.phead h1 { margin: 0 0 .8rem; font-size: clamp(1.9rem, 4vw, 2.5rem); letter-spacing: -.015em; }
.phead p { max-width: 62ch; margin: 0; font-size: 1.06rem; color: var(--muted); }

.section { padding: 3.2rem 0; border-top: 1px solid var(--rule); }
.section:first-of-type { border-top: 0; }
.section > h2 {
  margin: 0 0 1.6rem;
  font: 600 .78rem/1 var(--font-body);
  text-transform: uppercase; letter-spacing: .13em; color: var(--muted);
  display: flex; align-items: center; gap: 1rem;
}
.section > h2::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.sub__h { margin: 2.4rem 0 .9rem; font-size: 1.05rem; }
.sub__h:first-of-type { margin-top: 0; }

/* --------------------------- research area block ------------------------- */

.area {
  display: grid; grid-template-columns: 2.2rem minmax(0, 1fr); gap: 0 1.4rem;
  padding: 2.4rem 0; border-top: 1px solid var(--rule);
}
.area:first-of-type { border-top: 0; padding-top: .6rem; }
.area__ico { color: var(--accent); }
.area__ico svg {
  width: 26px; height: 26px; fill: none; stroke: currentColor;
  stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}
.area h2 { margin: 0 0 .6rem; font-size: 1.35rem; }
.area > div > p { max-width: 66ch; color: var(--muted); }
.area__tags { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1.4rem; }
.tag {
  padding: .13rem .5rem;
  border: 1px solid var(--rule); border-radius: 4px;
  font: 400 .74rem/1.65 var(--font-mono); color: var(--muted);
}
.tag__n { margin-left: .45rem; color: var(--accent); font-weight: 500; }

/* -------------------------------- people --------------------------------- */

.people {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem;
}
.person {
  padding: 1.15rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--rule); border-radius: var(--r);
}
.person .role, .card .role {
  margin: 0 0 .45rem;
  font: 500 .7rem/1.6 var(--font-mono);
  text-transform: uppercase; letter-spacing: .08em; color: var(--accent);
}

/* ------------------------------- timeline -------------------------------- */

.tl {
  list-style: none; margin: 0; padding: 0 0 0 1.5rem;
  position: relative; max-width: 72ch;
}
.tl::before {
  content: ""; position: absolute; left: 5px; top: .6rem; bottom: .6rem;
  width: 1px; background: var(--rule);
}
.tl li { position: relative; padding-bottom: 1.6rem; }
.tl li:last-child { padding-bottom: 0; }
.tl li::before {
  content: ""; position: absolute; left: -1.5rem; top: .4rem;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--rule);
}
/* The timeline gets the dot and the heading, not a tint — a filled block
   behind it would fight the connector line. */
.tl li:hover::before {
  background: var(--accent); border-color: var(--accent);
  transform: scale(1.25);
}
.tl li:hover h3 { color: var(--accent); }
.tl li.is-now::before { background: var(--accent); border-color: var(--accent); }
.tl time {
  display: block;
  font: 400 .78rem/1.6 var(--font-mono); color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.tl li.is-now time { color: var(--accent); }
.tl h3 { margin: .15rem 0 .2rem; font-size: 1.03rem; }
.tl p { margin: 0; font-size: .93rem; color: var(--muted); }
.tl__meta {
  display: block; margin-top: .4rem;
  font: 400 .78rem/1.6 var(--font-mono); color: var(--accent);
}
.person h3 { margin: 0 0 .3rem; font-size: 1.02rem; }
.person p { margin: 0; font-size: .87rem; line-height: 1.5; color: var(--muted); }
.coauthors { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; }

.callout {
  margin: 1.6rem 0;
  padding: 1.4rem 1.6rem;
  background: var(--accent-bg); border-radius: var(--r);
}
.callout h3 { margin: 0 0 .5rem; font-size: 1.04rem; }
.callout p { margin: 0; font-size: .95rem; color: var(--muted); }
:root[data-theme="dark"] .callout p { color: var(--text); }

/* ----------------------- generic date + content rows --------------------- */

.rows { list-style: none; margin: 0; padding: 0; max-width: 72ch; }
.rows > li {
  display: grid; grid-template-columns: 6.2rem minmax(0, 1fr); gap: 0 1.2rem;
  padding: 1.05rem 0; border-top: 1px solid var(--rule);
}
.rows > li:first-child { border-top: 0; padding-top: 0; }
.rows__when {
  font: 400 .78rem/1.9 var(--font-mono); color: var(--muted);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.rows > li > div > :last-child { margin-bottom: 0; }
.rows h3 { margin: 0 0 .25rem; font-size: 1rem; }
.rows h3 .meta {
  font-family: var(--font-body); font-weight: 400;
  color: var(--muted); font-size: .92rem;
}
.rows p { font-size: .95rem; color: var(--muted); }
.rows--plain > li { grid-template-columns: minmax(0, 1fr); }
.rows .links { display: flex; align-items: center; gap: .6rem; margin-top: .5rem; font-size: .84rem; }

details { font-size: .95rem; color: var(--muted); }
details summary { cursor: pointer; color: var(--accent); font-size: .9rem; }
details p { margin: .5rem 0 0; }

/* --------------------------------- skills -------------------------------- */

.skills {
  display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 0 1.2rem;
  margin: 0; max-width: 72ch;
}
.skills dt { padding: .8rem 0; font-size: .88rem; font-weight: 500; border-top: 1px solid var(--rule); }
.skills dd { margin: 0; padding: .8rem 0; font-size: .92rem; color: var(--muted); border-top: 1px solid var(--rule); }
.skills dt:first-of-type, .skills dd:first-of-type { border-top: 0; }

/* ------------------------------ publications ----------------------------- */

.pub__tools {
  position: sticky; top: var(--nav); z-index: 15;
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: .8rem;
  padding: 1rem 0;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
  padding: .3rem .7rem;
  background: none; border: 1px solid var(--rule); border-radius: 999px;
  font: 400 .84rem/1.4 var(--font-body); color: var(--muted); cursor: pointer;
}
.chip:hover { color: var(--text); border-color: var(--muted); }
.chip.is-on {
  background: var(--accent-bg); border-color: var(--accent);
  color: var(--accent); font-weight: 500;
}
.chip__n { font-family: var(--font-mono); font-size: .76rem; opacity: .75; margin-left: .35rem; }

.search input {
  width: 16rem; max-width: 100%;
  padding: .4rem .75rem;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--rule); border-radius: 7px;
  font: 400 .88rem/1.4 var(--font-body);
}
.search input::placeholder { color: var(--muted); }
.search input:focus { border-color: var(--accent); }

.pub__count { margin: 1.2rem 0 0; font-size: .86rem; color: var(--muted); }
.pub__group { margin-top: 2.6rem; }
.pub__group > h2 {
  margin: 0 0 .4rem;
  font: 500 .8rem/1.4 var(--font-body);
  text-transform: uppercase; letter-spacing: .1em; color: var(--muted);
}
.pub__group > h2 .chip__n { text-transform: none; letter-spacing: 0; }

.pub {
  position: relative;
  display: grid; grid-template-columns: 3.6rem minmax(0, 1fr); gap: 0 1.2rem;
  padding: 1.2rem 0; border-top: 1px solid var(--rule);
}
/* Tint bleeds past the text gutter so a long list stays easy to track. */
.pub::before {
  content: ""; position: absolute; inset: 0 -1rem;
  border-radius: 6px; background: transparent;
}
.pub:hover::before { background: var(--accent-bg); }
.pub > * { position: relative; }
.pub__year {
  font: 400 .78rem/1.95 var(--font-mono); color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.pub__title { margin: 0 0 .3rem; font-size: 1.03rem; line-height: 1.4; }
.pub__authors { margin: 0 0 .12rem; font-size: .91rem; color: var(--muted); }
.pub__authors .me { color: var(--text); font-weight: 600; }
.pub__venue { margin: 0; font-size: .91rem; color: var(--muted); }
.pub__venue .v { font-style: italic; }
.pub__note { display: inline-block; margin-top: .3rem; font-size: .82rem; color: var(--accent); }
.pub__links { display: flex; flex-wrap: wrap; gap: .4rem; margin: .65rem 0 0; }
.pub__link {
  padding: .13rem .5rem;
  border: 1px solid var(--rule); border-radius: 4px;
  font: 400 .76rem/1.7 var(--font-mono); color: var(--muted);
  background: none; cursor: pointer;
}
.pub__link:hover {
  color: var(--accent); border-color: var(--accent);
  background: var(--accent-bg); text-decoration: none;
}
.pub__empty { padding: 2.5rem 0; color: var(--muted); font-size: .95rem; }

/* --------------------------------- footer -------------------------------- */

.foot { padding: 0 0 2.8rem; }
/* Content-width rule above the footer columns. */
.foot__in {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem;
  max-width: var(--max); margin: 0 auto; padding: 2.8rem 2rem 0;
  border-top: 1px solid var(--rule);
}
.foot h2 {
  margin: 0 0 .8rem;
  font: 600 .74rem/1 var(--font-body);
  text-transform: uppercase; letter-spacing: .12em; color: var(--muted);
}
.foot p, .foot li { font-size: .9rem; color: var(--muted); margin: 0 0 .35rem; }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot__name { font-family: var(--font-head); font-weight: 600; font-size: 1.05rem; color: var(--text); }
/* Full-bleed rule above the copyright. Scoped under .foot so it outranks
   `.foot p`, which would otherwise reset the margins set here. */
.foot .foot__meta {
  margin: 2.2rem 0 0; padding: 1.2rem 2rem 0;
  border-top: 1px solid var(--rule);
  font-size: .82rem; color: var(--muted);
  text-align: center;
}

/* -------------------------------- dialog --------------------------------- */

.dlg {
  width: min(640px, calc(100vw - 2rem));
  padding: 0; border: 1px solid var(--rule); border-radius: 12px;
  background: var(--surface); color: var(--text);
}
.dlg::backdrop { background: rgb(0 0 0 / .45); }
.dlg__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem 1.2rem; border-bottom: 1px solid var(--rule);
}
.dlg__head h2 { margin: 0; font-size: 1rem; }
.dlg__x { background: none; border: 0; cursor: pointer; font-size: 1.5rem; line-height: 1; color: var(--muted); }
.dlg__x:hover { color: var(--accent); }
#bibOut {
  margin: 0; padding: 1.2rem; max-height: 55vh; overflow: auto;
  font: 400 .82rem/1.65 var(--font-mono);
  white-space: pre-wrap; word-break: break-word;
}
.dlg__foot { display: flex; justify-content: flex-end; padding: .9rem 1.2rem; border-top: 1px solid var(--rule); }

/* ------------------------------ responsive ------------------------------- */

@media (max-width: 960px) {
  .hero__in { grid-template-columns: minmax(0, 1fr); gap: 2.4rem; }
  .hero__media { max-width: 200px; order: -1; }
  .hero__img--mono { font-size: 3.2rem; }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .people { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot__in { grid-template-columns: 1fr 1fr; }
}

/* The nav runs out of room before the phone layout kicks in, so it collapses
   on its own breakpoint. Raise this if more items are added. */
@media (max-width: 880px) {
  .nav__links {
    position: absolute; top: var(--nav); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    margin: 0; padding: .4rem 1rem 1rem;
    background: var(--bg); border-bottom: 1px solid var(--rule);
    display: none;
  }
  .nav__links.is-open { display: flex; }
  .nav__links a { padding: .65rem 0; font-size: .96rem; }
  .nav__links a::after { display: none; }
  .nav__links a.is-on { color: var(--accent); }
  .nav__tools { margin-left: auto; }
  .burger { display: grid; }
}

@media (max-width: 760px) {
  .wrap, .nav__in, .foot__in, .foot .foot__meta { padding-left: 1rem; padding-right: 1rem; }


  .hero { padding: 2.6rem 0 2.4rem; }
  .hero__media { max-width: 132px; }
  .hero__img--mono { font-size: 2.6rem; }

  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats > div { padding: 1.1rem 0; }
  .stats > div + div { padding-left: 0; }
  .stats > div + div::before { display: none; }
  .stats > div:nth-child(2n) { padding-left: 1.2rem; }
  .stats > div:nth-child(2n)::before { display: block; top: .7rem; bottom: .7rem; }
  .stats > div:nth-child(n + 3) { border-top: 1px solid var(--rule); }
  .stats b { font-size: 1.5rem; }

  .band { padding-top: 2.6rem; padding-bottom: 2.6rem; }
  .band__head { flex-direction: column; align-items: flex-start; gap: .4rem; }
  .grid--3, .grid--2 { grid-template-columns: minmax(0, 1fr); }
  .people { grid-template-columns: minmax(0, 1fr); }
  .card, .work { padding: 1.3rem; }

  .newsline li { grid-template-columns: minmax(0, 1fr); gap: .15rem; }
  .newsline time { line-height: 1.5; }

  .cta { padding: 2.2rem 1.4rem; }
  .phead { padding-top: 2.2rem; padding-bottom: 1.8rem; }
  .section { padding: 2.4rem 0; }

  .area { grid-template-columns: minmax(0, 1fr); gap: .9rem; }
  .rows > li { grid-template-columns: minmax(0, 1fr); gap: .2rem; }
  .rows__when { line-height: 1.5; }
  .pub { grid-template-columns: minmax(0, 1fr); gap: .2rem; }
  .pub__year { line-height: 1.5; }
  .skills { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .skills dt { padding-bottom: 0; }
  .skills dd { padding-top: .25rem; border-top: 0; }
  .skills dd:first-of-type { border-top: 0; }

  .pub__tools { padding: .8rem 0; }
  .search { flex: 1 1 100%; }
  .search input { width: 100%; }

  .foot__in { grid-template-columns: minmax(0, 1fr); gap: 1.6rem; }
}

@media print {
  .nav, .pub__tools, .dlg, .skip, .cta, .hero__media { display: none !important; }
  body { font-size: 11pt; color: #000; background: #fff; }
  a { color: #000; }
  .card, .work { border: 1px solid #ccc; break-inside: avoid; }
  .band, .section { padding-top: 1.2rem; padding-bottom: 1.2rem; break-inside: avoid; }
}
