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

/* CSS Custom Properties */
:root {
    --bg-color: #000000;
    --text-color: #ffffff;
    --accent-color: #666666;
    --nav-active: #ffffff;
    --nav-inactive: #666666;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    /* Contrast halo behind text so it stays legible over the shader background */
    --text-halo: rgba(0, 0, 0, 0.55);
    --progress-height: 25%;
    
    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    
    /* Transitions */
    --transition-fast: 0.15s ease-in-out;
    --transition-normal: 0.3s ease-in-out;
    --transition-slow: 0.5s ease-in-out;
}

/* White Theme */
body[data-theme="light"] {
    --bg-color: #ffffff;
    --text-color: #000000;
    --accent-color: #999999;
    --nav-active: #000000;
    --nav-inactive: #999999;
    --glass-bg: rgba(0, 0, 0, 0.05);
    --glass-border: rgba(0, 0, 0, 0.1);
    /* Light theme: white halo behind dark text */
    --text-halo: rgba(255, 255, 255, 0.7);
}

/* Base Typography */
html {
    font-size: 16px;
    scroll-behavior: smooth;
    /* Native, continuous scrolling with gentle snapping to each section.
       "proximity" (not "mandatory") never fights the user mid-section. */
    scroll-snap-type: y proximity;
}

body {
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    transition: all var(--transition-normal);
    cursor: default;
    font-weight: 300;
    letter-spacing: 0.01em;
    font-synthesis-weight: none;
    font-synthesis-style: none;
}


/* Background Canvas */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* Progress Indicator */
.progress-indicator {
    position: fixed;
    top: 50%;
    left: 30px;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
}

.progress-bar {
    width: 2px;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    position: relative;
    border-radius: 1px;
    overflow: hidden;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--progress-height);
    background: var(--text-color);
    border-radius: 1px;
    transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
}

.progress-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.7rem;
    color: var(--text-color);
    font-weight: 300;
    letter-spacing: 0.02em;
}

.current-section {
    color: var(--text-color);
    font-size: 0.9rem;
    font-weight: 400;
    margin-bottom: 2px;
    letter-spacing: 0.02em;
}

.total-sections::before {
    content: '/';
    margin-right: 2px;
}

/* Scroll Hint */
.scroll-hint {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    opacity: 0.8;
    animation: fadeInOut 2s ease-in-out infinite;
}

.scroll-hint-text {
    font-size: 0.8rem;
    color: var(--text-color);
    font-weight: 300;
    letter-spacing: 0.01em;
}

.scroll-hint-arrow {
    font-size: 1.2rem;
    color: var(--text-color);
    animation: bounce 2s ease-in-out infinite;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-5px); }
    60% { transform: translateY(-3px); }
}

/* Navigation */
.navigation {
    position: fixed;
    top: 50%;
    right: 50px;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.nav-item {
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    padding: var(--space-sm);
    background: transparent;
    border: none;
}

.nav-item:hover,
.nav-item:focus {
    background: rgba(255, 255, 255, 0.05);
    
    border-radius: 8px;
    transform: translateX(-4px);
    box-shadow: none;
}

.nav-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--nav-inactive);
    margin-right: var(--space-md);
    transition: all var(--transition-normal);
}

.nav-item.active .nav-dot {
    background: var(--text-color);
    transform: scale(1.2);
    box-shadow: none;
    animation: none;
}


.nav-text {
    color: var(--nav-active);
    font-size: 0.9rem;
    opacity: 1;
    transition: all var(--transition-normal);
    white-space: nowrap;
    font-weight: 300;
    letter-spacing: 0.02em;
}

.nav-item:hover .nav-text,
.nav-item.active .nav-text {
    opacity: 1;
    color: var(--nav-active);
}

/* Main Content Layout */
.content {
    padding: 0 var(--space-xl);
    min-height: 100vh;
    position: relative;
    z-index: 2;
}

.section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    /* Full-screen sections are gentle snap targets; sections taller than the
       viewport opt out below so their top edge can't trap the scroll. */
    scroll-snap-align: start;
}

.section#projects {
    justify-content: flex-start;
    padding: 2rem 0;
    /* Taller than one screen: flows in the page scroll, no internal scroller.
       Not a snap target — a start-aligned tall section re-pulls its top edge
       and locks you at the boundary. */
    height: auto;
    scroll-snap-align: none;
}

