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

:root {
    --bg: #0e0e0e;
    --fg: #f0ede8;
    --teal: #00b4a6;
    --cobalt: #1a4cff;
    --acid: #c8ff00;
    --mono: 'Space Mono', monospace;
    --en: 'Inter', sans-serif;
    --ar: 'Noto Kufi Arabic', sans-serif;
}

html,
body {
    width: 100%;
    height: 100%;
    background: var(--bg);
    color: var(--fg);
    overflow: hidden;
    cursor: none;
}

@media (pointer: coarse) {
    html,
    body {
        cursor: auto;
    }

    #cursor,
    #cursor-ring,
    #cursor-glow {
        display: none !important;
    }

    .footer-item:hover,
    .footer-email-link:hover,
    .cta-btn {
        cursor: auto;
    }
}

/* CUSTOM CURSOR */
#cursor {
    position: fixed;
    z-index: 9999;
    width: 12px;
    height: 12px;
    background: var(--teal);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: transform 0.1s, width 0.3s, height 0.3s, background 0.3s;
    mix-blend-mode: difference;
}

#cursor-ring {
    position: fixed;
    z-index: 9998;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(0, 180, 166, 0.5);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: transform 0.12s ease-out, width 0.3s, height 0.3s;
}

body:hover #cursor {
    opacity: 1;
}

/* GRAIN OVERLAY */
#grain {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    opacity: 0.045;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-size: 256px 256px;
    animation: grainShift 0.5s steps(1) infinite;
}

@keyframes grainShift {
    0% {
        background-position: 0 0;
    }

    20% {
        background-position: -50px -20px;
    }

    40% {
        background-position: 30px 40px;
    }

    60% {
        background-position: -60px 10px;
    }

    80% {
        background-position: 20px -30px;
    }
}

/* CURSOR GLOW */
#cursor-glow {
    position: fixed;
    z-index: 1;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(0, 180, 166, 0.07) 0%, transparent 70%);
    transition: transform 0.4s ease-out;
}

/* WEBGL CANVAS */
#canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
}

/* MAIN LAYOUT */
#main {
    position: fixed;
    inset: 0;
    z-index: 3;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-rows: 1fr auto;
    padding: clamp(24px, 4vw, 60px);
    gap: 0;
}

/* LEFT — EN VERTICAL */
.col-left {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.vertical-en {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    font-family: var(--en);
    font-weight: 900;
    font-size: clamp(80px, 10vw, 148px);
    letter-spacing: -0.04em;
    line-height: 0.9;
    color: transparent;
    -webkit-text-stroke: 1px rgba(240, 237, 232, 0.15);
    text-transform: uppercase;
    user-select: none;
    animation: fadeSlideLeft 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

.logo-wrap {
    display: flex;
    align-items: flex-end;
    animation: fadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

.logo-wrap img {
    width: clamp(48px, 5vw, 72px);
    height: auto;
    /* filter: brightness(0) invert(1); */
    opacity: 0.9;
}

.logo-name {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: white;
    margin-left: 12px;
    margin-bottom: 4px;
}

/* CENTER COLUMN */
.col-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: clamp(200px, 25vw, 360px);
    position: relative;
    z-index: 5;
}

.sphere-container {
    width: clamp(220px, 28vw, 420px);
    height: clamp(220px, 28vw, 420px);
    position: relative;
    flex-shrink: 0;
}

.center-tag {
    font-family: var(--mono);
    font-size: clamp(8px, 0.8vw, 11px);
    letter-spacing: 0.25em;
    color: var(--teal);
    text-transform: uppercase;
    text-align: center;
    margin-top: 24px;
    animation: fadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) 1.4s both;
}

/* RIGHT — AR VERTICAL */
.col-right {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
    overflow: hidden;
}

.vertical-ar {
    writing-mode: vertical-rl;
    font-family: var(--ar);
    font-weight: 900;
    font-size: clamp(80px, 10vw, 148px);
    line-height: 0.9;
    color: var(--bg);
    -webkit-text-stroke: 1px rgba(240, 237, 232, 0.15);
    paint-order: stroke fill;
    user-select: none;
    animation: fadeSlideRight 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

/* BOTTOM ROW */
.bottom-bar {
    grid-column: 1 / -1;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding-top: 24px;
    border-top: 1px solid rgba(240, 237, 232, 0.06);
    animation: fadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) 1.6s both;
}

/* HERO TEXT */
.hero-block {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    text-align: center;
    pointer-events: none;
    white-space: nowrap;
}

/* OVERLAY HERO — positioned absolutely over layout */
#hero-overlay {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    gap: 8px;
}

