/*
Corporate Governance Audit Platform - Refined Swiss Design System
Updated: 2025-11-26

Design Principles:
- Clarity & Precision: Docs-first, scannable hierarchy
- Subtle Grid: 5% opacity background texture
- Professional Depth: Minimal shadows for layering
- Strategic Color: Red for CTAs/critical, Navy for trust/data

Typography:
- All text: Inter (sans-serif) with weight/italic variations

Color System:
- Primary Accent: #334C6A (navy blue) - CTAs, critical issues
- Secondary Accent: #1E293B (navy) - trust signals, data elements
- Semantic: Green (success), Amber (warning), Red (error)
- Background: #FAFBFC (off-white) - reduced eye strain

Inspired by: Stripe Docs, Linear, Vercel
*/

@import url('https://fonts.googleapis.com/css2?family=Heebo:wght@400;500;600;700;800;900&family=Inter:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ============================================================================
   DESIGN TOKENS
   ============================================================================ */

:root {
    /* Colors - Base */
    --bg: #FBFAFA;  /* Matte off-white like withmartian */
    --bg-pure: #FFFFFF;
    --text: #0F0F0F;
    --text-secondary: #555555;

    /* Neutrals - Expanded Palette */
    --gray-50: #FAFAFA;
    --gray-100: #F5F5F5;
    --gray-200: #E5E5E5;
    --gray-300: #D4D4D4;
    --gray-400: #A3A3A3;
    --gray-500: #737373;
    --gray-600: #525252;
    --gray-700: #404040;
    --gray-800: #262626;
    --gray-900: #171717;
    --border: #E0E0E0;
    --border-light: #F0F0F0;

    /* Primary Accent - Navy Blue */
    --accent: #334C6A;
    --accent-light: rgba(51, 76, 106, 0.12);
    --accent-glow: rgba(51, 76, 106, 0.35);

    /* Secondary Accent - Navy (Trust & Data) */
    --navy: #1E293B;
    --navy-dark: #0F172A;
    --navy-light: rgba(30, 41, 59, 0.1);

    /* Tiffany Blue - Cap Table Background */
    --tiffany-blue: #0ABAB5;  /* Bold vibrant tiffany */

    /* Semantic Colors */
    --success: #10B981;
    --success-light: rgba(16, 185, 129, 0.1);
    --warning: #F59E0B;
    --warning-light: rgba(245, 158, 11, 0.1);
    --error: #DC2626;
    --error-light: rgba(220, 38, 38, 0.1);

    /* Terminal Colors */
    --terminal-bg: #0F172A;
    --terminal-green: #10B981;
    --terminal-text: #E2E8F0;

    /* Shareholder Color Palette (Muted) */
    --shareholder-blue: #60A5FA;
    --shareholder-green: #34D399;
    --shareholder-purple: #A78BFA;
    --shareholder-orange: #FB923C;
    --shareholder-teal: #2DD4BF;
    --shareholder-pink: #F472B6;
    --shareholder-amber: #FBBF24;
    --shareholder-indigo: #818CF8;

    /* Grid Lines */
    --grid-line: #0F0F0F;
    --grid-line-soft: #D6D6D6;
    --grid-line-w: 1px;

    /* Typography - Proper font differentiation */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-grotesk: 'Heebo', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Monaco', 'Consolas', monospace;

    /* Grid System (8px base) */
    --grid: 8px;
    --spacing-xs: calc(var(--grid) * 1);
    --spacing-sm: calc(var(--grid) * 2);
    --spacing-md: calc(var(--grid) * 3);
    --spacing-lg: calc(var(--grid) * 4);
    --spacing-xl: calc(var(--grid) * 6);
    --spacing-2xl: calc(var(--grid) * 8);

    /* Shadows - Subtle depth (Stripe-style) */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.1);

    /* Border Radius - Subtle softening */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;

    /* Transitions */
    --transition-fast: 150ms ease-out;
    --transition-normal: 200ms ease-out;
    --transition-slow: 300ms ease-out;

    /* Touch targets - Minimum 44px for mobile accessibility */
    --touch-target-min: 44px;
}

/* ============================================================================
   RESET & BASE
   ============================================================================ */

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

/* Skip to main content link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent);
    color: white;
    padding: 12px 24px;
    z-index: 10000;
    font-family: var(--font-sans);
    font-weight: 600;
    text-decoration: none;
    border-radius: 0 0 var(--radius-md) 0;
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: 0;
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    padding: 0;
    margin: 0;
}

/* Legacy upload page container */
#upload-header,
#upload-section,
#progress {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: var(--spacing-lg) 2rem;
    border-left: none;
    border-right: none;
}

#upload-header {
    padding-top: var(--spacing-2xl);
    border-top: none;
}

#upload-section {
    border-bottom: 1px solid #000;
    padding-bottom: calc(var(--spacing-lg) * 5); /* increase space to footer */
}

#past-audits-section {
    min-height: 70vh;
}

/* ============================================================================
   GRID UTILITIES (Martian-style)
   ============================================================================ */

/* Hard line utilities (Martian-style) */
.line {
    width: 100%;
    height: var(--grid-line-w);
    background: var(--grid-line);
    display: block;
    pointer-events: none;
}

.line.light {
    background: var(--grid-line-soft);
}

.line-vertical {
    width: var(--grid-line-w);
    height: 100%;
    background: var(--grid-line);
    display: block;
    pointer-events: none;
    align-self: stretch;
}

/* Responsive: Hide lines on mobile */
@media (max-width: 768px) {
    .line,
    .line-vertical {
        display: none;
    }
}

/* ============================================================================
   TYPOGRAPHY
   ============================================================================ */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-grotesk);
    text-transform: none;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.2;
}

h1 {
    font-size: 2.75rem;
    color: var(--text);
    margin-bottom: var(--spacing-md);
    text-shadow: none;
    line-height: 1.05;
}

header h1 {
    max-width: 700px;
}

h2 {
    font-size: 2rem;
    color: var(--text);
    margin: var(--spacing-2xl) 0 var(--spacing-lg);
    border-bottom: none;
    padding-bottom: 0;
}

h3 {
    font-size: 1.125rem;
    margin: var(--spacing-lg) 0 var(--spacing-md);
    color: var(--navy);
    font-weight: 700;
}

p {
    margin-bottom: var(--spacing-md);
}

.subtitle {
    font-family: var(--font-sans);
    font-size: 2rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xl);
    line-height: 1.5;
    text-align: center;
}

