/* ==========================================================================
   Dr. Haider Waseem Anwar - Academic Website Stylesheet
   Human, literary academic typography inspired by Places Journal, MIT Press,
   and Works in Progress: optical-sized Newsreader & humanist Source Sans 3,
   clean hairline divisions, zero AI eyebrow badges or monospace UI clutter.
   ========================================================================== */

@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/newsreader-latin-opsz-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/newsreader-latin-opsz-italic.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Source Sans 3";
  src: url("/assets/fonts/source-sans-3-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Source Sans 3";
  src: url("/assets/fonts/source-sans-3-latin-wght-italic.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-primary: #FAF7F2;
  --bg-elevated: #F2ECE1;
  --bg-sheet: rgba(250, 247, 242, 0.92);
  --bg-card: #FDFBF8;
  --ink-primary: #141416;
  --ink-secondary: #2C2926;
  --ink-muted: #524D47;
  --accent-teal: #0D6B63;
  --accent-teal-hover: #09504A;
  --accent-ochre: #B45309;
  --rule: rgba(20, 20, 22, 0.14);
  --rule-light: rgba(20, 20, 22, 0.08);
  --rule-strong: rgba(20, 20, 22, 0.30);
  --font-display: "Newsreader", "Iowan Old Style", "Charter", Georgia, serif;
  --font-body: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --measure: 65ch;
  --container-max: 1120px;
}

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

[hidden] {
  display: none !important;
}

html {
  background: var(--bg-primary);
  color: var(--ink-primary);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg-primary);
  color: var(--ink-primary);
  font-family: var(--font-body);
  font-size: 1.09375rem;
  line-height: 1.68;
  font-weight: 400;
  font-optical-sizing: auto;
  font-kerning: normal;
  font-feature-settings: "kern" 1, "liga" 1;
  text-rendering: optimizeLegibility;
  position: relative;
}

body.dialog-open {
  overflow: hidden;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  padding: 0.55rem 1.1rem;
  background: var(--ink-primary);
  color: #fff;
  z-index: 9999;
  border-radius: 2px;
  text-decoration: none;
  font-size: 0.9375rem;
  transition: top 0.2s ease;
}

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

/* ==========================================================================
   Ambient 3D Landscape Canvas (WebGL2)
   ========================================================================== */
.world {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  opacity: 0.78;
  transition: opacity 0.8s ease;
}

/* Seamless full-viewport atmospheric mist from left (open-air prose column) to right (clear 3D landscape) */
.world::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(250, 247, 242, 0.91) 0%,
    rgba(250, 247, 242, 0.84) 36%,
    rgba(250, 247, 242, 0.42) 58%,
    rgba(250, 247, 242, 0.06) 80%,
    rgba(250, 247, 242, 0.00) 100%
  );
  pointer-events: none;
}

@media (max-width: 880px) {
  .world::after {
    background: rgba(250, 247, 242, 0.82);
  }
}

.world-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.js .world-poster {
  display: none;
}

#world {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* ==========================================================================
   Scholarly Typography & Global Utilities
   ========================================================================== */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 470;
  line-height: 1.16;
  letter-spacing: -0.018em;
  color: var(--ink-primary);
  margin: 0 0 0.65rem;
  text-wrap: balance;
}

p {
  margin: 0 0 1.1rem;
  text-wrap: pretty;
}

a {
  color: var(--accent-teal);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

a:hover {
  color: var(--accent-teal-hover);
  text-decoration-thickness: 2px;
}

/* Humanist tabular numerals for dates & metadata instead of coder monospace */
.mono {
  font-family: var(--font-body);
  font-size: 0.92em;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.005em;
}

.small {
  font-size: 0.9375rem;
}

.muted {
  color: var(--ink-secondary);
}

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

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(1.25rem, 4vw, 2.5rem);
  padding-right: clamp(1.25rem, 4vw, 2.5rem);
  position: relative;
  z-index: 1;
}

