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

/* SAFETY NET — no image can ever force horizontal overflow on any screen,
   even if a future asset is added without a matching responsive rule. */
img{
    max-width:100%;
}

.nav-container{
    max-width:1200px;
    margin:auto;
    display:flex;
    flex-wrap:nowrap;
    justify-content:space-between;
    align-items:center;
    /* Nav's physical arrangement stays fixed (logo left, icons right)
       regardless of page language, so switching to Arabic never
       re-mirrors the header — only the page content below mirrors. */
    direction:ltr;
}

.nav-left a{
    display:inline-flex;
    align-items:center;
    line-height:0;
}

.nav-left a:hover img{
    transform:scale(1.08);
    filter:drop-shadow(0 8px 18px rgba(31,37,80,0.25));
}

.nav-left img{
    height:48px;
    transition:transform 0.35s ease, filter 0.35s ease;
}

@media(max-width:768px){
    .nav-left img{
        height:38px;
    }
}

@media(max-width:480px){
    nav{
        padding:14px 16px;
    }

    .nav-left img{
        height:32px;
    }
}

.nav-right{
    display:flex;
    flex-wrap:nowrap;
    align-items:center;
    gap:15px;
}

@media(max-width:768px){
    .nav-right{
        gap:10px;
    }
    .nav-icon{
        width:38px;
        height:38px;
        font-size:16px;
    }
    .lang-toggle{
        height:38px;
        padding:0 14px;
        font-size:12px;
    }
    .theme-toggle{
        height:38px;
        width:38px;
        font-size:14px;
    }
}

@media(max-width:480px){
    .nav-right{
        gap:6px;
    }
    .nav-icon{
        width:32px;
        height:32px;
        font-size:14px;
        border-radius:9px;
    }
    .lang-toggle{
        height:32px;
        padding:0 10px;
        font-size:11px;
        border-radius:9px;
    }
    .theme-toggle{
        height:32px;
        width:32px;
        font-size:12px;
        border-radius:9px;
    }
}

@media(max-width:360px){
    .nav-container{
        gap:6px;
    }
    .nav-right{
        gap:5px;
    }
    .nav-icon,
    .theme-toggle{
        width:28px;
        height:28px;
        font-size:12px;
    }
    .lang-toggle{
        height:28px;
        padding:0 8px;
        font-size:10px;
    }
}

