/* ============================================
   milo Homepage
   Warm minimal academic homepage template
   ============================================ */

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
}

body.theme-milo,
body.theme-milo *,
body.theme-milo *::before,
body.theme-milo *::after {
  box-sizing: border-box;
}

:root {
  --milo-bg: #faf9f7;
  --milo-text: #3d3929;
  --milo-accent: #c2714f;
  --milo-secondary: #8c8577;
  --milo-muted: var(--milo-secondary);
  --milo-border: rgba(194, 113, 79, 0.2);
  --milo-shadow: rgba(194, 113, 79, 0.15);
  --milo-social-bg: #ffffff;
  --milo-social-text: #8b7355;
  --milo-footer-border: rgba(194, 113, 79, 0.15);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --milo-bg: #1a1917;
    --milo-text: #d1cec7;
    --milo-accent: #e28a67;
    --milo-secondary: #9b9488;
    --milo-muted: var(--milo-secondary);
    --milo-border: rgba(226, 138, 103, 0.2);
    --milo-shadow: rgba(0, 0, 0, 0.3);
    --milo-social-bg: #22211e;
    --milo-social-text: #d1cec7;
    --milo-footer-border: rgba(226, 138, 103, 0.15);
  }
}

[data-theme="dark"] {
  --milo-bg: #1a1917;
  --milo-text: #d1cec7;
  --milo-accent: #e28a67;
  --milo-secondary: #9b9488;
  --milo-muted: var(--milo-secondary);
  --milo-border: rgba(226, 138, 103, 0.2);
  --milo-shadow: rgba(0, 0, 0, 0.3);
  --milo-social-bg: #22211e;
  --milo-social-text: #d1cec7;
  --milo-footer-border: rgba(226, 138, 103, 0.15);
}

[data-theme="light"] {
  --milo-bg: #faf9f7;
  --milo-text: #3d3929;
  --milo-accent: #c2714f;
  --milo-secondary: #8c8577;
  --milo-muted: var(--milo-secondary);
  --milo-border: rgba(194, 113, 79, 0.2);
  --milo-shadow: rgba(194, 113, 79, 0.15);
  --milo-social-bg: #ffffff;
  --milo-social-text: #8b7355;
  --milo-footer-border: rgba(194, 113, 79, 0.15);
}

body.theme-milo {
  background: var(--milo-bg);
  color: var(--milo-text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body.theme-milo a {
  color: var(--milo-accent);
  text-decoration: none;
}

body.theme-milo a:hover {
  filter: brightness(1.15);
}

body.theme-milo .top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--milo-bg);
  border-bottom: 1px solid var(--milo-footer-border);
  z-index: 1000;
}

