/* Design System & Reset - Sepia Paper Aesthetic */
:root {
    /* Sepia Paper Theme (Default) */
    --bg-color: #f4f0e8;
    --bg-secondary: #ebe7df;
    --text-primary: #383b3e;
    --text-secondary: #5a5d60;
    --accent-color: #6b4e3d;
    --accent-secondary: #8b7355;
    --glass-bg: rgba(56, 59, 62, 0.03);
    --glass-border: rgba(56, 59, 62, 0.12);
    --input-bg: #faf8f4;
    --input-border: #d4cfc4;
    --btn-bg: #383b3e;
    --btn-text: #f4f0e8;
    --glow-color: rgba(107, 78, 61, 0.08);

    --font-heading: 'Computer Modern Serif', 'Crimson Text', Georgia, serif;
    --font-body: 'Computer Modern Serif', 'Crimson Text', Georgia, serif;
    --transition-speed: 0.4s;
}

[data-theme="dark"] {
    --bg-color: #000000;
    --bg-secondary: #0a0a0a;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --accent-color: #666666;
    --accent-secondary: #555555;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.15);
    --input-bg: rgba(255, 255, 255, 0.08);
    --input-border: rgba(255, 255, 255, 0.25);
    --btn-bg: #ffffff;
    --btn-text: #000000;
    --glow-color: rgba(255, 255, 255, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    width: 100%;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.8;
    -webkit-font-smoothing: subpixel-antialiased;
    position: relative;
}

/* Subtle paper grain texture - matching notebook's clean look */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.15;
    z-index: 9999;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 600 600' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch' seed='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='1'/%3E%3C/svg%3E");
    background-size: 300px 300px;
}

[data-theme="dark"] body::before {
    opacity: 0;
}


/* Typography - LaTeX Paper Style */
h1,
h2,
h3 {
    font-family: var(--font-heading);
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: 0.02em;
    color: var(--text-primary);
    opacity: 1;
    text-rendering: geometricPrecision;
}

h1 {
    font-size: clamp(2rem, 6vw, 2.5rem);
    color: var(--text-primary);
    margin-bottom: 2rem;
    font-weight: 400;
    font-style: normal;
    letter-spacing: 0.01em;
}

p {
    color: var(--text-secondary);
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    max-width: 650px;
    margin: 0 auto 1em auto;
    font-weight: 400;
    letter-spacing: 0.015em;
    line-height: 1.7;
    text-align: justify;
}

a {
    color: var(--text-primary);
    text-decoration: underline;
}

a:hover {
    color: var(--accent-color);
}

a.reference {
    text-decoration: none;
    font-size: 0.75em;
    vertical-align: super;
}

a.reference:hover {
    text-decoration: underline;
}

/* Layout Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2.5rem;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Header */
header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 2.5rem 0;
    z-index: 100;
    background-color: var(--bg-color);
}

.nav-content {
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: 1.5rem;

    color: var(--text-primary);
    opacity: 1;

}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    top: 2.5rem;
    right: 2.5rem;
    background: var(--input-bg);
    border: 1.5px solid var(--input-border);
    cursor: pointer;
    color: var(--text-primary);
    padding: 0.625rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(56, 59, 62, 0.08);
    z-index: 101;
}

.theme-toggle:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--bg-color);
    transform: rotate(20deg);
    box-shadow: 0 2px 6px rgba(56, 59, 62, 0.15);
}

[data-theme="light"] .sun-icon {
    display: block;
}

[data-theme="light"] .moon-icon {
    display: none;
}

[data-theme="dark"] .sun-icon {
    display: none;
}

[data-theme="dark"] .moon-icon {
    display: block;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    text-align: center;
    position: relative;
    padding-top: 12rem;
    padding-bottom: 4rem;
}

.hero-content {
    z-index: 10;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    animation-delay: 0.3s;
}

/* Background Effects - Subtle paper fade */
.glow {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--glow-color) 0%, transparent 65%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 1;
    transition: opacity 0.5s ease;
    opacity: 0.5;
}

[data-theme="dark"] .glow {
    opacity: 0.3;
}

[data-theme="light"] .glow {
    opacity: 0.5;
}

@keyframes pulse-transform {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* Geometric Art System */
.shapes-container {
    position: relative;
    width: 100%;
    pointer-events: none;
    z-index: 10;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 1rem;
    margin-bottom: 3rem;
}

.art-system {
    width: 100%;
    height: auto;
    max-width: 400px;
    max-height: 400px;
    opacity: 0.2;
    filter: blur(0.3px);
    /* Subtle base opacity with slight blur for pencil effect */
}

/* Mathematical scatter plot aesthetic - like notebook */
.scatter-point {
    fill: var(--text-primary);
    opacity: 0.95;
    stroke: none;
}

.flow-line {
    fill: none;
    stroke: var(--text-primary);
    stroke-width: 1.5;
    opacity: 0.12;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* LaTeX Equation Styling */
.equation-container {
    margin-top: 2.5rem;
    margin-bottom: 0.5rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    animation-delay: 0.4s;
    padding: 1.5rem 2rem;
    background: rgba(56, 59, 62, 0.02);
    border: 1.5px solid rgba(56, 59, 62, 0.08);
    border-radius: 4px;
    display: inline-block;
    box-shadow: 0 2px 6px rgba(56, 59, 62, 0.04);
}

.equation-text {
    margin: 0;
    font-family: var(--font-heading);
    color: var(--text-primary);
    font-size: 1.1rem;
}

/* MathJax styling overrides */
.MathJax {
    color: var(--text-primary) !important;
}

/* Input & Button */
.cta-form {
    margin-top: 2.5rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    animation-delay: 0.6s;
}

input[type="email"] {
    background: var(--input-bg);
    border: 2px solid var(--input-border);
    padding: 1rem 1.5rem;
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font-body);
    width: 320px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    box-shadow: 0 2px 4px rgba(56, 59, 62, 0.06);
}

input[type="email"]::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

input[type="email"]:focus {
    border-color: var(--accent-color);
    box-shadow: 0 3px 8px rgba(56, 59, 62, 0.12);
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--btn-bg);
    color: var(--btn-text);
    border: 2px solid var(--btn-bg);
    padding: 1rem 2rem;
    border-radius: 4px;
    font-weight: 500;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1rem;
    letter-spacing: 0.025em;
    box-shadow: 0 2px 8px rgba(56, 59, 62, 0.15);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(56, 59, 62, 0.22);
    background: var(--accent-color);
    border-color: var(--accent-color);
}

.btn-primary:active {
    transform: translateY(0px);
}

/* Footer */
footer {
    position: absolute;
    bottom: 3rem;
    width: 100%;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
    opacity: 0.7;
    font-family: var(--font-body);
}

/* Animations */
@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 1.5rem;
    }

    h1 {
        font-size: 2.75rem;
    }

    .theme-toggle {
        top: 1.5rem;
        right: 1.5rem;
    }

    .equation-container {
        padding: 1rem 1.5rem;
        margin-top: 2rem;
    }

    .equation-text {
        font-size: 0.95rem;
    }

    .cta-form {
        flex-direction: column;
        align-items: center;
        width: 100%;
        padding: 0 1rem;
    }

    input[type="email"] {
        width: 100%;
        max-width: 100%;
    }

    .btn-primary {
        width: 100%;
    }

    .hero::after {
        width: 250px;
        height: 250px;
    }

    .art-system {
        opacity: 0.15;
    }
}