/* ANIMATED HEADER ICONS */
.nav-icon {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #fff;
    font-size: 20px;
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.nav-icon.email {
    background: #4fb9c2;
    animation: iconPulseEmail 2s infinite;
}

.nav-icon.linkedin {
    background: #0a66c2;
    animation: iconPulseLinkedin 2s infinite;
}

.nav-icon:hover {
    transform: translate(var(--mx,0px), var(--my,0px)) scale(1.15) rotate(5deg);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* THEME TOGGLE BUTTON — mirrors .lang-toggle sizing/behavior */
.theme-toggle {
    height: 45px;
    width: 45px;
    padding: 0;
    border: none;
    border-radius: 12px;
    background: #1f2550;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.theme-toggle:hover {
    transform: translate(var(--mx,0px), var(--my,0px)) scale(1.08);
    background: #ff00aa;
}

/* MAGNETIC BUTTONS — JS sets --mx/--my (pull offset in px) on mousemove;
   this transition just smooths the pull and the snap-back on mouseleave. */
.magnetic-btn{
    --mx:0px;
    --my:0px;
    transform:translate(var(--mx), var(--my));
    transition:transform 0.25s cubic-bezier(0.2,0.8,0.2,1);
}

@keyframes iconPulseEmail {
    0% { box-shadow: 0 0 0 0 rgba(79, 185, 194, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(79, 185, 194, 0); }
    100% { box-shadow: 0 0 0 0 rgba(79, 185, 194, 0); }
}

@keyframes iconPulseLinkedin {
    0% { box-shadow: 0 0 0 0 rgba(10, 102, 194, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(10, 102, 194, 0); }
    100% { box-shadow: 0 0 0 0 rgba(10, 102, 194, 0); }
}

/* HERO WITH VIDEO */
.hero{
    position:relative;
    min-height:100vh;
    display:flex;
    flex-direction:column;
    justify-content:center;
    align-items:center;
    text-align:center;
    padding:140px 20px 40px;
    overflow:hidden;
}

/* VIDEO */
.hero video{
    position:absolute;
    top:0;
    left:0;
    width:100%;
    height:100%;
    object-fit:cover;
    z-index:-2;
}

/* OVERLAY */
.hero::after{
    content:"";
    position:absolute;
    width:100%;
    height:100%;
    top:0;
    left:0;
    background:rgba(247,249,252,0.75);
    z-index:-1;
}

@keyframes float{
    50%{transform:translateY(-15px);}
}

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

.coming h1{
    font-size:30px;
    margin-bottom:15px;
    font-weight:700;
}

/* Default section heading style.
   Excludes any heading using the animated brand-shimmer treatment
   (About Melodies, Why Work With Melodies, capability, contact, etc.)
   so the underline bar below doesn't clash with those gradient headings. */
section h2:not(.why-melodies-heading):not(.about-shimmer-heading):not(.capability-content h2):not(.contact-form-panel h2) {
    font-size: 40px;
    margin-bottom: 50px;
    position: relative;
    display: inline-block;
    color: #1f2550;
}

section h2:not(.why-melodies-heading):not(.about-shimmer-heading):not(.capability-content h2):not(.contact-form-panel h2)::after {
    content: '';
    position: absolute;
    width: 60%;
    height: 4px;
    background: #ff00aa;
    bottom: -10px;
    left: 20%;
    border-radius: 2px;
}

/* Logo Color Variables
   Updated to match the current Melodies brand palette used across the site
   (previously held an older/legacy palette that silently overrode every
   var(--logo-*, fallback) reference elsewhere in the codebase). */
:root {
    --logo-green: #85BB33;
    --logo-purple: #913791;
    --logo-pink: #ff00aa;
    --logo-blue: #4fb9c2;
    --logo-orange: #ffad27;
    --wave-bg: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20viewBox%3D%270%200%201200%20200%27%20preserveAspectRatio%3D%27none%27%3E%3Cpath%20d%3D%27M0.0%2C70.0%20C150.0%2C70.0%20150.0%2C25.0%20300.0%2C25.0%20C450.0%2C25.0%20450.0%2C70.0%20600.0%2C70.0%20C750.0%2C70.0%20750.0%2C115.0%20900.0%2C115.0%20C1050.0%2C115.0%201050.0%2C70.0%201200.0%2C70.0%27%20fill%3D%27none%27%20stroke%3D%27%23e33069%27%20stroke-width%3D%273%27%20stroke-linecap%3D%27round%27%20stroke-opacity%3D%270.3%27/%3E%3Cpath%20d%3D%27M0.0%2C95.0%20C150.0%2C95.0%20150.0%2C57.0%20300.0%2C57.0%20C450.0%2C57.0%20450.0%2C95.0%20600.0%2C95.0%20C750.0%2C95.0%20750.0%2C133.0%20900.0%2C133.0%20C1050.0%2C133.0%201050.0%2C95.0%201200.0%2C95.0%27%20fill%3D%27none%27%20stroke%3D%27%234fb9c2%27%20stroke-width%3D%273%27%20stroke-linecap%3D%27round%27%20stroke-opacity%3D%270.3%27/%3E%3Cpath%20d%3D%27M0.0%2C110.0%20C75.0%2C110.0%2075.0%2C90.0%20150.0%2C90.0%20C225.0%2C90.0%20225.0%2C110.0%20300.0%2C110.0%20C375.0%2C110.0%20375.0%2C130.0%20450.0%2C130.0%20C525.0%2C130.0%20525.0%2C110.0%20600.0%2C110.0%20C675.0%2C110.0%20675.0%2C90.0%20750.0%2C90.0%20C825.0%2C90.0%20825.0%2C110.0%20900.0%2C110.0%20C975.0%2C110.0%20975.0%2C130.0%201050.0%2C130.0%20C1125.0%2C130.0%201125.0%2C110.0%201200.0%2C110.0%27%20fill%3D%27none%27%20stroke%3D%27%23ffad27%27%20stroke-width%3D%273%27%20stroke-linecap%3D%27round%27%20stroke-opacity%3D%270.3%27/%3E%3Cpath%20d%3D%27M0.0%2C130.0%20C150.0%2C130.0%20150.0%2C100.0%20300.0%2C100.0%20C450.0%2C100.0%20450.0%2C130.0%20600.0%2C130.0%20C750.0%2C130.0%20750.0%2C160.0%20900.0%2C160.0%20C1050.0%2C160.0%201050.0%2C130.0%201200.0%2C130.0%27%20fill%3D%27none%27%20stroke%3D%27%23913791%27%20stroke-width%3D%273%27%20stroke-linecap%3D%27round%27%20stroke-opacity%3D%270.3%27/%3E%3Cpath%20d%3D%27M0.0%2C120.0%20C75.0%2C120.0%2075.0%2C98.0%20150.0%2C98.0%20C225.0%2C98.0%20225.0%2C120.0%20300.0%2C120.0%20C375.0%2C120.0%20375.0%2C142.0%20450.0%2C142.0%20C525.0%2C142.0%20525.0%2C120.0%20600.0%2C120.0%20C675.0%2C120.0%20675.0%2C98.0%20750.0%2C98.0%20C825.0%2C98.0%20825.0%2C120.0%20900.0%2C120.0%20C975.0%2C120.0%20975.0%2C142.0%201050.0%2C142.0%20C1125.0%2C142.0%201125.0%2C120.0%201200.0%2C120.0%27%20fill%3D%27none%27%20stroke%3D%27%2385bb33%27%20stroke-width%3D%273%27%20stroke-linecap%3D%27round%27%20stroke-opacity%3D%270.3%27/%3E%3C/svg%3E");
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--card-color, #ff00aa) 0%, transparent 100%);
    opacity: 0;
    transition: 0.4s;
}

.service-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    border-color: var(--card-color, #ff00aa);
}

.service-card:hover::before {
    opacity: 0.08;
}

.service-icon-wrap{
    position:relative;
    width:130px;
    height:130px;
    margin:0 auto 25px;
    display:flex;
    align-items:center;
    justify-content:center;
}

.service-icon-ring{
    position:absolute;
    inset:0;
    border-radius:50%;
    border:2px solid color-mix(in srgb, var(--card-color, #ff00aa) 40%, transparent);
    opacity:0;
    transform:scale(0.7);
    transition:opacity 0.4s ease, transform 0.45s cubic-bezier(0.34,1.56,0.64,1);
}

.service-card:hover .service-icon-ring{
    opacity:1;
    transform:scale(1.28);
}

.service-icon {
    position:relative;
    z-index:1;
    width: 96px;
    height: 96px;
    background: color-mix(in srgb, var(--card-color, #ff00aa) 12%, transparent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: var(--card-color, #ff00aa);
    transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1), background 0.35s ease;
}

.service-card:hover .service-icon {
    transform: scale(1.12) rotate(10deg);
    background: color-mix(in srgb, var(--card-color, #ff00aa) 22%, transparent);
}

.portfolio-item {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    height: 350px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    cursor: pointer;
    background: #eee;
    border: 2px solid transparent;
    transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}

.portfolio-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--accent, #ff00aa) 0%, transparent 100%);
    opacity: 0;
    transition: 0.4s;
    z-index: 1;
    pointer-events: none;
}

.portfolio-item:hover {
    transform: translateY(-12px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    border-color: var(--accent, #ff00aa);
}

.portfolio-item:hover::before {
    opacity: 0.18;
}

.portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.2, 1, 0.3, 1);
}

.portfolio-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(31, 37, 80, 0.9), transparent);
    opacity: 0;
    display: flex;
    align-items: flex-end;
    padding: 30px;
    transition: 0.4s ease;
}

.portfolio-item:hover img {
    transform: scale(1.15);
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}

.overlay-content {
    color: #fff;
    transform: translateY(20px);
    transition: 0.4s 0.1s ease;
}

.portfolio-item:hover .overlay-content {
    transform: translateY(0);
}

.overlay-content h4 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 5px;
}

.overlay-content p {
    font-size: 14px;
    opacity: 0.8;
}

.contact-card::before{
    content:'';
    position:absolute;
    inset:0;
    background:radial-gradient(circle at 15% 15%, rgba(255,255,255,0.14), transparent 55%);
    pointer-events:none;
}

.contact-card h2{
    position:relative;
    font-size:32px;
    margin-bottom:32px;
    color:#fff;
}

/* WHATSAPP */
.whatsapp-float{
    position:fixed;
    bottom:25px;
    right:25px;
    width:65px;
    height:65px;
    background:#25d366;
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    z-index:999;
    box-shadow:0 10px 25px rgba(0,0,0,0.2);
    animation:pulse 2s infinite;
    text-decoration: none;
}

.whatsapp-float img{
    width:32px;
}

/* Pulse Animation */
@keyframes pulse{
    0%{box-shadow:0 0 0 0 rgba(37,211,102,0.6);}
    70%{box-shadow:0 0 0 15px rgba(37,211,102,0);}
    100%{box-shadow:0 0 0 0 rgba(37,211,102,0);}
}

/* FOOTER */
footer{
    text-align:center;
    padding:40px 20px;
    color:#6b6b6b;
    background: #fff;
    margin-top: 50px;
}

/* LANGUAGE TOGGLE */
.lang-toggle{
    height:45px;
    padding:0 20px;
    border:none;
    border-radius:12px;
    background:#1f2550;
    color:#fff;
    font-family:inherit;
    font-weight:700;
    font-size:14px;
    cursor:pointer;
    display:flex;
    align-items:center;
    justify-content:center;
    flex-shrink:0;
    white-space:nowrap;
    transition:0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.lang-toggle:hover{
    transform:translate(var(--mx,0px), var(--my,0px)) scale(1.08);
    background:#ff00aa;
}

/* ARABIC / RTL SUPPORT */
html[dir="rtl"] body{
    font-family:'Cairo', 'Poppins', sans-serif;
}

/* PRELOADER MARK v2 — shared by every page (choreography + sound in
   /assets/js/preloader.js). Selectors are more specific than each page's original
   inline .pl-stroke rules so these win, and target the classes the SVG paths
   really carry (s1–s5 — the old .pl-s1… delays never matched).
   1) draw-in: each colour pair grows out from its base in sequence, with a
      slight twist and overshoot
   2) rhythm: once drawn, the strokes breathe like equalizer bars in a wave
   3) beats (homepage intro): the mark thumps, glows in the word's colour
      and sends out a ripple ring (classes/elements added by preloader.js) */
.site-preloader .preloader-mark .pl-stroke{
    opacity:0;
    transform:scale(0) rotate(-10deg);
    animation:pl2-draw 0.62s cubic-bezier(0.22,1.35,0.36,1) both,
              pl2-eq 1.5s ease-in-out infinite;
}
.site-preloader .preloader-mark .s1{ animation-delay:0s, 1.00s; }
.site-preloader .preloader-mark .s2{ animation-delay:0.12s, 1.12s; }
.site-preloader .preloader-mark .s3{ animation-delay:0.24s, 1.24s; }
.site-preloader .preloader-mark .s4{ animation-delay:0.36s, 1.36s; }
.site-preloader .preloader-mark .s5{ animation-delay:0.48s, 1.48s; }
@keyframes pl2-draw{
    0%{ opacity:0; transform:scale(0) rotate(-10deg); }
    55%{ opacity:1; }
    100%{ opacity:1; transform:scale(1) rotate(0); }
}
@keyframes pl2-eq{
    0%, 100%{ transform:scale(1); }
    50%{ transform:scale(0.84); }
}
.site-preloader .pl-beat{
    transform-box:fill-box;
    transform-origin:center;
}
.site-preloader .pl-beat.pl-thump{
    animation:pl2-thump 0.45s cubic-bezier(0.3,1.6,0.5,1);
}
@keyframes pl2-thump{
    0%{ transform:scale(1); }
    30%{ transform:scale(1.09); }
    100%{ transform:scale(1); }
}
.site-preloader .preloader-mark{
    transition:filter 0.45s ease;
}
.pl-ripple{
    position:fixed;
    width:120px;
    height:120px;
    margin:-60px 0 0 -60px;
    border:2px solid #ff00aa;
    border-radius:50%;
    pointer-events:none;
    opacity:0.55;
    transform:scale(0.6);
    animation:pl2-ripple 0.9s cubic-bezier(0.2,0.7,0.3,1) forwards;
}
@keyframes pl2-ripple{
    to{ transform:scale(2.6); opacity:0; }
}
/* service pages: the mark lifts and fades out with the overlay (the
   homepage instead flies it into the nav logo — .pl-morph) */
.site-preloader.pl-hide:not(.pl-morph) .preloader-mark{
    transform:scale(1.18);
    opacity:0;
    transition:transform 0.55s cubic-bezier(0.65,0,0.35,1), opacity 0.4s ease;
}
@media (prefers-reduced-motion: reduce){
    .site-preloader .preloader-mark .pl-stroke{ animation:none; opacity:1; transform:none; }
    .site-preloader .pl-beat.pl-thump{ animation:none; }
    .pl-ripple{ display:none; }
}

/* HOMEPAGE → VIDEOS PAGE link, under the cinematic showcase player */
.cinema-cta{
    text-align:center;
    margin-top:34px;
}
.cinema-cta-btn{
    display:inline-flex;
    align-items:center;
    gap:10px;
    padding:15px 34px;
    border-radius:40px;
    background:#1f2550;
    color:#fff;
    font-weight:700;
    font-size:15px;
    text-decoration:none;
    box-shadow:0 12px 28px rgba(31,37,80,0.25);
    transition:transform 0.3s cubic-bezier(0.34,1.56,0.64,1), background 0.3s, box-shadow 0.3s;
    transform:translate(var(--mx,0px), var(--my,0px));
}
.cinema-cta-btn:hover,
.cinema-cta-btn:focus-visible{
    background:#c0007f;
    box-shadow:0 16px 34px rgba(192,0,127,0.35);
    transform:translate(var(--mx,0px), var(--my,0px)) translateY(-3px);
}
html[data-theme="dark"] .cinema-cta-btn{
    background:#c0007f;
}
html[data-theme="dark"] .cinema-cta-btn:hover,
html[data-theme="dark"] .cinema-cta-btn:focus-visible{
    background:#e0009a;
}

/* TYPEWRITER HEADINGS — the not-yet-typed remainder stays in the DOM (for
   search engines and screen readers) but is invisible until typed. The
   cursor span is empty; its line height comes from a zero-width pseudo
   character so no stray space ever appears inside the heading text. */
.type-rest{
    visibility:hidden;
}
.type-cursor:empty::before{
    content:"\200b";
}
html[data-theme="dark"] .heading-emphasis .type-cursor{
    background:#eef0fa;
}

/* READABILITY (WCAG AA contrast) — small text in brand tints was too faint
   on light backgrounds. `html` prefix lets these win over the homepage's
   inline <style>, which loads after this file. Brand hues are kept, just
   deepened for text; decorative uses of the colours are untouched. */
html .cinema-eyebrow,
html .ksa-map-eyebrow,
html .impact-globe-eyebrow{
    color:#4e7419;
}
html .national-card .national-subtitle{
    color:#6b6b6b;
}
html .national-card[style*="#4fb9c2"] h3{
    color:#2c8f9b;
}