.hero-en {
    font-family: var(--en);
    font-weight: 900;
    font-size: clamp(28px, 4vw, 56px);
    letter-spacing: -0.03em;
    line-height: 1;
    color: var(--fg);
    text-align: center;
    animation: heroReveal 1.4s cubic-bezier(0.16, 1, 0.3, 1) 0.8s both;
}

.hero-en span {
    color: var(--teal);
}

.hero-ar {
    font-family: var(--ar);
    font-weight: 700;
    font-size: clamp(20px, 2.8vw, 40px);
    line-height: 1.4;
    color: rgba(240, 237, 232, 1);
    text-align: center;
    direction: rtl;
    animation: heroReveal 1.4s cubic-bezier(0.16, 1, 0.3, 1) 1s both;
}

.hero-divider {
    width: 1px;
    height: 32px;
    background: linear-gradient(to bottom, transparent, var(--teal), transparent);
    margin: 4px auto;
    animation: fadeUp 1s ease 1.2s both;
}

/* BOTTOM BAR ELEMENTS */
.contact-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.footer-item {
    font-family: var(--mono);
    font-size: 18px;
    letter-spacing: 0.05em;
    color: rgba(240, 237, 232, 0.65);
    text-decoration: none;
    text-transform: uppercase;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-email-link {
    font-family: var(--mono);
    font-size: 18px;
    letter-spacing: 0.05em;
    color: rgba(240, 237, 232, 0.65);
    text-decoration: none;
    text-transform: uppercase;
    transition: color 0.3s;
}

.footer-email-link,
.footer-email-link:link,
.footer-email-link:visited {
    color: rgba(240, 237, 232, 0.65);
    text-decoration: none;
    cursor: none;
}

.footer-email-link:hover {
    color: var(--teal);
    cursor: none;
}

.footer-item:hover {
    color: var(--teal);
    cursor: none;
}

.footer-item svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    flex-shrink: 0;
    opacity: 0.8;
}

.cta-btn {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--fg);
    background: transparent;
    border: 1px solid rgba(240, 237, 232, 0.2);
    padding: 12px 28px;
    cursor: none;
    transition: all 0.4s;
    position: relative;
    overflow: hidden;
}

.cta-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--teal);
    transform: translateX(-101%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: -1;
}

.cta-btn:hover::before {
    transform: translateX(0);
}

.cta-btn:hover {
    color: #0e0e0e;
    border-color: var(--teal);
    box-shadow: 0 0 30px rgba(0, 180, 166, 0.3), 0 0 60px rgba(0, 180, 166, 0.1);
}

.socials {
    display: flex;
    gap: 20px;
    align-items: center;
}

.contact-ar {
    font-family: var(--ar);
    font-size: clamp(9px, 0.9vw, 12px);
    color: rgba(240, 237, 232, 0.25);
    direction: rtl;
    letter-spacing: 0;
}

/* COUNTDOWN */
.countdown-wrap {
    display: flex;
    gap: clamp(16px, 2vw, 32px);
    align-items: flex-end;
    pointer-events: none;
}

.count-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.count-num {
    font-family: var(--en);
    font-weight: 700;
    font-size: clamp(22px, 2.5vw, 36px);
    letter-spacing: -0.04em;
    color: var(--fg);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.count-label {
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(240, 237, 232, 0.25);
}

.count-sep {
    font-family: var(--en);
    font-weight: 700;
    font-size: 28px;
    color: var(--teal);
    margin-bottom: 8px;
    opacity: 0.6;
}

/* SCANLINE ACCENT */
.scanline {
    position: fixed;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--teal), transparent);
    opacity: 0;
    z-index: 6;
    pointer-events: none;
    animation: scanAnim 8s ease-in-out 2s infinite;
}