body.theme-milo .nav-container {
  width: 100%;
  max-width: 1120px;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

body.theme-milo .nav-left a {
  color: var(--milo-text);
  font-size: 18px;
  font-weight: 600;
}

body.theme-milo .theme-toggle {
  border: none;
  background: transparent;
  color: var(--milo-text);
  width: 40px;
  height: 40px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 18px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

body.theme-milo .theme-toggle:hover {
  background: var(--milo-border);
  color: var(--milo-accent);
}

body.theme-milo .wrapper {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  min-height: 100vh;
}

body.theme-milo .sidebar {
  width: 320px;
  flex-shrink: 0;
  position: fixed;
  top: 60px;
  left: calc(50% - 560px);
  height: calc(100vh - 60px);
  overflow-y: auto;
  text-align: center;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding-top: 60px;
  z-index: 100;
}

body.theme-milo .profile-card {
  width: 100%;
  padding: 0 20px;
  text-align: center;
}

body.theme-milo .image.avatar {
  display: block;
  margin: 0 auto 28px;
}

body.theme-milo .image.avatar img {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 6px 24px var(--milo-shadow);
}

body.theme-milo .site-name {
  margin: 0 0 8px;
  color: var(--milo-text);
  font-size: 28px;
  line-height: 1.2;
}

body.theme-milo .site-email {
  margin: 0 0 24px;
  color: var(--milo-secondary);
  font-size: 13px;
  font-family: "Ubuntu Mono", "SFMono-Regular", monospace;
  word-break: break-all;
}

body.theme-milo .social-icons {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

body.theme-milo .social-icons a {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--milo-social-bg);
  color: var(--milo-social-text) !important;
  box-shadow: 0 2px 8px rgba(61, 57, 41, 0.08);
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

body.theme-milo .social-icons a:hover {
  background: var(--milo-accent);
  color: #fff !important;
  transform: translateY(-2px);
}

body.theme-milo .visitor-card {
  margin: 40px auto 0;
  width: 240px;
  padding: 18px 16px;
  border: 1px dashed var(--milo-border);
  border-radius: 14px;
  color: var(--milo-secondary);
  text-align: left;
}

body.theme-milo .visitor-card-title {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--milo-accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

body.theme-milo .visitor-card-body {
  font-size: 13px;
  line-height: 1.6;
}

body.theme-milo .content {
  flex: 1;
  min-width: 0;
  margin-left: 320px;
  padding: 120px 40px 80px 60px;
}

body.theme-milo .section {
  margin-bottom: 44px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

body.theme-milo .section.visible {
  opacity: 1;
  transform: translateY(0);
}

body.theme-milo .section-title {
  display: inline-block;
  margin: 0 0 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--milo-accent);
  color: var(--milo-accent);
  font-size: 19px;
  font-weight: 600;
}

body.theme-milo .section-body p {
  margin: 0 0 14px;
}

body.theme-milo .card {
  background: transparent;
  padding: 0;
  box-shadow: none;
}

body.theme-milo .timeline-item {
  position: relative;
  margin-left: 20px;
  padding-left: 8px;
  padding-bottom: 20px;
}

body.theme-milo .timeline-item::before {
  content: "";
  position: absolute;
  left: -20px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--milo-accent), rgba(194, 113, 79, 0.12));
}

body.theme-milo .timeline-item:last-child::before {
  bottom: 50%;
}

body.theme-milo .timeline-item::after {
  content: "";
  position: absolute;
  left: -25px;
  top: 22px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--milo-accent);
  border: 2px solid var(--milo-bg);
}

body.theme-milo .experience-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

body.theme-milo .institution-logo {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}

body.theme-milo .experience-content {
  flex: 1;
}

body.theme-milo .experience-content p {
  margin: 0 0 2px;
}

body.theme-milo .exp-title {
  font-size: 15px;
  color: var(--milo-text);
}

body.theme-milo .exp-detail {
  font-size: 14px;
  color: var(--milo-secondary);
}

body.theme-milo .exp-period {
  font-size: 13px;
  color: var(--milo-accent);
  font-weight: 500;
}

body.theme-milo .project-card {
  font-size: 15px;
  line-height: 1.7;
}

body.theme-milo .publications ol.bibliography {
  list-style: none;
  padding: 0;
  margin: 0;
}

body.theme-milo .publications ol.bibliography li {
  margin-bottom: 14px;
  padding: 15px 0 15px 16px;
  border-left: 3px solid var(--milo-accent);
}

body.theme-milo .pub-content .title {
  margin-bottom: 4px;
  color: var(--milo-text);
  font-size: 15px;
  font-weight: 600;
}

body.theme-milo .pub-content .author {
  margin-bottom: 4px;
  color: var(--milo-secondary);
  font-size: 14px;
}

body.theme-milo .pub-content .periodical {
  margin-bottom: 6px;
  color: var(--milo-accent);
  font-size: 14px;
}

body.theme-milo .pub-content .links a {
  font-size: 13px;
  font-weight: 500;
}

body.theme-milo .awards-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

body.theme-milo .award-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}

body.theme-milo .award-icon {
  flex-shrink: 0;
  font-size: 20px;
}

body.theme-milo .award-text {
  color: var(--milo-text);
  font-size: 14px;
}

body.theme-milo .site-footer {
  width: 100%;
  flex-basis: 100%;
  padding: 32px 24px 40px 380px;
  text-align: center;
}

body.theme-milo .site-footer p {
  margin: 0;
  padding-top: 20px;
  border-top: 1px solid var(--milo-footer-border);
  color: var(--milo-secondary);
  font-size: 13px;
}

body.theme-milo .template-credit {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
}

body.theme-milo h1,
body.theme-milo h2,
body.theme-milo h3,
body.theme-milo h4,
body.theme-milo strong {
  color: var(--milo-text);
}

