:root {
    --primary: #1a365d;
    --accent: #d4af37;
    --bg-light: #f8f9fa;
    --bg-dark: #2d3748;
    --text-charcoal: #333;
    --text-white: #fff;
    --card-bg: rgba(255, 255, 255, 0.8);
    --shadow: 0 4px 6px rgba(0,0,0,0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text-charcoal);
    background-color: var(--bg-light);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, .italic {
    font-family: 'Playfair Display', serif;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 8rem 0;
}

.bg-light { background-color: #f0f4f8; }
.bg-dark { background-color: var(--bg-dark); color: var(--text-white); }
.center { text-align: center; }

/* Navbar */
#navbar {
    position: fixed;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 4rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.logo {
    font-weight: 800;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 2px;
}

#navbar ul {
    display: flex;
    list-style: none;
}

#navbar ul li {
    margin-left: 2rem;
}

#navbar ul li a {
    text-decoration: none;
    color: var(--text-charcoal);
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition);
}

#navbar ul li a:hover {
    color: var(--accent);
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(rgba(26, 54, 93, 0.7), rgba(26, 54, 93, 0.7)),
                url('bg-hero.png');
    background-size: cover;
    background-position: center;
    color: var(--text-white);
    text-align: center;
}

.hero-content h1 {
    font-size: 4.5rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.subtitle {
    font-size: 1.8rem;
    max-width: 800px;
    margin: 0 auto 1.5rem;
    opacity: 0.9;
}

.author {
    font-size: 1.2rem;
    font-weight: 300;
    letter-spacing: 1px;
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.arrow {
    width: 20px;
    height: 20px;
    border-bottom: 2px solid white;
    border-right: 2px solid white;
    transform: rotate(45deg);
    margin-top: 10px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: rotate(45deg) translate(0,0);}
    40% {transform: rotate(45deg) translate(10px,10px);}
    60% {transform: rotate(45deg) translate(5px,5px);}
}

/* Animations */
.fade-in {
    opacity: 0;
    animation: fadeIn 1s forwards;
}

.fade-in-delay {
    opacity: 0;
    animation: fadeIn 1s 0.5s forwards;
}

@keyframes fadeIn {
    to { opacity: 1; transform: translateY(0); }
    from { opacity: 0; transform: translateY(20px); }
}

/* Math Cards */
.math-demo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 3rem;
}

.math-card {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
}

.math-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.math-card.primary {
    background: var(--primary);
    color: var(--text-white);
}

.formula {
    font-size: 3rem;
    font-weight: 800;
    margin: 1.5rem 0;
}

/* Timeline */
.timeline-container {
    position: relative;
    padding: 4rem 0;
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 6px;
    background: #e2e8f0;
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -3px;
    border-radius: 10px;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    width: 50%;
    box-sizing: border-box;
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    right: -10px;
    background-color: white;
    border: 4px solid var(--primary);
    top: 15px;
    border-radius: 50%;
    z-index: 1;
}

.timeline-item.right {
    left: 50%;
}

.timeline-item.right::after {
    left: -10px;
}

.timeline-item.error::after {
    border-color: #e53e3e;
    background-color: #e53e3e;
}

.timeline-item .content {
    padding: 1.5rem;
    background: white;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.timeline-item.error .content {
    background: #fff5f5;
    border-left: 5px solid #e53e3e;
}

/* Theory */
.theory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    margin-top: 4rem;
}

.theory-card {
    background: rgba(255,255,255,0.05);
    padding: 3rem;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.theory-card:hover {
    background: rgba(255,255,255,0.1);
}

.theory-card .icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

.conjecture-box {
    margin-top: 4rem;
    padding: 3rem;
    background: var(--accent);
    color: var(--primary);
    border-radius: 20px;
    text-align: center;
}

.conjecture-box h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

/* Video */
.video-preview {
    margin-top: 3rem;
}

.btn-video {
    display: inline-block;
    padding: 1rem 2rem;
    background: #ff0000;
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 700;
    margin-top: 1.5rem;
    transition: var(--transition);
}

.btn-video:hover {
    transform: scale(1.05);
    background: #cc0000;
}

.video-thumb {
    width: 100%;
    max-width: 800px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    margin-top: 2rem;
}

footer {
    padding: 4rem 0;
    background: var(--primary);
    color: white;
    text-align: center;
}

/* Expanded Layouts */
.grid-2col {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 4rem;
    align-items: center;
}

.margin-note {
    background: #fffcf0;
    border-left: 4px solid var(--accent);
    padding: 2rem;
    margin: 2rem 0;
    font-style: italic;
    font-size: 1.2rem;
    color: #555;
    position: relative;
}

.info-card {
    background: var(--primary);
    color: white;
    padding: 3rem;
    border-radius: 30px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.15);
}

.info-card h3 {
    color: var(--accent);
    margin-bottom: 1rem;
}

/* The Bridge Grid */
.bridge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.step-card {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: var(--shadow);
    border-top: 5px solid #e2e8f0;
    transition: var(--transition);
}

.step-card:hover {
    transform: translateY(-5px);
}

.step-card.highlight {
    border-top-color: var(--accent);
    background: #fffdf5;
}

.step-card h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.text-wide {
    max-width: 900px;
    margin: 0 auto;
}

@media (max-width: 900px) {
    .grid-2col { grid-template-columns: 1fr; gap: 2rem; }
    .hero-content h1 { font-size: 3rem; }
}

@media (max-width: 768px) {
    #navbar { padding: 1rem 2rem; }
    #navbar ul { display: none; } /* Could add a hamburger, but keeping it simple for now */
    .math-demo { grid-template-columns: 1fr; }
    .timeline::after { left: 31px; }
    .timeline-item { width: 100%; padding-left: 70px; padding-right: 25px; }
    .timeline-item.right { left: 0; }
    .timeline-item::after { left: 21px; right: auto; }
    .section { padding: 4rem 0; }
}