@keyframes scanAnim {
    0% {
        top: 0;
        opacity: 0;
    }

    5% {
        opacity: 0.4;
    }

    95% {
        opacity: 0.4;
    }

    100% {
        top: 100%;
        opacity: 0;
    }
}

/* CORNER MARKS */
.corner {
    position: fixed;
    width: 20px;
    height: 20px;
    z-index: 7;
    pointer-events: none;
    opacity: 0.2;
    animation: fadeUp 1s ease 2s both;
}

.corner-tl {
    top: 20px;
    left: 20px;
    border-top: 1px solid var(--fg);
    border-left: 1px solid var(--fg);
}

.corner-tr {
    top: 20px;
    right: 20px;
    border-top: 1px solid var(--fg);
    border-right: 1px solid var(--fg);
}

.corner-bl {
    bottom: 20px;
    left: 20px;
    border-bottom: 1px solid var(--fg);
    border-left: 1px solid var(--fg);
}

.corner-br {
    bottom: 20px;
    right: 20px;
    border-bottom: 1px solid var(--fg);
    border-right: 1px solid var(--fg);
}

/* STATUS DOT */
.status-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--teal);
    border-radius: 50%;
    margin-right: 8px;
    animation: pulse 2s ease infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.4;
        transform: scale(0.7);
    }
}

.social-area {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 16px;
}

/* INLINE ARABIC FIX */
.ar-inline {
    font-family: var(--ar);
    letter-spacing: 0;
    font-size: 1.1em;
}

/* KEYFRAMES */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeSlideLeft {
    from {
        opacity: 0;
        transform: rotate(180deg) translateY(-40px);
    }

    to {
        opacity: 1;
        transform: rotate(180deg) translateY(0);
    }
}

@keyframes fadeSlideRight {
    from {
        opacity: 0;
        transform: translateY(-40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heroReveal {
    from {
        opacity: 0;
        transform: translateY(30px);
        filter: blur(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

/* MOBILE */
@media (max-width: 768px) {

    html,
    body {
        overflow-y: auto;
        overflow-x: hidden;
    }

    #main {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto auto;
        padding: 44px 40px;
        height: auto;
        min-height: 100dvh;
        position: relative;
    }

    .col-left {
        flex-direction: row;
        justify-content: space-between;
        align-items: start;
        gap: 16px;
    }

    .vertical-en {
        /* writing-mode: horizontal-tb; */
        /* transform: none; */
        font-size: clamp(24px, 8vw, 40px);
        -webkit-text-stroke: 1px rgba(240, 237, 232, 0.2);
    }

    .col-center {
        width: 100%;
        align-items: center;
        padding: 40px 0;
    }

    .sphere-container {
        width: 180px;
        height: 180px;
    }

    .col-right {
        align-items: flex-start;
        flex-direction: row;
    }

    .vertical-ar {
        writing-mode: horizontal-tb;
        font-size: clamp(24px, 8vw, 40px);
        -webkit-text-stroke: 1px rgba(240, 237, 232, 0.2);
    }

    #hero-overlay {
        position: absolute;
        inset: 0;
        padding: 0 20px;
        margin: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-top: -70px;
    }

    .hero-en {
        font-size: 22px;
    }

    .hero-ar {
        font-size: 18px;
    }

    .bottom-bar {
        flex-direction: column;
        gap: 20px;
        align-items: flex-start;
    }

    .footer-item {
        font-size: 13px;
        gap: 8px;
    }

    .footer-email-link {
        font-size: 13px;
    }

    .footer-item svg {
        width: 14px;
        height: 14px;
    }

    .socials {
        flex-wrap: wrap;
        gap: 12px;
    }

    .countdown-wrap {
        gap: 12px;
    }

    #canvas {
        opacity: 0.4;
    }
    
    .social-area{
        align-items: flex-start;
    }
}