#upload-header {
    text-align: center;
}

.monospace {
    font-family: var(--font-mono);
}

/* ============================================================================
   MARTIAN GRID SYSTEM
   ============================================================================ */

/* Base grid: 2-column layout with hard black borders */
.martian-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-top: 0;
    border-bottom: 1px solid #000;
    background: var(--bg-pure);
    width: 100%;
    max-width: 100%;
    margin: 0;
    border-left: none;
    border-right: none;
}

/* Full-width section with bottom border */
.martian-section {
    border-top: 0;
    border-bottom: 1px solid #000;
    background: var(--bg-pure);
    width: 100%;
    max-width: 100%;
    margin: 0;
    border-left: none;
    border-right: none;
}

/* Left column: generous padding (no center border - using edge lines instead) */
.martian-column-left {
    padding: 4rem 3.5rem;
    border-right: 1px solid #000;
}

/* Right column: generous padding */
.martian-column-right {
    padding: 4rem 3.5rem;
}

/* Section labels (CORPORATE TIMELINE, CAP TABLE, etc.) */
.section-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    margin-bottom: var(--spacing-md);
    color: var(--text);
    text-transform: uppercase;
}

/* Section headings */
.section-heading {
    font-family: var(--font-grotesk);
    font-size: 2.5rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0.01em;
    margin-bottom: var(--spacing-md);
    line-height: 1.1;
}

/* Section descriptions */
.section-description {
    font-family: var(--font-sans);
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

.section-description-small {
    font-family: var(--font-sans);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Date display */
.date-display {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

/* Responsive: Stack on mobile/tablet */
@media (max-width: 1024px) {
    .martian-grid {
        grid-template-columns: 1fr;
    }

    .martian-column-left,
    .martian-column-right {
        padding: 2rem 1.5rem;
        border-right: none;
    }
}

/* ============================================================================
   LAYOUT CONTAINERS
   ============================================================================ */

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.section {
    margin-bottom: var(--spacing-2xl);
    padding: var(--spacing-xl);
    border: 1px solid #000;
    background: var(--bg-pure);
    border-radius: 0;
    box-shadow: none;
}

.grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--spacing-md);
}

.col-12 { grid-column: span 12; }
.col-6 { grid-column: span 6; }
.col-4 { grid-column: span 4; }
.col-3 { grid-column: span 3; }

@media (max-width: 768px) {
    .col-6, .col-4, .col-3 {
        grid-column: span 12;
    }
}

/* ============================================================================
   UPLOAD ZONE
   ============================================================================ */

#upload-zone {
    padding: calc(var(--spacing-2xl) + 8px);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    background: var(--bg-pure);
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-300);
    box-shadow: var(--shadow-sm);
    background-image:
        linear-gradient(#f0f0f0 1px, transparent 1px),
        linear-gradient(90deg, #f0f0f0 1px, transparent 1px);
    background-size: 40px 40px;
    background-color: #fff;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#upload-zone:hover {
    background-color: var(--gray-50);
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

#upload-zone.dragging {
    background: var(--accent-light);
    border-color: #000;
}

#upload-zone .upload-icon {
    width: 175px;
    height: 150px;
    color: var(--text-secondary);
    margin: 0 auto var(--spacing-md);
    display: block;
    pointer-events: none;
}

#upload-zone p {
    margin: 0;
    font-family: var(--font-sans);
    pointer-events: none;
}

#upload-zone .primary-text {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: var(--spacing-xs);
}

#upload-zone .secondary-text {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-secondary);
}

/* ============================================================================
   PROGRESS DISPLAY
   ============================================================================ */

#progress {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: var(--spacing-xl) 0;
    padding: var(--spacing-2xl);
    border: 1px solid #000;
    background: #fff;
    background-image:
        linear-gradient(#f0f0f0 1px, transparent 1px),
        linear-gradient(90deg, #f0f0f0 1px, transparent 1px);
    background-size: 40px 40px;
    text-align: center;
    min-height: 240px;
    border-radius: 0;
    box-shadow: none;
}

#progress-wrapper {
    margin-top: var(--spacing-lg);
}

#progress-step {
    font-family: var(--font-grotesk);
    text-transform: uppercase;
    font-weight: 700;
    color: var(--accent);
    font-size: 1.25rem;
    display: block;
    margin-bottom: var(--spacing-sm);
    letter-spacing: 0.08em;
}

#progress-text {
    font-family: var(--font-sans);
    color: var(--text-secondary);
    font-size: 0.9375rem;
    display: block;
    font-weight: 500;
}

/* Animated Loader - Horizontal Dots */
.loader {
    width: 90px;
    height: 14px;
    box-shadow: 0 3px 0 #fff;
    display: grid;
}

.loader:before,
.loader:after {
    content: "";
    grid-area: 1/1;
    background: radial-gradient(circle closest-side, var(--c, var(--accent)) 92%, #0000) 0 0/calc(100%/4) 100%;
    animation: l4 1s infinite linear;
}

.loader:after {
    --c: #000;
    background-color: #fff;
    box-shadow: 0 -2px 0 0 #fff;
    clip-path: inset(-2px calc(50% - 10px));
}

@keyframes l4 {
    100% {
        background-position: calc(100%/3) 0;
    }
}

.loader-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
}

/* ============================================================================
   RESULTS DISPLAY
   ============================================================================ */

#results {
    display: none;
}

.company-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-xl);
    padding: 3rem;
    border: 1px solid #000;
    background: var(--bg-pure);
    margin-bottom: var(--spacing-2xl);
    border-radius: 0;
    box-shadow: none;
}

/* Animated Canvas Window - Stripe-style */
.fig-window {
    width: 100%;
    max-width: 500px;
    flex-shrink: 0;
    border-radius: var(--radius-md);
    border: 1px solid #111827;
    box-shadow: var(--shadow-lg);
    background: #f9fafb;
    overflow: hidden;
}

/* Scale up for hero visual */
.hero-visual .fig-window {
    width: 100%;
    max-width: 100%;
}

@media (min-width: 1025px) {
    .hero-visual .fig-window {
        max-width: 500px;
    }
}

.hero-visual .fig-canvas-wrap {
    height: 300px;
}

