/* Ropurchase homepage styles. Loaded after market.css, and only by index.html.
   Every selector starts with .home- (or sits inside a .home- element), so
   nothing here can reach any other page. Layout breakpoints are container
   queries on .home-wrap, because the 200px nav rail eats into the viewport. */

.market-content.home-content,
.market-footer.home-footer {
    --home-ease: cubic-bezier(0.22, 0.8, 0.3, 1);
    --home-line: rgba(148, 178, 214, 0.14);
    --home-line-strong: rgba(148, 178, 214, 0.26);
    --home-muted: #8b97a6;
    --home-blue: #7cb2ff;
    --home-focus: #9cc4ff;
    --home-card: linear-gradient(180deg, rgba(23, 31, 39, 0.92) 0%, rgba(16, 22, 28, 0.92) 100%);
    --home-row-h: 68px;
}

/* ---------- Page frame ---------- */

.market-content.home-content {
    width: 100%;
    max-width: 1600px;
    margin-inline: auto;
    gap: 0;
}

.home-content [hidden] { display: none !important; }

.home-content :focus-visible {
    outline: 2px solid var(--home-focus);
    outline-offset: 3px;
}

.home-wrap {
    width: 100%;
    max-width: 1240px;
    margin-inline: auto;
    padding-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 80px;
    container-name: home;
    container-type: inline-size;
}

.home-top {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.home-sec { scroll-margin-top: 88px; }

.home-sec-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 24px;
    margin-bottom: 28px;
}

.home-eyebrow {
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--home-blue);
}

.home-sec-head h2 {
    font-size: clamp(1.6rem, 2.8vw, 2.15rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.12;
}

.home-sec-head p {
    margin-top: 10px;
    max-width: 560px;
    font-size: 15px;
    line-height: 1.65;
    color: var(--text-dim);
    text-wrap: pretty;
}

.home-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 2px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--home-blue);
    transition: color 0.15s ease;
}

.home-link i {
    font-size: 11px;
    transition: transform 0.2s var(--home-ease);
}

