/* ==========================================================================
   FLEXIBLELINE | MASTER STYLESHEET (style.css)
   Colors: Charcoal (#434242), Brand Red (#E31E24), Background (#111215)
   Fonts: Yatra One & Open Sans
   ========================================================================== */

/* 1. Global Reset & Body */
body {
    background-color: #111215;
    color: #EBE6F2;
    font-family: 'Open Sans', sans-serif;
    overflow-x: hidden;
}

.heading-font {
    font-family: 'Yatra One', cursive;
    letter-spacing: 0.04em;
}

/* 2. Glassmorphism Utilities */
.glass-nav {
    background: rgba(17, 18, 21, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.glass-badge {
    background: rgba(30, 31, 38, 0.75);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(217, 217, 227, 0.18);
}

/* 3. 3D Perspective Stages & Cards */
.perspective-wrapper {
    perspective: 1200px;
}

.stage-3d-wrapper {
    perspective: 1400px;
    perspective-origin: 50% 50%;
    transform-style: preserve-3d;
}

.depth-card {
    transform-style: preserve-3d;
    backface-visibility: hidden;
    will-change: transform, opacity, filter;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, box-shadow 0.4s ease;
}

.depth-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: #E31E24;
    box-shadow: 0 25px 40px -10px rgba(227, 30, 36, 0.25);
}

/* 4. Contact Page Cyber Laser & Radar Animations */
@property --laser-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

@keyframes rotateLaser {
    0% { --laser-angle: 0deg; }
    100% { --laser-angle: 360deg; }
}

.laser-box-wrapper {
    position: relative;
    padding: 2px;
    border-radius: 26px;
    background: conic-gradient(from var(--laser-angle), #E31E24 0%, transparent 20%, #434242 40%, transparent 60%, #E31E24 80%, transparent 100%);
    animation: rotateLaser 5s linear infinite;
    box-shadow: 0 0 35px rgba(227, 30, 36, 0.2);
}

.laser-box-inner {
    background: rgba(26, 27, 32, 0.95);
    backdrop-filter: blur(18px);
    border-radius: 24px;
}

.magnetic-stage {
    perspective: 1200px;
}

.magnetic-card {
    transform-style: preserve-3d;
    transition: transform 0.15s ease-out, box-shadow 0.3s ease;
    position: relative;
}

.light-sheen {
    position: absolute;
    inset: 0;
    border-radius: 24px;
    pointer-events: none;
    background: radial-gradient(circle at 50% 50%, rgba(227, 30, 36, 0.15), transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

@keyframes radarSweep {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.radar-scanner {
    position: relative;
    overflow: hidden;
}

.radar-sweep-beam {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform-origin: top left;
    background: conic-gradient(from 0deg, rgba(227, 30, 36, 0.4) 0deg, transparent 65deg);
    animation: radarSweep 3s linear infinite;
}

.service-pill {
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
}

.service-pill:hover {
    border-color: #E31E24;
    transform: translateY(-2px);
}

.service-pill.active {
    background-color: #E31E24;
    color: #ffffff;
    border-color: #E31E24;
    box-shadow: 0 0 16px rgba(227, 30, 36, 0.55);
    transform: scale(1.04);
}

/* 5. 3D Physical Book Styles (work.html) */
.book-stage-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    perspective: 2600px;
    padding: 20px 0;
}

.physical-book {
    position: relative;
    display: flex;
    width: 100%;
    max-width: 880px;
    height: 580px;
    background: #14151a;
    border-radius: 8px;
    box-shadow: 
        0 30px 70px -15px rgba(0, 0, 0, 0.95),
        0 0 40px rgba(227, 30, 36, 0.15),
        inset 0 0 10px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(217, 217, 227, 0.12);
    transform-style: preserve-3d;
    user-select: none;
}

@media (max-width: 768px) {
    .physical-book {
        max-width: 340px;
        height: 480px;
    }
}

.page-slot {
    width: 50%;
    height: 100%;
    position: relative;
    background: #ffffff;
    overflow: hidden;
}

.page-slot.slot-left {
    border-radius: 6px 0 0 6px;
    border-right: 1px solid rgba(0, 0, 0, 0.12);
}

.page-slot.slot-right {
    border-radius: 0 6px 6px 0;
    border-left: 1px solid rgba(0, 0, 0, 0.12);
}

@media (max-width: 768px) {
    .page-slot.slot-left {
        display: none;
    }
    .page-slot.slot-right {
        width: 100%;
        border-radius: 6px;
        border: none;
    }
}

.page-slot img {
    width: 100%;
    height: 100%;
    object-fit: fill;
    display: block;
    pointer-events: none;
}

.spine-shadow {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 36px;
    transform: translateX(-50%);
    background: linear-gradient(
        to right,
        rgba(0, 0, 0, 0.5) 0%,
        rgba(0, 0, 0, 0.15) 30%,
        rgba(255, 255, 255, 0.06) 50%,
        rgba(0, 0, 0, 0.15) 70%,
        rgba(0, 0, 0, 0.5) 100%
    );
    pointer-events: none;
    z-index: 40;
}

@media (max-width: 768px) {
    .spine-shadow {
        display: none;
    }
}

.flipper-leaf {
    position: absolute;
    top: 0;
    height: 100%;
    transform-style: preserve-3d;
    z-index: 50;
    pointer-events: none;
    display: none;
}

.flipper-leaf.forward {
    right: 0;
    width: 50%;
    transform-origin: left center;
}

.flipper-leaf.backward {
    left: 0;
    width: 50%;
    transform-origin: right center;
}

@media (max-width: 768px) {
    .flipper-leaf.forward,
    .flipper-leaf.backward {
        width: 100%;
        left: 0;
        right: 0;
    }
}

.flipper-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
}

.flipper-face.face-front {
    transform: rotateY(0deg);
}

.flipper-face.face-back {
    transform: rotateY(180deg);
}

.flipper-face img {
    width: 100%;
    height: 100%;
    object-fit: fill;
    display: block;
}

.thumb-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 10px 4px;
    scrollbar-width: thin;
}

.thumb-box {
    flex: 0 0 60px;
    height: 75px;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #ffffff;
}

.thumb-box.active {
    border-color: #E31E24;
    transform: scale(1.08);
    box-shadow: 0 0 12px rgba(227, 30, 36, 0.6);
}

/* Shared card interaction layer */
.motion-card,
.depth-card,
.magnetic-card {
    position: relative;
    isolation: isolate;
}

.motion-card,
.depth-card {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), translate 0.4s cubic-bezier(0.16, 1, 0.3, 1), scale 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.35s ease, box-shadow 0.4s ease;
}

.magnetic-card {
    transition: transform 0.15s ease-out, border-color 0.3s ease, box-shadow 0.3s ease;
}

.motion-card::before,
.depth-card::before,
.magnetic-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: -45%;
    width: 38%;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, #ff6870, #ffffff, transparent);
    box-shadow: 0 0 16px rgba(227, 30, 36, 0.9);
    opacity: 0;
    pointer-events: none;
}

