/* ── Base ───────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    overflow-x: hidden;
}

/* ── Scroll Progress Bar ─────────────────────── */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, #56642b, #8a9a5b, #bdce89);
    z-index: 9999;
    transition: width 0.05s linear;
    pointer-events: none;
}

/* ── Material Symbols ──────────────────────────── */
.material-symbols-outlined {
    font-variation-settings:
        "FILL" 0,
        "wght" 400,
        "GRAD" 0,
        "opsz" 24;
    display: inline-block;
    vertical-align: middle;
}

/* ── Glass Header ──────────────────────────────── */
.glass-header {
    background: rgba(252, 249, 248, 0.82);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.glass-header.scrolled {
    box-shadow: 0 1px 12px rgba(0, 0, 0, 0.06);
}

/* ── Glass Effect (floating cards) ─────────────── */
.glass-effect {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* ── Navigation Links ──────────────────────────── */
.nav-link {
    color: #57534e;
    font-weight: 500;
    padding-bottom: 4px;
    position: relative;
    transition: color 0.3s;
}

.nav-link::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #56642b;
    transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link:hover,
.nav-link.active {
    color: #56642b;
}

.nav-link-mobile {
    color: #57534e;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.5rem 0;
    transition:
        color 0.3s,
        padding-left 0.3s;
}

.nav-link-mobile:hover,
.nav-link-mobile.active {
    color: #56642b;
    padding-left: 0.5rem;
}

/* ── Typing Animation (Home Hero) ──────────────── */
@keyframes typing {
    0%,
    10% {
        content: "";
    }
    20%,
    40% {
        content: ".";
    }
    40%,
    70% {
        content: ".A";
    }
    80%,
    100% {
        content: ".AI";
    }
}

.typing-animation::after {
    content: "";
    animation: typing 1.5s steps(5) infinite;
    display: inline-block;
    min-width: 1em;
}

@media (min-width: 768px) {
    .typing-animation::after {
        min-width: 1.5em;
    }
}

/* ── Shimmer Text Effect ─────────────────────── */
@keyframes shimmer {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

.shimmer-text {
    background: linear-gradient(
        90deg,
        #8a9a5b 0%,
        #bdce89 25%,
        #d9eaa3 50%,
        #bdce89 75%,
        #8a9a5b 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 4s linear infinite;
}

/* ── Scroll-Reveal: Base ─────────────────────── */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition:
        opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.active {
    opacity: 1;
    transform: translate(0, 0) scale(1);
}

/* ── Reveal Variants ─────────────────────────── */
.reveal-left {
    opacity: 0;
    transform: translateX(-60px);
    transition:
        opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-right {
    opacity: 0;
    transform: translateX(60px);
    transition:
        opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition:
        opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-left.active,
.reveal-right.active,
.reveal-scale.active {
    opacity: 1;
    transform: translate(0, 0) scale(1);
}

/* ── Stagger Children ────────────────────────── */
.stagger-children > * {
    opacity: 0;
    transform: translateY(25px);
    transition:
        opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.stagger-children.active > * {
    opacity: 1;
    transform: translateY(0);
}

/* Delay assigned via JS --stagger-i custom prop */
.stagger-children > * {
    transition-delay: calc(var(--stagger-i, 0) * 120ms);
}

/* ── Floating / Bobbing ──────────────────────── */
@keyframes float {
    0%,
    100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-12px);
    }
}

.float {
    animation: float 4s ease-in-out infinite;
}

/* ── Parallax (subtle, JS-driven) ────────────── */
.parallax {
    will-change: transform;
    transition: transform 0.1s linear;
}

/* ── Zig-Zag Solution Cards ────────────────────── */
.zig-zag-image {
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.zig-zag-card:hover .zig-zag-image {
    transform: scale(1.03);
}

/* ── Tilt Card (3D hover) ────────────────────── */
.tilt-card {
    transition:
        transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.4s ease;
    transform-style: preserve-3d;
    perspective: 800px;
}

.tilt-card:hover {
    box-shadow: 0 20px 60px rgba(86, 100, 43, 0.08);
}

/* ── Icon Bounce on Hover ────────────────────── */
.icon-bounce {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.group:hover .icon-bounce,
.icon-bounce:hover {
    transform: scale(1.15) translateY(-4px);
}

/* ── Progress Bar Fill Animation ─────────────── */
.progress-fill {
    width: 0;
    transition: width 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.progress-fill.animate {
    /* width set via data-width or inline style */
}

/* ── Button Ripple ───────────────────────────── */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple .ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    transform: scale(0);
    animation: ripple-expand 0.6s ease-out forwards;
    pointer-events: none;
}

@keyframes ripple-expand {
    to {
        transform: scale(4);
        opacity: 0;
    }
}


/* ── Counter glow pulse ──────────────────────── */
@keyframes counter-glow {
    0% {
        text-shadow: 0 0 0 transparent;
    }
    50% {
        text-shadow: 0 0 12px rgba(86, 100, 43, 0.25);
    }
    100% {
        text-shadow: 0 0 0 transparent;
    }
}

.counter-done {
    animation: counter-glow 0.6s ease-out;
}

/* ── Data-Line Accent ────────────────────────── */
.data-line {
    background-color: #c6c8b8;
    opacity: 0.3;
}

/* ── Asymmetric Shape Clip ───────────────────── */
.asymmetric-shape {
    clip-path: polygon(0 0, 100% 0, 100% 85%, 0% 100%);
}

/* ── Page Transition ─────────────────────────── */
#app {
    opacity: 1;
    transform: translateY(0);
    transition:
        opacity 0.3s ease,
        transform 0.3s ease;
}

#app.fade-out {
    opacity: 0;
    transform: translateY(12px);
}

/* ── Contact Form Focus States ───────────────── */
.contact-input {
    width: 100%;
    border: 0;
    border-left: 2px solid transparent;
    border-radius: 0.5rem;
    padding: 1rem;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.contact-input:focus {
    border-left-color: #56642b;
    outline: none;
    box-shadow: 0 0 0 3px rgba(86, 100, 43, 0.08);
    transform: translateX(4px);
}

/* ── Gradient Background Shift ───────────────── */
@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.gradient-animate {
    background-size: 200% 200%;
    animation: gradient-shift 8s ease infinite;
}

/* ── Ping Slow ───────────────────────────────── */
@keyframes ping-slow {
    75%,
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

.animate-ping-slow {
    animation: ping-slow 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* ── Tech Tag Pop-in ─────────────────────────── */
.tag-pop {
    opacity: 0;
    transform: scale(0.7);
    transition:
        opacity 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
        transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tag-pop.active {
    opacity: 1;
    transform: scale(1);
}

/* ── Subtle rotate on scroll for grid bg ─────── */
@keyframes slow-rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.slow-spin {
    animation: slow-rotate 120s linear infinite;
}

/* ── Hover lift for generic elements ─────────── */
.hover-lift {
    transition:
        transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.35s ease;
}

.hover-lift:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(86, 100, 43, 0.1);
}

/* ── Job Card Accordion ──────────────────────── */
.job-card {
    transition:
        border-color 0.3s ease,
        box-shadow 0.3s ease;
}

.job-card:has(.job-toggle[aria-expanded="true"]) {
    border-color: rgba(86, 100, 43, 0.2);
    box-shadow: 0 8px 30px rgba(86, 100, 43, 0.06);
}

.job-details {
    animation: accordion-open 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes accordion-open {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        max-height: 2000px;
        transform: translateY(0);
    }
}

.job-chevron {
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Form Validation Error State ─────────────── */
.border-error {
    border-left-color: #ba1a1a !important;
    box-shadow: 0 0 0 2px rgba(186, 26, 26, 0.1);
}

.form-error {
    transition: opacity 0.2s ease;
}

/* ── Select Dropdown Arrow ───────────────────── */
select.contact-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%2346483c' d='m12 15.4-6-6L7.4 8l4.6 4.6L16.6 8 18 9.4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* ── File Upload Hover ───────────────────────── */
label:has(+ .hidden#career-resume):hover,
label[for="career-resume"]:hover {
    border-color: rgba(86, 100, 43, 0.4);
}

/* ── Prefers reduced motion ──────────────────── */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .reveal,
    .reveal-left,
    .reveal-right,
    .reveal-scale,
    .stagger-children > * {
        opacity: 1 !important;
        transform: none !important;
    }

    #scroll-progress {
        display: none;
    }
}