.home-link:hover { color: #fff; }
.home-link:hover i { transform: translateX(4px); }

.home-noscript {
    padding: 20px;
    text-align: center;
    color: var(--text-dim);
    font-size: 14px;
}

.home-noscript a { color: var(--home-blue); text-decoration: underline; }

/* home.js didn't load (index.html adds .home-failed): drop the blocks it would fill. */
.home-failed #home-stats,
.home-failed #home-trending,
.home-failed #home-latest,
.home-failed #home-sales { display: none !important; }
.home-failed .home-hero-inner { grid-template-columns: minmax(0, 1fr) !important; }

/* ---------- Buttons ---------- */

.home-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    height: 46px;
    padding: 0 22px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 14.5px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: transform 0.2s var(--home-ease), box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.home-btn i { font-size: 14px; }
.home-btn:hover { transform: translateY(-2px); }
.home-btn:active { transform: translateY(0) scale(0.98); }

.home-btn-primary {
    color: #fff;
    background: linear-gradient(180deg, #4f93ff 0%, #2d6de0 100%);
    box-shadow: 0 10px 28px -10px rgba(59, 130, 246, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.home-btn-primary:hover {
    box-shadow: 0 16px 34px -10px rgba(59, 130, 246, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.home-btn-glass {
    color: #e8f0ff;
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(96, 165, 250, 0.38);
}

.home-btn-glass i { color: var(--home-blue); }

.home-btn-glass:hover {
    background: rgba(59, 130, 246, 0.22);
    border-color: rgba(96, 165, 250, 0.65);
}

.home-btn-ghost {
    color: var(--text-dim);
    background: transparent;
    border-color: var(--home-line-strong);
}

.home-btn-ghost:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.32);
}

.home-btn-light {
    color: #0b1d3f;
    background: #fff;
    box-shadow: 0 12px 28px -12px rgba(0, 0, 0, 0.55);
}

.home-btn-light i { color: #2d6de0; }
.home-btn-light:hover { background: #eaf2ff; }

.home-btn-outline {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.4);
}

.home-btn-outline:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.7);
}

/* ---------- Skeleton shimmer ---------- */

.home-skel {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: rgba(148, 178, 214, 0.1);
}

.home-skel::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    animation: home-shimmer 1.5s ease-in-out infinite;
}

.home-skel-line { display: block; width: 100%; height: 12px; }
.home-skel-line.is-short { width: 58%; }

@keyframes home-shimmer { to { transform: translateX(100%); } }

@keyframes home-pulse {
    0% { box-shadow: 0 0 0 0 rgba(31, 191, 107, 0.55); }
    70% { box-shadow: 0 0 0 9px rgba(31, 191, 107, 0); }
    100% { box-shadow: 0 0 0 0 rgba(31, 191, 107, 0); }
}

@keyframes home-rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

/* ---------- Hero ---------- */

.home-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border-radius: 24px;
    border: 1px solid var(--home-line);
    background:
        radial-gradient(900px 460px at 88% 0%, rgba(59, 130, 246, 0.24), transparent 62%),
        radial-gradient(640px 380px at 0% 100%, rgba(34, 211, 238, 0.07), transparent 62%),
        linear-gradient(180deg, #0f161d 0%, #0c1115 100%);
    box-shadow: 0 32px 80px -44px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* The crest art, toned down and pushed to the right behind the sales card. */
.home-hero-art {
    position: absolute;
    inset: 0 0 0 auto;
    width: 78%;
    z-index: -3;
    background: url("bg2.png") 60% 42% / cover no-repeat;
    opacity: 0.5;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.4) 28%, #000 62%);
    mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.4) 28%, #000 62%);
}

/* Faint dot grid. */
.home-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    opacity: 0.55;
    background-image: radial-gradient(rgba(148, 178, 214, 0.16) 1px, transparent 1.2px);
    background-size: 26px 26px;
    -webkit-mask-image: radial-gradient(70% 90% at 20% 10%, #000, transparent 75%);
    mask-image: radial-gradient(70% 90% at 20% 10%, #000, transparent 75%);
}

/* Vignette so the text stays readable and the hero melts into the page. */
.home-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(12, 17, 21, 0.78) 0%, rgba(12, 17, 21, 0.35) 48%, rgba(12, 17, 21, 0) 100%),
        linear-gradient(180deg, rgba(12, 17, 21, 0) 62%, rgba(12, 17, 21, 0.85) 100%);
}

.home-hero-inner {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    gap: 32px;
    padding: 28px 16px 16px;
}

.home-hero-copy { min-width: 0; }

.home-hero-copy > * { animation: home-rise 0.7s var(--home-ease) both; }
.home-hero-copy > :nth-child(2) { animation-delay: 0.06s; }
.home-hero-copy > :nth-child(3) { animation-delay: 0.12s; }
.home-hero-copy > :nth-child(4) { animation-delay: 0.18s; }
.home-hero-copy > :nth-child(5) { animation-delay: 0.24s; }
.home-hero-copy > :nth-child(6) { animation-delay: 0.3s; }

.home-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    max-width: 100%;
    padding: 7px 14px 7px 12px;
    border-radius: 999px;
    border: 1px solid rgba(96, 165, 250, 0.3);
    background: rgba(59, 130, 246, 0.1);
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.3;
    color: #d3e2ff;
}

.home-pill-dot {
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    animation: home-pulse 2s ease-out infinite;
}

