/* ==========================================================
   3KOLONA — shared stylesheet
   Used by index.html, books.html and every page in /books/.
   Change a colour here and it changes everywhere.
   ========================================================== */

:root {
    --space-bg: #0D1117;
    --atom-cyan: #00F5FF;
    --violet: #7000FF;
    --lab-white: #F0F6FC;
    --gray: #8b949e;
    --dim: #484f58;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
    --nav-height: 70px;
    --mono: 'JetBrains Mono', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    background-color: var(--space-bg); color: var(--lab-white);
    font-family: 'Inter', sans-serif; line-height: 1.6; overflow-x: hidden;
}
a { color: var(--atom-cyan); }

/* ---------- NAV ---------- */
nav {
    position: fixed; top: 0; width: 100%; z-index: 1000;
    background: rgba(13, 17, 23, 0.9); backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--glass-border); padding: 0 5%;
    height: var(--nav-height); display: flex; justify-content: space-between; align-items: center;
}
.nav-logo { font-weight: 800; font-family: var(--mono); color: var(--atom-cyan); font-size: 0.9rem; text-decoration: none; }
.nav-links a {
    color: var(--lab-white); text-decoration: none; margin-left: 1.5rem;
    font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px;
}
.nav-links a:hover, .nav-links a.current { color: var(--atom-cyan); }

/* ---------- HERO (home page) ---------- */
.hero {
    height: 100vh; width: 100%; position: relative;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    text-align: center; padding: 0 8%; overflow: hidden;
}
#particles-js { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; }
.hero-content { position: relative; z-index: 5; max-width: 900px; }
.hero h1 { font-size: clamp(2.2rem, 8vw, 4.5rem); font-weight: 800; margin-bottom: 1.5rem; line-height: 1.1; letter-spacing: -2px; }
.hero p { margin-bottom: 2rem; }

/* ---------- SECTIONS ---------- */
.section-container { padding: 5rem 8%; position: relative; z-index: 10; scroll-margin-top: var(--nav-height); }
.section-title { font-size: clamp(1.8rem, 5vw, 2.5rem); margin-bottom: 1rem; }
.section-lead { color: var(--gray); margin-bottom: 3rem; max-width: 700px; }
.header-meta {
    font-family: var(--mono); color: var(--atom-cyan); font-size: 0.75rem;
    text-transform: uppercase; letter-spacing: 2px; margin-bottom: 1rem;
}

/* ---------- CARD GRID ---------- */
.project-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem; margin-top: 3rem;
}
.project-card {
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: 24px; padding: 2.5rem;
    display: flex; flex-direction: column;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.project-card:hover { border-color: var(--atom-cyan); transform: translateY(-10px); background: rgba(0, 245, 255, 0.02); }
.card-icon { font-size: 2.5rem; margin-bottom: 1.5rem; display: block; }
.card-title { color: var(--atom-cyan); font-family: var(--mono); margin-bottom: 1rem; font-size: 1.1rem; }
.card-sub { color: var(--lab-white); font-size: 0.85rem; margin: -0.5rem 0 1rem; opacity: 0.8; }
.card-text { color: var(--gray); font-size: 0.95rem; margin-bottom: 2rem; min-height: 3em; flex-grow: 1; }
.card-link {
    color: var(--atom-cyan); text-decoration: none; font-family: var(--mono);
    font-size: 0.8rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px;
}
.card-link:hover { text-decoration: underline; }

/* ---------- BUTTONS ---------- */
.btn-action {
    background: var(--atom-cyan); color: var(--space-bg); text-decoration: none;
    padding: 1rem; border-radius: 8px; font-weight: 800; font-size: 0.8rem;
    text-align: center; display: inline-block; text-transform: uppercase;
    border: none; cursor: pointer; width: 100%;
}
.btn-auto { width: auto; padding: 1.2rem 2.5rem; }
.btn-outline {
    display: inline-block; background: transparent; color: var(--atom-cyan);
    border: 1px solid var(--atom-cyan); padding: 1rem 2.5rem; border-radius: 8px;
    text-decoration: none; font-weight: 800; font-size: 0.8rem;
    text-transform: uppercase; letter-spacing: 1px; transition: all 0.3s ease;
}
.btn-outline:hover { background: rgba(0, 245, 255, 0.1); transform: translateY(-2px); }
.center-row { text-align: center; margin-top: 3rem; }

/* ---------- CONTACT FORM ---------- */
.contact-form { max-width: 600px; margin: 4rem auto; background: var(--glass-bg); padding: 3rem; border-radius: 24px; border: 1px solid var(--glass-border); }
.form-input {
    width: 100%; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--glass-border);
    padding: 1rem; color: white; border-radius: 10px; margin-bottom: 1rem; font-size: 16px; font-family: inherit;
}
.form-note { font-size: 0.65rem; color: var(--dim); margin-top: 1.5rem; text-align: center; line-height: 1.4; }
.grecaptcha-badge { visibility: hidden; }

/* ---------- LIBRARY PAGE ---------- */
.page-header { padding: calc(var(--nav-height) + 4rem) 8% 1rem; }
.page-header h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; letter-spacing: -1px; line-height: 1.1; margin-bottom: 1rem; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 2rem; }
.filter-btn {
    background: transparent; color: var(--gray); border: 1px solid var(--glass-border);
    padding: 0.5rem 1rem; border-radius: 999px; font-family: var(--mono); font-size: 0.75rem;
    cursor: pointer; transition: 0.2s;
}
.filter-btn:hover { color: var(--lab-white); border-color: var(--gray); }
.filter-btn.active { color: var(--space-bg); background: var(--atom-cyan); border-color: var(--atom-cyan); }
.empty-note { color: var(--gray); font-family: var(--mono); font-size: 0.9rem; }

