/* =========================================
   Hussain Al-Najjar · DXX
   Velvet Dark · Fully Responsive
   ========================================= */

:root {
    --bg: #07050a;
    --bg-2: #0d0a14;
    --velvet: #1a0d28;
    --wine:  #3b0f1f;
    --gold:  #c9a35a;
    --gold-2:#e8c573;
    --text:  #f1ebe1;
    --dim:   #8a7f70;
    --line:  rgba(201,163,90,0.16);
    --serif: 'Cormorant Garamond', serif;
    --sans:  'Tajawal', sans-serif;

    /* safe-area للأجهزة اللي فيها notch */
    --sa-top:    env(safe-area-inset-top, 0px);
    --sa-bottom: env(safe-area-inset-bottom, 0px);
    --sa-left:   env(safe-area-inset-left, 0px);
    --sa-right:  env(safe-area-inset-right, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
}

html, body { min-height: 100%; }

body {
    font-family: var(--sans);
    background:
            radial-gradient(circle at 20% 0%, var(--velvet) 0%, transparent 55%),
            radial-gradient(circle at 80% 100%, var(--wine) 0%, transparent 50%),
            var(--bg);
    background-attachment: fixed;
    color: var(--text);
    overflow-x: hidden;
    min-height: 100vh;
    min-height: 100dvh; /* iOS Safari + Chrome — يحسب الـ viewport بدون شريط العنوان */
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* الكرسر المخصص فقط على الأجهزة اللي تدعم hover */
@media (hover: hover) and (pointer: fine) {
    body { cursor: none; }
    a, button { cursor: none; }
}

a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
ul { list-style: none; }
button {
    background: none;
    border: none;
    color: inherit;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

img, svg { display: block; max-width: 100%; }

/* =========================================
   PARTICLES CANVAS
   ========================================= */
#particles {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* =========================================
   AURA — وهج يتبع الماوس (ديسكتوب فقط)
   ========================================= */
.aura {
    position: fixed;
    top: 0; left: 0;
    width: clamp(320px, 50vw, 600px);
    height: clamp(320px, 50vw, 600px);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(201,163,90,0.18) 0%, rgba(201,163,90,0.06) 30%, transparent 65%);
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 1;
    filter: blur(40px);
    transition: opacity 0.5s ease;
    will-change: transform;
}

@media (hover: none) {
    .aura {
        /* على اللمس: نخلي وهج ثابت في المنتصف بدل ما يتبع */
        top: 50%; left: 50%;
        opacity: 0.7;
    }
}

/* =========================================
   GRAIN
   ========================================= */
.grain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.06;
    z-index: 5;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    mix-blend-mode: overlay;
}

/* =========================================
   CURSOR
   ========================================= */
.cursor {
    position: fixed;
    top: 0; left: 0;
    width: 14px; height: 14px;
    border: 1px solid var(--gold);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease, background 0.3s ease, border-color 0.3s ease;
    mix-blend-mode: difference;
    will-change: transform;
    display: none; /* مخفي افتراضياً، JS يفعّله */
}
.cursor.grow {
    width: 60px; height: 60px;
    background: rgba(201,163,90,0.15);
    border-color: var(--gold-2);
}

@media (hover: hover) and (pointer: fine) {
    .cursor { display: block; }
}

/* =========================================
   LOADER
   ========================================= */
.loader {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 9999;
    display: grid;
    place-items: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}
.loader.hidden { opacity: 0; visibility: hidden; }
.loader__bar {
    width: min(220px, 60vw);
    height: 1px;
    background: rgba(255,255,255,0.08);
    position: relative;
    overflow: hidden;
}
.loader__bar span {
    position: absolute;
    top: 0; right: 0;
    height: 100%; width: 100%;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    animation: loadBar 1.6s ease-in-out infinite;
}
@keyframes loadBar {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* =========================================
   STAGE
   ========================================= */
.stage {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    padding:
            calc(28px + var(--sa-top))
            calc(clamp(20px, 5vw, 60px) + var(--sa-right))
            calc(28px + var(--sa-bottom))
            calc(clamp(20px, 5vw, 60px) + var(--sa-left));
}

/* TOP BAR */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: auto;
    flex-wrap: wrap;
}
.mark {
    font-family: var(--serif);
    font-size: clamp(1.1rem, 1.6vw, 1.4rem);
    font-weight: 600;
    letter-spacing: 0.3em;
    color: var(--text);
    white-space: nowrap;
}
.mark span { color: var(--gold); }
.clock {
    font-family: var(--serif);
    font-size: clamp(0.78rem, 1vw, 0.9rem);
    letter-spacing: 0.25em;
    color: var(--dim);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* CARD */
.card {
    margin: auto;
    text-align: center;
    width: 100%;
    max-width: 720px;
    padding: clamp(24px, 5vw, 40px) 0;
    position: relative;
    transform-style: preserve-3d;
    will-change: transform;
}

/* زخرفة في الزاوية */
.card::before, .card::after {
    content: '';
    position: absolute;
    width: clamp(36px, 6vw, 60px);
    height: clamp(36px, 6vw, 60px);
    border: 1px solid var(--line);
    pointer-events: none;
}
.card::before {
    top: -10px; right: -10px;
    border-bottom: none; border-left: none;
}
.card::after {
    bottom: -10px; left: -10px;
    border-top: none; border-right: none;
}

.kicker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: clamp(0.66rem, 1.2vw, 0.78rem);
    letter-spacing: 0.4em;
    color: var(--gold);
    text-transform: uppercase;
    margin-bottom: clamp(20px, 4vw, 36px);
    font-weight: 500;
    padding: 0 8px;
}
.kicker .dot {
    width: 6px; height: 6px;
    background: var(--gold);
    border-radius: 50%;
    animation: pulse 2.4s ease-in-out infinite;
    box-shadow: 0 0 12px var(--gold);
    flex-shrink: 0;
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.4; transform: scale(0.7); }
}