.home-hero h1 {
    margin: 22px 0 18px;
    font-size: clamp(2.2rem, 4.5vw, 3.6rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.035em;
    text-wrap: balance;
}

.home-grad { color: var(--accent); }

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
    .home-grad {
        background: linear-gradient(92deg, #93c5ff 0%, #3b82f6 48%, #22d3ee 100%);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        color: transparent;
    }
}

.home-hero-sub {
    max-width: 33rem;
    font-size: 1.05rem;
    line-height: 1.65;
    color: var(--text-dim);
}

.home-search {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 520px;
    margin-top: 28px;
    padding: 6px 6px 6px 16px;
    border: 1px solid var(--home-line-strong);
    border-radius: 14px;
    background: rgba(23, 31, 39, 0.75);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.home-search:focus-within {
    border-color: rgba(96, 165, 250, 0.75);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.18), 0 14px 32px -14px rgba(59, 130, 246, 0.6);
}

.home-search > i { flex: none; font-size: 14px; color: var(--home-muted); }

.home-search input {
    flex: 1;
    min-width: 0;
    height: 42px;
    border: 0;
    outline: 0;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    color: var(--text);
    font-size: 15px;
}

.home-search input::placeholder { color: var(--home-muted); }
.home-search input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.home-search input:focus-visible { outline: none; }

.home-search-btn {
    flex: none;
    height: 42px;
    padding: 0 20px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(180deg, #4f93ff 0%, #2d6de0 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    transition: filter 0.15s ease, transform 0.15s ease;
}

.home-search-btn:hover { filter: brightness(1.12); }
.home-search-btn:active { transform: scale(0.97); }

.home-hero-ctas {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

.home-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 28px;
    list-style: none;
}

.home-trust li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border: 1px solid var(--home-line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-dim);
}

.home-trust i { font-size: 12px; color: var(--accent); }

/* ---------- Live sales card ---------- */

.home-sales {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    border-radius: 20px;
    border: 1px solid rgba(148, 178, 214, 0.2);
    background: linear-gradient(180deg, rgba(25, 34, 43, 0.74) 0%, rgba(16, 22, 28, 0.7) 100%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    backdrop-filter: blur(18px) saturate(140%);
    box-shadow: 0 32px 70px -28px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.07);
    animation: home-rise 0.8s 0.2s var(--home-ease) both;
}

.home-sales::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    z-index: 0;
    height: 130px;
    pointer-events: none;
    background: radial-gradient(60% 100% at 50% 0%, rgba(59, 130, 246, 0.26), transparent 72%);
}

.home-sales > * { position: relative; z-index: 1; }

.home-sales-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px 12px;
}

.home-sales-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.home-sales-title > div { min-width: 0; }

.home-sales-ico {
    flex: none;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    border: 1px solid rgba(96, 165, 250, 0.35);
    background: radial-gradient(circle at 30% 20%, rgba(96, 165, 250, 0.5), rgba(59, 130, 246, 0.14));
    box-shadow: 0 8px 20px -8px rgba(59, 130, 246, 0.7);
    font-size: 15px;
    color: #a9cdff;
}

.home-sales-title h2 {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.home-sales-count {
    margin-top: 3px;
    font-size: 12.5px;
    color: var(--home-muted);
}

.home-live {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid rgba(31, 191, 107, 0.32);
    background: rgba(31, 191, 107, 0.12);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: #4ade80;
}

.home-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    animation: home-pulse 2s ease-out infinite;
}

.home-sales-body { padding: 0 12px; }

/* Fixed-height window: shows up to 5 rows and slides when there are more. */
.home-sales-view {
    position: relative;
    height: calc(var(--home-row-h) * var(--home-rows, 5));
    overflow: hidden;
    overflow: clip;
}

.home-sales-track {
    list-style: none;
    will-change: transform;
}

.home-sale {
    height: var(--home-row-h);
    list-style: none;
    transition: opacity 0.5s ease;
}

.home-sale.is-leaving { opacity: 0; }

.home-sales-track.is-fresh .home-sale {
    animation: home-rise 0.55s var(--home-ease) both;
    animation-delay: calc(var(--i, 0) * 70ms);
}

.home-sale-link {
    display: flex;
    align-items: center;
    gap: 14px;
    height: 100%;
    padding: 0 10px;
    border-radius: 14px;
    transition: background-color 0.2s ease;
}

a.home-sale-link:hover { background: rgba(255, 255, 255, 0.05); }

/* The rows sit in a clipped window, so the focus ring goes inside the row. */
.home-sale-link:focus-visible {
    outline-offset: -2px;
    border-radius: 14px;
}

.home-sale-thumb {
    position: relative;
    flex: none;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid var(--home-line);
    background: radial-gradient(circle at 50% 38%, rgba(59, 130, 246, 0.28), transparent 75%), var(--bg-2);
    font-size: 16px;
    color: var(--home-muted);
}

.home-sale-thumb img {
    width: 100%;
    height: 100%;
    padding: 3px;
    object-fit: contain;
}

.home-sale-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.home-sale-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14.5px;
    font-weight: 700;
    line-height: 1.25;
    color: #fff;
}

