/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Paper & Ink Theme (Always Dark) */
    --bg: #111111;
    /* Deep charcoal “paper” */
    --bg-alt: #181818;
    /* Slightly raised paper */
    --text: #f4f2ef;
    /* Warm bright ink */
    --text-light: #a7a7a7;
    /* Secondary ink */
    --border: #2a2a2a;
    /* Print-like border */

    --primary: #66b3ff;
    /* Ink highlight (soft neon blue) */
    --primary-dark: #3380cc;

    --code-bg: #1a1a1a;
    /* Terminal-like */
}

body {
    font-family:
        "JetBrains Mono", "Fira Code", "Iosevka", "SF Mono", "Ubuntu Mono",
        monospace;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    background-image: url("/textures/dark_paper.png");
    /* optional */
    background-size: 600px;
    /* subtle, non-repeating grain */
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Navigation */
.navbar {
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
    text-decoration: none;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--primary);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg,
            var(--primary) 0%,
            var(--primary-dark) 100%);
    color: white;
    padding: 6rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

h1,
h2,
h3,
h4 {
    color: #ffffff;
    letter-spacing: -0.5px;
    font-weight: 700;
    text-shadow: 0 0 1px rgba(255, 255, 255, 0.1);
}

.tagline {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary {
    background: white;
    color: var(--primary);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background: white;
    color: var(--primary);
}

/* Content */
.content {
    padding: 4rem 0;
}

.content h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--text);
}

.content h2 {
    font-size: 2rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.content h3 {
    font-size: 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.content p {
    margin-bottom: 1rem;
}

.content a {
    color: var(--primary);
    text-decoration: none;
}

.content a:hover {
    text-decoration: underline;
}

.content ul,
.content ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.content code {
    background: var(--code-bg);
    padding: 0.25rem 0.4rem;
    border-radius: 4px;
    font-size: 0.95em;
    border: 1px solid #222;
}

.content pre {
    background: var(--code-bg);
    border: 1px solid #2a2a2a;
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.4);
}

.content pre code {
    background: none;
    padding: 0;
}

/* --- CARD SYSTEM --- */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.card {
    background: var(--bg-alt);
    padding: 2rem;
    border-radius: 8px;

    /* Subtle high-contrast border */
    border: 1px solid rgba(255, 255, 255, 0.06);

    /* Micro-elevation shadow */
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.015) inset;

    /* Paper texture inside the card */
    background-image: url("/textures/dark_paper.png");
    background-size: 600px;

    /* Slight lift on hover — tactile but not flashy */
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow:
        0 3px 6px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

.card h2,
.card h3 {
    margin-bottom: 1rem;
    color: white;
}

.card p {
    color: var(--text);
}

/* Prevent global wall-of-text feel */
.content-section,
.philosophy-points {
    column-count: 1 !important;
    width: 100%;
}

/* --------------------------------------------------------------
   MayaFlux Tutorial Component (global)
-------------------------------------------------------------- */

.tutorial-section {
    margin: 2rem 0;
}

.tutorial-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.tutorial-card {
    flex: 1 1 300px;
    background: var(--paper-2, rgba(255, 255, 255, 0.03));
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 1rem 1.2rem;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    transition: 0.25s ease;
    color: var(--text) !important;
}

.tutorial-card pre code {
    color: #f8f8f2 !important;
}

.tutorial-card ul li::marker,
.tutorial-expanded ul li::marker {
    color: var(--primary) !important;
}

.tutorial-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.tutorial-title {
    color: var(--accent-primary);
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.hint {
    opacity: 0.5;
    font-size: 0.85rem;
}

.tutorial-expanded {
    display: none;
    padding: 1rem;
    border-radius: 12px;
    margin-top: 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.tutorial-expanded p,
.tutorial-expanded li,
.tutorial-expanded summary {
    color: #ddd;
    line-height: 1.6;
}

/* make bullets subtle but elegant */
.tutorial-expanded ul li {
    margin: 0.25rem 0;
    padding-left: 0.4rem;
    border-left: 3px solid rgba(255, 255, 255, 0.08);
}

/* darker text for code explanations */
.tutorial-expanded code {
    color: #ffddb3;
}

/* DETAILS TAG STYLING */
details summary {
    cursor: pointer;
    font-weight: 600;
    margin: 0.5rem 0;
    color: var(--accent-primary);
}

details[open] summary {
    opacity: 0.8;
}

details {
    background: rgba(255, 255, 255, 0.03);
    padding: 0.6rem 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* CODE BLOCK DARK THEME BOOST */
pre code {
    font-size: 0.9rem;
    background: transparent !important;
    color: inherit;
}

/* MAKE THE CARD TEXT NOT BLACK */
.tutorial-card p,
.tutorial-card h3 {
    color: #ddd !important;
}

/* BULLET POP COLOR */
.tutorial-expanded ul li::marker {
    color: var(--accent-primary);
}

/* More comfortable spacing inside expanded panel */
.tutorial-expanded {
    padding: 1.5rem !important;
    color: #ddd;
}

.try-it {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.04);
    border-left: 3px solid var(--accent-primary);
    border-radius: 8px;
}

.try-note {
    opacity: 0.6;
    font-size: 0.9rem;
}

/* ============================
   Homepage Accordion 
===============================*/

.collapsible {
    cursor: pointer;
}

.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.collapsible-body {
    display: none;
    /* hidden by default */
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

/* optional: add a small icon */
.collapsible-header::after {
    content: "▸";
    transition: transform 0.2s ease;
    opacity: 0.7;
}

.collapsible.open .collapsible-header::after {
    transform: rotate(90deg);
}

hr {
    border: none;
    height: 1px;
    background: linear-gradient(to right,
            transparent,
            rgba(255, 255, 255, 0.35),
            transparent);
    margin: 3rem 0;
}

/* Footer */
footer {
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
    color: var(--text-light);
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }

    .tagline {
        font-size: 1rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .container {
        padding: 0 1rem;
    }
}
