:root {
  --background: #90c2e8;
  --surface:
    repeating-linear-gradient(0deg,
      rgba(0, 0, 0, 0.15) 0px,
      rgba(0, 0, 0, 0.15) 1px,
      transparent 1px,
      transparent 2px),

    linear-gradient(180deg,
      #f2a9e9 0%,
      #e696db 12%,
      #d382bf 50%,
      #c85ca2 100%);

  --text: #010101;
  --muted: #985d19;
  --accent: #010101;
  --border: #010101;
  --max-width: 100%;
  --header-h: 84px;
}

@media (min-width: 640px) {
  :root {
    --header-h: 100px;
  }
}

* {
  box-sizing: border-box;
}

.surface {
  background: var(--surface);
}

.retro-yellow-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 16px;
  background: linear-gradient(180deg, #fff775 0%, #f6d968 50%, #f0c51c 100%);
  color: #1a1a1a !important;
  font-family: "Tahoma", "Courier New", monospace;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none !important;
  letter-spacing: 0.5px;

  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #806600;
  border-bottom: 2px solid #806600;
  border-radius: 15px;
  box-shadow: 1px 1px 0px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  user-select: none;
}

.retro-yellow-box:hover {
  filter: brightness(1.08);
  text-decoration: none !important;
}

.retro-yellow-box:active {
  border-top: 2px solid #806600;
  border-left: 2px solid #806600;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  transform: translate(1px, 1px);
}

.typewriter-box {
  display: inline-flex;
  align-items: center;
  font-family: "Courier New", Courier, monospace;
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  text-decoration: none !important;
  min-height: 28px;
  min-width: 270px;
}

.typewriter-box .prompt {
  color: #90c2e8;
  margin-right: 7px;
}

.typewriter-cursor {
  display: inline-block;
  font-weight: 900;
  margin-left: 2px;
  animation: retro-blink 0.8s steps(2, start) infinite;
}

@keyframes retro-blink {
  to {
    visibility: hidden;
  }
}

.desktop-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: flex-start;
  padding-top: 50px;
  position: fixed;
  left: 24px;
  top: 80px;
  z-index: 5;
}

.desktop-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 120px;
  padding: 6px 4px;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none !important;
  user-select: none;
  background: transparent;

}

.desktop-icon img {
  width: 84px;
  height: 84px;
  object-fit: contain;
  margin-bottom: 2px;
  filter: drop-shadow(1px 2px 2px rgba(0, 0, 0, 0.4));
}

.desktop-icon span {
  font-family: "Tahoma", "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: #ffffff;
  text-align: center;
  text-shadow: 1px 1px 2px #000000, 0 0 1px #000000;
  line-height: 1.2;
  word-break: break-word;
}

.desktop-icon:hover {
  background: rgba(49, 106, 197, 0.35);
  border: 1px dotted rgba(255, 255, 255, 0.6);
}

.desktop-icon:active {
  background: rgba(49, 106, 197, 0.7);
}

#icon-recycle {
  position: fixed;
  bottom: 90px;
  right: 24px;
  z-index: 5;
}


.desktop-workspace {
  position: relative;
  width: 100%;
  min-height: calc(100vh - 140px);
  display: flex;
  align-items: center;
}

.desktop-workspace .window {
  position: absolute;
  min-width: 340px;
  max-width: 90vw;
  z-index: 10;
  cursor: default;
}

.desktop-workspace .title-bar {
  cursor: move;
  touch-action: none;
}

.desktop-workspace .window.hidden {
  display: none !important;
}

.desktop-mascot {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1;
  pointer-events: none;
  user-select: none;
}

.mascot-img {
  width: 170px;
  height: auto;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.25));
  animation: mascot-breathe 2s ease-in-out infinite;
}


.mascot-bubble {
  position: relative;
  background: #ffffff;
  border: 2px solid #0055ea;
  border-radius: 12px;
  padding: 8px 14px;
  font-family: "Courier New", "Tahoma", monospace;
  font-size: 13px;
  font-weight: 700;
  color: #0b2367;
  box-shadow: 2px 3px 8px rgba(0, 0, 0, 0.2);
  margin-bottom: 8px;
  white-space: nowrap;
  animation: bubble-float 3s ease-in-out infinite;
}


.mascot-bubble::before {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 8px 7px 0 7px;
  border-style: solid;
  border-color: #0055ea transparent transparent transparent;
}

.mascot-bubble::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px 5px 0 5px;
  border-style: solid;
  border-color: #ffffff transparent transparent transparent;
}

@keyframes bubble-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes mascot-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;

  background-image: url('../images/background.png');
  background-position: center;
  background-size: cover; 
  background-repeat: no-repeat;

  opacity: 0.6;
}