.home-sale-sub {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    white-space: nowrap;
    font-size: 12.5px;
    line-height: 1.2;
    color: var(--home-muted);
}

.home-sale-who {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.home-sale-who b { font-weight: 700; color: var(--text-dim); }
.home-sale-sep, .home-ago { flex: none; }

.home-sale-price {
    flex: none;
    padding: 6px 11px;
    border-radius: 10px;
    background: rgba(31, 191, 107, 0.11);
    font-size: 15px;
    font-weight: 800;
    color: #3fdc8a;
    font-variant-numeric: tabular-nums;
}

.home-sale.is-skel .home-sale-thumb {
    border-color: transparent;
    background: rgba(148, 178, 214, 0.1);
}

.home-sale.is-skel .home-sale-main { gap: 9px; }
.home-skel-price { flex: none; width: 62px; height: 30px; border-radius: 10px; }

.home-sales-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: calc(var(--home-row-h) * 4);
    padding: 20px 16px;
    text-align: center;
}

.home-sales-empty-ico {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    margin-bottom: 8px;
    border-radius: 50%;
    border: 1px solid rgba(96, 165, 250, 0.3);
    background: radial-gradient(circle at 30% 20%, rgba(96, 165, 250, 0.4), rgba(59, 130, 246, 0.1));
    box-shadow: 0 0 40px -6px rgba(59, 130, 246, 0.55);
    font-size: 22px;
    color: #a9cdff;
}

.home-sales-empty strong { font-size: 16px; font-weight: 800; }

.home-sales-empty p {
    max-width: 240px;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--text-dim);
}

.home-sales-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 4px 12px;
    margin-top: 8px;
    padding: 14px 20px 16px;
    border-top: 1px solid var(--home-line);
    font-size: 12.5px;
}

.home-sales-foot .home-link { white-space: nowrap; }
.home-sales-total { min-width: 0; color: var(--text-dim); }
.home-sales-total b { font-weight: 800; color: #fff; }

/* ---------- Stats strip ---------- */

.home-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.home-stat {
    --tone: 96, 165, 250;
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 16px;
    border-radius: 16px;
    border: 1px solid var(--home-line);
    background: var(--home-card);
    transition: translate 0.25s var(--home-ease), border-color 0.25s ease, box-shadow 0.25s ease;
}

.home-stat:hover {
    translate: 0 -3px;
    border-color: rgba(var(--tone), 0.45);
    box-shadow: 0 18px 36px -22px rgba(var(--tone), 0.6);
}

.home-stat-ico {
    flex: none;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    border: 1px solid rgba(var(--tone), 0.28);
    background: radial-gradient(circle at 30% 20%, rgba(var(--tone), 0.32), rgba(var(--tone), 0.08));
    font-size: 18px;
    color: rgb(var(--tone));
}

.home-stat-body { min-width: 0; }

.home-stat-num {
    font-size: clamp(1.35rem, 2.4vw, 1.75rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.home-stat-label {
    margin-top: 5px;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--home-muted);
}

.home-stat.is-loading .home-stat-num {
    position: relative;
    overflow: hidden;
    width: 2.6em;
    height: 1.1em;
    border-radius: 8px;
    background: rgba(148, 178, 214, 0.12);
    color: transparent;
}

.home-stat.is-loading .home-stat-num::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    animation: home-shimmer 1.5s ease-in-out infinite;
}

/* ---------- Pay-with strip ---------- */

.home-pay {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 20px;
    padding: 14px 18px;
    border-radius: 16px;
    border: 1px solid var(--home-line);
    background: rgba(16, 22, 28, 0.7);
}

.home-pay-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-dim);
}

.home-pay-label i { color: var(--home-blue); }

.home-pay-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
}

.home-coin {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--home-line);
    background: rgba(255, 255, 255, 0.04);
    font-size: 12.5px;
    font-weight: 700;
    color: #e6edf5;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.home-coin::before {
    content: "";
    flex: none;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--c, var(--accent));
    box-shadow: 0 0 10px var(--c, var(--accent));
}

.home-coin:hover {
    border-color: var(--home-line-strong);
    background: rgba(255, 255, 255, 0.07);
}

.home-coin small { font-size: 11px; font-weight: 700; color: var(--home-muted); }