.fig-header {
    display: grid;
    grid-template-columns: 80px 1fr 80px;
    align-items: center;
    border-bottom: 1px solid #111827;
    background: #e5e7eb;
    position: relative;
    height: 32px;
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.fig-header-left,
.fig-header-right {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4b5563;
}

.fig-header-center {
    text-align: center;
    color: #4b5563;
    font-size: 10px;
    font-weight: 500;
}

.fig-header-left span {
    border: 1px solid #4b5563;
    padding: 1px 3px;
    font-family: var(--font-mono);
    font-size: 9px;
}

.fig-header-right svg {
    width: 12px;
    height: 12px;
    stroke: #4b5563;
}

.fig-inner {
    border-top: none;
    margin: 4px;
    margin-top: 0;
    position: relative;
}

.fig-canvas-wrap {
    position: relative;
    border: 1px solid #111827;
    margin: 6px;
    overflow: hidden;
    height: 120px;
    background-color: #E8F1F8;
    background-image: radial-gradient(circle at 1px 1px, rgba(51, 76, 106, 0.28) 1px, transparent 0);
    background-size: 18px 18px;
}

canvas,
video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.company-header-content {
    flex: 1;
}

.company-name {
    font-family: var(--font-grotesk);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 var(--spacing-sm) 0;
    line-height: 1.2;
}

.company-stats {
    display: flex;
    gap: var(--spacing-xl);
    margin-top: var(--spacing-md);
}

.company-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.company-stat-label {
    font-family: var(--font-sans);
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    font-weight: 600;
}

.company-stat-value {
    font-family: var(--font-mono);
    font-size: 1.125rem;
    color: var(--navy);
    font-weight: 700;
}

/* Legacy terminal styling (for backwards compat if needed) */
.terminal-line {
    margin: var(--spacing-sm) 0;
    font-size: 0.9375rem;
    line-height: 1.6;
}

.terminal-prompt {
    font-weight: 700;
    margin-right: 8px;
}

.terminal-stats {
    margin-top: var(--spacing-md);
    font-size: 0.8125rem;
}

.terminal-stat {
    display: inline-block;
    margin-right: var(--spacing-lg);
}

/* ============================================================================
   TABLES & CAP TABLE
   ============================================================================ */

table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--spacing-lg) 0;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    background: var(--bg-pure);
}

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

/* Right-align numeric columns */
td:nth-child(3),
td:nth-child(4),
th:nth-child(3),
th:nth-child(4) {
    text-align: right;
}

th {
    font-weight: 700;
    background: var(--gray-50);
    text-transform: uppercase;
    font-size: 0.6875rem;
    letter-spacing: 0.08em;
    border-bottom: 1px solid #000;
    color: var(--text);
    padding: var(--spacing-md) var(--spacing-sm);
}

/* Zebra striping */
tbody tr:nth-child(even) {
    background: var(--gray-50);
}

tbody tr:hover {
    background: var(--gray-100);
    transition: background 150ms ease-out;
}

/* Cap Table Progress Bars */
.ownership-cell {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.ownership-bar {
    flex: 3;
    min-width: 150px;
    height: 24px;
    background: var(--gray-200);
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
}

.ownership-fill {
    height: 100%;
    background: var(--accent);
    transition: width 300ms ease-out;
}

.ownership-text {
    font-weight: 700;
    color: var(--text);
    min-width: 60px;
    text-align: right;
    flex-shrink: 0;
}

/* Total row styling */
tr.total-row {
    font-weight: 700;
    background: var(--gray-100);
    border-top: 2px solid var(--navy);
}

tr.total-row:hover {
    background: var(--gray-100);
    transform: none;
}

/* ============================================================================
   TIMELINE - VERTICAL WITH DOTS
   ============================================================================ */

.timeline-event {
    display: grid;
    grid-template-columns: 110px 20px 1fr;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) 0;
    position: relative;
}

.timeline-event:not(:last-child) .timeline-dot::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 22px;
    width: 3px;
    height: calc(100% + var(--spacing-sm));
    background: linear-gradient(180deg, var(--navy) 0%, var(--gray-300) 100%);
    transform: translateX(-50%);
    border-radius: 2px;
}

.timeline-date {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--navy);
    font-size: 0.8125rem;
    text-align: right;
}

.timeline-dot {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 3px;
}

.timeline-dot::before {
    content: '';
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--navy);
    border: 2px solid var(--bg);
    box-shadow: none;
    position: relative;
    z-index: 1;
    transition: all 200ms ease-out;
}

.timeline-event:hover .timeline-dot::before {
    width: 14px;
    height: 14px;
    box-shadow: none;
}

.timeline-description {
    font-family: var(--font-sans);
    font-size: 0.875rem;
    color: var(--text);
    line-height: 1.6;
}

/* ============================================================================
   ISSUES
   ============================================================================ */

.issue {
    padding: var(--spacing-lg) var(--spacing-md);
    margin: 0;
    border-left: 3px solid var(--error);
    background: transparent;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-light);
    transition: all 150ms ease-out;
}

.issue:hover {
    background: var(--error-light);
}

.issue.critical {
    border-left-color: var(--error);
}

.issue.critical:hover {
    background: var(--error-light);
}

.issue.warning {
    border-left-color: var(--warning);
}

.issue.warning:hover {
    background: var(--warning-light);
}

.issue.note {
    border-left-color: var(--navy);
}

.issue.note:hover {
    background: var(--navy-light);
}

.issue-category {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.6875rem;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
    color: var(--text-secondary);
}

.issue-description {
    color: var(--text);
    line-height: 1.6;
}

.issue-critical {
    color: var(--error);
}

.issue-warning {
    color: #F59E0B;
}

.issue-note {
    color: var(--text-secondary);
}

.spacer {
    margin-bottom: 0.75rem;
}

/* ============================================================================
   DOCUMENT LIST - CARD GRID
   ============================================================================ */

.documents-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.document-category {
    border-bottom: 1px solid var(--border-light);
    padding: var(--spacing-md) 0;
    background: transparent;
    transition: background 150ms ease-out;
}

.document-category:hover {
    background: var(--gray-50);
}

