/* MINIMALIST DESIGN SYSTEM */
:root {
    --bg-color: #ffffff;
    --text-main: #111827;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --accent: #2563eb;
    --hover-bg: #f9fafb;
    --btn-hover: #374151;
    --card-shadow: rgba(0, 0, 0, 0.1);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #121212;       /* Very dark, neutral gray (not quite pure black) */
        --text-main: #f3f4f6;      /* Soft off-white to prevent eye strain */
        --text-muted: #9ca3af;     /* True neutral medium gray */
        --border-color: #2a2a2a;   /* Subtle dark gray for cards and dividers */
        --accent: #3b82f6;         /* Brightened blue to maintain contrast against the dark background */
        --hover-bg: #1f1f1f;       /* A subtle elevated gray for dark mode hover */
        --btn-hover: #d1d5db;      /* A slightly dimmer off-white for a natural hover effect */
        --card-shadow: rgba(0, 0, 0, 0.7); /* A much darker, more opaque shadow to stand out against the dark gray background */
    }

    /* ---> THIS WILL SWAP THE FORMS IN DARK MODE <--- */
    .beehiiv-light {
        display: none !important;
    }
    
    .beehiiv-dark {
        display: block !important;
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

/* NAVIGATION */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 3rem;
}

.logo {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-main);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    margin-left: 1.5rem;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-main);
    font-weight: 500;
}

/* TYPOGRAPHY & LAYOUT */
h1 {
    font-size: 2.5rem;
    letter-spacing: -1px;
    margin-bottom: 1rem;
    line-height: 1.2;
}

h2 {
    font-size: 1.5rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

a.link {
    color: var(--accent);
    text-decoration: none;
}

a.link:hover {
    text-decoration: underline;
}

/* PROJECT CARDS */
.project-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
}

.project-card {
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px var(--card-shadow);
}

.project-card h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
}

.project-card p {
    margin: 0;
    font-size: 0.95rem;
}

/* SOCIAL LINKS */
.social-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.social-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.social-link:hover {
    border-color: var(--text-main);
    background-color: var(--hover-bg);
}

/* PRIMARY BUTTON */
.btn-primary {
    display: inline-block;
    padding: 0.85rem 1.75rem;
    background-color: var(--text-main);
    color: var(--bg-color);
    text-decoration: none;
    border-radius: 6px;
    font-size: 1.05rem;
    font-weight: 500;
    transition: background-color 0.2s ease, transform 0.2s ease;
    margin-top: 1rem;
    margin-bottom: 3rem;
}

.btn-primary:hover {
    background-color: var(--btn-hover);
    transform: translateY(-2px);
}

/* NOSCRIPT FALLBACK */
.fallback-box {
    width: 100%;
    flex: 1;
    box-sizing: border-box;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-align: center;
}

.fallback-box p {
    margin-bottom: 1rem;
    font-size: 1rem;
    color: var(--text-main);
}

/* SITEMAP / NAVIGATOR LIST */
.sitemap-list {
    list-style: none;
    padding: 0;
    margin: 2rem 0 0 0;
    border-top: 1px solid var(--border-color);
}

.sitemap-list li {
    border-bottom: 1px solid var(--border-color);
}

.sitemap-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 0.5rem;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    font-size: 1.1rem;
    transition: color 0.2s ease, padding-left 0.2s ease;
}

/* Hidden arrow that slides in on hover */
.sitemap-list a::after {
    content: '\2192'; /* Unicode for right arrow */
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform: translateX(-10px);
}

.sitemap-list a:hover {
    color: var(--accent);
    padding-left: 1rem;
}

.sitemap-list a:hover::after {
    opacity: 1;
    transform: translateX(0);
}

/* FOOTER */
footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
    line-height: 2;
}

/* ADDED: FOOTER LINKS STYLE */
.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    margin: 0 0.5rem;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--text-main);
}

/* TIMELINE SPECIFIC STYLES */
.timeline {
    border-left: 2px solid var(--border-color);
    padding-left: 1.5rem;
    margin-top: 2rem;
    margin-left: 0.5rem;
}

.timeline-item {
    position: relative;
    margin-bottom: 2.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.9rem;
    top: 0.35rem;
    width: 12px;
    height: 12px;
    background-color: var(--bg-color);
    border: 2px solid var(--text-main);
    border-radius: 50%;
}

.timeline-date {
    font-weight: 700;
    color: var(--text-main);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.timeline-content {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.6;
}

.timeline-content ul {
    padding-left: 1.2rem;
    margin-top: 0.5rem;
}

.timeline-content li {
    margin-bottom: 0.5rem;
}

/* MAJOR TIMELINE UPDATE MODIFIER */
.timeline-item.major::before {
    background-color: var(--text-main);
    /* Fills the dot in completely */
    box-shadow: 0 0 0 4px var(--bg-color), 0 0 0 5px var(--text-main);
    /* Adds a double-ring effect */
    left: -1.95rem;
    /* Slight adjustment for the larger ring */
}

/* Adjust nested project cards to fit the timeline */
.timeline-content .project-card {
    margin-top: 0.5rem;
    background-color: var(--bg-color);
}

/* Hide dark form by default */
.beehiiv-dark {
    display: none;
}

/* ==========================================================================
   NEWSLETTER SPECIFIC STYLES (Anti-Jumping & Pulse Loading)
   ========================================================================== */

.newsletter-box {
    margin-top: 1rem;
    width: 100%;
    
    /* Layout Shift Fix (Exact height of the form without padding) */
    min-height: 45px; 
    /*
    display: flex;
    justify-content: center;
    align-items: center;
    */
}

.newsletter-box iframe {
    width: 100% !important; 
    margin: 0 !important;
}

/* Animation Keyframes */
@keyframes text-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Make the loading text pulse and remove its borders */
#loading-message {
    animation: text-pulse 1.5s ease-in-out infinite;
    border: none;
    background-color: transparent;
    padding: 0;
    margin-top: 2rem;
}

/* AUTOMATED LEGAL HEADING COUNTERS */
.privacy-autonumber {
    counter-reset: privacy-section;
}

.privacy-autonumber h2::before {
    counter-increment: privacy-section;
    content: counter(privacy-section) ". ";
}