.section#projects::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none; /* Chrome, Safari, Opera */
}

/* Info can grow past one screen (who I help + process + skills) — flows in the page scroll */
.section#info {
    justify-content: flex-start;
    padding: 2rem 0;
    height: auto;
    /* Can exceed the viewport — opt out of snapping (see #projects note). */
    scroll-snap-align: none;
}

.section#info::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

/* Boundary feedback animations */
.section#projects.boundary-top.boundary-progress-1 {
    animation: bounceTopLight 0.3s ease-out;
}

.section#projects.boundary-top.boundary-progress-2 {
    animation: bounceTopMedium 0.3s ease-out;
}

.section#projects.boundary-bottom.boundary-progress-1 {
    animation: bounceBottomLight 0.3s ease-out;
}

.section#projects.boundary-bottom.boundary-progress-2 {
    animation: bounceBottomMedium 0.3s ease-out;
}

/* Progressive bounce animations */
@keyframes bounceTopLight {
    0% { transform: translateY(0); }
    50% { transform: translateY(3px); }
    100% { transform: translateY(0); }
}

@keyframes bounceTopMedium {
    0% { transform: translateY(0); }
    50% { transform: translateY(6px); }
    100% { transform: translateY(0); }
}

@keyframes bounceBottomLight {
    0% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
    100% { transform: translateY(0); }
}

@keyframes bounceBottomMedium {
    0% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
    100% { transform: translateY(0); }
}

.section.active {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

/* Reset animations when section becomes inactive */
.section:not(.active) h2,
.section:not(.active) h2::after,
.section:not(.active) .project-item,
.section:not(.active) .project-date,
.section:not(.active) .project-title,
.section:not(.active) .project-description,
.section:not(.active) .info-content p,
.section:not(.active) .skills,
.section:not(.active) .skills h3,
.section:not(.active) .skills li,
.section:not(.active) .contact-content p,
.section:not(.active) .contact-links,
.section:not(.active) .contact-link {
    animation: none;
    opacity: 0;
    transform: translateY(20px);
}

.section:not(.active) h2::after {
    transform: scaleX(0);
}

/* Home Section */
.intro {
    position: relative;
    z-index: 2;
}

.title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 300;
    margin-bottom: var(--space-lg);
    line-height: 1.1;
    letter-spacing: -0.01em;
    overflow: hidden;
}

.title-line {
    display: block;
    transform: translateY(100%);
    animation: slideUp 0.8s ease-out forwards;
}

.title-line:nth-child(2) {
    animation-delay: 0.1s;
}

@keyframes slideUp {
    to {
        transform: translateY(0);
    }
}

.subtitle {
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    color: var(--text-color);
    margin-bottom: var(--space-xl);
    max-width: 600px;
    line-height: 1.6;
    font-weight: 300;
    letter-spacing: 0.01em;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.5s forwards;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

@keyframes scaleInX {
    from {
        opacity: 0;
        transform: scaleX(0);
    }
    to {
        opacity: 1;
        transform: scaleX(1);
    }
}

.cta-buttons {
    display: flex;
    gap: var(--space-lg);
    flex-wrap: wrap;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.7s forwards;
}

.cta-button {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-color);
    padding: var(--space-md) var(--space-lg);
    font-family: inherit;
    font-weight: 300;
    letter-spacing: 0.01em;
    cursor: default;
    border-radius: 50px;
    transition: all var(--transition-normal);
    backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
}

.cta-button-secondary {
    background: var(--text-color);
    color: var(--bg-color);
    border-color: var(--text-color);
}

