* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== إعدادات سهلة التعديل ===== */
:root {
    /* بيرفع الفيديو لفوق عشان المسافة فوق الراس تبقى صغيرة.
       عايز الراس تطلع لفوق أكتر؟ زوّد الرقم السالب (مثلاً -8%)
       عايزها تنزل شوية؟ قلّله (مثلاً -2%) */
    --video-shift: -5%;
}

html, body {
    height: 100%;
    overflow: hidden;              /* مفيش سكرول خالص */
    overscroll-behavior: none;
}

body {
    background-color: #000000;
    font-family: 'Montserrat', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}


/* ===== الشاشات الكبيرة: الفيديو مكبّر ومغبّش كخلفية ورا الكارت ===== */
.ambient {
    position: fixed;
    inset: -10%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    animation: ambientIn 1.6s ease 1.2s both;
}

.ambient img,
.ambient video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(50px) brightness(0.85) saturate(1.2);
    transform: scale(1.1);
}

/* تعتيم الأطراف عشان الكارت يبقى هو المركز */
.ambient::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, 0.7) 100%);
}

@keyframes ambientIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* الكارت الرئيسي (على الكمبيوتر بيظهر ككارت في النص) */
.card-container {
    position: relative;
    background-color: #000000;
    width: 100%;
    max-width: 400px;
    height: min(calc(100dvh - 60px), 860px);
    border-radius: 40px;
    text-align: center;
    color: #ffffff;
    z-index: 1;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.07);
    overflow: hidden;
}

/* الفيديو خلفية للكارت كله */
.profile-img-container {
    position: absolute;
    inset: 0;
    background-color: #000000;
    overflow: hidden;
}

.profile-poster,
.profile-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    transform: translateY(var(--video-shift));
    pointer-events: none;
}

/* الفيديو مخفي لحد ما يبدأ يتحرك، والصورة اللي تحته هي اللي ظاهرة */
.profile-video {
    opacity: 0;
    transition: opacity 0.4s ease;
}

.profile-video.is-playing {
    opacity: 1;
}

/* المحتوى فوق الفيديو من تحت */
.card-content {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 70px 24px calc(env(safe-area-inset-bottom, 0px) + 18px);
    /* تدرج خفيف بيبدأ شفاف عشان ما يداريش الفيديو */
    background: linear-gradient(to bottom,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.55) 35%,
        rgba(0, 0, 0, 0.85) 100%);
}

