/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none;
}

:root {
    /* Light mode variables */
    --color-bg: #ffffff;
    --color-text: #1a1a1a;
    --color-accent: #666666;
    --color-hover: #333333;
    --color-border: rgba(0, 0, 0, 0.1);
    --color-card-bg: #ffffff;
    --font-heading: "Expletus Sans", sans-serif;
    --font-body: "Sora", sans-serif;
    --spacing-unit: 1rem;
}

/* Dark mode variables */
@media (prefers-color-scheme: dark) {
    :root:not(.light-mode) {
        --color-bg: #1a1a1a;
        --color-text: #ffffff;
        --color-accent: #999999;
        --color-hover: #cccccc;
        --color-border: rgba(255, 255, 255, 0.1);
        --color-card-bg: #242424;
    }
}

/* Dark mode class (for manual toggle) */
.dark-mode {
    --color-bg: #1a1a1a !important;
    --color-text: #ffffff !important;
    --color-accent: #999999 !important;
    --color-hover: #cccccc !important;
    --color-border: rgba(255, 255, 255, 0.1) !important;
    --color-card-bg: #242424 !important;
}

/* Light mode class (for manual toggle) */
.light-mode {
    --color-bg: #ffffff !important;
    --color-text: #1a1a1a !important;
    --color-accent: #666666 !important;
    --color-hover: #333333 !important;
    --color-border: rgba(0, 0, 0, 0.1) !important;
    --color-card-bg: #ffffff !important;
}

/* Override system preference when manual theme is set */
:root.light-mode {
    --color-bg: #ffffff !important;
    --color-text: #1a1a1a !important;
    --color-accent: #666666 !important;
    --color-hover: #333333 !important;
    --color-border: rgba(0, 0, 0, 0.1) !important;
    --color-card-bg: #ffffff !important;
}

:root.dark-mode {
    --color-bg: #1a1a1a !important;
    --color-text: #ffffff !important;
    --color-accent: #999999 !important;
    --color-hover: #cccccc !important;
    --color-border: rgba(255, 255, 255, 0.1) !important;
    --color-card-bg: #242424 !important;
}

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
    font-optical-sizing: auto;
    font-weight: 400;
    position: relative;
}

/* Typography */
h1, h2, h3 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-unit);
    font-optical-sizing: auto;
}

h1 {
    font-size: 3.5rem;
    margin-bottom: calc(var(--spacing-unit) * 2);
    font-weight: 700;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 2rem;
    margin-bottom: calc(var(--spacing-unit) * 1.5);
    font-weight: 600;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-unit);
    font-weight: 500;
}

p { margin-bottom: 1rem; }

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
    display: flex;
    gap: 2rem;
}

.section-header {
    flex: 0 0 30%;
    display: flex;
    flex-direction: column;
}

.container > div:not(.section-header) {
    flex: 0 0 70%;
}

.section-header h2 {
    width: 100%;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    color: var(--color-accent);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* Navigation */
.navigation {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99;
    padding: 1rem 0;
}

/* Apply mix-blend-mode only in dark mode */
:root:not(.light-mode) .navigation {
    mix-blend-mode: difference;
}

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

.logo {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.01em;
    text-decoration: none;
    color: var(--color-text);
    transition: color 0.3s ease;
}

.logo:hover {
    color: var(--color-hover);
}

.nav-links a {
    font-family: var(--font-heading);
    margin-left: 2rem;
    text-decoration: none;
    color: var(--color-text);
    position: relative;
    transition: color 0.3s ease;
    font-weight: 500;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -2px;
    left: 0;
    background-color: var(--color-text);
    transition: width 0.3s ease;
}

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

.nav-links a:hover::after {
    width: 100%;
}

/* Sections */
section {
    padding: 6rem 0;
}

/* Hero section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8rem 0;
}

.hero-content {
    max-width: 50rem;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
}

.profile-image {
    width: 200px;
    height: 200px;
    margin: 0 auto 2rem;
    border-radius: 50%;
    overflow: hidden;
}

.profile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.profile-image:hover img {
    transform: scale(1.05);
}

/* About Section */
#about {
    background-color: var(--color-bg);
    position: relative;
    z-index: 1;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
}