/* The secondary CTA is a real link (opens Calendly) — no underline, show a pointer */
a.cta-button {
    text-decoration: none;
    cursor: pointer;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.cta-button:hover::before {
    left: 100%;
}

.cta-button:hover {
    background: var(--text-color);
    color: var(--bg-color);
    border-color: transparent;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cta-button:active {
    transform: translateY(-1px) scale(0.98);
}

/* Section Titles */
h2 {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: var(--space-xl);
    font-weight: 300;
    letter-spacing: -0.01em;
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease-out 0.1s forwards;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--text-color);
    border-radius: 2px;
    opacity: 0;
    transform: scaleX(0);
    transform-origin: left;
    animation: scaleInX 0.6s ease-out 0.4s forwards;
}

/* Projects Section */
/* Projects category filter (chooser) */
.projects-filter {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease-out 0.15s forwards;
}

.projects-filter-tab {
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    color: var(--text-color);
    background: transparent;
    border: 1.5px solid var(--text-color);
    border-radius: 50px;
    padding: 0.6rem 1.5rem;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.projects-filter-tab:hover {
    transform: translateY(-2px);
}

.projects-filter-tab.active {
    background: var(--text-color);
    color: var(--bg-color);
}

.projects-filter-desc {
    font-size: 1rem;
    font-weight: 300;
    letter-spacing: 0.01em;
    color: var(--text-color);
    text-shadow: 0 1px 4px var(--text-halo);
    margin-bottom: 1.5rem;
    max-width: 600px;
    line-height: 1.5;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease-out 0.25s forwards;
}

.projects-grid {
    display: grid;
    gap: var(--space-xl);
    width: 100%;
    padding-bottom: 2rem;
}

/* Collapsible system groups (e.g. "Contract & Document Ops") */
.projects-group-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 0.25rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--text-color);
    color: var(--text-color);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: opacity var(--transition-normal);
}

.projects-group-header:hover {
    opacity: 0.7;
}

.projects-group-title {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-shadow: 0 1px 4px var(--text-halo);
}

.projects-group-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--text-color);
}

.projects-group-count {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1;
    padding: 0.35rem 0.7rem;
    border: 2px solid var(--text-color);
    border-radius: 50px;
}

.projects-group-chevron {
    font-size: 1.2rem;
    font-weight: 700;
    transition: transform var(--transition-normal);
}

.projects-group.collapsed .projects-group-chevron {
    transform: rotate(-90deg);
}

.projects-group-body {
    display: grid;
    gap: var(--space-lg);
    margin-top: var(--space-lg);
}

.projects-group.collapsed .projects-group-body {
    display: none;
}

.project-item {
    display: grid;
    grid-template-columns: 80px 1fr;
    grid-template-rows: auto auto auto auto;
    gap: 16px 24px;
    padding: 1.75rem;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: var(--glass-bg);
    backdrop-filter: blur(4px);
    cursor: pointer;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                background-color 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease-out forwards;
}

/* Persistent affordance so clients know a card opens details */
.project-item::after {
    content: "View details →";
    grid-column: 2;
    grid-row: 4;
    justify-self: start;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    color: var(--text-color);
    opacity: 0.85;
    text-shadow: 0 1px 4px var(--text-halo);
    transition: opacity var(--transition-normal), transform var(--transition-normal);
}

.project-item:hover::after {
    opacity: 1;
    transform: translateX(5px);
}

.project-item:nth-child(1) { animation-delay: 0.1s; }
.project-item:nth-child(2) { animation-delay: 0.2s; }
.project-item:nth-child(3) { animation-delay: 0.3s; }
.project-item:nth-child(4) { animation-delay: 0.4s; }
.project-item:nth-child(5) { animation-delay: 0.5s; }
.project-item:nth-child(6) { animation-delay: 0.6s; }

.project-date {
    font-size: 0.9rem;
    font-weight: 300;
    letter-spacing: 0.02em;
    color: var(--text-color);
    text-shadow: 0 1px 4px var(--text-halo);
    grid-column: 1;
    grid-row: 1;
    opacity: 0;
    animation: fadeIn 0.8s ease-out 0.2s forwards;
}

.project-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
    border-color: var(--text-color);
}


.project-title {
    font-size: 1.2rem;
    font-weight: 400;
    letter-spacing: 0.01em;
    text-shadow: 0 1px 4px var(--text-halo);
    margin-bottom: 0.75rem;
    grid-column: 2;
    grid-row: 1;
    opacity: 0;
    transform: translateX(-20px);
    animation: slideInLeft 0.8s ease-out 0.3s forwards;
}

