/* ============================================
   Kevin Kloiber — Academic Website
   Clean but warm, not stuffy
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --color-bg: #faf9f6;
  --color-surface: #ffffff;
  --color-text: #222222;
  --color-text-secondary: #4a4a4a;
  --color-text-muted: #828282;
  --color-accent: #3a6b8a;
  --color-accent-light: #4d88ac;
  --color-accent-warm: #c47d3e;
  --color-border: #e6e3dc;
  --color-border-light: #f0ede6;
  --color-hover-bg: #f4f2ec;
  --color-tag-bg: rgba(58, 107, 138, 0.07);

  --font-display: 'Inter', 'Helvetica Neue', sans-serif;
  --font-body: 'Inter', 'Helvetica Neue', sans-serif;

  --sidebar-width: 320px;
  --content-max: 720px;
}

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

html {
  font-size: 17px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.72;
}

a { color: var(--color-accent); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--color-accent-light); }
::selection { background: rgba(58, 107, 138, 0.15); }

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

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  padding: 40px 36px 28px;
  position: fixed;
  top: 0; left: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--color-border);
  background: var(--color-surface);
  overflow-y: auto;
}

.sidebar-photo {
  width: 150px; height: 150px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 18%;
  margin-bottom: 20px;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}
.sidebar-photo:hover { transform: scale(1.03); }

.sidebar-name {
  font-family: var(--font-display);
  font-size: 1.45rem; font-weight: 700;
  color: var(--color-text);
  line-height: 1.25; margin-bottom: 6px;
}

.sidebar-title {
  font-size: 0.84rem; font-weight: 400;
  color: var(--color-text-secondary);
  line-height: 1.5; margin-bottom: 24px;
}

.sidebar-nav { list-style: none; margin-bottom: 24px; }
.sidebar-nav li { margin-bottom: 3px; }
.sidebar-nav a {
  display: block; padding: 8px 14px;
  font-size: 0.9rem; font-weight: 400;
  color: var(--color-text-secondary);
  border-radius: 6px;
  transition: all 0.15s ease;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
  color: var(--color-text);
  background: var(--color-hover-bg);
}
.sidebar-nav a.active { font-weight: 500; }
.nav-group-label {
  display: block; padding: 8px 14px;
  font-size: 0.9rem; font-weight: 400;
  color: var(--color-text-secondary);
}
.nav-sub a {
  padding-left: 28px;
  font-size: 0.86rem;
}

.sidebar-footer {
  margin-top: auto; padding-top: 20px;
  border-top: 1px solid var(--color-border-light);
  flex-shrink: 0;
}
.sidebar-contact {
  font-size: 0.82rem; color: var(--color-text-muted);
  line-height: 1.5; margin-bottom: 16px;
}

.sidebar-social { display: flex; gap: 14px; }
.sidebar-social a {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 6px;
  color: var(--color-text-secondary);
  transition: all 0.15s ease;
}
.sidebar-social a:hover {
  color: var(--color-accent);
  background: var(--color-hover-bg);
}
.sidebar-social svg { width: 20px; height: 20px; }

/* ---- Main Content ---- */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 56px 56px 80px;
  max-width: calc(var(--content-max) + 112px);
}

/* ---- Typography ---- */
.page-title {
  font-family: var(--font-display);
  font-size: 1.75rem; font-weight: 700;
  color: var(--color-text);
  margin-bottom: 36px;
}

.section-label {
  font-size: 0.73rem; font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin-bottom: 18px;
}

h2 { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; margin-bottom: 14px; }
h3 { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; margin-bottom: 6px; }

p { margin-bottom: 14px; color: var(--color-text-secondary); }
p:last-child { margin-bottom: 0; }

/* ---- About ---- */
.about-intro {
  font-size: 1.02rem; line-height: 1.8;
  color: var(--color-text-secondary);
  margin-bottom: 14px;
}
.about-intro strong, .about-intro b { color: var(--color-text); font-weight: 500; }

.about-highlight {
  margin: 0 0 14px;
}
.about-highlight p { font-size: 1.02rem; line-height: 1.8; color: var(--color-text-secondary); }

.fields-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; margin-bottom: 20px; }
.field-tag {
  display: inline-block; padding: 5px 14px;
  font-size: 0.8rem; font-weight: 500;
  color: var(--color-accent);
  background: var(--color-tag-bg);
  border-radius: 20px;
}

.beyond-work {
  margin-top: 36px; padding-top: 28px;
  border-top: 1px solid var(--color-border-light);
}
.beyond-work p { font-size: 0.95rem; line-height: 1.8; color: var(--color-text-secondary); }

.site-credit {
  margin-top: 48px; padding-top: 20px;
  border-top: 1px solid var(--color-border-light);
  font-size: 0.78rem; color: var(--color-text-muted); line-height: 1.6;
}

/* ---- Research ---- */
.research-section { margin-bottom: 44px; }

.paper { padding: 22px 0; border-bottom: 1px solid var(--color-border-light); }
.paper:first-child { padding-top: 0; }
.paper:last-child { border-bottom: none; }

.paper-title {
  font-family: var(--font-display);
  font-size: 1.05rem; font-weight: 700;
  color: var(--color-text);
  margin-bottom: 5px; line-height: 1.45;
}
.paper-title a { color: var(--color-text); }
.paper-title a:hover { color: var(--color-accent); }

