/* =====================================================================
 * Stage — public showcase / template browse page (/stage, /templates)
 *
 * Editorial gallery layout. Apple Newsroom + magazine-cover inspired.
 *
 *   • Compact hero — eyebrow + tight headline + tagline. The featured
 *     mosaic below is the visual centrepiece, not the title bar.
 *   • Featured mosaic — 1 hero card + 3 companions on desktop.
 *   • Sticky toolbar — category pills + search. Sort row sits below.
 *   • Image-only cards — hover reveals title + author + Use-template CTA
 *     over a gradient scrim. On touch devices (no hover) the meta is
 *     always visible underneath the image, per Editorial Gallery spec.
 *
 * All tokens come from variables.css (DESIGN.md §2). One iridescent
 * moment per surface lives on the wordmark span. Hairlines use the
 * canonical rgba(text, 0.06 ~ 0.5) pattern.
 * ===================================================================== */

/* Body wrapper opt-out so the aura can go full-bleed (DESIGN.md §4.5). */
#wrapper-contents {
    padding: 0;
    background-color: var(--global-body-background);
}

.stage {
    position: relative;
    width: 100%;
    min-height: calc(100vh - var(--header-height) - var(--footer-height));
    padding: clamp(64px, 9vh, 104px) clamp(24px, 4vw, 48px) clamp(64px, 10vh, 120px);
    isolation: isolate;
    overflow: clip;
    word-break: keep-all;
    overflow-wrap: anywhere;
}

/* ---------- Ambient aura ---------- */
.stage-aura {
    position: absolute;
    inset: -20% -10% auto -10%;
    height: 80%;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(32% 42% at 20% 22%, rgba(var(--brand-iris-rgb),     0.20), transparent 72%),
        radial-gradient(30% 40% at 78% 18%, rgba(var(--brand-mulberry-rgb), 0.16), transparent 72%),
        radial-gradient(36% 42% at 58% 70%, rgba(var(--brand-lichen-rgb),   0.16), transparent 72%),
        radial-gradient(28% 32% at 42% 8%,  rgba(var(--brand-brass-rgb),    0.12), transparent 70%);
    filter: blur(80px) saturate(118%);
    opacity: 0.85;
    animation: stage-aura-drift 26s ease-in-out infinite alternate;
}
@keyframes stage-aura-drift {
    0%   { transform: translate3d(-2%, -1%, 0) scale(1); }
    50%  { transform: translate3d( 2%,  1%, 0) scale(1.06); }
    100% { transform: translate3d( 3%, -1%, 0) scale(1.02); }
}

/* ---------- Compact hero ---------- */
.stage-hero {
    max-width: 1080px;
    margin: 0 auto;
    text-align: center;
    padding-bottom: clamp(36px, 5vh, 56px);
}
.stage-eyebrow {
    display: inline-block;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--global-text-muted);
    line-height: 1;
    margin-bottom: 18px;
    opacity: 0;
    animation: stage-fade-up 0.9s cubic-bezier(0.22, 0.61, 0.36, 1) 0.05s forwards;
}

/* Orphan-word guard — balance short display/lead text so the final word
   never wraps onto a line by itself. Progressive enhancement: ignored
   where unsupported, and never alters box dimensions. */
.stage-title,
.stage-tagline,
.stage-section-title,
.stage-empty-title {
    text-wrap: balance;
}
.stage-title {
    margin: 0;
    font-family: inherit;
    font-weight: 800;
    font-size: clamp(34px, 5.4vw, 72px);
    line-height: 1.08;
    letter-spacing: -0.035em;
    display: flex;
    flex-wrap: wrap;
    gap: 0.22em;
    justify-content: center;
    align-items: baseline;
    /* Bottom padding keeps Safari from cropping descenders on the gradient
       span — clip:text uses the text's own box, not the line's. */
    padding-bottom: 0.08em;
    opacity: 0;
    animation: stage-fade-up 1.1s cubic-bezier(0.22, 0.61, 0.36, 1) 0.1s forwards;
}
.stage-title-solid { color: var(--global-text-color); }
.stage-title-grad {
    background: var(--brand-iridescent-gradient);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    padding: 0 0.06em 0.12em;
    display: inline-block;
    animation: brand-iridescent-shift 14s ease infinite;
}
.stage-tagline {
    margin: 18px auto 0;
    max-width: 560px;
    font-weight: 400;
    font-size: clamp(15px, 1.3vw, 17px);
    line-height: 1.6;
    letter-spacing: -0.005em;
    color: var(--global-text-muted);
    opacity: 0;
    animation: stage-fade-up 1.2s cubic-bezier(0.22, 0.61, 0.36, 1) 0.2s forwards;
}

