/* =========================================
   THE ARCHIVE // PHYSICS STYLES
   ========================================= */

:root {
    /* DARK MODE (Default) */
    --bg: #050505;
    --card: #0a0a0a;
    --text: #e0e0e0;
    --dim: #666;
    --accent: #00f3ff; /* Electric Cyan */
    --border: rgba(0, 243, 255, 0.15);
    --hover-bg: rgba(0, 243, 255, 0.03);
    --nav-bg: rgba(5, 5, 5, 0.8);
    --grid-line: rgba(255, 255, 255, 0.03);
}

/* LIGHT MODE (Lab Notebook) */
body.light-mode {
    --bg: #ffffff;
    --card: #f8f9fa; /* Light grey card */
    --text: #1a1a1a;
    --dim: #555;
    --accent: #008c9e; /* Darker Teal for visibility */
    --border: rgba(0, 140, 158, 0.2);
    --hover-bg: rgba(0, 140, 158, 0.08);
    --nav-bg: rgba(255, 255, 255, 0.9);
    --grid-line: rgba(0, 0, 0, 0.05); /* Faint pencil grid */
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* --- BACKGROUND EFFECTS --- */
.grid-bg {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -2;
    background-image: 
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 50px 50px;
    transform: perspective(500px) rotateX(20deg) scale(1.2);
    transform-origin: top;
    opacity: 0.4;
    pointer-events: none;
    transition: background-image 0.3s ease;
}

canvas {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    opacity: 0.4; 
    pointer-events: none;
}

/* --- NAVIGATION --- */
nav {
    padding: 30px 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    background: var(--nav-bg);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background 0.3s ease;
}

.logo {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: -1px;
    font-size: 1.1rem;
}
.logo span { color: var(--accent); }

.nav-right {
    display: flex;
    align-items: center;
}

.nav-right a, .nav-right button {
    font-family: 'JetBrains Mono', monospace;
    color: var(--dim);
    text-decoration: none;
    font-size: 0.85rem;
    margin-left: 30px;
    transition: 0.2s;
    background: none;
    border: none;
    cursor: pointer;
}
.nav-right a:hover, .nav-right button:hover { color: var(--accent); }
.nav-active { color: var(--text) !important; border-bottom: 1px solid var(--accent); }

/* --- HERO SECTION --- */
header {
    padding: 120px 50px 80px 50px;
    max-width: 1200px;
    margin: 0 auto;
}

h1 {
    font-family: 'Inter', sans-serif;
    font-size: 4.5rem;
    font-weight: 800;
    letter-spacing: -3px;
    margin-bottom: 20px;
    line-height: 0.95;
    background: linear-gradient(to right, var(--text), var(--dim));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent);
    font-size: 0.9rem;
    border-left: 2px solid var(--accent);
    padding-left: 20px;
    max-width: 600px;
    line-height: 1.6;
    margin-top: 30px;
}

/* --- SECTIONS --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 50px 100px 50px;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 40px;
    margin-top: 80px;
}

.section-num {
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent);
    font-size: 0.8rem;
}

.section-line {
    height: 1px;
    background: var(--border);
    flex: 1;
}

.section-title {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    color: var(--dim);
    letter-spacing: 1px;
}

/* --- TOOLS GRID --- */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.tool-card {
    background: var(--card);
    border: 1px solid #222;
    padding: 35px;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.tool-card::before {
    content: ''; position: absolute; top: 0; left: 0; width: 2px; height: 0%; background: var(--accent); transition: 0.3s;
}

.tool-card:hover {
    border-color: var(--border);
    background: var(--hover-bg);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 243, 255, 0.05);
}

.tool-card:hover::before { height: 100%; }

.tool-icon {
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent);
    font-size: 0.8rem;
    margin-bottom: 20px;
    background: rgba(0, 243, 255, 0.1);
    width: fit-content;
    padding: 5px 10px;
    border-radius: 4px;
}

.tool-card h3 {
    color: var(--text);
    font-size: 1.5rem;
    margin-bottom: 10px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
}

.tool-card p {
    color: var(--dim);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-top: auto;
}

/* --- FILE SYSTEM LIST (ARCHIVE) --- */
.file-list {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--border);
}

.file-row {
    display: grid;
    grid-template-columns: 60px 3fr 1fr 100px 40px; /* Icon | Name | Tag | Size | DL */
    align-items: center;
    padding: 20px;
    text-decoration: none;
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
    transition: 0.2s;
}

.file-row:hover {
    background: var(--hover-bg);
    padding-left: 30px; /* Slight nudge right */
}

.file-row:hover .file-icon { color: var(--accent); }

.file-icon { color: var(--dim); transition: 0.2s; }

.file-name { font-weight: 500; }

.file-tag { 
    font-size: 0.7rem; 
    background: var(--card); 
    padding: 4px 8px; 
    border-radius: 4px; 
    width: fit-content; 
    color: var(--dim);
    text-align: center;
    border: 1px solid #333;
}

.file-size { color: var(--dim); text-align: right; font-size: 0.8rem; }

.dl-arrow { opacity: 0; color: var(--accent); transition: 0.2s; }
.file-row:hover .dl-arrow { opacity: 1; }


/* --- FOOTER --- */
footer {
    border-top: 1px solid var(--border);
    padding: 50px;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--dim);
    background: var(--bg);
}

@media (max-width: 768px) {
    .file-row { grid-template-columns: 30px 1fr 40px; gap: 10px; }
    .file-tag, .file-size { display: none; }
    h1 { font-size: 3rem; }
    nav { padding: 20px; }
    header { padding: 80px 20px; }
    .container { padding: 0 20px 100px 20px; }
}