/* ---------- Trending limiteds ---------- */

.home-trend-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
}

.home-trend-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 14px;
    border-radius: 20px;
    border: 1px solid var(--home-line);
    background: var(--home-card);
    transition: translate 0.25s var(--home-ease), border-color 0.25s ease, box-shadow 0.25s ease;
}

a.home-trend-card:hover {
    translate: 0 -5px;
    border-color: rgba(96, 165, 250, 0.5);
    box-shadow: 0 24px 44px -20px rgba(0, 0, 0, 0.75), 0 0 44px -14px rgba(59, 130, 246, 0.5);
}

.home-trend-tile {
    position: relative;
    aspect-ratio: 1 / 1;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 14px;
    border: 1px solid var(--home-line);
    background: radial-gradient(circle at 50% 42%, rgba(59, 130, 246, 0.3), rgba(59, 130, 246, 0.07) 55%, transparent 76%), var(--bg-2);
    font-size: 34px;
    color: var(--home-muted);
}

.home-trend-tile img {
    width: 76%;
    height: 76%;
    object-fit: contain;
    filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.5));
    transition: transform 0.45s var(--home-ease);
}

a.home-trend-card:hover .home-trend-tile img { transform: scale(1.07) rotate(-2deg); }

.home-trend-rank,
.home-trend-escrow {
    position: absolute;
    top: 10px;
    z-index: 1;
    border-radius: 8px;
    border: 1px solid var(--home-line);
    background: rgba(12, 17, 21, 0.78);
}

.home-trend-rank {
    left: 10px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #ffd479;
}

.home-trend-escrow {
    right: 10px;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    font-size: 11px;
    color: var(--green);
}

.home-trend-name {
    margin: 14px 2px 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 15px;
    font-weight: 700;
}

.home-trend-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 24px;
    margin: 0 2px 12px;
}

.home-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 7px;
    font-size: 10.5px;
    font-weight: 700;
    white-space: nowrap;
}

.home-badge i { font-size: 10px; }
.home-badge.is-verified { color: #8ec0ff; background: var(--accent-soft); }
.home-badge.is-stock { color: #3fdc8a; background: rgba(31, 191, 107, 0.14); }

.home-trend-foot {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    padding: 12px 2px 0;
    border-top: 1px dashed var(--home-line-strong);
}

.home-trend-foot > div:last-child { text-align: right; }

.home-trend-lab {
    display: block;
    margin-bottom: 3px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--home-muted);
}

.home-trend-lab.is-rap,
.home-trend-rap { color: var(--limited-rap, #ff5470); }

.home-trend-rap {
    font-size: 14px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.home-trend-price {
    font-size: 17px;
    font-weight: 800;
    color: #3fdc8a;
    font-variant-numeric: tabular-nums;
}

.home-trend-card.is-skel .home-skel-line { margin-top: 10px; }
.home-trend-card.is-skel .home-skel-tile + .home-skel-line { margin-top: 16px; }
.home-skel-tile { aspect-ratio: 1 / 1; width: 100%; border-radius: 14px; }
.home-skel-foot { height: 40px; margin-top: 18px; border-radius: 10px; }

/* ---------- Latest listings ---------- */

.home-listing-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
}

/* The cards themselves come from market.js (same markup as the Listings page). */
.home-listing-grid .listing-card {
    height: 100%;
    border-radius: 20px;
    border-color: var(--home-line);
    background: var(--home-card);
}

.home-listing-grid .listing-card:hover {
    border-color: rgba(96, 165, 250, 0.5);
    box-shadow: 0 24px 44px -20px rgba(0, 0, 0, 0.75), 0 0 44px -14px rgba(59, 130, 246, 0.5);
}

.home-skel-card {
    overflow: hidden;
    border-radius: 20px;
    border: 1px solid var(--home-line);
    background: var(--home-card);
}

.home-skel-thumb { aspect-ratio: 16 / 9; width: 100%; border-radius: 0; }

.home-skel-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px 16px 20px;
}

.home-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 56px 24px;
    text-align: center;
    border-radius: 20px;
    border: 1px dashed var(--home-line-strong);
    background: radial-gradient(60% 90% at 50% 0%, rgba(59, 130, 246, 0.13), transparent 70%), rgba(16, 22, 28, 0.6);
}

.home-empty-ico {
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    margin-bottom: 10px;
    border-radius: 50%;
    border: 1px solid rgba(96, 165, 250, 0.3);
    background: radial-gradient(circle at 30% 20%, rgba(96, 165, 250, 0.4), rgba(59, 130, 246, 0.1));
    box-shadow: 0 0 60px -8px rgba(59, 130, 246, 0.6);
    font-size: 28px;
    color: #a9cdff;
}

.home-empty h3 {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.home-empty p {
    max-width: 420px;
    margin-bottom: 14px;
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--text-dim);
}

/* ---------- Cursor spotlight (steps + why tiles) ---------- */

.home-spot > * { position: relative; }

.home-spot::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 0%), rgba(59, 130, 246, 0.16), transparent 62%);
}

