/* ============================================================
   site-luxury.css — AutoProphets shared motion & media layer
   Loaded on public marketing/content pages (not the live app).
   Pairs with site-luxury.js. Zero dependencies, CSP-safe.
   Brand tokens per DESIGN.md (aurora purple/green on void black).
   ============================================================ */

:root {
    --lux-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --lux-dur: 0.55s;
    --lux-purple: #8b5cf6;
    --lux-green: #10b981;
    --lux-gold: #f4c04e;
}

/* ------------------------------------------------------------
   1) Page-enter curtain — one soft fade/slide on first paint.
   Scoped under html.lux-on (set by JS) so no-JS never hides UI.
   ------------------------------------------------------------ */
html.lux-on body { animation: luxPageIn 0.5s var(--lux-ease) both; }
@keyframes luxPageIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ------------------------------------------------------------
   2) Scroll-reveal — elements start hidden ONLY when JS is live
   (html.lux-on). JS swaps .rx for .rx-in as they enter viewport.
   Stagger via --rxd set inline by JS.
   ------------------------------------------------------------ */
html.lux-on .rx {
    opacity: 0;
    transform: translateY(18px);
    will-change: opacity, transform;
}
html.lux-on .rx-in {
    opacity: 1;
    transform: translateY(0);
    transition: opacity var(--lux-dur) var(--lux-ease) var(--rxd, 0ms),
                transform var(--lux-dur) var(--lux-ease) var(--rxd, 0ms);
    will-change: auto;
}

/* ------------------------------------------------------------
   3) Skeleton shimmer for async-loaded regions.
   JS adds .skel-on while a container still shows "Loading…" text
   and removes it the moment real content lands.
   ------------------------------------------------------------ */
.skel-on { position: relative; min-height: 64px; }
.skel-on > * { visibility: hidden; }           /* reserve space, hide the raw "Loading…" word */
.skel-on::before,
.skel-on::after {
    content: '';
    position: absolute;
    left: 0; right: 0;
    border-radius: 8px;
    background: linear-gradient(100deg,
        rgba(139, 92, 246, 0.06) 20%,
        rgba(139, 92, 246, 0.16) 40%,
        rgba(16, 185, 129, 0.10) 60%,
        rgba(139, 92, 246, 0.06) 80%);
    background-size: 220% 100%;
    animation: luxShimmer 1.4s linear infinite;
}
.skel-on::before { top: 6px; height: 22px; width: 62%; }
.skel-on::after  { top: 38px; height: 14px; width: 84%; opacity: 0.7; }
@keyframes luxShimmer {
    from { background-position: 130% 0; }
    to   { background-position: -90% 0; }
}
/* Rows containers get a taller multi-bar skeleton */
.skel-on.skel-tall { min-height: 190px; }
.skel-on.skel-tall::before { height: 26px; }
.skel-on.skel-tall::after  { top: 44px; height: 120px; }

/* ------------------------------------------------------------
   4) Lazy-image fade-up. JS opts images in at runtime (never via
   plain CSS, so a JS failure can never hide a real image).
   ------------------------------------------------------------ */
img.lz-fade { opacity: 0; transform: translateY(10px) scale(1.01); }
img.lz-fade.lz-in {
    opacity: 1;
    transform: none;
    transition: opacity 0.6s var(--lux-ease), transform 0.6s var(--lux-ease);
}

/* ------------------------------------------------------------
   5) "IMAGE NEEDED" placeholder — obvious, honest, clickable.
   Whole card links to /image-prompts entry for that exact asset.
   Aspect ratio is set inline per instance (exact production dims).
   ------------------------------------------------------------ */
.img-needed {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    text-align: center;
    text-decoration: none;
    border: 2px dashed rgba(139, 92, 246, 0.5);
    border-radius: 14px;
    background:
        radial-gradient(circle at 30% 20%, rgba(139, 92, 246, 0.10), transparent 55%),
        radial-gradient(circle at 75% 85%, rgba(16, 185, 129, 0.07), transparent 50%),
        repeating-linear-gradient(45deg,
            rgba(139, 92, 246, 0.05) 0 12px,
            rgba(10, 10, 20, 0) 12px 24px),
        rgba(15, 15, 26, 0.6);
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
    overflow: hidden;
    padding: 10px;
}
.img-needed:hover,
.img-needed:focus-visible {
    border-color: rgba(139, 92, 246, 0.9);
    box-shadow: 0 0 24px rgba(139, 92, 246, 0.25);
    transform: translateY(-2px);
}
.in-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--lux-gold, #f4c04e);
    background: rgba(244, 192, 78, 0.09);
    border: 1px solid rgba(244, 192, 78, 0.35);
    border-radius: 10px;
    padding: 3px 10px;
}
.in-dims {
    font-size: 12px;
    font-weight: 700;
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 8px;
    padding: 2px 10px;
    font-variant-numeric: tabular-nums;
}
.in-title { font-size: 13px; font-weight: 700; color: #f8fafc; line-height: 1.3; }
.in-link {
    font-size: 11.5px;
    font-weight: 600;
    color: #a78bfa;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.img-needed:hover .in-link { color: #c4b5fd; }
/* Compact square variant used for prophet avatars */
.img-needed.in-avatar { gap: 5px; padding: 8px; border-radius: 12px; }
.img-needed.in-avatar .in-title { display: none; }
.img-needed.in-avatar .in-link { font-size: 10.5px; }

/* Shipped art: WebP first with an SEO-friendly PNG fallback. */
.site-media,
.prophet-portrait {
    display: block;
    width: 100%;
}
.site-media img,
.prophet-portrait img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--border-color);
    background: #0A0A14;
}
.site-media img { border-radius: 14px; }
.prophet-portrait { margin-bottom: 12px; }
.prophet-portrait img {
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 12px;
}

/* ------------------------------------------------------------
   6) Count-up numerals — prevent layout shift while animating.
   ------------------------------------------------------------ */
.lux-count { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------
   7) Accessibility: reduced motion kills every effect instantly.
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
    html.lux-on body { animation: none; }
    html.lux-on .rx,
    html.lux-on .rx-in { opacity: 1 !important; transform: none !important; transition: none !important; }
    .skel-on::before, .skel-on::after { animation: none; background: rgba(139, 92, 246, 0.10); }
    img.lz-fade { opacity: 1; transform: none; transition: none; }
    .img-needed { transition: none; }
    .img-needed:hover { transform: none; }
}

/* Small screens: soften travel distance */
@media (max-width: 480px) {
    html.lux-on .rx { transform: translateY(12px); }
    .img-needed.in-avatar { min-height: 96px; }
}