.document-category h3 {
    font-size: 0.875rem;
    margin: 0;
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--text);
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
    user-select: none;
    font-weight: 600;
    font-family: var(--font-sans);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.document-category h3::before {
    content: '›';
    display: inline-block;
    margin-right: var(--spacing-sm);
    transition: transform 200ms ease-out;
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.document-category.expanded h3::before {
    transform: rotate(90deg);
}

.document-category.collapsed .document-list {
    display: none;
}

.doc-count {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.8125rem;
}

.document-list {
    list-style: none;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    padding: 0 var(--spacing-md);
    margin-top: var(--spacing-sm);
}

.document-list li {
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    color: var(--text-secondary);
    line-height: 1.5;
}

.document-list li:hover {
    background: var(--gray-50);
    color: var(--text);
}

.document-list li:last-child {
    border-bottom: none;
}

.error-badge {
    color: var(--accent);
    font-weight: 700;
    margin-left: var(--spacing-xs);
}

.verification-badge {
    font-size: 0.625rem;
    padding: 2px 4px;
    margin-left: var(--spacing-xs);
    border-radius: 2px;
    font-weight: 700;
}

.verification-high {
    background: rgba(0, 200, 0, 0.15);
    color: #008000;
}

.verification-low {
    background: rgba(255, 165, 0, 0.15);
    color: #FFA500;
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

/* ============================================================================
   BUTTON SYSTEM - Unified Component Variants
   ============================================================================ */

button, .button {
    font-family: var(--font-grotesk);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
    background: var(--accent);
    color: white;
    border: none;
    padding: 14px 28px;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.875rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    min-height: var(--touch-target-min);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    text-decoration: none;
}

button:hover:not(:disabled), .button:hover {
    background: #2a3f59;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

button:active:not(:disabled), .button:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

button:focus-visible, .button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Secondary Button Variant */
.button-secondary {
    background: transparent;
    color: var(--accent);
    border: 1.5px solid var(--accent);
    box-shadow: none;
}

.button-secondary:hover {
    background: var(--accent-light);
    box-shadow: none;
}

/* Ghost Button Variant */
.button-ghost {
    background: transparent;
    color: var(--text);
    box-shadow: none;
    padding: 10px 16px;
}

.button-ghost:hover {
    background: var(--gray-100);
    box-shadow: none;
    transform: none;
}

/* Small Button */
.button-sm {
    padding: 8px 16px;
    font-size: 0.75rem;
    min-height: 36px;
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

.hidden {
    display: none !important;
}

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

.text-accent {
    color: var(--accent);
}

.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }

.mt-0 { margin-top: 0; }
.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 768px) {
    body {
        padding: var(--spacing-md);
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    .timeline-event {
        grid-template-columns: 1fr;
        gap: var(--spacing-xs);
    }

    .timeline-date {
        font-size: 0.75rem;
    }

    .martian-grid,
    .martian-section,
    .nav-container,
    #upload-header,
    #upload-section,
    #progress,
    .timeline-band-header,
    .timeline-band-container,
    .cta-container {
        border-left: none;
        border-right: none;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .martian-column-left,
    .martian-column-right {
        padding: 2.5rem 1.5rem;
    }
}

/* ============================================================================
   STICKY NAVIGATION BAR
   ============================================================================ */

.sticky-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-pure);
    border-bottom: 1px solid #000;
    box-shadow: none;
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-left: none;
    border-right: none;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
}

.nav-logo {
    height: 24px;
    width: auto;
    display: block;
}

.nav-right {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text);
    text-decoration: none;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    min-height: var(--touch-target-min);
    border-radius: var(--radius-sm);
}

.nav-link:hover {
    color: var(--accent);
    background: var(--gray-50);
}

.nav-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.nav-link:visited {
    color: var(--text);
}

.nav-link:visited:hover {
    color: var(--accent);
}

/* ============================================================================
   HERO SECTION (SIMPLIFIED TWO-COLUMN GRID)
   ============================================================================ */

.hero-section {
    width: 100%;
    border-bottom: 1px solid var(--border);
    background: var(--bg-pure);
    background-image:
        linear-gradient(#f0f0f0 1px, transparent 1px),
        linear-gradient(90deg, #f0f0f0 1px, transparent 1px);
    background-size: 40px 40px;
    padding: 4rem 2rem;
    min-height: 0;
}

/* When hero-section also has martian-grid class */
.hero-section.martian-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    padding: 4rem 2rem 2.5rem;
    align-items: start;
}

.hero-section .martian-column-left {
    border-right: none;
}

.hero-section .martian-column-left,
.hero-section .martian-column-right {
    padding-top: 2.5rem;
    padding-bottom: 2rem;
}

.hero-left {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.5rem;
    position: relative;
    z-index: 2;
}

.hero-left .company-name {
    font-family: var(--font-grotesk);
    font-size: clamp(3rem, 12vw, 10rem);  /* Large responsive sizing like okalpha */
    font-weight: 700;
    line-height: 0.95;
    color: var(--text);
    margin: 0;
    letter-spacing: -0.04em;  /* Tight letter-spacing */
}

.company-period {
    display: none;
}

.company-stats {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
}

.company-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.company-stat-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gray-500);
}

.company-stat-value {
    font-family: var(--font-grotesk);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
}

.hero-right {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.hero-visual {
    width: 100%;
    max-width: 520px;
    position: relative;
    isolation: isolate;
    overflow: visible;
    min-height: 360px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    perspective: 1200px;
    transform-style: preserve-3d;
    position: sticky;
    top: 10vh;
    --hero-x: 0px;
    --hero-y: 0px;
    --hero-z: 0px;
    --hero-scale: 1;
}

.hero-image {
    width: 100%;
    height: auto;
    display: block;
    position: relative;
    z-index: 1;
    transform: translate3d(var(--hero-x), var(--hero-y), var(--hero-z))
        scale(var(--hero-scale));
    transform-origin: 50% 50%;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    filter: drop-shadow(0 24px 48px rgba(15, 23, 42, 0.2));
    will-change: transform;
    transition: transform 0ms linear;
}

/* Tablet: Reduce gap and font sizes */
@media (max-width: 1024px) {
    .hero-section.martian-grid {
        gap: 2rem;
        padding: 3rem 1.5rem;
    }

    .hero-left .company-name {
        font-size: 2.25rem;
    }

    .company-stats {
        gap: 1.5rem;
    }

    .company-stat-value {
        font-size: 1.5rem;
    }

    .hero-visual {
        top: 8vh;
    }
}

/* Mobile: Stack vertically */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 1.25rem;
        min-height: 0;
    }

    .hero-section.martian-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .hero-left {
        order: 2;
        text-align: center;
        align-items: center;
    }

    .hero-left .company-name {
        font-size: 1.75rem;
    }

    .company-stats {
        justify-content: center;
        flex-wrap: wrap;
        gap: 1.5rem 2rem;
    }

    .company-stat {
        align-items: center;
    }

    .hero-right {
        order: 1;
    }

    .hero-visual {
        max-width: 400px;
        min-height: 300px;
        height: auto;
        position: relative;
        top: auto;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .hero-section {
        padding: 1.5rem 1rem;
        min-height: 0;
    }

    .hero-left .company-name {
        font-size: 1.5rem;
    }

    .company-stat-value {
        font-size: 1.25rem;
    }

    .company-stats {
        gap: 1rem 1.5rem;
    }

    .hero-visual {
        min-height: 260px;
    }
}

