:root {
  --bg: #ececec;
  --surface: #f4f4f4;
  --text: #162127;
  --muted: #5d6b70;
  --line: #d9dfdf;
  --accent: #0f4c5c;
  --accent-2: #dce9ea;
  --accent-3: #eef4f4;
  --max: 1360px;
  --gutter: 32px;
  --shadow: 0 0 0 1px rgba(15, 76, 92, 0.03);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

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

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

button {
  font: inherit;
}

.page {
  max-width: var(--max);
  margin: 0 auto;
  background: var(--surface);
  min-height: 100vh;
  box-shadow: var(--shadow);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: end;
  padding: 22px var(--gutter);
  border-bottom: 1px solid var(--line);
}

.identity h1 {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: clamp(1.4rem, 1.8vw, 1.8rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--muted);
  line-height: 1;
}

.identity p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

.nav-toggle {
  display: none;
  border: 0;
  background: transparent;
  width: 42px;
  height: 42px;
  padding: 0;
  cursor: pointer;
  align-self: center;
}

.nav-toggle span,
.nav-toggle::before,
.nav-toggle::after {
  content: "";
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text);
  margin: 5px auto;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"]::before {
  transform: translateY(6.5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"]::after {
  transform: translateY(-6.5px) rotate(-45deg);
}

.nav-toggle[aria-expanded="true"] span {
  opacity: 0;
}

.nav {
  display: flex;
  align-items: center;
  gap: 30px;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: none;
  white-space: nowrap;
}

.nav a {
  position: relative;
  color: var(--text);
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.2s ease;
}

.nav a:hover::after,
.nav a:focus-visible::after,
.nav a.active::after {
  width: 100%;
}

.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 270px 1fr;
  align-items: center;
  gap: 36px;
  padding: 28px var(--gutter) 60px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(140deg, transparent 0 68%, rgba(15, 76, 92, 0.06) 68% 76%, rgba(15, 76, 92, 0.03) 76% 84%, transparent 84%),
    linear-gradient(90deg, rgba(15, 76, 92, 0.02), rgba(15, 76, 92, 0));
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: 0.18;
  transform: skewX(-25deg) translateX(35%);
  pointer-events: none;
}

.hero-media,
.hero-copy {
  position: relative;
  z-index: 1;
}

.portrait-frame {
  aspect-ratio: 3 / 4;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, #e8ecec, #d7dddd);
  overflow: hidden;
}

.portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.eyebrow {
  margin: 8px 0 18px;
  font-size: 0.95rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.hero-copy h2 {
  margin: 0;
  max-width: 100%;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: clamp(2.2rem, 4vw, 3.5rem);
  line-height: 0.98;
  font-weight: 500;
  letter-spacing: -0.045em;
}

.hero-copy p {
  /*max-width: 640px;*/
  margin: 20px 0 26px;
  font-size: 1.1rem;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: white;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.meta-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 0.95rem;
}

.meta-links a:hover {
  color: var(--accent);
}

.main-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 0;
}

.section {
  padding: 20px var(--gutter) 40px;
  border-bottom: 1px solid var(--line);
}

.section+.section {
  border-left: 1px solid var(--line);
}

.section.full {
  grid-column: 1 / -1;
  border-left: 0;
}

.section h3 {
  margin: 0 0 24px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: clamp(1.4rem, 1.8vw, 1.8rem);
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--muted);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border: 1px solid var(--line);
  width: fit-content;
  margin-bottom: 22px;
  background: white;
}

.filter-btn {
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  min-width: 72px;
  padding: 10px 14px;
  color: var(--muted);
  cursor: pointer;
}

.filter-btn:last-child {
  border-right: 0;
}

.filter-btn.is-active {
  background: var(--accent);
  color: white;
}

.publication-list,
.engagement-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.publication-item,
.engagement-item {
  display: grid;
  grid-template-columns: 84px 1fr 24px;
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}

.publication-year {
  color: var(--muted);
  font-size: 0.95rem;
  padding-top: 2px;
}

.engagement-date {
  color: var(--muted);
  font-size: 0.95rem;
  padding-top: 0;
}

.publication-title,
.engagement-title {
  font-weight: 600;
  margin-bottom: 6px;
}

.publication-summary,
.engagement-meta {
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 60ch;
}

.publication-mark {
  text-align: right;
  color: var(--accent);
  font-size: 1rem;
  padding-top: 2px;
}

.focus-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.focus-item {
  display: grid;
  grid-template-columns: 1fr 24px;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}

