/* 
 * The Impossible Distance Collective
 * Constitutional Artifact Design System
 * 
 * Design Doctrine:
 * The site should feel like a constitutional artifact, not a brand.
 * Privilege legibility, dignity, speed, and epistemic seriousness.
 * Typographic hierarchy and whitespace do all structural work.
 * Performance is a moral value.
 */

/* ===== BASE RESET ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== ROOT VARIABLES ===== */
:root {
    /* Colors - substrate honest */
    --text-primary: #1a1a1a;
    --text-secondary: #4a4a4a;
    --background: #f9f9f7;  /* warm off-white, not pure white */
    --accent: #666666;
    --rule: #cccccc;
    
    /* Typography - system-safe, morally aligned */
    --font-body: Georgia, 'Times New Roman', serif;
    --font-heading: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    
    /* Spacing - generous, dignified */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 3rem;
    --spacing-xl: 4rem;
    
    /* Line length - optimal readability */
    --content-width: 65ch;
    --wide-width: 85ch;
}

/* ===== BASE TYPOGRAPHY ===== */
body {
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--background);
    padding: var(--spacing-md);
    max-width: var(--content-width);
    margin: 0 auto;
}

/* ===== HEADINGS ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-top: 0;
}

h2 {
    font-size: 1.5rem;
    margin-top: var(--spacing-xl);
}

h3 {
    font-size: 1.25rem;
}

/* ===== PARAGRAPHS ===== */
p {
    margin-bottom: var(--spacing-sm);
}

p + p {
    margin-top: var(--spacing-sm);
}

/* ===== LINKS ===== */
a {
    color: var(--text-primary);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent);
}

a:visited {
    color: var(--text-secondary);
}

/* ===== LISTS ===== */
ul, ol {
    margin-left: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
}

li {
    margin-bottom: var(--spacing-xs);
}

/* ===== CODE AND PREFORMATTED TEXT ===== */
pre, code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
    background: #f0f0ed;
    padding: 0.2em 0.4em;
    border-radius: 2px;
}

pre {
    padding: var(--spacing-sm);
    overflow-x: auto;
    margin-bottom: var(--spacing-sm);
    border-left: 3px solid var(--rule);
}

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

/* ===== BLOCKQUOTES ===== */
blockquote {
    margin: var(--spacing-md) 0;
    padding-left: var(--spacing-md);
    border-left: 3px solid var(--accent);
    font-style: italic;
    color: var(--text-secondary);
}

/* ===== HORIZONTAL RULES ===== */
hr {
    border: none;
    border-top: 1px solid var(--rule);
    margin: var(--spacing-lg) 0;
}

/* ===== SECTIONS ===== */
section {
    margin-bottom: var(--spacing-xl);
}

section:last-child {
    margin-bottom: 0;
}

/* ===== NAVIGATION (SITE-WIDE) ===== */
nav {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin: var(--spacing-md) 0;
    padding: var(--spacing-sm) 0;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
}

nav a {
    white-space: nowrap;
    text-decoration: none;
    padding: 0.25em 0;
}

nav a:hover {
    text-decoration: underline;
}

/* ===== FRONT PAGE SPECIFIC ===== */
.front-page {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: var(--spacing-xl) var(--spacing-md);
}

.site-title {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.site-title h1 {
    margin-bottom: var(--spacing-xs);
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-style: italic;
}

.introduction {
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--rule);
}

.introduction p {
    margin-bottom: var(--spacing-sm);
}

.orientation {
    margin-bottom: var(--spacing-xl);
}

.core-principles {
    list-style: none;
    margin-left: var(--spacing-md);
}

.core-principles li {
    margin-bottom: var(--spacing-sm);
    padding-left: var(--spacing-sm);
    border-left: 2px solid var(--accent);
}

.paths, .membership {
    margin-bottom: var(--spacing-xl);
}

.primary-nav, .secondary-nav {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    border: none;
    padding: 0;
    margin-top: var(--spacing-sm);
}

.nav-link {
    font-size: 1.2rem;
    font-family: var(--font-heading);
    text-decoration: none;
    display: block;
}

.nav-description {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-left: 1.5rem;
    margin-top: 0.25rem;
}

.site-footer {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--rule);
    text-align: center;
}

.closing {
    font-style: italic;
    color: var(--text-secondary);
}

/* ===== CHARTER PAGE SPECIFIC ===== */
header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--rule);
}

header h1 {
    margin-bottom: var(--spacing-xs);
}

.tagline {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-style: italic;
}

main {
    max-width: var(--content-width);
    margin: 0 auto;
}

footer {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--rule);
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ===== DOCUMENT LINKS BOXES ===== */
.document-links {
    background: #f0f0ed;
    padding: var(--spacing-md);
    margin: var(--spacing-md) 0;
    border-left: 4px solid var(--accent);
}

.core-principle {
    margin: var(--spacing-md) 0;
    padding-left: var(--spacing-md);
    border-left: 3px solid var(--accent);
}

/* ===== IMAGES ===== */
img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: var(--spacing-md) auto;
}

/* ===== TABLES ===== */
table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--spacing-md) 0;
}

th, td {
    text-align: left;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-bottom: 1px solid var(--rule);
}

th {
    font-weight: 600;
    font-family: var(--font-heading);
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 600px) {
    body {
        font-size: 16px;
        padding: var(--spacing-sm);
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.3rem;
    }
    
    .front-page {
        padding: var(--spacing-md) var(--spacing-sm);
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    body {
        background: white;
        color: black;
        font-size: 12pt;
        max-width: none;
    }
    
    a {
        text-decoration: underline;
        color: black;
    }
    
    nav {
        display: none;
    }
    
    .document-links {
        background: white;
        border-left-color: black;
    }
}
