/* ElegArch home page — motion and interaction layer.
 *
 * Every effect here is switched on by a class on <html> (fx-progress, fx-hero, …)
 * that js/home-fx.js adds, so an effect that is switched off leaves the page
 * exactly as it was. Nothing in css/styles.css or the page's own styles is changed.
 *
 *   fx-progress   scroll progress bar under the top edge
 *   fx-header     header is see-through over the hero, solid once you scroll
 *   fx-hero       hero entrance: eyebrow line, words rising one by one, second button, scroll cue
 *   fx-parallax   hero picture drifts and the text fades as you scroll away
 *   fx-journey    journey steps react to hover / tap and show a detail panel
 *   fx-about      About text and picture slide in from the sides
 *   fx-boq        cost-estimate preview with a quality-tier switch
 *   fx-smart      smart-home hub: nodes react and show a status line
 *   fx-portfolio  portfolio filter animates
 *   fx-cards      "Why us" and "Values" cards appear one after another
 *   fx-titles     the line under section titles draws itself
 */

:root{--fx-ease:cubic-bezier(.22,1,.36,1);--fx-bronze:#A68868;--fx-champagne:#E3C39D;--fx-navy:#071739}

/* ── progress bar ───────────────────────────────────────────────────────── */
.fx-bar{display:none}
.fx-progress .fx-bar{display:block;position:fixed;top:0;left:0;right:0;height:3px;z-index:1100;transform-origin:left center;transform:scaleX(0);
  background:linear-gradient(90deg,var(--fx-bronze),var(--fx-champagne),var(--fx-bronze));pointer-events:none}
html[dir=rtl].fx-progress .fx-bar{transform-origin:right center}

/* ── header over the hero (desktop layout only: the phone menu keeps its own look) ── */
@media(min-width:769px){
  .fx-header header{transition:background-color .45s ease,box-shadow .45s ease,padding .45s ease}
  .fx-header header:not(.scrolled):not(.fx-solid){background-color:transparent;box-shadow:none}
  .fx-header header:not(.scrolled):not(.fx-solid) .nav-menu ul li a{color:#fff}
  .fx-header header:not(.scrolled):not(.fx-solid) .nav-menu ul li a:hover{color:var(--fx-champagne)}
  .fx-header header:not(.scrolled):not(.fx-solid) .lang-toggle-btn{color:#fff;border-color:rgba(255,255,255,.55);background:transparent}
  .fx-header header:not(.scrolled):not(.fx-solid) .btn-login{color:#fff;border-color:rgba(255,255,255,.6);background:transparent}
  .fx-header header:not(.scrolled):not(.fx-solid) .user-menu-trigger{color:#fff}
  .fx-header header:not(.scrolled):not(.fx-solid) .user-menu-trigger .user-name{color:#fff}
  .fx-header header.scrolled{background-color:rgba(255,255,255,.93);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}
  .fx-header header .nav-menu ul li a{position:relative}
  .fx-header header .nav-menu ul li a::after{content:'';position:absolute;left:0;right:0;bottom:-4px;height:1.5px;background:var(--fx-bronze);
    transform:scaleX(0);transform-origin:left center;transition:transform .3s var(--fx-ease)}
  html[dir=rtl].fx-header header .nav-menu ul li a::after{transform-origin:right center}
  .fx-header header .nav-menu ul li a:hover::after,.fx-header header .nav-menu ul li a:focus-visible::after{transform:scaleX(1)}
}

/* ── hero entrance ──────────────────────────────────────────────────────── */
.fx-eyebrow,.fx-cta2,.fx-scroll{display:none}
.fx-hero .hero{overflow:hidden}
.fx-hero .hero-overlay{background:linear-gradient(135deg,rgba(5,16,42,.86) 0%,rgba(7,23,57,.62) 55%,rgba(166,136,104,.3) 100%)}
.fx-hero .fx-eyebrow{display:inline-flex;align-items:center;gap:12px;margin:0 0 22px;font-size:.72rem;font-weight:600;letter-spacing:.28em;text-transform:uppercase;color:var(--fx-champagne)}
html[lang=ar].fx-hero .fx-eyebrow{letter-spacing:.06em;font-size:.86rem}
.fx-hero .fx-eyebrow::before,.fx-hero .fx-eyebrow::after{content:'';width:38px;height:1px;background:rgba(227,195,157,.8)}
.fx-hero .hero h1{font-size:clamp(2.6rem,6.2vw,5.2rem);line-height:1.08;letter-spacing:-.01em}
.fx-hero .hero h1 .fx-w{display:inline-block;overflow:hidden;vertical-align:bottom;padding-bottom:.08em}
.fx-hero .hero h1 .fx-w>span{display:inline-block;transform:translateY(105%);opacity:0;animation:fx-rise .85s var(--fx-ease) forwards}
.fx-hero .hero h1 .fx-w:nth-child(2)>span{animation-delay:.14s}
.fx-hero .hero h1 .fx-w:nth-child(3)>span{animation-delay:.28s}
.fx-hero .hero h1 .fx-w:nth-child(4)>span{animation-delay:.42s}
.fx-hero .hero h1 .fx-w:last-child:not(:first-child)>span{color:var(--fx-champagne)}
.fx-hero .hero-content>.fx-eyebrow{opacity:0;animation:fx-up .7s var(--fx-ease) forwards}
.fx-hero .hero-content>p[data-i18n]{opacity:0;animation:fx-up .85s var(--fx-ease) .45s forwards;max-width:620px;margin-left:auto;margin-right:auto;line-height:1.7}
.fx-hero .fx-actions{display:flex;flex-wrap:wrap;gap:14px;justify-content:center;align-items:center;opacity:0;animation:fx-up .85s var(--fx-ease) .62s forwards}
.fx-hero .fx-actions .btn{border-radius:50px;padding:14px 32px;letter-spacing:.06em;margin:0}
.fx-hero .fx-actions .btn:hover{background-color:var(--fx-champagne);color:var(--fx-navy)}
.fx-hero .fx-cta2{display:inline-flex;align-items:center;gap:8px;border-radius:50px;padding:13px 28px;font-weight:500;letter-spacing:.06em;color:#fff;text-decoration:none;
  border:1px solid rgba(255,255,255,.38);background:rgba(255,255,255,.1);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);transition:border-color .3s,color .3s,transform .3s}
.fx-hero .fx-cta2:hover,.fx-hero .fx-cta2:focus-visible{border-color:var(--fx-champagne);color:var(--fx-champagne);transform:translateY(-2px)}
.fx-hero .fx-scroll{display:flex;flex-direction:column;align-items:center;gap:4px;position:absolute;left:50%;bottom:28px;z-index:2;transform:translateX(-50%);
  font-size:.68rem;font-weight:500;letter-spacing:.25em;text-transform:uppercase;color:rgba(227,195,157,.85);text-decoration:none;animation:fx-bob 2.2s ease-in-out infinite}
html[lang=ar].fx-hero .fx-scroll{letter-spacing:.04em;font-size:.8rem}
.fx-hero .fx-scroll:hover,.fx-hero .fx-scroll:focus-visible{color:#fff}
@keyframes fx-rise{to{transform:translateY(0);opacity:1}}
@keyframes fx-up{from{opacity:0;transform:translateY(22px)}to{opacity:1;transform:translateY(0)}}
@keyframes fx-bob{0%,100%{transform:translate(-50%,0)}50%{transform:translate(-50%,8px)}}

/* ── hero parallax ──────────────────────────────────────────────────────── */
.fx-parallax .hero{overflow:hidden;background-image:none!important;background-color:#05102a}
.fx-parallax .fx-hero-bg{position:absolute;inset:-6% 0 -6% 0;background-size:cover;background-position:center;will-change:transform;transform:translate3d(0,0,0) scale(1.03)}
.fx-parallax .hero-content{will-change:opacity}
.fx-hero-bg{display:none}
.fx-parallax .fx-hero-bg{display:block}

/* ── journey: steps you can point at ────────────────────────────────────── */
.fx-detail{display:none}
.fx-journey .journey-step{cursor:pointer;-webkit-tap-highlight-color:transparent;outline:none}
.fx-journey .journey-step .js-circle{transition:all .5s ease,transform .35s var(--fx-ease)}
.fx-journey .journey-step.fx-on .js-circle{transform:scale(1.1);border-color:var(--fx-bronze);color:#fff;background:var(--fx-bronze);box-shadow:0 0 0 10px rgba(166,136,104,.12),0 14px 30px -12px rgba(7,23,57,.35)}
.fx-journey .journey-step:focus-visible .js-circle{box-shadow:0 0 0 4px rgba(166,136,104,.45)}
.fx-journey .fx-detail{display:block;max-width:700px;margin:44px auto 0;padding:22px 30px;border-radius:16px;border-left:4px solid var(--fx-bronze);background:#faf9f7;text-align:left;min-height:104px}
html[dir=rtl].fx-journey .fx-detail{border-left:none;border-right:4px solid var(--fx-bronze);text-align:right}
.fx-journey .fx-detail-k{font-size:.7rem;font-weight:700;letter-spacing:.2em;text-transform:uppercase;color:var(--fx-bronze);margin:0 0 6px}
html[lang=ar].fx-journey .fx-detail-k{letter-spacing:.03em;font-size:.82rem}
.fx-journey .fx-detail-t{margin:0;color:#555;font-size:.95rem;line-height:1.8}
.fx-journey .fx-detail.fx-swap .fx-detail-k,.fx-journey .fx-detail.fx-swap .fx-detail-t{animation:fx-up .35s var(--fx-ease)}
.fx-journey .journey-usp{margin-top:22px}

/* ── about: slide in from the sides ─────────────────────────────────────── */
.fx-about .about-left,.fx-about .about-image{opacity:0;transition:opacity 1s var(--fx-ease),transform 1s var(--fx-ease)}
.fx-about .about-left{transform:translateX(-46px)}
.fx-about .about-image{transform:translateX(46px)}
html[dir=rtl].fx-about .about-left{transform:translateX(46px)}
html[dir=rtl].fx-about .about-image{transform:translateX(-46px)}
html.fx-about .about-left.fx-in,html.fx-about .about-image.fx-in{opacity:1;transform:none}
.fx-about .mission-vision .vision,.fx-about .mission-vision .mission{transition:transform .3s var(--fx-ease),box-shadow .3s}
.fx-about .mission-vision .vision:hover,.fx-about .mission-vision .mission:hover{transform:translateY(-4px);box-shadow:0 14px 30px -18px rgba(7,23,57,.35)}

/* ── cost-estimate preview: quality tiers ───────────────────────────────── */
.fx-tiers,.fx-boq-note{display:none}
.fx-boq .fx-tiers{display:flex;gap:4px;flex-wrap:wrap;padding:10px 14px 0}
.fx-boq .fx-tiers button{border:none;border-radius:50px;padding:5px 11px;font:inherit;font-size:.62rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;cursor:pointer;background:#f1eee8;color:#777;transition:background .2s,color .2s}
html[lang=ar].fx-boq .fx-tiers button{letter-spacing:0;font-size:.74rem}
.fx-boq .fx-tiers button:hover{color:var(--fx-navy)}
.fx-boq .fx-tiers button[aria-pressed=true]{background:var(--fx-navy);color:#fff}
.fx-boq .fx-tiers button:focus-visible{outline:2px solid var(--fx-bronze);outline-offset:2px}
.fx-boq .emw-row .rv.fx-tick,.fx-boq .emw-total .tv.fx-tick{animation:fx-tick .35s var(--fx-ease)}
.fx-boq .fx-boq-note{display:block;margin:8px 0 14px;font-size:.68rem;color:#999;text-align:center}
@keyframes fx-tick{from{opacity:.3;transform:translateY(-5px)}to{opacity:1;transform:none}}

/* ── smart-home hub ─────────────────────────────────────────────────────── */
.fx-status{display:none}
.fx-smart .sm-node{cursor:pointer;-webkit-tap-highlight-color:transparent}
.fx-smart .sm-node .sm-node-ico{transition:transform .3s var(--fx-ease),border-color .3s,background .3s,box-shadow .3s}
.fx-smart .sm-node.fx-on .sm-node-ico{transform:scale(1.14);border-color:var(--fx-champagne);background:rgba(166,136,104,.38);box-shadow:0 0 0 6px rgba(227,195,157,.14)}
.fx-smart .sm-node:focus-visible .sm-node-ico{box-shadow:0 0 0 3px rgba(227,195,157,.7)}
.fx-smart .sm-node:focus{outline:none}
.fx-smart #smSvg line{transition:stroke .3s,stroke-width .3s}
.fx-smart #smSvg line.fx-on{stroke:rgba(227,195,157,.95);stroke-width:2.4}
.fx-smart .fx-status{display:block;position:absolute;left:50%;bottom:14px;transform:translateX(-50%);z-index:12;max-width:92%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  padding:7px 16px;border-radius:50px;border:1px solid rgba(166,136,104,.45);background:rgba(7,23,57,.86);color:var(--fx-champagne);font-size:.74rem;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px)}
.fx-smart .fx-status b{color:#fff;font-weight:500}
.fx-smart .fx-status.fx-swap{animation:fx-pill .3s var(--fx-ease)}
@keyframes fx-pill{from{opacity:0;transform:translate(-50%,8px)}to{opacity:1;transform:translate(-50%,0)}}

/* ── portfolio filter ───────────────────────────────────────────────────── */
.fx-portfolio .portfolio-item.fx-pop{animation:fx-pop .45s var(--fx-ease) both}
.fx-portfolio .filter-btn{transition:background-color .25s,color .25s,transform .25s}
.fx-portfolio .filter-btn:active{transform:scale(.96)}
@keyframes fx-pop{from{opacity:0;transform:scale(.93)}to{opacity:1;transform:scale(1)}}

/* ── section titles ─────────────────────────────────────────────────────── */
.fx-titles .section-title::after{transform:scaleX(0);transition:transform .9s var(--fx-ease) .15s}
.fx-titles .section-title.fx-in::after{transform:scaleX(1)}

/* ── the preview panel (only on the preview page) ───────────────────────── */
.fx-panel{position:fixed;left:16px;bottom:16px;z-index:5000;width:300px;max-width:calc(100vw - 32px);font-family:Arial,Helvetica,sans-serif;font-size:13px;color:#1e2535;direction:ltr;text-align:left}
.fx-panel-btn{display:flex;align-items:center;gap:10px;border:2px solid #fff;border-radius:50px;padding:13px 20px;background:#A68868;color:#fff;font:inherit;font-size:15px;font-weight:700;cursor:pointer;box-shadow:0 10px 30px rgba(0,0,0,.45);animation:fx-panel-pulse 2.2s ease-in-out infinite}
.fx-panel-btn:hover{background:#8c6f52}
.fx-panel.open .fx-panel-btn{animation:none}
.fx-panel-btn span{background:#071739;border-radius:50px;padding:2px 10px;font-size:12px}
@keyframes fx-panel-pulse{0%,100%{box-shadow:0 10px 30px rgba(0,0,0,.45),0 0 0 0 rgba(166,136,104,.75)}60%{box-shadow:0 10px 30px rgba(0,0,0,.45),0 0 0 16px rgba(166,136,104,0)}}
.fx-panel-box{display:none;margin-bottom:10px;background:#fff;border:1px solid #e2e6f0;border-radius:14px;box-shadow:0 18px 44px rgba(0,0,0,.28);overflow:hidden}
.fx-panel.open .fx-panel-box{display:block}
.fx-panel-head{padding:12px 14px;background:#071739;color:#fff}
.fx-panel-head strong{display:block;font-size:14px}
.fx-panel-head small{color:#c9d0e0;font-size:11.5px;line-height:1.4;display:block;margin-top:2px}
.fx-panel-list{max-height:52vh;overflow-y:auto;padding:6px 0}
.fx-panel-list label{display:flex;gap:10px;align-items:flex-start;padding:8px 14px;cursor:pointer}
.fx-panel-list label:hover{background:#f5f6fa}
.fx-panel-list input{margin-top:2px;width:16px;height:16px;accent-color:#A68868;flex-shrink:0}
.fx-panel-list b{display:block;font-size:13px}
.fx-panel-list small{display:block;color:#6b7280;font-size:11.5px;line-height:1.35}
.fx-panel-foot{display:flex;gap:8px;padding:10px 14px;border-top:1px solid #eef0f5;background:#fafbfd}
.fx-panel-foot button{flex:1;border:1px solid #e2e6f0;border-radius:8px;background:#fff;padding:7px 6px;font:inherit;font-size:12px;font-weight:700;cursor:pointer}
.fx-panel-foot button:hover{background:#f1f3f9}
.fx-panel-code{padding:0 14px 12px;background:#fafbfd;font-size:11px;color:#6b7280;line-height:1.5}
.fx-panel-code code{display:block;margin-top:4px;padding:6px 8px;background:#f1f3f9;border-radius:6px;color:#1e2535;overflow-wrap:break-word;font-family:Consolas,monospace;font-size:11px}
@media print{.fx-panel,.fx-bar{display:none!important}}

/* ── people who ask for less motion get none of the movement ────────────── */
@media(prefers-reduced-motion:reduce){
  .fx-hero .hero h1 .fx-w>span,.fx-hero .hero-content>.fx-eyebrow,.fx-hero .hero-content>p[data-i18n],.fx-hero .fx-actions{animation:none;opacity:1;transform:none}
  .fx-hero .fx-scroll{animation:none}
  .fx-about .about-left,.fx-about .about-image{opacity:1;transform:none;transition:none}
  .fx-titles .section-title::after{transform:none;transition:none}
  .fx-portfolio .portfolio-item.fx-pop,.fx-journey .fx-detail.fx-swap .fx-detail-k,.fx-journey .fx-detail.fx-swap .fx-detail-t,.fx-smart .fx-status.fx-swap,.fx-boq .rv.fx-tick,.fx-boq .tv.fx-tick{animation:none}
}
