/* ==========================================================================
   Yasaman — scroll-motion layer (home page)
   Progressive enhancement: every section below is fully usable and visible
   without JS / without GSAP / with prefers-reduced-motion. The `ay-motion`
   class on <html> is added by ayrin-motion.js only when the motion engine
   actually runs.
   ========================================================================== */

/* ---------- page-level ---------- */
html.ay-motion { scroll-behavior: auto !important; }           /* Lenis owns smoothing */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

/* the generic fade-in from base.html would fight GSAP on the home page */
html.ay-motion .fade-in { opacity: 1; transform: none; transition: none; }

.ay-progress {
    position: fixed; top: 0; right: 0; left: 0; height: 3px; z-index: 2000;
    background: linear-gradient(90deg, var(--brass), var(--brass-light));
    transform: scaleX(0); transform-origin: 100% 50%;            /* RTL: grows from the right */
    pointer-events: none;
}
html:not(.ay-motion) .ay-progress { display: none; }

/* ---------- word-split helpers (never split Persian into letters: it breaks joining) ---------- */
.ay-w { display: inline-block; overflow: hidden; vertical-align: top; padding-block: .12em; margin-block: -.12em; }
.ay-wi { display: inline-block; will-change: transform; }

/* ---------- hero ---------- */
html.ay-motion .hero-full { will-change: clip-path; }
html.ay-motion .hero-full-bg img { will-change: transform; transform-origin: 50% 40%; }
html.ay-motion .hero-full-inner { will-change: transform, opacity; }
.hero-full .hero-title .ay-w { overflow: visible; }              /* heading words fly apart; no mask */

/* ---------- marquee strip (built from .trust-bar) ---------- */
.trust-bar.ay-mq { overflow: hidden; padding: 20px 0; direction: ltr; }
.trust-bar.ay-mq .container { max-width: none; padding: 0; }
.trust-bar.ay-mq .trust-bar-inner {
    display: flex; flex-wrap: nowrap; justify-content: flex-start; gap: 0;
    width: max-content; will-change: transform; direction: rtl;
}
.trust-bar.ay-mq .ay-mq-group {
    display: flex; flex: none; align-items: center; gap: 56px; padding-inline: 28px; white-space: nowrap;
}
.trust-bar.ay-mq .ay-mq-group span { position: relative; font-size: .95rem; }
.trust-bar.ay-mq .ay-mq-group span::after {
    content: ""; position: absolute; top: 50%; inset-inline-end: -32px; width: 6px; height: 6px;
    background: var(--brass); transform: translateY(-50%) rotate(45deg);
}

