/* ==========================================================================
   Personal academic homepage — style.css
   Content-first, single-column layout. No frameworks.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Design tokens
   -------------------------------------------------------------------------- */
:root {
  /* Palette: near-white paper, near-black ink, one restrained accent. */
  --color-bg: #fcfcfa;
  --color-text: #1c1c1c;
  --color-text-muted: #5d5d58;
  --color-text-faint: #8a8a84;
  --color-rule: #dededa;
  --color-accent: #1f4b7a;        /* links */
  --color-accent-hover: #12314f;
  --color-tag-bg: #f0efeb;
  --color-placeholder: #a05a12;   /* deliberately noticeable: unfilled content */

  /* Type: serif for reading, sans for small UI labels. */
  --font-serif: 'Roboto Mono', monospace;
  --font-heading: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --text-base: clamp(0.9rem, 0.8rem + 0.15vw, 1rem);
  --leading: 1.65;

  /* Layout */
  --measure: 48rem;               /* ~700px content width */
  --gutter: clamp(1.25rem, 5vw, 2.5rem);
  --space-section: clamp(2rem, 5vw, 3rem);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-serif);
  font-size: var(--text-base);
  line-height: var(--leading);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.page {
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(2.5rem, 8vw, 5rem) var(--gutter) clamp(2rem, 6vw, 3.5rem);
}

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.375rem;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.0625rem;
}

p {
  margin: 0 0 1rem;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--color-accent);
  text-decoration: underline;
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.18em;
  text-decoration-color: color-mix(in srgb, var(--color-accent) 40%, transparent);
  transition: color 120ms ease, text-decoration-color 120ms ease;
}

a:hover {
  color: var(--color-accent-hover);
  text-decoration-color: currentColor;
}

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

ul, ol {
  margin: 0;
  padding: 0;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

svg.icon {
  flex: none;
  width: 1em;
  height: 1em;
}

/* Visible marker for content that still needs to be written. */
.placeholder {
  color: var(--color-placeholder);
  border-bottom: 1px dashed currentColor;
}

a.placeholder {
  text-decoration: none;
}

/* Skip link: hidden until focused. */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  padding: 0.5rem 0.75rem;
  background: var(--color-text);
  color: var(--color-bg);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  z-index: 10;
}

.skip-link:focus {
  top: 1rem;
}

/* --------------------------------------------------------------------------
   Introduction
   -------------------------------------------------------------------------- */
.intro {
  display: flex;
  align-items: flex-start;
  gap: 1.75rem;
}

.intro-photo {
  width: 8.5rem;
  height: 8.5rem;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  margin-top: 0.35rem;
}

.intro-text {
  min-width: 0;
}

.intro-name {
  font-size: clamp(1.985rem, 1.8rem + 1.8vw, 2.9rem);
  margin-bottom: 0.25rem;
}

.intro-role {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.intro-summary {
  max-width: 38rem;
  margin-bottom: 1.25rem;
}

/* --------------------------------------------------------------------------
   In-page navigation
   -------------------------------------------------------------------------- */
.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--color-rule);
  border-bottom: 1px solid var(--color-rule);
  font-family: var(--font-sans);
  font-size: 0.955rem;
}

.nav-sections {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
}

.nav-sections a {
  color: var(--color-text-muted);
  text-decoration: none;
  padding: 0.1rem 0;
  border-bottom: 1px solid transparent;
  transition: color 120ms ease, border-color 120ms ease;
}

.nav-sections a:hover,
.nav-sections a.is-active {
  color: var(--color-text);
  border-bottom-color: var(--color-text);
}

/* Icon links (GitHub, LinkedIn, email) on the right of the bar. */
.nav-icons {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: none;
}

.nav-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  color: var(--color-text-muted);
  border-radius: 4px;
  transition: color 120ms ease, background-color 120ms ease;
}

.nav-icons a:hover {
  color: var(--color-text);
  background: var(--color-tag-bg);
}

.nav-icons .icon {
  width: 1.355rem;
  height: 1.355rem;
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
.section {
  padding-top: var(--space-section);
}

.section + .section {
  margin-top: var(--space-section);
  border-top: 1px solid var(--color-rule);
}

.section-lede {
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}

/* Entry list: a left "meta" column (year, dates) beside the content.
   Collapses to a single column on small screens. */
.entries {
  list-style: none;
}

.entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.entry + .entry {
  margin-top: 2rem;
}

.entry-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
}

.entry-title a {
  color: inherit;
}

/* Date on the right of the title line; wraps below it on narrow screens. */
.entry-date {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: normal;
  color: var(--color-text-faint);
  white-space: nowrap;
}

.entry-subtitle {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0.15rem 0 0.5rem;
}

.entry-desc {
  margin: 0.4rem 0 0.6rem;
}

.tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.6rem;
}

.tags li {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  background: var(--color-tag-bg);
  border-radius: 3px;
  color: var(--color-text-muted);
}

.tags li.placeholder {
  border-bottom: none;
  color: var(--color-placeholder);
}

.entry-links {
  font-family: var(--font-sans);
  font-size: 0.875rem;
}

.entry-links span {
  color: var(--color-text-faint);
  margin: 0 0.35rem;
}

/* Research interests: term + one-line description. */
.interests {
  margin: 0;
}

.interest + .interest {
  margin-top: 1rem;
}

.interest dt {
  font-weight: 600;
}

.interest dd {
  margin: 0.15rem 0 0;
  color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  margin-top: var(--space-section);
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-rule);
  font-family: var(--font-sans);
  font-size: 0.855rem;
  color: var(--color-text-muted);
  text-align: center; /* Centers inline content like text, spans, and links */
  width: 100%;
}

.site-footer a {
  color: inherit;
}

.footer-meta {
  color: var(--color-text-faint);
}

/* --------------------------------------------------------------------------
   Responsive adjustments
   -------------------------------------------------------------------------- */

/* Tablet and below: tighten section rhythm slightly. */
@media (max-width: 48em) {
  .intro {
    gap: 1.25rem;
  }

  .intro-photo {
    width: 6rem;
    height: 6rem;
  }
}

/* Phones: single column entries, stacked intro, larger tap targets. */
@media (max-width: 36em) {
  .intro {
    flex-direction: column;
  }

  .nav-sections {
    gap: 0.25rem 1rem;
  }

  .nav-sections a {
    padding: 0.35rem 0;
  }

  /* Stack the bar: section links on one row, icons on the next. */
  .site-nav {
    flex-wrap: wrap;
    row-gap: 0.25rem;
  }

  .nav-sections {
    flex-basis: 100%;
  }

  .nav-icons {
    margin-left: -0.6rem;
  }

  .nav-icons a {
    width: 2.5rem;
    height: 2.5rem;
  }

  h2 {
    font-size: 1.25rem;
  }
}

/* Print: drop chrome, keep the text. */
@media print {
  .site-nav,
  .skip-link {
    display: none;
  }

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