/* ==========================================================================
   Maraya homepage v4 — "one mirror for every salon in Tunisia"
   World: velvet plum + rose gold, arched mirror, editorial numbering.
   Rules followed: Impeccable (persuade: the main action in working form,
   no split-hero-plus-equal-cards template), Taste (one hero entrance,
   hover micro-motion, flat grounds, no glow), Emil/Apple (press feedback,
   ease-out, reduced motion), animated icons (useanimations-style draw).
   ========================================================================== */

.landing { --velvet: #2c1229; --velvet-2: #43203f; --cream-t: #fbefe9; --rg: #d7a99a; }
[dir="rtl"] .landing { --disp: "El Messiri", "Playfair Display", serif; --accent-f: "Aref Ruqaa", "El Messiri", serif; }
[dir="ltr"] .landing { --disp: "Playfair Display", Georgia, serif; --accent-f: "Playfair Display", Georgia, serif; }

/* header sits on the velvet hero until you scroll */
.landing .nav { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; position: fixed; inset-inline: 0; top: 0; }
.landing .nav .brand-t, .landing .nav .links a { color: var(--cream-t); }
.landing .nav .brand small { color: var(--rg); }
.landing .nav .btn { background: rgba(255, 255, 255, .08) !important; color: var(--cream-t) !important; border-color: rgba(255, 255, 255, .16) !important; box-shadow: none !important; }
.scrolled .landing .nav, html.scrolled .landing .nav { background: rgba(44, 18, 41, .78); -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%); border-bottom-color: rgba(255, 255, 255, .06); }