/* ============================================================================
   TIMELINE BAND SECTION
   ============================================================================ */

.timeline-band {
    background: var(--gray-50);
    padding: 2rem 0;
    border-bottom: 1px solid var(--border);
}

.timeline-band-header {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem 1rem;
    text-align: center;
}

.timeline-band-header .section-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gray-500);
}

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

/* Color legend for timeline */
.color-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem 1.5rem;
    margin-top: 1rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

.color-legend-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--gray-600);
}

.color-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* ============================================================================
   EXPLAINER SECTION (SPLIT LAYOUT)
   ============================================================================ */

.explainer-section {
    background: var(--bg-pure);
    padding: 0;
    font-family: var(--font-grotesk);
    --font-sans: 'Heebo', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.explainer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-xl);
    display: grid;
    grid-template-columns: 1fr var(--grid-line-w) 1.4fr;
    gap: calc(var(--spacing-2xl) * 1.5);
    min-height: 800px;
    border-left: var(--grid-line-w) solid var(--grid-line);
    border-right: var(--grid-line-w) solid var(--grid-line);
}

.explainer-left {
    position: relative;
    background: #FFF2EE;
    padding: 4rem 3.5rem;
}

.explainer-sticky .section-label,
#cap-table-date {
    display: none;
}

.explainer-sticky {
    position: sticky;
    top: calc(80px + var(--spacing-xl));
    background: var(--bg-pure);
    border: 1px solid #000;
    border-radius: 0;
    padding: 2.5rem;
    box-shadow: none;
}

.explainer-right {
    background: transparent;
    padding: 4rem 3.5rem;
    overflow-y: visible;
}

.explainer-right h2 {
    margin-top: 0;
}

/* Responsive: Stack on tablet/mobile */
@media (max-width: 1024px) {
    .explainer-container {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .explainer-container .line-vertical {
        display: none;
    }

    .explainer-sticky {
        position: relative;
        top: 0;
    }
}

/* ============================================================================
   DOCUMENT BREAKDOWN SECTION (ACCORDION)
   ============================================================================ */

.features-section {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    border-left: none;
    border-right: none;
    border-bottom: 1px solid #000;
    background: var(--bg-pure);
    background-image:
        linear-gradient(#000, #000),
        linear-gradient(#000, #000),
        linear-gradient(#000, #000);
    background-position:
        4.1667% 0,
        33.3333% 0,
        95.8333% 0;
    background-size:
        1px 100%,
        1px 100%,
        1px 100%;
    background-repeat: no-repeat;
}

.features-left {
    grid-column: 2 / span 3;
    padding: 4rem 2.5rem 4rem 1.5rem;
    position: relative;
}

.features-title {
    font-family: var(--font-grotesk);
    font-size: 2.5rem;
    line-height: 1.2;
    text-transform: none;
    margin: 0;
    font-weight: 400;
}

.features-right {
    grid-column: 5 / span 8;
    padding: 4rem 3.5rem 4rem 2rem;
    position: relative;
}

/* Document Accordion Styles */
.document-accordion {
    border-top: 1px solid #000;
    width: calc((100% / 12) * 7.5);
    margin-left: calc((100% / 12) * 4);
}

.accordion-item {
    border-bottom: 1px solid #000;
    transition: background 150ms ease-out;
}

.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) var(--spacing-sm);
    cursor: pointer;
    user-select: none;
    transition: all var(--transition-fast);
    min-height: var(--touch-target-min);
    margin: 0 calc(var(--spacing-sm) * -1);
    border-radius: var(--radius-sm);
}

.accordion-header:hover {
    color: var(--accent);
    background: var(--gray-50);
}

.accordion-header:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.accordion-title {
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

.accordion-toggle {
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--text);
    transition: transform 200ms ease-out, color 150ms ease-out;
    margin-left: auto;
}

.accordion-header:hover .accordion-toggle {
    color: var(--accent);
}

.accordion-item.active .accordion-toggle {
    transform: rotate(45deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 300ms ease-out;
}

.accordion-item.active .accordion-content {
    max-height: 1000px;
}

.accordion-body {
    padding: 0 0 var(--spacing-lg) 0;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-secondary);
    max-height: 240px;
    overflow-y: auto;
}

/* Responsive: Stack on mobile */
@media (max-width: 1024px) {
    .features-section {
        grid-template-columns: 1fr;
        gap: 0;
        border-left: none;
        border-right: none;
        background-image: none;
    }

    .features-left,
    .features-right {
        grid-column: 1;
        padding: 3rem 2rem;
        border-right: none;
        border-left: none;
    }

    .features-title {
        font-size: 2rem;
    }

    .document-accordion {
        width: 100%;
        margin-left: 0;
    }
}

/* ============================================================================
   SOLUTIONS STRIP (MARQUEE + CARDS)
   ============================================================================ */

.solutions-strip {
    background: var(--navy-dark);
    padding: calc(var(--spacing-2xl) * 2) 0;
    overflow: hidden;
    border-top: var(--grid-line-w) solid var(--grid-line);
    border-bottom: var(--grid-line-w) solid var(--grid-line);
}

.solutions-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-xl);
    border-left: var(--grid-line-w) solid rgba(255, 255, 255, 0.12);
    border-right: var(--grid-line-w) solid rgba(255, 255, 255, 0.12);
}

/* Logo Marquee */
.logo-marquee {
    margin-bottom: calc(var(--spacing-2xl) * 2);
    overflow: hidden;
    position: relative;
}

.marquee-track {
    display: flex;
    gap: calc(var(--spacing-2xl) * 3);
    animation: marqueeScroll 20s linear infinite;
    width: fit-content;
}

.marquee-logo {
    height: 60px;
    width: auto;
    opacity: 0.3;
    filter: brightness(0) invert(1);
}

@keyframes marqueeScroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Solution Cards */
.solution-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-xl);
}

.solution-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: var(--spacing-xl);
    text-align: center;
    transition: all 200ms ease-out;
}