/* الاسم */
.name {
    font-family: var(--serif);
    font-size: clamp(2.4rem, 9vw, 6.5rem);
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.02em;
    margin-bottom: clamp(12px, 2vw, 18px);
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.name .line { display: block; overflow: hidden; }
.name em {
    font-style: italic;
    font-weight: 400;
    background: linear-gradient(180deg, var(--gold-2) 0%, var(--gold) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--gold); /* fallback */
}
.name .and {
    color: var(--gold);
    margin: 0 0.15em;
    font-weight: 400;
    -webkit-text-fill-color: var(--gold);
}

.name-ar {
    font-family: var(--sans);
    font-size: clamp(0.9rem, 2.2vw, 1.3rem);
    font-weight: 300;
    letter-spacing: clamp(0.2em, 0.4vw, 0.4em);
    color: var(--dim);
    margin-bottom: clamp(24px, 4vw, 36px);
    padding: 0 10px;
}

/* فاصل ذهبي */
.divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin: 0 auto clamp(24px, 4vw, 36px);
    max-width: min(320px, 80%);
}
.divider span:not(.diamond) {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--line), transparent);
}
.diamond {
    width: 6px; height: 6px;
    background: var(--gold);
    transform: rotate(45deg);
    box-shadow: 0 0 14px rgba(201,163,90,0.6);
    flex-shrink: 0;
}

/* tagline */
.tagline {
    font-family: var(--serif);
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.8;
    font-weight: 400;
    color: rgba(241,235,225,0.78);
    max-width: 540px;
    margin: 0 auto clamp(32px, 6vw, 48px);
    padding: 0 16px;
}
.tagline em { font-style: italic; color: var(--gold); }

/* زر الانستغرام */
.ig-btn {
    display: inline-flex;
    align-items: center;
    gap: clamp(12px, 2vw, 18px);
    padding: clamp(14px, 2.5vw, 18px) clamp(20px, 3vw, 32px);
    background: linear-gradient(135deg, rgba(201,163,90,0.08), rgba(201,163,90,0.02));
    border: 1px solid var(--line);
    border-radius: 80px;
    position: relative;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.7,0,0.3,1);
    min-height: 56px; /* touch target */
    max-width: calc(100% - 32px);
    will-change: transform;
}
.ig-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--velvet), var(--wine));
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 0;
}

@media (hover: hover) {
    .ig-btn:hover {
        border-color: var(--gold);
        transform: translateY(-3px);
        box-shadow: 0 20px 50px -15px rgba(201,163,90,0.4);
    }
    .ig-btn:hover::before { opacity: 1; }
    .ig-btn:hover .ig-btn__icon { transform: rotate(-12deg) scale(1.1); }
    .ig-btn:hover .ig-btn__arrow { transform: translateX(-8px); }
}

/* tap effect على اللمس */
.ig-btn:active {
    transform: scale(0.97);
    border-color: var(--gold);
}
.ig-btn:active::before { opacity: 0.6; }

.ig-btn > * { position: relative; z-index: 1; }

.ig-btn__icon {
    width: clamp(38px, 5vw, 44px);
    height: clamp(38px, 5vw, 44px);
    display: grid; place-items: center;
    border-radius: 50%;
    background: var(--gold);
    color: var(--bg);
    transition: transform 0.5s cubic-bezier(0.7,0,0.3,1);
    flex-shrink: 0;
}

