/* Experience card hint: GPU-accelerate the fade-in transforms applied via Compose */
.experience-card {
    will-change: opacity, transform;
}

/* Experience timeline dot — pulse animation to draw the eye to the active item.
 * The dot itself has solid brand fill; this ::after layer is the ripple. */
@keyframes experience-dot-pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.55;
    }
    100% {
        transform: translate(-50%, -50%) scale(2.6);
        opacity: 0;
    }
}

.experience-timeline-dot {
    position: absolute;
}
.experience-timeline-dot::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: rgb(159, 52, 240);
    pointer-events: none;
    transform: translate(-50%, -50%);
    animation: experience-dot-pulse 1.8s ease-out infinite;
}

/* Performance: enable smooth scrolling with native browser support */
html {
    scroll-behavior: smooth;
}

/* Performance: rendering hints for images */
img {
    max-width: 100%;
    height: auto;
    image-rendering: -webkit-optimize-contrast;
}

/* Reduce repaints on interactive items */
.work-item,
.product-item,
.feature-card,
.contact-card {
    will-change: transform;
}

/* Better focus accessibility */
a:focus-visible,
button:focus-visible {
    outline: 2px solid rgb(159, 52, 240);
    outline-offset: 3px;
    border-radius: 6px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Mobile tap highlight */
* {
    -webkit-tap-highlight-color: rgba(159, 52, 240, 0.15);
}

/* Prevent horizontal overflow on mobile */
body {
    overflow-x: hidden;
}

/* Smoother text rendering */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Custom thin scrollbar (desktop) */
@media (min-width: 768px) {
    ::-webkit-scrollbar {
        width: 10px;
        height: 10px;
    }
    ::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.05);
    }
    ::-webkit-scrollbar-thumb {
        background: rgba(159, 52, 240, 0.5);
        border-radius: 8px;
    }
    ::-webkit-scrollbar-thumb:hover {
        background: rgba(159, 52, 240, 0.75);
    }
}

/* Improve image lazy-loading fade-in */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.4s ease-in;
}
img[loading="lazy"].loaded,
img[loading="lazy"]:not([src=""]) {
    opacity: 1;
}

/* Override fade-in for images that fail the "loaded" trigger — apply once decoded */
img {
    transition: opacity 0.4s ease-in;
}

/* Ensure mobile-friendly button tap targets */
@media (max-width: 768px) {
    button, .silk-button {
        min-height: 44px;
    }
}

/* ───────────────────────────────────────────────────────────────────────────
 * Mobile section padding — bypass silk's CSS-in-JS which collapses our
 * individual padding-left/right declarations and resets them to 0.
 * Apply via the deployed stylesheet for guaranteed precedence.
 * ─────────────────────────────────────────────────────────────────────────── */
.section-container-about-section,
.section-container-contact-section,
#experience.section-container {
    padding-left: 16px !important;
    padding-right: 16px !important;
}

@media (min-width: 30rem) {
    .section-container-about-section,
    .section-container-contact-section,
    #experience.section-container {
        padding-left: 28px !important;
        padding-right: 28px !important;
    }
}

@media (min-width: 48rem) {
    .section-container-about-section,
    .section-container-contact-section,
    #experience.section-container {
        padding-left: 48px !important;
        padding-right: 48px !important;
    }
}

@media (min-width: 81.25rem) {
    .section-container-about-section,
    .section-container-contact-section,
    #experience.section-container {
        padding-left: 94px !important;
        padding-right: 94px !important;
    }
}

@media (min-width: 100rem) {
    .section-container-about-section,
    .section-container-contact-section,
    #experience.section-container {
        padding-left: 134px !important;
        padding-right: 134px !important;
    }
}
