:root{
  --bg:#0f1115; --muted:#97a0af; --fg:#e6e9ef; --ink:#fff;
  --link:#86bafc; --card:#171923; --border:#23283b; --accent:#cfcfe6;
  --cyan: #00aadd; --cyan-dim: #0088bb;
  --violet: #aa88dd; --violet-dim: #8866bb;
  --amber: #ddaa00; --amber-dim: #bb8800;
  --radius:14px; --pad:20px; --max:840px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0; font-family:'Inter',system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  background:var(--bg); color:var(--fg); line-height:1.6;
}

.byline {
  margin: -8px 0 12px 0;
  font-style: italic;
  color: var(--amber);
  font-weight: 500;
}

a{color:var(--cyan); text-decoration:none; transition: color 0.2s ease}
a:hover{text-decoration:underline; color: var(--cyan-dim)}

/* Different link colors for different contexts */
.post-body a{color: var(--violet)}
.post-body a:hover{color: var(--violet-dim)}

.tag{
  margin-left:4px; 
  color: var(--amber); 
  padding: 2px 6px; 
  background: rgba(221, 170, 0, 0.1);
  border-radius: 4px;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}
.tag:hover{
  background: rgba(221, 170, 0, 0.2);
  color: var(--amber-dim);
}

.muted{color:var(--muted)}
.small{font-size:0.9rem}
.date{margin-left:8px; color: var(--violet); font-weight: 500}
.site{display:flex; flex-direction:column}
.site-header, .site-footer{max-width:var(--max); margin:0 auto; width:100%; padding:10px var(--pad)}
.site-main{max-width:var(--max); margin:0 auto; width:100%; padding:20px var(--pad) 60px}

.socials {
  display: flex;
  align-items: center;
}

.socials a {
  margin-left: 12px;
  color: var(--muted);
  display: inline-block;
  width: 18px;
  height: 18px;
  transition: all 0.2s ease;
}

.socials a:hover {
  color: var(--cyan);
  transform: translateY(-1px);
}

.socials svg {
  width: 18px;
  height: 18px;
  opacity: 0.7;
  transition: opacity 0.2s;
  display: block;
}

.socials svg:hover {
  opacity: 1;
}

.nav{display:flex; align-items:center; gap:12px}
.nav .logo{
  font-weight:600; 
  color:var(--accent); 
  padding:6px 10px; 
  border:1px solid var(--border); 
  border-radius:999px;
  transition: all 0.3s ease;
  background: linear-gradient(135deg, rgba(0, 170, 221, 0.05), rgba(170, 136, 221, 0.05));
}
.nav .logo:hover{
  border-color: var(--cyan);
  color: var(--cyan);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 170, 221, 0.15);
}

.nav ul{display:flex; gap:14px; list-style:none; padding:0; margin:0}
.nav a{
  transition: all 0.2s ease;
  padding: 4px 8px;
  border-radius: 6px;
}
.nav a:hover{
  background: rgba(0, 170, 221, 0.1);
  text-decoration: none;
}
.nav a.active{
  color:var(--amber); 
  font-weight:600;
  background: rgba(221, 170, 0, 0.1);
}
.nav .spacer{flex:1}

.hero{padding:10px 0 20px}
.hero h1{
  margin:0 0 6px 0; 
  font-size:1.6rem;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% 200%;
  animation: gradientShift 6s ease-in-out infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero p:last-child{
  color: var(--muted);
  font-style: italic;
}

/* Replace the existing .post-list li:hover and .post-list li:before rules with these: */

.post-list li:before{
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--cyan);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.post-list li:hover{
  border-color: var(--cyan);
  /* Removed: transform: translateY(-2px); */
  /* Removed: box-shadow: 0 8px 25px rgba(0, 170, 221, 0.1); */
}

.post-list li:hover:before{
  opacity: 1;
}

/* Optional: If you want the link text to also change color on hover */
.post-list li:hover a{
  color: var(--cyan);
}
.post h1{
  margin:0 0 8px;
  color: var(--fg);
}
.post-body img{
  max-width:100%; 
  border-radius:10px;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}
.post-body img:hover{
  border-color: var(--cyan);
  box-shadow: 0 4px 20px rgba(0, 170, 221, 0.15);
}

.post-body h1, .post-body h2, .post-body h3{
  color: var(--cyan);
  position: relative;
}

.post-body h2:before{
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 30px;
  height: 2px;
  background: var(--amber);
  border-radius: 1px;
}

.post-body code{
  background: rgba(170, 136, 221, 0.1);
  color: var(--violet);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Monaco', 'Menlo', monospace;
}

.post-body blockquote{
  border-left: 3px solid var(--amber);
  margin: 20px 0;
  padding: 10px 20px;
  background: rgba(221, 170, 0, 0.05);
  border-radius: 0 8px 8px 0;
  font-style: italic;
}

.site-footer{
  color:var(--muted); 
  border-top:1px solid var(--border);
  text-align: center;
}

/* Reading list and project page enhancements */
h1{
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

h2{
  color: var(--amber);
  border-bottom: 1px solid rgba(221, 170, 0, 0.2);
  padding-bottom: 8px;
}

h3{
  color: var(--violet);
}

/* Special styling for favorite items (🪐) */
li:has(em:contains("🪐")){
  position: relative;
}

ul li{
  padding: 8px 0;
  border-bottom: 1px solid rgba(35, 40, 59, 0.5);
  transition: all 0.2s ease;
}

ul li:hover{
  padding-left: 8px;
  border-left: 2px solid var(--cyan);
}

/* Responsive design */
@media (max-width: 768px) {
  .nav{
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .nav ul{
    gap: 10px;
  }
  
  .hero h1{
    font-size: 1.4rem;
  }
  
  .socials a{
    margin-left: 8px;
  }
}


/* MathJax styling for dark theme */
.MathJax {
  color: var(--fg) !important;
}

mjx-container[jax="CHTML"] {
  color: var(--fg) !important;
}

mjx-container[jax="CHTML"][display="true"] {
  margin: 1em 0 !important;
  text-align: center;
}

/* Math expressions in posts */
.post-body mjx-container {
  color: var(--cyan) !important;
}

.post-body mjx-container[display="true"] {
  background: rgba(0, 170, 221, 0.05);
  padding: 15px;
  border-radius: 8px;
  border-left: 3px solid var(--cyan);
  margin: 20px 0;
}
