/* Google Fonts - Load first */
@import url('https://fonts.googleapis.com/css2?family=Courier+Prime&family=Handlee&display=swap');

/* Light Mode */
:root {
    --bg-color: #f8f8f8;
    --text-color: #2a2a2a;
    --accent-primary: #a58260;
    --accent-secondary: #556b2f;
    --header-footer-color: #2a2a2a;
    --header-subtitle-color: #5a5a5a;
    
    /* Typewriter font for light mode */
    --font-light: 'Courier Prime', monospace;

    /* Clean sans-serif font for structured content */
    --font-publication: 'Nunito', sans-serif;
}

/* Dark Mode (Blackboard) */
body.dark-mode {
    --bg-color: #303030;
    --text-color: #f8f8f8;
    --accent-primary: #68b0ab;
    --accent-secondary: #68b0ab;
    --header-footer-color: #ffffff;
    --header-subtitle-color: #e0e0e0;

    /* Less extreme, readable chalk-like font */
    --font-dark: 'Handlee', cursive;
}

/* Apply fonts */
body {
    background: var(--bg-color) url('../textures/paper.png') repeat;
    color: var(--text-color);
    font-family: var(--font-light), monospace;  /* Typewriter font in light mode */
}

body.dark-mode {
    background: var(--bg-color) url('../textures/blackboard.jpg') repeat;
    font-family: var(--font-dark), sans-serif;  /* Handwritten but readable */
}

/* Ensure lists match paragraph font size */
ul {
    font-size: 1.6rem;  /* Same as paragraph */
    line-height: 1.9;   /* Ensures readability */
    padding-left: 20px; /* Keeps bullets aligned */
}

ul li {
    font-size: inherit; /* Ensures consistency */
    line-height: inherit;
    margin-bottom: 10px; /* Adds spacing */
}


html, body {
    width: 100%;
    overflow-x: hidden;
}

body.fjord-mode {
    --bg-color: #ffffff;
    --text-color: #1a2b33;
    --accent-primary: #3b6e8f;
    --accent-secondary: #2d5d73;
    --header-footer-color: #1a2b33;
    --header-subtitle-color: #3a4a53;

    font-family: 'Courier Prime', monospace;
    font-weight: 600;

    background-color: var(--bg-color);
    background-image:
        url('../textures/fjord-theme.png'),
        url('../textures/paper.png');
    background-repeat:
        repeat-y,
        repeat;
    background-position:
        center top,
        center top;
    background-size:
        100% auto,
        auto;
    background-attachment:
        scroll,
        scroll;
    background-blend-mode: multiply;
}

/* Soft white mist (optional, can be tuned) */
body.fjord-mode::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    pointer-events: none;
    z-index: -1;
}


/* Overlay to soften everything */
body.fjord-mode::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.4);
    pointer-events: none;
    z-index: -1;
}



