@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap');

:root {
    --bg: #191c1e;
    --bio-color: #868686;
    --border: #222222;
    --btn-hover-border-color: rgba(255, 255, 255, 0.3);
    --btn-halo: rgba(255, 255, 255, 0.15);
    --footer-text: #565e5f;
    --glass-gradient: linear-gradient(225deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0) 100%);
    --glass-hover: linear-gradient(225deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
    --hover-bg: #1a1a1a;
    --label-color: #565e5f;
    --link-text: #f9f9f9;
    --matrix-green: #00ff41;
    --name-color: #f9f9f9;
    --pbd-blue: #4a90e2;
    --status-bg: rgba(74, 222, 128, 0.05);
    --status-glow: rgba(74, 144, 226, 0.35);  
    --status-label: #868686;
    --status-text: #4a90e2;
     --sticker-border: #2a2d30;
    --sticker-shadow: rgba(0, 0, 0, 0.3);
}

.light-mode {
    --bg: #dbdee2;
    --bio-color: #515458;  
    --border: #bcbfc3;
    --btn-hover-border-color: rgba(0, 0, 0, 0.2);
    --btn-halo: rgba(0, 0, 0, 0.15);
    --footer-text: #8e888c;  
    --glass-gradient: linear-gradient(225deg, rgba(0, 0, 0, 0.02) 0%, rgba(0, 0, 0, 0) 100%);
    --glass-hover: linear-gradient(225deg, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.01) 100%);
    --hover-bg: #ced1d5;
    --label-color: #8e888c;    
    --link-text: #141414;      
    --matrix-green: #008f11;
    --name-color: #141414;  
    --pbd-blue: #2d5da1;
    --status-bg: #d1fae5;
    --status-glow: rgba(45, 93, 161, 0.2);
    --status-label: #515458;
    --status-text: #2d5da1;
    --sticker-border: #caced3;
    --sticker-shadow: rgba(0, 0, 0, 0.08);
}

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

body {
    background-color: var(--bg);
    color: var(--bio-color);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    display: flex;
    justify-content: center;
    padding: 80px 24px;
    transition: background-color 0.2s ease;
}

.wrapper {
    width: 100%;
    max-width: 1000px;
}

.index-page .main-grid {
    max-width: 560px;
    margin: 0 auto;
}

.grid-row {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 24px;
    align-items: baseline;
}

.col-left {
    display: flex;
    justify-content: flex-end; 
    text-align: right;
}

.col-right {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
}

.avatar-container {
    margin-bottom: 20px; 
    display: flex;
    justify-content: flex-start;
    text-decoration: none;
}

.avatar-container a {
    text-decoration: none;
    display: block;
    line-height: 0;
    border-radius: 50%;
}

.avatar {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #2a2d30; 
    box-shadow: 0 8px 24px var(--sticker-shadow);
    background: var(--glass-gradient);
}

.main-grid {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.experience-node, .education-node {
    margin-bottom: 16px;
    width: 100%;
}

.experience-node:last-child, .education-node:last-child {
    margin-bottom: 0;
}

/* --- Typography --- */
.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: -4px; 
}

h1 { 
    font-size: 1.8rem; 
    font-weight: 700; 
    margin-bottom: 4px;
    letter-spacing: -0.02em;
    color: var(--name-color);
    transition: color 0.3s ease; /* Scramble */
    min-width: 280px; /* Scramble */
}

.section-title {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.75rem;
    text-transform: lowercase;
    color: var(--label-color);
    opacity: 1;
    padding-top: 6px;
    text-align: right;
}

.bio {
    font-size: 1rem;
    font-weight: 500;
    color: var(--bio-color);
    letter-spacing: -0.015em;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.bio.lead-in {
    margin-bottom: 4px; 
}

.col-right > .bio:last-child {
    margin-bottom: 0;
}

ul.bio {
    padding-left: 2rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

ul.bio li {
    margin-bottom: 0.5rem;
}

.spacer-top {
    margin-top: 1.25rem;
}

/* --- Base Button Convention --- */
.download-btn, #show-more-trigger, .return-top-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 28px;
    padding: 0 14px;
    background: var(--glass-gradient);
    border: 1px solid var(--sticker-border);
    border-radius: 20px;
    font-family: "JetBrains Mono", monospace;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--pbd-blue);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    cursor: default;
}

/* Unified Halo Hover Effect */
.download-btn:hover, 
#show-more-trigger:hover, 
.return-top-btn:hover {
    background: var(--glass-gradient);
    border-color: var(--btn-hover-border-color);
    box-shadow: 0 0 0 4px var(--btn-halo);
    color: var(--pbd-blue);
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--glass-gradient);
    border: 1px solid var(--sticker-border);
    border-radius: 20px;
    cursor: default;
}