.solution-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-4px);
}

.solution-card.featured {
    background: var(--accent);
    border-color: var(--accent);
    grid-column: span 1;
}

.solution-card.featured:hover {
    background: #B82418;
    border-color: #B82418;
}

.solution-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--spacing-md);
    display: block;
}

.solution-card h3 {
    font-size: 1rem;
    margin: 0 0 var(--spacing-xs) 0;
    color: white;
    font-family: var(--font-grotesk);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.solution-card p {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

.solution-placeholder h3 {
    color: rgba(255, 255, 255, 0.6);
}

.solution-placeholder p {
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
}

/* Responsive: 4-up → 2-up → 1-up */
@media (max-width: 1024px) {
    .solution-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .solution-cards {
        grid-template-columns: 1fr;
    }
}

/* ============================================================================
   TIME-TRAVEL CAP TABLE VIEW
   ============================================================================ */

/* View Toggle Button */
.view-toggle-btn {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--border);
    color: var(--text);
    border: 1px solid var(--border);
    padding: var(--spacing-xs) var(--spacing-md);
    cursor: pointer;
    transition: all 0.15s ease;
}

.view-toggle-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* Time Slider Control */
.time-control {
    padding: var(--spacing-md);
    border: 1px solid var(--border);
    background: var(--bg);
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.time-label {
    font-family: var(--font-grotesk);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
    color: var(--text);
}

.date-slider {
    flex-grow: 1;
    height: 4px;
    appearance: none;
    background: var(--border);
    outline: none;
    border-radius: 2px;
}

.date-slider::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent);
    cursor: pointer;
    border-radius: 0;
    transition: transform 0.15s ease;
}

.date-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.date-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--accent);
    cursor: pointer;
    border: none;
    border-radius: 0;
}

.current-date {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--accent);
    min-width: 120px;
    text-align: right;
}

/* Split Panel Layout */
.split-view {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    height: calc(100vh - 220px); /* Full height minus header + controls */
    min-height: 600px;
}

.panel-left,
.panel-right {
    border: 1px solid #000;
    background: var(--bg-pure);
    overflow-y: auto;
    padding: var(--spacing-xl);
    border-radius: 0;
    box-shadow: none;
}

.panel-left h2,
.panel-right h2 {
    margin-top: 0;
    font-size: 1.25rem;
    color: var(--navy);
    border-bottom: 2px solid var(--navy);
    padding-bottom: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

/* Cap Table (Time-Travel View) */
.cap-table {
    width: 100%;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    border-collapse: collapse;
    margin-top: var(--spacing-md);
}

.cap-table thead {
    border-bottom: 2px solid var(--text);
}

.cap-table th {
    text-align: left;
    padding: var(--spacing-sm);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.cap-table td {
    padding: var(--spacing-sm);
    border-bottom: 1px solid var(--border);
}

.cap-table tr:hover {
    background: rgba(0, 0, 0, 0.02);
}

.cap-table tfoot {
    border-top: 2px solid var(--text);
    font-weight: 700;
}

.cap-table tfoot td {
    padding: var(--spacing-md) var(--spacing-sm);
}

/* Event Stream Cards */
#event-stream-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.event-card {
    border-left: 4px solid var(--navy);
    padding: 1.5rem 1.25rem;
    margin-bottom: var(--spacing-md);
    background: var(--bg-pure);
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200);
    border-left-width: 4px;
    transition: all var(--transition-fast);
}

.event-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--gray-300);
}

.event-card.verified {
    border-left-color: var(--accent);
    background: linear-gradient(90deg, #E8F1F8 0%, var(--bg-pure) 100%);
}

.event-card.warning {
    border-left-color: var(--warning);
    background: linear-gradient(90deg, var(--warning-light) 0%, var(--bg-pure) 100%);
}

.event-card.critical {
    border-left-color: var(--error);
    background: linear-gradient(90deg, var(--error-light) 0%, var(--bg-pure) 100%);
}

.event-card.critical:hover {
    box-shadow: none;
}

.event-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.event-type {
    font-family: var(--font-grotesk);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.6875rem;
    letter-spacing: 0.08em;
    color: var(--navy);
}

.event-date {
    font-family: var(--font-mono);
    color: var(--text-secondary);
    font-size: 0.6875rem;
    font-weight: 700;
}

.event-details {
    font-size: 0.875rem;
    margin-bottom: var(--spacing-sm);
    line-height: 1.6;
}

.event-details strong {
    color: var(--text);
    font-weight: 600;
}

.source-quote {
    font-size: 0.6875rem;
    font-style: italic;
    color: var(--text-secondary);
    margin: 12px 0;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.02);
    border-left: 3px solid var(--border);
    border-radius: 0 2px 2px 0;
    line-height: 1.5;
}

.compliance-note {
    font-size: 0.6875rem;
    color: var(--text);
    font-weight: 600;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.doc-reference {
    font-family: var(--font-mono);
    font-size: 0.625rem;
    color: var(--text-secondary);
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.doc-link {
    color: var(--text);
    cursor: pointer;
    transition: opacity 150ms ease-out;
}

.doc-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Shareholder color dot in event card header */
.shareholder-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}

/* Condensed event summary (20-30 words) */
.event-summary {
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text);
    margin: 0.75rem 0;
    font-weight: 400;
}

/* Event preview section */
.event-preview {
    margin: 1rem 0;
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: all 150ms ease-out;
}

.event-preview:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.event-preview-image {
    width: 100%;
    display: block;
    max-height: 220px;
    object-fit: cover;
    object-position: center center;
    background: var(--gray-50);
}

/* Event metadata (shares, price) */
.event-metadata {
    display: flex;
    gap: 1.5rem;
    margin: 0.75rem 0;
    font-size: 0.8125rem;
}

.event-metadata .label {
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.6875rem;
    font-weight: 600;
}

.event-metadata .value {
    color: var(--text);
    font-family: var(--font-mono);
    font-weight: 500;
}

.event-amount,
.event-price {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* Event links (Source, Approval) */
.event-links {
    display: flex;
    gap: 1rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-200);
}

.event-link {
    font-size: 0.75rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 150ms ease-out;
    cursor: pointer;
}

.event-link:hover {
    opacity: 0.7;
    text-decoration: underline;
}

/* Responsive: Stack panels on mobile */
@media (max-width: 1024px) {
    .split-view {
        grid-template-columns: 1fr;
        height: auto;
    }

    .panel-left,
    .panel-right {
        min-height: 400px;
    }
}

