/* Academic site — card layout, primary nav, focus-visible */

:root {
  --text: #141413;
  --muted: #4b5563;
  --link: #3b82f6;
  --link-hover: #1d4ed8;
  --border: #e5e7eb;
  --surface: #ffffff;
  --bg: #ffffff;
  --nav-tab: #bdbcc4;
  --nav-tab-hover: #b0afb8;
  --nav-tab-active: #8f8e97;
  --accent: linear-gradient(90deg, #3b82f6 0%, #6366f1 50%, #8b5cf6 100%);
  --layout-max: min(92vw, 88rem);
  --sidebar-w: min(280px, 28vw);
  --content-max: min(56rem, 100%);
  --content-wide-max: min(76rem, 100%);
  --radius: 10px;
  --shadow: 0 1px 2px rgb(20 20 19 / 0.06), 0 4px 14px rgb(20 20 19 / 0.06);
  --shadow-hover: 0 2px 6px rgb(20 20 19 / 0.08), 0 8px 22px rgb(20 20 19 / 0.08);
  --border-soft: #e8eaed;
  --project-row-bg: #fafbfc;
  --shadow-project: 0 1px 2px rgb(20 20 19 / 0.04), 0 2px 8px rgb(20 20 19 / 0.04);
  --shadow-project-hover: 0 2px 4px rgb(20 20 19 / 0.06), 0 6px 16px rgb(20 20 19 / 0.06);
}

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

html {
  color: var(--text);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family:
    Inter,
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  background: var(--bg);
}

/* Subtle top accent */
body::before {
  content: "";
  display: block;
  height: 3px;
  background: var(--accent);
  width: 100%;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--link-hover);
}

a:focus-visible,
.site-nav a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 3px;
  border-radius: 4px;
}

