/* ==========================================================================
   Raw Terminal/Retro Aesthetic
   ========================================================================== */

:root {
  --bg: #0d1117;
  --bg-alt: #161b22;
  --text: #c9d1d9;
  --text-dim: #8b949e;
  --accent: #58a6ff;
  --accent-hover: #79c0ff;
  --accent-alt: #7ee787;
  --border: #30363d;
}

/* Light mode */
body.light-mode {
  --bg: #f5f5f5;
  --bg-alt: #ffffff;
  --text: #24292f;
  --text-dim: #57606a;
  --accent: #0969da;
  --accent-hover: #0550ae;
  --accent-alt: #1a7f37;
  --border: #d0d7de;
}

body.light-mode .ascii-name {
  color: var(--accent);
}

body.light-mode .profile-photo {
  filter: grayscale(10%);
}

body.light-mode .profile-photo:hover {
  filter: grayscale(0%);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'IBM Plex Mono', 'Consolas', 'Monaco', monospace;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
}

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ==========================================================================
   Header & ASCII Art
   ========================================================================== */

.site-header {
  margin-bottom: 3rem;
}

.ascii-name {
  font-size: 0.5rem;
  line-height: 1.1;
  color: var(--accent);
  margin-bottom: 1.5rem;
  overflow-x: auto;
  user-select: none;
}

@media (min-width: 640px) {
  .ascii-name {
    font-size: 0.65rem;
  }
}

/* ==========================================================================
   Navigation
   ========================================================================== */

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.site-nav a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.15s ease;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--accent);
}

.site-nav a.active::before {
  content: '>';
  margin-right: 0.25rem;
}

.theme-toggle {
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  padding: 0;
  margin-left: auto;
  transition: color 0.15s ease;
}

.theme-toggle:hover {
  color: var(--accent);
}

@media (max-width: 540px) {
  .theme-toggle {
    margin-left: 0;
  }
}

/* ==========================================================================
   Content
   ========================================================================== */

.content {
  min-height: 50vh;
}

.content h1,
.content h2,
.content h3,
.content h4,
.content h5,
.content h6 {
  color: var(--text);
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.content h1 {
  font-size: 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.content h2 {
  font-size: 1.25rem;
  color: var(--accent-alt);
}

.content h2::before {
  content: '## ';
  color: var(--text-dim);
}

.content h3 {
  font-size: 1.1rem;
}

.content p {
  margin-bottom: 1rem;
}

.content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.content a:hover {
  color: var(--accent-hover);
}

.content strong {
  color: var(--text);
  font-weight: 600;
}

.content em {
  font-style: italic;
}

/* Lists */
.content ul,
.content ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.content li {
  margin-bottom: 0.5rem;
}

.content li::marker {
  color: var(--text-dim);
}

/* Horizontal rule */
.content hr {
  border: none;
  border-top: 1px dashed var(--border);
  margin: 2rem 0;
}

/* Code */
.content code {
  font-family: inherit;
  background: var(--bg-alt);
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
  font-size: 0.9em;
}

.content pre {
  background: var(--bg-alt);
  padding: 1rem;
  overflow-x: auto;
  margin-bottom: 1rem;
  border-left: 3px solid var(--accent);
}

.content pre code {
  padding: 0;
  background: none;
}

/* Blockquote */
.content blockquote {
  border-left: 3px solid var(--text-dim);
  padding-left: 1rem;
  color: var(--text-dim);
  font-style: italic;
  margin-bottom: 1rem;
}

/* ==========================================================================
   Page-specific: About/Home
   ========================================================================== */

.intro-section {
  margin-bottom: 2rem;
}

.intro-section::after {
  content: '';
  display: table;
  clear: both;
}

.profile-photo {
  float: right;
  max-width: 280px;
  height: auto;
  margin: 0 0 1rem 1.5rem;
  filter: grayscale(15%);
  transition: filter 0.3s ease;
}

.profile-photo:hover {
  filter: grayscale(0%);
}

@media (max-width: 540px) {
  .profile-photo {
    float: none;
    display: block;
    max-width: 100%;
    margin: 0 auto 1.5rem auto;
  }
}

.status-line {
  color: var(--text-dim);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.status-line .blink {
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Paper/Publication styling */
.paper {
  margin-bottom: 1.5rem;
  padding-left: 1rem;
  border-left: 2px solid var(--border);
}

.paper:hover {
  border-left-color: var(--accent);
}

.paper.award {
  border-left-color: #ffd700;
}

.paper.award .paper-venue {
  color: #ffd700;
}

.paper-title {
  font-weight: 600;
  color: var(--text);
}

.paper-authors {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.paper-venue {
  color: var(--accent-alt);
  font-size: 0.85rem;
}

/* News scroll */
.news-scroll {
  max-height: 180px;
  overflow-y: auto;
  padding-right: 0.5rem;
  border: 1px solid var(--border);
  padding: 1rem;
  background: var(--bg-alt);
}

.news-scroll::-webkit-scrollbar {
  width: 6px;
}

.news-scroll::-webkit-scrollbar-track {
  background: var(--bg);
}

.news-scroll::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.news-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

/* News items */
.news-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px dashed var(--border);
}

.news-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.news-date {
  color: var(--accent);
  white-space: nowrap;
  min-width: 70px;
  font-weight: 600;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  margin-top: 4rem;
  padding-top: 1rem;
}

.footer-line {
  height: 1px;
  background: linear-gradient(90deg, var(--accent), var(--accent-alt), var(--border));
  margin-bottom: 1rem;
}

.site-footer p {
  color: var(--text-dim);
  font-size: 0.8rem;
}

.site-footer a {
  color: var(--text-dim);
  text-decoration: underline;
}

.site-footer a:hover {
  color: var(--accent);
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.text-dim {
  color: var(--text-dim);
}

.text-accent {
  color: var(--accent);
}

.mt-2 {
  margin-top: 2rem;
}

.mb-2 {
  margin-bottom: 2rem;
}

/* Selection */
::selection {
  background: var(--accent);
  color: var(--bg);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 480px) {
  html {
    font-size: 14px;
  }

  .container {
    padding: 1rem;
  }

  .ascii-name {
    font-size: 0.35rem;
  }
}