@media (max-width: 1080px) {
  body.theme-milo .nav-container {
    padding: 0 20px;
  }

  body.theme-milo .wrapper {
    flex-direction: column;
    padding: 0 20px;
  }

  body.theme-milo .sidebar {
    position: static;
    left: auto;
    width: 100%;
    height: auto;
    padding-top: 80px;
    overflow: visible;
  }

  body.theme-milo .profile-card {
    padding: 0;
  }

  body.theme-milo .content {
    margin-left: 0;
    padding: 32px 0 48px;
  }

  body.theme-milo .site-footer {
    padding: 32px 0;
  }

  body.theme-milo .site-footer p {
    padding-top: 0;
    border-top: none;
  }
}

@media (max-width: 640px) {
  body.theme-milo .image.avatar img {
    width: 148px;
    height: 148px;
  }

  body.theme-milo .site-name {
    font-size: 24px;
  }

  body.theme-milo .experience-item {
    gap: 12px;
  }

  body.theme-milo .institution-logo {
    width: 44px;
    height: 44px;
  }

  body.theme-milo .visitor-card {
    width: 100%;
    max-width: 280px;
  }
}

@media (max-width: 480px) {
  body.theme-milo .section {
    margin-bottom: 32px;
  }

  body.theme-milo .section-title {
    font-size: 18px;
  }

  body.theme-milo .project-card,
  body.theme-milo .exp-detail,
  body.theme-milo .award-text,
  body.theme-milo .pub-content .author,
  body.theme-milo .pub-content .periodical {
    font-size: 13px;
  }
}
.project-entry {
  border-left: 3px solid #c96f45;
  padding-left: 18px;
  margin-bottom: 22px;
}

.project-entry p {
  margin: 0 0 10px 0;
}

.project-entry p:last-child {
  margin-bottom: 0;
}
.opportunity-box {
  margin: 18px 0 18px;
  padding: 14px 18px;
  border-left: 3px solid #c96f45;
  border-radius: 10px;
  background: #f7eee9;
  line-height: 1.7;
}

.opportunity-box strong {
  color: #c96f45;
}

.cv-link {
  margin-top: 12px;
  font-size: 1rem;
}

.cv-link a {
  color: #c96f45;
  font-weight: 700;
}
/* ===== Milo Tang Sky Blue Theme Override ===== */

:root {
  --milo-sky: #38bdf8;
  --milo-sky-dark: #0284c7;
  --milo-sky-deep: #0369a1;
  --milo-sky-light: #f0f9ff;
  --milo-sky-border: #bae6fd;
}

/* Main accent colour */
.section-title,
.visitor-card-title,
.cv-link a,
.opportunity-box strong,
.exp-period,
.template-credit a,
.site-footer a {
  color: var(--milo-sky-dark) !important;
}

/* Section title underline */
.section-title {
  border-color: var(--milo-sky) !important;
}

/* Links */
a {
  color: var(--milo-sky-dark);
}

a:hover {
  color: var(--milo-sky-deep);
}

/* Social icons */
.social-icons a:hover {
  color: var(--milo-sky-dark) !important;
  border-color: var(--milo-sky-border) !important;
  background: var(--milo-sky-light) !important;
}

/* Visitor card */
.visitor-card {
  border-color: var(--milo-sky-border) !important;
  background: rgba(240, 249, 255, 0.55) !important;
}

/* Open to opportunities box */
.opportunity-box {
  margin: 18px 0 18px;
  padding: 14px 18px;
  border-left: 3px solid var(--milo-sky);
  border-radius: 10px;
  background: var(--milo-sky-light);
  line-height: 1.7;
}

.opportunity-box strong {
  color: var(--milo-sky-dark) !important;
}

.cv-link {
  margin-top: 12px;
  font-size: 1rem;
}

.cv-link a {
  color: var(--milo-sky-dark) !important;
  font-weight: 700;
}

/* Project vertical line */
.project-entry {
  position: relative;
  margin-left: 20px;
  margin-bottom: 0;
  padding-left: 8px;
  padding-bottom: 26px;
  border-left: none;
}

.project-entry::before {
  content: "";
  position: absolute;
  left: -20px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--milo-sky);
}

.project-entry:last-child::before {
  bottom: 50%;
}

.project-entry::after {
  content: "";
  position: absolute;
  left: -25px;
  top: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--milo-sky);
  border: 2px solid var(--milo-sky);
}

.project-entry p {
  margin: 0 0 10px 0;
}

.project-entry p:last-child {
  margin-bottom: 0;
}