.status-text {
    font-family: "JetBrains Mono", monospace;
    font-size: 10px;
    text-transform: uppercase;
    color: var(--pbd-blue);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.pdf-icon {
    color: var(--pbd-blue);
    margin-right: 2px;
}

.dot {
    width: 6px; 
    height: 6px;
    background-color: var(--pbd-blue);
    border-radius: 50%;
    position: relative;
    animation: core-traffic 3s steps(1) infinite;
}

.dot::after {
    content: ""; 
    position: absolute; 
    inset: -1px;
    background-color: var(--pbd-blue);
    border-radius: 50%;
    filter: blur(2px);
    animation: matrix-pulse 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes matrix-pulse {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(2.5); opacity: 0; }
    100% { transform: scale(1); opacity: 0; }
}

.return-top-container {
    display: flex;
    justify-content: flex-end; /* Aligns it to the right of the bio text */
    margin-top: 40px;
    padding-bottom: 20px;
}

.return-top-btn .chevron-icon {
    display: inline-block;
    font-size: 14px;
    transform: rotate(90deg); /* Points the « upwards */
    color: var(--pbd-blue);
    line-height: 1;
}

.footer-copyright p {
    font-style: normal;
    color: var(--footer-text);
    font-size: 11px; /* Matches your current footer style */
}

/* --- Link Buttons --- */
.link-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.link-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--link-text);
    font-size: 0.9rem;
    font-weight: 500;
    background: var(--glass-gradient);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                border-color 0.3s ease,
                background 0.3s ease;
}

.link-button-row {
    display: flex;
    gap: 8px;
    width: 100%;
}

.link-button-row .link-card {
    flex: 1;
    justify-content: center;
    text-align: center;
    padding: 16px 8px;
    margin-bottom: 0;
}

.link-card:hover {
    background: var(--glass-gradient);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.07);
}

.pbd-card {
    padding: 0 !important;
    overflow: hidden;
    cursor: default;
    height: 100px;
    position: relative;
    border: 1px solid var(--sticker-border);
    display: flex;
    margin-top: 8px;
}

.pbd-monitor {
    position: relative;
    width: 100%;
    height: 100%;
    background: #080808;
}

.pbd-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0.5;
    filter: grayscale(100%);
    transition: all 0.4s ease;
}

.pbd-card:hover .pbd-image {
    opacity: 0.9;
    filter: grayscale(0%);
}

.pbd-telemetry {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    flex-direction: row;
    gap: 6px;
    z-index: 10;
    pointer-events: none;
    white-space: nowrap;
}

.pbd-tag {
    font-family: "JetBrains Mono", monospace;
    font-size: 9px;
    color: var(--label-color);
    letter-spacing: 0.5px;
    line-height: 1;
    opacity: 0.8;
}

.pbd-coord {
    font-family: "JetBrains Mono", monospace;
    font-size: 10px;
    color: var(--pbd-blue);
    font-weight: bold;
    line-height: 1;
}

/* --- Progressive Disclosure --- */

/* Hide everything below /about by default */
.row-education, .row-experience {
    display: none !important;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

/* When expanded, show them */
.is-expanded .row-education, .is-expanded .row-experience {
    display: grid !important;
    opacity: 1;
    transform: translateY(0);
}

.col-right {
    position: relative; /* This is the anchor */
}

.reveal-wrapper {
    position: relative;
    max-height:200px;
    overflow: hidden;
    transition: max-height 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-wrapper.is-expanded {
    max-height: 8000px;
}

.reveal-overlay {
    position: absolute;
    bottom: 25px; 
    left: 0;
    width: 100%;
    height: 160px; 
    background: linear-gradient(to bottom, transparent, var(--bg) 75%);
    display: flex;
    justify-content: center;
    align-items: flex-end;
    z-index: 100;
    pointer-events: none;
}

.reveal-overlay.hidden {
    display: none;
}

#show-more-trigger {
    position: relative;
    pointer-events: auto;
    z-index: 101;
}

#show-more-trigger .chevron-icon {
    display: inline-block;
    font-size: 14px;
    transform: rotate(90deg); /* Points the » downwards */
    color: var(--pbd-blue);
    line-height: 1;
}

#show-more-trigger.collapsing {
    transform: translateX(-100px);
    opacity: 0;
    filter: blur(4px);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.4s ease, 
                filter 0.4s ease;
}

/* --- Footer & Theme Toggle --- */
footer {
    margin-top: 16px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    width: 100%;
}

#theme-toggle {
    background: var(--glass-gradient);
    border: 1px solid var(--sticker-border);
    padding: 8px; 
    height: 34px;
    width: 34px;
    border-radius: 20px;
    cursor: pointer;
    display: flex; 
    align-items: center; 
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative; /* Added for absolute children */
    overflow: hidden;   /* Keeps rotation clean */
    z-index: 10;
}

#theme-toggle svg {
    position: absolute; /* Stacked on top of each other */
    color: var(--pbd-blue);
    stroke: currentColor;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.5s ease;
    pointer-events: none;
}

#theme-toggle:hover {
    background: var(--glass-gradient);
    border-color: var(--btn-hover-border-color);
    box-shadow: 0 0 0 4px var(--btn-halo); /* Now uses unified halo */
}

/* Default (Dark Mode): Moon is visible, Sun is rotated away */
.moon {
    opacity: 1;
    transform: rotate(0deg);
}
.sun {
    opacity: 0;
    transform: rotate(-90deg);
}