.project-description {
    font-size: 1rem;
    font-weight: 300;
    color: var(--text-color);
    text-shadow: 0 1px 4px var(--text-halo);
    line-height: 1.6;
    text-align: justify;
    margin-bottom: 0;
    grid-column: 2;
    grid-row: 2;
    opacity: 0;
    animation: fadeIn 0.8s ease-out 0.4s forwards;
}

/* Highlight metric — the outcome a client cares about, visible before opening */
.project-metric {
    grid-column: 2;
    grid-row: 3;
    justify-self: start;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: var(--text-color);
    text-shadow: 0 1px 4px var(--text-halo);
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    background: var(--glass-bg);
    opacity: 0;
    animation: fadeIn 0.8s ease-out 0.5s forwards;
}

.project-metric-icon {
    font-size: 0.8rem;
    line-height: 1;
    opacity: 0.8;
}

/* Project Modal */
.project-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-modal.active {
    opacity: 1;
    visibility: visible;
}

.project-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    opacity: 0.2;
    backdrop-filter: blur(8px) contrast(1.1);
}

.project-modal-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    width: 1000px;
    background: var(--bg-color);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
    backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 0 8px 32px var(--glass-bg);
    transform: scale(0.9) translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-modal.active .project-modal-container {
    transform: scale(1) translateY(0);
}

.project-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    color: var(--text-color);
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    backdrop-filter: blur(10px);
    transition: all var(--transition-normal);
    text-shadow: 0 1px 4px var(--glass-bg);
}

.project-modal-close:hover {
    background: var(--text-color);
    color: var(--bg-color);
    transform: scale(1.1);
}

.project-modal-content {
    padding: 30px;
    overflow-y: auto;
    max-height: 90vh;
    /* Slim, visible scrollbar so it's clear there's more to scroll */
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: var(--accent-color) transparent;
}

.project-modal-content::-webkit-scrollbar {
    width: 10px;
}

.project-modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.project-modal-content::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 5px;
    border: 3px solid transparent;
    background-clip: padding-box;
}

.project-modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-color);
    background-clip: padding-box;
}

.project-modal-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 30px;
    backdrop-filter: blur(10px);
}

/* When a project has no screenshot, drop the image column and let info span full width */
.project-modal-header.no-image {
    grid-template-columns: 1fr;
}

/* Media column: main screenshot + optional gallery (caption + thumbnails) */
.project-modal-media {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.project-modal-image {
    width: 100%;
    flex: 1 1 auto;
    min-height: 320px;
    max-height: 70vh;
    border-radius: 10px;
    overflow: hidden;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(5px);
    cursor: zoom-in;
    transition: border-color var(--transition-normal);
}

.project-modal-gallery-caption {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-color);
    text-shadow: 0 1px 4px var(--text-halo);
    text-align: center;
    margin: 0;
}

.project-modal-gallery-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 6px;
}

.project-modal-thumb {
    width: 68px;
    height: 68px;
    padding: 0;
    border: 2px solid var(--glass-border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--glass-bg);
    cursor: pointer;
    opacity: 0.6;
    transition: all var(--transition-normal);
}

.project-modal-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.project-modal-thumb:hover {
    opacity: 1;
}

.project-modal-thumb.active {
    opacity: 1;
    border-color: var(--text-color);
}

.project-modal-image:hover {
    border-color: var(--text-color);
}

/* Show the whole screenshot (flow diagrams are tall) instead of cropping it */
.project-modal-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    padding: 8px;
}

.project-modal-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}


