/* ============================================================
   Steffen Smolka · Homepage · 2025
   "Deep Code" — Night Scholar aesthetic
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Spectral:ital,wght@0,400;0,600;0,700;1,400&family=Plus+Jakarta+Sans:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* ── Design tokens ───────────────────────────────────────── */
:root {
  --bg:            #0b0c10;
  --surface:       #12141c;
  --surface-2:     #191c28;
  --border:        #1e2235;
  --border-light:  #252840;

  --text:          #dedad2;
  --text-muted:    #7a7872;
  --text-faint:    #454340;

  --accent:        #c9a96e;   /* warm brass / gold */
  --accent-dim:    #856f47;
  --link:          #7db3e8;   /* cornflower blue */
  --link-hover:    #aed0f5;

  --venue-bg:      #141926;
  --venue-text:    #7db3e8;
  --award-text:    #c9a96e;

  --sidebar-w:     280px;
  --content-max:   760px;

  --radius:        4px;
  --font-serif:    'Spectral', Georgia, serif;
  --font-sans:     'Plus Jakarta Sans', system-ui, sans-serif;
  --font-mono:     'JetBrains Mono', 'Fira Code', monospace;
}

/* ── Base ────────────────────────────────────────────────── */
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.18s ease;
}
a:hover { color: var(--link-hover); }

/* ── Layout ──────────────────────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 36px 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 0;

  /* Hide scrollbar */
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

/* Portrait */
.portrait-wrap {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto 20px;
  cursor: pointer;
}
.portrait-wrap img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--border-light);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.portrait-wrap .img-hover { opacity: 0; }
.portrait-wrap:hover .img-default { opacity: 0; }
.portrait-wrap:hover .img-hover { opacity: 1; }
.portrait-wrap .img-click { opacity: 0; transform: scale(0.95); }
.portrait-wrap:active .img-hover { opacity: 0; }
.portrait-wrap:active .img-click { opacity: 1; transform: scale(1); }

/* Identity */
.sidebar-name {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  text-align: center;
  margin-bottom: 8px;
}
.sidebar-title {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  text-align: center;
  margin-bottom: 4px;
  font-family: var(--font-mono);
}
.sidebar-org {
  font-size: 12.5px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 4px;
}
.sidebar-phd {
  font-size: 12px;
  color: var(--text-faint);
  text-align: center;
  margin-bottom: 14px;
}
.sidebar-phd a { color: var(--text-faint); }
.sidebar-phd a:hover { color: var(--link); }

/* Email */
.sidebar-email {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  text-align: center;
  margin-bottom: 8px;
}

/* Divider */
.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* Contact info */
.sidebar-info {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 28px;
  line-height: 1.8;
}
.sidebar-info a { color: var(--text-muted); }
.sidebar-info a:hover { color: var(--link); }

/* Nav */
.sidebar-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-nav li a {
  display: block;
  padding: 6px 10px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  transition: all 0.15s ease;
}
.sidebar-nav li a:hover,
.sidebar-nav li a.active {
  color: var(--text);
  background: var(--border);
}
.sidebar-nav li a.active {
  color: var(--accent);
  background: rgba(201, 169, 110, 0.08);
}

/* Social icons */
.sidebar-social {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 14px;
}
.sidebar-social a {
  color: #ffffff;
  font-size: 20px;
  transition: color 0.2s ease, text-shadow 0.2s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
}
.sidebar-social a:hover {
  color: #ffffff;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.7);
  transform: translateY(-2px);
}

/* ── Main content ────────────────────────────────────────── */
main {
  padding: 64px 56px 80px;
  max-width: calc(var(--content-max) + 112px);
}

/* ── Sections ────────────────────────────────────────────── */
.section {
  margin-bottom: 72px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.section.visible {
  opacity: 1;
  transform: none;
}

.section-heading {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 28px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.01em;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.section-heading .section-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-dim);
  font-weight: 400;
  letter-spacing: 0.05em;
}

/* ── Hero / intro ────────────────────────────────────────── */
.hero {
  margin-bottom: 72px;
  padding-top: 8px;
}
.hero-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
  display: block;
}
.hero-name {
  font-family: var(--font-serif);
  font-size: 48px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  word-spacing: 0.06em;
  color: var(--text);
  margin-bottom: 18px;
}
.hero-tagline {
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-muted);
  word-spacing: 0.1em;
}
.hero-tagline strong { color: var(--text); font-weight: 500; }

/* ── Research chips ──────────────────────────────────────── */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}
.chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  background: var(--surface-2);
  transition: all 0.2s ease;
}
.chip:hover {
  border-color: var(--accent-dim);
  color: var(--accent);
  background: rgba(201, 169, 110, 0.06);
}

/* ── About text ──────────────────────────────────────────── */
.about-body p {
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 14px;
  font-size: 15px;
  word-spacing: 0.06em;
}
.about-body p:last-child { margin-bottom: 0; }
.about-body a { color: var(--link); }
.about-body a:hover { color: var(--link-hover); }
.about-body strong { color: var(--text); font-weight: 500; }

/* ── Publications ────────────────────────────────────────── */
.pub-section-heading {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 40px 0 16px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.pub-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pub-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
  padding: 18px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: all 0.2s ease;
  position: relative;
}
.pub-item:hover {
  background: var(--surface);
  border-color: var(--border);
}

.pub-item.distinguished::before {
  content: '';
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 2px;
  background: var(--accent);
  border-radius: 2px;
}
.pub-item.distinguished { padding-left: 20px; }