section[id] {
  scroll-margin-top: 76px;
}

/* ==========================================================================
   Masthead Navigation
   ========================================================================== */
.masthead {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 247, 242, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}

.masthead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
}

.wordmark {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: 1.18rem;
  font-weight: 520;
  color: var(--ink-primary);
  text-decoration: none;
  letter-spacing: -0.015em;
  white-space: nowrap;
}

.wordmark:hover {
  color: var(--accent-teal);
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.35rem;
}

.nav-links a {
  font-size: 0.9375rem;
  color: var(--ink-secondary);
  text-decoration: none;
  font-weight: 450;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.nav-links a:hover {
  color: var(--ink-primary);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.btn-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.78rem;
  background: transparent;
  border: 1px solid var(--rule-strong);
  color: var(--ink-primary) !important;
  font-family: var(--font-body);
  font-size: 0.85rem !important;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none !important;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-chip:hover {
  background: var(--bg-elevated);
  border-color: var(--ink-primary);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
}

.nav-toggle-box {
  display: inline-block;
  width: 24px;
  height: 18px;
  position: relative;
}

.nav-toggle-inner,
.nav-toggle-inner::before,
.nav-toggle-inner::after {
  width: 24px;
  height: 1.5px;
  background-color: var(--ink-primary);
  position: absolute;
  left: 0;
  transition: transform 0.2s ease;
}

.nav-toggle-inner {
  top: 8px;
}

.nav-toggle-inner::before {
  content: "";
  top: -7px;
}

.nav-toggle-inner::after {
  content: "";
  top: 7px;
}

@media (max-width: 1060px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 62px;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--rule);
    flex-direction: column;
    padding: 1.4rem 2rem;
    gap: 1.1rem;
    align-items: flex-start;
    box-shadow: 0 12px 24px rgba(24, 24, 27, 0.08);
  }

  .nav-links.nav-open {
    display: flex;
  }
}

/* ==========================================================================
   Hero Frontispiece
   ========================================================================== */
.hero {
  padding: clamp(3.25rem, 6.5vw, 5.25rem) 0 clamp(2.75rem, 5.5vw, 4.25rem);
  position: relative;
  z-index: 1;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(340px, 430px);
  gap: clamp(2.25rem, 4.5vw, 4rem);
  align-items: center;
}

.hero-intro {
  max-width: var(--measure);
}

.hero-affiliation {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.06rem;
  color: var(--ink-secondary);
  margin-bottom: 0.55rem;
}

.hero-title {
  font-size: clamp(2.45rem, 4.6vw, 3.35rem);
  font-weight: 490;
  line-height: 1.08;
  letter-spacing: -0.024em;
  margin-bottom: 1rem;
}

.hero-positioning {
  font-family: var(--font-display);
  font-size: clamp(1.24rem, 2.1vw, 1.48rem);
  font-weight: 450;
  line-height: 1.38;
  color: var(--ink-primary);
  margin-bottom: 1.15rem;
  text-wrap: balance;
}

.hero-bio {
  font-size: 1.0625rem;
  color: var(--ink-secondary);
  line-height: 1.66;
  margin-bottom: 1.5rem;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.35rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.58rem 1.2rem;
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none !important;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font-body);
}

.btn--primary {
  background: var(--ink-primary);
  color: #fff !important;
  border: 1px solid var(--ink-primary);
}

.btn--primary:hover {
  background: #303034;
}

.btn--outline {
  background: var(--bg-card);
  color: var(--ink-primary) !important;
  border: 1px solid var(--rule-strong);
}

.btn--outline:hover {
  background: var(--bg-elevated);
  border-color: var(--ink-primary);
}

.btn--teal {
  background: var(--accent-teal);
  color: #fff !important;
  border: 1px solid var(--accent-teal);
}

.btn--teal:hover {
  background: var(--accent-teal-hover);
}