/* ---------- pinned showcase (featured products, clip-path wipes) ---------- */
.ay-showcase { position: relative; background: var(--ink); color: #fff; overflow: hidden; overflow: clip; }
.ay-showcase.is-stack .ay-sc-panels { gap: 22px; padding-bottom: 10vh; }
.ay-showcase.is-stack .ay-panel { position: sticky; top: calc(var(--ay-nav, 0px) + 14px); aspect-ratio: auto; height: min(70vh, 540px); transform-origin: 50% 0; box-shadow: 0 18px 40px rgba(0,0,0,.35); }
@media (hover: none) { html.ay-motion .product-image { transition: none; } }
.ay-sc-stage {
    min-height: 100vh; display: grid; grid-template-columns: minmax(240px, 32%) 1fr;
    gap: clamp(24px, 4vw, 72px); align-items: center; padding: 56px clamp(20px, 5vw, 80px);
}
.ay-sc-info .section-subtitle { color: var(--brass-light); text-align: right; opacity: .8; }
.ay-sc-info h2 { color: #fff; text-align: right; font-size: clamp(1.8rem, 3.2vw, 2.8rem); font-weight: 300; line-height: 1.35; margin: 0 0 22px; }
.ay-sc-info p { color: rgba(255,255,255,.7); font-weight: 300; line-height: 2; margin: 0 0 28px; max-width: 34ch; }
.ay-meter { display: flex; align-items: center; gap: 14px; font-size: .85rem; color: rgba(255,255,255,.75); }
.ay-meter b { font-size: 1.6rem; font-weight: 300; color: #fff; min-width: 2ch; }
.ay-meter .ay-bar { flex: 1; height: 2px; background: rgba(255,255,255,.18); position: relative; overflow: hidden; max-width: 220px; }
.ay-meter .ay-bar i { position: absolute; inset: 0; background: var(--brass); transform: scaleX(0); transform-origin: 100% 50%; }

.ay-showcase:not(.is-pinned) .ay-meter { display: none; }
.ay-sc-panels { display: grid; gap: 20px; }
.ay-panel {
    position: relative; display: block; overflow: hidden; border-radius: 22px; aspect-ratio: 4/5;
    background: var(--moss-dark); color: #fff;
}
.ay-panel img { width: 100%; height: 100%; object-fit: cover; display: block; will-change: transform; }
.ay-panel .ay-cap {
    position: absolute; inset-inline: 0; bottom: 0; padding: 56px 26px 24px; text-align: right;
    background: linear-gradient(to top, rgba(20,30,22,.82), rgba(20,30,22,0));
}
.ay-panel .ay-cap h3 { font-size: 1.1rem; font-weight: 400; margin: 0 0 4px; color: #fff; }
.ay-panel .ay-cap p { margin: 0; font-size: .85rem; font-weight: 300; color: rgba(255,255,255,.8); }
.ay-panel .ay-cap span { display: inline-block; margin-top: 10px; font-size: .75rem; color: var(--brass-light); letter-spacing: .5px; }
.ay-panel .ay-idx {
    position: absolute; top: 18px; inset-inline-start: 20px; font-size: .78rem; color: #fff;
    background: rgba(20,30,22,.45); backdrop-filter: blur(6px); border-radius: 50px; padding: 3px 12px;
}

/* desktop pinned layout (class added by JS only when pinning is active) */
.ay-showcase.is-pinned .ay-sc-stage { height: calc(100vh - var(--ay-nav, 0px)); min-height: 560px; padding-block: 24px; }
.ay-showcase.is-pinned .ay-sc-panels { display: block; position: relative; height: min(78vh, 760px); }
.ay-showcase.is-pinned .ay-panel { position: absolute; inset: 0; aspect-ratio: auto; }

/* ---------- lookbook (horizontal) ---------- */
.ay-lookbook { position: relative; padding: 80px 0 60px; overflow: hidden; }
.ay-lb-top { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 0 clamp(20px, 5vw, 80px) 28px; }
.ay-lb-top .section-subtitle { text-align: right; }
.ay-lb-top .section-title { text-align: right; margin: 0; }
.ay-lookbook .ay-meter { color: var(--text-light); }
.ay-lookbook .ay-meter b { color: var(--ink); }
.ay-lookbook .ay-meter .ay-bar { background: rgba(0,0,0,.1); width: 160px; flex: none; }
.ay-lb-viewport { overflow-x: auto; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: none; direction: rtl; padding: 6px clamp(20px, 5vw, 80px) 12px; }
.ay-lb-viewport::-webkit-scrollbar { display: none; }
.ay-lb-track { display: flex; gap: clamp(16px, 2.2vw, 36px); width: max-content; }
.ay-lb-item { flex: none; width: clamp(220px, 24vw, 360px); display: block; text-decoration: none; color: inherit; scroll-snap-align: start; }
.ay-lb-item:nth-child(even) { margin-top: 48px; }
.ay-lb-img { display: block; overflow: hidden; border-radius: 18px; aspect-ratio: 3/4; background: var(--bg-dark); }
.ay-lb-img img { width: 118%; max-width: none; height: 100%; object-fit: cover; display: block; margin-inline: -9%; will-change: transform; }
.ay-lb-meta { display: flex; justify-content: space-between; gap: 10px; padding: 12px 4px 0; font-size: .85rem; }
.ay-lb-meta b { font-weight: 400; color: var(--text); }
.ay-lb-meta em { font-style: normal; font-weight: 300; color: var(--text-light); white-space: nowrap; }

.ay-lookbook.is-pinned { padding: 0; }
.ay-lookbook.is-pinned .ay-lb-stage { height: calc(100vh - var(--ay-nav, 0px)); min-height: 560px; display: flex; flex-direction: column; justify-content: center; }
.ay-lookbook.is-pinned .ay-lb-viewport { overflow: hidden; scroll-snap-type: none; }
.ay-lookbook.is-pinned .ay-lb-item { width: clamp(240px, 26vw, 400px); }

/* ---------- quality section ---------- */
html.ay-motion .quality-image { will-change: clip-path; }
html.ay-motion .quality-image-logo { will-change: transform; }
.ay-words .ay-wd { transition: none; }

/* ---------- extras ---------- */
.ay-all-link { display: inline-block; margin: 0 0 26px; color: var(--brass-light); font-size: .9rem; text-decoration: none; border-bottom: 1px solid rgba(238,225,195,.4); padding-bottom: 2px; }
.ay-all-link:hover { color: #fff; border-color: #fff; }
.ay-skip {
    position: absolute; z-index: 20; bottom: 18px; inset-inline-start: clamp(20px, 5vw, 80px);
    font: inherit; font-size: .78rem; color: #fff; background: rgba(20,30,22,.55); backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,.3); border-radius: 50px; padding: 6px 16px; cursor: pointer;
    opacity: .8; transition: opacity .3s, background .3s;
}
.ay-skip:hover, .ay-skip:focus-visible { opacity: 1; background: var(--brass); color: var(--ink); outline: none; }
.ay-lookbook .ay-skip { color: var(--ink); background: rgba(255,255,255,.7); border-color: rgba(0,0,0,.15); }
.ay-showcase :focus-visible, .ay-lookbook :focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }

.ay-giant { overflow: hidden; padding: 30px 0 0; margin-top: 20px; text-align: center; line-height: .8; user-select: none; }
.ay-giant-word {
    display: block; font-size: clamp(7rem, 30vw, 26rem); font-weight: 700; color: var(--ink); letter-spacing: -.02em;
    opacity: .09; line-height: 1; padding-bottom: .05em; will-change: transform;
}
.hero-btn.ay-magnet { will-change: transform; }

.ay-band { overflow: hidden; padding: 28px 0 8px; direction: ltr; user-select: none; }
.ay-band-row { display: flex; gap: .5em; width: max-content; font-size: clamp(3rem, 13vw, 9rem); font-weight: 700; line-height: 1.15; white-space: nowrap; color: var(--ink); will-change: transform; }
.ay-band-row span { flex: none; }
.ay-band-row.ay-outline { color: transparent; -webkit-text-stroke: 1.5px var(--moss); }
.ay-band-row span:nth-child(even) { color: var(--brass); -webkit-text-stroke: 0; }
@media (max-width: 991.98px) { .ay-band-row { font-size: clamp(2.6rem, 15vw, 5rem); } }
html:not(.ay-motion) .ay-band { display: none; }
.ay-skewy { will-change: transform; }

/* ---------- touch / small screens ---------- */
@media (max-width: 991.98px) {
    .ay-sc-stage { grid-template-columns: 1fr; padding-block: 56px; }
    .ay-sc-info h2, .ay-sc-info .section-subtitle { text-align: center; }
    .ay-sc-info p { margin-inline: auto; text-align: center; }
    .ay-lb-item { width: 68vw; }
    .ay-lb-item:nth-child(even) { margin-top: 28px; }

    /* pinned showcase on phones: compact header on top, big card filling the rest */
    .ay-showcase.is-pinned .ay-sc-stage {
        height: calc(100vh - var(--ay-nav, 0px)); height: calc(100svh - var(--ay-nav, 0px));
        min-height: 0; padding: 14px 16px 18px; gap: 10px;
        grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); align-items: stretch;
    }
    .ay-showcase.is-pinned .ay-sc-info p { display: none; }
    .ay-showcase.is-pinned .ay-sc-info h2 { font-size: 1.25rem; margin: 0 0 8px; }
    .ay-showcase.is-pinned .ay-sc-info .section-subtitle { margin-bottom: 4px; text-align: center; }
    .ay-showcase.is-pinned .ay-all-link { display: none; }
    .ay-showcase.is-pinned .ay-meter { justify-content: center; }
    .ay-showcase.is-pinned .ay-sc-panels { height: 100%; min-height: 0; }
    .ay-showcase.is-pinned .ay-panel { border-radius: 20px; }
    .ay-showcase.is-pinned .ay-skip { bottom: 26px; inset-inline-start: 28px; }

    /* pinned lookbook on phones */
    .ay-lookbook.is-pinned .ay-lb-stage { height: 100vh; height: calc(100svh - var(--ay-nav, 0px)); min-height: 0; }
    .ay-lookbook.is-pinned .ay-lb-item { width: 66vw; }
    .ay-lookbook.is-pinned .ay-lb-top { padding-bottom: 16px; }
    .ay-lookbook.is-pinned .ay-lb-top .section-title { font-size: 1.5rem; }
    .ay-lookbook.is-pinned .ay-skip { bottom: 16px; }
    .ay-lookbook .ay-meter .ay-bar { width: 90px; }
}

@media (prefers-reduced-motion: reduce) {
    .ay-progress { display: none; }
}
