/* ============================================
   The Source Protocol — Site Styles
   ============================================ */

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

:root {
    --bg: #0a0a0f;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);
    --border: rgba(255, 255, 255, 0.08);
    --border-accent: rgba(123, 92, 201, 0.3);
    --text: #e0e0e8;
    --text-dim: #888899;
    --text-bright: #ffffff;
    --accent: #7b5cc9;
    --accent-glow: rgba(123, 92, 201, 0.15);
    --blue: #3b82f6;
    --green: #22c55e;
    --amber: #f59e0b;
    --section-gap: 8rem;
    --content-width: 900px;
    --wide-width: 1100px;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

/* --- Typography --- */
h1, h2, h3, h4 {
    color: var(--text-bright);
    font-weight: 400;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

h1 { font-size: 3.5rem; font-weight: 300; letter-spacing: -0.02em; }
h2 { font-size: 2rem; margin-bottom: 1rem; }
h3 { font-size: 1.3rem; margin-bottom: 0.5rem; }

.section-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--accent);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

/* --- Layout --- */
.container {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.wide {
    max-width: var(--wide-width);
}

section {
    padding: var(--section-gap) 0;
    position: relative;
}

section + section {
    border-top: 1px solid var(--border);
}

/* --- Navigation --- */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: transform 0.3s ease;
}

nav.hidden {
    transform: translateY(-100%);
}

nav .nav-inner {
    max-width: var(--wide-width);
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

nav .logo {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-bright);
    letter-spacing: 0.05em;
    text-decoration: none;
}

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

nav .nav-links a {
    font-size: 0.8rem;
    color: var(--text-dim);
    text-decoration: none;
    letter-spacing: 0.03em;
    transition: color 0.2s;
}

nav .nav-links a:hover,
nav .nav-links a.active {
    color: var(--text-bright);
}

/* --- Hero --- */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    padding-top: 56px;
}

#hero .hero-bg {
    position: absolute;
    inset: 0;
    background-image: url('https://api.gamaedor.com/eyes/gen_20260221_115018_a05781.jpg');
    background-size: cover;
    background-position: center;
    opacity: 0.15;
    filter: blur(2px);
}

#hero .hero-content {
    position: relative;
    z-index: 1;
    max-width: 700px;
    padding: 2rem;
}

#hero h1 {
    margin-bottom: 1.5rem;
}

#hero .tagline {
    font-size: 1.15rem;
    color: var(--text-dim);
    line-height: 1.8;
    margin-bottom: 2rem;
}

#hero .hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 3rem;
}

#hero .hero-stat {
    text-align: center;
}

#hero .hero-stat .num {
    font-size: 2.5rem;
    font-weight: 300;
    color: var(--accent);
    display: block;
    line-height: 1;
    margin-bottom: 0.3rem;
}

#hero .hero-stat .label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-dim);
}

.scroll-hint {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    animation: pulse 2s ease-in-out infinite;
    color: var(--text-dim);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
}

@keyframes pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

/* --- Cards --- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    transition: background 0.2s, border-color 0.2s;
}

.card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-accent);
}

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

.card .card-tag {
    display: inline-block;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent);
    background: var(--accent-glow);
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.card .card-title {
    font-size: 1rem;
    color: var(--text-bright);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.card .card-body {
    font-size: 0.88rem;
    color: var(--text-dim);
    line-height: 1.6;
}

.card .card-footer {
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-dim);
    opacity: 0.7;
}

/* --- Overview / Central Claim --- */
.central-claim {
    font-size: 1.25rem;
    line-height: 1.8;
    color: var(--text);
    border-left: 3px solid var(--accent);
    padding-left: 1.5rem;
    margin: 2rem 0;
}

.central-claim strong {
    color: var(--text-bright);
}

/* --- Collapsibles (Propositions) --- */
.collapsible {
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.collapsible-header {
    padding: 1rem 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-card);
    transition: background 0.2s;
    user-select: none;
}

.collapsible-header:hover {
    background: var(--bg-card-hover);
}

.collapsible-header .tag {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-glow);
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    flex-shrink: 0;
    min-width: 2.5rem;
    text-align: center;
}

.collapsible-header .title {
    font-size: 0.95rem;
    color: var(--text-bright);
    flex: 1;
}

.collapsible-header .arrow {
    color: var(--text-dim);
    transition: transform 0.3s;
    font-size: 0.8rem;
}

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

.collapsible-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.collapsible.open .collapsible-body {
    max-height: 500px;
}

.collapsible-content {
    padding: 0 1.5rem 1.25rem;
    font-size: 0.88rem;
    color: var(--text-dim);
    line-height: 1.7;
}

.collapsible-content .premises {
    margin-top: 0.75rem;
    font-size: 0.78rem;
    color: var(--accent);
}

/* --- Geometry Section --- */
.metric-display {
    background: rgba(123, 92, 201, 0.08);
    border: 1px solid var(--border-accent);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    margin: 2rem 0;
}

.metric-display .katex {
    font-size: 1.4rem;
}

.geometry-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 2rem 0;
}

.geometry-image {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.geometry-image img {
    width: 100%;
    height: auto;
    display: block;
    opacity: 0.85;
    transition: opacity 0.3s;
}

.geometry-image:hover img {
    opacity: 1;
}

.geometry-image .caption {
    padding: 0.75rem 1rem;
    font-size: 0.78rem;
    color: var(--text-dim);
    background: var(--bg-card);
}

.equation-block {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin: 1rem 0;
    overflow-x: auto;
}

.equation-block .eq-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
}

/* --- Predictions --- */
.prediction-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
}

.prediction-card .pred-num {
    font-size: 2rem;
    font-weight: 300;
    color: var(--accent);
    line-height: 1;
    flex-shrink: 0;
    width: 2.5rem;
    text-align: center;
}

.prediction-card .pred-body h3 {
    font-size: 1rem;
    margin-bottom: 0.4rem;
}

.prediction-card .pred-body p {
    font-size: 0.88rem;
    color: var(--text-dim);
    line-height: 1.6;
}

.result-highlight {
    display: inline-block;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 4px;
    padding: 0.15rem 0.6rem;
    font-size: 0.85rem;
    color: var(--green);
}

/* --- Timeline --- */
.timeline {
    position: relative;
    padding-left: 2rem;
    margin-top: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent), var(--border));
}

.timeline-item {
    position: relative;
    padding-bottom: 2.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2rem;
    top: 0.4rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg);
    transform: translateX(-4px);
}

.timeline-item .tl-date {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent);
    margin-bottom: 0.3rem;
}

.timeline-item h3 {
    font-size: 1.05rem;
    margin-bottom: 0.4rem;
}

.timeline-item p {
    font-size: 0.88rem;
    color: var(--text-dim);
    line-height: 1.6;
}

/* --- Footer --- */
footer {
    padding: 3rem 0;
    border-top: 1px solid var(--border);
    text-align: center;
}

footer p {
    font-size: 0.8rem;
    color: var(--text-dim);
    line-height: 2;
}

footer .author {
    color: var(--text);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    :root { --section-gap: 5rem; }
    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.5rem; }

    nav .nav-links { display: none; }

    #hero .hero-stats {
        flex-direction: column;
        gap: 1.5rem;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .geometry-grid {
        grid-template-columns: 1fr;
    }

    .metric-display .katex {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    h1 { font-size: 1.8rem; }
    .container { padding: 0 1.25rem; }
}