.ig-btn__text {
    display: flex;
    flex-direction: column;
    text-align: right;
    line-height: 1.3;
    min-width: 0;
}
.ig-btn__label {
    font-size: clamp(0.65rem, 1vw, 0.72rem);
    letter-spacing: 0.3em;
    color: var(--dim);
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ig-btn__handle {
    font-family: var(--serif);
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    font-weight: 600;
    color: var(--gold);
    letter-spacing: 0.05em;
}
.ig-btn__arrow {
    font-size: clamp(1.1rem, 1.6vw, 1.3rem);
    color: var(--gold);
    transition: transform 0.5s cubic-bezier(0.7,0,0.3,1);
    flex-shrink: 0;
}

/* إحصائيات */
.meta {
    display: flex;
    justify-content: center;
    gap: clamp(24px, 8vw, 80px);
    margin-top: clamp(40px, 7vw, 60px);
    padding-top: clamp(28px, 5vw, 40px);
    border-top: 1px solid var(--line);
    flex-wrap: wrap;
}
.meta li {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
}
.meta span {
    font-family: var(--serif);
    font-size: clamp(1.6rem, 3.5vw, 2.2rem);
    font-weight: 600;
    color: var(--gold);
    font-style: italic;
    line-height: 1;
}
.meta small {
    font-size: clamp(0.65rem, 1vw, 0.72rem);
    letter-spacing: 0.25em;
    color: var(--dim);
    text-transform: uppercase;
    white-space: nowrap;
}

/* FOOTER */
.footbar {
    margin-top: auto;
    padding-top: clamp(28px, 4vw, 40px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: clamp(0.65rem, 1vw, 0.72rem);
    letter-spacing: 0.3em;
    color: var(--dim);
    text-transform: uppercase;
    gap: 14px;
    flex-wrap: wrap;
}
.dxx-mark {
    font-family: var(--serif);
    font-style: italic;
    letter-spacing: 0.2em;
    white-space: nowrap;
}
.dxx-mark span { color: var(--gold); }

/* =========================================
   REVEAL
   ========================================= */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    filter: blur(8px);
    transition: opacity 1.2s cubic-bezier(0.7,0,0.3,1),
    transform 1.2s cubic-bezier(0.7,0,0.3,1),
    filter 1.2s cubic-bezier(0.7,0,0.3,1);
}
.reveal.in {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

/* =========================================
   RESPONSIVE BREAKPOINTS
   ========================================= */

/* تابلت كبير وما تحت */
@media (max-width: 1024px) {
    .stage { padding-top: calc(24px + var(--sa-top)); }
}

/* تابلت / موبايل أفقي */
@media (max-width: 768px) {
    .topbar { margin-bottom: clamp(40px, 8vw, 80px); }
    .ig-btn__text { gap: 2px; }
}

/* موبايل عمودي */
@media (max-width: 600px) {
    .stage { padding: calc(20px + var(--sa-top)) calc(18px + var(--sa-right)) calc(20px + var(--sa-bottom)) calc(18px + var(--sa-left)); }
    .meta { gap: 28px; }
    .footbar { justify-content: center; text-align: center; }
}

/* موبايل صغير جداً (320–375) */
@media (max-width: 380px) {
    .topbar .clock { display: none; } /* الساعة قد تزحم */
    .ig-btn { gap: 10px; padding: 14px 18px; }
    .ig-btn__label { letter-spacing: 0.2em; }
    .meta { gap: 20px; }
    .meta li:nth-child(3) { display: none; } /* نخفي الإحصائية الثالثة في الصغير جداً */
}

/* وضع landscape على الموبايل (ارتفاع صغير) */
@media (max-height: 500px) and (orientation: landscape) {
    .stage { padding-block: 16px; }
    .topbar { margin-bottom: 20px; }
    .name { font-size: clamp(2rem, 7vh, 3.5rem); }
    .kicker { margin-bottom: 14px; }
    .name-ar { margin-bottom: 16px; }
    .divider { margin-bottom: 16px; }
    .tagline { margin-bottom: 22px; font-size: 0.95rem; line-height: 1.6; }
    .meta { margin-top: 24px; padding-top: 18px; }
    .meta span { font-size: 1.4rem; }
    .footbar { padding-top: 18px; }
}

/* شاشات كبيرة جداً (4K+) */
@media (min-width: 1920px) {
    .card { max-width: 880px; }
    .stage { padding-inline: clamp(60px, 8vw, 120px); }
}

/* شاشات قصيرة جداً */
@media (max-height: 380px) {
    .meta, .footbar { display: none; }
}

/* تقليل الحركة لمن يفضّل ذلك */
@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;
    }
    .reveal { filter: none; transform: none; }
    #particles, .aura, .grain { display: none; }
}

/* وضع الطباعة */
@media print {
    body { background: white; color: black; }
    #particles, .aura, .grain, .cursor, .loader { display: none !important; }
}