/* ─── Reset ─────────────────────────────────────────────────────────────── */

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

:root {
  --bg:           #ffffff;
  --text:         #111111;
  --text-muted:   #6b7280;
  --accent:       #2563eb;
  --accent-hover: #1d4ed8;
  --accent-bg:    #eff6ff;
  --border:       #e5e7eb;
  --sidebar-bg:   #fafafa;
  --sidebar-w:    240px;
  --content-w:    720px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--accent-hover); }

/* ─── Layout ────────────────────────────────────────────────────────────── */

.wrapper {
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ───────────────────────────────────────────────────────────── */

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 2.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.sidebar-mascot {
  width: 56px;
  height: 56px;
  image-rendering: pixelated;
  display: block;
  margin-bottom: 0.75rem;
}

.nav-icon {
  width: 18px;
  height: 18px;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.sidebar-name {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  display: block;
  line-height: 1.2;
}

.sidebar-name:hover { color: var(--accent); }

.sidebar-title {
  font-size: 0.775rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  line-height: 1.5;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 0.4rem 0.6rem;
  border-radius: 5px;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: var(--accent-bg);
  color: var(--accent);
}

.sidebar-nav a .pixel-icon { flex-shrink: 0; }

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-footer a {
  font-size: 0.775rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-footer a:hover { color: var(--accent); }

/* ─── Main content ──────────────────────────────────────────────────────── */

.main {
  flex: 1;
  min-width: 0;
  padding: 3.5rem 3rem 4rem;
  max-width: var(--content-w);
}

/* ─── Page headings ─────────────────────────────────────────────────────── */

.page-title {
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 1.75rem;
  background: linear-gradient(130deg, #111 30%, #2563eb);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-title {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 1.25rem;
  margin-top: 3rem;
}

.section-title:first-child { margin-top: 0; }

/* ─── Body text ─────────────────────────────────────────────────────────── */

/* ─── Intro card ────────────────────────────────────────────────────────── */

.intro-card {
  border-left: 3px solid var(--accent);
  background: var(--accent-bg);
  padding: 1rem 1.25rem;
  border-radius: 0 6px 6px 0;
  margin-bottom: 2rem;
}

.intro-card p {
  font-size: 1rem;
  font-style: italic;
  color: var(--accent-hover);
  line-height: 1.7;
  margin: 0;
}

.prose p {
  font-size: 0.9875rem;
  line-height: 1.75;
  color: var(--text);
  margin-bottom: 1rem;
  max-width: 600px;
}

.prose p a {
  border-bottom: 1px solid #bfdbfe;
  transition: border-color 0.15s;
}

.prose p a:hover { border-bottom-color: var(--accent); }

/* ─── Pixel icons ───────────────────────────────────────────────────────── */

.pixel-icon {
  display: inline-block;
  vertical-align: middle;
  shape-rendering: crispEdges;
  image-rendering: pixelated;
  fill: currentColor;
}

/* ─── Publication group ─────────────────────────────────────────────────── */

.pub-group { margin-bottom: 3rem; }

.pub-group-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent-bg);
}

/* ─── Publication rows (Tania-style) ────────────────────────────────────── */

.pub-list { list-style: none; }

.pub-row {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.45rem 0.5rem;
  border-radius: 5px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: background 0.12s;
}

.pub-list li:first-child .pub-row { border-top: 1px solid var(--border); }

.pub-row:hover { background: var(--accent-bg); }

.pub-year {
  font-size: 0.775rem;
  color: var(--text-muted);
  width: 42px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.pub-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  flex: 1;
  line-height: 1.45;
}

.pub-row:hover .pub-name { color: var(--accent); }

.pub-venue {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  font-style: italic;
}

.pub-link-badge {
  font-size: 0.675rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-bg);
  border: 1px solid #bfdbfe;
  padding: 0.1rem 0.45rem;
  border-radius: 3px;
  flex-shrink: 0;
  white-space: nowrap;
}

/* ─── Pill tags ─────────────────────────────────────────────────────────── */

.pill-links {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.pill-links a {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-bg);
  border: 1px solid #bfdbfe;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  transition: background 0.15s, border-color 0.15s;
}

.pill-links a:hover { background: #dbeafe; border-color: #93c5fd; }

/* ─── Mobile ─────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .wrapper { flex-direction: column; }

  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    padding: 1rem 1.25rem;
    gap: 1rem;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .sidebar-info { flex: 1; }
  .sidebar-title { display: none; }

  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .sidebar-footer { display: none; }

  .main { padding: 2rem 1.25rem; }
}