/* الاسم */
.name {
    font-size: 2.1rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 4px;
    letter-spacing: -0.8px;
    white-space: nowrap;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

/* المسمى الوظيفي والتفاصيل */
.title-container {
    cursor: pointer;
    margin-bottom: 18px;
    display: inline-block;
    user-select: none;
}

.title {
    font-size: 1.05rem;
    font-weight: 500;
    color: #dddddd;
    letter-spacing: 0.2px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}

.title-details {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.4s ease, margin-top 0.4s ease;
}

.title-details.show {
    max-height: 50px;
    opacity: 1;
    margin-top: 8px;
}

.title-details p {
    font-size: 0.85rem;
    color: #b9bec6;
    font-weight: 500;
}

.title-details strong {
    color: #ffffff;
}

/* زر الاتصال */
.cta-button {
    display: block;
    width: 100%;
    border: none;
    cursor: pointer;
    background-color: #f0f0f0;
    color: #000000;
    font-family: 'Montserrat', sans-serif;
    padding: 14px 20px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 0;
    transition: background-color 0.3s ease;
}

.cta-button:hover {
    background-color: #ffffff;
}

/* الأيقونات */
.social-icons {
    display: flex;
    justify-content: center;
    gap: 20px;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    margin-top: 0;
    transition: max-height 0.4s ease, opacity 0.4s ease, margin-top 0.4s ease;
}

.social-icons.show {
    max-height: 60px;
    opacity: 1;
    margin-top: 18px;
}

.social-icons a {
    color: #ffffff;
    font-size: 1.7rem;
    text-decoration: none;
    transition: transform 0.3s ease, color 0.3s ease;
}

.social-icons a:hover {
    transform: translateY(-3px);
}

.social-icons .add-contact:hover { color: #34c759; }
.social-icons .whatsapp:hover { color: #25D366; }
.social-icons .phone:hover { color: #34b7f1; }
.social-icons .email:hover { color: #ea4335; }
.social-icons .instagram:hover { color: #e1306c; }

/* السطر الأخير */
.tagline {
    font-size: 0.6rem;
    font-weight: 500;
    color: #777777;
    margin-top: 16px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* الموبايل: الكارت ياخد الشاشة كلها بالظبط */
@media (max-width: 480px) {
    body {
        background-color: #000000;
        padding: 0;
    }

    .ambient {
        display: none;
    }

    .card-container {
        position: fixed;
        inset: 0;
        max-width: 100%;
        height: 100%;
        border-radius: 0;
        box-shadow: none;
    }

    .card-content {
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* شاشات قصيرة جداً: نصغّر المسافات شوية */
@media (max-height: 640px) {
    .name { font-size: 1.8rem; }
    .title-container { margin-bottom: 12px; }
    .tagline { margin-top: 10px; }
    .card-content { padding-top: 50px; }
}

/* ===== الدخلة: البابين ===== */
/* الترتيب: شاشة سودا ← خط نور في النص ← البابين بيتفتحوا على نور أبيض
   ← الكاميرا بتعدّي والنور بيختفي ← الاسم بيطلع من النور ← اللقب ← الزرار */

.intro-scene {
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
    transform-origin: 50% 45%;
    animation: cameraPush 1.5s cubic-bezier(0.55, 0, 0.35, 1) 1.05s both;
}

/* النور الأبيض اللي ورا الباب */
.intro-light {
    position: absolute;
    inset: -20%;
    opacity: 0;
    background: radial-gradient(ellipse 75% 95% at 50% 45%,
        #ffffff 0%, #ffffff 50%, rgba(255, 255, 255, 0.85) 75%, rgba(255, 255, 255, 0.45) 100%);
    animation: lightFlood 1.5s linear 1.12s both;
}

/* البابين: أسود سادة */
.intro-doors {
    position: absolute;
    inset: 0;
    perspective: 1100px;
    perspective-origin: 50% 45%;
}

.intro-door {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50.2%;
    background: #000000;
    overflow: hidden;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.intro-door.left {
    left: 0;
    transform-origin: 0 50%;
    animation: doorLeft 1.3s cubic-bezier(0.7, 0, 0.25, 1) 1.1s both;
}

.intro-door.right {
    right: 0;
    transform-origin: 100% 50%;
    animation: doorRight 1.3s cubic-bezier(0.7, 0, 0.25, 1) 1.1s both;
}

.intro-shade {
    position: absolute;
    inset: 0;
    background: #000000;
    opacity: 0;
    animation: fadeTo85 1.3s ease-in 1.1s both;
}

/* خط النور اللي بيتسرب من بين البابين */
.intro-seam {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    margin-left: -1px;
    background: #ffffff;
    opacity: 0;
    box-shadow: 0 0 8px #fff, 0 0 24px #fff,
        0 0 70px rgba(240, 244, 250, 0.75), 0 0 140px rgba(240, 244, 250, 0.45);
    animation: seamGlow 1.6s ease 0.3s both;
}

/* الفيديو: بيقرب مع دخول الكاميرا */
.profile-img-container {
    animation: arrive 1.9s cubic-bezier(0.3, 0, 0.2, 1) 1.05s both;
}

.card-content {
    animation: fadeIn 0.8s ease 1.9s both;
}

/* الاسم بيطلع من النور، وبعدين بيفضل له توهج فضي هادي */
.name {
    animation:
        nameFromLight 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) 2.15s both,
        nameBreathe 4.5s ease-in-out 3.25s infinite alternate;
}

.title-container {
    animation: riseIn 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) 2.5s both;
}

.cta-button {
    animation: riseIn 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) 2.7s both;
}

.tagline {
    animation: riseIn 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) 2.9s both;
}

@keyframes seamGlow {
    0%   { opacity: 0; transform: scaleY(0.2); }
    35%  { opacity: 0.9; transform: scaleY(1); }
    50%  { opacity: 0.7; }
    60%  { opacity: 1; width: 3px; margin-left: -1.5px; }
    75%  { opacity: 1; width: 14px; margin-left: -7px; }
    100% { opacity: 0; width: 60px; margin-left: -30px; }
}

@keyframes doorLeft {
    from { transform: rotateY(0); }
    to   { transform: rotateY(-100deg); }
}

@keyframes doorRight {
    from { transform: rotateY(0); }
    to   { transform: rotateY(100deg); }
}

@keyframes fadeTo85 {
    from { opacity: 0; }
    to   { opacity: 0.85; }
}

@keyframes cameraPush {
    from { transform: scale(1); }
    to   { transform: scale(1.9); }
}

@keyframes lightFlood {
    0%   { opacity: 0; }
    22%  { opacity: 1; }
    55%  { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes arrive {
    from { filter: blur(3px); transform: scale(0.86); }
    to   { filter: none; transform: scale(1); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes nameFromLight {
    from {
        opacity: 0;
        letter-spacing: 0.22em;
        filter: blur(8px);
        text-shadow: 0 0 30px #fff, 0 0 60px #fff;
    }
    to {
        opacity: 1;
        letter-spacing: -0.8px;
        filter: blur(0);
        text-shadow: 0 0 10px rgba(225, 230, 240, 0.35), 0 0 24px rgba(200, 210, 225, 0.18), 0 2px 12px rgba(0, 0, 0, 0.6);
    }
}

@keyframes nameBreathe {
    from { text-shadow: 0 0 10px rgba(225, 230, 240, 0.35), 0 0 24px rgba(200, 210, 225, 0.18), 0 2px 12px rgba(0, 0, 0, 0.6); }
    to   { text-shadow: 0 0 14px rgba(235, 240, 248, 0.55), 0 0 34px rgba(205, 215, 230, 0.3), 0 2px 12px rgba(0, 0, 0, 0.6); }
}

@keyframes riseIn {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* لو الموبايل مفعّل عليه "تقليل الحركة": من غير دخلة خالص */
@media (prefers-reduced-motion: reduce) {
    .intro-scene {
        display: none;
    }

    .ambient,
    .profile-img-container,
    .card-content,
    .name,
    .title-container,
    .cta-button,
    .tagline {
        animation: none;
    }

    .name {
        text-shadow: 0 0 10px rgba(225, 230, 240, 0.35), 0 2px 12px rgba(0, 0, 0, 0.6);
    }
}