.hero-direct {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.9375rem;
  color: var(--ink-secondary);
  border-top: 1px solid var(--rule);
  padding-top: 0.9rem;
}

.hero-direct a {
  color: var(--ink-secondary);
}

.hero-direct a:hover {
  color: var(--accent-teal);
}

/* Portrait styling - 1:1 square frame without face zoom */
.hero-portrait {
  margin: 0;
  max-width: 430px;
  justify-self: end;
  width: 100%;
}

.portrait-frame {
  padding: 0.65rem;
  background: var(--bg-elevated);
  border: 1px solid var(--rule);
  box-shadow: 0 18px 40px -16px rgba(24, 24, 27, 0.15);
}

.portrait-frame img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center center;
  display: block;
}

.portrait-caption {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.65rem;
  padding: 0.45rem 0.15rem 0.1rem;
  border-top: 1px solid var(--rule);
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--ink-secondary);
}

@media (max-width: 880px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero-portrait {
    order: -1;
    max-width: 320px;
    justify-self: start;
  }
}

/* ==========================================================================
   Section Layouts (Open-Air Headings + Clean Translucent Content Ledgers)
   ========================================================================== */
.section {
  padding: clamp(3.25rem, 6vw, 5rem) 0;
  position: relative;
  z-index: 1;
}

.section--divided {
  border-top: 1px solid var(--rule);
}

.section--vista {
  padding-top: clamp(5rem, 9vw, 7.5rem);
}

.section-header {
  max-width: var(--measure);
  margin-bottom: 2rem;
}

.section-title {
  font-size: clamp(1.9rem, 3.1vw, 2.35rem);
  font-weight: 490;
  letter-spacing: -0.02em;
  margin-bottom: 0.55rem;
}

.section-lead {
  font-size: 1.08rem;
  color: var(--ink-secondary);
  line-height: 1.62;
  margin-bottom: 0;
}

.research-ledger,
.project-ledger,
.pub-groups,
.substack-portal,
.teaching-grid,
.contact-info {
  background: rgba(250, 247, 242, 0.86);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.35rem clamp(1.35rem, 3vw, 2.1rem);
}

/* ==========================================================================
   Section 1: Research Areas (Editorial Ledger - Zero SaaS Card Clutter)
   ========================================================================== */
.research-ledger {
  display: flex;
  flex-direction: column;
}

.research-entry {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: clamp(1rem, 2.5vw, 1.75rem);
  padding: clamp(1.4rem, 2.5vw, 1.9rem) 0;
  border-bottom: 1px solid var(--rule-light);
}

.research-entry:last-child {
  border-bottom: none;
}

.research-num {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--ink-secondary);
  line-height: 1.3;
  padding-top: 0.1rem;
}

.research-entry-title {
  font-size: clamp(1.28rem, 2vw, 1.52rem);
  font-weight: 500;
  margin-bottom: 0.55rem;
}

.research-entry p:last-child {
  margin-bottom: 0;
}

@media (max-width: 640px) {
  .research-entry {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }
}

/* ==========================================================================
   Section 2: Professional Experience & Applied Projects
   ========================================================================== */
.project-ledger {
  display: flex;
  flex-direction: column;
}

.ledger-row {
  display: grid;
  grid-template-columns: 175px minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 2.25rem);
  padding: clamp(1.35rem, 2.4vw, 1.9rem) 0;
  border-bottom: 1px solid var(--rule-light);
}

.ledger-row:last-child {
  border-bottom: none;
}

.ledger-meta {
  font-size: 0.9rem;
  color: var(--ink-secondary);
  line-height: 1.45;
}

.ledger-dates {
  display: block;
  font-weight: 600;
  color: var(--ink-primary);
  margin-bottom: 0.2rem;
}

.ledger-loc {
  display: block;
  color: var(--ink-muted);
  font-size: 0.86rem;
}

