/* Bento Grid Layout */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: auto auto;
    gap: 24px;
    margin-top: 80px;
    align-items: start;
}

/* Bento Item Sizes */
.bento-item.large {
    grid-column: span 2;
    grid-row: span 2;
}

.bento-item.medium {
    grid-column: span 2;
    grid-row: span 1;
    flex-direction: column;
    /* Vertical layout - text below mockup */
    align-items: center;
    padding: 32px;
    /* Standard padding for column layout */
}

.bento-item.small {
    grid-column: span 1;
    grid-row: span 1;
    justify-content: space-between;
}

/* Bento Item Styling */
.bento-item {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    height: 100%;
    align-items: flex-start;
}

.bento-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(255, 107, 0, 0.1), transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.bento-item::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05), transparent 60%);
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.5s ease;
    pointer-events: none;
}

.bento-item:hover {
    border-color: rgba(255, 107, 0, 0.5);
    transform: translateY(-8px) scale(1.01);
    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 107, 0, 0.2),
        inset 0 0 20px rgba(255, 107, 0, 0.05);
}

.bento-item:hover::before,
.bento-item:hover::after {
    opacity: 1;
}

/* Phone Devices */
.bento-mockup {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 20px;
    width: 100%;
}

.phone-device {
    background: linear-gradient(135deg, #121212 0%, #1c1c1c 50%, #121212 100%);
    border: 1px solid #2a2a2a;
    padding: 7px;
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.5),
        inset 0 0 2px 1px rgba(255, 255, 255, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    position: relative;
    z-index: 1;
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    transform-style: preserve-3d;
    perspective: 1000px;
    transform: rotateY(-8deg) rotateX(2deg);
}

/* Side Buttons - Pro Style */
.phone-device::before,
.phone-device::after {
    content: '';
    position: absolute;
    background: #1c1c1c;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    z-index: -1;
}

/* Power Button */
.phone-device::before {
    top: 90px;
    right: -4px;
    width: 3px;
    height: 55px;
    border-radius: 0 4px 4px 0;
}

/* Volume / Action Buttons */
.phone-device::after {
    top: 80px;
    left: -4px;
    width: 3px;
    height: 90px;
    border-radius: 4px 0 0 4px;
    background: linear-gradient(to bottom,
            #1c1c1c 0%, #1c1c1c 25%,
            transparent 25%, transparent 35%,
            #1c1c1c 35%, #1c1c1c 60%,
            transparent 60%, transparent 70%,
            #1c1c1c 70%, #1c1c1c 100%);
}

/* Mockup Glow for Bento */
.mockup-glow.small {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140%;
    height: 140%;
    background: radial-gradient(circle, rgba(255, 107, 0, 0.15) 0%, transparent 65%);
    filter: blur(60px);
    z-index: -1;
    opacity: 0.5;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.bento-item:hover .mockup-glow.small {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

/* Floating Elements for Bento */
.bento-float {
    position: absolute;
    width: 48px;
    height: 48px;
    background: rgba(15, 37, 58, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    z-index: 2;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.float-top {
    top: 20%;
    right: -10px;
    animation: float-y 4s ease-in-out infinite;
}

.float-bottom {
    bottom: 20%;
    left: -10px;
    animation: float-y 4s ease-in-out infinite 2s;
}

@keyframes float-y {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.bento-item:hover .phone-device {
    transform: translateY(-12px) rotateY(-2deg) rotateX(1deg) scale(1.03);
    box-shadow:
        0 40px 80px rgba(0, 0, 0, 0.6),
        0 0 0 4px #151515,
        0 0 0 6px #222,
        0 0 40px rgba(255, 107, 0, 0.2);
}

.large-device {
    width: 250px;
    height: 520px;
    border-radius: 52px;
}

.medium-device {
    width: 190px;
    height: 390px;
    border-radius: 44px;
}

.small-device {
    width: 160px;
    height: 330px;
    border-radius: 38px;
}

/* Dynamic Island Style */
.device-notch {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    width: 52px;
    height: 18px;
    background: #000;
    border-radius: 20px;
    z-index: 10;
    display: flex !important;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Sensor detail inside Dynamic Island */
.device-notch::after {
    content: '';
    width: 5px;
    height: 5px;
    background: #080808;
    border-radius: 50%;
    margin-right: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.large-device .device-notch {
    width: 65px;
    height: 20px;
}

.device-notch.small {
    width: 48px;
    height: 16px;
    top: 12px;
}

.device-notch.tiny {
    width: 42px;
    height: 14px;
    top: 10px;
}

.bento-item:hover .device-notch {
    width: 100px;
    transform: translateX(-50%) scaleX(1.1);
}

.device-screen {
    width: 100%;
    height: 100%;
    background: #000;
    border-radius: 40px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 1;
}

/* Screen Reflection/Glare */
.device-screen::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 100%;
    background: linear-gradient(105deg,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.05) 45%,
            rgba(255, 255, 255, 0.1) 50%,
            rgba(255, 255, 255, 0.05) 55%,
            rgba(255, 255, 255, 0) 100%);
    transform: translateX(-100%);
    transition: transform 0.8s ease;
    pointer-events: none;
    z-index: 5;
}

.bento-item:hover .device-screen::after {
    transform: translateX(100%);
}

.device-screen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Continuous "Smooth Journey" Scroll Animation with Motion Blur */
@keyframes scroll-screen {
    0% {
        transform: translateY(0);
        filter: blur(0);
    }

    5% {
        filter: blur(0.6px);
    }

    45% {
        filter: blur(0.6px);
    }

    50% {
        transform: translateY(-25%);
        filter: blur(0);
    }

    55% {
        filter: blur(0.6px);
    }

    95% {
        filter: blur(0.6px);
    }

    100% {
        transform: translateY(0);
        filter: blur(0);
    }
}

.bento-item:hover .device-screen img {
    animation: scroll-screen 30s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

.large-device .device-screen {
    border-radius: 45px;
}

.medium-device .device-screen {
    border-radius: 37px;
}

.small-device .device-screen {
    border-radius: 31px;
}

/* Bento Content */
.bento-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 1;
    position: relative;
}

.medium .bento-content {
    /* Text below mockup in vertical layout */
    max-width: 100%;
}

.bento-content.compact {
    gap: 12px;
}

.content-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(255, 107, 0, 0.15), rgba(255, 107, 0, 0.08));
    border: 1.5px solid rgba(255, 107, 0, 0.4);
    color: var(--primary);
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: fit-content;
    box-shadow: 0 4px 12px rgba(255, 107, 0, 0.15);
}

.content-badge i {
    width: 14px;
    height: 14px;
}

.bento-content h3 {
    font-size: 2rem;
    font-weight: 900;
    color: var(--text-white);
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin: 0;
}

.bento-content h4 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-white);
    letter-spacing: -0.01em;
    margin: 0;
}

.bento-content p {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-muted);
    margin: 0;
}

.bento-content.compact p {
    font-size: 0.95rem;
}

/* Quick Stats */
.quick-stats {
    display: flex;
    gap: 24px;
    margin-top: 8px;
    align-items: center;
}

.quick-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.quick-stat strong {
    font-size: 1.75rem;
    font-weight: 900;
    color: var(--primary);
    line-height: 1;
    letter-spacing: -0.02em;
}

.quick-stat span {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ========================================
   RESPONSIVE BREAKPOINTS
   ======================================== */

/* Tablet & Below (1024px) */
@media (max-width: 1024px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        margin-top: 60px;
    }

    .bento-item.large {
        grid-column: span 2;
        grid-row: span 1;
    }

    .bento-item.medium {
        grid-column: span 2;
        padding: 0 32px;
    }

    .bento-item.small {
        grid-column: span 1;
    }

    .large-device {
        width: 200px;
        height: 420px;
    }

    .medium-device {
        width: 160px;
        height: 330px;
    }

    .small-device {
        width: 140px;
        height: 290px;
    }

    .bento-content h3 {
        font-size: 1.75rem;
    }

    .bento-content h4 {
        font-size: 1.2rem;
    }

    .bento-content p {
        font-size: 0.95rem;
    }
}

/* Mobile Landscape & Below (768px) */
@media (max-width: 768px) {
    .bento-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-top: 40px;
    }

    .bento-item.large,
    .bento-item.medium,
    .bento-item.small {
        grid-column: span 1;
        grid-row: span 1;
    }

    .bento-item {
        padding: 24px;
        border-radius: 20px;
    }

    .bento-item.medium {
        flex-direction: column;
        padding: 24px;
    }

    .medium .bento-content {
        order: 0;
        max-width: 100%;
    }

    /* Stack mockup and content vertically on mobile */
    .bento-mockup {
        padding: 16px;
    }

    .large-device {
        width: 180px;
        height: 380px;
    }

    .medium-device {
        width: 160px;
        height: 330px;
    }

    .small-device {
        width: 140px;
        height: 290px;
    }

    .bento-content h3 {
        font-size: 1.5rem;
    }

    .bento-content h4 {
        font-size: 1.1rem;
    }

    .bento-content p {
        font-size: 0.9rem;
        line-height: 1.6;
    }

    .bento-content.compact p {
        font-size: 0.85rem;
    }

    .content-badge {
        font-size: 0.7rem;
        padding: 6px 12px;
    }

    /* Adjust floating elements for mobile */
    .bento-float {
        width: 40px;
        height: 40px;
    }

    .float-top {
        right: -8px;
    }

    .float-bottom {
        left: -8px;
    }

    /* Reduce hover effects on mobile */
    .bento-item:hover {
        transform: translateY(-4px) scale(1.005);
    }

    .bento-item:hover .phone-device {
        transform: translateY(-6px) rotateY(-2deg) rotateX(1deg) scale(1.02);
    }
}

/* Mobile Portrait (480px) */
@media (max-width: 480px) {
    .bento-grid {
        gap: 12px;
        margin-top: 32px;
    }

    .bento-item {
        padding: 20px;
        border-radius: 16px;
        gap: 16px;
    }

    .bento-mockup {
        padding: 12px;
    }

    .large-device {
        width: 160px;
        height: 340px;
        border-radius: 48px;
    }

    .medium-device {
        width: 140px;
        height: 290px;
        border-radius: 40px;
    }

    .small-device {
        width: 120px;
        height: 250px;
        border-radius: 36px;
    }

    .bento-content h3 {
        font-size: 1.35rem;
    }

    .bento-content h4 {
        font-size: 1rem;
    }

    .bento-content p {
        font-size: 0.85rem;
        line-height: 1.5;
    }

    .bento-content.compact p {
        font-size: 0.8rem;
    }

    .content-badge {
        font-size: 0.65rem;
        padding: 5px 10px;
    }

    .bento-float {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }

    .quick-stat strong {
        font-size: 1.5rem;
    }

    .quick-stat span {
        font-size: 0.75rem;
    }

    /* Disable 3D transforms on small mobile */
    .phone-device {
        transform: rotateY(0deg) rotateX(0deg);
    }

    .bento-item:hover .phone-device {
        transform: translateY(-4px) scale(1.01);
    }

    /* Simplify device notch on mobile */
    .device-notch {
        width: 40px;
        height: 12px;
    }

    .device-notch.small {
        width: 36px;
        height: 11px;
    }

    .device-notch.tiny {
        width: 32px;
        height: 10px;
    }
}

/* Extra Small Mobile (360px) */
@media (max-width: 360px) {
    .bento-item {
        padding: 16px;
    }

    .large-device {
        width: 140px;
        height: 300px;
    }

    .medium-device {
        width: 120px;
        height: 250px;
    }

    .small-device {
        width: 100px;
        height: 210px;
    }

    .bento-content h3 {
        font-size: 1.2rem;
    }

    .bento-content h4 {
        font-size: 0.95rem;
    }

    .bento-content p {
        font-size: 0.8rem;
    }
}