@import 'variables.css';
@import 'mobile-nav.css';

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

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

body {
    font-family: var(--font-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

ul {
    list-style: none;
}

/* Utilities */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.text-center {
    text-align: center;
}

.flex {
    display: flex;
}

.grid {
    display: grid;
}

.hidden {
    display: none;
}

/* Navigation */
.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--color-border);
}

.nav-logo {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 1.5rem;
    letter-spacing: -0.05em;
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    gap: var(--spacing-md);
    font-family: var(--font-ui);
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

.btn-cta {
    background-color: var(--color-text-primary);
    color: var(--color-text-inverse);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-ui);
    font-weight: 600;
    font-size: 0.9rem;
}

.btn-cta:hover {
    background-color: var(--color-novus);
    color: #fff;
}

/* Hero Section */
.hero {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at center, rgba(15, 118, 110, 0.1) 0%, rgba(248, 250, 252, 0) 70%);
}

.hero-headline {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    max-width: 900px;
    margin-bottom: var(--spacing-md);
    letter-spacing: -0.03em;
}

.hero-subhead {
    font-size: 1.25rem;
    font-family: var(--font-ui);
    color: #64748B;
    /* Slate 500 */
    max-width: 600px;
    margin-bottom: var(--spacing-lg);
}

/* Three Trusts Cards */
.trusts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.trust-card {
    padding: var(--spacing-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    background: white;
}

.trust-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
}

.trust-card h3 {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.trust-gaia h3 {
    color: var(--color-gaia);
}

.trust-demos h3 {
    color: var(--color-demos);
}

.trust-novus h3 {
    color: var(--color-novus);
}

.trust-card p {
    font-size: 0.95rem;
    color: #475569;
}

/* Diagnosis Page Visuals */
.diagnosis-section {
    padding: var(--spacing-lg) 0;
    border-bottom: 1px solid var(--color-border);
}

.stat-card {
    background: white;
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--color-demos);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin: var(--spacing-sm) 0;
}

.diagnosis-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

@media screen and (max-width: 768px) {
    .diagnosis-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--color-bg-dark);
    display: block;
    margin-bottom: 0.5rem;
}

.stat-source {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 1rem;
    display: block;
    font-style: italic;
}

/* Diagram: Loop of Doom */
/* Diagram: Loop of Doom (Linear) */
.loop-diagram {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 2rem 0;
    flex-wrap: wrap;
}

.loop-node {
    background: var(--color-bg-dark);
    color: white;
    padding: 1rem;
    border-radius: var(--radius-md);
    font-weight: bold;
    font-family: var(--font-heading);
}

.loop-arrow {
    font-size: 1.5rem;
    color: var(--color-novus);
}

@media screen and (max-width: 768px) {
    .loop-diagram {
        flex-direction: column;
    }

    .loop-arrow {
        transform: rotate(90deg);
    }
}

/* Strategy Page Timeline */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 0;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 2px;
    background-color: var(--color-border);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -1px;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 50%;
}

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

.timeline-left {
    left: 0;
}

.timeline-right {
    left: 50%;
}

.timeline-left::before {
    content: " ";
    height: 0;
    position: absolute;
    top: 22px;
    width: 0;
    z-index: 1;
    right: 30px;
    border: medium solid white;
    border-width: 10px 0 10px 10px;
    border-color: transparent transparent transparent white;
}

.timeline-right::before {
    content: " ";
    height: 0;
    position: absolute;
    top: 22px;
    width: 0;
    z-index: 1;
    left: 30px;
    border: medium solid white;
    border-width: 10px 10px 10px 0;
    border-color: transparent white transparent transparent;
}

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

.timeline-content {
    padding: 20px 30px;
    background-color: white;
    position: relative;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

@media screen and (max-width: 600px) {
    .timeline::after {
        left: 31px;
    }

    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
    }

    .timeline-item::before {
        left: 60px;
        border: medium solid white;
        border-width: 10px 10px 10px 0;
        border-color: transparent white transparent transparent;
    }

    .timeline-left::after,
    .timeline-right::after {
        left: 21px;
    }

    .timeline-right {
        left: 0%;
    }
}