.project-modal-date {
    font-size: 0.8rem;
    font-weight: 300;
    letter-spacing: 0.1em;
    color: var(--accent-color);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.project-modal-title {
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* Outcome / impact line (mainly for automation projects) — kept minimal */
.project-modal-outcome {
    display: none; /* toggled to inline-flex by JS when an outcome exists */
    align-items: center;
    gap: 0.45rem;
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    color: var(--text-color);
    text-shadow: 0 1px 4px var(--text-halo);
    margin-top: -0.5rem;
    margin-bottom: 1.5rem;
    opacity: 0.85;
}

.project-modal-outcome::before {
    content: "✓";
    color: var(--accent-color);
    font-weight: 600;
}

.project-modal-description {
    font-size: 1.1rem;
    font-weight: 300;
    line-height: 1.6;
    margin-bottom: 2rem;
    color: var(--text-color);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}


.project-modal-links {
    display: flex;
    gap: 1rem;
}

.project-modal-link {
    display: inline-flex;
    align-items: center;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 300;
    transition: all var(--transition-normal);
}

.project-modal-link:hover {
    background: var(--text-color);
    color: var(--bg-color);
    transform: translateY(-2px);
}

.project-modal-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 30px;
    backdrop-filter: blur(10px);
}

.project-modal-section h3 {
    font-size: 1.3rem;
    font-weight: 300;
    margin-bottom: 1rem;
    color: var(--text-color);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.project-modal-tech-list,
.project-modal-feature-list {
    list-style: none;
    padding: 0;
}

.project-modal-tech-list li {
    display: inline-block;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-color);
    padding: 8px 16px;
    margin: 6px 8px 6px 0;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 300;
    backdrop-filter: blur(5px);
    text-shadow: 0 1px 2px var(--glass-bg);
}

.project-modal-feature-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--glass-border);
    font-weight: 300;
    color: var(--text-color);
    text-shadow: 0 1px 2px var(--glass-bg);
}

.project-modal-feature-list li:before {
    content: "→ ";
    color: var(--accent-color);
    margin-right: 8px;
}

.project-modal-navigation {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    pointer-events: none;
}

.project-modal-nav-btn {
    width: 54px;
    height: 54px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    color: var(--text-color);
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
    pointer-events: all;
    backdrop-filter: blur(10px);
    text-shadow: 0 1px 4px var(--glass-bg);
}

.project-modal-nav-btn:hover {
    background: var(--text-color);
    color: var(--bg-color);
    transform: scale(1.1);
}

.project-modal-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* "More below" scroll hint — appears when modal content is scrollable */
.project-modal-scroll-hint {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    display: none; /* toggled to inline-flex by JS when there's more to scroll */
    align-items: center;
    gap: 0.5rem;
    background: var(--text-color);
    color: var(--bg-color);
    border: none;
    border-radius: 50px;
    padding: 0.5rem 1.1rem;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    z-index: 2;
    transition: opacity var(--transition-normal), transform var(--transition-normal);
}

.project-modal-scroll-hint:hover {
    transform: translateX(-50%) translateY(-2px);
}

.project-modal-scroll-hint .scroll-hint-chevron {
    display: inline-block;
    animation: scrollHintBounce 1.4s ease-in-out infinite;
}

@keyframes scrollHintBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(4px); }
}

@media (prefers-reduced-motion: reduce) {
    .project-modal-scroll-hint .scroll-hint-chevron {
        animation: none;
    }
}

/* Floating Theme Button */
.floating-theme-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 0 4px 20px var(--glass-bg), 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    overflow: hidden;
}

.floating-theme-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, var(--text-color) 0%, transparent 70%);
    opacity: 0;
    transform: scale(0);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.floating-theme-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px var(--glass-bg), 0 4px 15px rgba(0, 0, 0, 0.15);
    border-color: var(--text-color);
}

.floating-theme-btn:active {
    transform: scale(0.95);
}

.floating-theme-btn:active::before {
    opacity: 0.1;
    transform: scale(1);
}

.floating-theme-btn:focus {
    outline: none;
    box-shadow: 0 6px 25px var(--glass-bg), 0 4px 15px rgba(0, 0, 0, 0.15), 0 0 0 3px var(--text-color);
}

.theme-icon {
    font-size: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.floating-theme-btn:hover .theme-icon {
    transform: rotate(180deg) scale(1.1);
}

/* Theme transition animation */
.floating-theme-btn.theme-switching {
    animation: themeSwitch 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes themeSwitch {
    0% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.2) rotate(180deg); }
    100% { transform: scale(1) rotate(360deg); }
}

/* Mobile Modal Styles */
@media (max-width: 768px) {
    .project-modal-container {
        max-width: 95vw;
        max-height: 95vh;
    }
    
    .project-modal-content {
        padding: 20px;
    }
    
    .project-modal-header {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }
    
    .project-modal-image {
        height: 200px;
    }
    
    .project-modal-title {
        font-size: 2rem;
    }
    
    .project-modal-details {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }
    
    .project-modal-links {
        flex-direction: column;
    }
    
    .project-modal-navigation {
        display: none;
    }
    
    /* Mobile floating theme button */
    .floating-theme-btn {
        bottom: 20px;
        right: 20px;
        width: 52px;
        height: 52px;
    }
    
    .theme-icon {
        font-size: 22px;
    }
}

