:root {
    --text: #222;
    --bg: #fff;
    --accent: #5865F2;
    --accent-hover: #4752C4;
    --border: #e5e5e5;
    --max-width: 650px;
}

[data-theme="dark"] {
    --text: #e5e5e5;
    --bg: #1a1a1a;
    --accent: #8B95FF;
    --accent-hover: #A3ABFF;
    --border: #333;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --text: #e5e5e5;
        --bg: #1a1a1a;
        --accent: #8B95FF;
        --accent-hover: #A3ABFF;
        --border: #333;
    }
}

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

body {
    font-family: ui-monospace, 'SF Mono', 'Cascadia Code', 'Roboto Mono', Menlo, Monaco, Consolas, 'Courier New', monospace;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
    padding: 2rem 1rem;
    font-size: 15px;
    letter-spacing: -0.01em;
    font-weight: 400;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
}

header {
    margin-bottom: 3rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    position: relative;
    z-index: 100;
}

/* Theme Toggle */
.theme-toggle {
    position: absolute;
    top: 0;
    right: 0;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.4rem 0.6rem;
    font-size: 1.2rem;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.2s ease;
    line-height: 1;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.theme-toggle:hover {
    background: var(--border);
}

.theme-toggle:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.theme-toggle .icon {
    display: block;
    width: 20px;
    height: 20px;
}

.theme-toggle .sun {
    display: none;
}

.theme-toggle .moon {
    display: block;
}

[data-theme="dark"] .theme-toggle .sun,
:root:not([data-theme="light"]) .theme-toggle .sun {
    display: block;
}

[data-theme="dark"] .theme-toggle .moon,
:root:not([data-theme="light"]) .theme-toggle .moon {
    display: none;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle .sun {
        display: block;
    }
    
    :root:not([data-theme="light"]) .theme-toggle .moon {
        display: none;
    }
}

h1 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.tagline {
    color: var(--text);
    opacity: 0.7;
    font-size: 0.9rem;
}

/* Mobile Navigation */
.mobile-nav-toggle {
    display: none;
    position: absolute;
    top: 0;
    right: 0;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.4rem 0.6rem;
    font-size: 1.2rem;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.2s ease;
    line-height: 1;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.mobile-nav-toggle:hover {
    background: var(--border);
}

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

.mobile-nav-toggle .icon {
    display: block;
    width: 20px;
    height: 20px;
}


.mobile-nav-toggle .close-icon {
    display: none;
}

.mobile-nav-toggle.active .menu-icon {
    display: none;
}

.mobile-nav-toggle.active .close-icon {
    display: block;
}

nav {
    margin-top: 1rem;
}

nav a {
    color: var(--accent);
    text-decoration: none;
    margin-right: 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

nav a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

nav a .back-arrow {
    width: 14px;
    height: 14px;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

@media (min-width: 601px) {
    nav a.desktop-only {
        display: inline-flex;
    }
    
    nav a.mobile-only {
        display: none;
    }
}

section {
    margin-bottom: 3rem;
}

h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-hover);
    text-decoration-thickness: 2px;
}

.external-link {
    display: inline-flex;
    align-items: center;
    gap: 0.2em;
}

.external-link .external-icon {
    width: 0.9em;
    height: 0.9em;
    display: inline-block;
    flex-shrink: 0;
}

/* Support Areas */
.support-area {
    margin-bottom: 2rem;
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: var(--bg);
}

.support-area h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
}

/* Equity Calculator */
.equity-calculator {
    margin: 2rem 0;
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: var(--bg);
}

.calculator-options {
    margin-bottom: 1.5rem;
}

.calculator-option {
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    position: relative;
}

.calculator-option input[type="checkbox"] {
    position: relative;
    z-index: 2;
}

.calculator-option .label-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.calculator-option input[type="checkbox"] {
    margin-top: 0.25rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.calculator-option label {
    cursor: pointer;
    flex: 1;
    font-size: 0.95rem;
    line-height: 1.5;
    user-select: none;
    display: block;
}

.calculator-option .option-description {
    font-size: 0.85rem;
    opacity: 0.7;
    margin-top: 0.25rem;
}

.capital-amount-input {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.capital-amount-input .slider-label {
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    opacity: 0.8;
    color: var(--text);
}

.capital-amount-input .slider-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.capital-amount-input .slider-wrapper {
    flex: 1;
    position: relative;
}

.capital-amount-input input[type="range"] {
    width: 100%;
    background: transparent;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: grab;
}

.capital-amount-input input[type="range"]:active {
    cursor: grabbing;
}

.capital-amount-input input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: var(--border);
}

.capital-amount-input input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: 2px solid var(--bg);
    box-shadow: 0 0 0 1px var(--border);
    margin-top: -6px;
}

.capital-amount-input input[type="range"]::-moz-range-track {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: var(--border);
    border: none;
}

.capital-amount-input input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: 2px solid var(--bg);
    box-shadow: 0 0 0 1px var(--border);
}

.capital-amount-input input[type="range"]:focus::-webkit-slider-thumb {
    box-shadow: 0 0 0 1px var(--border), 0 0 0 3px var(--accent);
}

.capital-amount-input input[type="range"]:focus::-moz-range-thumb {
    box-shadow: 0 0 0 1px var(--border), 0 0 0 3px var(--accent);
}

.capital-amount-input .slider-value {
    min-width: 80px;
    text-align: right;
    font-weight: 500;
    color: var(--accent);
    font-size: 0.95rem;
}

