body {
  font-family: 'Quattrocento Sans';
  margin: 10px;
  padding: 10px;
  background: url("old_mathematics.png")
}

main {
  padding-right: 0.6em;
}

h1 {
  font-family: 'Quattrocento';
}

nav {
  display: inline;
  position: static;
  height: auto;
  padding: 0;
  background: none;
  box-shadow: none;
  z-index: auto;
  transition: none;
  transform-style: flat;
}

.spiel {
  text-align: justify;
  text-justify: inter-word;
}

.headshot {
  opacity: 0.9;
  width: 200px;
  max-width: 100%;
}

.headshot-container {
  position: relative;
  display: inline-block;
}

.third-900:has(.headshot-container) {
  align-self: center;
}

.headshot-change-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(192, 192, 192, 0.9);
  border: 1px solid;
  border-color: #fff #808080 #808080 #fff;
  padding: 4px 8px;
  font-size: 16px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.headshot-change-btn:hover {
  opacity: 1;
}

.headshot-change-btn:active {
  border-color: #808080 #fff #fff #808080;
}

dl {
  margin: 0;
  padding: 0;
}

dt {
  display: inline;
  font-weight: bold;
}

dd {
  display: inline;
  margin: 0;
}

dd::after {
  display: block;
  content: "";
  margin-bottom: 6px;
}

/* Extended paper list styles */
.year-group {
  display: flex;
  border-top: 1px solid #000;
}

.year-group:last-child {
  border-bottom: 1px solid #000;
}

.year-label {
  width: 40px;
  min-width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid #000;
}

.year-label span {
  transform: rotate(-90deg);
  white-space: nowrap;
  font-family: 'Quattrocento', serif;
  font-weight: bold;
  font-size: 14px;
}

.year-papers {
  flex: 1;
  padding: 4px 0;
}

.year-papers ul {
  margin: 0;
  padding: 0;
}

.year-papers li {
  list-style-type: none;
  padding: 2px 8px;
}

.venue-divider {
  border: none;
  border-top: 1px dashed #000;
  margin: 4px 8px;
}

.venue-section {
  scroll-margin-top: 20px;
}

.venue-section.highlight {
  animation: highlight-flash 1.5s ease-out;
}

@keyframes highlight-flash {
  0% { background: rgba(80, 150, 220, 0.4); }
  100% { background: transparent; }
}

.email-graph {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0px;
}

/* Paper summary table styles */
.paper-summary-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 24px;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.6);
}

.paper-summary-table th,
.paper-summary-table td {
  padding: 4px 6px;
  text-align: center;
  border: 1px solid #ccc;
}

.paper-summary-table thead th {
  background: rgba(60, 60, 60, 0.85);
  color: #fff;
  font-family: 'Quattrocento', serif;
  font-weight: bold;
}

.paper-summary-table tbody tr:nth-child(even) {
  background: rgba(240, 240, 240, 0.5);
}

.paper-summary-table tbody tr:hover {
  background: rgba(200, 220, 255, 0.5);
}

.paper-summary-table .venue-cell {
  text-align: left;
  font-weight: bold;
  white-space: nowrap;
  background: rgba(80, 80, 80, 0.1);
  min-width: 120px;
  padding-right: 16px;
}

.paper-summary-table .has-papers {
  background: rgba(100, 180, 100, 0.25);
  font-weight: bold;
}

.paper-summary-table .clickable-cell:hover {
  background: rgba(80, 150, 220, 0.5);
  text-decoration: underline;
}

.paper-summary-table .total-col {
  background: rgba(60, 60, 60, 0.1);
  font-weight: bold;
  border-left: 2px solid #666;
}

.paper-summary-table thead .total-col {
  background: rgba(60, 60, 60, 0.85);
  border-left: 2px solid #999;
}

.paper-summary-table tfoot td {
  background: rgba(60, 60, 60, 0.85);
  color: #fff;
  font-weight: bold;
  border-top: 2px solid #666;
}

.paper-summary-table tfoot .grand-total {
  background: rgba(40, 40, 40, 0.95);
  font-size: 14px;
}

.paper-summary-table .footer-label-cell {
  text-align: right;
  white-space: nowrap;
  padding-right: 8px;
}

.toggle-switch {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  font-size: 12px;
  font-weight: normal;
  gap: 6px;
}

.toggle-switch input {
  display: none;
}

.toggle-text {
  color: #fff;
}

.toggle-slider {
  width: 32px;
  height: 18px;
  background: #666;
  border-radius: 9px;
  position: relative;
  transition: background 0.2s;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
  background: #4a4;
}

.toggle-switch input:checked + .toggle-slider::after {
  transform: translateX(14px);
}

/* Dark mode */
.dark-mode {
  color: #e0e0e0;
  background: none;
}

.dark-mode::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("old_mathematics.png");
  filter: invert(1) sepia(0.1) saturate(6) hue-rotate(200deg);
  z-index: -1;
}


.dark-mode h1, .dark-mode h2, .dark-mode h3 {
  color: #fff;
}

.dark-mode a {
  color: #6dd5ed;
}

.dark-mode a:hover {
  color: #c6ffdd;
}

.dark-mode .paper-summary-table {
  background: rgba(30, 30, 50, 0.9);
}

.dark-mode .paper-summary-table tbody tr:nth-child(even) {
  background: rgba(50, 50, 70, 0.5);
}

.dark-mode .paper-summary-table tbody tr:hover {
  background: rgba(80, 100, 140, 0.5);
}

.dark-mode .paper-summary-table .venue-cell {
  background: rgba(60, 60, 80, 0.5);
}

.dark-mode .year-group {
  border-color: #444;
}

.dark-mode .year-label {
  border-color: #444;
}

.dark-mode .venue-divider {
  border-color: #444;
}

.dark-mode .headshot {
  opacity: 0.85;
}

.dark-mode #email-graph {
  filter: invert(1) hue-rotate(180deg);
}

body.matrix-mode #email-graph {
  filter: invert(1) sepia(1) saturate(20) hue-rotate(70deg) brightness(0.8);
}

/* Dark mode toggle button */
#name-div {
  position: relative;
}

#dark-toggle {
  position: absolute;
  top: 0;
  right: 0;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
  padding: 4px;
  color: #333;
}

#dark-toggle:hover {
  opacity: 1;
}

.dark-mode #dark-toggle {
  color: #ffd700;
}