.home-spot:hover::before { opacity: 1; }

/* ---------- How it works ---------- */

.home-steps {
    --home-gap: 20px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--home-gap);
}

.home-step {
    --home-step-pad: 24px;
    position: relative;
    padding: var(--home-step-pad);
    border-radius: 20px;
    border: 1px solid var(--home-line);
    background: var(--home-card);
    transition: translate 0.25s var(--home-ease), border-color 0.25s ease, box-shadow 0.25s ease;
}

.home-step:hover,
.home-tile:hover {
    translate: 0 -4px;
    border-color: rgba(96, 165, 250, 0.42);
    box-shadow: 0 24px 44px -24px rgba(0, 0, 0, 0.8), 0 0 40px -16px rgba(59, 130, 246, 0.5);
}

/* Dashed connector between the step badges (vertical on small screens). */
.home-step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 100%;
    left: calc(var(--home-step-pad) + 27px);
    width: 2px;
    height: var(--home-gap);
    background: repeating-linear-gradient(180deg, rgba(96, 165, 250, 0.6) 0 5px, transparent 5px 10px);
}

.home-step-badge {
    position: relative;
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    margin-bottom: 20px;
    border-radius: 50%;
    background: linear-gradient(145deg, #4f93ff, #2350b8);
    box-shadow: 0 14px 30px -10px rgba(59, 130, 246, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    font-size: 21px;
    color: #fff;
}

.home-step-no {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 2px solid #4f93ff;
    background: var(--bg-0);
    font-size: 11px;
    font-weight: 800;
    color: #cfe1ff;
}

.home-step-ghost {
    position: absolute;
    top: 12px;
    right: 20px;
    font-size: 64px;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
    color: rgba(148, 178, 214, 0.07);
    pointer-events: none;
    user-select: none;
}

.home-step h3 {
    margin-bottom: 8px;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.015em;
}

.home-step p {
    font-size: 14.5px;
    line-height: 1.65;
    color: var(--text-dim);
}

/* ---------- Why Ropurchase ---------- */

.home-tiles {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
}

.home-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 24px;
    border-radius: 20px;
    border: 1px solid var(--home-line);
    background: var(--home-card);
    transition: translate 0.25s var(--home-ease), border-color 0.25s ease, box-shadow 0.25s ease;
}

.home-tile-ico {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    margin-bottom: 18px;
    border-radius: 14px;
    border: 1px solid rgba(96, 165, 250, 0.3);
    background: radial-gradient(circle at 30% 20%, rgba(96, 165, 250, 0.38), rgba(59, 130, 246, 0.1));
    font-size: 18px;
    color: #a9cdff;
}

.home-tile h3 {
    margin-bottom: 8px;
    font-size: 16.5px;
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.home-tile p {
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-dim);
}

.home-tile .home-link { margin-top: 12px; }

/* ---------- Sell banner ---------- */

.home-cta {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 28px;
    padding: 36px 24px;
    border-radius: 26px;
    border: 1px solid rgba(147, 197, 253, 0.3);
    background:
        radial-gradient(620px 320px at 100% 0%, rgba(34, 211, 238, 0.26), transparent 62%),
        radial-gradient(560px 360px at 0% 110%, rgba(79, 147, 255, 0.4), transparent 64%),
        linear-gradient(120deg, #0f2f6b 0%, #1a46a3 48%, #1b57c4 100%);
    box-shadow: 0 40px 90px -44px rgba(59, 130, 246, 0.8);
}

.home-cta::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: 50%;
    right: -120px;
    width: 420px;
    height: 420px;
    transform: translateY(-50%);
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 0 0 60px rgba(255, 255, 255, 0.03), 0 0 0 120px rgba(255, 255, 255, 0.02);
}

.home-cta::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: 0.5;
    background-image: radial-gradient(rgba(255, 255, 255, 0.22) 1px, transparent 1.2px);
    background-size: 24px 24px;
    -webkit-mask-image: linear-gradient(90deg, transparent 30%, #000);
    mask-image: linear-gradient(90deg, transparent 30%, #000);
}

.home-cta h2 {
    max-width: 640px;
    font-size: clamp(1.6rem, 3vw, 2.3rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: #fff;
}

.home-cta p {
    max-width: 560px;
    margin-top: 12px;
    font-size: 15.5px;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.9);
}

.home-cta-copy { min-width: 0; }

.home-cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* ---------- Footer ---------- */

.market-footer.home-footer {
    padding: 56px 28px 28px;
    border-top: 1px solid var(--home-line);
    background: linear-gradient(180deg, var(--bg-1) 0%, #0a0f13 100%);
}

.home-footer-inner {
    max-width: 1240px;
    margin-inline: auto;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.home-footer-cols {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px 24px;
}

.home-footer-brand {
    grid-column: 1 / -1;
    max-width: 360px;
}

.home-footer-logo {
    display: inline-flex;
    margin-bottom: 14px;
    border-radius: 10px;
}

.home-footer-logo img {
    display: block;
    height: 44px;
    width: auto;
}

.home-footer-brand p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-dim);
}

.home-footer-col {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.home-footer-col h3 {
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--home-muted);
}

.home-footer-col a {
    padding: 5px 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dim);
    transition: color 0.15s ease, transform 0.2s var(--home-ease);
}

.home-footer-col a:hover {
    color: #fff;
    transform: translateX(3px);
}

.home-footer a:focus-visible {
    outline: 2px solid var(--home-focus);
    outline-offset: 3px;
    border-radius: 6px;
}

.home-footer-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px 32px;
    padding-top: 24px;
    border-top: 1px solid var(--home-line);
}