/* Info Section */
.info-content {
    max-width: 600px;
}

.info-content p {
    margin-bottom: 1.5rem;
    line-height: 1.6;
    font-size: 1.1rem;
    font-weight: 300;
    letter-spacing: 0.01em;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease-out forwards;
}

.info-content p:nth-child(1) { animation-delay: 0.1s; }
.info-content p:nth-child(2) { animation-delay: 0.3s; }

.skills {
    margin-top: 2rem;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease-out 0.5s forwards;
}

.skills h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 300;
    letter-spacing: 0.01em;
    opacity: 0;
    transform: translateX(-20px);
    animation: slideInLeft 0.8s ease-out 0.6s forwards;
}

.skills ul {
    list-style: none;
}

.skills li {
    margin-bottom: 0.5rem;
    font-size: 1rem;
    font-weight: 300;
    letter-spacing: 0.01em;
    color: var(--text-color);
    opacity: 0;
    transform: translateX(-15px);
    animation: slideInLeft 0.6s ease-out forwards;
}

.skills li:nth-child(1) { animation-delay: 0.7s; }
.skills li:nth-child(2) { animation-delay: 0.8s; }
.skills li:nth-child(3) { animation-delay: 0.9s; }
.skills li:nth-child(4) { animation-delay: 1.0s; }
.skills li:nth-child(5) { animation-delay: 1.1s; }

.skills li:before {
    content: "— ";
    color: var(--text-color);
}

.skills h3:not(:first-of-type) {
    margin-top: 2.5rem;
}

/* Contact Section */
.contact-content {
    max-width: 600px;
}

.contact-content p {
    font-size: 1.5rem;
    font-weight: 300;
    letter-spacing: 0.01em;
    margin-bottom: 2rem;
    line-height: 1.6;
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    animation: fadeInScale 0.8s ease-out 0.2s forwards;
}

.contact-links {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease-out 0.4s forwards;
}

.contact-link {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 300;
    letter-spacing: 0.01em;
    padding: 10px 0;
    border-bottom: 1px solid transparent;
    transition: all var(--transition-normal);
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUp 0.6s ease-out forwards;
}

.contact-link:nth-child(1) { animation-delay: 0.6s; }
.contact-link:nth-child(2) { animation-delay: 0.7s; }
.contact-link:nth-child(3) { animation-delay: 0.8s; }

.contact-link:hover {
    border-bottom-color: var(--text-color);
    transform: translateY(-1px);
}

/* Accessibility: Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.2s !important;
        transition-duration: 0.2s !important;
    }
    
    h2, h2::after, .title-line, .subtitle, .cta-buttons,
    .project-item, .project-date, .project-title, .project-description,
    .info-content p, .skills, .skills h3, .skills li,
    .contact-content p, .contact-links, .contact-link {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
    
    .scroll-hint-arrow {
        animation: none;
    }
}

/* Touch and Mobile Enhancements */
@media (hover: none) and (pointer: coarse) {
    .nav-item:hover,
    .cta-button:hover,
    .project-item:hover {
        transform: none;
    }
    
    .nav-item:active,
    .cta-button:active {
        transform: scale(0.98);
        transition: transform 0.1s;
    }
}

@media (max-width: 768px) {
    .progress-indicator {
        display: none; /* Hide progress indicator on mobile */
    }
    
    .scroll-hint {
        bottom: 20px;
        font-size: 0.7rem;
    }
    
    .navigation {
        display: none; /* Completely hide navigation on mobile */
    }
    
    .content {
        padding: 0 var(--space-lg);
    }
    
    .section {
        padding: var(--space-xl) 0;
    }
    
    .section#projects {
        padding: 1rem 0;
    }
    
    .title {
        font-size: clamp(2.5rem, 6vw, 4rem);
        margin-bottom: var(--space-md);
    }
    
    .subtitle {
        font-size: 1.1rem;
        margin-bottom: var(--space-lg);
    }
    
    h2 {
        font-size: clamp(1.8rem, 4vw, 2.5rem);
        margin-bottom: var(--space-lg);
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    
    .project-item {
        grid-template-columns: 1fr;
        gap: 10px;
        transform: none !important;
        box-shadow: none;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-md);
    }
    
    .cta-button {
        justify-content: center;
        width: 100%;
        min-height: 48px;
    }
    
    .contact-links {
        flex-direction: column;
        gap: var(--space-sm);
    }
}