body {
  margin: 0;
  padding-top: var(--header-h);
  min-height: 100vh;
  overflow-x: clip;
  display: flex;
  flex-direction: column;
  background: var(--background);
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.08) 1px, transparent 1px);
  background-size: 24px 24px;

  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

main {
  max-width: var(--max-width);
  margin: auto;
  padding: 0 24px;
  flex: 1;
  width: 100%;
}

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

a:hover {
  text-decoration: underline;
}

.recycle-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  background: #ffffff;
  border: 2px solid #7f9db9;
  padding: 12px;
  max-height: 400px;
  overflow-y: auto;
}

.photo-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 8px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.photo-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  border-color: #3b82f6;
  background: #f1f5f9;
}

.photo-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid #e2e8f0;
}

.photo-card span {
  font-family: "Tahoma", sans-serif;
  font-size: 11px;
  color: #334155;
  margin-top: 6px;
  text-align: center;
  word-break: break-all;
}



/* ---------- Blog & Research pages ---------- */

.paper {
  overflow-wrap: break-word;
  max-width: 720px;
  margin: 40px auto 60px auto;
  padding: 48px 56px;
  background: #fdfcf8;
  border: 1px solid var(--border);
  color: #1a1a1a;
  font-family: "EB Garamond", Garamond, Georgia, "Times New Roman", serif;
  font-size: 19px;
  line-height: 1.6;
}

.paper a {
  color: #1d3f8a;
}

.paper a:hover {
  text-decoration: underline;
}

.paper-heading,
.article-title {
  font-weight: 500;
  line-height: 1.2;
  margin: 0 0 8px 0;
}

.paper-heading {
  font-size: 2rem;
}

.paper-intro {
  margin: 0 0 32px 0;
  color: #555;
  font-style: italic;
}

.back-link {
  display: inline-block;
  margin-bottom: 24px;
  font-size: 0.9rem;
}

/* ---------- Index lists ---------- */

.entry-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.entry {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.entry-date {
  color: #777;
  font-size: 0.9rem;
  padding-top: 2px;
}

.entry-title {
  font-size: 1.1rem;
}

.entry-desc,
.entry-authors,
.entry-venue,
.entry-links {
  margin: 2px 0 0 0;
  font-size: 0.95rem;
}

.entry-desc,
.entry-venue {
  color: #555;
}

.entry-links {
  font-size: 0.9rem;
}

.entry-empty {
  color: #777;
  font-style: italic;
}

@media (max-width: 640px) {
  .paper {
    margin: 16px auto;
    padding: 28px 20px;
  }

  .entry {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

/* ---------- Single post / research page ---------- */

.article-header {
  margin-bottom: 32px;
}

.article-title {
  font-size: 2rem;
}

.article-authors {
  margin: 0 0 4px 0;
}

.article-meta {
  margin: 0;
  color: #666;
  font-size: 0.95rem;
}

.prose p {
  margin: 0 0 1em 0;
}

.prose h2,
.prose h3 {
  font-weight: 600;
  line-height: 1.3;
  margin: 1.8em 0 0.5em 0;
  scroll-margin-top: 120px; /* Offset for fixed navbar */
}

.prose h2 {
  font-size: 1.35rem;
}

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

.heading-anchor {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  opacity: 0;
  color: #a0aec0;
  transition: opacity 0.2s ease;
}

.heading-anchor svg {
  display: inline;
}

.prose h2:hover .heading-anchor,
.prose h3:hover .heading-anchor,
.heading-anchor:focus {
  opacity: 1;
}

.heading-anchor:hover {
  color: #3182ce;
}

.prose a {
  text-decoration: underline;
}

.prose ul,
.prose ol {
  margin: 0 0 1em 0;
  padding-left: 1.5em;
}

.prose ul {
  list-style: disc;
}

.prose ol {
  list-style: decimal;
}

.prose li {
  margin-bottom: 0.3em;
}

.prose li > ul,
.prose li > ol {
  margin: 0.3em 0 0 0;
}

.prose blockquote {
  margin: 1.4em 0;
  padding-left: 1em;
  border-left: 2px solid #ccc;
  color: #555;
  font-style: italic;
}

.prose img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.6em auto;
}

.prose code,
.prose pre {
  font-family: Menlo, Consolas, "Courier New", monospace;
  font-size: 0.8em;
}

.prose pre {
  margin: 1.4em 0;
  padding: 12px 16px;
  background: #f3f1ea;
  overflow-x: auto;
  line-height: 1.5;
}

.prose pre code {
  font-size: 1em;
}

.prose table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 1.4em 0;
  font-size: 0.9em;
}

.prose th,
.prose td {
  border-bottom: 1px solid #ddd;
  padding: 4px 12px 4px 0;
  text-align: left;
}

.prose th {
  font-weight: 600;
  border-bottom-color: #999;
}

.prose .references {
  font-size: 0.85rem;
}

.prose .references h3 {
  font-size: 0.95rem;
}

.prose hr {
  border: 0;
  border-top: 1px solid #ddd;
  margin: 2em 0;
}


body.blog-theme::before {
  display: none !important; 
}

body.blog-theme {
  background: #ffffff !important; 
  background-image: none !important;
}

.blog-theme main {
  max-width: 1400px;
  width: 100%;
}

.blog-container {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 40px;
  min-height: calc(100vh - 160px);
  padding: 20px 0;
}

.blog-sidebar {
  width: 280px;
  flex-shrink: 0;
  position: sticky;
  top: 120px;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  border-right: 1px solid #eaeaea;
  padding-right: 20px;
}

.blog-sidebar .sidebar-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 15px 0;
}