/* ---------- Section heads (Featured) ---------- */
.stage-section-head {
    max-width: 1280px;
    margin: 0 auto clamp(16px, 2vh, 24px);
    padding: 0 4px;
    display: flex;
    align-items: baseline;
    gap: 16px;
}
.stage-section-kicker {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--global-text-muted);
    line-height: 1;
}
.stage-section-title {
    margin: 0;
    font-family: inherit;
    font-weight: 600;
    font-size: clamp(18px, 1.8vw, 22px);
    letter-spacing: -0.02em;
    color: var(--global-text-color);
    line-height: 1;
}

/* ---------- Featured mosaic ----------
   Grid template: 1 hero on the left (spans 3 rows) + 3 companions on the
   right (one each row). The hero's aspect-ratio sets the row height; side
   cards fill their allotted slices. Stacks on tablet/mobile. */
.stage-featured {
    max-width: 1280px;
    margin: 0 auto clamp(40px, 6vh, 72px);
    opacity: 0;
    animation: stage-fade-up 1.0s cubic-bezier(0.22, 0.61, 0.36, 1) 0.3s forwards;
}
.stage-featured-grid {
    display: grid;
    gap: clamp(10px, 1vw, 16px);
    grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr);
    grid-template-areas:
        "hero side1"
        "hero side2"
        "hero side3";
}
.stage-featured-grid > .stage-card-hero {
    grid-area: hero;
    aspect-ratio: 4 / 3;
}
.stage-featured-grid > .stage-card:not(.stage-card-hero):nth-child(2) { grid-area: side1; }
.stage-featured-grid > .stage-card:not(.stage-card-hero):nth-child(3) { grid-area: side2; }
.stage-featured-grid > .stage-card:not(.stage-card-hero):nth-child(4) { grid-area: side3; }

/* Fallback for <4 featured items — JS toggles `--row` and the mosaic
   collapses to a clean responsive row. Keeps the layout intentional
   even when the admin has only curated 1–3 items. */
.stage-featured-grid--row {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    grid-template-areas: none;
}
.stage-featured-grid--row > .stage-card { grid-area: auto; aspect-ratio: 4 / 3; }

@media (max-width: 768px) {
    .stage-featured-grid {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: none;
    }
    .stage-featured-grid > .stage-card-hero { aspect-ratio: 16 / 10; }
    .stage-featured-grid > .stage-card { aspect-ratio: 4 / 3; grid-area: auto; }
}

/* ---------- Sticky toolbar — category pills + search ----------
   Floating glass card that sticks under the global header with a small
   air gap so it reads as an elevated control surface, not as part of the
   header chrome. Pills + search inside sit on this card as a second tier,
   keeping two visual levels (not three nested pills). */
.stage-toolbar {
    position: sticky;
    top: calc(var(--header-height) + var(--announcement-h, 0px) + 8px);
    z-index: 50;
    max-width: 1280px;
    margin: 0 auto;
    padding: 8px 10px 8px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--global-card-background);
    border: 1px solid rgba(var(--global-text-color-rgb), 0.08);
    border-radius: 16px;
    box-shadow: 0 12px 32px -16px rgba(var(--global-text-color-rgb), 0.14),
                0 2px 6px -2px rgba(var(--global-text-color-rgb), 0.05);
}
@supports ((backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px))) {
    .stage-toolbar {
        backdrop-filter: blur(14px) saturate(160%);
        -webkit-backdrop-filter: blur(14px) saturate(160%);
        /* Swap to the header's translucent tint when blur is active so the
           aura behind the toolbar still breathes through. */
        background: var(--header-background-color);
    }
}

/* Category pills — horizontal scroll on narrow viewports, no scrollbar. */
.stage-tabs {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 2px 0;
}
.stage-tabs::-webkit-scrollbar { display: none; }

.stage-tab {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 0 14px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--global-text-muted);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: -0.005em;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.18s cubic-bezier(0.22, 0.61, 0.36, 1),
                background-color 0.18s cubic-bezier(0.22, 0.61, 0.36, 1),
                border-color 0.18s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.stage-tab:hover { color: var(--global-text-color); background: var(--state-hover-bg); }
.stage-tab:focus-visible {
    outline: 2px solid var(--focus-outline-color);
    outline-offset: 2px;
}
.stage-tab.is-active {
    color: var(--global-text-color);
    background: var(--state-selected-bg);
    font-weight: 600;
}