.capital-amount-input .slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    opacity: 0.6;
    margin-top: 0.25rem;
}

.equity-result {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--border);
    border-radius: 3px;
    text-align: center;
}

.equity-result.hidden {
    display: none;
}

.equity-result .result-label {
    font-size: 0.85rem;
    opacity: 0.7;
    margin-bottom: 0.5rem;
}

.equity-result .result-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--accent);
}

.equity-result .result-note {
    font-size: 0.85rem;
    opacity: 0.7;
    margin-top: 0.5rem;
}

.equity-disclaimer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    opacity: 0.7;
    font-style: italic;
}

/* Previous Companies */
.previous-companies {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.company-item {
    margin-bottom: 1.5rem;
}

.company-item strong {
    font-weight: 600;
}

.company-item .company-description {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    opacity: 0.8;
    line-height: 1.6;
}

/* U.S. Focus Section */
.us-focus-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.us-focus-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.us-focus-header .flag-icon {
    width: 24px;
    height: auto;
    flex-shrink: 0;
}

.us-focus-header h2 {
    margin-bottom: 0;
}

.project-item {
    margin-bottom: 1.5rem;
    position: relative;
}

.project-item a {
    font-weight: 500;
}

.project-tooltip {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 0.75rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    transform: translateY(5px);
    z-index: 100;
    pointer-events: none;
}

.project-item:hover .project-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.project-tooltip img {
    max-width: 300px;
    width: auto;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border);
    display: block;
}

[data-theme="dark"] .project-tooltip img,
:root:not([data-theme="light"]) .project-tooltip img {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Inline tooltip for name hover */
.inline-tooltip-wrapper {
    position: relative;
    display: inline-block;
}

.inline-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    margin-bottom: 0.75rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    z-index: 100;
    pointer-events: none;
}

.inline-tooltip-wrapper:hover .inline-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.inline-tooltip img {
    max-width: 120px;
    width: auto;
    height: auto;
    display: block;
}

.inline-tooltip .mii-dark {
    display: none;
}

.inline-tooltip .mii-light {
    display: block;
}

[data-theme="dark"] .inline-tooltip .mii-dark,
:root:not([data-theme="light"]) .inline-tooltip .mii-dark {
    display: block;
}

[data-theme="dark"] .inline-tooltip .mii-light,
:root:not([data-theme="light"]) .inline-tooltip .mii-light {
    display: none;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .inline-tooltip .mii-dark {
        display: block;
    }

    :root:not([data-theme="light"]) .inline-tooltip .mii-light {
        display: none;
    }
}



.project-description {
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
}

.project-meta {
    font-size: 0.85rem;
    opacity: 0.6;
}

.empty-state {
    font-size: 0.9rem;
    opacity: 0.7;
    font-style: italic;
}

/* Contact Form */
form {
    margin-top: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.01em;
}

input, textarea {
    width: 100%;
    padding: 0.6rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
    border-radius: 3px;
}

input:focus, textarea:focus {
    outline: 2px solid var(--accent);
    outline-offset: 0;
    border-color: var(--accent);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

button {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
    border-radius: 3px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    transition: background 0.2s ease;
    letter-spacing: 0.02em;
}

button:hover {
    background: var(--accent-hover);
}

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

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

.form-status {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 3px;
    font-size: 0.9rem;
}

.form-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

@media (prefers-color-scheme: dark) {
    .form-status.success {
        background: #1b4332;
        color: #95d5b2;
        border: 1px solid #2d6a4f;
    }
    
    .form-status.error {
        background: #5c1f1f;
        color: #f8b4b4;
        border: 1px solid #842029;
    }
}

footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
    opacity: 0.7;
}

footer p {
    margin-bottom: 0.5rem;
}

.entity-info {
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.us-banner {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    opacity: 0.6;
}

.us-banner .flag-icon {
    width: 20px;
    height: auto;
    flex-shrink: 0;
}

/* Mobile adjustments */
@media (max-width: 600px) {
    body {
        padding: 1.5rem 1rem;
    }

    .theme-toggle {
        right: 50px;
    }

    .mobile-nav-toggle {
        display: flex;
    }

    nav {
        display: none;
        position: absolute;
        top: 100%;
        left: -1rem;
        right: -1rem;
        background: var(--bg);
        border: 1px solid var(--border);
        border-left: none;
        border-right: none;
        padding: 0.5rem 0;
        margin-top: 1rem;
        flex-direction: column;
        gap: 0;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        z-index: 1000;
    }

    nav.active {
        display: flex;
    }

    nav a {
        display: block;
        margin-right: 0;
        margin-bottom: 0;
        padding: 1rem;
        border-bottom: 1px solid var(--border);
        white-space: nowrap;
        text-align: center;
        font-size: 1rem;
        text-decoration: none;
    }

    nav a:last-child {
        border-bottom: none;
    }
    
    nav a.desktop-only {
        display: none;
    }
    
    nav a.mobile-only {
        display: block;
    }
    
    nav a .back-arrow {
        display: none;
    }
    
    .support-area {
        padding: 1rem;
    }
    
    .equity-calculator {
        padding: 1rem;
    }
}

/* Print styles */
@media print {
    body {
        font-size: 12pt;
        color: black;
        background: white;
    }
    
    a {
        color: black;
        text-decoration: underline;
    }
    
    form, button {
        display: none;
    }
    
    .equity-calculator {
        border: 1px solid #000;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --text: #000;
        --bg: #fff;
        --accent: #0040dd;
        --border: #000;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}
