/* -------- Base Style -------- */
body {
    background: #fafafa;
    color: #111;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    cursor: default;
    overflow-x: hidden;
    transition: background 1s ease;
  }
  
  /* -------- Layout -------- */
  main {
    max-width: 700px;
    margin: 60px auto;
    padding: 0 20px;
  }
  
  /* -------- Profile Section -------- */
  .profile-section {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
  }
  
  .profile-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    border: 3px solid rgba(103, 145, 192, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }
  
  .profile-photo:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(103, 145, 192, 0.3);
  }
  
  .header-text {
    flex: 1;
  }

  /* -------- Typography -------- */
  h1 {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-size: 2.5rem;
    margin-bottom: 0.3rem;
  }
  
  .tagline {
    color: #555;
    font-size: 0.95rem;
    margin-top: 0;
    margin-bottom: 2rem;
    font-style: italic;
  }
  
  h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 2.5rem;
    margin-bottom: 0.8rem;
    text-transform: lowercase;
    transition: color 0.4s ease, text-shadow 0.4s ease;
  }
  
  /* Glow effect on scroll */
  h2.glow {
    color: #000;
    text-shadow: 0 0 12px rgba(0, 0, 0, 0.25);
  }
  
  /* -------- Lists -------- */
  ul {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
  }
  
  li {
    margin-bottom: 0.4rem;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.6s ease;
  }
  
  li.visible {
    opacity: 1;
    transform: translateY(0);
  }
  
  /* -------- Links -------- */
  a {
    color: #111;
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.15);
    transition: border-color 0.2s ease, color 0.2s ease;
  }
  
  a:hover {
    color: #6791c0;
    border-color: #000;
  }
  
  /* -------- Footer -------- */
  footer {
    margin-top: 3rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 0.8rem;
    color: #666;
    text-align: center;
  }
  
   /* -------- Explore Tiles -------- */
   #explore {
     margin-top: 2rem;
     padding-top: 0;
   }
  
  .tile-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.2rem;
    margin-top: 1.2rem;
  }
  
  .tile {
    display: block;
    background: #f2f2f2;
    border-radius: 10px;
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.4s ease;
    opacity: 0;
    transform: translateY(20px);
  }
  
  .tile::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, #6791c0, #c06791);
    transition: width 0.3s ease;
  }
  
  .tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    background: #fafafa;
  }
  
  .tile:hover::after {
    width: 100%;
  }
  
  .tile-title {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
  }
  
  .tile.visible {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.6s ease;
  }
  
  /* -------- Soft Gradient Blob -------- */
  .cursor-blob {
    position: fixed;
    top: 0;
    left: 0;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle at center, rgba(103,145,192,0.15), transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
    mix-blend-mode: multiply;
    transition: transform 0.2s ease;
  }
  
   /* -------- Progress Bar -------- */
   #progress {
     position: fixed;
     top: 0;
     left: 0;
     height: 2px;
     background: linear-gradient(to right, #6791c0, #c06791);
     width: 0%;
     z-index: 999;
     transition: width 0.1s linear;
   }
   
   /* -------- Card Layouts -------- */
   .card-container {
     display: flex;
     flex-direction: column;
     gap: 1.5rem;
     margin-top: 1.5rem;
   }
   
   .writing-card, .project-card {
     background: #f8f8f8;
     border-radius: 12px;
     padding: 2rem;
     border: 1px solid rgba(0, 0, 0, 0.08);
     transition: all 0.3s ease;
     opacity: 0;
     transform: translateY(20px);
     cursor: pointer;
   }
   
   .writing-card:hover, .project-card:hover {
     transform: translateY(-2px);
     box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
     border-color: rgba(0, 0, 0, 0.15);
   }
   
   .writing-card.visible, .project-card.visible {
     opacity: 1;
     transform: translateY(0);
   }
   
   .card-header {
     display: flex;
     justify-content: space-between;
     align-items: flex-start;
     margin-bottom: 1rem;
     gap: 1rem;
   }
   
   .card-title {
     font-family: 'Playfair Display', serif;
     font-size: 1.4rem;
     font-weight: 600;
     margin: 0;
     color: #111;
     line-height: 1.3;
   }
   
   .card-date {
     font-size: 0.85rem;
     color: #666;
     white-space: nowrap;
     font-weight: 500;
   }
   
   .card-description {
     color: #444;
     line-height: 1.6;
     margin-bottom: 1.5rem;
   }
   
   .card-tags {
     display: flex;
     flex-wrap: wrap;
     gap: 0.5rem;
     margin-bottom: 1rem;
   }
   
   .tag {
     background: #e8e8e8;
     color: #555;
     padding: 0.3rem 0.8rem;
     border-radius: 20px;
     font-size: 0.8rem;
     font-weight: 500;
   }
   
   .card-links {
     display: flex;
     gap: 1rem;
     flex-wrap: wrap;
   }
   
   .card-link {
     color: #6791c0;
     text-decoration: none;
     font-weight: 500;
     font-size: 0.9rem;
     border-bottom: 1px solid transparent;
     transition: all 0.2s ease;
   }
   
   .card-link:hover {
     border-bottom-color: #6791c0;
     color: #5a7ba8;
   }
   
   /* -------- Blog/Journal Layout -------- */
   .blog-post {
     max-width: 800px;
     margin: 0 auto;
     padding: 0 2rem;
     line-height: 1.8;
   }
   
   .blog-header {
     text-align: center;
     margin-bottom: 3rem;
     padding-bottom: 2rem;
     border-bottom: 1px solid rgba(0, 0, 0, 0.1);
   }
   
   .blog-title {
     font-family: 'Playfair Display', serif;
     font-size: 2.5rem;
     font-weight: 600;
     color: #111;
     margin-bottom: 1rem;
     line-height: 1.2;
   }
   
   .blog-meta {
     color: #666;
     font-size: 0.95rem;
     font-style: italic;
   }
   
   .blog-content {
     font-family: 'Times New Roman', Times, serif;
     font-size: 1.1rem;
     color: #333;
     line-height: 1.8;
   }
   
   .blog-content h2 {
     display: none;
   }
   
   .blog-content .works-cited-title {
     display: block !important;
     font-family: 'Playfair Display', serif;
     font-size: 1.8rem;
     font-weight: 600;
     color: #111;
     margin-top: 3rem;
     margin-bottom: 1.5rem;
     line-height: 1.3;
   }
   
   .blog-content h3 {
     display: none;
   }
   
   /* Show headers for wind-powered car specifically */
   .wind-powered-car .blog-content h2,
   .wind-powered-car .blog-content h3 {
     display: block;
   }
   
   .wind-powered-car .blog-content h2 {
     font-family: 'Playfair Display', serif;
     font-size: 1.8rem;
     font-weight: 600;
     color: #111;
     margin-top: 3rem;
     margin-bottom: 1.5rem;
     line-height: 1.3;
   }
   
   .wind-powered-car .blog-content h3 {
     font-family: 'Playfair Display', serif;
     font-size: 1.4rem;
     font-weight: 500;
     color: #222;
     margin-top: 2.5rem;
     margin-bottom: 1rem;
     line-height: 1.3;
   }
   
   /* Show headers for the darkness unleashed specifically */
   .the-darkness-unleashed .blog-content h2,
   .the-darkness-unleashed .blog-content h3 {
     display: block;
   }
   
   .the-darkness-unleashed .blog-content h2 {
     font-family: 'Playfair Display', serif;
     font-size: 1.8rem;
     font-weight: 600;
     color: #111;
     margin-top: 3rem;
     margin-bottom: 1.5rem;
     line-height: 1.3;
   }
   
   .the-darkness-unleashed .blog-content h3 {
     font-family: 'Playfair Display', serif;
     font-size: 1.4rem;
     font-weight: 500;
     color: #222;
     margin-top: 2.5rem;
     margin-bottom: 1rem;
     line-height: 1.3;
   }
   
   .blog-content p {
     margin-bottom: 1.8rem;
     text-align: justify;
     hyphens: auto;
     text-indent: 2rem;
   }
   
   .blog-content blockquote {
     border-left: 4px solid #6791c0;
     padding-left: 2rem;
     margin: 2rem 0;
     font-family: 'Times New Roman', Times, serif;
     font-style: italic;
     color: #555;
     background-color: rgba(103, 145, 192, 0.05);
     padding: 1.5rem 2rem;
     border-radius: 0 8px 8px 0;
     text-indent: 0;
   }
   
   .blog-content blockquote cite {
     display: block;
     margin-top: 1rem;
     font-size: 0.9rem;
     font-style: normal;
     color: #666;
     text-align: right;
   }
   
   .blog-content hr {
     border: none;
     height: 1px;
     background: linear-gradient(to right, transparent, #ddd, transparent);
     margin: 3rem 0;
   }
   
   .blog-content ol {
     counter-reset: item;
     padding-left: 0;
   }
   
   .blog-content ol li {
     display: block;
     margin-bottom: 1rem;
     padding-left: 2rem;
     position: relative;
     font-family: 'Times New Roman', Times, serif;
   }
   
   .blog-content ol li::before {
     content: counter(item) ".";
     counter-increment: item;
     position: absolute;
     left: 0;
     top: 0;
     font-weight: 600;
     color: #6791c0;
   }
   
   .blog-content em {
     font-style: italic;
     color: #555;
   }
   
   /* Calculation formatting */
   .blog-content .calculation {
     background-color: rgba(103, 145, 192, 0.08);
     border: 1px solid rgba(103, 145, 192, 0.2);
     border-radius: 8px;
     padding: 1.5rem;
     margin: 2rem 0;
     font-family: 'Times New Roman', Times, serif;
   }
   
   .blog-content .calculation-title {
     font-weight: 600;
     color: #333;
     margin-bottom: 1rem;
     font-size: 1.1rem;
   }
   
   .blog-content .calculation-formula {
     font-family: 'Times New Roman', Times, serif;
     font-size: 1.1rem;
     text-align: center;
     margin: 1rem 0;
     padding: 1rem;
     background-color: rgba(255, 255, 255, 0.5);
     border-radius: 4px;
     border: 1px solid rgba(103, 145, 192, 0.1);
   }
   
   .blog-content .calculation-result {
     font-weight: 600;
     color: #6791c0;
     margin-top: 1rem;
     text-align: center;
   }
   
   .blog-content .calculation-step {
     margin: 0.5rem 0;
     padding-left: 1rem;
     border-left: 2px solid rgba(103, 145, 192, 0.3);
   }
   
   .blog-navigation {
     display: flex;
     justify-content: space-between;
     align-items: center;
     margin-top: 4rem;
     padding-top: 2rem;
     border-top: 1px solid rgba(0, 0, 0, 0.1);
   }
   
   .nav-link {
     color: #6791c0;
     text-decoration: none;
     font-weight: 500;
     padding: 0.5rem 1rem;
     border-radius: 6px;
     transition: all 0.2s ease;
   }
   
   .nav-link:hover {
     background-color: rgba(103, 145, 192, 0.1);
     color: #5a7ba8;
   }
   
   .nav-link.disabled {
     color: #ccc;
     cursor: not-allowed;
   }
   
   .back-to-writings {
     text-align: center;
     margin: 2rem 0;
   }
   
   .back-to-writings a {
     color: #6791c0;
     text-decoration: none;
     font-weight: 500;
     display: inline-flex;
     align-items: center;
     gap: 0.5rem;
     padding: 0.75rem 1.5rem;
     border: 1px solid rgba(103, 145, 192, 0.3);
     border-radius: 6px;
     transition: all 0.2s ease;
   }
   
   .back-to-writings a:hover {
     background-color: rgba(103, 145, 192, 0.1);
     border-color: #6791c0;
   }
   
   /* Mobile responsive blog layout */
   @media (max-width: 768px) {
     .blog-post {
       padding: 0 1rem;
     }
     
     .blog-title {
       font-size: 2rem;
     }
     
     .blog-content {
       font-size: 1rem;
     }
     
     .blog-content h2 {
       font-size: 1.5rem;
     }
     
     .blog-content h3 {
       font-size: 1.2rem;
     }
     
     .blog-navigation {
       flex-direction: column;
       gap: 1rem;
       text-align: center;
     }
     
     /* Fix horizontal scrolling on mobile */
     .blog-content ol li {
       word-break: break-all;
       overflow-wrap: break-word;
       hyphens: auto;
       max-width: 100%;
     }
     
     .blog-content ol {
       overflow-x: hidden;
       word-wrap: break-word;
     }
     
     /* Ensure images don't cause horizontal scroll */
     .blog-content img {
       max-width: 100% !important;
       height: auto !important;
     }
     
     /* Fix calculation boxes on mobile */
     .blog-content .calculation {
       padding: 1rem;
       margin: 1.5rem 0;
     }
     
     .blog-content .calculation-formula {
       font-size: 1rem;
       padding: 0.75rem;
     }
     
     .blog-content .calculation-step {
       font-size: 0.9rem;
       padding-left: 0.5rem;
     }
   }
   
   /* -------- Modal System -------- */
   .modal {
     display: none;
     position: fixed;
     z-index: 1000;
     left: 0;
     top: 0;
     width: 100%;
     height: 100%;
     background-color: rgba(0, 0, 0, 0.5);
     backdrop-filter: blur(5px);
     animation: fadeIn 0.3s ease;
   }
   
   .modal-content {
     background-color: #fafafa;
     margin: 2% auto;
     padding: 0;
     border: none;
     width: 90%;
     max-width: 900px;
     max-height: 90vh;
     border-radius: 12px;
     box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
     animation: slideIn 0.3s ease;
     overflow: hidden;
     position: relative;
   }
   
   .modal-header {
     background: linear-gradient(135deg, #6791c0, #c06791);
     color: white;
     padding: 1.5rem 2rem;
     display: flex;
     justify-content: space-between;
     align-items: center;
   }
   
   .modal-title {
     font-family: 'Playfair Display', serif;
     font-size: 1.5rem;
     font-weight: 600;
     margin: 0;
   }
   
   .modal-close {
     color: white;
     font-size: 2rem;
     font-weight: bold;
     cursor: pointer;
     background: none;
     border: none;
     padding: 0;
     width: 30px;
     height: 30px;
     display: flex;
     align-items: center;
     justify-content: center;
     border-radius: 50%;
     transition: background-color 0.2s ease;
   }
   
   .modal-close:hover {
     background-color: rgba(255, 255, 255, 0.2);
   }
   
   .modal-body {
     padding: 2rem;
     max-height: calc(90vh - 120px);
     overflow-y: auto;
     line-height: 1.7;
   }
   
   .modal-body h3 {
     font-family: 'Playfair Display', serif;
     color: #111;
     margin-top: 2rem;
     margin-bottom: 1rem;
   }
   
   .modal-body h3:first-child {
     margin-top: 0;
   }
   
   .modal-body p {
     color: #444;
     margin-bottom: 1.5rem;
   }
   
   .modal-navigation {
     display: flex;
     justify-content: space-between;
     align-items: center;
     padding: 1rem 2rem;
     background-color: #f8f8f8;
     border-top: 1px solid rgba(0, 0, 0, 0.1);
   }
   
   .nav-button {
     background: none;
     border: 1px solid #ddd;
     color: #666;
     padding: 0.5rem 1rem;
     border-radius: 6px;
     cursor: pointer;
     transition: all 0.2s ease;
     font-size: 0.9rem;
   }
   
   .nav-button:hover:not(:disabled) {
     background-color: #6791c0;
     color: white;
     border-color: #6791c0;
   }
   
   .nav-button:disabled {
     opacity: 0.5;
     cursor: not-allowed;
   }
   
   .modal-counter {
     color: #666;
     font-size: 0.9rem;
   }
   
   @keyframes fadeIn {
     from { opacity: 0; }
     to { opacity: 1; }
   }
   
   @keyframes slideIn {
     from { 
       opacity: 0;
       transform: translateY(-50px) scale(0.95);
     }
     to { 
       opacity: 1;
       transform: translateY(0) scale(1);
     }
   }
   
   /* Mobile responsive modal */
   @media (max-width: 768px) {
     .modal-content {
       width: 95%;
       margin: 5% auto;
       max-height: 85vh;
     }
     
     .modal-header {
       padding: 1rem;
     }
     
     .modal-title {
       font-size: 1.2rem;
     }
     
     .modal-body {
       padding: 1.5rem;
       max-height: calc(85vh - 100px);
     }
     
     .modal-navigation {
       padding: 1rem;
     }
   }
  
  /* -------- Responsive -------- */
  @media (max-width: 600px) {
    main {
      margin: 40px auto;
    }
    h1 {
      font-size: 2rem;
    }
    .cursor-blob { display: none; } /* hide blob on mobile */
    
    /* Mobile profile section */
    .profile-section {
      flex-direction: column;
      text-align: center;
      gap: 1.5rem;
    }
    
    .profile-photo {
      width: 100px;
      height: 100px;
    }
  }
  