/* ============================================================
   RESET
   ============================================================ */

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

a,
a:link,
a:visited {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

:root {
  --accent: #2563eb;
}

/* ============================================================
   BASE
   ============================================================ */

body {
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: #111;
  background: #fff;
  transition: background-color 0.4s ease-out, color 0.35s ease-out;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 56px 24px;
}

header {
  margin-bottom: 48px;
}

h1 {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.3px;
  margin-bottom: 12px;
  color: var(--accent);
}

h2 {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #666;
  margin-bottom: 20px;
}

.header-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

.header-links a {
  font-size: 13px;
  color: #888;
}

.header-links a:hover {
  color: #111;
  text-decoration: none;
}

.header-links a + a::before {
  content: '\00B7';
  margin: 0 8px;
  color: #ccc;
}

section {
  margin-bottom: 48px;
}

#about {
  padding-right: 160px;
}

#about h2 {
  display: none;
}

#papers h2 {
  margin-bottom: 16px;
}

#papers-list {
  border-top: 1px solid #e8e8e8;
  padding-top: 24px;
}

#papers .paper:first-child {
  border-top: none;
}

/* Tagline */
.tagline {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--accent);
  margin-bottom: 16px;
  hyphens: none;
}

#about-content {
  font-size: 15px;
  color: #444;
  line-height: 1.7;
}

#about-content p + p {
  margin-top: 12px;
}

/* Papers */
.paper {
  display: grid;
  grid-template-columns: 1fr 52px;
  gap: 0 20px;
  padding: 18px 0;
  border-bottom: 1px solid #e8e8e8;
}

.paper:first-child {
  border-top: 1px solid #e8e8e8;
}

.paper-main {
  min-width: 0;
}

.paper-title {
  font-size: 15px;
  font-weight: 500;
  color: #111;
  line-height: 1.4;
  display: block;
  margin-bottom: 5px;
}

.paper-title:hover {
  text-decoration: none;
}

a.paper-title {
  background-image: linear-gradient(to right, #d4ed4a, #93c5fd);
  background-size: 0% 100%;
  background-repeat: no-repeat;
  background-position: 0 0;
  transition: background-size 0.2s ease;
}

a.paper-title:hover { background-size: 100% 100%; }

::selection { background: rgba(191, 219, 254, 0.7); color: #111; }

.paper-title.no-link {
  cursor: default;
}

.paper-authors {
  font-size: 13px;
  color: #777;
  margin-bottom: 3px;
}

.paper-authors strong {
  color: var(--accent);
  font-weight: 500;
}

.paper-venue {
  font-size: 13px;
  color: #888;
  font-style: italic;
}

.paper-description {
  font-size: 13px;
  color: #666;
  line-height: 1.6;
  margin-top: 8px;
}

.paper-meta {
  text-align: right;
  padding-top: 2px;
}

.paper-year {
  font-size: 13px;
  color: #aaa;
}

/* ============================================================
   LIGHTBULB TOGGLE
   ============================================================ */

.header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.header-top h1 {
  margin-bottom: 0;
}

#dark-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  line-height: 1.45;
  user-select: none;
  transform-origin: top center;
  flex-shrink: 0;
}

.bulb-svg {
  display: block;
  color: inherit;
  transition: filter 0.3s ease;
}

/* No hover styling on the SVG itself — pixel art uses fill classes */
#dark-toggle:hover .bulb-svg {
  filter: none;
}

/* Sparkle dots */
.bulb-sparkles {
  transition: transform 0.35s ease;
  transform-origin: 22.5px 20px;
  animation: none;
}

body.dark .bulb-sparkles {
  opacity: 0;
}

/* Pixel art colors */
.px-o { fill: #b8860b; }
.px-i { fill: #ffd740; }
.px-h { fill: #fff9e0; }
.px-b { fill: #4a4848; }
.px-s { fill: #ffd740; }

body.dark .px-o { fill: #4a4a4a; }
body.dark .px-i { fill: #767676; }
body.dark .px-h { fill: #aaa; }
body.dark .px-b { fill: #2a2a2a; }
body.dark .px-s { opacity: 0; }

.pixel-bulb { image-rendering: pixelated; transform: scaleY(-1); }

/* Sparkle dots breathe in/out on hover (light mode only) */
@keyframes px-sparkle-move {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.15); }
}

body:not(.dark) #dark-toggle:hover .bulb-sparkles {
  animation: px-sparkle-move 2s ease-in-out infinite;
}

/* Dark mode: warm glow on dome on hover */
body.dark #dark-toggle:hover .px-dome {
  filter: drop-shadow(0 0 10px rgba(255, 200, 50, 0.55));
}

/* Pull-cord click animation */
@keyframes bulb-pull {
  0%   { transform: translateY(0px)  scaleY(1);    }
  18%  { transform: translateY(10px) scaleY(0.96); }
  40%  { transform: translateY(24px) scaleY(0.90); }
  58%  { transform: translateY(-6px) scaleY(1.06); }
  72%  { transform: translateY(5px)  scaleY(0.98); }
  84%  { transform: translateY(-2px) scaleY(1.01); }
  93%  { transform: translateY(1px)  scaleY(1);    }
  100% { transform: translateY(0px)  scaleY(1);    }
}

#dark-toggle.jiggling {
  animation: bulb-pull 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

/* ============================================================
   DARK MODE
   ============================================================ */

body.dark {
  --accent: #60a5fa;
  background: #111;
  color: #d4d4d4;
}

body.dark h2 { color: #444; }
body.dark .header-links a { color: #555; }
body.dark .header-links a:hover { color: #d4d4d4; }
body.dark .header-links a + a::before { color: #333; }
body.dark #about-content { color: #999; }
body.dark .paper { border-bottom-color: #222; }
body.dark #papers-list { border-top-color: #222; }
body.dark .paper-title { color: #d4d4d4; }
body.dark a.paper-title {
  background-image: none;
  transition: color 0.15s ease, text-shadow 0.15s ease;
}
body.dark a.paper-title:hover {
  color: #22d3ee;
  text-shadow: 0 0 12px rgba(34, 211, 238, 0.65), 0 0 30px rgba(34, 211, 238, 0.2);
}
body.dark .paper-authors { color: #555; }
body.dark .paper-venue { color: #555; }
body.dark .paper-description { color: #666; }
body.dark .paper-year { color: #444; }
body.dark ::selection { background: rgba(34, 211, 238, 0.2); color: #22d3ee; }

/* ============================================================
   FOOTER
   ============================================================ */

footer {
  display: flex;
  justify-content: center;
  padding: 32px 0 40px;
  font-size: 14px;
  color: #444;
}

body.dark footer {
  color: #333;
}

/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 560px) {
  #about {
    padding-right: 0;
  }

  .paper {
    grid-template-columns: 1fr;
  }

  .paper-meta {
    text-align: left;
    margin-top: 4px;
  }
}