.focus-item h4 {
  margin: 0 0 6px;
  font-size: 1.15rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.focus-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.focus-icon {
  width: 24px;
  height: 24px;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transform: translateY(8px) skew(-18deg);
  opacity: 0.7;
}

.engagement-item {
  grid-template-columns: 1fr auto;
}

.engagement-location {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  margin-bottom: 6px;
}

.mobile-only {
  display: none;
}

@media (max-width: 1100px) {
  .hero {
    grid-template-columns: 220px 1fr;
    gap: 28px;
  }

  .main-grid {
    grid-template-columns: 1fr;
  }

  .section+.section {
    border-left: 0;
  }
}

@media (max-width: 860px) {
  :root {
    --gutter: 20px;
  }

  .topbar {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .nav-toggle {
    display: block;
  }

  .nav {
    position: absolute;
    top: 82px;
    left: 0;
    right: 0;
    z-index: 20;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 10px var(--gutter) 18px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
  }

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

  .nav a {
    padding: 12px 0;
    width: 100%;
  }

  .hero {
    grid-template-columns: 1fr;
    padding-top: 20px;
  }

  .hero-media {
    max-width: 210px;
  }

  .hero-copy h2 {
    font-size: clamp(2rem, 8vw, 3rem);
    max-width: 100%;
  }

  /* On mobile, Research Focus comes before Recent Publications */
  .main-grid {
    display: flex;
    flex-direction: column;
  }

  .research-focus-section {
    order: 1;
  }

  .publications-section {
    order: 2;
  }

  .speaking-section {
    order: 3;
  }
}

@media (max-width: 560px) {
  .identity h1 {
    font-size: 2.2rem;
  }

  .identity p {
    font-size: 0.88rem;
  }

  .hero-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .btn {
    width: 100%;
  }

  .meta-links {
    gap: 10px;
    font-size: 0.9rem;
  }

  .publication-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .publication-mark {
    display: none;
  }

  .engagement-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .engagement-sidebar {
    text-align: left !important;
  }

  .focus-item h4 {
    font-size: 1.6rem;
  }
}

/* New Pub Card Styles */
.pub-card {
  padding: 16px 0;
  border-bottom: 1px solid rgba(15, 76, 92, 0.08);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pub-tags {
  display: none;
}

.ptag {
  display: inline-block;
  font-size: 0.70rem;
  padding: 2px 6px;
  border-radius: 0;
  background: rgba(15, 76, 92, 0.08);
  color: var(--text);
  margin-right: 4px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.pub-title {
  font-weight: 500;
  font-size: 1.20rem;
  line-height: 1.3;
}

.pub-authors {
  font-size: 1rem;
  color: var(--text);
}

.pub-venue {
  font-size: 0.95rem;
  color: #889397;
  font-style: italic;
}

.pub-meta {
  font-size: 0.85rem;
  font-weight: 400;
  opacity: 0.85;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}

/* Print Styles */
@media print {
  @page {
    margin: 1.5cm;
  }

  body,
  .page {
    background: white !important;
    color: black !important;
    box-shadow: none !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
  }

  .topbar,
  footer,
  .hero,
  .hero-actions {
    display: none !important;
  }

  .section {
    border: none !important;
    padding: 0 !important;
  }

  .page-header {
    margin-bottom: 25px !important;
    padding-bottom: 10px !important;
    border-bottom: 2px solid #000 !important;
  }

  .cv-module {
    page-break-inside: avoid;
    break-inside: avoid;
    margin-bottom: 20px !important;
  }

  .cv-module h2 {
    color: black !important;
    page-break-after: avoid;
    break-after: avoid;
  }

  .cv-module h3,
  .cv-module h4 {
    page-break-after: avoid;
    break-after: avoid;
  }

  .print-only {
    display: block !important;
  }

  a {
    color: black !important;
    text-decoration: none !important;
    border-bottom: none !important;
  }

  .cv-module-body ul,
  .cv-module-body ol {
    padding-left: 20px !important;
  }

  .cv-module-body li {
    margin-bottom: 4px !important;
  }

  .cv-module-body {
    line-height: 1.4 !important;
  }
}

.pub-links a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: 0.2s;
}

.pub-links a:hover {
  text-decoration-color: var(--accent);
}

.badge {
  display: inline-flex;
  align-items: center;
  background: #fff;
  border: 1px solid rgba(15, 76, 92, 0.15);
  padding: 2px 6px;
  border-radius: 0;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
}

.research-group {
  margin-bottom: 10px;
  margin-top: 10px;
}

.research-group h2 {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  font-weight: 600;
  font-size: 1.8rem;
  color: var(--muted);
  letter-spacing: 0;
  border-bottom: 1px solid rgba(15, 76, 92, 0.15);
  padding-bottom: 8px;
  margin-bottom: 4px;
}

.page-title {
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: clamp(3rem, 6vw, 3.5rem);
  font-weight: 400;
  margin: 20px 0 20px;
  letter-spacing: -0.05em;
  line-height: 1.1;
  color: #0b1114;
}

.page-subtitle {
  font-size: 1.25rem;
  color: var(--muted);
  max-width: 650px;
  margin: 0 0 10px;
  line-height: 1.6;
}

.content-container a:not(.btn) {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(15, 76, 92, 0.2);
  transition: all 0.2s ease;
  font-weight: 500;
}

.content-container a:not(.btn):hover {
  border-bottom-color: var(--accent);
  background-color: rgba(15, 76, 92, 0.08);
}

.content-container h2 {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: clamp(1.7rem, 2vw, 2.2rem);
  font-weight: 600;
  color: var(--text);
  margin: 40px 0 20px;
  letter-spacing: -0.01em;
  border-bottom: 1px solid rgba(15, 76, 92, 0.15);
  padding-bottom: 8px;
}

.content-container h2:first-child {
  margin-top: 0;
}

.content-container h3 {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: clamp(1.2rem, 1.4vw, 1.4rem);
  font-weight: 600;
  color: var(--muted);
  margin: 32px 0 16px;
}

/* Abstract Styles */
.pub-abstract {
  margin-top: 12px;
  margin-bottom: 12px;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.6;
  border-left: 2px solid var(--accent);
  padding-left: 14px;
}

.toggle-abstract-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 500;
  border-bottom: 1px dashed var(--accent);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.toggle-abstract-btn:hover {
  border-bottom-style: solid;
  opacity: 0.8;
}