 /* --- FONTS --- */
 @font-face {
     font-family: 'TheLastOfUsTitleFont';
     src: url('../res/thelastfont.ttf') format('truetype');
     font-weight: normal;
     font-style: normal;
 }

 @font-face {
     font-family: 'JournalHeaderFont';
     src: url('../res/thelastfont.ttf') format('truetype');
     font-weight: normal;
     font-style: normal;
 }

 @font-face {
     font-family: 'JournalBodyTextFont';
     font-weight: normal;
     font-style: normal;
 }

 @font-face {
     font-family: 'TheLastOfDataFont';
     src: url('../res/thelastfont.ttf') format('truetype');
     font-weight: normal;
     font-style: normal;
 }

 /* --- BASIC STUFF (Body & Main Container) --- */
 body {
     font-family: 'JournalBodyTextFont', Arial, sans-serif;
     margin: 0;
     padding: 0;
     background-color: #22201e;
     /* Changed: Main page background color */
     display: flex;
     justify-content: center;
     align-items: center;
     min-height: 100vh;
     overflow-y: auto;
     /* Just in case the content gets too long, you can scroll. */
     box-sizing: border-box;
     color: #333;
     /* Default text color for the paper-like parts. */
 }

 /* --- THE JOURNAL ITSELF (with its cool background image) --- */
 .journal-outer {
     width: 100%;
     /* Trying to fill as much space as possible, but not too much. */
     max-width: 1280px;
     /* This is like the 'ideal' width based on the journal's image. */
     aspect-ratio: 1280 / 750;
     /* Keeps the journal's proportions correct, super important for the image! */
     position: relative;
     /* So I can place things inside it precisely. */
     background-image: url('../images/background.png');
     /* The actual journal background image. */
     background-size: 100% 100%;
     /* Stretches the image to fit perfectly. */
     background-repeat: no-repeat;
     box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7);
     /* A nice deep shadow to make it pop off the page. */
     border-radius: 8px;
     /* A little bit of roundness for the book's corners. */
     overflow: hidden;
     /* Keeps everything neatly inside the journal's borders. */
 }

 /* --- LEFT & RIGHT PAGE CONTENT AREAS --- */
 .journal-page-content-left,
 .journal-page-content-right {
     position: absolute;
     /* Allows me to place them exactly where I want on the background image. */
     box-sizing: border-box;
     background-color: transparent;
     /* No extra background, just let the journal image show through! */
 }

 .journal-page-content-left {
     top: 15%;
     /* Positioned carefully based on the background image. */
     left: 19%;
     width: 28%;
     height: 70%;
     padding: 2% 4%;
     display: flex;
     flex-direction: column;
     justify-content: flex-start;
 }

 .journal-page-content-right {
     top: 15.5%;
     /* A bit lower to make space for the top navigation. */
     left: 51.5%;
     width: 44%;
     height: 72%;
     /* Adjusted this so it fits nicely below the navigation. */
     padding: 3% 4%;
     /* Keeping the content a bit away from the edges. */
     overflow-y: auto;
     /* Gotta have scrolling for all those entries! */
     color: #FFF;
     /* White text looks good on that dark page. */
 }

 /* --- CUSTOM SCROLLBAR (because default ones are boring) --- */
 .journal-page-content-right::-webkit-scrollbar {
     width: 8px;
     /* Keeping it thin. */
 }

 .journal-page-content-right::-webkit-scrollbar-track {
     background: #2a2a2a;
     /* Dark track, subtle. */
     border-radius: 4px;
 }

 .journal-page-content-right::-webkit-scrollbar-thumb {
     background-color: #555;
     /* The part you drag, also dark. */
     border-radius: 4px;
     border: 2px solid #2a2a2a;
     /* A little border to separate it from the track. */
 }

 .journal-page-content-right::-webkit-scrollbar-thumb:hover {
     background-color: #777;
     /* A bit lighter when you hover, just a touch. */
 }


 /* --- STYLES FOR THE LEFT PAGE CONTENT --- */
 .journal-page-content-left .large-text {
     font-family: 'TheLastOfDataFont', Arial, sans-serif;
     font-size: 6.5vw;
     font-weight: bold;
     color: #333;
     text-align: left;
     margin-top: 0;
     margin-bottom: 0.5vw;
     line-height: 0.9;
     text-transform: uppercase;
 }

 .journal-page-content-left .medium-header {
     font-family: 'JournalHeaderFont', Arial, sans-serif;
     font-size: 1.5vw;
     font-weight: bold;
     color: #444;
     margin-top: 0;
     margin-bottom: 1.5vw;
     text-transform: uppercase;
 }

 .journal-left-description {
     font-family: 'JournalBodyTextFont', Arial, sans-serif;
     font-size: 0.9vw;
     line-height: 1.6;
     margin-bottom: 2vw;
     color: #444;
     flex-grow: 1;
 }

 /* --- STYLES FOR THE RIGHT PAGE CONTENT --- */
 .right-page-top-nav {
     font-family: 'JournalBodyTextFont', Arial, sans-serif;
     position: absolute;
     /* This keeps it fixed in place on the journal. */
     top: 10.5%;
     /* Putting it high up on the right page. */
     right: 4%;
     /* Aligning it perfectly with the right edge of the content area. */
     width: fit-content;
     /* It'll only be as wide as its text. */
     display: flex;
     gap: 1vw;
     /* Some space between the navigation links. */
     z-index: 10;
     /* Making sure it's always on top of other elements. */
     padding: 0.5vw 1vw;
     /* A little breathing room inside the navigation bar. */
     background-color: #1F1F1F;
     /* Navigation background color */
     box-sizing: border-box;
     /* Includes padding in the width/height calculations. */
     border-radius: 3px;
 }

 .right-page-top-nav a {
     color: #AAA;
     /* A subtle grey for the links. */
     text-decoration: none;
     /* No underlines, please! */
     font-size: 0.8vw;
     text-transform: uppercase;
     letter-spacing: 0.5px;
     transition: color 0.2s ease;
     /* Smooth color change on hover. */
     white-space: nowrap;
     /* Keep the links on one line. */
 }

 .right-page-top-nav a:hover {
     color: #FFF;
     /* Brighter white when you hover over them. */
 }

 .gallery-header {
     font-family: 'JournalHeaderFont', Arial, sans-serif;
     font-size: 1.8vw;
     font-weight: bold;
     color: #EEE;
     /* Light color for headers on the dark page. */
     text-align: left;
     margin-top: 0;
     margin-bottom: 1.5vw;
     padding-bottom: 0.3vw;
     border-bottom: 2px dashed #444;
     /* A dashed line for a journal feel. */
 }

 /* Gallery Grid for the thumbnails on the right page */
 .gallery {
     display: grid;
     grid-template-columns: repeat(3, 1fr);
     /* Three columns, equally spaced. */
     gap: 1.5vw;
     /* Space between the thumbnails. */
     margin: 0;
     padding: 0;
 }

 .thumbnail {
     text-align: center;
     background-color: #1F1F1F;
     /* Changed: Thumbnail background color */
     border-radius: 3px;
     padding: 0.8vw;
     box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
     /* A subtle shadow. */
     transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
     /* Smooth hover effects. */
     display: flex;
     flex-direction: column;
     justify-content: space-between;
     height: 15vw;
     /* Keeping the height consistent. */
     max-height: 200px;
     overflow: hidden;
     /* Hides anything that spills out. */
 }

 .thumbnail:hover {
     transform: translateY(-0.3vw);
     /* Lifts it up a bit on hover. */
     box-shadow: 4px 4px 15px rgba(0, 0, 0, 0.6);
     /* Deeper shadow on hover. */
 }

 .thumbnail img {
     width: 100%;
     height: 10vw;
     max-height: 150px;
     object-fit: cover;
     /* Makes sure images fill the space without distortion. */
     background-color: #000;
     border-radius: 1px;
     border: 1px solid #333;
     margin-bottom: 0.5vw;
     display: block;
 }

 .thumbnail p {
     margin-top: 0;
     font-size: 0.7vw;
     color: #F0F0F0;
     /* Light text for thumbnail descriptions. */
     word-wrap: break-word;
     /* Helps with long words. */
     padding: 0 0.3vw;
     line-height: 1.3;
     flex-grow: 1;
     display: flex;
     align-items: center;
     justify-content: center;
 }

 /* Source code link section */
 .source-code-reader {
     font-family: 'JournalBodyTextFont', Arial, sans-serif;
     margin-top: 2vw;
     padding-top: 1vw;
     text-align: center;
     font-size: 0.7vw;
     color: #888;
     /* Greyed out text. */
     border-top: 1px dashed #444;
     /* Another dashed line for theme. */
 }

 .source-code-reader a {
     color: #88AACC;
     /* A nice blue for the link. */
     text-decoration: none;
     /* No underline by default. */
 }

 .source-code-reader a:hover {
     text-decoration: underline;
     /* Underline on hover for clarity. */
 }

 /* Flicker effect for thumbnails (it's a little secret effect!) */
 @keyframes flicker {
     0% {
         opacity: 1;
         filter: brightness(100%);
     }

     5% {
         opacity: 0.8;
         filter: brightness(120%);
     }

     10% {
         opacity: 1;
         filter: brightness(90%);
     }

     15% {
         opacity: 0.7;
         filter: brightness(130%);
     }

     20% {
         opacity: 1;
         filter: brightness(100%);
     }

     25% {
         opacity: 0.9;
         filter: brightness(110%);
     }

     30% {
         opacity: 1;
         filter: brightness(100%);
     }

     35% {
         opacity: 0.85;
         filter: brightness(125%);
     }

     40% {
         opacity: 1;
         filter: brightness(95%);
     }

     45% {
         opacity: 0.75;
         filter: brightness(135%);
     }

     50% {
         opacity: 1;
         filter: brightness(100%);
     }

     55% {
         opacity: 0.95;
         filter: brightness(105%);
     }

     60% {
         opacity: 1;
         filter: brightness(100%);
     }

     65% {
         opacity: 0.8;
         filter: brightness(120%);
     }

     70% {
         opacity: 1;
         filter: brightness(100%);
     }

     75% {
         opacity: 0.7;
         filter: brightness(130%);
     }

     80% {
         opacity: 1;
         filter: brightness(90%);
     }

     85% {
         opacity: 0.8;
         filter: brightness(120%);
     }

     90% {
         opacity: 1;
         filter: brightness(100%);
     }

     95% {
         opacity: 0.85;
         filter: brightness(125%);
     }

     100% {
         opacity: 1;
         filter: brightness(100%);
     }
 }

 .flicker-active {
     animation: flicker 1s infinite step-end;
     /* Applies the flicker animation. */
 }

 /* --- RESPONSIVENESS (Making it work on smaller screens) --- */
 @media (max-width: 900px) {
     body {
         background-color: #22201e;
         /* Changed: Consistent page background for mobile */
     }

     .journal-outer {
         width: 95%;
         /* Take up more width on smaller screens. */
         max-width: 500px;
         /* But don't get too wide. */
         aspect-ratio: auto;
         /* Let the height adjust naturally. */
         min-height: 600px;
         background-image: none;
         /* Ditching the journal image on mobile for simplicity. */
         box-shadow: none;
         /* No shadow either. */
         border-radius: 0;
         background-color: #22201e;
         /* Changed: The dark background for the mobile content area. */
         padding: 20px 0;
     }

     .journal-page-content-left,
     .journal-page-content-right {
         position: static;
         /* No absolute positioning on mobile, just normal flow. */
         width: auto;
         /* Let content fill width. */
         height: auto;
         /* Let content determine height. */
         margin: 0;
         padding: 5% 5%;
         /* Good padding all around. */
         border-bottom: 1px solid rgba(255, 255, 255, 0.1);
         /* A subtle separator between sections. */
         color: #F0F0F0;
         /* Lighter text for better contrast on the dark background. */
         background-color: transparent;
         /* Keeping it clear. */
     }

     .journal-page-content-right {
         border-bottom: none;
         /* Don't need a border at the very bottom. */
         padding: 5% 5% 5% 5%;
         /* Even padding. */
     }

     /* Adjusting font sizes for better mobile readability */
     .journal-page-content-left .large-text {
         font-size: 2.5em;
         /* Bigger main title. */
         margin-bottom: 5px;
         color: #FFF;
         /* Pure white. */
     }

     .journal-page-content-left .medium-header {
         font-size: 1.2em;
         margin-bottom: 10px;
         color: #DDD;
         /* Lighter gray. */
     }

     .journal-left-description {
         font-size: 0.9em;
         margin-bottom: 15px;
         color: #CCC;
         /* Light gray for body text. */
     }

     /* On mobile, making the nav flow normally */
     .right-page-top-nav {
         position: relative;
         /* Not fixed anymore. */
         top: auto;
         /* Let it sit where it naturally goes. */
         right: auto;
         width: auto;
         justify-content: center;
         /* Center the links. */
         margin-bottom: 15px;
         padding: 0;
         background-color: transparent;
         /* No background on mobile. */
         box-shadow: none;
     }

     .right-page-top-nav a {
         font-size: 0.8em;
         color: #AAA;
     }

     .gallery-header {
         font-size: 1.5em;
         /* Bigger headers for the gallery. */
         margin-top: 20px;
         margin-bottom: 10px;
         padding-bottom: 5px;
         border-bottom: 1px dashed #666;
         /* Still keeping that dashed line. */
         color: #EEE;
     }

     .gallery {
         grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
         /* Auto-fitting columns, a bit smaller. */
         gap: 10px;
     }

     .thumbnail {
         height: auto;
         /* Let images define height. */
         padding: 8px;
         background-color: #1F1F1F;
         /* Changed: Thumbnail background for mobile */
         box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.3);
     }

     .thumbnail img {
         height: auto;
         margin-bottom: 5px;
         border: 1px solid #555;
     }

     .thumbnail p {
         font-size: 0.75em;
         color: #F0F0F0;
     }

     .source-code-reader {
         margin-top: 20px;
         padding-top: 10px;
         font-size: 0.7em;
         border-top: 1px dashed #666;
         color: #AAA;
     }

     .source-code-reader a {
         color: #AACCFF;
     }
 }

 @media (max-width: 550px) {

     .journal-page-content-left,
     .journal-page-content-right {
         padding: 15px 15px;
         /* Even smaller padding on really small screens. */
     }

     .journal-page-content-left .large-text {
         font-size: 2em;
     }

     .journal-page-content-left .medium-header {
         font-size: 1em;
     }

     .journal-left-description {
         font-size: 0.8em;
     }

     .gallery {
         grid-template-columns: 1fr;
         /* Just one column for super small screens. */
     }

     .thumbnail {
         height: auto;
     }
 }

 /* --- NEW: SECRET OVERLAY STYLES --- */
 #secret-overlay {
     position: fixed;
     /* Sits on top of all other content */
     top: 0;
     left: 0;
     width: 100%;
     height: 100%;
     background-color: rgba(0, 0, 0, 0.9);
     /* Dark, semi-transparent background */
     display: none;
     /* Hidden by default */
     justify-content: center;
     align-items: center;
     z-index: 1000;
     /* Ensures it's on the very top layer */
     color: #ccc;
     font-family: 'JournalBodyTextFont', monospace;
     text-align: center;
     padding: 20px;
     box-sizing: border-box;
     opacity: 0;
     /* Start fully transparent for fade-in effect */
     transition: opacity 0.5s ease-in-out;
     /* Smooth fade-in transition */
 }

 #secret-overlay.visible {
     display: flex;
     /* Change to flex to enable centering */
     opacity: 1;
     /* Fade to full opacity */
 }

 .overlay-content {
     max-width: 600px;
 }

 .overlay-content h2 {
     font-family: 'JournalHeaderFont', sans-serif;
     color: #eee;
     font-size: 2em;
     margin-bottom: 20px;
     border-bottom: 1px dashed #555;
     padding-bottom: 10px;
 }

 .overlay-content p {
     font-size: 1.1em;
     line-height: 1.6;
     margin-bottom: 30px;
 }

 .close-overlay {
     font-family: 'JournalBodyTextFont', monospace;
     display: inline-block;
     margin-top: 20px;
     padding: 10px 20px;
     border: 1px solid #555;
     color: #aaa;
     text-decoration: none;
     cursor: pointer;
     transition: background-color 0.3s, color 0.3s;
 }

 .close-overlay:hover {
     background-color: #eee;
     color: #111;
 }

 /* --- NEW & INTEGRATED: Vertical Link List Styles --- */
 .vertical-link-list {
     list-style-type: none;
     margin: 30px 0;
     /* Adds space above and below the list */
     padding: 0;
     width: 100%;
     border: 1px solid #444;
     /* A border that matches the theme */
     border-radius: 3px;
     background-color: #1F1F1F;
     /* A dark background, consistent with thumbnails */
     font-family: 'JournalBodyTextFont', monospace;
 }

 .vertical-link-list li a {
     display: block;
     color: #aaa;
     /* A light, readable color */
     padding: 12px 16px;
     text-decoration: none;
     border-bottom: 1px solid #333;
     /* Separator line between links */
     transition: background-color 0.3s, color 0.3s;
 }

 .vertical-link-list li:last-child a {
     border-bottom: none;
     /* No line on the last item */
 }

 .vertical-link-list li a:hover {
     background-color: #333;
     color: white;
 }