.ledger-title {
  font-size: 1.28rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.ledger-role {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.02rem;
  color: var(--ink-secondary);
  margin-bottom: 0.65rem;
}

.ledger-content p:last-child,
.ledger-bullets:last-child {
  margin-bottom: 0;
}

@media (max-width: 720px) {
  .ledger-row {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }
}

/* ==========================================================================
   Section 3: Publications
   ========================================================================== */
.pub-groups {
  padding-top: 1.25rem;
  padding-bottom: 0.75rem;
}

.pub-group {
  margin-bottom: 2.25rem;
}

.pub-group:last-child {
  margin-bottom: 0.5rem;
}

.pub-group-title {
  font-size: 1.25rem;
  font-weight: 520;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 0.85rem;
}

.pub-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.pub-item {
  display: grid;
  grid-template-columns: 95px minmax(0, 1fr);
  gap: 1.25rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--rule-light);
}

.pub-item:last-child {
  border-bottom: none;
}

.pub-year {
  font-size: 0.9rem;
  color: var(--ink-muted);
  padding-top: 0.15rem;
}

.pub-title {
  font-size: 1.12rem;
  font-weight: 500;
  margin-bottom: 0.3rem;
  line-height: 1.35;
}

.pub-meta {
  font-size: 0.95rem;
  color: var(--ink-secondary);
  margin-bottom: 0.45rem;
}

.pub-status {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--ink-primary);
}

.pub-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin-top: 0.45rem;
}

.pub-details {
  margin-top: 0.55rem;
}

.pub-details summary {
  font-size: 0.88rem;
  color: var(--accent-teal);
  cursor: pointer;
  user-select: none;
}

.pub-detail-box {
  margin-top: 0.55rem;
  padding: 0.85rem 1.1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--rule);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.pub-detail-box h4 {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  margin: 0.4rem 0 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}

.pub-bibtex-pre {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  overflow-x: auto;
  padding: 0.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--rule);
}

.peer-review-callout {
  padding: 1.15rem 1.35rem;
  background: var(--bg-elevated);
  border: 1px solid var(--rule);
  margin-top: 1.25rem;
  border-radius: 2px;
}

.callout-title {
  font-size: 1.08rem;
  font-weight: 500;
  margin-bottom: 0.3rem;
}

.peer-review-callout p:last-child {
  margin-bottom: 0;
}

@media (max-width: 640px) {
  .pub-item {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
}

/* ==========================================================================
   Section 4: Blog
   ========================================================================== */
.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr));
  gap: 1.5rem;
}

.note-card {
  display: flex;
  flex-direction: column;
  padding: 1.6rem;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 2px;
}

.note-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin-bottom: 0.6rem;
}

.note-cat {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.94rem;
  color: var(--ink-secondary);
}

.note-title {
  font-size: 1.3rem;
  font-weight: 500;
  line-height: 1.28;
  margin-bottom: 0.65rem;
}

.note-title a {
  color: var(--ink-primary);
  text-decoration: none;
}

.note-title a:hover {
  color: var(--accent-teal);
}

.note-summary {
  font-size: 0.975rem;
  color: var(--ink-secondary);
  line-height: 1.6;
  margin-bottom: 1.15rem;
  flex-grow: 1;
}

.note-card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--rule-light);
  padding-top: 0.75rem;
}

.read-note-link {
  font-size: 0.88rem;
  font-weight: 500;
}

.draft-badge {
  font-size: 0.78rem;
  font-style: italic;
  color: var(--ink-muted);
}

.draft-badge-callout {
  padding: 0.65rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--rule);
  color: var(--ink-secondary);
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
}

/* ==========================================================================
   Section 5: Teaching & Professional Service
   ========================================================================== */
.teaching-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 2.25rem;
  padding-top: 1.5rem;
  padding-bottom: 1.25rem;
}

/* Substack Blog & Discussion Portal */
.substack-portal {
  padding: clamp(1.6rem, 3vw, 2.25rem);
}

