/* --- 0. FONTS --- */
@import url('https://fonts.googleapis.com/css2?family=Covered+By+Your+Grace&family=Inter:wght@300;400;800&family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=Space+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap');
html {
    scroll-behavior: smooth;
    /* Offset for the fixed taskbar if needed */
    scroll-padding-bottom: 50px; 
}
/* --- 1. CORE THEME --- */
:root {
    --paper: #f4f1ea;   
    --ink: #2a2a2a;     
    --accent: #8c8c8c;
    
    /* System OS Additions */
    --sys-grey: #d4d0c8;     /* Classic Win95 Silver */
    --sys-blue: #2e59ff;     /* Saphi Blue / Header Blue */
    --term-pink: #ff7c79;   /* Matrix/Terminal Green */
}

body {
    background-color: var(--paper);
    color: var(--ink);
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    /* Added to ensure the taskbar doesn't cover content later */
    padding-bottom: 50px; 
}

/*1.2 MARQUEE BANNER*/
.marquee {
  overflow: hidden;
  white-space: nowrap;
  background: #0f0f0f;
  color: #ffffff;
  padding: 12px 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
}

.marquee-content {
  display: flex;
  white-space: nowrap;
  /* Adjust 20s to change speed */
  animation: continuous-scroll 40s linear infinite;
}

.marquee-content span {
  display: inline-block;
  padding-right: 60px; /* The gap between the repeated phrases */
  font-family: 'Space Mono', monospace;
  font-size: 0.9rem;
  letter-spacing: 1px;
}

@keyframes continuous-scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    /* We move it exactly half its total width */
    transform: translateX(-50%);
  }
}


/* --- 2. NAVIGATION --- */
nav {
    display: flex;
    justify-content: flex-end;
    padding: 1.5rem 5%; /* Tightened padding for a sleeker look */
    text-transform: uppercase;
    letter-spacing: 0.15rem;
    font-size: 0.75rem;
    font-family: 'Space Mono', monospace; /* Swapped to system font */
}

nav a {
    text-decoration: none;
    color: var(--ink);
    margin-left: 2.5rem;
    transition: all 0.2s ease;
    position: relative;
}

/* Subtle hover: instead of just fading, let's give it a system highlight */
nav a:hover {
    color: var(--sys-blue);
    opacity: 1;
}

/* Optional: A tiny dot or underline for the current page/hover */
nav a:hover::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--sys-blue);
}

/* --- UNIVERSAL DOT SYSTEM --- */