/* Light Mode: Sun is visible, Moon is rotated away */
.light-mode .sun {
    opacity: 1;
    transform: rotate(0deg);
}
.light-mode .moon {
    opacity: 0;
    transform: rotate(-90deg);
}

/* Hover in Dark Mode: Show Sun spinning in */
#theme-toggle:hover .moon {
    opacity: 0;
    transform: rotate(90deg);
}
#theme-toggle:hover .sun {
    opacity: 1;
    transform: rotate(0deg);
}

/* Hover in Light Mode: Show Moon spinning in */
.light-mode #theme-toggle:hover .sun {
    opacity: 0;
    transform: rotate(90deg);
}
.light-mode #theme-toggle:hover .moon {
    opacity: 1;
    transform: rotate(0deg);
}

.footer-info { display: flex; flex-direction: column; gap: 4px; }

footer p { 
    font-size: 11px; 
    color: var(--footer-text);
    line-height: 1.2; 
}

.last-updated {
    font-size: 9px; 
    color: var(--footer-text);
    opacity: 1;
    font-family: "JetBrains Mono", monospace; 
    text-transform: uppercase;
}

/* --- CV Node Structure --- */
.node-title {
    color: var(--name-color);
    font-weight: 700;
    font-size: 1.35rem; /* Reduced from default h2 size */
    margin-bottom: 0px;
    letter-spacing: -0.01em;
}

.node-org {
    color: var(--pbd-blue);
    font-weight: 600;
    font-size: 1rem; /* Keeping this at standard bio size */
    margin-bottom: 2px;
}

.node-meta-row {
    display: flex;
    gap: 16px; /* Increased slightly for breathing room */
    margin: 0 0 16px 0;
    align-items: center;
}

.node-meta-row .last-updated {
    font-size: 12px; /* Increased from 9px for better legibility */
    text-transform: none; 
    opacity: 0.9;
}

.experience-details {
    width: 100%;
}

/* --- LIGHT MODE OVERRIDES --- */
.light-mode .link-card {
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: var(--glass-gradient);
}

.light-mode .link-card:hover {
    background: var(--glass-gradient);
    border-color: rgba(0, 0, 0, 0.2);
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.05);
}

/* Disable hover effects for the Availability indicator */
.light-mode .status-indicator.download-btn[style*="cursor: default"]:hover,
.status-indicator.download-btn[style*="cursor: default"]:hover {
    background: var(--glass-gradient); /* Keep original background */
    border-color: var(--sticker-border); /* Keep original border */
    box-shadow: none; /* Remove the halo */
}

.light-mode .avatar {
    border-color: #caced3;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.light-mode .pbd-image {
    filter: grayscale(100%) brightness(1.2) contrast(0.7) opacity(0.4);
}

.light-mode .pbd-card:hover .pbd-image {
    filter: grayscale(0%) brightness(1) contrast(1) opacity(1);
}

.light-mode .pbd-monitor {
    background: #f0f2f5;
}

.link-card:focus-visible, 
#theme-toggle:focus-visible {
    outline: 2px solid var(--status-text);
    outline-offset: 4px;
}

.pbd-trigger {
    text-decoration: underline dotted var(--pbd-blue);
    text-underline-offset: 4px;
    cursor: help;
    position: relative;
    color: var(--name-color);
    transition: color 0.2s ease;
}

.pbd-trigger:hover {
    color: var(--pbd-blue);
}

.pbd-trigger::after {
    content: "To me, it underscores our responsibility to deal more kindly with one another, and to preserve and cherish the pale blue dot, the only home we've ever known — Carl Sagan, Pale Blue Dot, 1994";
    position: absolute;
    bottom: 160%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--bg);
    border: 1px solid var(--pbd-blue);
    color: var(--bio-color);
    padding: 14px;
    width: 280px;
    font-size: 11px;
    line-height: 1.4;
    border-radius: 6px;
    z-index: 100;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    font-family: "Inter", sans-serif;
    text-transform: none;
}

/* Show tooltip on hover or focus */
.pbd-trigger:hover::after,
.pbd-trigger:focus::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Tooltip Arrow */
.pbd-trigger:hover::before {
    content: "";
    position: absolute;
    bottom: 135%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 8px 8px 0 8px;
    border-style: solid;
    border-color: var(--pbd-blue) transparent transparent transparent;
    z-index: 101;
}

/* Helper class for the JavaScript scramble effect */
.scramble-active {
    color: var(--pbd-blue) !important;
}

/* --- Responsive --- */
@media (max-width: 480px) {
    .grid-row { 
        grid-template-columns: 1fr; 
        gap: 8px; 
    }

    .col-left { 
        display: none; 
    } 
    
    body { 
        padding: 40px 16px; 
    }

    .avatar { 
        width: 90px; 
        height: 90px; 
    }

    .link-button-row {
        flex-direction: column;
    }
    
    .link-button-row .link-card {
        width: 100%;
        padding: 14px 16px;
    }
}