.pub-title {
  font-family: var(--font-serif);
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 4px;
}
.pub-title a { color: var(--text); }
.pub-title a:hover { color: var(--link-hover); }

.pub-authors {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 8px;
}
.pub-authors strong { color: var(--text); font-weight: 500; }

.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.pub-link {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 3px;
  text-decoration: none;
  transition: all 0.15s ease;
}
.pub-link:hover {
  color: var(--link);
  border-color: var(--link);
  background: rgba(125, 179, 232, 0.06);
}

.pub-award, a.pub-award {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  padding: 2px 8px;
  border: 1px solid var(--accent-dim);
  border-radius: 3px;
  background: rgba(201, 169, 110, 0.06);
}

.pub-venue-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  min-width: 82px;
  padding-top: 2px;
}
.pub-hidden, .award-hidden, .teaching-hidden { display: none; }

.pub-venue {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--venue-text);
  background: var(--venue-bg);
  border: 1px solid rgba(125, 179, 232, 0.15);
  padding: 3px 8px;
  border-radius: var(--radius);
  white-space: nowrap;
}

a.pub-award:hover {
  color: var(--accent);
  border-color: var(--accent-dim);
  background: rgba(201, 169, 110, 0.1);
}

.news-toggle-btn {
  margin-top: 16px;
  margin-left: 0;
  width: 100%;
  justify-content: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.18s ease;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 8px 16px;
}
.news-toggle-btn:hover {
  color: var(--text);
  border-color: var(--accent-dim);
  background: rgba(201, 169, 110, 0.06);
}
.news-toggle-btn svg {
  width: 14px;
  height: 14px;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}
.news-toggle-btn.open svg { transform: rotate(180deg); }

/* ── Table-style lists (teaching, experience, service) ────── */
.list-item .item-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 5px;
  line-height: 1.65;
}

.list-section {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.list-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.65;
}
.list-item:last-child { border-bottom: none; }
.list-item a { color: var(--link); }
.list-item a:hover { color: var(--link-hover); }
.list-item .item-title {
  font-weight: 500;
  color: var(--text);
  font-size: 14px;
}
.item-title-note {
  font-weight: 400;
  font-size: 13px;
}
.list-item .item-meta {
  font-size: 12.5px;
  color: var(--text-faint);
  margin-top: 2px;
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.level-badge {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 1px 7px;
  border-radius: 3px;
  border: 1px solid;
}
.level-phd    { color: #a78bfa; border-color: rgba(167,139,250,0.3); background: rgba(167,139,250,0.07); }
.level-masters { color: #67c5b5; border-color: rgba(103,197,181,0.3); background: rgba(103,197,181,0.07); }
.level-undergrad { color: #d4c47a; border-color: rgba(212,196,122,0.3); background: rgba(212,196,122,0.07); }

/* ── Talks section ───────────────────────────────────────── */
.talk-feature {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 24px;
  align-items: start;
  margin-bottom: 20px;
}
.talk-feature.talk-playlist {
  align-items: stretch;
  margin-top: 8px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.talk-feature.talk-playlist .talks-cta {
  margin-bottom: 0;
  justify-content: center;
  padding: 20px;
}
.talk-feature-title {
  font-family: var(--font-serif);
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 10px;
}
.talk-feature-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
}
.talk-note {
  font-size: 13.5px;
  color: var(--text-muted);
  margin: 0;
}

.video-thumb {
  display: block;
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}
.video-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: opacity 0.2s ease;
}
.video-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  transition: background 0.2s ease;
}
.video-thumb:hover::after { background: rgba(0, 0, 0, 0.3); }
.video-thumb-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 1;
}
.video-thumb-play::before {
  content: '';
  position: absolute;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.92;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.video-thumb-play svg {
  width: 36px;
  height: 36px;
  color: var(--bg);
  position: relative;
  z-index: 1;
  transform: translateX(2px); /* optical center for play triangle */
  transition: transform 0.2s ease;
}
.video-thumb:hover .video-thumb-play::before {
  transform: scale(1.08);
  opacity: 1;
}
.video-thumb:hover .video-thumb-play svg {
  transform: translateX(2px) scale(1.08);
}

.talks-cta {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 14px;
  color: var(--text-muted);
  transition: all 0.2s ease;
  margin-bottom: 16px;
}
.talks-cta:hover {
  border-color: var(--accent-dim);
  color: var(--text);
  background: var(--surface-2);
}
.talks-cta .icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(201, 169, 110, 0.1);
  border: 1px solid var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.talks-cta .icon svg {
  width: 14px;
  height: 14px;
  color: var(--accent);
}

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
  margin-top: 80px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-faint);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.site-footer a { color: var(--text-faint); }
.site-footer a:hover { color: var(--text-muted); }

/* ── Scroll reveal ───────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  :root { --sidebar-w: 240px; }
  main { padding: 48px 36px 64px; }
}

@media (max-width: 700px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 32px 24px;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
  }
  .portrait-wrap { margin: 0; flex-shrink: 0; }
  .sidebar-identity { flex: 1; min-width: 160px; }
  .sidebar-name, .sidebar-title, .sidebar-org { text-align: left; }
  .sidebar-nav { flex-direction: row; flex-wrap: wrap; flex: none; width: 100%; }
  .sidebar-social { margin-top: 0; justify-content: flex-start; }
  main { padding: 36px 24px 48px; }
  .hero-name { font-size: 36px; }
  .pub-item { grid-template-columns: 1fr; }
  .pub-venue-col { flex-direction: row; align-items: center; }
  .news-toggle-btn { margin-left: 78px; }
}
