/* ============================================================
   Inshine Clinic — home page
   Design reference: 1920 x 1080 (16:9). RTL Arabic.
   ============================================================ */

@font-face {
    font-family: "Tharwat Emara";
    src: url("../fonts/TharwatEmara.ttf") format("truetype");
    font-weight: normal;
    font-display: swap;
}

:root {
    --brown:       #5b1b00;   /* brand / headline / logo */
    --brown-soft:  #7a3413;
    --ink:         #3a2c20;   /* contact text */
    --cream:       #f7efe4;
    --gold:        #c69c6d;

    /* Design-space helpers: 1vw of a 1920 canvas, 1vh of 1080 */
    --u: clamp(0px, 1.18vw, 1.18vh * 1.777);
}

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

html, body { height: 100%; }

body {
    font-family: "Tharwat Emara", "Segoe UI", Tahoma, sans-serif;
    color: var(--ink);
    background: #efe6d8;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
img { display: block; }

/* ---------- Pinned-stage scaffolding ----------
   The driver is taller than the viewport; the stage sticks while we scroll,
   so states cross-fade "in place" rather than scrolling away.            */
.scroll-driver { height: 300vh; }

.stage {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    /* Background lives on the pinned stage so it never scrolls with the page */
    background: #efe6d8 url("../img/BG.png") center / cover no-repeat;
}

/* ============================================================
   Header
   ============================================================ */
.topbar {
    position: absolute;
    inset: clamp(14px, 2.4vh, 28px) clamp(20px, 3vw, 60px) auto;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    z-index: 40;
}

.brand {
    position: absolute;
    left: 50%;
    top: clamp(-6px, -0.6vh, 0px);
    transform: translateX(-50%);
}
.brand__mark {
    height: clamp(64px, 12vh, 122px);
    width: auto;
}

.topbar__link {
    font-size: clamp(18px, 2.5vh, 30px);
    color: var(--brown);
    font-family: "Tharwat Emara", serif;
    letter-spacing: .5px;
    transition: opacity .2s ease;
    padding-top: clamp(10px, 2.2vh, 26px);
    white-space: nowrap;
}
.topbar__link:hover { opacity: .65; }

/* ============================================================
   Persistent visuals — girl + flowers
   ============================================================ */
.girl {
    position: absolute;
    bottom: 0;
    left: 49%;
    transform: translateX(-50%);
    height: 83vh;
    width: auto;
    z-index: 20;
    pointer-events: none;
    transition: transform .9s cubic-bezier(.22,.61,.36,1);
}

.flowers {
    position: absolute;
    bottom: 0;                   /* start from the bottom... */
    left: 50%;                   /* ...centered behind the girl */
    transform: translateX(-50%);
    height: 82vh;
    width: auto;
    z-index: 15;                 /* behind the girl (20) */
    opacity: .95;
    pointer-events: none;
    transition: transform .9s cubic-bezier(.22,.61,.36,1), opacity .6s ease;
}

/* ============================================================
   State 1 — hero headline
   ============================================================ */
.headline {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    text-align: center;
    color: var(--brown);
    font-family: "Tharwat Emara", serif;
    font-weight: 400;
    font-size: clamp(50px, 7.9vw, 180px);   /* width-based: keeps the long kashida line from clipping */
    line-height: 1;
    letter-spacing: 2px;
    white-space: nowrap;
    z-index: 18;            /* behind the girl (20), in front of flowers (15) */
    will-change: opacity, transform;
}
.headline--m { display: none; }   /* mobile-only variant, shown via media query */

.scroll-cue {
    position: absolute;
    bottom: 9vh;
    left: 50%;
    transform: translateX(-50%);
    width: 26px; height: 42px;
    border: 2px solid var(--brown);
    border-radius: 14px;
    opacity: .55;
    z-index: 30;
    transition: opacity .4s ease;
}
.scroll-cue span {
    position: absolute;
    top: 8px; left: 50%;
    width: 4px; height: 8px;
    margin-left: -2px;
    background: var(--brown);
    border-radius: 2px;
    animation: cue 1.5s ease-in-out infinite;
}
@keyframes cue {
    0%   { opacity: 0; transform: translateY(0); }
    40%  { opacity: 1; }
    100% { opacity: 0; transform: translateY(14px); }
}

/* ============================================================
   State 2 — services · "Arched Atelier"
   ============================================================ */
.services { position: absolute; inset: 0; pointer-events: none; }

/* shared reveal curve for this state */
.svc-veil, .svc-arch, .svc-display, .service-list {
    --svc-in:  clamp(0, calc((var(--p) - .30) / .08), 1);
    --svc-out: clamp(0, calc((.68 - var(--p)) / .08), 1);
}

/* warm depth */
.svc-veil {
    position: absolute; inset: 0; z-index: 9;
    background: radial-gradient(120% 90% at 24% 52%, rgba(247,239,228,0) 42%, rgba(243,231,214,.55) 100%);
    visibility: hidden;
    opacity: min(var(--svc-in), var(--svc-out));
}

/* arched, gold-framed media */
.svc-arch {
    position: absolute;
    left: 5.5vw; top: 12vh;
    height: 80vh; aspect-ratio: 10 / 14; width: auto;
    z-index: 10;
    padding: 10px;
    border-radius: 48% 48% 22px 22px / 30% 30% 4% 4%;
    background: linear-gradient(160deg, rgba(214,184,138,.55), rgba(247,239,228,.25));
    box-shadow: 0 44px 90px -34px rgba(91,27,0,.6), 0 0 0 1px rgba(198,156,109,.55);
    visibility: hidden;
    opacity: min(var(--svc-in), var(--svc-out));
    transform: translateX(-46px);
    transition: transform 1s cubic-bezier(.22,.61,.36,1);
}
.media-box {
    position: relative;
    width: 100%; height: 100%;
    background: var(--brown);
    border-radius: 46% 46% 16px 16px / 29% 29% 3% 3%;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(255,243,223,.3);
}
.media-box img, .media-box video, .media-box iframe {
    width: 100%; height: 100%; object-fit: cover; border: 0; display: block;
}

/* active-service headline */
.svc-display {
    position: absolute;
    right: 41vw; top: 50%;
    transform: translateY(-50%);
    width: 25vw;
    text-align: right; direction: rtl;
    z-index: 25; color: var(--brown);
    visibility: hidden;
    opacity: min(var(--svc-in), var(--svc-out));
}
.svc-eyebrow {
    display: block;
    font-family: "Segoe UI", serif; letter-spacing: .42em;
    font-size: clamp(11px, 1.4vh, 16px); color: var(--gold);
    margin-bottom: .7rem; padding-right: .3em;
}
.svc-index {
    display: block;
    font-family: "Segoe UI", serif; font-weight: 700;
    font-size: clamp(46px, 11vh, 130px); line-height: .85;
    color: transparent; -webkit-text-stroke: 1.4px rgba(198,156,109,.85);
    margin-bottom: .2rem;
}
.svc-title {
    font-family: "Tharwat Emara", serif; font-weight: 400;
    font-size: clamp(30px, 6.2vh, 70px); line-height: 1.1;
}
.svc-tagline {
    margin-top: 1.1rem;
    font-family: "Tharwat Emara", serif;
    font-size: clamp(16px, 2.5vh, 30px); line-height: 1.5;
    color: var(--ink); opacity: .82;
}
.is-swap { animation: svcSwap .55s cubic-bezier(.22,.61,.36,1); }
@keyframes svcSwap { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* editorial numbered menu */
.service-list {
    position: absolute;
    right: 5vw; top: 50%;
    width: 30vw;
    list-style: none;
    transform: translateY(-50%) translateX(40px);
    transition: transform 1s cubic-bezier(.22,.61,.36,1);
    z-index: 26;
    visibility: hidden;
    opacity: min(var(--svc-in), var(--svc-out));
}
.service-list li { margin: 0; }
.service-list__item {
    width: 100%;
    background: none; border: 0; cursor: pointer;
    display: flex; align-items: baseline; gap: 1rem;
    direction: rtl; text-align: right;
    padding: clamp(8px, 1.7vh, 20px) .4rem;
    border-bottom: 1px solid rgba(123,52,19,.18);
    color: var(--brown);
    position: relative;
    transition: padding .3s ease, color .3s ease, border-color .3s ease;
}
.svc-no {
    flex: none; min-width: 2.6em;
    font-family: "Segoe UI", serif;
    font-size: clamp(13px, 1.7vh, 20px); color: var(--gold);
    transition: color .3s ease;
}
.svc-name {
    flex: 1;
    font-family: "Tharwat Emara", serif;
    font-size: clamp(20px, 3.5vh, 42px); line-height: 1.1;
}
.service-list__item::before {
    content: ""; position: absolute; right: -.45rem; top: 50%;
    width: 3px; height: 0; border-radius: 3px;
    background: var(--gold);
    transform: translateY(-50%);
    transition: height .35s ease;
}
.service-list__item:hover { padding-right: 1.1rem; color: #7a3413; }
.service-list__item:hover { border-color: rgba(198,156,109,.6); }
.service-list__item[aria-current="true"] { padding-right: 1.5rem; }
.service-list__item[aria-current="true"]::before { height: 66%; }
.service-list__item[aria-current="true"] .svc-name { color: #5b1b00; }
.service-list__item[aria-current="true"] .svc-no   { color: #7a3413; }

/* ============================================================
   Contact (persistent)
   ============================================================ */
.contact {
    position: absolute;
    right: clamp(20px, 3vw, 60px);
    bottom: clamp(12px, 2.4vh, 30px);
    text-align: right;
    z-index: 35;
    color: var(--ink);
}
.contact__line {
    font-family: "Tharwat Emara", serif;
    font-size: clamp(13px, 1.7vh, 21px);
    line-height: 1.7;
    white-space: nowrap;
}
.contact__line--ltr { direction: ltr; text-align: right; font-family: "Segoe UI", serif; letter-spacing: .5px; }
.contact__line .sep { color: var(--gold); margin: 0 .35em; }
.contact__line a { color: inherit; transition: color .2s ease; }
.contact__line a:hover { color: var(--brown); }

/* ============================================================
   State 3 — contact us · "Reservation Card"
   ============================================================ */
.contact-us {
    position: absolute; inset: 0;
    z-index: 26; color: var(--brown);
    visibility: hidden; pointer-events: none;
    --cu-in: clamp(0, calc((var(--p) - .62) / .08), 1);
}
.cu-veil {
    position: absolute; inset: 0; z-index: 1;
    background: linear-gradient(105deg, rgba(40,16,2,.42) 0%, rgba(40,16,2,.1) 40%, transparent 64%);
    opacity: var(--cu-in);
}
.cu-watermark {
    position: absolute; left: -3vw; top: 50%; transform: translateY(-50%);
    width: 52vh; height: 52vh; z-index: 2;
    -webkit-mask: url("../img/Logo.svg") center / contain no-repeat;
            mask: url("../img/Logo.svg") center / contain no-repeat;
    background: rgba(214,184,138,.18);
    opacity: var(--cu-in);
}
.cu-card {
    position: absolute;
    left: 6vw; top: 50%;
    transform: translateY(-50%) translateX(-46px);
    width: min(42vw, 580px);
    z-index: 3;
    padding: clamp(24px, 4.2vh, 56px) clamp(26px, 3vw, 58px);
    border-radius: 28px;
    background: rgba(247,239,228,.5);
    -webkit-backdrop-filter: blur(16px) saturate(1.25);
            backdrop-filter: blur(16px) saturate(1.25);
    border: 1px solid rgba(214,184,138,.55);
    box-shadow: 0 50px 92px -40px rgba(46,17,2,.62), inset 0 0 0 1px rgba(255,255,255,.3);
    text-align: right; direction: rtl;
    opacity: var(--cu-in);
    transition: transform 1s cubic-bezier(.22,.61,.36,1);
}
.cu-eyebrow {
    display: block;
    font-family: "Segoe UI", serif; letter-spacing: .4em;
    font-size: clamp(10px, 1.3vh, 14px); color: var(--gold);
    margin-bottom: .5rem; padding-right: .2em;
}
.contact-us__title {
    font-family: "Tharwat Emara", serif; font-weight: 400;
    font-size: clamp(34px, 6.6vh, 78px); line-height: 1;
    color: var(--brown); margin: 0;
}
.cu-rule {
    display: block; height: 1px;
    margin: clamp(13px, 2.4vh, 26px) 0;
    background: linear-gradient(90deg, rgba(198,156,109,.75), transparent);
}
.contact-us__list {
    list-style: none; display: flex; flex-direction: column;
    gap: clamp(10px, 1.9vh, 24px);
}
.contact-us__item a {
    display: flex; align-items: center;
    gap: clamp(10px, 1vw, 16px);
    direction: ltr;
    font-family: "Segoe UI", serif;
    font-size: clamp(15px, 2.3vh, 25px);
    color: var(--ink);
    transition: color .2s ease, transform .2s ease;
}
.contact-us__item a:hover { color: var(--brown); transform: translateX(5px); }
.contact-us__item--loc a { font-size: clamp(14px, 2vh, 22px); }
.contact-us__item--loc .contact-us__text {
    direction: rtl; font-family: "Tharwat Emara", serif; line-height: 1.4;
}
.contact-us__icon {
    flex: none;
    width: clamp(34px, 4.8vh, 54px); height: clamp(34px, 4.8vh, 54px);
    display: grid; place-items: center;
    padding: clamp(8px, 1.2vh, 14px);
    background: var(--brown); color: var(--cream);
    border-radius: 50%;
    transition: box-shadow .3s ease;
}
.contact-us__icon svg { width: 100%; height: 100%; display: block; }

/* primary call-to-action */
.cu-cta {
    display: inline-flex; align-items: center; justify-content: center;
    margin-top: .5rem;
    padding: clamp(12px, 1.9vh, 19px) clamp(30px, 3.2vw, 52px);
    border-radius: 40px;
    background: linear-gradient(120deg, #7a3413, #5b1b00);
    color: var(--cream);
    font-family: "Tharwat Emara", serif;
    font-size: clamp(18px, 2.7vh, 31px); letter-spacing: .5px;
    box-shadow: 0 16px 32px -12px rgba(91,27,0,.6), inset 0 0 0 1px rgba(214,184,138,.4);
    position: relative; overflow: hidden;
    transition: transform .3s ease, box-shadow .3s ease;
}
.cu-cta:hover { transform: translateY(-2px); box-shadow: 0 22px 44px -14px rgba(91,27,0,.72), inset 0 0 0 1px rgba(214,184,138,.75); }
.cu-cta > span { position: relative; z-index: 2; }
.cu-cta::after {
    content: ""; position: absolute; inset: 0; z-index: 1;
    background: linear-gradient(120deg, transparent 40%, rgba(255,243,223,.4) 50%, transparent 60%);
    transform: translateX(-130%);
}
.cu-cta:hover::after { animation: cuSweep .9s ease; }
@keyframes cuSweep { to { transform: translateX(130%); } }

/* ============================================================
   Scroll-driven transition (added by JS via custom property --p 0→1)
   We fade the hero out and the services in around the midpoint.
   ============================================================ */
.stage {
    --p: 0;
}
.headline {
    opacity: clamp(0, calc((.26 - var(--p)) / .07), 1);
    transform: translate(-50%, calc(-50% - var(--p) * 4vh)) scale(calc(1 - var(--p) * .05));
}
.scroll-cue { opacity: calc(.55 - var(--p) * 4); }

/* State 2 (services) — reveal the atelier, slide the girl off to the right */
.stage.is-services .svc-veil,
.stage.is-services .svc-arch,
.stage.is-services .svc-display,
.stage.is-services .service-list { visibility: visible; }
.stage.is-services .svc-arch     { transform: translateX(0); pointer-events: auto; }
.stage.is-services .service-list { transform: translateY(-50%) translateX(0); pointer-events: auto; }
.stage.is-services .girl    { transform: translateX(calc(-50% + 82vw)); }
.stage.is-services .flowers { transform: translateX(calc(-50% + 30vw)) translateY(13vh) scale(.72) rotate(8deg); }

/* State 3 (contact) — reveal the reservation card, bring the girl back as a backdrop.
   (After the is-services rules so they win during the crossfade.) */
.stage.is-contact .contact-us { visibility: visible; pointer-events: auto; }
.stage.is-contact .cu-card    { transform: translateY(-50%) translateX(0); }
.stage.is-contact .girl    { transform: translateX(calc(-50% + 26vw)) scale(1.04); }
.stage.is-contact .flowers { transform: translateX(calc(-50% + 26vw)) scale(1.03); }

/* ============================================================
   Mobile / portrait — normal stacked scroll, no pinning
   ============================================================ */
@media (max-width: 820px), (orientation: portrait) {
    .scroll-driver { height: auto; }
    .stage {
        position: static;
        height: auto;
        min-height: 100svh;
        overflow: visible;
        padding-bottom: 4rem;
        --p: 0 !important;
    }

    /* ---- header becomes a compact top bar ---- */
    .topbar {
        position: relative;
        inset: auto;
        padding: 14px 16px 0;
        align-items: center;
    }
    .brand { position: static; transform: none; margin: 0 auto; order: 2; }
    .brand__mark { height: 78px; }
    .topbar__link { font-size: 16px; padding-top: 0; }
    .topbar__link--book { order: 1; }
    .topbar__link--file { order: 3; }

    /* ---- hero block ---- */
    .girl {
        position: relative;
        left: auto; transform: none;
        height: auto;
        width: min(86vw, 380px);
        margin: 1.5rem auto 0;
    }
    .flowers {
        top: 14rem; bottom: auto; left: auto; right: 2vw;
        height: 22vh;
        opacity: .9;
        transform: none !important;
    }
    .headline--d { display: none; }      /* hide elongated variant on mobile */
    .headline--m { display: block; }     /* show normal variant */
    .headline {
        position: relative;
        top: auto; left: auto;
        transform: none !important;
        opacity: 1 !important;
        font-size: clamp(40px, 13vw, 84px);
        margin: 1.2rem auto 0;
        z-index: 22;
        white-space: normal;
    }
    .scroll-cue { display: none; }

    /* ---- services: stacked "atelier" ---- */
    .services {
        position: relative; inset: auto;
        pointer-events: auto !important;
        margin-top: 2.5rem; padding: 0 18px;
    }
    .svc-veil { display: none; }
    .svc-arch {
        position: relative; left: auto; top: auto;
        width: 86%; max-width: 360px; height: auto; aspect-ratio: 10 / 13;
        margin: 0 auto 1.6rem;
        transform: none !important;
        visibility: visible !important; opacity: 1 !important;
    }
    .svc-display {
        position: relative; right: auto; top: auto;
        transform: none !important; width: 100%; text-align: center;
        visibility: visible !important; opacity: 1 !important;
        margin-bottom: 1.2rem;
    }
    .svc-index { font-size: clamp(40px, 16vw, 80px); }
    .svc-title { font-size: clamp(26px, 8vw, 44px); }
    .service-list {
        position: relative; right: auto; top: auto;
        transform: none !important; width: 100%;
        visibility: visible !important; opacity: 1 !important;
    }
    .service-list__item { padding: 12px .2rem; }
    .svc-name { font-size: clamp(20px, 6vw, 30px); }

    /* ---- contact: card in flow ---- */
    .contact-us {
        position: relative; inset: auto;
        visibility: visible !important; pointer-events: auto !important;
        margin: 2.5rem 18px 0;
    }
    .cu-veil, .cu-watermark { display: none; }
    .cu-card {
        position: relative; left: auto; top: auto;
        transform: none !important; width: 100%; opacity: 1 !important;
        -webkit-backdrop-filter: none; backdrop-filter: none;
        background: rgba(247,239,228,.72);
    }
    .contact-us__title { font-size: clamp(32px, 9vw, 52px); }
    .contact-us__item a { font-size: clamp(15px, 4.4vw, 21px); }
    .contact-us__icon { width: clamp(38px, 11vw, 50px); height: clamp(38px, 11vw, 50px); padding: 10px; }
    .cu-cta { width: 100%; }

    /* ---- contact in flow ---- */
    .contact {
        position: relative;
        right: auto; bottom: auto;
        margin: 2.5rem 18px 0;
        text-align: center;
    }
    .contact__line { white-space: normal; }
    .contact__line--ltr { text-align: center; }
}

/* (reduced-motion handling intentionally disabled — animations always play) */
