/* Base */
:root{
  --bg: #fffdfb;           /* cream */
  --text: #222222;
  --muted: #666666;
  --accent: #8FBFE0;       /* pastel blue */
  --accent-2: #CDB4DB;     /* lilac */
  --accent-3: #F7A9A8;     /* rose */
  --card: #ffffff;
  --shadow: 0 10px 30px rgba(0,0,0,0.06);
  --radius: 16px;
  --container: 900px;
}

*{ box-sizing: border-box; }
html, body { padding:0; margin:0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  line-height: 1.6;
}

/* Layout */
.container { width: min(100%, var(--container)); margin: 0 auto; padding: 0 16px; }

/* Navbar */
.navbar{
  position: sticky; top:0; z-index:100;
  background: rgba(255,255,255,0.8); backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.nav-inner{ display:flex; align-items:center; justify-content:space-between; padding: 14px 0; }
.nav-brand a{ text-decoration:none; color:var(--text); font-weight:700; }
.nav-links a{
  margin-left: 18px; text-decoration:none; color:var(--text); padding:6px 10px; border-radius: 12px;
  transition: transform .2s ease, background .2s ease;
}
.nav-links a:hover, .nav-links a.active{ background: #ecf6fd; color:#0b3b63; transform: translateY(-1px); }

/* Hero */
.hero{ display:flex; align-items:center; gap: 24px; padding: 28px 0 12px; }
.profile-img{ width: 140px; height: 140px; border-radius: 50%; object-fit: cover; box-shadow: var(--shadow); }
.hero-text .title{ margin:0 0 8px; font-size: 28px; }
.lead{ margin: 0 0 10px; color: var(--muted); }

/* About */
.about{ padding: 8px 0 26px; }
.about p{ margin: 0 0 12px; font-size: 17px; }

/* Grid of cards */
.grid{
  display:grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px; margin: 18px 0 40px;
}
.card{
  background:var(--card); border-radius: var(--radius); overflow:hidden; box-shadow: var(--shadow);
  text-decoration:none; color: var(--text); transition: transform .2s ease, box-shadow .2s ease;
}
.card img{ width: 100%; height: 160px; object-fit: cover; }
.card h3{ margin: 12px 14px 8px; }
.card p{ margin: 0 14px 16px; color: var(--muted); font-size: 15px; }
.card:hover{ transform: translateY(-4px) scale(1.02); box-shadow: 0 14px 40px rgba(0,0,0,0.10); }

/* Research subpage */
.page-hero{ width:100%; border-radius: var(--radius); box-shadow: var(--shadow); margin: 6px 0 16px; }
.content h2{ margin-top: 22px; }
.pub-list li{ margin: 6px 0; }

/* CV */
.cv-frame iframe{ width: 100%; height: 80vh; border: 1px solid rgba(0,0,0,0.1); border-radius: var(--radius); background:#fff; }

/* Footer */
.footer{ margin-top: 40px; padding: 22px 0; border-top: 1px solid rgba(0,0,0,0.06); }
.socials img{ width:28px; height:28px; margin-right: 10px; }

/* Animations */
.fade-in{ animation: fadeIn .6s ease both; }
.hover-scale{ transition: transform .18s ease; display:inline-flex; }
.hover-scale:hover{ transform: scale(1.06); }
@keyframes fadeIn { from{ opacity:0; transform: translateY(6px);} to{ opacity:1; transform: translateY(0);} }

/* Utilities */
.title{ font-size: 28px; margin: 14px 0; }
.underline{ text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.button{ display:inline-block; background: var(--accent); color:#0b3b63; text-decoration:none; padding:10px 14px; border-radius:12px; font-weight:600; }
.back{ display:inline-block; margin: 8px 0 12px; text-decoration:none; color:#0b3b63; }

/* --- Intro Section with all info on the left --- */
.intro-section {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 2rem;
  margin-top: 2rem;
  padding-bottom: 2rem;
  flex-wrap: nowrap;
}

.intro-left {
  flex: 0 0 32%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.8rem;
}

.profile-rect {
  width: 100%;
  max-width: 220px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: var(--shadow);
}

.lead {
  color: var(--muted);
  margin-top: -4px;
}

.intro-divider {
  width: 1.5px;
  background-color: #ccc;
  align-self: stretch;
  opacity: 0.6;
}

.intro-right {
  flex: 1;
}

.about-text p {
  margin: 0.6rem 0;
  line-height: 1.65;
  font-size: 1rem;
}

/* Responsive layout for mobile */
@media (max-width: 850px) {
  .intro-section {
    flex-direction: column;
    align-items: center;
  }
  .intro-divider {
    display: none;
  }
  .intro-left {
    flex: none;
    width: 100%;
    border-bottom: 1px solid #ddd;
    padding-bottom: 1rem;
  }
  .intro-right {
    width: 100%;
    text-align: left;
    margin-top: 1rem;
  }
}

/* --- Publications page --- */
.section-title { margin: 18px 0 8px; }

.filters {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 6px 0 12px;
}

#search {
  width: 100%;
  max-width: 520px;
  padding: 10px 12px;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 10px;
  font-size: 15px;
  background: #fff;
}

.results-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 6px 0 10px;
  color: var(--muted);
  font-size: 14px;
}

/* Scrollable list container */
.pub-list-scroll {
  max-height: 60vh;           /* visible window height */
  overflow-y: auto;
  padding: 12px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

/* Optional: subtle custom scrollbar */
.pub-list-scroll::-webkit-scrollbar { width: 10px; }
.pub-list-scroll::-webkit-scrollbar-thumb {
  background: #e6edf5;
  border-radius: 10px;
  border: 2px solid #fff;
}
.pub-list-scroll::-webkit-scrollbar-track { background: transparent; }

/* Publication cards */
.pub { padding: 12px 6px; border-bottom: 1px solid rgba(0,0,0,0.06); }
.pub:last-of-type { border-bottom: none; }
.pub h3 { margin: 0 0 6px; font-size: 16px; }
.pub .meta { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }

/* Hide utility */
.is-hidden { display: none !important; }

/* --- News panel --- */
.news-section { margin: 32px 0 8px; }

.news-list-scroll {
  max-height: 220px;           /* makes it scrollable */
  overflow-y: auto;
  padding: 12px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

/* optional: subtle custom scrollbar (matches publications) */
.news-list-scroll::-webkit-scrollbar { width: 10px; }
.news-list-scroll::-webkit-scrollbar-thumb {
  background: #e6edf5;
  border-radius: 10px;
  border: 2px solid #fff;
}
.news-list-scroll::-webkit-scrollbar-track { background: transparent; }

.news-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 6px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.news-item:last-child { border-bottom: none; }

.news-dot {
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--accent);    /* pastel blue bullet */
}

.news-text {
  margin: 0;
  line-height: 1.55;
  color: var(--text);
}

/* --- Research cards refinement --- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  transition: transform .2s ease, box-shadow .2s ease;
  display: flex;
  flex-direction: column;
}

.card h3 {
  margin: 14px 14px 8px;
  font-size: 1.1rem;
  text-align: center;
}

/* fixed image proportions */
.card-img {
  width: 100%;
  aspect-ratio: 4 / 3;     /* keeps all research images same height */
  overflow: hidden;
  border-radius: var(--radius);
}

.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card p {
  margin: 8px 14px 16px;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}

.card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 14px 40px rgba(0,0,0,0.10);
}

/* --- News Section (scrollable panel, no list) --- */
.news-section {
  margin: 40px 0;
}

.news-scroll {
  max-height: 200px;                /* sets visible height before scrolling */
  overflow-y: auto;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

/* Smooth scroll and custom scrollbar */
.news-scroll {
  scroll-behavior: smooth;
}
.news-scroll::-webkit-scrollbar {
  width: 10px;
}
.news-scroll::-webkit-scrollbar-thumb {
  background: #e6edf5;
  border-radius: 10px;
  border: 2px solid #fff;
}
.news-scroll::-webkit-scrollbar-track {
  background: transparent;
}

/* News text styling */
.news-text {
  margin: 8px 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  padding-bottom: 6px;
}
.news-text:last-child {
  border-bottom: none;
}

/* --- Blog page --- */
.blog-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 18px 0 40px;
}

.blog-note {
  margin: 16px 0 6px;
  color: var(--muted);
  font-size: 15px;
}

.blog-card {
  display: flex;
  gap: 18px;
  padding: 14px;
  background: #fff;
  border: none;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.blog-card.is-clickable {
  cursor: pointer;
}

.blog-card.is-paper {
  background: #f4f9ff;
}

.blog-card.is-essay {
  background: #fff7f1;
}

.blog-media img {
  width: 220px;
  height: 140px;
  object-fit: cover;
  border-radius: 10px;
  background: transparent;
}

.blog-body h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.blog-meta {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 850px) {
  .blog-card {
    flex-direction: column;
  }
  .blog-media img {
    width: 100%;
    height: auto;
  }
}

/* --- Blog detail pages --- */
.blog-detail {
  margin: 16px 0 40px;
}

.blog-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.blog-hero h1 {
  margin: 0 0 6px;
  font-size: 28px;
}

.blog-hero .blog-meta {
  margin-bottom: 10px;
}

.blog-figure {
  margin: 14px 0 18px;
  padding: 12px;
  background: #fff;
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: var(--shadow);
}

.blog-figure img {
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  border-radius: 12px;
  background: #f6f6f6;
}

.blog-figure figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

.blog-content p {
  margin: 0 0 12px;
  font-size: 16px;
}

.blog-content .highlight {
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  background: #f3f8fc;
  border-radius: 10px;
  margin: 12px 0;
}

/* --- Taxonomy long-form post --- */
.taxonomy-page {
  --taxonomy-bg: #f6f4ef;
  --taxonomy-paper: #fffefb;
  --taxonomy-ink: #1f1e1a;
  --taxonomy-muted: #636056;
  --taxonomy-rule: #dfd8cb;
  --taxonomy-accent: #a85d2a;
  --taxonomy-accent-soft: #efe4d6;
  background:
    radial-gradient(1200px 420px at 0% -20%, #efe8dc 0%, rgba(239,232,220,0) 70%),
    radial-gradient(1000px 380px at 100% -10%, #ebe3d6 0%, rgba(235,227,214,0) 72%),
    var(--taxonomy-bg);
  color: var(--taxonomy-ink);
  font-family: "IBM Plex Sans", "Segoe UI", Roboto, Arial, sans-serif;
}

.taxonomy-page .container {
  width: min(100%, 1080px);
}

.taxonomy-main {
  width: min(100%, 1140px);
  margin: 0 auto;
  padding: 16px 16px 44px;
}

.taxonomy-article {
  max-width: 820px;
  margin: 0 auto;
  padding: 28px 34px 38px;
  background: var(--taxonomy-paper);
  border: 1px solid var(--taxonomy-rule);
  border-radius: 18px;
  box-shadow: 0 24px 44px rgba(58, 45, 23, 0.08);
}

.taxonomy-back {
  margin-bottom: 18px;
  color: #5f4b32;
}

.taxonomy-hero {
  margin-bottom: 24px;
}

.taxonomy-kicker {
  margin: 0 0 8px;
  color: var(--taxonomy-accent);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
}

.taxonomy-hero h1 {
  margin: 0;
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.01em;
}

.taxonomy-dek {
  margin: 16px 0 8px;
  color: var(--taxonomy-muted);
  font-size: 18px;
  line-height: 1.6;
}

.taxonomy-meta {
  margin: 0;
  font-size: 14px;
  color: var(--taxonomy-muted);
}

.taxonomy-section {
  margin: 28px 0;
}

.taxonomy-section h2,
.taxonomy-subtitle {
  margin: 0 0 12px;
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  line-height: 1.2;
}

.taxonomy-section h2 {
  font-size: 30px;
}

.taxonomy-subtitle {
  font-size: 24px;
}

.taxonomy-section p {
  margin: 0 0 14px;
  font-size: 18px;
  line-height: 1.8;
}

.taxonomy-section ol {
  margin: 0 0 14px 22px;
  padding: 0;
}

.taxonomy-section li {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.7;
}

.taxonomy-pull {
  margin: 24px 0 28px;
  padding: 20px 22px;
  border-radius: 12px;
  border-left: 4px solid var(--taxonomy-accent);
  background: var(--taxonomy-accent-soft);
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-size: 26px;
  line-height: 1.35;
}

.taxonomy-table-wrap {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid var(--taxonomy-rule);
  background: #fffcf5;
}

.taxonomy-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

.taxonomy-table th,
.taxonomy-table td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid #e7dfd3;
}

.taxonomy-table th {
  background: #f5eee2;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.taxonomy-table td {
  font-size: 15px;
  line-height: 1.5;
}

.taxonomy-figure {
  margin: 18px 0 10px;
}

.taxonomy-figure img {
  width: 100%;
  border: 1px solid #e4ddcf;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(27, 19, 6, 0.08);
  background: #f2f2f2;
}

.taxonomy-figure figcaption {
  margin-top: 8px;
  color: var(--taxonomy-muted);
  font-size: 14px;
  line-height: 1.5;
}

.taxonomy-close {
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid var(--taxonomy-rule);
}

.taxonomy-close p {
  margin: 0;
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-size: 28px;
  line-height: 1.35;
}

@media (max-width: 900px) {
  .taxonomy-main {
    padding: 12px 10px 28px;
  }
  .taxonomy-article {
    padding: 22px 18px 28px;
  }
  .taxonomy-section h2 {
    font-size: 26px;
  }
  .taxonomy-subtitle {
    font-size: 22px;
  }
  .taxonomy-section p {
    font-size: 17px;
    line-height: 1.72;
  }
  .taxonomy-pull {
    font-size: 22px;
    padding: 16px 16px;
  }
  .taxonomy-close p {
    font-size: 24px;
  }
}
