/* Minimal black-and-white, single-column document layout */

* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

:root {
  --bg: #fff;
  --fg: #000;
  --maxw: 740px;
  --space: 1.25rem;
  /* Active tab indicator colors */
  --tab-about: #0093a9;     /* about (black) */
  --tab-home: #000000;      /* black */
  --tab-news: #D81B24;      /* red */
  --tab-research: #0057A3;  /* blue */
  --tab-teaching: #2E7D32;  /* green */
  --tab-publications: #F57C00; /* orange */
  --tab-notes: #000000;     /* notes */
  --tab-blog: #e8f31c;      /* purple */
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Meta", Helvetica, Arial, sans-serif;
  line-height: 1.55;
}

.skip { position: absolute; left: -999px; top: -999px; }
.skip:focus {
  left: 1rem; top: 1rem;
  background: var(--fg);
  color: var(--bg);
  padding: .25rem .5rem;
}

.page {
  max-width: calc(var(--maxw) * 1);
  margin: 8vh auto;
  padding: 0 2.7rem 10vh;
}

.header { margin-bottom: 0; text-align: center; }
.title {
  margin: 0;
  font-weight: 800; /* Bold display */
  /* text-transform: uppercase; */
  letter-spacing: 0.1em;
  line-height: 1.1;
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  padding-bottom: .2rem;
}
.title .brand-mark {
  height: .7em; /* match text size */
  width: auto;
  vertical-align: 0em; /* nudge to baseline */
  margin-left: -.5rem;
  /* filter: grayscale(1) contrast(1.25); */
}
.tagline { margin: .1rem 0 0; font-weight: 500; }

.section { padding-top: var(--space); margin-top: var(--space); }
/* Tighter space from nav to first section */
.nav + .section { margin-top: 1rem; padding-top: .5rem; }
h2 {
  margin: 0 0 .5rem 0;
  font-size: clamp(1.1rem, 2.6vw, 1.35rem);
  line-height: 1.2;
  font-weight: 800; /* Bold section titles */
  /* text-transform: uppercase; */
  letter-spacing: 0.02em;
}

p { margin: 0 0 1rem 0; }
ul, ol { margin: 0 0 1rem 1.25rem; padding: 0; }
ul.tight li { margin-bottom: .25rem; }

/* Full justification for body content */
.section p,
.section li {
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}

.pubs { list-style: decimal; }
.pubs li { margin: 0 0 .75rem 0; }
.pub-title { font-style: italic; font-weight: normal; }

a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
a:hover, a:focus { text-decoration-thickness: 2px; }

.footer { margin-top: 0; padding-top: var(--space); font-size: .95rem; }
.footer p { margin: 0; }

@media print {
  .page { margin: 0; padding: 0; }
  a { text-decoration: none; }
}

/* Math typesetting tweaks (KaTeX) */
.katex { color: inherit; }
.katex-display { margin: .75rem 0; }

/* Minimal centered navigation */
.nav {
  margin-top: .5rem; /* space under tagline */
  display: flex;
  gap: .25rem .4rem; /* reduced spacing between buttons */
  justify-content: center;
  flex-wrap: nowrap; /* force one line */
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: .9rem; /* slightly smaller font */
  /* full-bleed nav spanning viewport width while content stays narrow */
  width: 100vw;
  position: relative;
  z-index: 20;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  padding-left: calc((100vw - min(var(--maxw), 100vw)) / 2);
  padding-right: calc((100vw - min(var(--maxw), 100vw)) / 2);
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}
.nav a { color: inherit; text-decoration: none; }
.nav a:hover, .nav a:focus { text-decoration: underline; text-decoration-thickness: 2px; }

/* Top-level nav buttons as minimal black boxes */
.nav > a,
.nav .dropdown > a {
  background: #fff;
  color: #000;
  border: 1px solid #000;
  padding: .2rem .3rem;
  display: inline-block;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap; /* prevent wrap to keep equal heights */
}
.nav > a:hover, .nav > a:focus,
.nav .dropdown > a:hover, .nav .dropdown > a:focus {
  text-decoration: none;
  background: #f5f5f5;
}

/* Blog button inverted (black background, white text) */
.nav a[data-tab="blog"] {
  background: #000;
  color: #fff;
  border-color: #000;
}
.nav a[data-tab="blog"]:hover,
.nav a[data-tab="blog"]:focus {
  background: #111;
}

/* Dropdown removed: single Research page */
.nav a[aria-current="page"] {
  text-decoration: none;
  box-shadow: inset 0 -3px var(--active-color, currentColor);
}
.nav a[aria-current="page"]:hover,
.nav a[aria-current="page"]:focus { text-decoration: none; }

  /* Per-tab active colors */
  .nav a[data-tab="about"][aria-current="page"] { --active-color: var(--tab-about); }
  .nav a[data-tab="home"][aria-current="page"] { --active-color: var(--tab-home); }
  .nav a[data-tab="news"][aria-current="page"] { --active-color: var(--tab-news); }
  .nav a[data-tab="research"][aria-current="page"] { --active-color: var(--tab-research); }
  .nav a[data-tab="teaching"][aria-current="page"] { --active-color: var(--tab-teaching); }
  .nav a[data-tab="publications"][aria-current="page"] { --active-color: var(--tab-publications); }
  .nav a[data-tab="notes"][aria-current="page"] { --active-color: var(--tab-notes); }
  .nav a[data-tab="blog"][aria-current="page"] { --active-color: var(--tab-blog); }

/* News list */
.news { list-style: none; padding: 0; margin: 0; }
.news li { margin: 0 0 .75rem 0; }
.news time { font-weight: 700; margin-right: .5rem; }

/* Home hero image */
.hero { margin: .75rem 0 0; }
.hero img {
  display: block;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  height: auto;
  /* filter: grayscale(1) contrast(1.1); */
}

/* About page two-column layout */
.about-layout {
  display: flex;
  flex-direction: row;
  gap: 2rem;
  align-items: flex-start;
  flex-wrap: nowrap;
}
.about-content {
  flex: 1 1 auto;
  min-width: 0;
}
.about-image {
  flex: 0 0 auto;
  width: 300px;
}
.about-image img {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

@media (max-width: 768px) {
  .about-layout {
    flex-direction: column;
  }
  .about-image {
    width: 100%;
  }
}
