:root {
  --max-width: 900px;
  --text: #1c1c1c;
  --muted: #6b6b6b;
  --accent: #b00020; /* UniSI UniRed, from unisi_business_card */
  --border: rgba(0, 0, 0, 0.1);
  --bg: #ffffff;
  --bg-card: #fafafa;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}

html[data-theme="dark"] {
  --text: #e6e6e6;
  --muted: #9a9a9a;
  --accent: #ff3358; /* UniRed, lightened for AA contrast on this dark background */
  --border: #424246;
  --bg: #1c1c1d;
  --bg-card: #262627;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
}

* { box-sizing: border-box; }

body {
  font-family: "Roboto", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  margin: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

h1, h2, h3 {
  font-family: "Roboto Slab", "Roboto", Georgia, serif;
  font-weight: 500;
}

.site-header, main, .site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.site-title {
  font-family: "Roboto Slab", serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
}

.site-header nav {
  display: flex;
  align-items: center;
}

.site-header nav a {
  margin-left: 1.4rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-bottom: 0.2rem;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.site-header nav a:hover { color: var(--accent); border-bottom-color: var(--accent); }

#theme-toggle {
  margin-left: 1.4rem;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

#theme-toggle:hover { border-color: var(--accent); }
#theme-toggle::before { content: "\1F319"; } /* moon: shown in light mode, click to go dark */
html[data-theme="dark"] #theme-toggle::before { content: "\2600\FE0F"; } /* sun: shown in dark mode, click to go light */

main { padding-top: 2rem; padding-bottom: 3rem; min-height: 60vh; }

a { color: var(--accent); }

h1 { font-size: 1.9rem; margin-bottom: 0.3rem; }
h2 { font-size: 1.3rem; margin-top: 2.5rem; }

.subtitle { color: var(--muted); margin-top: 0; }

/* --- Profile header (home page) --- */
.profile-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 0.5rem;
}

.profile-avatar {
  flex-shrink: 0;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow);
}

.profile-header h1 { margin-bottom: 0.15rem; }
.profile-header .subtitle { margin-top: 0; }

/* --- Highlight cards (recent high-impact publications) --- */
.highlights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.highlight-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.highlight-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.highlight-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--border);
}

.highlight-card .body { padding: 0.9rem 1rem 1.1rem; }

.highlight-card .venue {
  display: inline-block;
  font-size: 0.72rem;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.highlight-card h3 {
  font-size: 1.02rem;
  margin: 0.5rem 0 0.4rem;
}

.highlight-card .abstract {
  font-size: 0.9rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.highlight-card .meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

/* --- Research topics --- */
.topic-block {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

/* --- Auto-generated-content disclaimer --- */
.auto-disclaimer {
  font-size: 0.85rem;
  color: var(--muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.9rem;
  margin: 0.75rem 0 1.5rem;
}

/* --- Publications list --- */
.pub-year-heading {
  font-family: "Roboto Slab", serif;
  font-size: 1.1rem;
  color: var(--muted);
  margin-top: 2rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.3rem;
}

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

.pub-list li {
  display: flex;
  gap: 0.6rem;
  padding: 0.7rem 0.8rem;
  margin-bottom: 0.6rem;
  line-height: 1.5;
  border-radius: var(--radius);
  transition: background 0.15s ease;
}

.pub-list li:hover { background: var(--bg-card); }

.pub-list .pub-number {
  color: var(--muted);
  flex-shrink: 0;
  min-width: 2.2em;
  text-align: right;
}

.pub-list .pub-self { font-weight: 700; }

.pub-corresponding-note {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

/* --- Publication/citation trends chart --- */
.pub-trends-chart {
  margin: 1.5rem 0 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  background: var(--bg-card);
  box-shadow: var(--shadow);
}

/* --- Contact / map --- */
.map-embed {
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  margin-top: 0.75rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.map-embed iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.site-footer { color: var(--muted); font-size: 0.9rem; }
.footer-links { margin-bottom: 0.4rem; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--accent); }
