/* latin-ext */
@font-face {
  font-family: 'Lato';
  font-style: italic;
  font-weight: 400;
  src: local('Lato Italic'), local('Lato-Italic'), url(https://fonts.gstatic.com/s/lato/v15/S6u8w4BMUTPHjxsAUi-qNiXg7eU0.woff2) format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Lato';
  font-style: italic;
  font-weight: 400;
  src: local('Lato Italic'), local('Lato-Italic'), url(https://fonts.gstatic.com/s/lato/v15/S6u8w4BMUTPHjxsAXC-qNiXg7Q.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Lato';
  font-style: italic;
  font-weight: 700;
  src: local('Lato Bold Italic'), local('Lato-BoldItalic'), url(https://fonts.gstatic.com/s/lato/v15/S6u_w4BMUTPHjxsI5wq_FQftx9897sxZ.woff2) format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Lato';
  font-style: italic;
  font-weight: 700;
  src: local('Lato Bold Italic'), local('Lato-BoldItalic'), url(https://fonts.gstatic.com/s/lato/v15/S6u_w4BMUTPHjxsI5wq_Gwftx9897g.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 400;
  src: local('Lato Regular'), local('Lato-Regular'), url(https://fonts.gstatic.com/s/lato/v15/S6uyw4BMUTPHjxAwXiWtFCfQ7A.woff2) format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 400;
  src: local('Lato Regular'), local('Lato-Regular'), url(https://fonts.gstatic.com/s/lato/v15/S6uyw4BMUTPHjx4wXiWtFCc.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 700;
  src: local('Lato Bold'), local('Lato-Bold'), url(https://fonts.gstatic.com/s/lato/v15/S6u9w4BMUTPHh6UVSwaPGQ3q5d0N7w.woff2) format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 700;
  src: local('Lato Bold'), local('Lato-Bold'), url(https://fonts.gstatic.com/s/lato/v15/S6u9w4BMUTPHh6UVSwiPGQ3q5d0.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #fff;
  --text: #444;
  --text-strong: #333;
  --text-heading: #222;
  --text-muted: #494949;
  --link: #267cb9;
  --link-hover: #0d5a9e;
  --accent: #0d5a9e;
  --border: #e5e5e5;
  --sidebar-title: #494949;
  --toggle-bg: #e5e5e5;
  --toggle-knob: #fff;
}

[data-theme="dark"] {
  --bg: #1a1a2e;
  --text: #ccc;
  --text-strong: #ddd;
  --text-heading: #e8e8e8;
  --text-muted: #aaa;
  --link: #5ca8e0;
  --link-hover: #8ec5f0;
  --accent: #5ca8e0;
  --border: #333;
  --sidebar-title: #aaa;
  --toggle-bg: #444;
  --toggle-knob: #1a1a2e;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:focus,
a:hover {
  color: var(--link-hover);
  text-decoration: none;
}

body {
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  margin: 0;
  padding: 50px;
  transition: background-color 0.3s, color 0.3s;
}

body,
td,
th,
tr,
p,
a {
  font-family: 'Lato', Verdana, Helvetica, sans-serif;
  font-size: 14px;
}

strong {
  font-family: 'Lato', Verdana, Helvetica, sans-serif;
  font-size: 14px;
  color: var(--text-strong);
}

h2 {
  margin: 24px 0 12px;
  font-weight: normal;
  font-family: 'Lato', Verdana, Helvetica, sans-serif;
  font-size: 22px;
  color: var(--text-heading);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
}

.papertitle {
  font-family: 'Lato', Verdana, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--link);
}

em {
  color: var(--text-muted);
}

/* Dark mode toggle */
.theme-toggle {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.toggle-track {
  width: 40px;
  height: 22px;
  background: var(--toggle-bg);
  border-radius: 11px;
  position: relative;
  transition: background 0.3s;
}

.toggle-knob {
  width: 18px;
  height: 18px;
  background: var(--toggle-knob);
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.3s, background 0.3s;
}

[data-theme="dark"] .toggle-knob {
  transform: translateX(18px);
}

.toggle-label {
  font-size: 12px;
  color: var(--text-muted);
}

/* Layout */
.wrapper {
  max-width: 960px;
  margin: 0 auto;
}

.sidebar {
  width: 240px;
  float: left;
  position: fixed;
  height: calc(100vh - 100px);
}

.name {
  margin: 0 0 16px;
  font-family: 'Lato', Verdana, Helvetica, sans-serif;
  font-size: 28px;
  color: var(--text-heading);
  line-height: 1.1;
}

.profile-photo {
  width: 200px;
  max-width: 100%;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 16px;
}

.sidebar-title {
  color: var(--sidebar-title);
  margin: 0 0 16px;
  line-height: 1.5;
}

.sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-links a {
  display: block;
}

.content {
  width: 620px;
  float: right;
  padding-bottom: 50px;
}

.section-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 8px;
}

.section-table td {
  border: none;
}

.hover-rows tr {
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.hover-rows tr:hover {
  transform: translateX(6px);
  background-color: rgba(38, 124, 185, 0.04);
}

[data-theme="dark"] .hover-rows tr:hover {
  background-color: rgba(92, 168, 224, 0.06);
}

.pub-entry {
  padding: 8px 0;
  vertical-align: middle;
}

.code-link {
  font-size: 13px;
}

.code-link:not([href]),
.code-link[href=""] {
  display: none;
}

.sidebar-footer {
  position: absolute;
  bottom: 50px;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

.mobile-footer {
  display: none;
}

/* Responsive */
@media screen and (max-width: 960px) {
  .wrapper {
    width: auto;
  }
  .sidebar,
  .content {
    float: none;
    position: static;
    width: auto;
  }
  .sidebar {
    text-align: center;
    margin-bottom: 30px;
    height: auto;
  }
  .sidebar-links {
    flex-direction: row;
    justify-content: center;
    gap: 12px;
  }
  .theme-toggle {
    justify-content: center;
  }
  .sidebar-footer {
    position: static;
    display: none;
  }
  .name {
    font-size: 28px;
  }
  .profile-photo {
    width: 160px;
  }
  .mobile-footer {
    display: block;
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-top: 40px;
    padding-top: 16px;
  }
}

@media screen and (max-width: 480px) {
  body {
    padding: 20px;
  }
}
