/* Interactive classic / 3D presentation switch. */
.design-ambient {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    opacity: 0;
    transition: opacity .65s ease;
}

.design-orb {
    position: absolute;
    width: clamp(260px, 32vw, 520px);
    aspect-ratio: 1;
    border-radius: 50%;
    filter: blur(12px);
    opacity: .22;
    animation: design-orbit 16s ease-in-out infinite alternate;
}

.design-orb-one { inset: 4% auto auto -10%; background: radial-gradient(circle at 32% 30%, #76e6ff, #1783d1 52%, transparent 72%); }
.design-orb-two { inset: 34% -12% auto auto; background: radial-gradient(circle at 40% 38%, #a68cff, #24558b 55%, transparent 72%); animation-delay: -5s; }
.design-orb-three { inset: auto auto -18% 34%; background: radial-gradient(circle at 40% 38%, #43c7f0, #112747 58%, transparent 73%); animation-delay: -9s; }

.design-mode-toggle {
    position: fixed;
    inset-inline-end: clamp(14px, 2.4vw, 34px);
    bottom: clamp(16px, 2.8vw, 34px);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 190px;
    padding: 9px 13px 9px 9px;
    color: #fff;
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 18px;
    background: rgba(17,39,71,.92);
    box-shadow: 0 14px 42px rgba(17,39,71,.28);
    backdrop-filter: blur(18px) saturate(140%);
    cursor: pointer;
    transition: transform .25s ease, box-shadow .35s ease, background .35s ease;
}

.design-mode-toggle:hover { transform: translateY(-3px); box-shadow: 0 20px 50px rgba(17,39,71,.36); }
.design-toggle-track { position: relative; display: flex; align-items: center; width: 74px; height: 36px; padding: 3px; border-radius: 12px; background: rgba(255,255,255,.1); }
.design-toggle-icon { position: relative; z-index: 1; display: grid; place-items: center; width: 34px; color: rgba(255,255,255,.52); font-size: 14px; transition: color .3s ease; }
.design-toggle-thumb { position: absolute; inset-inline-start: 3px; top: 3px; z-index: 0; display: grid; place-items: center; width: 34px; height: 30px; color: transparent; border-radius: 9px; background: linear-gradient(145deg, #6fe2ff, #43c7f0); box-shadow: 0 5px 15px rgba(67,199,240,.35); transition: transform .45s cubic-bezier(.2,.8,.2,1), border-radius .3s ease; }
.design-toggle-copy { display: grid; text-align: start; line-height: 1.2; }
.design-toggle-copy small { color: #acd1e5; font-size: 10px; letter-spacing: .05em; }
.design-toggle-copy strong { margin-top: 3px; color: #fff; font-size: 12px; white-space: nowrap; }
.design-mode-toggle:not([aria-pressed="true"]) .design-toggle-icon-flat,
.design-mode-toggle[aria-pressed="true"] .design-toggle-icon-3d { color: #112747; }
.design-mode-toggle[aria-pressed="true"] .design-toggle-thumb { transform: translateX(calc(34px * var(--design-direction, 1))); border-radius: 50%; background: linear-gradient(145deg, #fff, #8eeaff); box-shadow: 0 7px 18px rgba(67,199,240,.48); }
[dir="rtl"] .design-mode-toggle { padding: 9px 9px 9px 13px; }
[dir="rtl"] .design-mode-toggle[aria-pressed="true"] .design-toggle-thumb { --design-direction: -1; }

body[data-design-mode="3d"] {
    background: linear-gradient(135deg, #eaf8ff 0%, #f6f8ff 42%, #e9f4fb 100%);
    background-attachment: fixed;
    perspective: 1400px;
}

body[data-design-mode="3d"] .design-ambient { opacity: 1; }
body[data-design-mode="3d"] main,
body[data-design-mode="3d"] footer,
body[data-design-mode="3d"] .profile-header-nav { position: relative; z-index: 1; }
body[data-design-mode="3d"] .profile-header-nav {
    margin: 12px clamp(10px, 2vw, 28px) 0;
    width: auto;
    border: 1px solid rgba(255,255,255,.7);
    border-radius: 20px;
    background: rgba(255,255,255,.76);
    box-shadow: 0 16px 48px rgba(26,55,100,.14), inset 0 1px rgba(255,255,255,.9);
    backdrop-filter: blur(22px) saturate(150%);
}

body[data-design-mode="3d"] .hero-banner {
    width: min(1320px, calc(100% - 32px));
    min-height: min(720px, calc(100svh - var(--navHeight)));
    margin: 22px auto 34px;
    border: 1px solid rgba(255,255,255,.82);
    border-radius: clamp(26px, 4vw, 54px);
    background: linear-gradient(135deg, rgba(255,255,255,.9), rgba(220,244,255,.7));
    box-shadow: 0 40px 90px rgba(25,65,106,.2), inset 0 1px rgba(255,255,255,.95);
    transform-style: preserve-3d;
    overflow: hidden;
}

body[data-design-mode="3d"] .hero-banner::after {
    content: "";
    position: absolute;
    inset: 8% 5% 8% 52%;
    z-index: 0;
    border-radius: 40% 60% 55% 45% / 45% 42% 58% 55%;
    background: linear-gradient(145deg, rgba(67,199,240,.8), rgba(26,55,100,.88));
    box-shadow: -28px 34px 0 rgba(67,199,240,.12), 0 38px 70px rgba(17,39,71,.28), inset 12px 12px 30px rgba(255,255,255,.28);
    transform: translateZ(20px) rotate(-4deg);
    animation: design-float 7s ease-in-out infinite;
}

[dir="rtl"] body[data-design-mode="3d"] .hero-banner::after { inset: 8% 52% 8% 5%; }
body[data-design-mode="3d"] .hero-contained { z-index: 2; transform: translateZ(54px); }
body[data-design-mode="3d"] .profile-hero-content { padding: clamp(24px, 4vw, 52px); border: 1px solid rgba(255,255,255,.74); border-radius: 28px; background: rgba(255,255,255,.52); box-shadow: 0 28px 55px rgba(17,39,71,.16), inset 0 1px #fff; backdrop-filter: blur(12px); }
body[data-design-mode="3d"] .profile-company-name { text-shadow: 0 2px 0 #fff, 0 10px 24px rgba(26,55,100,.16); }

body[data-design-mode="3d"] .profile-section,
body[data-design-mode="3d"] main > section:not(.hero-banner) { position: relative; isolation: isolate; }
body[data-design-mode="3d"] .profile-card-grid,
body[data-design-mode="3d"] .profile-info-grid { perspective: 1100px; }
body[data-design-mode="3d"] .design-tilt-card {
    --tilt-x: 0deg;
    --tilt-y: 0deg;
    --shine-x: 50%;
    --shine-y: 50%;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.82);
    background: rgba(255,255,255,.8);
    box-shadow: 0 22px 46px rgba(24,62,103,.15), inset 0 1px #fff;
    transform: rotateX(var(--tilt-x)) rotateY(var(--tilt-y)) translateZ(0);
    transform-style: preserve-3d;
    transition: transform .16s ease-out, box-shadow .3s ease, border-color .3s ease;
    will-change: transform;
}
body[data-design-mode="3d"] .design-tilt-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    background: radial-gradient(circle at var(--shine-x) var(--shine-y), rgba(255,255,255,.62), transparent 34%);
    opacity: .52;
}
body[data-design-mode="3d"] .design-tilt-card:hover { box-shadow: 0 32px 65px rgba(24,62,103,.24), inset 0 1px #fff; border-color: rgba(67,199,240,.65); }
body[data-design-mode="3d"] .design-tilt-card > * { position: relative; z-index: 2; transform: translateZ(18px); }
body[data-design-mode="3d"] .design-tilt-card img { transform: translateZ(12px) scale(1.015); }
body[data-design-mode="3d"] footer { margin: 36px 16px 16px; border-radius: 34px; overflow: hidden; box-shadow: 0 30px 70px rgba(17,39,71,.3); }

@keyframes design-float { 0%,100% { transform: translateZ(20px) rotate(-4deg) translateY(0); } 50% { transform: translateZ(34px) rotate(1deg) translateY(-14px); } }
@keyframes design-orbit { from { transform: translate3d(-3%, -2%, 0) scale(.92); } to { transform: translate3d(9%, 7%, 0) scale(1.08); } }

@media (max-width: 760px) {
    .design-mode-toggle { min-width: 0; padding: 8px; border-radius: 15px; }
    .design-toggle-copy { display: none; }
    body[data-design-mode="3d"] .hero-banner { width: calc(100% - 20px); margin-top: 10px; border-radius: 28px; }
    body[data-design-mode="3d"] .hero-banner::after { inset: 48% 8% 5%; opacity: .35; }
    [dir="rtl"] body[data-design-mode="3d"] .hero-banner::after { inset: 48% 8% 5%; }
    body[data-design-mode="3d"] .profile-header-nav { margin: 8px 8px 0; border-radius: 16px; }
    body[data-design-mode="3d"] footer { margin: 24px 8px 8px; border-radius: 24px; }
}

@media (prefers-reduced-motion: reduce) {
    .design-orb, body[data-design-mode="3d"] .hero-banner::after { animation: none; }
    body[data-design-mode="3d"] .design-tilt-card { transform: none !important; }
}