/* ---------- hero ---------- */
.hx { position: relative; color: var(--cream-t); overflow: hidden; isolation: isolate;
  background:
    radial-gradient(60% 70% at 85% 10%, rgba(201, 81, 127, .35), transparent 60%),
    radial-gradient(50% 60% at 10% 90%, rgba(215, 169, 154, .22), transparent 60%),
    linear-gradient(160deg, var(--velvet-2), var(--velvet) 55%, #1d0b1b);
  padding: calc(96px + env(safe-area-inset-top)) 20px 72px; }
.hx::after { /* velvet nap: very fine diagonal sheen, static */
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5;
  background: repeating-linear-gradient(115deg, rgba(255,255,255,.018) 0 2px, transparent 2px 6px); }
.hx-in { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 48px; align-items: center; }
.hx .eyebrow { margin: 0 0 18px; font-size: .9rem; color: var(--rg); letter-spacing: .02em; }
.hx .eyebrow span { font-family: "Playfair Display", serif; font-style: italic; font-weight: 700; font-size: 1.05rem; }
.hx h1 { font-family: var(--disp); font-weight: 700; font-size: clamp(2.4rem, 5.2vw, 4.5rem); line-height: 1.12; margin: 0 0 20px; color: #fff; }
[dir="ltr"] .hx h1 { line-height: 1.02; letter-spacing: -0.03em; }
.hx h1 em { font-family: var(--accent-f); font-style: normal; font-weight: 700; color: var(--rg); }
[dir="ltr"] .hx h1 em { font-style: italic; }
.hx .lead { max-width: 34em; font-size: 1.08rem; line-height: 1.7; color: rgba(251, 239, 233, .78); margin: 0 0 28px; }

/* the finder: the action visitors came for, working right here */
.finder { display: flex; align-items: stretch; gap: 8px; padding: 8px; border-radius: 22px; background: #fff; color: var(--ink);
  box-shadow: 0 1px 0 rgba(255,255,255,.5) inset, 0 24px 60px rgba(10, 2, 9, .45); max-width: 640px; }
.f-field { flex: 1 1 0; min-width: 0; display: grid; gap: 0; padding: 6px 14px; border-radius: 16px; background: var(--blush); }
.f-field span { font-size: .72rem; font-weight: 700; color: var(--rose); }
.f-field select { border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 2px 0 !important; font-weight: 600; color: var(--ink); min-width: 0; width: 100%; }
.seg { display: flex; padding: 4px; gap: 2px; border-radius: 16px; background: var(--blush); }
.seg button { font: inherit; font-weight: 600; font-size: .92rem; border: 0; background: transparent; color: var(--muted); padding: 0 14px; border-radius: 12px; cursor: pointer;
  transition: background-color 200ms var(--ease-out), color 200ms ease, transform 120ms var(--ease-out); }
.seg button.on { background: #fff; color: var(--plum); box-shadow: var(--sh-1); }
.seg button:active { transform: scale(.96); }
.finder .f-go { border-radius: 16px !important; min-height: 56px; padding-inline: 22px; }

.hx .stats { display: flex; gap: 0; margin-top: 30px; background: none !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; }
.hx .stats span { display: grid; padding-inline: 22px; border-inline-start: 1px solid rgba(255, 255, 255, .14); color: rgba(251, 239, 233, .62); font-size: .85rem; }
.hx .stats span:first-child { padding-inline-start: 0; border: 0; }
.hx .stats b { font-family: "Playfair Display", serif; font-size: 2rem; font-weight: 700; color: #fff; line-height: 1.1; }

/* the mirror: an arch, not an egg */
.hx-art { position: relative; justify-self: center; width: min(420px, 100%); }
.arch { position: relative; aspect-ratio: 3 / 4; border-radius: 999px 999px 28px 28px; overflow: hidden; background: #fff;
  -webkit-clip-path: inset(0 round 999px 999px 28px 28px); clip-path: inset(0 round 999px 999px 28px 28px);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .7); }
.arch .slides { position: absolute; inset: 0; }
.arch .slides img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1s ease; }
.arch .slides img.on { opacity: 1; }
.arch::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(200deg, rgba(255,255,255,.35), transparent 35%), linear-gradient(0deg, rgba(44,18,41,.25), transparent 30%); }
.arch-ring { position: absolute; inset: -14px; border-radius: 999px 999px 40px 40px; border: 1px solid rgba(215, 169, 154, .55); pointer-events: none; }
.float { position: absolute; z-index: 2; background: rgba(255, 255, 255, .92); color: var(--ink); border-radius: 18px; box-shadow: 0 18px 40px rgba(10, 2, 9, .35);
  -webkit-backdrop-filter: blur(16px) saturate(180%); backdrop-filter: blur(16px) saturate(180%); }
.float.f1 { bottom: 26px; inset-inline-start: -36px; width: 250px; }
.float.f1:empty { display: none; }
.float.f1 a { display: flex; gap: 12px; align-items: center; padding: 10px; color: inherit; text-decoration: none; }
.float.f1 img { width: 58px; height: 58px; border-radius: 12px; object-fit: cover; background: var(--blush); flex: none; }
.float.f1 span { display: grid; min-width: 0; }
.float.f1 small { color: var(--rose); font-size: .72rem; font-weight: 700; }
.float.f1 b { font-size: .86rem; font-weight: 600; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.float.f1 em { font-style: normal; font-family: "Playfair Display", serif; font-weight: 700; color: var(--plum); }
.float.f2 { top: 34px; inset-inline-end: -28px; display: flex; gap: 10px; align-items: center; padding: 10px 16px 10px 12px; }
.float.f2 .ic { width: 22px; height: 22px; color: var(--rose); }
.float.f2 span { display: grid; line-height: 1.15; }
.float.f2 b { font-family: "Playfair Display", serif; font-size: 1.25rem; }
.float.f2 small { color: var(--muted); font-size: .72rem; }

/* one entrance, once */
.hx-copy > *, .hx-art { animation: hx-in .7s var(--ease-out) both; }
.hx-copy > :nth-child(2) { animation-delay: .06s; } .hx-copy > :nth-child(3) { animation-delay: .12s; }
.hx-copy > :nth-child(4) { animation-delay: .18s; } .hx-copy > :nth-child(5) { animation-delay: .24s; }
.hx-art { animation-delay: .15s; }
@keyframes hx-in { from { opacity: 0; transform: translateY(14px); } }

@media (max-width: 900px) {
  .hx { padding: calc(84px + env(safe-area-inset-top)) 18px 56px; }
  .hx-in { grid-template-columns: 1fr; gap: 44px; }
  .hx-art { width: min(300px, 74vw); }
  .float.f1 { inset-inline-start: -12px; width: min(230px, 80%); bottom: 18px; }
  .float.f2 { inset-inline-end: -12px; top: 24px; }
}
@media (max-width: 560px) {
  .finder { flex-wrap: wrap; border-radius: 20px; }
  .f-field { flex: 1 1 100%; padding: 8px 14px; }
  .seg { flex: 1 1 100%; } .seg button { flex: 1; min-height: 44px; }
  .finder .f-go { flex: 1 1 100%; }
  .hx .stats span { padding-inline: 14px; } .hx .stats b { font-size: 1.6rem; }
}

/* ---------- ticker: rose-gold rule between hero and page ---------- */
.landing .ticker { background: var(--velvet); color: rgba(251, 239, 233, .82); border: 0; border-top: 1px solid rgba(215, 169, 154, .25); }
.landing .ticker span { font-family: var(--disp); font-size: .95rem; }
.landing .ticker span::after { content: "✦"; color: var(--rg); margin-inline-start: 26px; font-size: .7rem; }

/* ---------- bento ---------- */
.bento { max-width: 1200px; margin: 56px auto 0; padding: 0 16px; display: grid; gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: 230px 230px; }
.bx { position: relative; display: flex; align-items: flex-end; overflow: hidden; border-radius: 26px; padding: 24px; text-decoration: none; color: var(--ink);
  background: #fff; border: var(--hair); box-shadow: var(--sh-1);
  transition: transform 140ms var(--ease-out), box-shadow 240ms var(--ease-out); }
.bx:active { transform: scale(.98); }
@media (hover: hover) and (pointer: fine) { .bx:hover { transform: translateY(-2px); box-shadow: var(--sh-3); } }
.bx-t { position: relative; z-index: 1; display: grid; gap: 4px; max-width: 26em; }
.bx-t small { font-family: "Playfair Display", serif; font-style: italic; color: var(--rose); font-size: .95rem; }
.bx-t b { font-family: var(--disp); font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.bx-t > span { color: var(--muted); font-size: .92rem; line-height: 1.55; }
.bx > .ic, .bx > [data-ic] { position: absolute; top: 22px; inset-inline-start: 22px; }
.bx > [data-ic] .ic { width: 34px; height: 34px; }

.b-map { grid-column: span 2; grid-row: span 2; background: #f6e9ec; }
.mini-map { position: absolute; inset: 0; width: 100%; height: 100%; }
.mini-map .streets path { fill: none; stroke: #fff; stroke-width: 12; stroke-linecap: round; }
.mini-map .pins circle { fill: var(--rose); stroke: #fff; stroke-width: 3; }
.mini-map .me circle { fill: #3d8bff; stroke: #fff; stroke-width: 3; }
.mini-map .me .pulse { fill: rgba(61, 139, 255, .25); stroke: none; transform-origin: 200px 140px; animation: me-pulse 2.6s var(--ease-out) infinite; }
@keyframes me-pulse { from { transform: scale(.6); opacity: 1; } to { transform: scale(3.2); opacity: 0; } }
.mini-map .pins circle { transform-box: fill-box; transform-origin: center; animation: pin-in .5s var(--ease-out) both; }
.mini-map .pins circle:nth-child(2) { animation-delay: .08s; } .mini-map .pins circle:nth-child(3) { animation-delay: .16s; }
.mini-map .pins circle:nth-child(4) { animation-delay: .24s; } .mini-map .pins circle:nth-child(5) { animation-delay: .32s; }
@keyframes pin-in { from { transform: scale(.4) translateY(-8px); opacity: 0; } }
.b-map::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(0deg, rgba(246, 233, 236, .96) 18%, rgba(246, 233, 236, 0) 60%); }
.b-map .bx-t { z-index: 2; }

.b-now { grid-column: span 2; background: var(--plum); color: var(--cream-t); border-color: transparent; }
.b-now .bx-t > span { color: rgba(251, 239, 233, .72); } .b-now .bx-t small { color: var(--rg); }
.b-now > [data-ic] .ic { color: var(--rg); }
.b-shop { background: #fff; }
.b-shop img { position: absolute; inset-inline-end: -8%; top: 0; width: 70%; height: 72%; object-fit: contain; transition: transform 600ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .b-shop:hover img { transform: scale(1.04); } }
.b-shop img:not([src]) { display: none; }
.b-game { background: #f8f1ea; }
.b-game > [data-ic] .ic { color: var(--plum); }

@media (max-width: 900px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: 300px auto auto; margin-top: 40px; }
  .b-map { grid-column: span 2; grid-row: auto; }
  .b-now { grid-column: span 2; min-height: 190px; }
  .b-shop, .b-game { min-height: 220px; }
  .bx { padding: 20px; } .bx-t b { font-size: 1.3rem; }
}

/* ---------- editorial section heads ---------- */
.landing .block h2 { font-family: var(--disp); font-weight: 700; font-size: clamp(1.6rem, 3.4vw, 2.3rem); display: flex; align-items: baseline; gap: 12px; }
.landing .block h2 .no { font-family: "Playfair Display", serif; font-style: italic; font-weight: 600; font-size: .55em; color: var(--rose); }
.landing .quiz h2 { font-family: var(--disp); }

/* ---------- animated icons (draw on hover / replay on tap) ---------- */
@keyframes ic-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.ic.ic-play > * { stroke-dasharray: 1; animation: ic-draw .7s var(--ease-out) both; }
.ic.ic-play[data-name="bell"] { animation: ic-ring .6s var(--ease-out); transform-origin: 50% 10%; }
.ic.ic-play[data-name="zap"] > * { animation: ic-draw .45s var(--ease-out) both; }
.ic.ic-play[data-name="shopping-cart"] { animation: ic-bump .4s var(--ease-out); }
@keyframes ic-ring { 20% { transform: rotate(14deg); } 45% { transform: rotate(-10deg); } 70% { transform: rotate(5deg); } }
@keyframes ic-bump { 40% { transform: translateY(-3px); } }

@media (prefers-reduced-motion: reduce) {
  .hx-copy > *, .hx-art, .mini-map .pins circle { animation: none !important; }
  .mini-map .me .pulse { animation: none; opacity: .4; }
  .ic.ic-play, .ic.ic-play > * { animation: none !important; }
}

/* ---------- light hero (the brand stays bright and cheerful; plum is the accent, not the ground) ---------- */
.landing .nav { background: rgba(255, 250, 247, .55); -webkit-backdrop-filter: blur(16px) saturate(170%); backdrop-filter: blur(16px) saturate(170%); }
.landing .nav .brand-t, .landing .nav .links a { color: var(--ink); }
.landing .nav .brand small { color: var(--gold); }
.landing .nav .btn { background: #fff !important; color: var(--plum) !important; border-color: rgba(74, 35, 70, .12) !important; box-shadow: var(--sh-1) !important; }
html.scrolled .landing .nav { background: rgba(255, 250, 247, .8); border-bottom-color: rgba(74, 35, 70, .08); }
.hx { color: var(--ink);
  background:
    radial-gradient(55% 65% at 88% 8%, rgba(232, 122, 160, .28), transparent 62%),
    radial-gradient(45% 55% at 6% 92%, rgba(215, 169, 154, .30), transparent 62%),
    radial-gradient(40% 40% at 50% 50%, rgba(255, 255, 255, .9), transparent 70%),
    linear-gradient(170deg, #fff7f3, #fbe9ee 60%, #f6e3ea); }
.hx::after { opacity: 0; }
.hx h1 { color: var(--ink); }
.hx h1 em { color: var(--rose); }
.hx .eyebrow { color: var(--gold); }
.hx .lead { color: #6f5866; }
.finder { box-shadow: 0 1px 0 #fff inset, 0 20px 50px rgba(74, 35, 70, .16); border: var(--hair); }
.hx .stats span { color: var(--muted); border-inline-start-color: rgba(74, 35, 70, .12); }
.hx .stats b { color: var(--plum); }
.arch { box-shadow: 0 40px 70px -30px rgba(74, 35, 70, .45); }
.arch-ring { border-color: rgba(201, 148, 130, .7); }
.float { box-shadow: 0 16px 36px rgba(74, 35, 70, .2); }

/* ---------- 09 · المراية السحرية (try-on teaser) ---------- */
.magic { max-width: 1200px; margin: 64px auto 0; padding: 0 16px; }
.magic-in { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 28px; align-items: center; padding: 34px; border-radius: 32px;
  background: radial-gradient(70% 90% at 0% 0%, #fde3ec, transparent 60%), radial-gradient(60% 80% at 100% 100%, #f1e2f7, transparent 60%), #fff; border: var(--hair); box-shadow: var(--sh-2); }
.magic h2 { font-family: var(--disp); font-size: clamp(1.8rem, 4vw, 2.8rem); margin: 6px 0 10px; line-height: 1.2; }
.magic h2 em { font-family: var(--accent-f); font-style: normal; color: var(--rose); }
[dir="ltr"] .magic h2 em { font-style: italic; }
.magic .badge-new { display: inline-block; font-size: .75rem; font-weight: 700; color: #fff; background: var(--rose); padding: 3px 10px; border-radius: 999px; }
.magic p { color: var(--muted); margin: 0 0 18px; line-height: 1.7; }
.magic-modes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.mm { display: grid; justify-items: center; gap: 10px; padding: 18px 8px 14px; border-radius: 22px; background: #fff; border: var(--hair); box-shadow: var(--sh-1); text-decoration: none; color: var(--ink);
  transition: transform 140ms var(--ease-out), box-shadow 240ms var(--ease-out); }
.mm:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) { .mm:hover { transform: translateY(-2px); box-shadow: var(--sh-2); } }
.mm b { font-size: .95rem; }
.mm .dots { display: flex; gap: 4px; }
.mm .dots i { width: 14px; height: 14px; border-radius: 50%; background: var(--c); box-shadow: inset 0 -2px 3px rgba(0,0,0,.15); }
.mm .em { font-size: 1.9rem; line-height: 1; }
@media (max-width: 900px) { .magic-in { grid-template-columns: 1fr; padding: 24px 18px; } .magic-modes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- 10 · كراسي فاضية (flash) ---------- */
.flash { max-width: 1200px; margin: 64px auto 0; padding: 0 16px; }
.flash-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.flash-head h2 { margin: 0; }
.flash-head p { margin: 4px 0 0; color: var(--muted); }
.flash-list { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 300px); gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 12px; scrollbar-width: none; }
.fd { scroll-snap-align: start; display: grid; gap: 8px; padding: 18px; border-radius: 24px; background: #fff; border: var(--hair); box-shadow: var(--sh-1); position: relative; }
.fd .cd { justify-self: start; font-variant-numeric: tabular-nums; font-weight: 700; font-size: .82rem; color: #fff; background: var(--plum); padding: 4px 10px; border-radius: 999px; }
.fd .cd.hot { background: #c8364f; }
.fd h3 { margin: 0; font-size: 1.05rem; }
.fd .sal { color: var(--muted); font-size: .88rem; }
.fd .pr { display: flex; align-items: baseline; gap: 8px; }
.fd .pr b { font-family: "Playfair Display", serif; font-size: 1.5rem; color: var(--price); }
.fd .pr s { color: var(--muted); }
.fd .pr em { font-style: normal; font-size: .8rem; font-weight: 700; color: #1f7a4d; background: #e3f5ea; padding: 2px 8px; border-radius: 999px; }
.fd .left { font-size: .8rem; color: #c8364f; font-weight: 700; }
.flash-empty { padding: 22px; border-radius: 24px; border: 1px dashed rgba(74, 35, 70, .2); background: rgba(255, 255, 255, .6); display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.flash-empty p { margin: 0; color: var(--muted); }
.flash-head h2 { font-family: var(--disp); font-weight: 700; font-size: clamp(1.6rem, 3.4vw, 2.3rem); display: flex; align-items: baseline; gap: 12px; }
.flash-head h2 .no { font-size: .6em; }

/* accessibility pass */
.hx .eyebrow { color: var(--gold-t); }
.f-field span, .bx-t small, .landing .block h2 .no, .flash-head h2 .no, .float.f1 small, .fd .left { color: var(--rose-t); }
.magic .badge-new { background: var(--rose-t); }
.f-field:focus-within { box-shadow: 0 0 0 3px var(--rose-t); }
.f-field select:focus-visible { outline: 3px solid var(--rose-t); outline-offset: 4px; }
.seg button { color: #5e4a58; }
.seg button:focus-visible { outline: 3px solid var(--rose-t); outline-offset: 1px; }
.fd .cd { max-width: 100%; white-space: normal; }