/* ---------- BOOK PAGE ---------- */
.book-header { padding: calc(var(--nav-height) + 4rem) 10% 2rem; }
.book-header h1 { font-size: clamp(2rem, 5vw, 3.5rem); letter-spacing: -2px; line-height: 1.1; margin-bottom: 1rem; }
.book-byline { color: var(--gray); font-size: 1.1rem; }
.book-byline strong { color: var(--lab-white); font-weight: 500; }

.content-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 4rem; padding: 0 10% 5rem; }
.whitepaper-box {
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: 24px; padding: 4rem; min-width: 0;
}
.whitepaper-box h2 { color: var(--atom-cyan); margin: 3rem 0 1.5rem; font-size: 1.6rem; font-weight: 800; scroll-margin-top: 100px; }
.whitepaper-box h2:first-child { margin-top: 0; }
.whitepaper-box h3 { color: var(--lab-white); margin: 2rem 0 1rem; font-size: 1.2rem; }
.whitepaper-box p, .whitepaper-box li { color: var(--gray); font-size: 1.05rem; line-height: 1.8; }
.whitepaper-box p { margin-bottom: 1.5rem; }
.whitepaper-box ul, .whitepaper-box ol { margin: 0 0 1.5rem 1.5rem; }
.whitepaper-box li { margin-bottom: 0.5rem; }
.whitepaper-box strong { color: var(--lab-white); }
.whitepaper-box blockquote {
    border-left: 2px solid var(--violet); padding: 0.5rem 0 0.5rem 1.5rem; margin: 0 0 1.5rem;
    background: rgba(112, 0, 255, 0.05); border-radius: 0 12px 12px 0;
}
.whitepaper-box blockquote p { margin-bottom: 0.5rem; font-style: italic; }
.whitepaper-box mark { background: rgba(0, 245, 255, 0.15); color: var(--lab-white); padding: 0 0.2em; border-radius: 3px; }
.whitepaper-box table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; font-size: 0.95rem; }
.whitepaper-box th, .whitepaper-box td { border-bottom: 1px solid var(--glass-border); padding: 0.6rem; text-align: left; color: var(--gray); }
.whitepaper-box th { color: var(--lab-white); }
.whitepaper-box code { font-family: var(--mono); font-size: 0.9em; background: rgba(255,255,255,0.06); padding: 0.1em 0.4em; border-radius: 4px; }
.whitepaper-box hr { border: none; border-top: 1px solid var(--glass-border); margin: 2.5rem 0; }

.sidebar { position: sticky; top: 100px; height: fit-content; }
.toc-container { margin-bottom: 3rem; }
.sidebar h4 { font-family: var(--mono); font-size: 0.7rem; color: var(--gray); margin-bottom: 1rem; text-transform: uppercase; letter-spacing: 2px; }
.toc-list { list-style: none; border-left: 1px solid var(--glass-border); }
.toc-list a {
    display: block; padding: 0.5rem 0 0.5rem 1.5rem; color: var(--gray);
    text-decoration: none; font-size: 0.9rem; transition: 0.3s; position: relative;
}
.toc-list a.active { color: var(--atom-cyan); font-weight: 600; }
.toc-list a.active::before {
    content: ""; position: absolute; left: -1px; top: 0; bottom: 0;
    width: 2px; background: var(--atom-cyan); box-shadow: 0 0 10px var(--atom-cyan);
}
.data-card {
    background: rgba(112, 0, 255, 0.05); border: 1px solid var(--violet);
    padding: 2rem; border-radius: 16px; margin-bottom: 2rem;
}
.data-card.cyan { border-color: var(--atom-cyan); background: rgba(0, 245, 255, 0.05); }
.data-card p { color: var(--lab-white); font-size: 0.95rem; }
.fact-list { list-style: none; font-size: 0.9rem; }
.fact-list li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.4rem 0; border-bottom: 1px solid var(--glass-border); }
.fact-list li:last-child { border-bottom: none; }
.fact-list span:first-child { color: var(--gray); font-family: var(--mono); font-size: 0.75rem; text-transform: uppercase; }
.fact-list span:last-child { text-align: right; }

/* ---------- FOOTER ---------- */
.site-footer { text-align: center; padding: 3rem 8% 4rem; color: var(--dim); font-size: 0.75rem; font-family: var(--mono); }

/* ---------- MOBILE ---------- */
@media (max-width: 1024px) {
    .content-grid { grid-template-columns: 1fr; padding: 0 5% 4rem; gap: 2rem; }
    .sidebar { position: static; }
    .toc-container { display: none; }
    .whitepaper-box { padding: 2rem; }
    .book-header { padding-left: 5%; padding-right: 5%; }
}
@media (max-width: 768px) {
    .nav-links a { margin-left: 1rem; }
    .nav-links a.hide-mobile { display: none; }
    .section-container { padding: 4rem 5%; }
    .page-header { padding-left: 5%; padding-right: 5%; }
    .contact-form { padding: 2rem; }
}