/* Rest of your styles remain unchanged... */

    
    /* Main Container */
    .container {
        max-width: 900px;
        margin: 60px auto;
        padding: 30px;
        border-radius: 8px;
        background: transparent;
        box-shadow: none;
    }
    
    /* Header */
    header {
        text-align: center;
        padding: 5px 0;
        border-bottom: 2px solid var(--accent-primary);
        color: var(--header-footer-color);
        position: relative;
    }
    
    header h1 {
        font-size: 2.8rem;
        font-weight: 700;
        margin-bottom: 10px;
    }
    
    header p {
        font-size: 1.4rem;
        color: var(--header-subtitle-color);
        margin: 0;
    }
    
    /* Theme Toggle Button */
    header .btn {
        position: absolute;
        top: 10px;
        right: 20px;
        padding: 8px 20px;
        background-color: var(--accent-primary);
        color: #fff;
        border: none;
        border-radius: 50px;
        font-size: 1.2rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background-color 0.3s ease, transform 0.3s ease;
    }
    
    header .btn:hover {
        background-color: var(--accent-secondary);
        transform: scale(1.1);
    }
    
    header .btn span {
        margin-left: 8px;
    }
    
    /* Navigation */
    nav ul {
        display: flex;
        justify-content: center;
        list-style: none;
        padding: 15px 0;
        margin: 0;
        border-bottom: 2px solid var(--accent-primary);
        color: var(--header-footer-color);
    }
    
    nav ul li {
        margin: 0 15px;
    }
    
    nav ul li a {
        text-decoration: none;
        font-size: 1.6rem;
        font-weight: 600;
        color: var(--header-footer-color);
        transition: color 0.3s ease;
    }
    
    nav ul li a:hover,
    nav ul li a.active {
        color: var(--accent-primary);
    }
    
    /* Text */
    p {
        font-size: 1.6rem;
        line-height: 1.9;
        margin-bottom: 20px;
    }
    
    /* Section Headers */
    h2 {
        font-size: 2.4rem;
        font-weight: bold;
        margin-bottom: 15px;
        color: var(--accent-secondary);
    }
    
    /* Footer */
    footer {
        text-align: center;
        padding: 15px;
        border-top: 2px solid var(--accent-primary);
        margin-top: 60px;
        font-size: 1.2rem;
        color: var(--header-footer-color);
    }
    
    /* Mobile Menu */
    .burger {
      display: none;
      position: fixed;
      top: 20px;
      left: 20px;
      font-size: 2.5rem;
      background: none;
      border: none;
      cursor: pointer;
      color: var(--text-color);
      z-index: 11;
    }
    
    .overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.9);
        z-index: 1000;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    
    .overlay.open {
        display: flex;
        justify-content: center;
        align-items: center;
        opacity: 1;
    }
    
    .overlay .close-btn {
        position: absolute;
        top: 20px;
        right: 30px;
        font-size: 30px;
        color: #fff;
        background: none;
        border: none;
        cursor: pointer;
        font-weight: bold;
    }
    
    .overlay-menu-items {
        list-style: none;
        padding: 0;
        margin: 0;
        text-align: center;
    }
    
    .overlay-menu-items li {
        margin: 20px 0;
    }
    
    .overlay-menu-items a {
        color: #fff;
        text-decoration: none;
        font-size: 2rem;
        font-weight: bold;
        transition: color 0.3s ease;
    }
    
    .overlay-menu-items a:hover {
        color: var(--accent-primary);
    }
    
    /* Mobile-Specific Styles */
    @media (max-width: 768px) {

        
        .burger {
            display: block;
        }
    
        nav ul {
            display: none;
        }
    
        .container {
          margin: 20px auto;
          padding: 20px;
        }
        
        p {
           font-size: 1.4rem;
        }
    
        header h1 {
            font-size: 2.2rem;           
            margin-top: 50px; /* Move the title down */
 
        }
    
        header p {
           font-size: 1.2rem;
           margin-top: 10px; /* Move subtitle down slightly */
        }
        
        header {
            padding-top: 50px; /* Add space inside the header */
        }
    
    
       section figure img {
        max-width: 100%;
        margin: 10px auto;
       }
      
       
    
       /* NEW RULES FOR EXPLORE MORE ON MOBILE*/
        .explore-more-container > div{
            width: 30%;
            min-width: 120px;
            margin: 5px;
        }
      
        .explore-more-container > div > a > img {
            max-width: 100%;
        }
        .explore-more-container {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }
 }
    
/*Section styling */
    