body.theme-milo #skills .awards-grid {
  gap: 0;
}

body.theme-milo #skills .award-item {
  position: relative;
  align-items: flex-start;
  margin-left: 20px;
  padding: 4px 0 18px 8px;
}

body.theme-milo #skills .award-item::before {
  content: "";
  position: absolute;
  left: -20px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--milo-sky);
}

body.theme-milo #skills .award-item:last-child::before {
  bottom: 50%;
}

body.theme-milo #skills .award-item::after {
  content: "";
  position: absolute;
  left: -25px;
  top: 10px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--milo-sky);
  border: 2px solid var(--milo-sky);
}

/* Timeline vertical line / dots */
.timeline-item {
  border-color: var(--milo-sky) !important;
}

.timeline-item::before,
.timeline-item::after {
  background: var(--milo-sky) !important;
  border-color: var(--milo-sky) !important;
}
/* ===== Theme toggle: icon only, blue on hover ===== */

/* Default light mode: icon only */
.theme-toggle {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: #3f3a32 !important;
  width: 34px !important;
  height: 34px !important;
  border-radius: 50% !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.theme-toggle i {
  color: #3f3a32 !important;
  transition: color 0.18s ease;
}

/* Light mode hover: only then turns blue */
.theme-toggle:hover {
  background: #e0f2fe !important;
  color: #0284c7 !important;
  transform: translateY(-1px);
}

.theme-toggle:hover i {
  color: #0284c7 !important;
}

/* Dark mode: icon only, no blue by default */
[data-theme="dark"] .theme-toggle {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: #e5e7eb !important;
}

[data-theme="dark"] .theme-toggle i {
  color: #e5e7eb !important;
}

/* Dark mode hover: turns blue */
[data-theme="dark"] .theme-toggle:hover {
  background: rgba(56, 189, 248, 0.14) !important;
  color: #7dd3fc !important;
}

[data-theme="dark"] .theme-toggle:hover i {
  color: #7dd3fc !important;
}
/* ===== Refined Visitor Map Card ===== */

.visitor-card {
  margin-top: 28px;
  padding: 16px 16px 18px;
  border: 1px solid rgba(125, 211, 252, 0.55) !important;
  border-radius: 18px !important;
  background: rgba(240, 249, 255, 0.48) !important;
  box-shadow: 0 12px 30px rgba(2, 132, 199, 0.06);
  text-align: center;
}

.visitor-card-title {
  margin-bottom: 12px;
  color: #0284c7 !important;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.visitor-card-body {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 12px;
}

.visitor-card-body img,
.visitor-card-body iframe,
.visitor-card-body canvas {
  max-width: 100% !important;
  border-radius: 10px;
}

/* Dark mode */
[data-theme="dark"] .visitor-card {
  background: rgba(15, 23, 42, 0.45) !important;
  border-color: rgba(125, 211, 252, 0.25) !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
}

[data-theme="dark"] .visitor-card-title {
  color: #7dd3fc !important;
}
/* ===== Project GitHub link ===== */

body.theme-milo .project-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #0284c7 !important;
  font-weight: 600;
  text-decoration: none;
}

body.theme-milo .project-links a:hover {
  color: #0369a1 !important;
  text-decoration: underline;
}

[data-theme="dark"] body.theme-milo .project-links a,
[data-theme="dark"] .project-links a {
  color: #7dd3fc !important;
}

[data-theme="dark"] body.theme-milo .project-links a:hover,
[data-theme="dark"] .project-links a:hover {
  color: #38bdf8 !important;
}
/* ===== Top navigation language switch ===== */

body.theme-milo .nav-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

body.theme-milo .nav-left a {
  font-size: 14px !important;
  font-weight: 600;
}

body.theme-milo .nav-home {
  color: var(--milo-text);
}

body.theme-milo .nav-divider {
  color: var(--milo-muted);
  font-size: 13px;
}

body.theme-milo .lang-switch {
  color: #0284c7 !important;
  font-size: 13px !important;
  font-weight: 600;
  text-decoration: none;
}

body.theme-milo .lang-switch:hover {
  color: #0369a1 !important;
  text-decoration: underline;
}

[data-theme="dark"] body.theme-milo .lang-switch {
  color: #7dd3fc !important;
}

[data-theme="dark"] body.theme-milo .lang-switch:hover {
  color: #38bdf8 !important;
}
