/* Custom CSS for animations and effects */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}
/* Psychological enhancements */
.trust-cue {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: rgba(82, 109, 130, 0.1);
    border-radius: 9999px;
    font-size: 0.875rem;
    color: #526D82;
    margin: 0.5rem 0;
}
/* Optimized cursor styles */
.cursor-dot {
    width: 6px;
    height: 6px;
    background-color: #526D82;
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    top: 0;
    left: 0;
    transform: translate3d(0, 0, 0);
    will-change: transform;
    mix-blend-mode: difference;
}

.cursor-outline {
    width: 30px;
    height: 30px;
    border: 1px solid rgba(82, 109, 130, 0.5);
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    top: 0;
    left: 0;
    transform: translate3d(0, 0, 0) scale(1);
    will-change: transform;
    transition: opacity 0.15s ease-out;
    mix-blend-mode: difference;
    opacity: 1;
}

@media (hover: none) {
    .cursor-dot,
    .cursor-outline {
        display: none !important;
    }
}
/* Tech Stack Section - Apple Inspired */
.tech-stack-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

@media (min-width: 640px) {
    .tech-stack-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.75rem;
        padding: 2rem 1.5rem;
    }
}

@media (min-width: 768px) {
    .tech-stack-container {
        grid-template-columns: repeat(5, 1fr);
        gap: 2rem;
        padding: 2.5rem 1.5rem;
    }
}
.tech-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    height: 120px;
    perspective: 1000px;
}

@media (min-width: 640px) {
    .tech-item {
        height: 150px;
    }
}

@media (min-width: 768px) {
    .tech-item {
        height: 190px;
    }
}
.tech-name {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    color: #27374D;
    margin-bottom: 1.5rem;
    text-align: center;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s ease-out;
}
.tech-icon-container {
    width: 90px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    will-change: transform;
    overflow: visible;
    margin: 0 auto;
    padding: 10px;
}

@media (min-width: 640px) {
    .tech-icon-container {
        width: 110px;
        height: 110px;
    }
}

@media (min-width: 768px) {
    .tech-icon-container {
        width: 140px;
        height: 140px;
    }
}
.tech-icon {
    width: 80%;
    height: 80%;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.05));
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}
.tech-item:hover .tech-name {
    opacity: 1;
    transform: translateY(0);
}

.tech-item:hover .tech-icon {
    transform: scale(1.1);
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.1));
}

@keyframes float {
    0% { transform: translate(0, 0) rotate(0); }
    33% { transform: translate(2px, -3px) rotate(1deg); }
    66% { transform: translate(-2px, 2px) rotate(-1deg); }
    100% { transform: translate(0, 0) rotate(0); }
}

.tech-icon-container:hover .tech-icon {
    animation: float 6s ease-in-out infinite;
}

/* Fade-in animation when in view */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.tech-stack-container.in-view .tech-item {
    animation: fadeInUp 0.6s forwards;
}

.tech-stack-container.in-view .tech-item:nth-child(1) { animation-delay: 0.1s; }
.tech-stack-container.in-view .tech-item:nth-child(2) { animation-delay: 0.2s; }
.tech-stack-container.in-view .tech-item:nth-child(3) { animation-delay: 0.3s; }
.tech-stack-container.in-view .tech-item:nth-child(4) { animation-delay: 0.4s; }
.tech-stack-container.in-view .tech-item:nth-child(5) { animation-delay: 0.5s; }
.tech-stack-container.in-view .tech-item:nth-child(6) { animation-delay: 0.6s; }
.tech-stack-container.in-view .tech-item:nth-child(7) { animation-delay: 0.7s; }
.tech-stack-container.in-view .tech-item:nth-child(8) { animation-delay: 0.8s; }
.tech-stack-container.in-view .tech-item:nth-child(9) { animation-delay: 0.9s; }
.tech-stack-container.in-view .tech-item:nth-child(10) { animation-delay: 1s; }
.tech-icon {
    width: 72%;
    height: 72%;
    object-fit: contain;
    filter: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 100%;
    max-height: 100%;
}

@media (min-width: 768px) {
    .tech-icon { width: 78%; height: 78%; }
}

@media (min-width: 1024px) {
    .tech-icon { width: 82%; height: 82%; }
}

.tech-icon:hover {
    filter: saturate(115%) contrast(110%);
    transform: scale(1.08) translateZ(0);
    animation: none;
}

