:root {
  --charcoal: #2c3340;
  --charcoal-overlay: rgba(28, 34, 44, 0.88);
  --bg: #ffffff;
  --bg-muted: #f7f8fa;
  --text: #1a1a1a;
  --text-muted: #6b7280;
  --text-on-dark: #f3f4f6;
  --text-on-dark-muted: #c5cad3;
  --border: #e5e7eb;
  --tab-active: #2563eb;
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --max-width: 1080px;
  --avatar-size: 120px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

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

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

.container-wide {
  width: min(var(--max-width), calc(100% - 2.5rem));
  margin: 0 auto;
}

.hidden {
  display: none !important;
}

/* ── Hero: left avatar + bio on charcoal with bg ── */

.profile-hero {
  position: relative;
  background-color: var(--charcoal);
  background-image:
    linear-gradient(135deg, rgba(28, 34, 44, 0.95) 0%, rgba(38, 48, 62, 0.9) 50%, rgba(30, 40, 52, 0.95) 100%),
    radial-gradient(ellipse at 70% 20%, rgba(74, 143, 168, 0.25) 0%, transparent 60%),
    radial-gradient(ellipse at 20% 80%, rgba(45, 90, 123, 0.2) 0%, transparent 50%);
  background-size: cover;
  background-position: center;
  color: var(--text-on-dark);
  padding: 2.75rem 0 2.5rem;
}

.hero-inner {
  display: flex;
  align-items: flex-start;
  gap: 1.75rem;
}

.profile-avatar {
  width: var(--avatar-size);
  height: var(--avatar-size);
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 3px solid rgba(255, 255, 255, 0.9);
  flex-shrink: 0;
}

.hero-text h1 {
  font-size: clamp(1.6rem, 3.5vw, 2rem);
  font-weight: 700;
  margin: 0 0 0.85rem;
  letter-spacing: -0.02em;
  color: #fff;
  line-height: 1.2;
}

.hero-role {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-on-dark);
  line-height: 1.5;
  max-width: 52rem;
}

.hero-profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.hero-profile-links a {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-on-dark);
  border: 1px solid rgba(255, 255, 255, 0.28);
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  transition: background 0.15s;
}

.hero-profile-links a:hover {
  background: rgba(255, 255, 255, 0.1);
}

.hero-contact {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-on-dark-muted);
}

.hero-contact a {
  color: var(--text-on-dark);
}

.hero-contact a:hover {
  text-decoration: underline;
}

/* ── Tab toolbar (Authory-style white bar) ── */

.content-toolbar {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.toolbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 52px;
}

.content-tabs {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.content-tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.85rem 0.75rem;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--tab-active);
  border-bottom-color: var(--tab-active);
}

.toolbar-search input {
  width: 200px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font: inherit;
  font-size: 0.88rem;
  background: var(--bg-muted);
}

.toolbar-search input:focus {
  outline: none;
  border-color: #93c5fd;
  background: #fff;
}

/* ── Highlight card grid ── */

.main-content {
  padding: 2rem 0 0;
}

.highlight-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.75rem 1.5rem;
  padding-bottom: 3rem;
}

.highlight-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.highlight-card-image {
  width: 100%;
  height: 180px;
  border-radius: 6px;
  overflow: hidden;
  background: #f0f2f5;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.highlight-card-image img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
}

.highlight-card h2 {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.4;
  margin: 0;
  letter-spacing: -0.01em;
}

.highlight-card h2 a {
  color: var(--text);
  transition: color 0.15s;
}

.highlight-card h2 a:hover {
  color: var(--tab-active);
}

.highlight-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.highlight-card-meta a {
  color: var(--tab-active);
}

.highlight-card-meta a:hover {
  text-decoration: underline;
}

.meta-sep {
  color: #d1d5db;
}

/* ── Publications panel (All tab) ── */

.publication-panel {
  padding-bottom: 3rem;
}

.pub-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.pub-controls select {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  font: inherit;
  font-size: 0.88rem;
  background: var(--bg);
}

.pub-meta {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-bottom: 1.25rem;
}

.publication-list {
  display: grid;
  gap: 0;
}

#publicationList {
  display: grid;
  gap: 2rem;
}

.pub-category-group {
  margin: 0;
}

.pub-category-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 0.75rem;
  padding-bottom: 0.65rem;
  border-bottom: 2px solid var(--charcoal);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.pub-category-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--bg-muted);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.pub-category-group .publication-item:first-child {
  border-top: 0;
}

.publication-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.publication-item:first-child {
  border-top: 1px solid var(--border);
}

.publication-item h3 {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.45;
}

.publication-item h3 a {
  color: var(--text);
}

.publication-item h3 a:hover {
  color: var(--tab-active);
}

