:root {
    /* Blue Pill Theme (Default/Light Futurism) */
    --bg-color: #f0f2f5;
    --text-color: #1a1a1a;
    --accent-color: #3b82f6;
    /* Bright Blue */
    --secondary-accent: #8b5cf6;
    /* Purple */
    --card-bg: rgba(255, 255, 255, 0.65);
    --card-border: rgba(255, 255, 255, 0.8);
    --glass-blur: 16px;
    --font-head: 'Syncopate', sans-serif;
    --font-body: 'Outfit', sans-serif;
    --pill-blue: #3b82f6;
    --pill-red: #ef4444;
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
}

[data-theme="matrix"] {
    /* Red Pill Theme (Matrix/Cyberpunk) */
    --bg-color: #050505;
    --text-color: #00ff41;
    /* Matrix Green */
    --accent-color: #00ff41;
    --secondary-accent: #008f11;
    --card-bg: rgba(0, 20, 0, 0.85);
    --card-border: rgba(0, 255, 65, 0.3);
    --glass-blur: 4px;
    /* Less blur, more sharp terminal feel */
    --font-head: 'VT323', monospace;
    --font-body: 'Courier New', monospace;
    --shadow: 0 0 20px rgba(0, 255, 65, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.5s ease, color 0.3s ease, border-color 0.3s ease;
}

body {
    background-color: var(--bg-color);
    /* Subtle mesh gradient for liquid glass effect */
    background-image:
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(139, 92, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(59, 130, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 0% 100%, rgba(139, 92, 246, 0.15) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-color);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Landing Overlay */
.landing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #ffffff;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 1s ease, transform 1s ease;
}

.landing-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(1.1);
}

.landing-title {
    font-family: 'Syncopate', sans-serif;
    font-size: 2rem;
    margin-bottom: 3rem;
    letter-spacing: 4px;
    text-align: center;

    /* Blue to Red Gradient across text */
    background: linear-gradient(to right, #3b82f6 0%, #ef4444 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    /* Fallback */

    /* text-shadow doesn't work with background-clip: text usually, use filter if needed, 
       but standard drop-shadow filter applies to the box not the text alpha mask correctly in some browsers on background-clip.
       Actually, standard filter: drop-shadow() DOES work on the alpha shape of the element. */
    filter: drop-shadow(0 0 10px rgba(100, 100, 100, 0.2));
}

.pill-container {
    display: flex;
    gap: 2rem;
    /* Reduced gap slightly since pills are huge */
    align-items: center;
    /* Center vertically */
}

.pill {
    position: relative;
    width: 350px;
    height: 140px;
    /* No border radius or border for full image visibility */
    border: none;
    background-color: transparent;
    cursor: pointer;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: transform 0.3s ease, filter 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Overflow visible strictly requested */
    overflow: visible;
}

.pill-text {
    position: relative;
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    /* Larger font for larger button */
    letter-spacing: 3px;
    font-weight: 700;
    z-index: 2;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
    /* Strong drop shadow for readability */
    pointer-events: none;
}

.pill:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.3));
}

.blue-pill {
    background-image: url('../img/bluepill.png');
}

.red-pill {
    background-image: url('../img/redpill.png');
}

/* Theme Switcher (Top Right) */
.theme-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    display: flex;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.5s ease 1s;
}

.theme-switcher.visible {
    opacity: 1;
}

.mini-pill {
    width: 50px;
    height: 25px;
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mini-pill:hover {
    transform: scale(1.1);
}

.mini-pill.blue {
    background: linear-gradient(135deg, #60a5fa, #2563eb);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.mini-pill.red {
    background: linear-gradient(135deg, #f87171, #dc2626);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

/* Main Content */
.content-wrapper {
    position: relative;
    z-index: 2;
    /* Above matrix canvas */
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 20px;
    opacity: 0;
    /* Hidden initially until choice */
    transition: opacity 1s ease;
}

.content-wrapper.visible {
    opacity: 1;
}

/* Hero Section */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex-direction: column;
}

.glitch-text {
    font-family: var(--font-head);
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 700;
    margin-bottom: 1rem;
    position: relative;
    color: var(--text-color);
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--accent-color);
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.hero-intro {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 4rem;
    opacity: 0.8;
}

.scroll-down {
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.9rem;
    letter-spacing: 2px;
    border: 1px solid var(--text-color);
    padding: 0.8rem 2rem;
    border-radius: 30px;
    transition: all 0.3s ease;
}

.scroll-down:hover {
    background: var(--text-color);
    color: var(--bg-color);
}

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

.section-title {
    font-family: var(--font-head);
    font-size: 2rem;
    margin-bottom: 4rem;
    text-align: center;
    border-bottom: 1px solid var(--text-color);
    display: inline-block;
    padding-bottom: 0.5rem;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}

/* Cards & Liquid Glass */
/* Cards & Liquid Glass (iOS 26 Style) */
.card {
    /* More transparent, heavier blur */
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(40px) saturate(200%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);

    /* Iridescent/Pearl border effect */
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-top: 1px solid rgba(255, 255, 255, 0.7);
    border-left: 1px solid rgba(255, 255, 255, 0.7);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);

    border-radius: 24px;
    /* Slightly rounder */
    padding: 2.5rem;

    /* Deep, colorful shadow + internal glow */
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.1),
        inset 0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 0 20px rgba(255, 255, 255, 0.2);

    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

/* Liquid Shine Effect (Specular Highlight) */
.card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    /* Subtle diagonal shimmer ensuring it feels like a physical object */
    background: linear-gradient(125deg,
            rgba(255, 255, 255, 0.4) 0%,
            rgba(255, 255, 255, 0.1) 20%,
            rgba(255, 255, 255, 0) 60%);
    pointer-events: none;
    border-radius: 24px;
}

/* Matrix Theme Override for Cards */
[data-theme="matrix"] .card {
    background: rgba(0, 20, 0, 0.85);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid var(--card-border);
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.1);
    border-radius: 20px;
}