section {
    max-width: 700px;
    margin: 0 auto;
}
section figure {
    max-width: 700px;
    margin: 20px auto;
}
section figure img {
   width: 100%;
   height: auto;
   border-radius: 8px;
   border: 1px solid var(--accent-primary);
   box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.content {
    max-width: 700px;
    margin: 0 auto;
}


a {
    color: var(--accent-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: bold;
}
  
a:hover {
    color: var(--accent-primary);
}
body.dark-mode a {
   color: var(--accent-secondary);
}
    
/*NEW RULES FOR EXPLORE MORE */
.explore-more-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-top: 20px;
}

/* Publication List Styling */
.publication-item {
    margin-bottom: 30px;
    border-bottom: 1px solid var(--accent-primary);
     display: flex;
    justify-content: space-between;
    align-items: flex-start; /* Aligns items to the top */
    padding-bottom: 15px; /* Space below each item */
}

.publication-item:last-child {
    border-bottom: none; /* Removes the bottom border from the last publication item */
}

.publication-content {
    flex: 1;
}

.publication-info {
    display:flex;
    flex-direction: column; /* stack info vertically */
    align-items: flex-start;
}

.publication-info p {
    margin: 0;
    padding: 0;
}
.publication-info a:hover {
   color: var(--accent-primary);
}

/* mobile adjustments for publications*/
@media (max-width: 768px) {
    .publication-item {
         flex-direction: column; /* On mobile, items stack vertically */
         align-items: flex-start; /* Aligns items to the left */
    }
    .publication-info {
        flex-direction: column; /* On mobile, info stacks vertically */
        align-items: flex-start;
    }
    .publication-info img {
       margin:10px auto 0 auto;
       float: none !important;
       display: block;
       max-width: 100% !important;
    }
}


/* Fix publication title size */
.publication-content h3 {
    font-size: 1.9rem; /* Ensure it's larger than the body text */
    font-weight: bold;
    margin-bottom: 5px;
}

/* Balance paragraph size */
.publication-content p {
    font-size: 1.6rem;
}

/* Nav container */
.desktop-nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
    padding: 0;
    margin: 0;
    position: relative;
    gap: 25px;
  }
  
  /* Hover subnav container (the second row) */
  .hover-subnav {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--bg-color);
    padding: 10px 20px;
    border-top: 2px solid var(--accent-primary);
    border-bottom: 2px solid var(--accent-primary);
    white-space: nowrap;
    z-index: 100;
    width: auto;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  }
  
  .hover-subnav a {
    font-family: var(--font-light), monospace;
    margin: 0 12px;
    font-size: 1.4rem;
    text-decoration: none;
    color: var(--text-color);
  }
  
  .hover-subnav a:hover {
    color: var(--accent-primary);
    text-decoration: underline;
  }
  
  /* Show on hover */
  .has-hover-subnav:hover .hover-subnav {
    display: flex;
    justify-content: center;
  }
  

  .footnote {
    font-size: 0.9em;
    color: #666;
    margin-top: 1em;
}



/* MATRIX CANVAS (for green binary rain) */
#matrix-canvas {
    position: fixed;
    top: 0;
    left: 0;
    z-index: -1;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.15;
  }
  
  /* CRT flicker animation (optional, subtle effect) */
  @keyframes crt-flicker {
    0%   { opacity: 0.98; }
    20%  { opacity: 1; }
    40%  { opacity: 0.97; }
    60%  { opacity: 1; }
    80%  { opacity: 0.99; }
    100% { opacity: 0.98; }
  }
  
  /* TERMINAL MODE STYLES */
  body.terminal-mode {
    --bg-color: #000;
    --text-color: #33ff33;
    --accent-primary: #33ff33;
    --accent-secondary: #66ff66;
    --header-footer-color: #33ff33;
    --header-subtitle-color: #66ff66;
  
    font-family: 'Courier Prime', monospace;
    background-color: var(--bg-color);
    color: var(--text-color);
    background-image: none;
    text-shadow: 0 0 4px #00ff00;
    animation: crt-flicker 4s infinite;
  }
  
  /* LINKS in Terminal Mode */
  body.terminal-mode a {
    color: var(--accent-secondary);
    text-decoration: underline;
  }
  
  body.terminal-mode a:hover {
    color: #99ff99;
  }
  
  /* HEADINGS in Terminal Mode */
  body.terminal-mode h1,
  body.terminal-mode h2,
  body.terminal-mode h3 {
    color: var(--text-color);
    text-shadow: 0 0 4px #00ff00;
  }
  
  /* CONTAINER and IMAGES — remove shadows/borders for flat CRT look */
  body.terminal-mode .container,
  body.terminal-mode section figure img {
    box-shadow: none;
    border-radius: 0;
    border: none;
  }
  

  /* SUBNAV IN TERMINAL MODE */
body.terminal-mode .hover-subnav {
    background-color: #000000;
    border-top: 2px solid #33ff33;
    border-bottom: 2px solid #33ff33;
    box-shadow: none;
  }
  
  body.terminal-mode .hover-subnav a {
    color: #33ff33;
    font-family: 'Courier Prime', monospace;
    text-shadow: 0 0 4px #00ff00;
  }
  
  body.terminal-mode .hover-subnav a:hover {
    color: #66ff66;
    text-decoration: underline;
  }
  