/* Organizations Section */
.org-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.org-card {
    padding: 1.5rem;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background-color: var(--color-card-bg);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

.org-card:hover::before {
    opacity: 0.1;
}

.org-card > * {
    position: relative;
    z-index: 1;
}

/* Substack Section */
.substack-content {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.substack-card {
    transition: transform 0.3s ease;
}

.substack-card:hover {
    transform: translateY(-5px);
}

.substack-card img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 12px;
}

.subtitle {
    color: var(--color-accent);
    font-size: 1.1rem;
    margin-top: 0.5rem;
    margin-bottom: 2rem;
}

.substack-subscribe {
    display: inline-block;
    text-decoration: none;
    color: var(--color-text);
    font-family: var(--font-heading);
    font-weight: 500;
    padding: 1rem 2rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.substack-subscribe:hover {
    background-color: var(--color-text);
    color: var(--color-bg);
}

@media (max-width: 768px) {
    .org-grid,
    .substack-content {
        grid-template-columns: 1fr;
    }
    
    .substack-subscribe {
        width: 100%;
        text-align: center;
    }
} 

/* Contact Section */
.contact-content {
    display: flex;
    gap: 2rem;
    justify-content: flex-start;
    align-items: flex-end;
}

.link {
    display: inline-block;
    color: var(--color-text);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: color 0.3s ease;
}

.link::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--color-text);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

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

.link:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}

.social-link {
    font-family: var(--font-heading);
    text-decoration: none;
    color: var(--color-text);
    font-weight: 500;
    position: relative;
    transition: color 0.3s ease;
}

.social-link::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--color-text);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.social-link:hover {
    color: var(--color-text);
}

.social-link:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}

/* Remove visited link color */
a:visited {
    color: var(--color-text);
}

/* Footer */
footer {
    padding: 2rem 0;
    font-size: 0.8rem;
    text-align: left;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

/* Animations */
.reveal-text {
    opacity: 0;
    transform: translateY(20px);
    animation: reveal 0.8s ease forwards;
}

@keyframes reveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Add animation delays for staggered effect */
.hero-content .reveal-text:nth-child(2) {
    animation-delay: 0.2s;
}

.hero-content .reveal-text:nth-child(3) {
    animation-delay: 0.4s;
}

/* Media Queries */
@media (max-width: 768px) {
    .nav-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .nav-links {
        display: none;
    }

    .container {
        flex-direction: column;
    }   

    .section-header,
    .container > div:not(.section-header) {
        flex: 0 0 100%;
        width: 100%;
    }

    .about-content {
        flex-direction: column;
        gap: 2rem;
    }

    .about-content > div {
        width: 100%;
    }

    .org-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .org-card {
        width: 100%;
    }

    .contact-content {
        gap: 2rem;
    }

    .contact-content > div {
        width: 100%;
    }

    .social-links {
        flex-direction: column;
        gap: 1rem;
    }

    .social-link {
        width: 100%;
        text-align: center;
    }

    .theme-toggle {
        right: 1rem;
        bottom: 1rem;
    }

    footer {
        text-align: center;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    .container {
        padding: 0 1rem;
    }

    .hero-content {
        padding: 0 1rem;
    }

    section {
        padding: 4rem 0;
    }

    .hero {
        padding: 6rem 0;
    }
}

/* Theme toggle button */
.theme-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

.theme-toggle svg {
    width: 1.5rem;
    height: 1.5rem;
    fill: var(--color-text);
}

/* Focus styles */
:focus {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

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

/* Skip to main content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-accent);
    color: var(--color-bg);
    padding: 8px;
    z-index: 100;
    transition: top 0.3s ease;
    visibility: hidden;
}

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

/* Update link styles for better contrast */
.link, .social-link {
    color: var(--color-text);
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease;
}

.link:hover, .social-link:hover {
    color: var(--color-text);
}

/* Ensure sufficient color contrast for text */
@media (prefers-color-scheme: dark) {
    :root:not(.light-mode) {
        --color-text: #ffffff;
        --color-accent: #999999;
        --color-hover: #cccccc;
    }
}

/* Theme toggle button focus styles */
.theme-toggle:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* Ensure proper contrast for visited links */
a:visited {
    color: var(--color-text);
}

/* Add reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Custom cursor */
.cursor-outline {
    width: 40px;
    height: 40px;
    border: 2px solid var(--color-text);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transition: width 0.3s ease, height 0.3s ease, border-radius 0.3s ease, opacity 0.3s ease;
    transform: translate(-50%, -50%);
    opacity: 1;
}

/* Hide default cursor */
* {
    cursor: none !important;
}

/* Show default cursor on touch devices */
@media (hover: none) {
    .cursor-outline {
        display: none;
    }
    * {
        cursor: auto !important;
    }
}

/* Show cursor when mouse moves */
body:hover .cursor-outline {
    opacity: 1;
}

/* Cursor effects for interactive elements */
.nav-links a:hover ~ .cursor-outline,
.link:hover ~ .cursor-outline,
.social-link:hover ~ .cursor-outline,
button:hover ~ .cursor-outline,
[role="button"]:hover ~ .cursor-outline,
.theme-toggle:hover ~ .cursor-outline {
    transform: translate(-50%, -50%);
    opacity: 0.5;
}

/* Dark mode adjustments */
:root:not(.light-mode) .cursor-outline {
    border-color: var(--color-text);
}