@media (max-width: 480px) {
    .navigation {
        right: var(--space-sm);
    }

    .content {
        padding: 0 var(--space-md);
    }

    .title {
        font-size: 2rem;
    }
}

/* ============================================================
   Business-value blocks (hero stat, case study, fit, process)
   ============================================================ */

/* Hero: proof line under the subtitle */
.hero-stat {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    max-width: 600px;
    margin-bottom: var(--space-xl);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: 0.01em;
    color: var(--text-color);
    text-shadow: 0 1px 4px var(--text-halo);
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.7s forwards;
}

.hero-stat-icon {
    font-size: 1rem;
    line-height: 1;
    flex-shrink: 0;
}

/* Case study: the trust centerpiece at the top of Projects */
.case-study {
    width: 100%;
    max-width: 700px;
    margin-bottom: 2rem;
    padding: 1.75rem;
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    background: var(--glass-bg);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.case-study-eyebrow {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    opacity: 0.7;
    margin-bottom: 0.6rem;
}

.case-study-title {
    font-size: clamp(1.35rem, 3vw, 1.75rem);
    font-weight: 300;
    letter-spacing: 0.01em;
    line-height: 1.2;
    margin-bottom: 0.9rem;
    text-shadow: 0 1px 4px var(--text-halo);
}

.case-study-lead,
.case-study-result {
    font-size: 1rem;
    font-weight: 300;
    line-height: 1.6;
    color: var(--text-color);
    text-shadow: 0 1px 4px var(--text-halo);
}

.case-study-lead { margin-bottom: 1rem; }

.case-study-points {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    display: grid;
    gap: 0.65rem;
}

.case-study-points li {
    position: relative;
    padding-left: 1.5rem;
    font-size: 1rem;
    font-weight: 300;
    line-height: 1.5;
    color: var(--text-color);
    text-shadow: 0 1px 4px var(--text-halo);
}

.case-study-points li::before {
    content: "→";
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0.7;
}

.case-study-points strong { font-weight: 500; }

.case-study-result { font-weight: 400; }

.case-study-note {
    margin-top: 0.9rem;
    font-size: 0.8rem;
    font-style: italic;
    opacity: 0.6;
}

/* "Is this for you?" self-selection strip */
.fit-strip {
    width: 100%;
    max-width: 700px;
    margin-bottom: 2.25rem;
    padding-left: 1rem;
    border-left: 2px solid var(--text-color);
}

.fit-strip-title {
    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    margin-bottom: 0.5rem;
    text-shadow: 0 1px 4px var(--text-halo);
}

.fit-strip-list {
    font-size: 0.98rem;
    font-weight: 300;
    line-height: 1.7;
    color: var(--text-color);
    text-shadow: 0 1px 4px var(--text-halo);
}

/* "How we'd work together" process steps in Info */
.process {
    margin-top: 2.5rem;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease-out 0.45s forwards;
}

.process h3 {
    font-size: 1.5rem;
    font-weight: 300;
    letter-spacing: 0.01em;
    margin-bottom: 1.25rem;
}

.process-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 1rem;
}

.process-steps li {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.process-num {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    background: var(--glass-bg);
    font-size: 0.95rem;
    font-weight: 500;
}

.process-body {
    font-size: 1rem;
    font-weight: 300;
    line-height: 1.55;
    color: var(--text-color);
    padding-top: 0.2rem;
}

.process-body strong { font-weight: 500; }

/* Modal: "the problem" line above the outcome */
.project-modal-problem {
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.55;
    margin-bottom: 0.85rem;
    padding-left: 0.9rem;
    border-left: 2px solid var(--text-color);
    opacity: 0.9;
}