.paper-subtitle { font-size: 0.88rem; color: var(--color-text-muted); margin-bottom: 5px; line-height: 1.5; }
.paper-authors { font-size: 0.86rem; color: var(--color-text-muted); margin-bottom: 5px; }
.paper-venue { font-size: 0.84rem; color: var(--color-text-muted); margin-bottom: 8px; }

.paper-jmp {
  display: inline-block; padding: 3px 10px;
  font-size: 0.7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--color-accent-warm);
  border: 1.5px solid var(--color-accent-warm);
  border-radius: 4px; margin-bottom: 8px;
}

.paper-abstract { font-size: 0.9rem; line-height: 1.72; color: var(--color-text-secondary); margin-top: 8px; }
.paper-links { display: flex; gap: 16px; margin-top: 10px; flex-wrap: wrap; }
.paper-link {
  font-size: 0.82rem; font-weight: 500;
  color: var(--color-accent);
  display: inline-flex; align-items: center; gap: 4px;
}
.paper-link:hover { color: var(--color-accent-light); }
.paper-link svg { width: 13px; height: 13px; }

.abstract-toggle {
  font-size: 0.82rem; font-weight: 500;
  color: var(--color-accent);
  cursor: pointer; background: none; border: none; padding: 0;
  display: inline-flex; align-items: center; gap: 4px;
  transition: color 0.15s ease;
  font-family: var(--font-body);
}
.abstract-toggle:hover { color: var(--color-accent-light); }
.abstract-toggle .chevron { transition: transform 0.25s ease; display: inline-block; }
.abstract-toggle.open .chevron { transform: rotate(180deg); }
.abstract-content { max-height: 0; overflow: hidden; transition: max-height 0.4s ease; }
.abstract-content.open { max-height: 800px; }

/* ---- CV ---- */
.cv-download {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; font-size: 0.86rem; font-weight: 500;
  color: var(--color-accent);
  border: 1.5px solid var(--color-accent);
  border-radius: 6px;
  transition: all 0.2s ease; margin-bottom: 36px;
}
.cv-download:hover { background: var(--color-accent); color: #fff; }
.cv-download svg { width: 15px; height: 15px; }

.cv-section { margin-bottom: 36px; }
.cv-entry {
  display: grid; grid-template-columns: 150px 1fr;
  gap: 20px; padding: 14px 0;
  border-bottom: 1px solid var(--color-border-light);
}
.cv-entry:last-child { border-bottom: none; }
.cv-date { font-size: 0.84rem; color: var(--color-text-muted); padding-top: 2px; }
.cv-detail h3 {
  font-family: var(--font-body);
  font-size: 0.93rem; font-weight: 600;
  color: var(--color-text); margin-bottom: 2px;
}
.cv-detail p { font-size: 0.87rem; color: var(--color-text-secondary); margin-bottom: 2px; }

/* ---- Teaching ---- */
.teaching-entry { padding: 18px 0; border-bottom: 1px solid var(--color-border-light); }
.teaching-entry:first-child { padding-top: 0; }
.teaching-entry:last-child { border-bottom: none; }
.teaching-role {
  font-size: 0.8rem; font-weight: 500;
  color: var(--color-accent);
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 3px;
}
.teaching-course {
  font-family: var(--font-display);
  font-size: 1.02rem; font-weight: 700;
  color: var(--color-text); margin-bottom: 3px;
}
.teaching-meta { font-size: 0.84rem; color: var(--color-text-muted); }

/* ---- Animations ---- */
.fade-in { opacity: 0; transform: translateY(10px); animation: fadeUp 0.45s ease forwards; }
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }
.fade-in:nth-child(1) { animation-delay: 0.04s; }
.fade-in:nth-child(2) { animation-delay: 0.1s; }
.fade-in:nth-child(3) { animation-delay: 0.16s; }
.fade-in:nth-child(4) { animation-delay: 0.22s; }
.fade-in:nth-child(5) { animation-delay: 0.28s; }
.fade-in:nth-child(6) { animation-delay: 0.34s; }
.fade-in:nth-child(7) { animation-delay: 0.40s; }
.fade-in:nth-child(8) { animation-delay: 0.46s; }

/* ---- Mobile ---- */
.mobile-header { display: none; }
.hamburger { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.hamburger svg { width: 24px; height: 24px; color: var(--color-text); }
.sidebar-overlay { display: none; }

@media (max-width: 900px) {
  .site-wrapper { flex-direction: column; }
  .sidebar {
    position: fixed; top: 0; left: -100%; width: 300px;
    min-height: 100vh; z-index: 1000;
    transition: left 0.3s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,0.08);
  }
  .sidebar.open { left: 0; }
  .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.25); z-index: 999; }
  .sidebar-overlay.open { display: block; }
  .mobile-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 20px; background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky; top: 0; z-index: 100;
  }
  .mobile-header .sidebar-name { margin-bottom: 0; font-size: 1.15rem; }
  .hamburger { display: flex; }
  .main-content { margin-left: 0; padding: 28px 22px 56px; }
  .cv-entry { grid-template-columns: 1fr; gap: 3px; }
}

@media (max-width: 480px) {
  .main-content { padding: 22px 16px 44px; }
  .page-title { font-size: 1.5rem; }
}