.motion-card:hover,
.motion-card:focus-within,
.depth-card.depth-card:hover,
.depth-card:focus-within,
.magnetic-card:hover,
.magnetic-card:focus-within {
    border-color: rgba(227, 30, 36, 0.9);
    box-shadow: 0 0 0 1px rgba(227, 30, 36, 0.22), 0 24px 48px -22px rgba(227, 30, 36, 0.65), 0 0 28px rgba(227, 30, 36, 0.12);
}

.motion-card:hover,
.motion-card:focus-within,
.depth-card.depth-card:hover,
.depth-card:focus-within {
    translate: 0 -8px;
    scale: 1.02;
}

.motion-card:hover::before,
.motion-card:focus-within::before,
.depth-card:hover::before,
.depth-card:focus-within::before,
.magnetic-card:hover::before,
.magnetic-card:focus-within::before {
    opacity: 1;
    animation: card-sweep 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.card-icon {
    transform-style: preserve-3d;
    transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1), filter 0.35s ease;
}

.motion-card:hover .card-icon,
.motion-card:focus-within .card-icon,
.depth-card:hover .card-icon,
.depth-card:focus-within .card-icon,
.magnetic-card:hover .card-icon,
.magnetic-card:focus-within .card-icon {
    transform: translateZ(18px) rotateY(180deg) scale(1.12);
    filter: drop-shadow(0 0 9px rgba(227, 30, 36, 0.55));
}

.card-arrow {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

a:hover .card-arrow,
a:focus-visible .card-arrow {
    transform: translateX(5px);
}

@keyframes card-sweep {
    from { left: -45%; }
    to { left: 110%; }
}

@media (prefers-reduced-motion: reduce) {
    .motion-card,
    .depth-card,
    .magnetic-card,
    .card-icon,
    .card-arrow {
        transition: none;
    }

    .motion-card:hover,
    .motion-card:focus-within,
    .depth-card.depth-card:hover,
    .depth-card:focus-within {
        translate: none;
        scale: 1;
    }

    .motion-card:hover::before,
    .motion-card:focus-within::before,
    .depth-card:hover::before,
    .depth-card:focus-within::before,
    .magnetic-card:hover::before,
    .magnetic-card:focus-within::before {
        animation: none;
    }
}

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

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #111215;
}

::-webkit-scrollbar-thumb {
    background: #434242;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #E31E24;
}