.pub-details {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.pub-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.loading,
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* ── Lower sections ── */

.section {
  padding: 3.5rem 0;
  scroll-margin-top: 3.25rem;
}

.section-dark {
  background: var(--charcoal);
  background-image:
    linear-gradient(135deg, rgba(28, 34, 44, 0.98) 0%, rgba(38, 48, 62, 0.95) 50%, rgba(30, 40, 52, 0.98) 100%),
    radial-gradient(ellipse at 80% 10%, rgba(74, 143, 168, 0.15) 0%, transparent 55%);
  color: var(--text-on-dark);
}

.section-dark.section-focus {
  box-shadow: inset 0 0 0 2px rgba(147, 197, 253, 0.35);
}

.section-light {
  background: var(--bg-muted);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 0.5rem;
}

.section-eyebrow-dark {
  color: var(--text-muted);
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 1.25rem;
  letter-spacing: -0.02em;
}

.section-title-light {
  color: #fff;
}

.section-lead {
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--text-on-dark-muted);
  margin: -0.5rem 0 1.75rem;
  max-width: 52rem;
}

.section-lead a {
  color: #93c5fd;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.section-lead a:hover {
  color: #fff;
}

.section-dark .about-bio p,
.section-dark .content-block p {
  color: var(--text-on-dark-muted);
}

.section-dark .plain-list {
  color: var(--text-on-dark-muted);
}

.plain-list-light {
  color: var(--text-on-dark-muted);
}

.section-cards {
  margin-top: 2rem;
}

.dark-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 1.35rem 1.5rem;
  border-left: 3px solid rgba(147, 197, 253, 0.45);
  transition: background 0.2s, border-color 0.2s;
}

.dark-card:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.18);
}

.dark-card h3 {
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.section-desc {
  color: var(--text-muted);
  margin: -0.75rem 0 1.5rem;
  font-size: 0.92rem;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
}

.content-block h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.65rem;
}

.content-block p {
  color: var(--text-muted);
  margin: 0 0 0.85rem;
  font-size: 0.93rem;
}

.plain-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--text-muted);
  font-size: 0.93rem;
}

.plain-list li {
  margin-bottom: 0.35rem;
}

.about-bio p {
  color: var(--text-muted);
  font-size: 0.93rem;
  margin: 0 0 1rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.project-card {
  border: 1px solid var(--border);
  padding: 1.35rem 1.5rem;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.15s, transform 0.15s;
}

.project-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  transform: translateY(-2px);
}

.project-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.55rem;
  line-height: 1.4;
}

.project-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.qaf-highlights {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.qaf-highlights-section {
  margin-top: 1.5rem;
  margin-bottom: 0;
}

.qaf-highlight-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 1rem 1.15rem;
  transition: background 0.2s, transform 0.2s, border-color 0.2s;
}

.qaf-highlight-card:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(147, 197, 253, 0.35);
  transform: translateY(-2px);
}

.qaf-highlight-card strong {
  display: block;
  color: #fff;
  font-size: 0.88rem;
  margin-bottom: 0.3rem;
}

.qaf-highlight-card span {
  font-size: 0.82rem;
  color: var(--text-on-dark-muted);
  line-height: 1.5;
}

.qaf-cta {
  display: inline-flex;
  align-items: center;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--charcoal);
  background: #fff;
  padding: 0.55rem 1.1rem;
  border-radius: 6px;
  transition: background 0.15s, transform 0.15s;
}

.qaf-cta:hover {
  background: #e8eef5;
  transform: translateY(-1px);
}

.qaf-cta-inline {
  margin-top: 0.5rem;
}

.qaf-detail-single {
  grid-template-columns: 1fr;
}

.qaf-company-card h3 {
  margin-bottom: 0.65rem;
}

.qaf-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0 0 1.25rem;
}

.qaf-meta-item {
  flex: 1;
  min-width: 10rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 0.75rem 1rem;
}

.qaf-meta-item dt {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 0.25rem;
}

.qaf-meta-item dd {
  margin: 0;
  font-size: 0.88rem;
  color: #fff;
  line-height: 1.4;
}

.qaf-detail-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 1.25rem;
  margin-bottom: 0;
}

.page-section.hidden {
  display: none !important;
}

.qaf-company-card p {
  color: var(--text-on-dark-muted);
  font-size: 0.93rem;
  line-height: 1.65;
  margin: 0 0 0.85rem;
}

.qaf-company-card strong {
  color: #fff;
}

.site-footer {
  padding: 2.5rem 0 2.75rem;
  background: var(--charcoal);
  background-image:
    linear-gradient(180deg, rgba(28, 34, 44, 1) 0%, rgba(22, 28, 36, 1) 100%),
    radial-gradient(ellipse at 50% 0%, rgba(74, 143, 168, 0.12) 0%, transparent 60%);
  color: var(--text-on-dark-muted);
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.footer-brand {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.01em;
}

.footer-tagline {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-on-dark-muted);
}

.footer-stats {
  margin: 0.5rem 0 0;
  font-size: 0.78rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.footer-copy {
  margin: 1rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  width: 100%;
  max-width: 20rem;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.35);
}

/* ── Responsive ── */

@media (max-width: 768px) {
  .hero-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .hero-role {
    font-size: 0.9rem;
  }

  .toolbar-inner {
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem 0;
  }

  .toolbar-search input {
    width: 100%;
  }

  .highlight-grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .qaf-meta-row {
    flex-direction: column;
  }

  .qaf-meta-item {
    min-width: 0;
  }

  .two-col,
  .qaf-detail-grid,
  .qaf-highlights,
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  :root {
    --avatar-size: 96px;
  }
}