/* ============================================================================
   DOCUMENT VIEWER MODAL
   ============================================================================ */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    cursor: pointer;
    animation: backdropFadeIn 200ms ease-out;
}

/* Reduce backdrop blur on mobile for better performance */
@media (max-width: 768px) {
    .modal-backdrop {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: rgba(0, 0, 0, 0.7);
    }
}

@keyframes backdropFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-card {
    position: relative;
    background: var(--bg-pure);
    max-width: 900px;
    width: 90%;
    max-height: 85vh;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    animation: modalFadeIn 250ms ease-out;
}

/* Mobile modal improvements */
@media (max-width: 768px) {
    .modal-card {
        width: 95%;
        max-height: calc(100vh - 80px);
        max-height: calc(100dvh - 80px); /* Dynamic viewport height for mobile */
        margin: 40px auto;
        border-radius: var(--radius-md);
    }
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: var(--spacing-xl);
    border-bottom: 1px solid var(--border);
    background: var(--gray-50);
}

.modal-title {
    font-family: var(--font-grotesk);
    font-size: 1.125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--navy);
    margin: 0;
    flex: 1;
    word-break: break-word;
}

.modal-close {
    background: var(--gray-100);
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    margin-left: var(--spacing-lg);
    width: var(--touch-target-min);
    height: var(--touch-target-min);
    min-width: var(--touch-target-min);
    min-height: var(--touch-target-min);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    border-radius: var(--radius-sm);
}

.modal-close:hover {
    color: white;
    background: var(--accent);
}

.modal-close:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Ensure close button is always accessible on mobile */
@media (max-width: 768px) {
    .modal-close {
        position: sticky;
        top: 0;
        right: 0;
    }
}

.modal-body {
    padding: var(--spacing-lg);
    overflow-y: auto;
    flex: 1;
}

.modal-classification {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border);
}

.modal-content-text {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    line-height: 1.7;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
}

.modal-content-text mark {
    background: #FEF3C7;
    color: var(--text);
    padding: 2px 4px;
    border-radius: 2px;
}

/* Smooth scroll to highlighted snippet */
.modal-body {
    scroll-behavior: smooth;
}

/* Accessibility: Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .modal-card {
        animation: none;
    }

    .modal-body {
        scroll-behavior: auto;
    }
}

/* ============================================================================
   SHAREHOLDER COLOR SYSTEM
   ============================================================================ */

/* Event card shareholder tag */
.shareholder-tag {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-left: 4px;
}

/* Cap table row left border colors */
.cap-table-row {
    transition: background-color 150ms ease-out, transform 150ms ease-out;
}

.cap-table-row.highlight {
    background-color: rgba(0, 0, 0, 0.08);
    transform: translateX(4px);
}

/* Event card highlight on hover */
.event-card {
    transition: background-color 150ms ease-out, transform 150ms ease-out;
}

.event-card.highlight {
    background-color: rgba(0, 0, 0, 0.08);
    transform: scale(1.02);
    box-shadow: none;
}

/* Pulse animation for changed rows */
@keyframes pulse {
    0% {
        transform: scale(1);
        background-color: transparent;
    }
    50% {
        transform: scale(1.01);
        background-color: rgba(0, 0, 0, 0.05);
    }
    100% {
        transform: scale(1);
        background-color: transparent;
    }
}

.cap-table-row.changed {
    animation: pulse 300ms ease-out;
}

/* Fade-in animation for new events */
@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.event-card.new-event {
    animation: fadeInSlide 200ms ease-out;
}

/* Ownership percentage number animation */
.ownership-number {
    transition: all 200ms ease-out;
}

/* Accessibility: Respect reduced motion for animations */
@media (prefers-reduced-motion: reduce) {
    .cap-table-row.changed,
    .event-card.new-event {
        animation: none;
    }

    .cap-table-row,
    .event-card,
    .ownership-number {
        transition: none;
    }
}

/* ============================================================================
   HORIZONTAL INTERACTIVE TIMELINE
   ============================================================================ */

#horizontal-timeline {
    min-height: 70px;
    position: relative;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--gray-300) transparent;
}

#horizontal-timeline::-webkit-scrollbar {
    height: 4px;
}

#horizontal-timeline::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 2px;
}

.timeline-track {
    position: relative;
    height: 50px;
    min-width: max-content;
    padding: 0 1rem;
}

.timeline-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gray-300);
    transform: translateY(-50%);
}

.timeline-node-wrapper {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 10;
    padding: 12px;
}

.timeline-node {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    transition: transform 150ms ease, box-shadow 150ms ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.timeline-node:hover {
    transform: scale(1.4);
}

.timeline-node.selected {
    width: 16px;
    height: 16px;
    box-shadow: 0 0 0 4px var(--accent-light);
}

.timeline-date-label {
    position: absolute;
    top: calc(50% + 18px);
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 0.625rem;
    color: var(--gray-500);
    white-space: nowrap;
    pointer-events: none;
}

.timeline-date-display {
    display: none;
}

/* Larger touch targets on mobile */
@media (max-width: 768px) {
    .timeline-node-wrapper {
        padding: 16px;
    }

    .timeline-node {
        width: 14px;
        height: 14px;
    }
}


/* ============================================================================
   SHAREHOLDER PILLS
   ============================================================================ */

.shareholder-pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 700;
    color: #fff;
    text-shadow: none;
    letter-spacing: 0.02em;
    box-shadow: none;
}

/* ============================================================================
   TABS FOR DOCUMENTS & ISSUES
   ============================================================================ */

.reference-tabs {
    margin-top: var(--spacing-2xl);
    border: 1px solid #000;
    border-radius: 0;
    box-shadow: none;
    background: var(--bg-pure);
}

.tab-header {
    display: flex;
    gap: 0;
    border-bottom: none;
    background: transparent;
}

.tab-section {
    flex: 1;
    padding: var(--spacing-xl);
    border-right: 1px solid #000;
}

.tab-section:last-child {
    border-right: none;
}

.tab-section-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: var(--spacing-md);
    cursor: pointer;
    user-select: none;
}

.tab-section-title svg {
    width: 14px;
    height: 14px;
    transition: transform 200ms ease-out;
}

.tab-section-title.collapsed svg {
    transform: rotate(-90deg);
}

.filter-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 6px 0;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    color: var(--text);
    cursor: pointer;
    transition: all 150ms ease-out;
}

