/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* === Scroll Reveal Animations ===
   Elements start invisible and translated down, then smoothly fade and
   slide into place when `.animate-in` is added by the IntersectionObserver
   in script.js. Removing the class fades them back out as they leave view. */
.section-header,
.about-summary,
.highlight-item,
.experience-item,
.education-item,
.timeline-item,
.project-card,
.skill-category,
.contact-item,
.contact-header-container {
    opacity: 0;
    transform: translate3d(0, 40px, 0);
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}

.section-header.animate-in,
.about-summary.animate-in,
.highlight-item.animate-in,
.experience-item.animate-in,
.education-item.animate-in,
.timeline-item.animate-in,
.project-card.animate-in,
.skill-category.animate-in,
.contact-item.animate-in,
.contact-header-container.animate-in {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

/* Grid children cascade in based on their sibling index (set in script.js). */
.highlight-item,
.experience-item,
.project-card,
.contact-item {
    transition-delay: calc(var(--reveal-index, 0) * 80ms);
}

@media (prefers-reduced-motion: reduce) {
    .section-header,
    .about-summary,
    .highlight-item,
    .experience-item,
    .education-item,
    .timeline-item,
    .project-card,
    .skill-category,
    .contact-item,
    .contact-header-container {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* Scrolling Background Animation */
.scrolling-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -10;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    animation: scrollingBackgroundFadeIn 1.5s ease-out 1s forwards;
}

.scroll-track {
    position: absolute;
    width: 200%;
    height: 80px;
    display: flex;
    align-items: center;
    gap: 100px;
    white-space: nowrap;
    will-change: transform;
    transform: translateZ(0);
}

.scroll-track-1 {
    top: 10%;
    animation: scrollRight 45s linear infinite;
    animation-delay: 1.5s;
}

.scroll-track-2 {
    top: 50%;
    animation: scrollLeft 55s linear infinite;
    animation-delay: 2s;
}

.scroll-track-3 {
    top: 85%;
    animation: scrollRight 40s linear infinite;
    animation-delay: 2.5s;
}

.scroll-item {
    font-size: 16px;
    color: rgba(134, 134, 139, 0.12);
    font-weight: 500;
    letter-spacing: 0.5px;
    user-select: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
    white-space: nowrap;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, rgba(134, 134, 139, 0.12) 0%, rgba(0, 122, 255, 0.08) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: blur(0.3px);
}

/* Different styling for alternating tracks */
.scroll-track-2 .scroll-item {
    color: rgba(0, 122, 255, 0.1);
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.1) 0%, rgba(134, 134, 139, 0.08) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.scroll-track-3 .scroll-item {
    color: rgba(88, 86, 214, 0.08);
    background: linear-gradient(135deg, rgba(88, 86, 214, 0.08) 0%, rgba(175, 82, 222, 0.06) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Animation keyframes */
@keyframes scrollingBackgroundFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scrollRight {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-12.5%);
    }
}

@keyframes scrollLeft {
    0% {
        transform: translateX(-12.5%);
    }
    100% {
        transform: translateX(0);
    }
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 140px; /* Account for fixed nav height (60px) + extra spacing to completely hide previous white sections */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #1d1d1f;
    background-color: #ffffff;
    overflow-x: hidden;
}

/* Fade in animation on page load */
.nav, .hero, .experience, .education, .projects, .contact, .footer {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

body.loaded .nav, 
body.loaded .hero, 
body.loaded .experience, 
body.loaded .education, 
body.loaded .projects, 
body.loaded .contact, 
body.loaded .footer {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger the animation for a cascade effect.
   Delay only the fade-in properties so section colour swaps stay instant. */
body.loaded .nav {
    transition-delay: 0.1s, 0.1s, 0s, 0s;
}

body.loaded .hero {
    transition-delay: 0.2s;
}

body.loaded .experience {
    transition-delay: 0.4s;
}

body.loaded .education {
    transition-delay: 0.5s;
}

body.loaded .projects {
    transition-delay: 0.6s;
}

body.loaded .contact {
    transition-delay: 0.7s;
}

body.loaded .footer {
    transition-delay: 0.8s;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Navigation */
/* No backdrop-filter here: the nav backgrounds are ~95% opaque so blur is
   invisible, it re-filters on every scroll frame (jank), and it turns the
   nav into a backdrop root that breaks the sweep bar's difference blend. */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: opacity 0.8s ease-out, transform 0.8s ease-out, background-color 0.04s linear, border-color 0.04s linear;
}

/* Dynamic nav backgrounds based on sections */
.nav.nav-hero {
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.nav.nav-about {
    background: rgba(248, 249, 250, 0.95);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.nav.nav-experience {
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.nav.nav-education {
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.nav.nav-projects {
    background: rgba(29, 29, 31, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav.nav-contact {
    background: rgba(29, 29, 31, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    /* Anchors the logo menu so it hangs flush from the bar's bottom edge */
    position: relative;
}

.nav-logo a {
    font-size: 24px;
    font-weight: 600;
    color: #1d1d1f;
    -webkit-tap-highlight-color: transparent;
    text-decoration: none;
    letter-spacing: -0.02em;
    transition: color 0.04s linear;
}

/* Logo color changes for different sections */
.nav.nav-hero .nav-logo a,
.nav.nav-experience .nav-logo a {
    color: #1d1d1f;
}

.nav.nav-projects .nav-logo a,
.nav.nav-contact .nav-logo a {
    color: #ffffff;
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-links a {
    font-size: 16px;
    font-weight: 400;
    color: #1d1d1f;
    text-decoration: none;
    transition: color 0.04s linear;
    position: relative;
}

.nav-links a:hover {
    color: #007aff;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: #007aff;
    transition: width 0.3s ease;
}

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

/* Nav links color changes for different sections */
.nav.nav-hero .nav-links a,
.nav.nav-experience .nav-links a {
    color: #1d1d1f;
}

.nav.nav-projects .nav-links a,
.nav.nav-contact .nav-links a {
    color: #ffffff;
}

.nav.nav-hero .nav-links a:hover,
.nav.nav-experience .nav-links a:hover,
.nav.nav-projects .nav-links a:hover {
    color: #007aff;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: #1d1d1f;
    margin: 3px 0;
    transition: transform 0.3s, opacity 0.3s, background-color 0.04s linear;
}

/* Nav toggle color changes for different sections */
.nav.nav-hero .nav-toggle span,
.nav.nav-experience .nav-toggle span {
    background: #1d1d1f;
}

.nav.nav-projects .nav-toggle span,
.nav.nav-contact .nav-toggle span {
    background: #ffffff;
}

/* Hero Section */
.hero {
    padding: 120px 0 24px;
    background: #ffffff;
    color: #1d1d1f;
    position: relative;
    overflow: hidden;
}

/* Signatures are now anchored to the headshot itself via .hero-image::before
   (see below), so they always frame the face the same way on every device. */

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: 2;
}

.hero-content {
    position: relative;
    /* Fill exactly the first viewport (minus the hero's top padding) so the
       process section starts right after the hero text. */
    height: calc(100vh - 120px);
    min-height: 500px;
    /* Drives the headshot diameter, the artwork frame and the hero bar so
       they stay perfectly proportional across all devices. Override the
       diameter in a media query to scale everything together. */
    --headshot-diameter: 339px;
    --artwork-scale: 5.5125;
}

.hero-image {
    order: 1;
    position: absolute;
    top: 25%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 4;
    width: calc(var(--headshot-diameter) * var(--artwork-scale));
    height: calc(var(--headshot-diameter) * var(--artwork-scale));
    display: flex;
    align-items: center;
    justify-content: center;
}

/* The signature artwork as a fixed-size frame centered on the headshot.
   Because .hero-image is sized relative to the headshot, the signatures
   always sit in the exact same position around the face on every screen. */
.hero-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('Untitled_Artwork.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: var(--bg-opacity, 0.8);
    transition: opacity 0.3s ease-out;
    pointer-events: none;
    z-index: 2;
    /* Nudge the signature layer left of the headshot without moving the face. */
    transform: translateX(-1%);
}

.profile-image {
    position: relative;
    z-index: 1;
    width: var(--headshot-diameter);
    height: var(--headshot-diameter);
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, opacity 1s ease-out;
    animation: none !important;
    opacity: 0;
}

body.loaded .profile-image {
    opacity: 1;
    transition-delay: 0.4s;
}



/* Hero Bottom Text */
.hero-bottom-text {
    position: absolute;
    bottom: 7%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 10;
    opacity: 0;
    transition: opacity 1s ease-out;
    transition-delay: 0.5s;
}

body.loaded .hero-bottom-text {
    opacity: 1;
}

.hero-name-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 24px;
    margin-bottom: 8px;
}

.hero-name {
    font-size: 48px;
    font-weight: 700;
    color: #1d1d1f;
    margin: 0;
    text-shadow: none;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    color: #000000;
    text-decoration: none;
    opacity: 1;
}

.social-icon svg {
    width: 30px;
    height: 30px;
}

.hero-role {
    font-size: 20px;
    font-weight: 400;
    color: #86868b;
    text-shadow: none;
    margin: 0 0 16px 0;
}

/* Default desktop layout: everything reads as one line. The pair wrappers
   prevent each "Role | Role" group from breaking mid-pair on awkward widths. */
.hero-role .role-pair {
    white-space: nowrap;
}

.hero-description {
    font-size: 16px;
    font-weight: 400;
    color: #6e6e73;
    text-shadow: none;
    margin: 0;
    max-width: 600px;
    line-height: 1.5;
    opacity: 1;
}





/* Section Styles */
section {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: 40px;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.section-header p {
    font-size: 18px;
    color: #86868b;
}

/* About Section */
.about {
    background: #ffffff;
    padding: 40px 0 80px 0;
}

.about .section-header h2 {
    color: #1d1d1f;
}

.about .section-header p {
    color: #424245;
}

/* About transition container removed */

/* Hero Profile Image - Enhanced for Transformation */
.profile-image {
    width: var(--headshot-diameter, 339px);
    height: var(--headshot-diameter, 339px);
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* About Content */
.about-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* About layout removed */

.about-text {
    text-align: left;
    margin-bottom: 40px;
}

.about-text h2 {
    font-size: 42px;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
}

.about-summary {
    font-size: 18px;
    color: #1d1d1f;
    line-height: 1.6;
    font-weight: 400;
    margin-bottom: 40px;
}

/* About Highlights */
.about-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.highlight-item {
    padding: 50px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
    min-height: 200px;
}

.highlight-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
}

.highlight-item h3 {
    font-size: 24px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 12px;
    line-height: 1.3;
    text-align: center;
}

.highlight-item p {
    font-size: 16px;
    color: #424245;
    line-height: 1.5;
    margin: 0 0 16px 0;
}

.tech-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 16px;
    justify-content: center;
}

.tech-icons img {
    width: 46px;
    height: 46px;
    border-radius: 8px;
    background: rgba(247, 248, 250, 0.8);
    padding: 9px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    object-fit: contain;
    position: relative;
    cursor: pointer;
}

.tech-icons img:hover {
    transform: scale(1.1);
    background: rgba(247, 248, 250, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Custom Tooltip for Tech Icons - Disabled in favor of JavaScript tooltips */
/* 
.tech-icons img::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(29, 29, 31, 0.95);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    margin-bottom: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tech-icons img::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid rgba(29, 29, 31, 0.95);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    margin-bottom: 2px;
}

.tech-icons img:hover::before,
.tech-icons img:hover::after {
    opacity: 1;
    visibility: visible;
}
*/



/* Disable default browser tooltips for tech icons */
.tech-icons img {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Ensure no title attribute tooltips show */
.tech-icons img[title] {
    title: none !important;
}

/* Custom tooltip styling: technical spec card */
.tech-tooltip {
    position: fixed;
    z-index: 10000;
    max-width: 280px;
    background: var(--ink);
    color: var(--paper);
    padding: 10px 14px 12px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.12);
}

.tech-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

.tech-tooltip-name {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    padding-bottom: 6px;
    margin-bottom: 7px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

.tech-tooltip-usage {
    font-size: 12.5px;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.82);
}

/* Skills section removed */

/* Animations */
@keyframes scrollRight {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-12.5%);
    }
}

@keyframes scrollLeft {
    0% {
        transform: translateX(-12.5%);
    }
    100% {
        transform: translateX(0);
    }
}

/* skillFloat animation removed */

/* Hero Section Parallax Improvements */
.hero {
    will-change: opacity;
}

/* Note: no will-change here — it would create a stacking context on
   .hero-content and break the hero bar's difference blending. */
.hero .hero-content {
    transition: opacity 0.3s ease-out;
}

.hero .profile-image {
    will-change: opacity;
    transition: opacity 0.3s ease-out;
}

.logo-showcase {
    display: flex;
    flex-direction: column;
    gap: 48px;
    padding: 40px 0;
}

.logo-row {
    display: flex;
    align-items: center;
    gap: 80px;
    animation-duration: 40s;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
    width: max-content;
}

.logo-row-1 {
    animation-name: scrollTechRight;
    animation-duration: 45s;
}

.logo-row-2 {
    animation-name: scrollTechLeft;
    animation-duration: 50s;
}

.logo-item {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #86868b;
    transition: all 0.3s ease;
    opacity: 0.7;
    flex-shrink: 0;
}

.logo-item:hover {
    color: #007aff;
    opacity: 1;
    transform: scale(1.1);
}

.logo-item svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@keyframes scrollTechRight {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100vw);
    }
}

@keyframes scrollTechLeft {
    0% {
        transform: translateX(100vw);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* Experience Section */
.experience {
    background: #ffffff;
    color: #1d1d1f;
}

.experience .section-header h2 {
    color: #1d1d1f;
}

.experience .section-header p {
    color: #86868b;
}

.experience-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.experience-item {
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 50px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
    min-height: 200px;
}

.experience-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
}

.experience-logo {
    flex-shrink: 0;
}

.company-logo {
    width: 100px;
    height: 100px;
    object-fit: contain;
    border-radius: 16px;
}

.company-logo-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.company-logo-placeholder.yakattack {
    background: linear-gradient(135deg, #007aff 0%, #5856d6 100%);
}

.company-logo-placeholder.cpr {
    background: linear-gradient(135deg, #ff3b30 0%, #ff9500 100%);
}

.company-logo-placeholder.wooster {
    background: linear-gradient(135deg, #34c759 0%, #30d158 100%);
}

.experience-details {
    flex: 1;
}

.experience-details h3 {
    font-size: 24px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 6px;
    line-height: 1.3;
}

.experience-details h4 {
    font-size: 18px;
    font-weight: 500;
    color: #007aff;
    margin-bottom: 12px;
}

.experience-date {
    font-size: 15px;
    color: #86868b;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Education Section */
.education {
    background: #ffffff;
}

.education-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.education-item {
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 50px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
    min-height: 200px;
}

.education-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
}

.education-logo {
    flex-shrink: 0;
}

.university-logo {
    width: 100px;
    height: 100px;
    object-fit: contain;
    border-radius: 16px;
}

.education-details {
    flex: 1;
}

.education-details h3 {
    font-size: 24px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 6px;
    line-height: 1.3;
}

.education-details h4 {
    font-size: 18px;
    font-weight: 500;
    color: #007aff;
    margin-bottom: 12px;
}

.education-date {
    font-size: 15px;
    color: #86868b;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Projects Section */
.projects {
    background: #1d1d1f;
    color: white;
}

.projects .section-header h2 {
    color: white;
}

.projects .section-header p {
    color: rgba(255, 255, 255, 0.7);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
}

.project-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    background: rgba(255, 255, 255, 0.08);
}

.project-icon {
    font-size: 48px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #007aff 0%, #5856d6 50%, #ff2d92 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

/* Tokenization Animation Styles */
.tokenization-animation {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 120px;
    font-size: 24px;
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    -webkit-text-fill-color: unset;
    text-shadow: none;
    gap: 8px;
    will-change: transform;
    contain: layout style paint;
    transform: translateZ(0);
    padding: 10px 0 12px 0;
}

.text-input {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    font-size: 24px;
    opacity: 1;
    animation: textFadeIn 6s infinite;
    letter-spacing: 1px;
    margin-bottom: 2px;
}

.tokens {
    display: flex;
    gap: 6px;
    opacity: 0;
    animation: tokensAppear 6s infinite;
    animation-delay: 1.5s;
    margin: 2px 0;
}

.token {
    background: rgba(0, 122, 255, 0.2);
    color: #007aff;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 20px;
    font-weight: 600;
    border: 1px solid rgba(0, 122, 255, 0.3);
    opacity: 0;
    transform: translateY(-10px);
    animation: tokenAppear 6s infinite;
}

.token:nth-child(1) {
    animation-delay: 2s;
}

.token:nth-child(2) {
    animation-delay: 2.2s;
}

.token:nth-child(3) {
    animation-delay: 2.4s;
}

.token:nth-child(4) {
    animation-delay: 2.6s;
}

.numbers {
    display: flex;
    gap: 6px;
    opacity: 0;
    animation: numbersAppear 6s infinite;
    animation-delay: 3s;
    margin: 2px 0 4px 0;
}

.number {
    background: rgba(88, 86, 214, 0.2);
    color: #5856d6;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid rgba(88, 86, 214, 0.3);
    font-family: 'Courier New', monospace;
    opacity: 0;
    transform: translate3d(0, 8px, 0);
    animation: numberAppear 6s infinite;
    width: 50px;
    text-align: center;
    line-height: 1.2;
}

.number:nth-child(1) {
    animation-delay: 3.5s;
}

.number:nth-child(2) {
    animation-delay: 3.7s;
}

.number:nth-child(3) {
    animation-delay: 3.9s;
}

.number:nth-child(4) {
    animation-delay: 4.1s;
}

/* Animation Keyframes */
@keyframes textFadeIn {
    0%, 100% { opacity: 0; transform: translate3d(0, 10px, 0); }
    15%, 85% { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes tokensAppear {
    0%, 100% { opacity: 0; }
    25%, 85% { opacity: 1; }
}

@keyframes tokenAppear {
    0%, 100% { opacity: 0; transform: translateY(-10px); }
    40%, 85% { opacity: 1; transform: translateY(0); }
}

@keyframes numbersAppear {
    0%, 100% { opacity: 0; }
    55%, 85% { opacity: 1; }
}

@keyframes numberAppear {
    0%, 100% { opacity: 0; transform: translate3d(0, 6px, 0); }
    65%, 85% { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* Web Scraping Animation Styles */
.scraping-animation {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 120px;
    gap: 12px;
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    -webkit-text-fill-color: unset;
    text-shadow: none;
    will-change: transform;
    contain: layout style paint;
    transform: translateZ(0);
}

.webpage {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    width: 140px;
    height: 100px;
    padding: 8px;
    opacity: 1;
    animation: webpageAppear 7s infinite;
}

.webpage-header {
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    margin-bottom: 8px;
}

.webpage-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.text-line {
    display: flex;
    gap: 3px;
    align-items: center;
}

.text-object {
    height: 4px;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.text-object.normal {
    background: rgba(255, 255, 255, 0.3);
}

.text-object.normal:nth-child(1) { width: 24px; }
.text-object.normal:nth-child(2) { width: 16px; }
.text-object.normal:nth-child(3) { width: 20px; }
.text-object.normal:nth-child(4) { width: 12px; }

.text-line:nth-child(1) .text-object.normal:nth-child(1) { width: 22px; }
.text-line:nth-child(1) .text-object.normal:nth-child(2) { width: 16px; }
.text-line:nth-child(1) .text-object.normal:nth-child(3) { width: 28px; }
.text-line:nth-child(1) .text-object.normal:nth-child(4) { width: 18px; }
.text-line:nth-child(1) .text-object.normal:nth-child(5) { width: 12px; }

.text-line:nth-child(2) .text-object.normal:nth-child(1) { width: 18px; }
.text-line:nth-child(2) .text-object.normal:nth-child(3) { width: 14px; }
.text-line:nth-child(2) .text-object.normal:nth-child(4) { width: 22px; }

.text-line:nth-child(3) .text-object.normal:nth-child(1) { width: 24px; }
.text-line:nth-child(3) .text-object.normal:nth-child(2) { width: 20px; }
.text-line:nth-child(3) .text-object.normal:nth-child(3) { width: 16px; }

.text-line:nth-child(4) .text-object.normal:nth-child(1) { width: 20px; }
.text-line:nth-child(4) .text-object.normal:nth-child(2) { width: 16px; }
.text-line:nth-child(4) .text-object.normal:nth-child(4) { width: 18px; }

.text-line:nth-child(5) .text-object.normal:nth-child(1) { width: 26px; }
.text-line:nth-child(5) .text-object.normal:nth-child(2) { width: 14px; }
.text-line:nth-child(5) .text-object.normal:nth-child(3) { width: 20px; }
.text-line:nth-child(5) .text-object.normal:nth-child(4) { width: 16px; }

.text-line:nth-child(6) .text-object.normal:nth-child(2) { width: 24px; }
.text-line:nth-child(6) .text-object.normal:nth-child(3) { width: 14px; }

.text-line:nth-child(7) .text-object.normal:nth-child(1) { width: 30px; }
.text-line:nth-child(7) .text-object.normal:nth-child(2) { width: 18px; }
.text-line:nth-child(7) .text-object.normal:nth-child(3) { width: 22px; }
.text-line:nth-child(7) .text-object.normal:nth-child(4) { width: 16px; }
.text-line:nth-child(7) .text-object.normal:nth-child(5) { width: 12px; }

.text-object.target {
    background: rgba(255, 255, 255, 0.3);
    width: 32px;
    opacity: 1;
    animation: scanTarget 7s infinite;
    position: relative;
}

.text-object.target::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 122, 255, 0.8);
    border-radius: 2px;
    opacity: 0;
    transform: translate3d(0, 0, 0);
    animation: travelToCollection 7s infinite;
    animation-fill-mode: both;
    will-change: transform, opacity;
}

.text-line:nth-child(2) .text-object.target {
    animation-delay: 1.5s;
}

.text-line:nth-child(2) .text-object.target::after {
    animation-delay: 2.8s;
}

.text-line:nth-child(4) .text-object.target {
    animation-delay: 2.5s;
}

.text-line:nth-child(4) .text-object.target::after {
    animation-delay: 3.8s;
}

.text-line:nth-child(6) .text-object.target {
    animation-delay: 3.5s;
}

.text-line:nth-child(6) .text-object.target::after {
    animation-delay: 4.8s;
}



.collected-data {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.data-collection {
    background: rgba(0, 122, 255, 0.1);
    border: 1px solid rgba(0, 122, 255, 0.3);
    border-radius: 8px;
    padding: 8px;
    min-height: 80px;
    width: 90px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    opacity: 0;
    animation: collectionAppear 7s infinite;
    animation-delay: 4.5s;
}

.collected-object {
    height: 6px;
    width: 60px;
    background: rgba(0, 122, 255, 0.6);
    border-radius: 3px;
    margin-bottom: 4px;
    opacity: 0;
    transform: translateX(-20px) scale(0.8);
    animation: objectCollect 7s infinite;
}

.collected-object:nth-child(1) {
    animation-delay: 5s;
    width: 55px;
}

.collected-object:nth-child(2) {
    animation-delay: 5.3s;
    width: 48px;
}

.collected-object:nth-child(3) {
    animation-delay: 5.6s;
    width: 52px;
}

/* Scraping Animation Keyframes */
@keyframes webpageAppear {
    0%, 100% { opacity: 0; transform: scale(0.9); }
    15%, 85% { opacity: 1; transform: scale(1); }
}

@keyframes scanTarget {
    0%, 100% { opacity: 1; background: rgba(255, 255, 255, 0.3); transform: scale(1); }
    25%, 75% { opacity: 1; background: rgba(0, 122, 255, 0.6); transform: scale(1.1); }
    50% { opacity: 1; background: rgba(0, 122, 255, 0.8); transform: scale(1.15); box-shadow: 0 0 8px rgba(0, 122, 255, 0.6); }
}

@keyframes travelToCollection {
    0%, 15% { opacity: 0; transform: translateX(0) translateY(0) scale(1); }
    20% { opacity: 1; transform: translateX(0) translateY(0) scale(1.1); }
    30% { opacity: 1; transform: translateX(30px) translateY(-8px) scale(0.9); }
    45% { opacity: 1; transform: translateX(80px) translateY(-12px) scale(0.8); }
    60% { opacity: 1; transform: translateX(120px) translateY(-8px) scale(0.7); }
    75% { opacity: 1; transform: translateX(150px) translateY(-2px) scale(0.6); }
    85% { opacity: 0.8; transform: translateX(165px) translateY(0px) scale(0.5); }
    95%, 100% { opacity: 0; transform: translateX(170px) translateY(0px) scale(0.4); }
}

@keyframes collectionAppear {
    0%, 100% { opacity: 0; transform: scale(0.9); }
    65%, 85% { opacity: 1; transform: scale(1); }
}

@keyframes objectCollect {
    0%, 100% { opacity: 0; transform: translateX(-20px) scale(0.8); }
    75%, 90% { opacity: 1; transform: translateX(0) scale(1); }
}

/* Manim Animation Styles */
.manim-animation {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 120px;
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    -webkit-text-fill-color: unset;
    text-shadow: none;
    will-change: transform;
    contain: layout style paint;
    transform: translateZ(0);
}

.transformation-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 100px;
}

.geometric-shape {
    position: relative;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shape-core {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.3) 0%, rgba(88, 86, 214, 0.3) 100%);
    border: 2px solid rgba(0, 122, 255, 0.8);
    transform-origin: center;
    animation: geometricTransform 8s infinite;
}

.wireframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    animation: wireframeAppear 8s infinite;
    animation-delay: 5.5s;
}

.wire-line {
    position: absolute;
    background: rgba(88, 86, 214, 0.8);
    opacity: 0;
    animation: wirelineAppear 8s infinite;
}

.wire-line.horizontal {
    width: 60px;
    height: 1px;
    left: 0;
}

.wire-line.vertical {
    width: 1px;
    height: 60px;
    top: 0;
}

.line-1 {
    top: 15px;
    animation-delay: 6s;
}

.line-2 {
    top: 30px;
    animation-delay: 6.2s;
}

.line-3 {
    top: 45px;
    animation-delay: 6.4s;
}

.line-4 {
    left: 15px;
    animation-delay: 6.6s;
}

.line-5 {
    left: 30px;
    animation-delay: 6.8s;
}

.line-6 {
    left: 45px;
    animation-delay: 7s;
}

/* Geometric Transformation Keyframes */
@keyframes geometricTransform {
    /* Phase 1: Spinning Square (0-25%) */
    0% { 
        border-radius: 0;
        transform: rotate(0deg) scale(1);
        background: linear-gradient(135deg, rgba(0, 122, 255, 0.3) 0%, rgba(88, 86, 214, 0.3) 100%);
    }
    12.5% { 
        border-radius: 0;
        transform: rotate(180deg) scale(1);
        background: linear-gradient(135deg, rgba(0, 122, 255, 0.4) 0%, rgba(88, 86, 214, 0.4) 100%);
    }
    25% { 
        border-radius: 0;
        transform: rotate(360deg) scale(1);
        background: linear-gradient(135deg, rgba(0, 122, 255, 0.5) 0%, rgba(88, 86, 214, 0.5) 100%);
    }
    
    /* Phase 2: Transform to Sphere (25-50%) */
    37.5% { 
        border-radius: 25px;
        transform: rotate(360deg) scale(1.1);
        background: linear-gradient(135deg, rgba(0, 122, 255, 0.6) 0%, rgba(88, 86, 214, 0.6) 100%);
    }
    50% { 
        border-radius: 50%;
        transform: rotate(360deg) scale(1.2);
        background: radial-gradient(circle, rgba(0, 122, 255, 0.7) 0%, rgba(88, 86, 214, 0.4) 100%);
        box-shadow: 0 0 20px rgba(0, 122, 255, 0.4);
    }
    
    /* Phase 3: Flatten to Spatial Geometry (50-87.5%) */
    62.5% { 
        border-radius: 25px;
        transform: rotate(360deg) scale(1.3, 0.8);
        background: linear-gradient(135deg, rgba(0, 122, 255, 0.4) 0%, rgba(88, 86, 214, 0.4) 100%);
        box-shadow: 0 0 10px rgba(0, 122, 255, 0.2);
    }
    75% { 
        border-radius: 8px;
        transform: rotate(360deg) scale(1.4, 0.6);
        background: linear-gradient(135deg, rgba(0, 122, 255, 0.2) 0%, rgba(88, 86, 214, 0.2) 100%);
        border: 2px solid rgba(88, 86, 214, 0.6);
    }
    87.5% { 
        border-radius: 4px;
        transform: rotate(360deg) scale(1.5, 0.4);
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(88, 86, 214, 0.4);
    }
    
    /* Phase 4: Return to Square (87.5-100%) */
    100% { 
        border-radius: 0;
        transform: rotate(720deg) scale(1);
        background: linear-gradient(135deg, rgba(0, 122, 255, 0.3) 0%, rgba(88, 86, 214, 0.3) 100%);
        border: 2px solid rgba(0, 122, 255, 0.8);
        box-shadow: none;
    }
}

@keyframes wireframeAppear {
    0%, 68% { opacity: 0; }
    75%, 87.5% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes wirelineAppear {
    0%, 70% { opacity: 0; transform: scaleX(0); }
    75%, 85% { opacity: 1; transform: scaleX(1); }
    100% { opacity: 0; transform: scaleX(0); }
}

.wire-line.vertical {
    animation-name: wirelineAppearVertical;
}

@keyframes wirelineAppearVertical {
    0%, 70% { opacity: 0; transform: scaleY(0); }
    75%, 85% { opacity: 1; transform: scaleY(1); }
    100% { opacity: 0; transform: scaleY(0); }
}

/* AI Fact Checker Animation Styles */
.fact-check-animation {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 120px;
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    -webkit-text-fill-color: unset;
    text-shadow: none;
    will-change: transform;
    contain: layout style paint;
    transform: translateZ(0);
}

.fact-check-container {
    position: relative;
    width: 200px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.claim-card {
    position: relative;
    width: 140px;
    padding: 12px 14px;
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.92) 0%, rgba(20, 20, 20, 0.92) 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.model-badge {
    display: flex;
    align-items: center;
    gap: 6px;
}

.model-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: linear-gradient(135deg, #007aff 0%, #5856d6 100%);
    box-shadow: 0 0 8px rgba(88, 86, 214, 0.7);
}

.model-name {
    font-size: 9px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.92);
    letter-spacing: 0.6px;
}

.claim-lines {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.claim-line {
    height: 4px;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 2px;
    width: 100%;
}

.claim-line.short {
    width: 62%;
}

.verify-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #34c759 0%, #30b350 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(52, 199, 89, 0.55);
    opacity: 0;
    transform: scale(0);
    animation: verifyAppear 4s infinite;
    animation-delay: 1.8s;
}

.check-icon {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: white;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.scan-line {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 152px;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, rgba(0, 122, 255, 0.95) 50%, transparent 100%);
    box-shadow: 0 0 14px rgba(0, 122, 255, 0.7);
    border-radius: 2px;
    opacity: 0;
    animation: scanFact 4s infinite;
}

@keyframes scanFact {
    0% { top: 20%; opacity: 0; }
    8% { opacity: 1; }
    40% { top: 78%; opacity: 1; }
    50% { top: 78%; opacity: 0; }
    100% { top: 20%; opacity: 0; }
}

@keyframes verifyAppear {
    0%, 40% { opacity: 0; transform: scale(0); }
    50% { opacity: 1; transform: scale(1.25); }
    60%, 92% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0); }
}



/* Class Selector Animation Styles */
.class-selector-animation {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 120px;
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    -webkit-text-fill-color: unset;
    text-shadow: none;
    will-change: transform;
    contain: layout style paint;
    transform: translateZ(0);
}

.phone-container {
    position: relative;
    width: 90px;
    height: 110px;
}

.phone-screen {
    width: 70px;
    height: 100px;
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.95) 0%, rgba(20, 20, 20, 0.95) 100%);
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    padding: 6px;
    position: relative;
    overflow: hidden;
}

.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 8px;
    font-size: 5px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    margin-bottom: 4px;
}

.app-header {
    text-align: center;
    font-size: 7px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 6px;
    padding-bottom: 3px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.schedule-view {
    display: flex;
    height: 60px;
}

.time-column {
    width: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding-right: 4px;
}

.time-label {
    font-size: 5px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    height: 12px;
    display: flex;
    align-items: center;
}

.schedule-slots {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.schedule-slot {
    height: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    transition: all 0.4s ease;
    position: relative;
}

.course-cards {
    position: absolute;
    top: 10px;
    right: -45px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.course-card {
    width: 50px;
    height: 18px;
    background: rgba(0, 122, 255, 0.9);
    border-radius: 6px;
    padding: 2px 4px;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
    opacity: 0;
    transform: translate3d(30px, 0, 0) scale(0.9);
    animation: courseAppear 10s infinite;
    animation-fill-mode: both;
    border: 1px solid rgba(255, 255, 255, 0.2);
    will-change: transform, opacity;
}

.course-title {
    font-size: 5px;
    font-weight: 700;
    color: white;
    text-align: center;
    line-height: 1;
}

.course-time {
    font-size: 4px;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    line-height: 1;
    margin-top: 1px;
}

.card-1 {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.9) 0%, rgba(0, 100, 220, 0.9) 100%);
    animation-delay: 0.5s;
}

.card-2 {
    background: linear-gradient(135deg, rgba(88, 86, 214, 0.9) 0%, rgba(70, 68, 190, 0.9) 100%);
    animation-delay: 2s;
}

.card-3 {
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.9) 0%, rgba(40, 180, 70, 0.9) 100%);
    animation-delay: 3.5s;
}

.conflict-indicator {
    position: absolute;
    top: 15px;
    right: 5px;
    font-size: 8px;
    opacity: 0;
    animation: conflictAlert 10s infinite;
    animation-delay: 4.5s;
    filter: drop-shadow(0 0 4px rgba(255, 149, 0, 0.6));
}

/* Schedule slots fill as courses are added */
.slot-1 {
    animation: slotFill 10s infinite;
    animation-delay: 1.2s;
}

.slot-2 {
    animation: slotFill 10s infinite;
    animation-delay: 2.7s;
}

.slot-3 {
    animation: slotFillConflict 10s infinite;
    animation-delay: 4.2s;
}

.slot-4 {
    animation: slotFill 10s infinite;
    animation-delay: 6.5s;
}

/* Class Selector Animation Keyframes */
@keyframes courseAppear {
    0%, 8% {
        opacity: 0;
        transform: translate3d(30px, 0, 0) scale(0.9) rotateY(15deg);
    }
    12%, 18% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1) rotateY(0deg);
    }
    22% {
        transform: translate3d(-35px, 15px, 0) scale(0.85);
    }
    26% {
        transform: translate3d(-45px, 20px, 0) scale(0.75);
        opacity: 0.8;
    }
    30%, 85% {
        transform: translate3d(-48px, 22px, 0) scale(0.7);
        opacity: 0.3;
    }
    90%, 100% {
        opacity: 0;
        transform: translate3d(-50px, 25px, 0) scale(0.6);
    }
}

@keyframes slotFill {
    0%, 10% {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        transform: scaleX(1);
    }
    15% {
        background: rgba(0, 122, 255, 0.3);
        border: 1px solid rgba(0, 122, 255, 0.5);
        transform: scaleX(1.02);
        box-shadow: 0 0 12px rgba(0, 122, 255, 0.3);
    }
    20%, 80% {
        background: rgba(0, 122, 255, 0.4);
        border: 1px solid rgba(0, 122, 255, 0.6);
        transform: scaleX(1);
        box-shadow: 0 0 8px rgba(0, 122, 255, 0.25);
    }
    85%, 100% {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        transform: scaleX(1);
        box-shadow: none;
    }
}

@keyframes slotFillConflict {
    0%, 20% {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    25% {
        background: rgba(255, 69, 58, 0.6);
        border: 1px solid rgba(255, 69, 58, 0.8);
        box-shadow: 0 0 16px rgba(255, 69, 58, 0.4);
        transform: scaleX(1.05);
    }
    35% {
        background: rgba(255, 149, 0, 0.5);
        border: 1px solid rgba(255, 149, 0, 0.7);
        box-shadow: 0 0 12px rgba(255, 149, 0, 0.3);
        transform: scaleX(1.02);
    }
    45%, 80% {
        background: rgba(52, 199, 89, 0.4);
        border: 1px solid rgba(52, 199, 89, 0.6);
        box-shadow: 0 0 8px rgba(52, 199, 89, 0.25);
        transform: scaleX(1);
    }
    85%, 100% {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: none;
        transform: scaleX(1);
    }
}

@keyframes conflictAlert {
    0%, 42% {
        opacity: 0;
        transform: scale(0.8) rotate(0deg);
    }
    45% {
        opacity: 1;
        transform: scale(1.3) rotate(15deg);
    }
    48% {
        transform: scale(1.1) rotate(-10deg);
    }
    52% {
        transform: scale(1.2) rotate(5deg);
    }
    56% {
        transform: scale(1) rotate(0deg);
    }
    65%, 100% {
        opacity: 0;
        transform: scale(0.8) rotate(0deg);
    }
}

/* JobPilot Animation Styles */
.jobpilot-animation {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 120px;
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    -webkit-text-fill-color: unset;
    text-shadow: none;
    contain: layout style paint;
}

/* Résumé and job posting as two skeleton documents; a packet of data
   travels from CV to JOB, the matching line lights up, and the fit
   score stamps in over the link. One 6s loop, CSS only. */
.jobpilot-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 200px;
    height: 100px;
}

.jp-doc {
    width: 62px;
    padding: 8px 9px 11px;
    border: 1px solid rgba(240, 239, 233, 0.35);
    background: rgba(240, 239, 233, 0.04);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.jp-doc-label {
    font-family: var(--font-mono);
    font-size: 8px;
    letter-spacing: 0.2em;
    color: rgba(240, 239, 233, 0.55);
    margin-bottom: 1px;
}

.jp-line {
    height: 3px;
    background: rgba(240, 239, 233, 0.28);
}

.jp-line.short {
    width: 62%;
}

/* The résumé's lines flash as they're read at the start of the loop */
.jp-resume .jp-line {
    animation: jpRead 6s infinite;
}

.jp-resume .jp-line:nth-child(3) {
    animation-delay: 0.18s;
}

.jp-resume .jp-line:nth-child(4) {
    animation-delay: 0.36s;
}

/* Dashed link between the documents */
.jp-track {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 56px;
    height: 1px;
    transform: translate(-50%, -50%);
    background: repeating-linear-gradient(90deg,
        rgba(240, 239, 233, 0.4) 0 4px,
        transparent 4px 8px);
}

/* Data packet travelling CV → JOB */
.jp-packet {
    position: absolute;
    left: calc(50% - 28px);
    top: 50%;
    width: 5px;
    height: 5px;
    margin-top: -2.5px;
    background: var(--ai-accent);
    opacity: 0;
    animation: jpPacket 6s infinite;
}

@keyframes jpPacket {
    0%, 12% { transform: translateX(0); opacity: 0; }
    16% { opacity: 1; }
    38% { transform: translateX(51px); opacity: 1; }
    42%, 100% { transform: translateX(51px); opacity: 0; }
}

/* The job's matched requirement lights up once the packet lands */
.jp-job .jp-line.match {
    animation: jpMatch 6s infinite;
}

@keyframes jpMatch {
    0%, 40% {
        background: rgba(240, 239, 233, 0.28);
        box-shadow: none;
    }
    46%, 86% {
        background: var(--ai-accent);
        box-shadow: 0 0 8px rgba(111, 242, 198, 0.5);
    }
    94%, 100% {
        background: rgba(240, 239, 233, 0.28);
        box-shadow: none;
    }
}

/* Fit score stamps in above the link */
.jp-fit-badge {
    position: absolute;
    left: 50%;
    top: 12px;
    transform: translateX(-50%) scale(0.6);
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: #0a0a0d;
    background: var(--ai-accent);
    padding: 3px 7px;
    opacity: 0;
    animation: jpBadge 6s infinite;
}

@keyframes jpBadge {
    0%, 42% { opacity: 0; transform: translateX(-50%) scale(0.6); }
    48% { opacity: 1; transform: translateX(-50%) scale(1.1); }
    53%, 86% { opacity: 1; transform: translateX(-50%) scale(1); }
    94%, 100% { opacity: 0; transform: translateX(-50%) scale(0.6); }
}

@keyframes jpRead {
    0%, 4% { background: rgba(240, 239, 233, 0.28); }
    9% { background: rgba(240, 239, 233, 0.8); }
    18%, 100% { background: rgba(240, 239, 233, 0.28); }
}

.project-card h3 {
    font-size: 20px;
    font-weight: 600;
    color: white;
    margin-bottom: 8px;
}

.project-subtitle {
    font-size: 14px;
    color: #007aff;
    font-weight: 500;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.project-card p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    margin-bottom: 20px;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.project-tech span {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.project-link {
    color: #007aff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.project-link:hover {
    color: #0056cc;
}

/* Contact Section */
.contact {
    background: #1d1d1f;
    color: white;
}

.contact .section-header h2 {
    color: white;
}

.contact .section-header p {
    color: rgba(255, 255, 255, 0.7);
}

.contact-content {
    max-width: 600px;
    margin: 0 auto;
}

.contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 32px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.contact-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    background: rgba(255, 255, 255, 0.08);
}

.contact-icon {
    font-size: 24px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #007aff 0%, #5856d6 50%, #ff2d92 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.contact-item h3 {
    font-size: 16px;
    font-weight: 600;
    color: white;
    margin-bottom: 4px;
}

.contact-item a {
    color: #007aff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-item a:hover {
    color: #0056cc;
}

.contact-item span {
    color: rgba(255, 255, 255, 0.7);
}

/* Contact Header with Social Icons */
.contact-header-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    margin-bottom: 16px;
}

.contact-social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.contact-social-icon:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.1);
    color: #007aff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.contact-social-icon svg {
    transition: all 0.3s ease;
}

/* Footer */
.footer {
    background: #1d1d1f;
    color: #86868b;
    text-align: center;
    padding: 40px 0;
}

.footer p {
    font-size: 14px;
}

/* Mobile Navigation Styles */
@media (max-width: 768px) {
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 20px 24px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease, background-color 0.04s linear, border-color 0.04s linear;
    }
    
    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-links a {
        padding: 12px 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    }
    
    .nav-links a:last-child {
        border-bottom: none;
    }
    
    /* Dark theme mobile navigation - for process, projects and contact */
    .nav.nav-ai-stack .nav-links,
    .nav.nav-projects .nav-links,
    .nav.nav-contact .nav-links {
        background: rgba(10, 10, 13, 0.98);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .nav.nav-ai-stack .nav-links a,
    .nav.nav-projects .nav-links a,
    .nav.nav-contact .nav-links a {
        color: #ffffff;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .nav.nav-ai-stack .nav-links a:hover,
    .nav.nav-projects .nav-links a:hover,
    .nav.nav-contact .nav-links a:hover {
        color: #007aff;
    }
    
    .nav.nav-ai-stack .nav-links a:last-child,
    .nav.nav-projects .nav-links a:last-child,
    .nav.nav-contact .nav-links a:last-child {
        border-bottom: none;
    }
    
    /* Light theme mobile navigation - for hero and experience sections */
    .nav.nav-hero .nav-links,
    .nav.nav-experience .nav-links {
        background: rgba(255, 255, 255, 0.98);
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    }
    
    .nav.nav-hero .nav-links a,
    .nav.nav-experience .nav-links a {
        color: #1d1d1f;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    }
    
    .nav.nav-hero .nav-links a:hover,
    .nav.nav-experience .nav-links a:hover {
        color: #007aff;
    }
    
    .nav.nav-hero .nav-links a:last-child,
    .nav.nav-experience .nav-links a:last-child {
        border-bottom: none;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
}

/* Continue with responsive styles */
@media (max-width: 768px) {
    .hero {
        padding: 100px 0 16px;
    }
    
    .hero-content {
        height: calc(100vh - 100px);
        min-height: 400px;
    }
    
    .hero-content {
        --headshot-diameter: 242px;
    }

    .hero-name-container {
        gap: 16px;
        flex-wrap: nowrap;
    }

    .hero-name {
        font-size: 36px;
    }

    .social-icon {
        width: 54px;
        height: 54px;
    }

    .social-icon svg {
        width: 27px;
        height: 27px;
    }
    
    .hero-role {
        font-size: 18px;
    }

    /* On tablet/mobile, break the role list into two clean lines at the
       middle separator: "Student | Software Engineer" / "AI Ambassador | Political Scientist". */
    .hero-role .role-sep-major {
        display: none;
    }
    .hero-role .role-pair {
        display: block;
    }

    .hero-description {
        font-size: 14px;
        max-width: 90%;
    }
    
        /* About Section Mobile Styles */
    .about {
        padding: 80px 0 60px 0;
    }

    .about-highlights {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .highlight-item {
        padding: 32px 24px;
        min-height: auto;
    }

    .highlight-item h3 {
        font-size: 20px;
    }

    .tech-icons {
        gap: 6px;
    }

    .tech-icons {
        gap: 5px;
    }

    .tech-icons img {
        width: 40px;
        height: 40px;
        padding: 8px;
    }
    
    /* Tablet tooltip adjustments - Disabled in favor of JavaScript tooltips */
    /*
    .tech-icons img::before {
        content: attr(data-tooltip);
        font-size: 11px;
        padding: 7px 10px;
        margin-bottom: 7px;
    }
    
    .tech-icons img::after {
        border-left: 5px solid transparent;
        border-right: 5px solid transparent;
        border-top: 5px solid rgba(29, 29, 31, 0.95);
    }
    */
    
    .section-header h2 {
        font-size: 32px;
    }
    
    .logo-showcase {
        gap: 32px;
        padding: 20px 0;
    }
    
    .logo-row {
        gap: 60px;
    }
    
    .logo-item {
        width: 48px;
        height: 48px;
    }
    

    
    .experience-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    
    .experience-item {
        padding: 40px;
        gap: 24px;
        min-height: 160px;
    }
    
    .company-logo,
    .company-logo-placeholder {
        width: 88px;
        height: 88px;
    }
    
    .company-logo-placeholder {
        font-size: 24px;
    }
    
    .experience-details h3 {
        font-size: 20px;
    }
    
    .experience-details h4 {
        font-size: 16px;
    }
    
    .experience-date {
        font-size: 14px;
    }
    
    .education-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    
    .education-item {
        padding: 40px;
        gap: 24px;
        min-height: 160px;
    }
    
    .university-logo {
        width: 88px;
        height: 88px;
    }
    
    .education-details h3 {
        font-size: 20px;
    }
    
    .education-details h4 {
        font-size: 16px;
    }
    
    .education-date {
        font-size: 14px;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-info {
        grid-template-columns: 1fr;
    }
    
    .contact-header-container {
        gap: 24px;
    }
    
    .contact-social-icon {
        width: 44px;
        height: 44px;
    }
    
    .contact-social-icon svg {
        width: 20px;
        height: 20px;
    }
    
    .container {
        padding: 0 16px;
    }
    
    .nav-container {
        padding: 0 16px;
    }
    
    section {
        padding: 60px 0;
    }
    
        /* Mobile adjustments for scrolling background */
    .scroll-item {
        font-size: 14px;
    }

    .scroll-track {
        gap: 70px;
        height: 60px;
    }

    .scroll-track-1 {
        top: 12%;
    }

    .scroll-track-2 {
        top: 52%;
    }

    .scroll-track-3 {
        top: 86%;
    }
}

@media (max-width: 480px) {
    .hero-name-container {
        gap: 12px;
    }

    .hero-name {
        font-size: 28px;
    }

    .social-icon {
        width: 48px;
        height: 48px;
    }

    .social-icon svg {
        width: 24px;
        height: 24px;
    }
    
    .hero-role {
        font-size: 16px;
    }

    .hero-description {
        font-size: 13px;
        max-width: 95%;
    }
    
        /* About Section Extra Small Mobile Styles */
    .about {
        padding: 30px 0 60px 0;
    }

    .highlight-item {
        padding: 24px 20px;
    }

    .highlight-item h3 {
        font-size: 18px;
    }

    .tech-icons {
        gap: 4px;
    }

    .tech-icons img {
        width: 33px;
        height: 33px;
        padding: 6px;
    }
    
    /* Mobile tooltip adjustments - Disabled in favor of JavaScript tooltips */
    /*
    .tech-icons img::before {
        content: attr(data-tooltip);
        font-size: 10px;
        padding: 6px 8px;
        margin-bottom: 6px;
    }
    
    .tech-icons img::after {
        border-left: 4px solid transparent;
        border-right: 4px solid transparent;
        border-top: 4px solid rgba(29, 29, 31, 0.95);
    }
    */


    

    
    .experience-item {
        padding: 32px;
        gap: 20px;
        min-height: 140px;
    }
    
    .company-logo,
    .company-logo-placeholder {
        width: 76px;
        height: 76px;
    }
    
    .company-logo-placeholder {
        font-size: 22px;
    }
    
    .experience-details h3 {
        font-size: 18px;
    }
    
    .experience-details h4 {
        font-size: 15px;
    }
    
    .experience-date {
        font-size: 13px;
    }
    
    .education-item {
        padding: 32px;
        gap: 20px;
        min-height: 140px;
    }
    
    .university-logo {
        width: 76px;
        height: 76px;
    }
    
    .education-details h3 {
        font-size: 18px;
    }
    
    .education-details h4 {
        font-size: 15px;
    }
    
    .education-date {
        font-size: 13px;
    }
    
    .project-card {
        padding: 24px;
    }
    
    .contact-header-container {
        gap: 16px;
    }
    
    .contact-social-icon {
        width: 40px;
        height: 40px;
    }
    
    .contact-social-icon svg {
        width: 18px;
        height: 18px;
    }
    
    .logo-showcase {
        gap: 24px;
        padding: 16px 0;
    }
    
    .logo-row {
        gap: 48px;
    }
    
    .logo-item {
        width: 40px;
        height: 40px;
    }
    
        /* Extra small mobile adjustments for scrolling background */
    .scroll-item {
        font-size: 12px;
    }

    .scroll-track {
        gap: 50px;
        height: 45px;
    }
}

/* Smooth scrolling and animations */
@media (prefers-reduced-motion: no-preference) {
    .project-card, .contact-item {
        animation: fadeInUp 0.8s ease-out;
    }
    
    .experience-item, .education-item, .highlight-item {
        animation: fadeInLeft 0.8s ease-out;
    }
    
    .logo-item {
        animation: fadeInUp 0.8s ease-out;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Focus styles for accessibility.
   Use :focus-visible so the outline only shows during keyboard navigation,
   and not after a mouse click or touch tap. */
a:focus, button:focus {
    outline: none;
}

a:focus-visible, button:focus-visible {
    outline: 2px solid #007aff;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .nav, .footer {
        display: none;
    }
    
    .hero {
        padding-top: 0;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .project-card, .contact-item {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* ============================================================
   TECHNICAL REDESIGN LAYER
   "Reality, by design" language: editorial serif display type,
   mono annotation labels, thin linework, blueprint grid.
   Appended last so it wins the cascade over the legacy styles.
   ============================================================ */

:root {
    --ink: #141414;
    --ink-soft: rgba(20, 20, 20, 0.55);
    --line: rgba(20, 20, 20, 0.25);
    --line-strong: rgba(20, 20, 20, 0.55);
    --paper: #f7f6f2;
    --accent: #2038e6;
    --ai-accent: #6ff2c6;
    --font-display: 'Instrument Serif', Georgia, serif;
    --font-mono: 'Space Mono', 'SF Mono', Menlo, monospace;
}

body {
    background-color: var(--paper);
    color: var(--ink);
}

/* ---------- Navigation: instrument-panel header ---------- */

.nav,
.nav.nav-hero,
.nav.nav-about,
.nav.nav-experience,
.nav.nav-education {
    background: rgba(247, 246, 242, 0.92);
    border-bottom: 1px solid var(--line);
}

.nav.nav-projects,
.nav.nav-contact {
    background: rgba(10, 10, 13, 0.92);
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.nav-logo a {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

/* Logo mark: two versions swapped to match the nav's text colour */
.nav-logo-mark {
    width: 26px;
    height: 26px;
    object-fit: contain;
    display: block;
}

/* Default (light nav states): show the dark mark, hide the light one */
.nav-logo-mark-light {
    display: none;
}

/* Dark nav states: show the light mark, hide the dark one */
.nav.nav-ai-stack .nav-logo-mark-dark,
.nav.nav-projects .nav-logo-mark-dark,
.nav.nav-contact .nav-logo-mark-dark {
    display: none;
}

.nav.nav-ai-stack .nav-logo-mark-light,
.nav.nav-projects .nav-logo-mark-light,
.nav.nav-contact .nav-logo-mark-light {
    display: block;
}

.nav-links a {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

/* No underline indicator — the hover box replaces it */
.nav-links a::after {
    display: none;
}

/* Desktop nav: hovering an option — or the name — paints an inverted rectangle */
@media (min-width: 769px) {
    .nav-links {
        gap: 6px;
    }

    .nav-links a {
        padding: 7px 12px;
        border-radius: 0;
        transition: background-color 0.18s ease, color 0.04s linear;
    }

    /* Logo box: pad it, but pull it back so the name stays flush at rest */
    .nav-logo a {
        padding: 6px 12px;
        margin-left: -12px;
        border-radius: 0;
        transition: background-color 0.18s ease, color 0.04s linear;
    }

    /* Light bar states → dark box, light text */
    .nav .nav-links a:hover,
    .nav.nav-hero .nav-links a:hover,
    .nav.nav-about .nav-links a:hover,
    .nav.nav-experience .nav-links a:hover,
    .nav.nav-education .nav-links a:hover,
    .nav .nav-logo a:hover,
    .nav.nav-hero .nav-logo a:hover,
    .nav.nav-about .nav-logo a:hover,
    .nav.nav-experience .nav-logo a:hover,
    .nav.nav-education .nav-logo a:hover {
        background-color: var(--ink);
        color: var(--paper);
    }

    /* Dark bar states → light box, dark text */
    .nav.nav-ai-stack .nav-links a:hover,
    .nav.nav-projects .nav-links a:hover,
    .nav.nav-contact .nav-links a:hover,
    .nav.nav-ai-stack .nav-logo a:hover,
    .nav.nav-projects .nav-logo a:hover,
    .nav.nav-contact .nav-logo a:hover {
        background-color: var(--paper);
        color: var(--ink);
    }

    /* Swap the logo mark on hover so it stays legible against the inverted box:
       light bars show the dark mark by default → switch to the light mark;
       dark bars show the light mark by default → switch to the dark mark. */
    .nav .nav-logo a:hover .nav-logo-mark-dark,
    .nav.nav-hero .nav-logo a:hover .nav-logo-mark-dark,
    .nav.nav-about .nav-logo a:hover .nav-logo-mark-dark,
    .nav.nav-experience .nav-logo a:hover .nav-logo-mark-dark,
    .nav.nav-education .nav-logo a:hover .nav-logo-mark-dark {
        display: none;
    }

    .nav .nav-logo a:hover .nav-logo-mark-light,
    .nav.nav-hero .nav-logo a:hover .nav-logo-mark-light,
    .nav.nav-about .nav-logo a:hover .nav-logo-mark-light,
    .nav.nav-experience .nav-logo a:hover .nav-logo-mark-light,
    .nav.nav-education .nav-logo a:hover .nav-logo-mark-light {
        display: block;
    }

    .nav.nav-ai-stack .nav-logo a:hover .nav-logo-mark-light,
    .nav.nav-projects .nav-logo a:hover .nav-logo-mark-light,
    .nav.nav-contact .nav-logo a:hover .nav-logo-mark-light {
        display: none;
    }

    .nav.nav-ai-stack .nav-logo a:hover .nav-logo-mark-dark,
    .nav.nav-projects .nav-logo a:hover .nav-logo-mark-dark,
    .nav.nav-contact .nav-logo a:hover .nav-logo-mark-dark {
        display: block;
    }
}

/* ---------- Hero: match the site's serif + mono typography ---------- */

.hero-name {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(40px, 5.5vw, 72px);
    letter-spacing: -0.01em;
    color: var(--ink);
}

.hero-role {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin-top: 6px;
}

.hero-role .role-sep {
    color: var(--line-strong);
    padding: 0 2px;
}

/* ---------- AI Stack: scroll-driven model walkthrough ---------- */

.ai-stack {
    /* Tall scroll runway; the inner viewport is sticky */
    height: 900vh;
    background: #0a0a0d;
    position: relative;
    padding: 0;
}

.ai-sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    color: #f0efe9;
    background: #0a0a0d;
    /* Faint dark blueprint grid */
    background-image:
        linear-gradient(rgba(240, 239, 233, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(240, 239, 233, 0.04) 1px, transparent 1px);
    background-size: 56px 56px;
    display: grid;
    grid-template-columns: 15rem minmax(0, 1fr) minmax(16rem, 20rem);
    grid-template-rows: auto minmax(0, 1fr) auto;
    column-gap: 24px;
    row-gap: 12px;
    padding: 76px 48px 28px;
}

/* Section header — top-left lane */
.ai-header {
    grid-column: 1;
    grid-row: 1;
    z-index: 4;
    min-width: 0;
}

.ai-kicker {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.16em;
    color: rgba(240, 239, 233, 0.5);
    margin: 0 0 8px 0;
}

.ai-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(32px, 2.8vw, 44px);
    line-height: 1;
    letter-spacing: -0.01em;
    color: #f0efe9;
    margin: 0 0 10px 0;
}

.ai-sub {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.14em;
    color: rgba(240, 239, 233, 0.55);
    margin: 0;
}

/* Stage rail — bottom of the left lane */
.ai-rail {
    grid-column: 1;
    grid-row: 2;
    align-self: end;
    z-index: 4;
    list-style: none;
    margin: 0;
    padding: 0;
    font-family: var(--font-mono);
    min-width: 0;
}

.ai-rail li {
    font-size: 11px;
    letter-spacing: 0.12em;
    line-height: 2.2;
    color: rgba(240, 239, 233, 0.35);
    cursor: pointer;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.ai-rail li span {
    display: inline-block;
    width: 28px;
    color: inherit;
}

.ai-rail li.active {
    color: var(--ai-accent, #6ff2c6);
}

.ai-rail li:hover {
    color: rgba(240, 239, 233, 0.8);
}

/* Central SVG canvas — middle lane only */
.ai-canvas {
    grid-column: 2;
    grid-row: 1 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    z-index: 2;
}

.ai-canvas svg {
    width: 100%;
    height: 100%;
    max-width: 1000px;
    max-height: 100%;
    overflow: hidden;
}

/* SVG typography + shared element styles (elements built in script.js) */
#ai-svg text {
    font-family: 'Space Mono', monospace;
    fill: #f0efe9;
}

/* Bump the diagram labels for legibility. JS sets sizes as attributes
   (viewBox units), so attribute selectors let each tier scale without
   flattening the hierarchy. */
#ai-svg text[font-size="8"] { font-size: 10px; }
#ai-svg text[font-size="9"] { font-size: 11px; }
#ai-svg text[font-size="10"] { font-size: 12px; }
#ai-svg text[font-size="11"] { font-size: 13px; }

#ai-svg .ai-dim { fill: rgba(240, 239, 233, 0.45); }
#ai-svg .ai-acc { fill: var(--ai-accent, #6ff2c6); }
#ai-svg .ai-box {
    fill: rgba(240, 239, 233, 0.03);
    stroke: rgba(240, 239, 233, 0.55);
    stroke-width: 1;
}
#ai-svg .ai-box-acc {
    fill: rgba(111, 242, 198, 0.08);
    stroke: var(--ai-accent, #6ff2c6);
    stroke-width: 1;
}
#ai-svg .ai-line {
    stroke: rgba(240, 239, 233, 0.5);
    stroke-width: 1;
    fill: none;
}
#ai-svg .ai-line-acc {
    stroke: var(--ai-accent, #6ff2c6);
    fill: none;
}

/* Isometric cube slabs (geometry built in script.js) */
#ai-svg .ai-slab path {
    stroke-width: 1;
    transition: fill 0.45s ease, stroke 0.45s ease;
}

#ai-svg .ai-slab .f-top   { fill: #232329; stroke: rgba(240, 239, 233, 0.5); }
#ai-svg .ai-slab .f-left  { fill: #17171c; stroke: rgba(240, 239, 233, 0.4); }
#ai-svg .ai-slab .f-right { fill: #101014; stroke: rgba(240, 239, 233, 0.4); }

#ai-svg .ai-slab.hl .f-top   { fill: #1d4a3a; stroke: var(--ai-accent, #6ff2c6); }
#ai-svg .ai-slab.hl .f-left  { fill: #14352b; stroke: var(--ai-accent, #6ff2c6); }
#ai-svg .ai-slab.hl .f-right { fill: #0e281f; stroke: var(--ai-accent, #6ff2c6); }

#ai-svg .ai-slab-label {
    fill: rgba(240, 239, 233, 0.45);
    letter-spacing: 0.1em;
    transition: fill 0.45s ease, opacity 0.4s ease;
}

/* The loop stage draws its feedback arc where the labels sit */
.ai-sticky[data-stage="6"] .ai-slab-label {
    opacity: 0 !important;
}

#ai-svg .ai-slab.hl .ai-slab-label {
    fill: var(--ai-accent, #6ff2c6);
}

#ai-svg .ai-cube-name {
    font-family: 'Instrument Serif', Georgia, serif;
    fill: #f0efe9;
    letter-spacing: 0.04em;
}

#ai-cube-title {
    transition: opacity 0.3s ease;
}

/* Gentle float so the cube reads as hovering off-axis */
#ai-cube {
    animation: aiCubeFloat 7s ease-in-out infinite;
}

@keyframes aiCubeFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-10px); }
}

/* Scene crossfade driven by data-stage on .ai-sticky */
.ai-scene {
    opacity: 0;
    transition: opacity 0.55s ease;
    pointer-events: none;
}

.ai-sticky[data-stage="1"] .ai-scene[data-scene="1"],
.ai-sticky[data-stage="2"] .ai-scene[data-scene="2"],
.ai-sticky[data-stage="3"] .ai-scene[data-scene="3"],
.ai-sticky[data-stage="4"] .ai-scene[data-scene="4"],
.ai-sticky[data-stage="5"] .ai-scene[data-scene="5"],
.ai-sticky[data-stage="6"] .ai-scene[data-scene="6"],
.ai-sticky[data-stage="7"] .ai-scene[data-scene="7"] {
    opacity: 1;
}

/* Fine-grained, within-stage animation hooks (--sp goes 0 → 1) */
#ai-svg .ai-grow {
    transform: scaleX(var(--sp, 0));
    transform-box: fill-box;
    transform-origin: left center;
}

#ai-svg .ai-draw {
    stroke-dasharray: 900;
    stroke-dashoffset: calc(900 * (1 - var(--sp, 0)));
}

#ai-svg .ai-fadein {
    opacity: calc(var(--sp, 0) * 1.6);
}

/* Explanation panels — right lane, stacked in one cell */
.ai-panels {
    grid-column: 3;
    grid-row: 1 / 3;
    align-self: end;
    display: grid;
    width: 100%;
    max-height: 200px;
    overflow: hidden;
    z-index: 4;
    min-width: 0;
}

.ai-panel {
    grid-area: 1 / 1;
    border: 1px solid rgba(240, 239, 233, 0.35);
    background: rgba(10, 10, 13, 0.88);
    padding: 16px 18px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    overflow: hidden;
}

.ai-sticky[data-stage="0"] .ai-panel[data-panel="0"],
.ai-sticky[data-stage="1"] .ai-panel[data-panel="1"],
.ai-sticky[data-stage="2"] .ai-panel[data-panel="2"],
.ai-sticky[data-stage="3"] .ai-panel[data-panel="3"],
.ai-sticky[data-stage="4"] .ai-panel[data-panel="4"],
.ai-sticky[data-stage="5"] .ai-panel[data-panel="5"],
.ai-sticky[data-stage="6"] .ai-panel[data-panel="6"],
.ai-sticky[data-stage="7"] .ai-panel[data-panel="7"],
.ai-sticky[data-stage="8"] .ai-panel[data-panel="8"] {
    opacity: 1;
    visibility: visible;
}

.ai-panel-tag {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.16em;
    color: var(--ai-accent, #6ff2c6);
    margin: 0 0 8px 0;
}

.ai-panel h3 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 24px;
    color: #f0efe9;
    margin: 0 0 8px 0;
}

.ai-panel p {
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.65;
    color: rgba(240, 239, 233, 0.8);
    margin: 0;
}

.ai-panel em {
    font-style: normal;
    color: var(--ai-accent, #6ff2c6);
}

/* Progress readout — own bottom row, centered */
.ai-progress {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-self: center;
    z-index: 4;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.16em;
    color: rgba(240, 239, 233, 0.45);
    margin: 0;
}

/* Nav goes dark over this section */
.nav.nav-ai-stack {
    background: rgba(10, 10, 13, 0.92);
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.nav.nav-ai-stack .nav-logo a,
.nav.nav-ai-stack .nav-links a {
    color: #ffffff;
}

.nav.nav-ai-stack .nav-toggle span {
    background: #ffffff;
}

/* ---------- Section headers: editorial + mono kicker ---------- */

.section-header {
    text-align: left;
    border-top: 1px solid var(--line-strong);
    padding-top: 18px;
}

.section-kicker {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.16em;
    color: var(--ink-soft);
    margin: 0 0 10px 0;
}

.section-header h2 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(48px, 6vw, 84px);
    letter-spacing: -0.01em;
    line-height: 1;
    text-transform: uppercase;
}

.section-header p {
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 0.04em;
    color: var(--ink-soft);
}

/* Dark sections adapt the linework */
.projects .section-header,
.contact .section-header {
    border-top-color: rgba(255, 255, 255, 0.35);
}

.projects .section-kicker,
.contact .section-kicker {
    color: rgba(255, 255, 255, 0.55);
}

.projects .section-header p,
.contact .section-header p {
    color: rgba(255, 255, 255, 0.55);
}

.contact .contact-header-container {
    justify-content: flex-start;
}

/* ---------- Light sections on paper with faint blueprint grid ---------- */

.about,
.experience,
.education {
    background-color: var(--paper);
    background-image:
        linear-gradient(rgba(20, 20, 20, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(20, 20, 20, 0.045) 1px, transparent 1px);
    background-size: 56px 56px;
}

/* ---------- About: editorial summary + spec cards ---------- */

.about-summary {
    font-family: var(--font-display);
    font-size: clamp(24px, 2.6vw, 36px);
    line-height: 1.35;
    font-weight: 400;
    color: var(--ink);
    max-width: 960px;
    margin-bottom: 56px;
}

.about-highlights {
    counter-reset: spec;
    gap: 24px;
}

.highlight-item {
    counter-increment: spec;
    position: relative;
    padding: 26px 28px 30px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
    min-height: 0;
}

.highlight-item::before {
    content: "[ SPEC. 0" counter(spec) " ]";
    display: block;
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.16em;
    color: var(--ink-soft);
    border-bottom: 1px solid var(--line);
    padding-bottom: 12px;
    margin-bottom: 18px;
}

.highlight-item:hover {
    transform: translateY(-4px);
    box-shadow: none;
    border-color: var(--ink);
}

.highlight-item h3 {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 400;
    text-align: left;
    margin-bottom: 10px;
}

.highlight-item p {
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.8;
    color: rgba(20, 20, 20, 0.6);
}

.tech-icons {
    justify-content: flex-start;
    border-top: 1px solid var(--line);
    padding-top: 16px;
}

.tech-icons img {
    border-radius: 0;
    background: transparent;
    border: 1px solid var(--line);
}

.tech-icons img:hover {
    transform: scale(1.08);
    background: #ffffff;
    box-shadow: none;
    border-color: var(--ink);
}

/* ---------- Experience + Education: indexed ledger rows ---------- */

.experience-grid,
.education-grid {
    display: block;
    max-width: 1100px;
    border-top: 1px solid var(--line-strong);
}

.experience-grid {
    counter-reset: role;
}

.education-grid {
    counter-reset: degree;
}

.experience-item,
.education-item {
    display: grid;
    grid-template-columns: 56px 64px 1fr auto auto;
    align-items: center;
    gap: 28px;
    padding: 26px 8px;
    min-height: 0;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
    transition: background 0.25s ease, padding-left 0.25s ease,
                opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: 0s, 0s, calc(var(--reveal-index, 0) * 80ms), calc(var(--reveal-index, 0) * 80ms);
}

.experience-item::before,
.education-item::before {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.14em;
    color: var(--ink-soft);
}

.experience-item::before {
    counter-increment: role;
    content: "[ 0" counter(role) " ]";
}

.education-item::before {
    counter-increment: degree;
    content: "[ 0" counter(degree) " ]";
}

.experience-item:hover,
.education-item:hover {
    background: #ffffff;
    padding-left: 20px;
    box-shadow: none;
}

.company-logo,
.university-logo {
    width: 56px;
    height: 56px;
    border-radius: 0;
}

.experience-details h3,
.education-details h3 {
    font-family: var(--font-display);
    font-size: clamp(22px, 2.3vw, 32px);
    font-weight: 400;
    line-height: 1.1;
    margin-bottom: 6px;
}

.experience-details h4,
.education-details h4 {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0;
}

.experience-date,
.education-date {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    color: var(--ink-soft);
    justify-self: end;
    text-align: right;
}

/* Expandable detail log per role */
.experience-item[data-expandable],
.education-item[data-expandable] {
    cursor: pointer;
}

/* Honors strip under the degree line — visible without expanding */
.education-honors {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin: 8px 0 0;
}

.experience-toggle {
    font-family: var(--font-mono);
    font-size: 18px;
    line-height: 1;
    color: var(--ink-soft);
    justify-self: end;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), color 0.25s ease;
}

.experience-item.open .experience-toggle,
.education-item.open .experience-toggle {
    transform: rotate(45deg);
    color: var(--accent);
}

.experience-item.open,
.education-item.open {
    background: #ffffff;
}

.experience-body {
    grid-column: 1 / -1;
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.experience-item.open .experience-body,
.education-item.open .experience-body {
    grid-template-rows: 1fr;
}

.experience-body-inner {
    overflow: hidden;
    min-height: 0;
}

.experience-body ul {
    list-style: none;
    margin: 0;
    padding: 20px 0 4px;
    border-top: 1px solid var(--line);
}

.experience-body li {
    position: relative;
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.8;
    color: rgba(20, 20, 20, 0.65);
    padding-left: 20px;
    margin-bottom: 10px;
    max-width: 720px;
}

.experience-body li::before {
    content: "▸";
    position: absolute;
    left: 0;
    color: var(--accent);
}

.experience-meta {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.14em;
    color: var(--ink-soft);
    margin: 8px 0 6px;
}

/* ---------- Projects: case-file panels on the dark grid ---------- */

.projects {
    background-color: #0a0a0d;
    background-image:
        linear-gradient(rgba(240, 239, 233, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(240, 239, 233, 0.035) 1px, transparent 1px);
    background-size: 56px 56px;
}

.projects-grid {
    counter-reset: fig;
}

.project-card {
    counter-increment: fig;
    background: rgba(240, 239, 233, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    padding: 24px 24px 28px;
}

.project-card::before {
    content: "FIG. 0" counter(fig) " — CASE FILE";
    display: block;
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.16em;
    color: rgba(240, 239, 233, 0.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    margin: -24px -24px 20px;
    padding: 10px 14px;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: none;
    background: rgba(240, 239, 233, 0.04);
    border-color: rgba(111, 242, 198, 0.45);
}

.project-icon {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(240, 239, 233, 0.02);
    padding: 12px;
    margin-bottom: 20px;
    text-shadow: none;
}

.project-card h3 {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 400;
    line-height: 1.05;
    margin-bottom: 8px;
}

.project-card .project-subtitle {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.16em;
    color: var(--ai-accent);
    margin-bottom: 14px;
}

.project-card > p:not(.project-subtitle) {
    font-size: 14px;
    line-height: 1.7;
    color: rgba(240, 239, 233, 0.65);
}

.project-tech span {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-radius: 0;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: rgba(240, 239, 233, 0.7);
}

.project-link {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ai-accent);
}

.project-link:hover {
    color: #f0efe9;
}

/* Responsive: ledgers stack, keep hierarchy */
@media (max-width: 768px) {
    .experience-item,
    .education-item {
        grid-template-columns: 44px 48px 1fr auto;
        gap: 14px;
        padding: 20px 4px;
    }

    .experience-toggle {
        grid-column: 4;
        grid-row: 1;
        align-self: start;
    }

    .experience-item::before,
    .education-item::before {
        font-size: 9px;
    }

    .company-logo,
    .university-logo {
        width: 44px;
        height: 44px;
    }

    .experience-date,
    .education-date {
        grid-column: 3;
        justify-self: start;
        text-align: left;
        margin-top: 4px;
    }

    .about-highlights {
        gap: 16px;
    }
}

/* ---------- Contact: ledger + status panel ---------- */

.contact {
    background-color: #0a0a0d;
    background-image:
        linear-gradient(rgba(240, 239, 233, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(240, 239, 233, 0.035) 1px, transparent 1px);
    background-size: 56px 56px;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 56px;
    align-items: start;
}

.contact-ledger {
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.ledger-row {
    display: grid;
    grid-template-columns: 170px 1fr auto;
    align-items: center;
    gap: 24px;
    padding: 24px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
    text-decoration: none;
    transition: background 0.25s ease, padding-left 0.25s ease;
}

a.ledger-row:hover {
    background: rgba(111, 242, 198, 0.05);
    padding-left: 16px;
}

.ledger-key {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.16em;
    color: rgba(240, 239, 233, 0.45);
}

.ledger-value {
    font-family: var(--font-display);
    font-size: clamp(20px, 2.2vw, 28px);
    line-height: 1.1;
    color: #f0efe9;
    transition: color 0.25s ease;
}

a.ledger-row:hover .ledger-value {
    color: var(--ai-accent, #6ff2c6);
}

.ledger-arrow {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--ai-accent, #6ff2c6);
    transition: transform 0.25s ease;
}

a.ledger-row:hover .ledger-arrow {
    transform: translate(4px, -4px);
}

.ledger-coords {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    color: rgba(240, 239, 233, 0.4);
}

/* Status panel */
.contact-panel {
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(10, 10, 13, 0.85);
}

.contact-panel-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 14px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    background: #f0efe9;
    color: #0a0a0d;
}

.contact-panel-body {
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.8;
    color: rgba(240, 239, 233, 0.8);
    margin: 0;
    padding: 18px 16px;
}

.contact-panel-foot {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 14px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.contact-meta {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.14em;
    color: rgba(240, 239, 233, 0.45);
    margin: 0;
}

.contact-meta span {
    color: var(--ai-accent, #6ff2c6);
}

/* Scroll reveal for the new contact elements */
.ledger-row,
.contact-panel {
    opacity: 0;
    transform: translate3d(0, 30px, 0);
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.8s cubic-bezier(0.22, 1, 0.36, 1),
                background 0.25s ease, padding-left 0.25s ease;
    transition-delay: calc(var(--reveal-index, 0) * 80ms), calc(var(--reveal-index, 0) * 80ms), 0s, 0s;
}

.ledger-row.animate-in,
.contact-panel.animate-in {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

/* Footer matches the instrument-panel language */
.footer {
    background: #0a0a0d;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.footer p {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

@media (max-width: 900px) {
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .ledger-row {
        grid-template-columns: 120px 1fr auto;
        gap: 14px;
        padding: 18px 4px;
    }

    .ledger-coords {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ledger-row,
    .contact-panel {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ---------- AI Stack responsive ---------- */

@media (max-width: 1180px) {
    .ai-sticky {
        grid-template-columns: 12.5rem minmax(0, 1fr) minmax(15rem, 18rem);
        padding-left: 28px;
        padding-right: 28px;
    }
}

@media (max-width: 960px) {
    .ai-sticky {
        height: 100svh;
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(0, 1fr) auto auto;
        column-gap: 0;
        row-gap: 10px;
        padding: 72px 20px 16px;
    }

    .ai-header {
        grid-column: 1;
        grid-row: 1;
    }

    .ai-title {
        font-size: 28px;
    }

    .ai-rail {
        display: none;
    }

    .ai-canvas {
        grid-column: 1;
        grid-row: 2;
    }

    .ai-canvas svg {
        width: 100%;
        height: 100%;
    }

    .ai-panels {
        grid-column: 1;
        grid-row: 3;
        max-height: none;
        align-self: stretch;
    }

    .ai-panel {
        padding: 14px 16px;
    }

    .ai-panel h3 {
        font-size: 22px;
    }

    .ai-panel p {
        font-size: 13px;
        line-height: 1.6;
    }

    .ai-progress {
        grid-column: 1;
        grid-row: 4;
    }

    /* Cube labels and scene captions duplicate the card on phones
       and were the main overlap source after the label-size bump. */
    #ai-svg .ai-slab-label,
    #ai-svg .ai-scene-caption {
        display: none;
    }

    /* The SVG renders at roughly a third of its viewBox size on phones,
       so its labels need a much bigger boost to stay legible. */
    #ai-svg text[font-size="8"] { font-size: 14px; }
    #ai-svg text[font-size="9"] { font-size: 16px; }
    #ai-svg text[font-size="10"] { font-size: 17px; }
    #ai-svg text[font-size="11"] { font-size: 18px; }
    #ai-svg text[font-size="15"] { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
    .ai-scene,
    .ai-panel {
        transition: none;
    }

    #ai-cube {
        animation: none;
    }

    #ai-svg .ai-grow {
        transform: scaleX(1);
    }

    #ai-svg .ai-draw {
        stroke-dasharray: none;
        stroke-dashoffset: 0;
    }

    #ai-svg .ai-fadein {
        opacity: 1;
    }
}

/* ---------- Hero bar: black band spinning around the headshot ---------- */

/* A full-width band, exactly as tall as the circular headshot and centred on
   it. It's a white plate with difference blending: over the white page it
   reads as solid black, and every pixel it covers — signatures, name, icons —
   inverts to its opposite. On scroll it spins around the headshot's axis;
   a circular hole at the axis keeps the photo itself untouched. */
.hero-bar {
    position: absolute;
    top: 25%;
    left: 50%;
    /* Long enough that its ends stay past the page edges at any rotation
       angle (the hero's overflow clipping trims the excess). */
    width: calc(120vw + 220vh);
    height: var(--headshot-diameter);
    transform: translate(-50%, -50%) rotate(var(--bar-angle, 0deg));
    background: #fff;
    mix-blend-mode: difference;
    pointer-events: none;
    z-index: 11;
    /* Fades in lockstep with the signature layer on scroll (0.8 → 0) */
    opacity: calc(var(--bg-opacity, 0.8) / 0.8);
    /* The closest side is half the bar's height, matching the photo radius.
       Percentage stops keep the cutout tied to the rendered band when browser
       zoom changes; pixel stops can retain their previous zoomed size. */
    -webkit-mask-image: radial-gradient(circle closest-side at 50% 50%,
        transparent 99.7%, #000 100%);
    mask-image: radial-gradient(circle closest-side at 50% 50%,
        transparent 99.7%, #000 100%);
    will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
    .hero-bar {
        transform: translate(-50%, -50%);
    }
}

/* ---------- Logo menu: back to top / résumé download ---------- */

.logo-menu {
    position: absolute;
    top: 100%;
    left: 24px;
    min-width: 220px;
    background: var(--paper);
    border: 1px solid var(--line-strong);
    border-top: none;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.14);
    z-index: 1001;
}

/* Align with the logo's hover box, which bleeds 12px left on desktop */
@media (min-width: 769px) {
    .logo-menu {
        left: 12px;
    }
}

/* Scoped under .nav-logo to out-rank the logo lockup's `.nav-logo a`
   styling (inline-flex, negative margin), which must not leak in here. */
.nav-logo .logo-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 12px 16px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px solid var(--line);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-logo .logo-menu-item:last-child {
    border-bottom: none;
}

.nav-logo .logo-menu-item:hover {
    background: var(--ink);
    color: var(--paper);
}

/* Dark nav states → dark panel, light text */
.nav.nav-ai-stack .logo-menu,
.nav.nav-projects .logo-menu,
.nav.nav-contact .logo-menu {
    background: #0a0a0d;
    border-color: rgba(240, 239, 233, 0.3);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
}

.nav.nav-ai-stack .logo-menu-item,
.nav.nav-projects .logo-menu-item,
.nav.nav-contact .logo-menu-item {
    color: var(--paper);
    border-bottom-color: rgba(240, 239, 233, 0.14);
}

.nav.nav-ai-stack .logo-menu-item:hover,
.nav.nav-projects .logo-menu-item:hover,
.nav.nav-contact .logo-menu-item:hover {
    background: var(--paper);
    color: var(--ink);
}

/* ---------- Nav sweep: inverted nav clone under a rotating clip ---------- */

/* A colour-inverted copy of the nav (cloned by JS) sits on top of the real
   one. Each scroll frame the clip-path is set to the hero bar's rotated
   band, so the strip and every option on it appear per-pixel inverted
   exactly where the bar crosses — no blend modes, works everywhere. */
.nav-invert {
    position: absolute;
    inset: 0;
    background: var(--ink);
    pointer-events: none;
    display: none;
}

.nav .nav-invert .nav-links a,
.nav .nav-invert .nav-logo a {
    color: var(--paper);
}

.nav .nav-invert .nav-logo a .nav-logo-mark-dark {
    display: none;
}

.nav .nav-invert .nav-logo a .nav-logo-mark-light {
    display: inline-block;
}

.nav .nav-invert .nav-toggle span {
    background: var(--paper);
}