/* —— Site header —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  max-width: var(--layout-max);
  margin: 0 auto;
  padding: 0.65rem 1.25rem 0.75rem;
  background: var(--bg);
  border-bottom: 1px solid #f0f0f0;
}

@media (min-width: 768px) {
  .site-header {
    padding: 0.75rem 1.75rem 0.85rem;
  }
}

.site-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.25rem 0.35rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.2rem;
  margin-bottom: 0;
  scrollbar-width: thin;
}

.site-nav a {
  flex: 0 0 auto;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: var(--nav-tab);
  border: 1px solid #b0afba;
  box-shadow: 0 1px 2px rgb(20 20 19 / 0.06);
}

.site-nav a:hover {
  color: var(--text);
  border-color: #a3a2aa;
  background: var(--nav-tab-hover);
}

.site-nav a[aria-current="page"] {
  color: #fff;
  background: var(--nav-tab-active);
  border-color: var(--nav-tab-active);
}

.site-nav a[aria-current="page"]:hover {
  color: #fff;
  background: #7e7d86;
  border-color: #7e7d86;
}

/* —— Layout shell —— */
.page {
  max-width: var(--layout-max);
  margin: 0 auto;
  padding: 0.5rem 1.25rem 3.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.page--simple {
  padding-top: 1rem;
}

@media (min-width: 768px) {
  .page {
    flex-direction: row;
    align-items: flex-start;
    gap: 2.5rem;
    padding: 0.75rem 1.75rem 4rem;
  }

  .sidebar {
    flex: 0 0 var(--sidebar-w);
    position: sticky;
    top: 4.75rem;
    max-height: calc(100vh - 5.25rem);
    overflow-y: auto;
  }
}

/* —— Identity / sidebar —— */
.identity.in-sidebar {
  margin-top: 0.25rem;
}

.profile-photo {
  display: block;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1rem;
}

.identity .name {
  margin: 0 0 0.75rem;
  font-size: clamp(1.6rem, 2.2vw, 2rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.about {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.65;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 500;
}

.identity .links a {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.identity .links a:hover {
  color: var(--link-hover);
  background: #e8eef5;
  border-color: #cbd5e1;
}

.identity .links a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
  border-radius: 999px;
}

/* —— Main content column —— */
.content {
  flex: 1;
  min-width: 0;
  max-width: var(--content-max);
}

.content--wide {
  max-width: var(--content-wide-max);
}

.page-title {
  margin: 0 0 1.25rem;
  font-size: clamp(1.5rem, 2vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.lead {
  margin: -0.5rem 0 1.75rem;
  color: var(--muted);
  font-size: 0.98rem;
  max-width: min(48rem, 100%);
  line-height: 1.65;
}

.lead code,
.post-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  font-size: 0.88em;
  color: var(--text);
  background: #f1f5f9;
  padding: 0.12em 0.4em;
  border-radius: 5px;
  border: 1px solid var(--border);
}

/* —— Sections & themes —— */
.theme + .theme {
  margin-top: 3.25rem;
}

.theme > h3 {
  margin: 0 0 1.1rem;
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -0.018em;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

/* —— Entry cards (research) —— */
.entry {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow);
  transition:
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.entry:hover {
  box-shadow: var(--shadow-hover);
  border-color: #d1d5db;
}

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

.entry h4 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.35;
}

.entry .row-chips {
  margin-bottom: 0.35rem;
}

.meta,
.venue,
.blurb,
.extra {
  margin: 0.2rem 0 0;
  font-size: 0.92rem;
}

.meta {
  color: var(--text);
  font-weight: 450;
}

.venue {
  color: var(--muted);
  font-style: italic;
  font-weight: 400;
}

.blurb {
  color: var(--muted);
  margin-top: 0.5rem;
  line-height: 1.65;
  font-weight: 400;
}

.project-row-body .blurb {
  font-weight: 400;
}

.extra {
  margin-top: 0.55rem;
  font-size: 0.88rem;
}

/* —— Chips —— */
.chip {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  background: #f1f5f9;
  border: 1px solid var(--border);
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
}

.chip--accent {
  color: #1e40af;
  background: #eff6ff;
  border-color: #bfdbfe;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.chip--tag {
  display: inline-block;
  text-transform: none;
  letter-spacing: 0.01em;
  font-size: 0.72rem;
  font-weight: 500;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 0.18rem 0.5rem;
  border-radius: 6px;
}

/* —— Project grid (projects page) —— */
.project-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.card.project-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

/* —— Project rows (featured, horizontal) —— */
.project-row-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.project-row {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 1.25rem;
  background: var(--project-row-bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow-project);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.project-row:hover {
  box-shadow: var(--shadow-project-hover);
  border-color: #d8dce3;
}

.project-row-media {
  flex: 0 0 200px;
  width: 200px;
  height: 160px;
  flex-shrink: 0;
  border: 1px solid var(--border-soft);
  border-radius: calc(var(--radius) - 2px);
  overflow: hidden;
  background: #f1f5f9;
  align-self: flex-end;
}

.project-row-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.project-row-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

@media (max-width: 560px) {
  .project-row {
    flex-direction: column;
    align-items: stretch;
  }

  .project-row-media {
    flex: none;
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    align-self: stretch;
  }

  .project-row-media img {
    height: 100%;
  }
}


.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.25rem;
}

.card-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.card-meta {
  margin: 0.15rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.card .blurb {
  flex: 1;
}

/* Generic card (shared) */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow);
  transition:
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-hover);
  border-color: #d1d5db;
}

/* —— Blog list —— */
.blog-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.blog-list li {
  margin: 0;
}

.blog-row {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition:
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.blog-row:hover {
  box-shadow: var(--shadow-hover);
  border-color: #c7d2fe;
}

.blog-row:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

.blog-row-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
  color: var(--link);
}

.blog-row:hover .blog-row-title {
  color: var(--link-hover);
}

.blog-row-date {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.blog-row-excerpt {
  margin: 0.45rem 0 0;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.55;
}

/* —— Blog post prose —— */
.post {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.35rem 1.75rem;
  box-shadow: var(--shadow);
  max-width: 100%;
}

.post-header {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.post-title {
  margin: 0;
  font-size: clamp(1.35rem, 2vw, 1.65rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.post-date {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.post-body {
  font-size: 0.98rem;
  line-height: 1.7;
  color: var(--text);
}

.post-body p {
  margin: 0 0 1rem;
}

.post-body p:last-child {
  margin-bottom: 0;
}

.post-body h2 {
  margin: 1.5rem 0 0.75rem;
  font-size: 1.1rem;
  font-weight: 650;
}

.post-body ul {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.post-body li {
  margin: 0.35rem 0;
}

.report-callout {
  margin: 0.75rem 0 0;
  font-size: 0.95rem;
}

.report-callout .report-link {
  margin-top: 0;
  font-weight: 600;
}

.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  font-weight: 600;
}

/* —— Listing states —— */
.listing-error,
.listing-empty {
  margin: 0;
  padding: 1rem;
  font-size: 0.92rem;
  color: var(--muted);
  background: #f8fafc;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.section-heading {
  margin: 2rem 0 0.85rem;
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.featured-projects-intro {
  margin: 0 0 0.85rem;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.55;
}

.latest-post {
  margin-top: 0.5rem;
}

.latest-post-link {
  font-weight: 600;
}

.teaser-date {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
}

.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;
}

/* —— Blog post media —— */
.media-row {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin: 1.5rem 0;
}

.media-row img,
.media-row figure img {
  max-width: 100%;
  border-radius: 6px;
}

.media-row figure {
  flex: 1 1 280px;
  margin: 0;
}

.media-row figure figcaption,
.full-media figcaption {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.4rem;
  text-align: center;
}

.full-media {
  margin: 1.5rem 0;
}

.full-media img {
  width: 100%;
  border-radius: 6px;
}

/* —— Method table —— */
.method-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.9rem;
}

.method-table th,
.method-table td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.method-table th {
  font-weight: 600;
}