.blog-sidebar .sidebar-subtitle {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 10px 0;
  color: #555;
}

.blog-sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.blog-sidebar li {
  margin-bottom: 8px;
}

.blog-sidebar a {
  color: #444;
  text-decoration: none;
  font-size: 0.95rem;
  display: block;
  line-height: 1.4;
}

.blog-sidebar a:hover {
  color: #1d3f8a;
  text-decoration: underline;
}

.blog-sidebar a.active {
  color: #1d3f8a;
  font-weight: 600;
}

.blog-sidebar .home-link {
  color: #1d3f8a;
}

.blog-main-content {
  flex: 1;
  min-width: 0;
  max-width: 800px;
  margin: 0 auto;
}

.blog-theme .paper {
  max-width: 100% !important;
  margin: 0 !important;
  padding: 20px 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

@media (max-width: 850px) {
  .blog-container {
    flex-direction: column;
    align-items: stretch;
  }
  .blog-main-content {
    width: 100%;
  }
  .blog-sidebar {
    width: 100%;
    position: static;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid #eaeaea;
    padding-right: 0;
    padding-bottom: 20px;
    margin-bottom: 20px;
  }
}

/* ---------- Responsive ---------- */

.paper .retro-yellow-box {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.nav-toggle {
  min-width: 0;
  min-height: 0;
  padding: 4px 14px;
  font-size: 18px;
  line-height: 1.2;
}

@media (max-width: 1023px) {
  .nav-links {
    background: var(--surface);
    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
  }
}

@media (max-width: 360px) {
  .typewriter-box {
    min-width: 0;
    font-size: 13px;
  }
}

/* Home desktop: short laptop screens */
@media (min-width: 768px) and (max-height: 820px) {
  .desktop-grid {
    padding-top: 30px;
    gap: 8px;
  }

  .desktop-icon img {
    width: 64px;
    height: 64px;
  }

  .mascot-img {
    width: 140px;
  }
}

/* Home desktop: phones */
@media (max-width: 767px) {
  .desktop-workspace {
    flex-direction: column;
    justify-content: flex-start;
    gap: 24px;
    padding: 16px 0 120px;
  }

  .desktop-grid {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    padding-top: 0;
    gap: 8px;
  }

  .desktop-icon {
    width: 84px;
  }

  .desktop-icon img {
    width: 60px;
    height: 60px;
  }

  #icon-recycle {
    position: absolute;
    bottom: 8px;
    right: 0;
  }

  .desktop-mascot {
    position: static;
    transform: none;
    margin: auto 0;
  }

  .mascot-img {
    width: 130px;
  }

  .desktop-workspace .window {
    position: fixed;
    top: calc(var(--header-h) + 12px) !important;
    left: 12px !important;
    right: 12px;
    width: auto !important;
    min-width: 0;
    max-width: none !important;
    max-height: calc(100dvh - var(--header-h) - 24px);
    overflow-y: auto;
  }

  .desktop-workspace .title-bar {
    cursor: default;
  }

  .recycle-gallery {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    max-height: none;
  }

  .photo-card img {
    height: 100px;
  }
}

#nav-links .retro-yellow-box {
  white-space: nowrap;
}

/* ---------- Post repo link & comments ---------- */

.post-repo {
  margin: 12px 0 0 0;
  font-size: 0.95rem;
}

.post-repo a {
  text-decoration: underline;
}

.comments {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid #ddd;
}

.comments h2 {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0 0 0.5em 0;
}

.comments-note {
  color: #64748b;
  font-size: 0.95rem;
  margin: 0 0 1em 0;
}