[data-theme="matrix"] .card::after {
    display: none;
}

.card:hover {
    transform: translateY(-5px) scale(1.02);
    /* Enhanced hover glow */
    box-shadow:
        0 40px 80px -20px rgba(59, 130, 246, 0.3),
        /* Blue tint on hover */
        inset 0 0 0 1px rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.25);
}

/* Summary Section */
.summary-container {
    max-width: 900px;
    margin: 0 auto;
    text-align: left;
    font-size: 1.1rem;
    line-height: 1.8;
}

.summary-container p {
    margin-bottom: 1.5rem;
}

.summary-container p:last-child {
    margin-bottom: 0;
}

/* Timeline */
.timeline {
    position: relative;
    max-width: 1400px;
    /* Increased further as requested */
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    /* Mobile first alignment */
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--accent-color);
    opacity: 0.3;
}

.timeline-item {
    position: relative;
    margin-bottom: 5rem;
    /* More spacing for focus effect */
    padding-left: 50px;
    transition: opacity 0.5s ease, filter 0.5s ease, transform 0.5s ease;
}

/* Focus Animation Styles */
.timeline-item.out-of-focus {
    opacity: 0.3;
    filter: blur(2px);
    transform: scale(0.95);
}

.timeline-item.in-focus {
    opacity: 1;
    filter: blur(0);
    transform: scale(1);
}

.timeline-marker {
    position: absolute;
    left: 11px;
    top: 25px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--bg-color);
    border: 3px solid var(--accent-color);
    z-index: 1;
    box-shadow: 0 0 10px var(--accent-color);
    pointer-events: none;
    /* User requested removal of click implication */
}

.timeline h3 {
    color: var(--accent-color);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.timeline h4 {
    margin-bottom: 1rem;
    font-weight: 400;
    font-size: 1.1rem;
}

.timeline .date {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-bottom: 0.5rem;
    display: block;
}

.resume-list {
    list-style-type: none;
    padding-left: 0;
    text-align: left;
    /* Ensure list is always left aligned */
}

.resume-list li {
    position: relative;
    padding-left: 1.5em;
    margin-bottom: 0.8em;
    font-size: 0.95rem;
    opacity: 0.9;
}

.resume-list li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--accent-color);
}

.timeline .tags span {
    display: inline-block;
    font-size: 0.75rem;
    padding: 2px 8px;
    border: 1px solid var(--text-color);
    border-radius: 12px;
    margin-top: 1rem;
    margin-right: 0.5rem;
}

/* Grid for Education */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

/* Contact Captcha */
.contact-container {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.captcha-wrapper {
    margin: 2rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

#captcha-canvas {
    background: #fff;
    /* Always white bg for contrast */
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.refresh-btn {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.3s;
}

.refresh-btn:hover {
    transform: rotate(180deg);
}

.captcha-input-group {
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 350px;
}

#captcha-input {
    flex: 1;
    padding: 10px 15px;
    border-radius: 20px;
    border: 1px solid var(--text-color);
    background: transparent;
    color: var(--text-color);
    font-family: var(--font-body);
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

#captcha-input:focus {
    outline: none;
    border-color: var(--accent-color);
}

#verify-btn {
    padding: 10px 20px;
    border-radius: 20px;
    border: none;
    background: var(--accent-color);
    color: #fff;
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 600;
    transition: opacity 0.3s;
}

#verify-btn:hover {
    opacity: 0.9;
}

.error-msg {
    color: var(--pill-red);
    font-size: 0.9rem;
    height: 1.2rem;
    /* Keep space */
}

.hidden-info {
    margin-top: 2rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.hidden-info.revealed {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

a.scramble-text {
    color: var(--accent-color);
    text-decoration: none;
}


/* Matrix Canvas */
#matrix-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1s ease;
}

[data-theme="matrix"] #matrix-canvas {
    opacity: 0.2;
    /* Subtle background effect */
}

/* Shake Animation */
@keyframes shake {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    50% {
        transform: translateX(10px);
    }

    75% {
        transform: translateX(-10px);
    }

    100% {
        transform: translateX(0);
    }
}

.shake {
    animation: shake 0.4s cubic-bezier(.36, .07, .19, .97) both !important;
    border: 2px solid var(--pill-red) !important;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 0;
    opacity: 0.6;
    font-size: 0.8rem;
}

/* Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

@media (min-width: 768px) {
    .timeline::before {
        left: 50%;
    }

    .timeline-item {
        width: 50%;
        padding-left: 0;
        padding-right: 40px;
        text-align: left;
        /* FORCE LEFT ALIGNMENT for ALL items as requested */
    }

    .timeline-item:nth-child(even) {
        align-self: flex-end;
        margin-left: 50%;
        padding-right: 0;
        padding-left: 40px;
        text-align: left;
        /* Ensure even items are also left aligned */
    }

    .timeline-marker {
        left: 50%;
        transform: translateX(-50%);
    }
}