.substack-portal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 3.5vw, 2.75rem);
  align-items: start;
}

.substack-portal-title {
  font-size: 1.38rem;
  font-weight: 500;
  margin-bottom: 0.55rem;
}

.substack-subscribe-box {
  background: var(--bg-elevated);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 1.25rem 1.4rem;
}

.substack-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.substack-form input[type="email"] {
  flex: 1 1 200px;
  min-width: 0;
  padding: 0.58rem 0.8rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: #fff;
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  color: var(--ink-primary);
}

.substack-feed-list {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}

.substack-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  margin: 1rem 0 0;
  font-weight: 500;
}

.substack-posts {
  list-style: none;
  margin: 0;
  padding: 0;
}

.substack-posts .writing-entry:first-child {
  padding-top: 0;
}

.substack-posts .writing-entry:last-child {
  border-bottom: 0;
  padding-bottom: 0.5rem;
}

.writing-summary {
  color: var(--ink-secondary);
  line-height: 1.6;
  margin: 0 0 0.6rem;
  max-width: var(--measure);
}

.writing-links {
  display: flex;
  gap: 1.25rem;
  margin: 0;
}

.substack-feed-empty {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--ink-muted);
  margin: 0;
}

.discussion-box {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

@media (max-width: 820px) {
  .substack-portal-grid {
    grid-template-columns: 1fr;
  }
}

.teaching-subtitle {
  font-size: 1.25rem;
  font-weight: 520;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.45rem;
  margin-bottom: 1.1rem;
}

.teaching-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.teaching-list li {
  margin-bottom: 1.2rem;
}

.teaching-list li:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   Section 6: Contact & Form
   ========================================================================== */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: clamp(1.75rem, 4vw, 3.25rem);
}

.contact-info {
  padding: clamp(1.5rem, 3vw, 2rem);
}

.contact-name {
  font-size: 1.55rem;
  font-weight: 500;
  margin-bottom: 0.3rem;
}

.contact-role {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--ink-secondary);
  margin-bottom: 0.25rem;
}

.contact-dept {
  font-size: 0.94rem;
  color: var(--ink-muted);
  margin-bottom: 1.35rem;
}

.contact-meta {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  font-size: 0.94rem;
  margin: 0 0 1.6rem;
}

.contact-meta > div {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 0.5rem;
  align-items: baseline;
}

.contact-meta dt {
  color: var(--ink-muted);
  font-weight: 500;
}

.contact-meta dd {
  margin: 0;
  color: var(--ink-primary);
  overflow-wrap: anywhere;
}

.contact-form-wrap {
  background: var(--bg-card);
  padding: clamp(1.5rem, 3vw, 2rem);
  border: 1px solid var(--rule);
  border-radius: 2px;
}

.form-title {
  font-size: 1.3rem;
  font-weight: 500;
  margin-bottom: 1.1rem;
}

.contact-form .hp-field {
  display: none !important;
}

.topic-fieldset {
  border: 1px solid var(--rule);
  padding: 0.8rem 1rem;
  margin-bottom: 1.15rem;
  border-radius: 2px;
}

.topic-fieldset legend {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-secondary);
  padding: 0 0.4rem;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.5rem;
}

.topic-option {
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.field {
  margin-bottom: 0.95rem;
}

.field label {
  display: block;
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 0.3rem;
}

.field input,
.field textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: #fff;
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  color: var(--ink-primary);
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent-teal);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.18);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.15rem;
  margin-top: 1.1rem;
}

.mailto-link {
  font-size: 0.88rem;
  color: var(--ink-secondary);
}

.form-status {
  margin-top: 0.9rem;
  font-size: 0.9375rem;
}