/* This adds the dots to the right side of ANY window header */
.logo-window::before,
.journal-entry::before, 
.hero-image-wrapper::before,
.chapter-box::before,
#live-terminal .window-header::after,
.description-window .window-header::after {
    /* If it's a pseudo-element (::after), we need to give it size */
    content: ""; 
    display: inline-block;
    width: 40px;
    height: 10px;
    
    /* Default Grey Dots */
    background-image: 
        radial-gradient(circle, #ccc 2px, transparent 3px),
        radial-gradient(circle, #ccc 2px, transparent 3px),
        radial-gradient(circle, #ccc 2px, transparent 3px);
    background-repeat: no-repeat;
    background-position: 
        calc(100% - 0px) center, 
        calc(100% - 12px) center, 
        calc(100% - 24px) center;
    transition: background-image 0.2s ease;
}

/* THE HOVER COLOR MAGIC */
.logo-window:hover::before,
.journal-entry:hover::before, 
.hero-image-wrapper:hover::before,
.chapter-box:hover::before,
#live-terminal:hover .window-header::after,
.description-window:hover .window-header::after {
    background-image: 
        radial-gradient(circle, #ff7c79 2px, transparent 3px),
        radial-gradient(circle, #5bfad5 2px, transparent 3px),
        radial-gradient(circle, #5bcefa 2px, transparent 3px) !important;
}

/* Fix Terminal/Description Header Alignment */
#live-terminal .window-header, 
.description-window .window-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Kill any remaining stray manual dot styles */
.window-dots { display: none !important; }

/* --- 3. HERO SPREAD (CLEANED & SYNCED) --- */

.hero-spread {
    display: flex;
    align-items: flex-start;
    justify-content: center; 
    gap: 30px;
    max-width: 1000px;
    margin: 30px auto;
    padding: 0 5%;
}

.hero-left {
    flex: 1;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* THE WINDOWS (Now standard across the site) */
.logo-window, .journal-entry, .hero-image-wrapper {
    background: #ffffff;
    border: 1px solid #000;
    box-shadow: 4px 4px 0px #000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0 !important; 
}

/* 1. DELETE OLD RELICS: These were causing the ghosting in Figure 2 */
.logo-window::before,
.journal-entry::before, 
.hero-image-wrapper::before,
.logo-window:hover::before,
.journal-entry:hover::before, 
.hero-image-wrapper:hover::before {
    display: none !important;
    content: none !important;
}

/* 2. STYLE THE ACTUAL HEADERS (Matching Terminal/README) */
.logo-window .window-header,
.journal-entry .window-header,
.hero-image-wrapper .window-header {
    height: 32px;
    background: #f0f0f0;
    border-bottom: 1px solid #000;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: space-between; /* Keeps title left, dots right */
    box-sizing: border-box;
}

/* 3. UNIVERSAL DOTS VIA ::AFTER */
.logo-window .window-header::after,
.journal-entry .window-header::after,
.hero-image-wrapper .window-header::after {
    content: "";
    width: 40px;
    height: 10px;
    display: inline-block;
    background-image: 
        radial-gradient(circle, #ccc 2px, transparent 3px),
        radial-gradient(circle, #ccc 2px, transparent 3px),
        radial-gradient(circle, #ccc 2px, transparent 3px);
    background-repeat: no-repeat;
    background-position: 
        calc(100% - 0px) center, 
        calc(100% - 12px) center, 
        calc(100% - 24px) center;
    transition: background-image 0.2s ease;
}

/* 4. HOVER GLOW EFFECT */
.logo-window:hover .window-header::after,
.journal-entry:hover .window-header::after,
.hero-image-wrapper:hover .window-header::after {
    background-image: 
        radial-gradient(circle, #ff7c79 2px, transparent 3px),
        radial-gradient(circle, #5bfad5 2px, transparent 3px),
        radial-gradient(circle, #5bcefa 2px, transparent 3px) !important;
}

/* THE CONTENT BODIES */
.logo-body, .window-body {
    padding: 25px;
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
}

/* LOGO SPECIFIC */
.logo-window { width: fit-content; }
.logo-body { padding: 30px 40px; }
.main-logo {
    width: 250px;
    display: block;
    height: auto;
}

/* IMAGE SPECIFIC */
.hero-image-wrapper {
    flex: 1;
    max-width: 420px;
}
.film-photo {
    width: 100%;
    display: block;
    filter: contrast(1.05) saturate(0.9);
}

/* Mobile Alignment */
@media (max-width: 850px) {
    .hero-spread { flex-direction: column; align-items: center; }
    .hero-left, .hero-image-wrapper { width: 100%; max-width: 100%; }
    .logo-window { width: 100%; }
    .logo-body { display: flex; justify-content: center; }
}
/* --- 4. THE SYSTEM TASKBAR (Functional) --- */
.system-taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background: #d4d0c8; 
    border-top: 2px solid #ffffff;
    display: flex;
    align-items: center;
    padding: 2px 10px;
    z-index: 99999;
    box-sizing: border-box;
    font-family: 'Space Mono', monospace;
}

.task-tabs {
    display: flex;
    gap: 4px;
    flex-grow: 1;
    align-items: center;
}

.task-tab {
    background: #d4d0c8;
    border: 2px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    padding: 2px 12px;
    font-size: 11px;
    text-decoration: none;
    color: #000;
    display: flex;
    align-items: center;
    height: 28px;
    user-select: none;
}

/* Mechanical Click Feel */
.task-tab:active {
    border-color: #808080 #ffffff #ffffff #808080;
    padding: 3px 11px 1px 13px;
}

/* The 'Current Section' highlight */
.task-tab.highlight {
    background: #e0e0e0;
    border-color: #808080 #ffffff #ffffff #808080;
    font-weight: bold;
    color: #2e59ff;
}

/* THE CLOCK INSET */
.system-clock {
    background: #d4d0c8;
    border: 2px solid;
    border-color: #808080 #ffffff #ffffff #808080;
    padding: 2px 10px;
    font-size: 11px;
    margin-left: 10px;
    height: 28px;
    display: flex;
    align-items: center;
    /* Add these two lines: */
    min-width: 65px; 
    justify-content: center;
}

/* MOBILE FIX: Hide less important tabs if they overflow */
@media (max-width: 600px) {
    .task-tabs {
        overflow: hidden;
    }
    .task-tab:nth-child(n+3) {
        display: none;
    }
}

/* --- 5. THE MODULAR HUB (Height Alignment) --- */
#media-hub {
    display: grid !important;
    grid-template-columns: 1.4fr 1fr !important;
    gap: 25px;
    max-width: 1050px;
    margin: 50px auto;
    padding: 0 5%;
    /* This ensures both columns take up the same vertical space */
    align-items: stretch; 
}

.video-column, .spotify-column {
    display: flex;
    flex-direction: column;
    /* This pushes the buttons to the very bottom so they align */
    justify-content:沟通; 
}

/* Force YouTube to a specific height if you want total pixel-perfection, 
   or let it stay 16/9 and we'll match Spotify to it */
.video-column iframe {
    width: 100%;
    height: 352px;
    aspect-ratio: 16/9;
    border: none;
    display: block;
}

.spotify-column iframe {
    width: 100%;
    /* We change height to 100% so it fills the flex container, 
       but we give it a min-height so it doesn't collapse */
    height: 100% !important;
    min-height: 352px; 
    border: none;
    border-radius: 12px;
}

.native-sub-btn {
    margin-top: 15px; /* Consistent gap from the player above */
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    text-decoration: none;
    color: #000;
    border: 1px solid #000;
    padding: 12px;
    text-align: center;
    background: #fff;
    box-shadow: 3px 3px 0px #000;
    transition: all 0.1s ease;
}

.native-sub-btn:hover {
    transform: translate(1px, 1px);
    box-shadow: 2px 2px 0px #000;
    background: #f0f0f0;
}
/* Mobile: Stack them */
@media (max-width: 850px) {
    #media-hub {
        grid-template-columns: 1fr !important;
    }
}

/* --- 4. THE TASKBAR (Spacing Fix) --- */
.system-taskbar {
    /* ... keep your existing position/bg settings ... */
    display: flex;
    justify-content: flex-start;
    padding: 0 10px;
    gap: 10px;
}

.task-tabs {
    display: flex;
    gap: 8px; /* Increased gap so buttons don't touch */
    align-items: center;
}

.task-tab {
    /* ... keep your existing border/bg settings ... */
    padding: 4px 15px; /* More horizontal padding for better click area */
    white-space: nowrap; /* Prevents text from wrapping inside the button */
    min-width: 80px; /* Gives them a consistent "system" look */
    justify-content: center;
}

/* Responsive: Only stack when the screen is actually small */
@media (max-width: 950px) {
    .bento-grid {
        grid-template-columns: 1fr !important;
    }
}

/* --- UPDATED DESCRIPTION WINDOW (README.TXT) --- */
.description-window {
    position: relative; 
    max-width: 800px;
    margin: 40px auto 80px auto;
    background: #ffffff;
    border: 1px solid #000;
    box-shadow: 2px 2px 0px #000;
    z-index: 1;
}

/* MATCHING THE CHAPTER BOX HEADER EXACTLY */
.description-window .window-header {
    height: 32px; /* Matching the chapter-box::before height */
    background: #f0f0f0;
    border-bottom: 1px solid #000;
    padding: 0 12px;
    display: flex;
    align-items: center; /* Vertical center */
    justify-content: space-between;
    box-sizing: border-box;
}

.description-window .window-title {
    font-family: 'Space Mono', monospace;
    font-size: 10px; /* Matching chapter text size */
    text-transform: uppercase;
    color: #000;
}

/* MATCHING THE 3-DOT CONTROL VISUALS */
.window-dots {
    display: flex;
    align-items: center;
    width: 40px; /* Space for the 3 dots */
    height: 100%;
    
    /* Using the same radial gradient logic from the links */
    background-image: 
        radial-gradient(circle, #ccc 2px, transparent 3px),
        radial-gradient(circle, #ccc 2px, transparent 3px),
        radial-gradient(circle, #ccc 2px, transparent 3px);
    background-repeat: no-repeat;
    background-position: 
        calc(100% - 0px) center, 
        calc(100% - 12px) center, 
        calc(100% - 24px) center;
}

/* Optional: Make the dots turn color on hover to match the others */
.description-window:hover .window-dots {
    background-image: 
        radial-gradient(circle, #ff7c79 2px, transparent 3px),
        radial-gradient(circle, #5bfad5 2px, transparent 3px),
        radial-gradient(circle, #5bcefa 2px, transparent 3px);
}

.description-content {
    padding: 30px;
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    clear: both; /* Safety for the floating audio */
}
/* --- SYSTEM OS: STRAY AUDIO WINDOW --- */
.stray-audio {
    /* 1. POSITIONING: Float right so text wraps around it */
    float: right;
    position: relative;
    width: 280px; /* Controlled width */
    margin: 10px 0 20px 20px; /* Space between text and window */
    
    /* 2. VISUALS: Minimalist Window */
    background: #ffffff;
    border: 1px solid #000;
    box-shadow: 3px 3px 0px #000;
    z-index: 5;
    display: flex;
    flex-direction: column;
}

/* THE WINDOW HEADER */
.stray-audio .caption {
    background: #f0f0f0;
    border-bottom: 1px solid #000;
    padding: 5px 10px;
    margin: 0;
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    color: #000;
    text-transform: uppercase;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Window Control Dots */
.stray-audio .caption::after {
    content: "● ● ●";
    font-size: 6px;
    color: #ccc;
    letter-spacing: 2px;
}

/* THE PLAYER: Fixed to fit the window */
.minimal-player {
    display: block;
    width: 100%;       /* Fills the 280px */
    max-width: 100%;   /* Cannot overflow */
    height: 35px;      /* Slimmer player profile */
    padding: 8px;
    box-sizing: border-box;
    filter: grayscale(1); /* Monochrome OS vibe */
}

/* HOVER STATE */
.stray-audio:hover {
    box-shadow: 4px 4px 0px #5bcefa; /* Subtle Saphi Blue highlight */
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

/* CLEARFIX: Ensures the next section (Live Schedule) stays below the description */
.description-content::after {
    content: "";
    display: table;
    clear: both;
}

/* MOBILE: Stack the player so it doesn't squish the text on small screens */
@media (max-width: 600px) {
    .stray-audio {
        float: none;
        width: 100%;
        margin: 20px 0;
    }
}

/* --- 6. LIVE TERMINAL --- */
#live-terminal {
    background: #0a0a0a;
    border: 1px solid #000;
    box-shadow: 4px 4px 0px #000;
    max-width: 900px;
    margin: 30px auto 80px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* OS Header Bar */
#live-terminal .window-header {
    height: 32px;
    background: #f0f0f0;
    border-bottom: 1px solid #000;
    padding: 0 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.window-title {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    color: #000;
}

.window-dots { display: flex; gap: 6px; }
.window-dots span {
    width: 6px; height: 6px; border-radius: 50%; background: #ccc;
}

/* Terminal Content */
.terminal-body {
    padding: 30px;
    font-family: 'Space Mono', monospace;
    color: var(--term-pink); /* Your Green/Cyan */
    font-size: 0.85rem;
}

.terminal-cmd { margin-bottom: 25px; opacity: 0.7; }

/* The Data Grid */
.terminal-entry {
    display: grid;
    grid-template-columns: 100px 1fr 120px; /* Precise columns for alignment */
    padding: 10px 0;
    border-bottom: 1px dashed rgba(91, 250, 213, 0.15);
}

.terminal-entry.past { opacity: 0.4; color: #fff; }
.terminal-entry.active { color: var(--term-pink); font-weight: bold; }

.term-date { color: #fff; }
.term-status { text-align: right; font-size: 10px; letter-spacing: 1px; }

/* Cursor Animation */
.terminal-cursor {
    margin-top: 20px;
    font-weight: bold;
    animation: blink 1s infinite;
}

@keyframes blink { 50% { opacity: 0; } }

/* Responsive Fix */
@media (max-width: 700px) {
    .terminal-entry {
        grid-template-columns: 1fr;
        gap: 5px;
        padding: 15px 0;
    }
    .term-status { text-align: left; opacity: 0.6; }
}


/* --- 7. SYSTEM WINDOWS (3-Column Row) --- */
.chapter-links {
    display: flex;
    justify-content: center; /* Centers the row */
    gap: 25px;               /* Space between windows */
    margin: 80px auto;
    padding: 0 5%;
    max-width: 1200px;
    height: auto;            /* Let the content define the height */
}

.chapter-box {
    flex: 1;                 /* Makes all 3 boxes equal width */
    min-width: 280px;        /* Prevents them from getting too skinny */
    max-width: 350px;
    background: #ffffff;
    border: 1px solid #000;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
    position: relative;
    box-sizing: border-box;
}

/* THE WINDOW HEADER BAR */
.chapter-box::before {
    content: "FILE_0" attr(data-id) ".SYS";
    display: flex;
    align-items: center;
    width: 100%;
    height: 32px;
    background: #f0f0f0;
    border-bottom: 1px solid #000;
    padding: 0 12px;
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    color: #000;
    box-sizing: border-box;
    
    /* The 3 Control Buttons (The visuals you liked) */
    background-image: 
        radial-gradient(circle, #ccc 2px, transparent 3px),
        radial-gradient(circle, #ccc 2px, transparent 3px),
        radial-gradient(circle, #ccc 2px, transparent 3px);
    background-repeat: no-repeat;
    background-position: 
        calc(100% - 12px) center, 
        calc(100% - 24px) center, 
        calc(100% - 36px) center;
}

/* THE SYSTEM HOVER */
.chapter-box:hover {
    transform: translate(-4px, -4px);
    box-shadow: 4px 4px 0px #000;
}

.chapter-box:hover::before {
    background-image: 
        radial-gradient(circle, #ff7c79 2px, transparent 3px),
        radial-gradient(circle, #5bfad5 2px, transparent 3px),
        radial-gradient(circle, #5bcefa 2px, transparent 3px);
    background-color: #e8e8e8;
}

.chapter-box-content {
    padding: 25px;
}

.chapter-box h2 {
    font-family: 'Space Mono', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.chapter-box p {
    font-family: 'Space Mono', monospace;
    color: #666;
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 0;
}

/* MOBILE FIX: Stack them when the screen gets narrow */
@media (max-width: 900px) {
    .chapter-links {
        flex-direction: column;
        align-items: center;
    }
    .chapter-box {
        width: 100%;
        max-width: 400px;
    }
}

.desktop-icons-container {
    display: flex;
    gap: 0;
    padding: 0;
    justify-content: center;
    flex-wrap: wrap;
}

.desktop-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80px;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.1s;
}

.icon-image {
    font-size: 40px; /* Or use a 32x32 pixel art icon */
    margin-bottom: 5px;
    filter: drop-shadow(1px 1px 0px #000);
}

.icon-label {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    color: rgb(0, 0, 0);
    text-align: center;
    padding: 2px 4px;
    word-wrap: break-word;
    background: transparent;
    border: 1px solid transparent;
}

/* THE 'SELECTED' EFFECT */
.desktop-icon:hover .icon-label {
    background-color: #000080;
    color: rgb(255, 255, 255); /* Classic Win95 selection blue */
    border: 1px dotted #ffff00; /* Yellow dotted selection border */
}

.desktop-icon:active {
    transform: translate(1px, 1px);
}

/* --- 8. CLEANUP & MOBILE --- */
.spine, .timeline-line, .central-line {
    display: none !important;
}

@media (max-width: 900px) {
    .hero-spread { flex-direction: column; text-align: center; }
    .hero-left { padding-left: 0; }
    .bento-grid { display: flex; flex-direction: column; }
    .video-card, .spotify-card, .photo-card { 
        width: 100%; 
        transform: none !important; 
        margin-bottom: 20px; 
    }
    .chapter-links { height: auto; display: flex; flex-direction: column; align-items: center; gap: 30px; }
    .chapter-box { position: relative; width: 85%; transform: rotate(0) !important; }
}

/* --- 9. THE MEDIA EXPLORER --- */
.explorer-window {
    max-width: 1000px;
    margin: 60px auto;
    background: #fff;
    border: 1px solid #000;
    box-shadow: 4px 4px 0px #000;
}

/* The Toolbar (Very 2000s) */
.explorer-toolbar {
    background: #f0f0f0;
    border-bottom: 1px solid #000;
    padding: 5px 10px;
    display: flex;
    gap: 15px;
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    text-transform: uppercase;
}

.explorer-toolbar span {
    cursor: pointer;
    padding: 2px 5px;
}

.explorer-toolbar span:hover {
    background: #000;
    color: #fff;
}

/* The File Grid */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
    padding: 30px;
    background: #fff;
    min-height: 400px;
}

.file-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    text-decoration: none;
    color: #000;
}

.file-icon-wrapper {
    width: 120px;
    height: 120px;
    border: 1px solid #eee;
    padding: 5px;
    background: #f9f9f9;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s ease;
}

.file-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    filter: contrast(1.1) grayscale(0.3);
}

.file-name {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    text-align: center;
    word-break: break-all;
}

/* Hover Effect: The "Selection" Blue */
.file-item:hover .file-icon-wrapper {
    background: #2e59ff; /* Saphi Blue */
    border-color: #000;
}

.file-item:hover .file-name {
    background: #2e59ff;
    color: #fff;
}