/* Search — pill input on the right edge of the toolbar. */
.stage-search {
    flex: 0 0 auto;
    position: relative;
    display: flex;
    align-items: center;
    width: clamp(160px, 28vw, 280px);
    height: 32px;
    padding: 0 12px 0 32px;
    background: var(--state-hover-bg);
    border: 1px solid transparent;
    border-radius: 999px;
    transition: background-color 0.18s ease, border-color 0.18s ease;
}
.stage-search:hover { background: var(--state-active-bg); }
.stage-search:focus-within {
    background: var(--global-card-background);
    border-color: var(--focus-border-color);
    box-shadow: 0 0 0 3px var(--focus-ring-color);
}
.stage-search-icon {
    position: absolute;
    left: 10px;
    color: var(--global-text-muted);
    pointer-events: none;
}
.stage-search:focus-within .stage-search-icon { color: var(--global-text-color); }
#stage-search-input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    font-family: inherit;
    font-size: 13px;
    color: var(--global-text-color);
    letter-spacing: -0.005em;
    padding: 0;
    min-width: 0;
}
#stage-search-input::placeholder { color: var(--global-text-muted); }

@media (max-width: 640px) {
    .stage-toolbar {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px;
        border-radius: 18px;
    }
    .stage-tabs   { order: 2; width: 100%; }
    .stage-search { order: 1; width: 100%; }
}

/* ---------- Theme chips ----------
   A multi-select refinement row that sits between the category tabs and
   the sort row. Visual rhythm matches `.stage-tab` but uses an outline
   resting state so chips read as a secondary filter, not as the primary
   navigation. */