@media (max-width: 800px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .field-row {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Slide-Over Modals & Drawers
   ========================================================================== */
.slide-drawer {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  margin: 0;
  padding: 0;
  background: rgba(24, 24, 27, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: none;
  z-index: 1000;
  display: flex;
  justify-content: flex-end;
}

.slide-drawer[hidden] {
  display: none !important;
}

.drawer-panel {
  width: 100%;
  max-width: 680px;
  height: 100%;
  background: var(--bg-primary);
  box-shadow: -10px 0 35px rgba(24, 24, 27, 0.16);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: clamp(1.5rem, 3vw, 2.5rem);
}

.drawer-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 1.4rem;
}

.drawer-close {
  background: none;
  border: none;
  font-size: 1.7rem;
  cursor: pointer;
  color: var(--ink-secondary);
  line-height: 1;
  padding: 0.25rem;
}

.drawer-close:hover {
  color: var(--ink-primary);
}

.reader-heading {
  font-size: clamp(1.7rem, 3vw, 2.25rem);
}

.article-body {
  font-size: 1.0625rem;
  line-height: 1.7;
}

.article-body h2 {
  font-size: 1.42rem;
  margin-top: 1.75rem;
}

.article-body h3 {
  font-size: 1.22rem;
  margin-top: 1.4rem;
}

/* ==========================================================================
   CV Page & Subpages
   ========================================================================== */
.cv-container,
.writing-container,
.article-container {
  padding-top: clamp(2.5rem, 5vw, 4.25rem);
  padding-bottom: clamp(3rem, 6vw, 4.75rem);
  max-width: 820px;
}

.cv-header,
.writing-header {
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1.75rem;
}

.cv-title,
.writing-title {
  font-size: clamp(2.15rem, 3.8vw, 2.85rem);
  margin-bottom: 0.45rem;
}

.cv-subtitle,
.writing-subtitle {
  font-size: 1.08rem;
  color: var(--ink-secondary);
  margin-bottom: 1.2rem;
  overflow-wrap: anywhere;
}

.cv-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.cv-section {
  margin-bottom: 2.4rem;
}

.cv-section h2 {
  font-size: 1.42rem;
  font-weight: 520;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.35rem;
  margin-bottom: 1.1rem;
}

.cv-section h3 {
  font-size: 1.15rem;
  font-weight: 500;
  margin: 1.3rem 0 0.55rem;
  color: var(--ink-secondary);
}

.cv-dl {
  display: grid;
  grid-template-columns: 135px minmax(0, 1fr);
  gap: 1.1rem 1rem;
}

.cv-dl dt {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink-secondary);
}

.cv-dl dd {
  margin: 0;
  font-size: 1.02rem;
  overflow-wrap: anywhere;
}

.cv-bullets,
.ledger-bullets {
  margin: 0.45rem 0 0.65rem;
  padding-left: 1.2rem;
}

.cv-bullets li,
.ledger-bullets li {
  margin-bottom: 0.42rem;
  line-height: 1.58;
}

@media (max-width: 680px) {
  .cv-dl {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .cv-dl dd {
    margin-bottom: 1rem;
  }
}

.writing-entry {
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--rule-light);
}

.writing-meta {
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin-bottom: 0.35rem;
}

.writing-entry-title {
  font-size: 1.45rem;
  margin-bottom: 0.45rem;
}

.writing-entry-title a {
  color: var(--ink-primary);
  text-decoration: none;
}

.writing-entry-title a:hover {
  color: var(--accent-teal);
}

/* ==========================================================================
   Colophon / Footer
   ========================================================================== */
.colophon {
  border-top: 1px solid var(--rule);
  padding: 2.25rem 0;
  background: var(--bg-elevated);
  position: relative;
  z-index: 1;
}

.colophon-inner {
  text-align: center;
}

@media print {
  .world,
  .masthead,
  .btn-row,
  .hero-direct,
  .pub-actions,
  .contact-form-wrap,
  .slide-drawer,
  .drawer-backdrop {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 10pt;
    line-height: 1.4;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }
}
