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

    :root {
      --ink: #1A1A1A;
      --paper: #f6f4f0;
      --tan: #e8e3db;
      --accent: #861e0e;
      --light-rule: #E9E8E5;
      --col-gap: 2.5rem;
    }

    html { font-size: 17px; }
    body {
      background: var(--paper);
      color: var(--ink);
      font-family: 'Source Serif 4', Georgia, serif;
      font-weight: 300;
      line-height: 1.7;
    }

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

    /* ─── MASTHEAD ─── */
    .masthead {
      border-top: 4px solid var(--ink);
      border-bottom: 1px solid var(--ink);
      padding: 1.5rem 2rem 1rem;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 0.5rem;
      background: var(--paper);
      position: sticky;
      top: 0;
      z-index: 100;
    }
    .masthead-kicker {
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.62rem;
      letter-spacing: 0.2em;
      text-transform: uppercase;
      color: var(--accent);
    }
    .masthead-title {
      font-family: 'Playfair Display', serif;
      font-size: clamp(2.2rem, 5vw, 3.8rem);
      font-weight: 900;
      letter-spacing: -0.02em;
      line-height: 1;
      text-align: center;
    }
    .masthead-sub {
      font-family: 'Source Serif 4', serif;
      font-size: 0.8rem;
      font-style: italic;
      color: #555;
      text-align: center;
    }
    .masthead-rule {
      width: 100%;
      height: 1px;
      background: var(--tan);
      margin: 0.4rem 0;
    }
    .masthead-nav {
      display: flex;
      gap: 1.8rem;
      flex-wrap: wrap;
      justify-content: center;
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.65rem;
      letter-spacing: 0.15em;
      text-transform: uppercase;
    }
    .masthead-nav a { color: var(--ink); }
    .masthead-nav a:hover { color: var(--accent); text-decoration: none; }
    .masthead-nav a.active { border-bottom: 2px solid var(--accent); padding-bottom: 1px; }

    /* ─── LAYOUT ─── */
    .page-wrap {
      max-width: 1080px;
      margin: 0 auto;
      padding: 0 1.5rem;
    }

    /* ─── SECTION DIVIDER ─── */
    .section-divider {
      display: flex;
      align-items: center;
      gap: 1rem;
      margin: 3rem 0 1.5rem;
    }
    .section-divider::before,
    .section-divider::after {
      content: '';
      flex: 1;
      height: 2px;
      background: var(--ink);
    }
    .section-divider::after { height: 2px; background: var(--ink); }
    .section-label {
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.6rem;
      letter-spacing: 0.2em;
      text-transform: uppercase;
      white-space: nowrap;
      color: var(--accent);
    }

    /* ─── profile ─── */
    .profile {
      padding: 3.5rem 0 2rem;
      border-bottom: 1px solid var(--light-rule);
    }
    .profile-columns {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: var(--col-gap);
      align-items: start;
    }
    .profile-hed {
      font-family: 'Playfair Display', serif;
      font-size: clamp(1.6rem, 3vw, 2.2rem);
      font-weight: 700;
      line-height: 1.2;
      margin-bottom: 1.2rem;
    }
    .profile-hed em {
      font-style: italic;
      font-weight: 400;
      color: #555;
      display: block;
      font-size: 0.8em;
      margin-bottom: 0.2rem;
    }
    .profile-body p {
      font-size: 0.95rem;
      line-height: 1.8;
      margin-bottom: 1rem;
    }
    .profile-body p:first-of-type::first-letter {
      float: left;
      font-family: 'Playfair Display', serif;
      font-size: 4.2rem;
      font-weight: 900;
      line-height: 0.78;
      margin-right: 0.12em;
      margin-top: 0.05em;
      color: var(--accent);
    }
    .profile-aside {
      border-left: 1px solid var(--light-rule);
      padding-left: var(--col-gap);
    }
    .profile-aside img {
      width: 100%;
      display: block;
      filter: grayscale(20%) contrast(1.05);
    }

    /* ─── NEWS GRID ─── */
    .news-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 0;
    }
    .news-item {
      padding: 1.4rem 1.2rem 1.4rem 0;
      border-right: 1px solid var(--light-rule);
    }
    .news-item:last-child { border-right: none; }
    .news-item + .news-item { padding-left: 1.2rem; }
    .news-date {
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.6rem;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      color: var(--accent);
      margin-bottom: 0.3rem;
    }
    .news-hed {
      font-family: 'Playfair Display', serif;
      font-size: 1rem;
      font-weight: 700;
      line-height: 1.3;
      margin-bottom: 0.5rem;
    }
    .news-body {
      font-size: 0.82rem;
      line-height: 1.65;
      color: #3a3a3a;
    }
    .news-body a {
      color: var(--accent);
      text-decoration: underline;
    }
    .news-img {
      width: 100%;
      margin-bottom: 0.7rem;
      display: block;
      filter: grayscale(30%);
    }

    /* ─── FEATURED (wide) ─── */
    .feature-strip {
      border-top: 1px solid var(--light-rule);
      border-bottom: 1px solid var(--light-rule);
      padding: 1.8rem 0;
      margin-bottom: 2rem;
    }
    .feature-two {
      display: grid;
      grid-template-columns: 2fr 1fr;
      gap: var(--col-gap);
      align-items: start;
    }
    .feature-hed {
      font-family: 'Playfair Display', serif;
      font-size: clamp(1.2rem, 2.5vw, 1.7rem);
      font-weight: 700;
      line-height: 1.25;
      margin-bottom: 0.6rem;
    }
    .feature-dek {
      font-size: 0.85rem;
      line-height: 1.7;
      color: #3a3a3a;
    }
    .feature-tag {
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.58rem;
      letter-spacing: 0.15em;
      text-transform: uppercase;
      background: var(--ink);
      color: var(--paper);
      padding: 0.15em 0.5em;
      display: inline-block;
      margin-bottom: 0.5rem;
    }
    .feature-img {
      width: 100%;
      display: block;
      filter: grayscale(30%);
    }

    /* ─── WORKS LIST ─── */
    .works-columns {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0 var(--col-gap);
    }
    .work-entry {
      display: flex;
      gap: 0.8rem;
      padding: 0.6rem 0;
      border-bottom: 1px solid var(--light-rule);
      font-size: 0.83rem;
      align-items: baseline;
    }
    .work-year {
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.65rem;
      color: var(--accent);
      white-space: nowrap;
      min-width: 3rem;
    }
    .work-title { line-height: 1.45; }
    .work-type {
      font-style: italic;
      color: #666;
      font-size: 0.78rem;
    }

    /* ─── SOFTWARE GRID ─── */
    .software-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 1.5rem;
      margin-top: 1rem;
    }
    .software-card {
      border: 1px solid var(--light-rule);
      padding: 1rem;
    }
    .software-card h3 {
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.75rem;
      font-weight: 500;
      margin-bottom: 0.4rem;
      color: var(--accent);
    }
    .software-card p {
      font-size: 0.78rem;
      line-height: 1.6;
      color: #444;
    }
    .software-card a {
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.65rem;
      color: var(--ink);
      text-decoration: underline;
    }

    /* ─── TEACHING ─── */
    .teaching-cols {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      gap: 0;
    }
    .teaching-col {
      padding-right: 1.5rem;
      border-right: 1px solid var(--light-rule);
      margin-bottom: 1rem;
    }
    .teaching-col:last-child { border-right: none; padding-right: 0; }
    .teaching-col + .teaching-col { padding-left: 1.5rem; }
    .teaching-col h3 {
      font-family: 'Playfair Display', serif;
      font-size: 0.9rem;
      font-weight: 700;
      margin-bottom: 0.7rem;
      border-bottom: 1px solid var(--ink);
      padding-bottom: 0.3rem;
    }
    .teaching-col ul { list-style: none; }
    .teaching-col li {
      font-size: 0.78rem;
      line-height: 1.55;
      padding: 0.25rem 0;
      border-bottom: 1px dotted var(--light-rule);
      color: #333;
    }
    .course-code {
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.65rem;
      color: var(--accent);
      display: block;
    }

    /* ─── PULLQUOTE ─── */
    .pullquote {
      border-top: 3px double var(--ink);
      border-bottom: 1px solid var(--ink);
      padding: 1.2rem 0;
      margin: 2rem 0;
      font-family: 'Playfair Display', serif;
      font-size: clamp(1rem, 2vw, 1.35rem);
      font-style: italic;
      line-height: 1.5;
      text-align: center;
      color: #2a2a2a;
    }

    /* ─── CONTACT STRIP ─── */
    .contact-strip {
      background: var(--ink);
      color: var(--paper);
      padding: 2.5rem 2rem;
      text-align: center;
      margin-top: 3rem;
    }
    .contact-strip h2 {
      font-family: 'Playfair Display', serif;
      font-size: 1.5rem;
      font-weight: 700;
      margin-bottom: 0.5rem;
    }
    .contact-strip p {
      font-size: 0.85rem;
      line-height: 1.7;
      color: #bbb;
    }
    .contact-strip a { color: var(--tan); text-decoration: underline; }

    /* ─── FOOTER ─── */
    footer {
      border-top: 1px solid var(--light-rule);
      padding: 1.5rem 2rem;
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.6rem;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: #999;
    }

    /* ─── RESPONSIVE ─── */
    @media (max-width: 800px) {
      .profile-columns,
      .feature-two,
      .works-columns,
      .teaching-cols { grid-template-columns: 1fr; }
      .profile-aside { border-left: none; padding-left: 0; border-top: 1px solid var(--light-rule); padding-top: 1.5rem; margin-top: 1.5rem; }
      .news-grid,
      .software-grid { grid-template-columns: 1fr 1fr; }
      .news-item { border-right: none; border-bottom: 1px solid var(--light-rule); padding: 1rem 0; }
      .news-item + .news-item { padding-left: 0; }
      .teaching-col { border-right: none; border-bottom: 1px solid var(--light-rule); padding: 0 0 1rem; }
      .teaching-col + .teaching-col { padding-left: 0; }
    }
    @media (max-width: 500px) {
      .news-grid, .software-grid { grid-template-columns: 1fr; }
      .masthead { padding: 1rem; }
    }

/* Moved from inline styles */
.software-card-img {
  width: 100%;
  filter: grayscale(40%);
}
.contact-form {
  max-width: 640px;
}

.pub-image {
  display: block;
  max-width: 100%;
  height: auto;
  margin-top: 0.75rem;
  border-radius: 4px;
}