.stage-themes {
    max-width: 1280px;
    margin: 12px auto 0;
    padding: 0 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    /* Smooth the cross-category swap — chips fade in/out instead of
     * snap-replacing when the user switches the active tab. */
    transition: opacity 0.18s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.stage-themes.is-swapping {
    opacity: 0;
}
.stage-themes[hidden] { display: none; }

.stage-theme-chip {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    height: 30px;
    padding: 0 12px;
    background: transparent;
    border: 1px solid var(--global-border-color);
    border-radius: 999px;
    color: var(--global-text-muted);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: -0.005em;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.18s cubic-bezier(0.22, 0.61, 0.36, 1),
                background-color 0.18s cubic-bezier(0.22, 0.61, 0.36, 1),
                border-color 0.18s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.stage-theme-chip:hover {
    color: var(--global-text-color);
    background: var(--state-hover-bg);
}
.stage-theme-chip:focus-visible {
    outline: 2px solid var(--focus-outline-color);
    outline-offset: 2px;
}
.stage-theme-chip.is-active {
    color: var(--global-text-color);
    background: var(--state-selected-bg);
    border-color: transparent;
    font-weight: 600;
}

/* ---------- Result + sort row ---------- */
.stage-sortbar {
    max-width: 1280px;
    margin: 18px auto clamp(20px, 2.5vh, 32px);
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.stage-sortbar-summary {
    font-size: 13px;
    font-weight: 500;
    color: var(--global-text-muted);
    letter-spacing: -0.005em;
    line-height: 1;
}
.stage-sortbar-actions {
    display: flex;
    align-items: center;
    gap: 18px;
}
.stage-sort-btn {
    position: relative;
    padding: 4px 0;
    background: transparent;
    border: 0;
    color: var(--global-text-muted);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: -0.005em;
    line-height: 1;
    cursor: pointer;
    transition: color 0.18s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.stage-sort-btn:hover { color: var(--global-text-color); }
.stage-sort-btn:focus-visible {
    outline: 2px solid var(--focus-outline-color);
    outline-offset: 4px;
    border-radius: 2px;
}
.stage-sort-btn.is-active {
    color: var(--global-text-color);
    font-weight: 600;
}
.stage-sort-btn.is-active::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 1.5px;
    background: var(--global-text-color);
    border-radius: 2px;
}

/* ---------- Main grid ---------- */
.stage-grid {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    gap: clamp(14px, 1.4vw, 22px);
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 1199px) { .stage-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 880px)  { .stage-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px)  { .stage-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Card — editorial, image-dominant ---------- */
.stage-card {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 14px;
    background: var(--global-card-background);
    border: 1px solid rgba(var(--global-text-color-rgb), 0.06);
    text-decoration: none;
    color: inherit;
    isolation: isolate;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.4s cubic-bezier(0.22, 0.61, 0.36, 1),
                box-shadow 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.stage-card:focus-visible {
    outline: 2px solid var(--focus-outline-color);
    outline-offset: 3px;
}

/* Thumbnail — image fills the card; fallback uses a hashed gradient with
   a single letter, so cards without artwork still feel intentional. */
.stage-card-thumb {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: var(--global-hover-color);
}
.stage-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.stage-card-thumb-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.92);
    font-family: 'Paperlogy', 'Pretendard Variable', sans-serif;
    font-weight: 900;
    font-size: clamp(48px, 6vw, 96px);
    letter-spacing: -0.04em;
}

/* Template badge — tiny pill in the top-right corner. Always visible so
   users can tell template cards apart at a glance before hovering. */
.stage-card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 9px;
    background: rgba(15, 15, 18, 0.55);
    color: rgba(255, 255, 255, 0.95);
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    backdrop-filter: blur(6px) saturate(140%);
    -webkit-backdrop-filter: blur(6px) saturate(140%);
}

/* Overlay — gradient scrim + meta. Hidden by default on hover-capable
   devices; revealed via hover. On touch devices we surface it always so
   the title/author stay readable without a hover state. */
.stage-card-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 16px 18px;
    color: rgba(255, 255, 255, 0.96);
    background: linear-gradient(
        to top,
        rgba(15, 15, 18, 0.78) 0%,
        rgba(15, 15, 18, 0.42) 30%,
        rgba(15, 15, 18, 0.00) 65%
    );
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.35s cubic-bezier(0.22, 0.61, 0.36, 1),
                transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}
.stage-card-title {
    margin: 0;
    font-family: inherit;
    font-weight: 600;
    font-size: clamp(15px, 1.1vw, 17px);
    line-height: 1.25;
    letter-spacing: -0.012em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.stage-card-meta {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.78);
    letter-spacing: -0.005em;
}
.stage-card-author {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.stage-card-author-avatar {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.12);
}
.stage-card-author-avatar img { width: 100%; height: 100%; display: block; }
.stage-card-author-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.stage-card-stat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.stage-card-stat svg { width: 12px; height: 12px; }

/* Use-template inline CTA — appears bottom-right of the overlay. Lifts
   above the gradient and uses the iridescent gradient (one moment per
   surface lives on the wordmark, so we use a quiet neutral here). */
.stage-card-use {
    position: absolute;
    right: 14px;
    bottom: 14px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 14px;
    background: rgba(255, 255, 255, 0.96);
    color: var(--global-text-color);
    border: 0;
    border-radius: 999px;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: -0.005em;
    cursor: pointer;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.35s cubic-bezier(0.22, 0.61, 0.36, 1),
                transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
                background-color 0.18s ease;
}
.stage-card-use:hover { background: #fff; }

/* Hover reveal — desktop only. Cards lift with the canonical iridescent
   bloom (DESIGN.md §6.3, alphas reduced one step for grid density). */
@media (hover: hover) {
    .stage-card:hover {
        transform: translateY(-3px);
        border-color: rgba(var(--global-text-color-rgb), 0.04);
        box-shadow:
            -22px -14px 50px -10px rgba(var(--brand-iris-rgb),     0.20),
             22px -14px 50px -10px rgba(var(--brand-mulberry-rgb), 0.18),
             22px  22px 56px -10px rgba(var(--brand-brass-rgb),    0.16),
            -22px  22px 56px -10px rgba(var(--brand-lichen-rgb),   0.20),
              0   28px 56px -24px rgba(var(--global-text-color-rgb), 0.14);
    }
    .stage-card:hover .stage-card-thumb img { transform: scale(1.04); }
    .stage-card:hover .stage-card-overlay,
    .stage-card:focus-within .stage-card-overlay {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }
    .stage-card:hover .stage-card-use,
    .stage-card:focus-within .stage-card-use {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Touch devices — always-on overlay (no hover state available). */
@media (hover: none) {
    .stage-card-overlay { opacity: 1; transform: none; pointer-events: auto; }
    .stage-card-use      { opacity: 1; transform: none; }
}

/* Hero card inside the featured mosaic — bigger title since it has the
   space, slightly stronger gradient so the larger image stays legible. */
.stage-card-hero .stage-card-overlay {
    padding: 22px 26px;
    background: linear-gradient(
        to top,
        rgba(15, 15, 18, 0.82) 0%,
        rgba(15, 15, 18, 0.42) 36%,
        rgba(15, 15, 18, 0.00) 70%
    );
}
.stage-card-hero .stage-card-title {
    font-size: clamp(20px, 1.8vw, 28px);
    letter-spacing: -0.022em;
    -webkit-line-clamp: 2;
}
.stage-card-hero .stage-card-meta {
    margin-top: 10px;
    font-size: 13px;
}
/* Theme chips inside the card overlay. Non-interactive (the whole card
   is a single anchor) so we keep them visually quiet — small frosted
   pills that sit between the title and the meta row. Hero variant
   bumps padding/font slightly to match the larger title. */
.stage-card-themes {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
    pointer-events: none;
}
.stage-card-theme {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 18px;
    padding: 0 7px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: -0.005em;
    color: rgba(255, 255, 255, 0.92);
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    white-space: nowrap;
    max-width: 110px;
    overflow: hidden;
}
.stage-card-theme-label {
    overflow: hidden;
    text-overflow: ellipsis;
}
.stage-card-theme-icon {
    font-size: 10px;
    line-height: 1;
}
.stage-card-hero .stage-card-themes {
    margin-top: 8px;
    gap: 6px;
}
.stage-card-hero .stage-card-theme {
    height: 22px;
    padding: 0 10px;
    font-size: 12px;
    max-width: 160px;
}
.stage-card-hero .stage-card-use {
    height: 34px;
    padding: 0 18px;
    font-size: 13px;
    right: 22px;
    bottom: 22px;
}

/* Mobile / touch — use-template flow is suppressed entirely (see
   use-template-modal.css). Hide the inline CTA so users don't see a
   dead button. Tapping the card still navigates to the detail page. */
@media (max-width: 768px), (hover: none) and (pointer: coarse) {
    .stage-card-use { display: none !important; }
}

/* ---------- Skeleton ---------- */
.stage-card.is-skeleton {
    background: linear-gradient(
        110deg,
        rgba(var(--global-text-color-rgb), 0.04) 30%,
        rgba(var(--global-text-color-rgb), 0.08) 50%,
        rgba(var(--global-text-color-rgb), 0.04) 70%
    );
    background-size: 220% 100%;
    border: 1px solid rgba(var(--global-text-color-rgb), 0.04);
    animation: stage-shimmer 1.6s ease-in-out infinite;
    pointer-events: none;
}
@keyframes stage-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -120% 0; }
}

/* ---------- Empty state ---------- */
.stage-empty {
    max-width: 1280px;
    margin: 0 auto;
    padding: clamp(60px, 8vh, 100px) 16px;
    text-align: center;
}
.stage-empty-title {
    margin: 0 0 6px;
    font-family: inherit;
    font-weight: 600;
    font-size: clamp(18px, 1.6vw, 22px);
    letter-spacing: -0.018em;
    color: var(--global-text-color);
}
.stage-empty-sub {
    margin: 0 0 22px;
    font-size: 14px;
    color: var(--global-text-muted);
    letter-spacing: -0.005em;
}
.stage-empty-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 22px;
    background: var(--global-button-background-color);
    color: var(--global-button-text-color);
    border-radius: 999px;
    font-family: inherit;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: -0.005em;
    text-decoration: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}
.stage-empty-cta:hover { opacity: 0.88; transform: translateY(-1px); }

/* ---------- Load more ---------- */
.stage-loadmore {
    max-width: 1280px;
    margin: clamp(28px, 4vh, 48px) auto 0;
    display: flex;
    justify-content: center;
}
.stage-loadmore-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 22px;
    background: transparent;
    color: var(--global-text-color);
    border: 1px solid rgba(var(--global-text-color-rgb), 0.16);
    border-radius: 999px;
    font-family: inherit;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: -0.005em;
    cursor: pointer;
    transition: background-color 0.18s ease, border-color 0.18s ease;
}
.stage-loadmore-btn:hover {
    background: var(--state-hover-bg);
    border-color: rgba(var(--global-text-color-rgb), 0.32);
}
.stage-loadmore-btn:disabled { opacity: 0.5; cursor: progress; }

/* ---------- Shared keyframes ---------- */
@keyframes stage-fade-up {
    to { opacity: 1; transform: none; }
}
.stage-eyebrow,
.stage-title,
.stage-tagline,
.stage-featured { transform: translateY(8px); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .stage-aura, .stage-eyebrow, .stage-title, .stage-tagline,
    .stage-featured, .stage-card, .stage-card-thumb img,
    .stage-card-overlay, .stage-card-use, .stage-title-grad {
        animation: none !important;
        transform: none !important;
        opacity: 1 !important;
        transition: none !important;
    }
}