.filter-item:hover {
    color: var(--navy);
}

.filter-checkbox {
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--gray-400);
    border-radius: 3px;
    flex-shrink: 0;
    background: transparent;
}

.filter-item.active .filter-checkbox {
    background: var(--accent);
    border-color: var(--accent);
    position: relative;
}

.filter-item.active .filter-checkbox::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 10px;
    font-weight: bold;
}

.filter-label {
    flex: 1;
}

.filter-count {
    color: var(--gray-400);
    font-size: 0.875rem;
    margin-left: 4px;
}

.tab-content {
    padding: 0;
    max-height: none;
    overflow-y: visible;
}

.tab-content.hidden {
    display: none;
}

/* ============================================================================
   LAYOUT UPDATES
   ============================================================================ */

.split-view {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    min-height: 500px;
    margin: var(--spacing-xl) 0;
}

.panel-left,
.panel-right {
    overflow-y: auto;
    max-height: 900px;
}

/* Responsive: Stack panels on tablet/mobile */
@media (max-width: 1024px) {
    .split-view {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .panel-left,
    .panel-right {
        max-height: 480px;
    }

    .timeline-track {
        margin: 0 var(--spacing-sm);
    }

    .timeline-date-label {
        font-size: 0.5rem;
    }
}

/* ============================================================================
   DOWNLOADS SECTION (Martian Grid)
   ============================================================================ */

.downloads-section {
    background: var(--bg-pure);
    background-image:
        linear-gradient(#f0f0f0 1px, transparent 1px),
        linear-gradient(90deg, #f0f0f0 1px, transparent 1px);
    background-size: 40px 40px;
    border-bottom: 1px solid #000;
    padding: 4rem 0;
}

/* Remove vertical divider line between columns */
.downloads-section .martian-column-left {
    border-right: none;
}

.download-preview-card {
    background: var(--bg-pure);
    border: 1px solid #000;
    padding: var(--spacing-xl);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    height: 100%;
    min-height: 400px;
}

.download-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text);
    margin: 0;
}

.download-preview-content {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    line-height: 1.6;
    color: var(--text-secondary);
    background: var(--gray-50);
    padding: var(--spacing-md);
    border: 1px solid var(--gray-200);
    height: 280px;
    overflow-y: auto;
    white-space: pre-wrap;
    flex-grow: 1;
}

.download-button {
    padding: 1rem 2rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 999px;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 200ms ease-out, transform 150ms ease-out;
    align-self: flex-start;
}

.download-button:hover {
    background: #b42020;
    transform: translateY(-2px);
}

.download-button:active {
    transform: translateY(0);
}

/* Responsive: Stack on mobile/tablet */
@media (max-width: 1024px) {
    .downloads-section {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
        padding: 3rem 2rem;
    }

    .download-preview-card {
        min-height: 350px;
    }
}

/* ============================================================================
   FOOTER - Responsive Site Footer
   ============================================================================ */

.site-footer {
    background: var(--bg-pure);
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    margin-top: auto;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.footer-brand {
    flex-shrink: 0;
}

.footer-logo {
    height: auto;
    width: auto;
    max-height: 48px;
}

.footer-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.footer-links a {
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

.footer-action {
    flex-shrink: 0;
}

.footer-copyright {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}

/* Tablet: Stack vertically, center-aligned */
@media (max-width: 1024px) {
    .footer-container {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }

    .footer-links {
        gap: 1.5rem;
    }
}

/* Mobile: Tighter spacing */
@media (max-width: 768px) {
    .site-footer {
        padding: 1.5rem 0;
    }

    .footer-container {
        padding: 0 1.5rem;
        gap: 1.25rem;
    }

    .footer-logo {
        max-height: 40px;
    }

    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

    .footer-links a {
        font-size: 0.75rem;
    }
}

/* ============================================================================
   CANVAS ANIMATION (Hero Section)
   ============================================================================ */

.hero-canvas {
    width: 100%;
    max-width: 500px;
    height: 400px;
    display: block;
    border: 1px solid #000;
    background: var(--bg-pure);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-canvas {
        height: 300px;
    }
}

/* ============================================================================
   PAST AUDITS SECTION
   ============================================================================ */

.past-audits-left,
.past-audits-right {
    /* Inherits from martian-column-left/right */
}

.past-audits-left {
    background: var(--bg-pure);
    background-image:
        linear-gradient(#f0f0f0 1px, transparent 1px),
        linear-gradient(90deg, #f0f0f0 1px, transparent 1px);
    background-size: 40px 40px;
}

.past-audits-accordion {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.audit-item {
    cursor: pointer;
    transition: all 0.15s ease-out;
}

.audit-item:hover:not(.disabled) {
    opacity: 0.8;
}

.audit-item.disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.audit-header-content {
    flex: 1;
}

.audit-metadata {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.audit-filename {
    font-size: 0.75rem;
    color: var(--gray-400);
    font-family: var(--font-mono);
    margin-top: 0.25rem;
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-complete {
    background-color: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.status-processing {
    background-color: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.status-error {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Navigation updates */
.nav-link {
    margin-left: 2rem;
}

.nav-link:first-child {
    margin-left: 0;
}

/* ============================================================================
   CAP TABLE TAB CONTROLS
   ============================================================================ */

.cap-table-tabs {
    display: flex;
    gap: 0;
    margin: 1rem 0 0.5rem 0;
    border-bottom: 1px solid var(--gray-200);
}

.cap-table-tab {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0.5rem 1rem;
    font-family: var(--font-grotesk);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 150ms ease-out;
}

.cap-table-tab:hover {
    color: var(--text);
    background: var(--gray-50);
}

.cap-table-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 600;
}

/* Dimmed style for option pool rows */
.cap-table-row.option-grant {
    opacity: 0.7;
    font-style: italic;
}

.cap-table-row.option-grant td {
    color: var(--text-secondary);
}

/* ============================================================================
   SCROLL REVEAL ANIMATIONS
   ============================================================================ */

.scroll-reveal {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.scroll-reveal.visible {
    opacity: 1;
    transform: scale(1);
}

/* Staggered delays */
.scroll-reveal[data-delay="1"] { transition-delay: 0.15s; }
.scroll-reveal[data-delay="2"] { transition-delay: 0.3s; }
.scroll-reveal[data-delay="3"] { transition-delay: 0.45s; }

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .scroll-reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .hero-image {
        transform: none;
        transition: none;
    }
}