@media (max-width: 767px) {
    .tech-stack-container {
        grid-template-columns: repeat(2, 1fr);
    }
    .tech-icon {
        width: 70%;
        height: 70%;
    }
}
/* Use pseudo-element for tooltip with opacity transition */
.tech-icon::after {
    content: attr(data-tech);
    position: absolute;
    bottom: -1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(39, 55, 77, 0.9);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.tech-icon:hover::after {
    opacity: 1;
}
/* Contact Form Enhancements */
#contact input,
#contact textarea {
    backdrop-filter: blur(4px);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

#contact input:focus,
#contact textarea:focus {
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 20px rgba(82, 109, 130, 0.1);
}

#contact button {
    letter-spacing: 0.5px;
    will-change: transform;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}
/* Custom selection color */
::selection {
    background-color: #526D82;
    color: white;
}

/* Scroll reveal animation */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}
/* Portfolio Grid Styles */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

@media (min-width: 640px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .portfolio-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.portfolio-card {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.portfolio-image-container {
    position: relative;
    border-radius: 0.75rem;
    overflow: hidden;
    aspect-ratio: 16/9;
}

.portfolio-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.portfolio-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(39, 55, 77, 0.9) 0%, transparent 50%);
    opacity: 0;
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
    transition: opacity 0.3s ease;
}

.portfolio-tech {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.portfolio-tech span {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
}

.portfolio-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1rem;
    color: #27374D;
}

.portfolio-description {
    color: #526D82;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.portfolio-card:hover .portfolio-overlay {
    opacity: 1;
}

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

/* Hover effect for project cards */
.project-card:hover .project-overlay {
    opacity: 1;
    transform: scale(1.03);
}

.project-overlay {
    transition: all 0.3s ease;
}

/* --- KD Studios Minimal Section Separators (Option A) --- */
:root{
    --kds-primary:#DDE6ED;
    --kds-accent:#526D82;
    --kds-dark:#27374D;
    --kds-ink-500:#64748B;
    --kds-tint: rgba(221,230,237,0.35);
    --kds-hairline: rgba(39,55,77,0.12);
    --kds-shadow: 0 8px 24px rgba(39,55,77,0.08);
    --kds-band1: #E8EFF5; /* slightly tinted */
    --kds-band2: #FFFFFF; /* clean white */
}

.kds-section {
    padding: 72px 0;
}

@media (min-width: 768px) {
    .kds-section {
        padding: 96px 0;
    }
}

.kds-section--tint {
    background: var(--kds-tint);
}

.kds-section--hairline { position: relative; }
.kds-section--hairline::before {
    content: "";
    position: absolute; left: 0; right: 0; top: 0; height: 1px;
    background: linear-gradient(to right, transparent, var(--kds-hairline) 12%, var(--kds-hairline) 88%, transparent);
}

.kds-card { border-radius: 16px; background: #fff; }
.kds-card--elevated { box-shadow: var(--kds-shadow); }
.kds-card--gradient-edge { position: relative; overflow: hidden; }
.kds-card--gradient-edge::before {
    content: "";
    position: absolute; inset: 0 0 auto 0; height: 3px;
    background: linear-gradient(90deg, rgba(82,109,130,0.0), rgba(82,109,130,0.25), rgba(82,109,130,0.0));
}

.kds-section__header { margin-bottom: 28px; text-align: left; }
.kds-section__title {
    margin: 0 0 8px; font-weight: 700; letter-spacing: -0.01em;
    font-size: clamp(1.5rem, 2vw + 1rem, 2rem);
}
.kds-section__subtitle { margin: 0; color: var(--kds-ink-500); font-size: 1rem; }

.kds-form-grid { display: grid; gap: 14px; }
.kds-input {
    width: 100%; padding: 14px 16px; border-radius: 12px; border: 1px solid rgba(39,55,77,0.12);
    background: #fff; color: var(--kds-dark); outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.kds-input:focus { border-color: rgba(82,109,130,0.45); box-shadow: 0 0 0 4px rgba(82,109,130,0.12); }
.kds-input--textarea { resize: vertical; }
.kds-button {
    margin-top: 4px; justify-self: start; padding: 12px 18px; border-radius: 999px; border: 1px solid var(--kds-accent);
    background: var(--kds-accent); color: #fff; font-weight: 600;
    transition: transform .15s ease, background .2s ease, box-shadow .2s ease;
    box-shadow: 0 6px 18px rgba(82,109,130,0.20);
}
.kds-button:hover { transform: translateY(-1px); background: #3f596c; }

/* --- KD Studios Background Bands --- */
.kds-bg-soft { background-color: #EDF4F9; }
.kds-bg-warm { background-color: #F5F8FB; }
.kds-bg-evening { background-color: #E8EFF5; }

.kds-band-1 { background-color: var(--kds-band1); }
.kds-band-2 { background-color: var(--kds-band2); }