.home-footer-note {
    max-width: 720px;
    font-size: 12px;
    line-height: 1.7;
    color: var(--home-muted);
}

.home-footer-copy {
    font-size: 12px;
    white-space: nowrap;
    color: var(--home-muted);
}

/* ---------- Scroll reveal (the .home-reveal class is added by home.js only,
   so everything stays visible if scripts fail) ---------- */

.home-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s var(--home-ease) var(--home-d, 0ms), transform 0.7s var(--home-ease) var(--home-d, 0ms);
}

.home-reveal.is-in {
    opacity: 1;
    transform: none;
}

.home-step.home-reveal,
.home-tile.home-reveal {
    transition:
        opacity 0.7s var(--home-ease) var(--home-d, 0ms),
        transform 0.7s var(--home-ease) var(--home-d, 0ms),
        translate 0.25s var(--home-ease),
        border-color 0.25s ease,
        box-shadow 0.25s ease;
}

/* ---------- Responsive: container queries on .home-wrap ---------- */

@container home (min-width: 480px) {
    .home-trend-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@container home (min-width: 520px) {
    .home-hero-inner { padding: 36px 28px 28px; }
    /* Cards wrap and grow, so a short last row still fills the width. */
    .home-stats {
        display: flex;
        flex-wrap: wrap;
        gap: 16px;
    }
    .home-stat {
        flex: 1 1 190px;
        padding: 18px;
    }
    .home-cta { padding: 44px 36px; }
}

@container home (min-width: 560px) {
    .home-listing-grid,
    .home-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@container home (min-width: 800px) {
    .home-steps {
        --home-gap: 32px;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .home-step { --home-step-pad: 28px; }

    /* Connector runs sideways through the gap at badge height. */
    .home-step:not(:last-child)::after {
        top: calc(var(--home-step-pad) + 27px);
        left: 100%;
        width: var(--home-gap);
        height: 2px;
        background: repeating-linear-gradient(90deg, rgba(96, 165, 250, 0.6) 0 5px, transparent 5px 10px);
    }
}

@container home (min-width: 920px) {
    .home-hero-inner {
        grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
        gap: 40px;
        min-height: 560px;
        padding: 64px 48px;
    }

    .home-hero h1 { font-size: clamp(2.4rem, 1rem + 3.2cqi, 3.6rem); }

    .home-listing-grid,
    .home-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }

    .home-cta {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 40px;
        padding: 52px 56px;
    }

    .home-cta-actions { flex: none; }
}

@container home (min-width: 960px) {
    .home-trend-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Stacked hero: the copy spans the whole width, so keep the crest art quieter behind it. */
@container home (max-width: 919px) {
    .home-hero-art { opacity: 0.3; }
}

@container home (max-width: 479px) {
    .home-trend-tile,
    .home-skel-tile { aspect-ratio: 4 / 3; }
}

@container home (max-width: 519px) {
    .home-hero { border-radius: 22px; }
    .home-hero h1 { font-size: 2rem; }
    .home-hero-sub { font-size: 1rem; }
    .home-hero-ctas .home-btn,
    .home-cta-actions .home-btn { flex: 1 1 100%; }
    .home-search-btn { padding: 0 16px; }

    .home-sales { --home-row-h: 62px; }
    .home-sales-head { padding: 16px 16px 10px; }
    .home-sales-body { padding: 0 8px; }
    .home-sale-link { gap: 10px; padding: 0 8px; }
    .home-sale-thumb { width: 40px; height: 40px; }
    .home-sale-name { font-size: 14px; }
    .home-sale-price { padding: 5px 9px; font-size: 14px; }
    .home-sales-foot { padding: 12px 16px 14px; }

    .home-stat { gap: 12px; padding: 14px; }
    .home-stat-ico { width: 40px; height: 40px; font-size: 16px; }
    .home-stats .home-stat.is-last-odd { grid-column: 1 / -1; }

    .home-skel-card:nth-child(n + 3) { display: none; }
    .home-empty { padding: 40px 18px; }
}

/* Footer sits outside .home-wrap, so it uses plain viewport queries. */
@media (min-width: 720px) {
    .home-footer-cols { grid-template-columns: 1.6fr repeat(3, minmax(0, 1fr)); }
    .home-footer-brand { grid-column: auto; }
}

@media (max-width: 640px) {
    .market-content.home-content {
        width: calc(100% + 16px);
        margin-inline: -8px;
    }

    .home-wrap { gap: 56px; }
    .market-footer.home-footer { padding: 40px 16px 24px; }
}

/* Where the nav rail stacks above the page (market.css, 900px and below), keep it after the
   homepage content so the hero is the first thing on a phone. */
@media (max-width: 900px) {
    .market-content.home-content { order: -1; }
}

/* ---------- Reduced motion: no animation or transitions at all ---------- */

@media (prefers-reduced-motion: reduce) {
    .home-content *,
    .home-content *::before,
    .home-content *::after,
    .home-footer * {
        animation: none !important;
        transition: none !important;
    }

    .home-reveal {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ---------- Trending Limiteds: items on sale (Admin > Sale) ---------- */
a.home-trend-card.is-sale,
.home-trend-card.is-sale {
    border-color: rgba(255, 176, 32, 0.7);
    background: linear-gradient(180deg, rgba(255, 176, 32, 0.09), var(--bg-1) 55%);
    box-shadow: 0 0 0 1px rgba(255, 176, 32, 0.28), 0 0 22px rgba(255, 176, 32, 0.26);
}

.home-trend-sale {
    position: absolute;
    left: 8px;
    bottom: 8px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
    color: #2a1500;
    background: linear-gradient(90deg, #ffb020, #ff8a3d);
    box-shadow: 0 2px 10px rgba(255, 140, 30, 0.5);
}

.home-trend-old {
    display: block;
    margin-bottom: 1px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: line-through;
    text-decoration-color: rgba(255, 84, 112, 0.95);
}

.home-trend-price.is-sale {
    color: #ffd27a;
    text-shadow: 0 0 14px rgba(255, 176, 32, 0.5);
}