/* -------------------------------------------
   THE CHARTER READER (Deep Read Interface)
   ------------------------------------------- */

.charter-page {
    /* GLOBAL DRAWER LAYOUT */
    display: block;
    min-height: 100vh;
}

/* Sidebar TOC */
/* Sidebar TOC (Global Drawer Style) */
.charter-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 280px;
    background: white;
    z-index: 1000;
    border-right: 1px solid var(--color-border);
    padding: var(--spacing-md);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    opacity: 0;
    /* Hidden by default */
    visibility: hidden;
    overflow-y: auto;
}

.charter-sidebar.active {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
}

.toc-title {
    font-family: var(--font-heading);
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    color: #64748B;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.toc-list li {
    margin-bottom: 0.5rem;
}

.toc-link {
    display: block;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    color: var(--color-text-primary);
    font-size: 0.9rem;
    font-family: var(--font-ui);
    transition: all 0.2s;
}

.toc-link:hover,
.toc-link.active {
    background: rgba(15, 118, 110, 0.1);
    color: var(--color-gaia);
    padding-left: 0.75rem;
}

/* Main Charter Content */
.charter-content {
    background: white;
    padding-bottom: 8rem;
}

/* Sticky Toggle Header */
.charter-controls {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
    padding: 1rem var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.control-label {
    font-family: var(--font-ui);
    font-weight: 600;
    font-size: 0.9rem;
    color: #475569;
}

/* The Toggle Switch */
.toggle-switch {
    display: flex;
    background: var(--color-bg-light);
    padding: 4px;
    border-radius: 99px;
    border: 1px solid var(--color-border);
    cursor: pointer;
}

.toggle-option {
    padding: 6px 16px;
    border-radius: 99px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: var(--font-ui);
    transition: all 0.3s ease;
}

.toggle-option.active {
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    color: var(--color-gaia);
}

.toggle-option.inactive {
    color: #94a3b8;
}

/* Charter Text Typography */
.charter-article {
    max-width: 800px;
    margin: 0 auto;
    padding: 4rem var(--spacing-md);
    border-bottom: 1px solid var(--color-border);
}

.charter-article h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--color-text-primary);
}

.charter-article h3 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #334155;
}

/* MODE: LEGAL (Serif) */
.text-legal {
    font-family: var(--font-body);
    font-size: 1.15rem;
    line-height: 1.8;
    color: #1e293b;
}

.text-legal p {
    margin-bottom: 1.5rem;
}

.text-legal ul {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
    list-style-type: disc;
}

/* MODE: SIMPLE (Sans-Serif) */
.text-simple {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    line-height: 1.7;
    color: #0f172a;
    background: #F0FDFA;
    /* Light Teal Tint */
    padding: 2rem;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--color-gaia);
}

.text-simple p {
    margin-bottom: 1rem;
}

.text-simple .highlight {
    font-weight: 700;
    color: var(--color-gaia);
}

/* Visibility States */
.hidden {
    display: none !important;
}

/* Interactive Definitions (Tooltips) */
.term-def {
    border-bottom: 1px dotted var(--color-novus);
    cursor: help;
    color: var(--color-text-primary);
}

/* GLOBAL SIDEBAR CONTROLS */

/* Toggle Button (Always Visible) */
.sidebar-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    border: 1px solid var(--color-border);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font-ui);
    font-weight: 600;
    color: var(--color-text-primary);
    font-size: 0.9rem;
    margin-right: auto;
}

.charter-controls {
    gap: 0.5rem;
}

/* Overlay (Always available) */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
    display: none;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
    display: block;
}

/* Mobile Adjustments */
@media screen and (max-width: 768px) {
    .charter-sidebar {
        width: 85%;
        max-width: 320px;
    }

    .control-label {
        display: none;
    }
}