/* ============================================================
   Interactive 3D post spiral
   ============================================================ */

.spiral-viewport,
.category-spiral-viewport {
    --spiral-card-width: clamp(280px, 25vw, 360px);
    --spiral-card-height: calc(var(--spiral-card-width) * 0.61);
    position: relative;
    z-index: 10;
    width: 100vw;
    height: 100svh;
    overflow: hidden;
    isolation: isolate;
    perspective: 1240px;
    perspective-origin: 50% 50%;
    background:
        radial-gradient(ellipse 54% 54% at 50% 52%, rgba(74, 29, 102, 0.16), transparent 70%),
        radial-gradient(circle at 16% 33%, rgba(26, 147, 164, 0.035), transparent 25%),
        #050506 !important;
    cursor: grab;
    overscroll-behavior-x: none;
    touch-action: pan-y;
}

.spiral-viewport::before,
.category-spiral-viewport::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.3), transparent 16%, transparent 84%, rgba(0, 0, 0, 0.3));
}

.spiral-scene,
.spiral-track {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    transform-style: preserve-3d;
}

.spiral-scene {
    will-change: transform;
    transition: filter 180ms ease;
}

.spiral-track {
    will-change: transform;
}

/* ---- Post cards ---- */
.spiral-card {
    --glow-color: #8c6cff;
    position: absolute;
    width: var(--spiral-card-width);
    height: var(--spiral-card-height);
    margin-top: calc(var(--spiral-card-height) / -2);
    margin-left: calc(var(--spiral-card-width) / -2);
    overflow: visible;
    border: 0;
    border-radius: 14px;
    background: #101014;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    will-change: transform, filter, opacity;
    transition: filter 280ms ease, opacity 280ms ease;
}

.spiral-card-link {
    position: absolute;
    inset: 0;
    display: block;
    overflow: hidden;
    color: #fff;
    border: 1px solid color-mix(in srgb, var(--glow-color) 68%, white 12%);
    border-radius: inherit;
    background: #111116;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.08) inset,
        0 0 11px color-mix(in srgb, var(--glow-color) 34%, transparent),
        0 10px 35px rgba(0, 0, 0, 0.45);
    outline: none;
    -webkit-touch-callout: none !important;
    -webkit-user-drag: none;
    -webkit-user-select: none;
    user-select: none;
    transform: translateZ(0);
    transition:
        box-shadow 280ms ease,
        border-color 280ms ease,
        transform 450ms cubic-bezier(0.16, 1, 0.3, 1);
}

.spiral-card-link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 4;
    border-radius: inherit;
    pointer-events: none;
    box-shadow:
        0 0 18px color-mix(in srgb, var(--glow-color) 18%, transparent) inset,
        0 0 1px rgba(255, 255, 255, 0.65) inset;
}

.spiral-card.is-held {
    z-index: 3000 !important;
    opacity: 1 !important;
    filter: brightness(1.12) saturate(1.08) drop-shadow(0 28px 58px rgba(0, 0, 0, 0.72));
    transform: translate3d(0, 0, 520px) rotateY(0) rotateZ(0) scale(1.52) !important;
    transition: transform 340ms cubic-bezier(0.16, 1, 0.3, 1), filter 280ms ease !important;
}

.spiral-card.is-releasing {
    transition: transform 420ms cubic-bezier(0.16, 1, 0.3, 1), filter 280ms ease !important;
}

.spiral-card.is-held .spiral-card-link {
    border-color: color-mix(in srgb, var(--glow-color) 78%, white 22%);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.16) inset,
        0 0 25px color-mix(in srgb, var(--glow-color) 58%, transparent),
        0 18px 50px rgba(0, 0, 0, 0.55);
    transform: translateZ(16px);
}

.spiral-card-link:focus-visible {
    border-color: #fff;
    outline: 2px solid #fff;
    outline-offset: 5px;
}

.spiral-viewport.has-held-card .spiral-card:not(.is-held) {
    opacity: 0.06 !important;
    filter: blur(4px) brightness(0.2) saturate(0.38);
    pointer-events: none;
}

.spiral-viewport.has-held-card .spiral-center-globe {
    opacity: 0.08 !important;
}

.spiral-viewport.has-held-card {
    cursor: zoom-out;
}

.spiral-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: inherit;
    background: #181820;
}

.spiral-card-image,
.spiral-card-placeholder {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    -webkit-touch-callout: none !important;
    -webkit-user-drag: none;
    -webkit-user-select: none;
    user-select: none;
}

.spiral-card-image {
    transform: scale(1.002);
    transition: transform 800ms cubic-bezier(0.16, 1, 0.3, 1);
}

.spiral-card.is-held .spiral-card-image {
    transform: scale(1.07);
}

.spiral-card-placeholder {
    background:
        radial-gradient(circle at 72% 25%, color-mix(in srgb, var(--glow-color) 55%, transparent), transparent 32%),
        linear-gradient(135deg, #20202b 0%, #101017 50%, #272132 100%);
}

.spiral-card-overlay {
    position: absolute;
    inset: auto 0 0;
    z-index: 3;
    display: flex;
    min-height: 74%;
    align-items: flex-end;
    padding: 20px 20px 17px;
    pointer-events: none;
    background: linear-gradient(to top, rgba(3, 3, 6, 0.94) 0%, rgba(3, 3, 6, 0.43) 50%, transparent 100%);
}

.spiral-card-title {
    display: -webkit-box;
    overflow: hidden;
    margin: 0;
    color: #fff;
    font-family: var(--font-body, "Inter", sans-serif);
    font-size: clamp(14px, 1.15vw, 17px);
    font-weight: 400;
    line-height: 1.35;
    letter-spacing: -0.01em;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.96);
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.spiral-card.is-opening {
    z-index: 2000 !important;
    filter: none !important;
}

.spiral-card.is-opening .spiral-card-link {
    transform: translateZ(180px) scale(1.18);
}

.spiral-card.is-fading {
    opacity: 0 !important;
    pointer-events: none;
}

/* ---- Category-based neon borders ---- */
.category-glow-politics { --glow-color: #a15cff; }
.category-glow-technology { --glow-color: #29ecff; }
.category-glow-sports { --glow-color: #27e7a1; }
.category-glow-entertainment { --glow-color: #ff4fc3; }
.category-glow-climate-crisis { --glow-color: #36d1dc; }
.category-glow-economy { --glow-color: #f7b731; }
.category-glow-fashion { --glow-color: #ff5cbd; }
.category-glow-life-style { --glow-color: #a55eea; }
.category-glow-news { --glow-color: #4b7bec; }
.category-glow-business { --glow-color: #ffbf45; }
.category-glow-health { --glow-color: #7dffb2; }
.category-glow-science { --glow-color: #69a9ff; }
.category-glow-science-environment { --glow-color: #69a9ff; }
.category-glow-world { --glow-color: #ff6878; }
.category-glow-trending { --glow-color: #ff704f; }
.category-glow-travel { --glow-color: #41d8ca; }
.category-glow-food-health,
.category-glow-food { --glow-color: #82e96f; }
.category-glow-uncategorized { --glow-color: #a576d8; }

/* ---- Static homepage category grids ---- */
.category-post-sections {
    position: relative;
    z-index: 11;
    background: #050506;
}

.category-post-section {
    --section-color: #8c6cff;
    position: relative;
    border-top: 1px solid color-mix(in srgb, var(--section-color) 24%, transparent);
    background:
        radial-gradient(circle at 12% 8%, color-mix(in srgb, var(--section-color) 8%, transparent), transparent 28%),
        #080809;
}

.category-post-section a {
    transition: color 180ms ease;
}

.category-post-section img {
    transition: transform 480ms cubic-bezier(0.16, 1, 0.3, 1);
}

.category-post-inner {
    width: min(1320px, 100%);
    margin: 0 auto;
    padding: clamp(58px, 7vw, 96px) clamp(20px, 4vw, 60px);
}

.category-post-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 30px;
    padding-bottom: 18px;
    border-bottom: 1px solid color-mix(in srgb, var(--section-color) 36%, rgba(255, 255, 255, 0.06));
}

.category-post-kicker {
    display: block;
    margin-bottom: 5px;
    color: var(--section-color);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.category-post-heading h2 {
    margin: 0;
    color: #fff;
    font-size: clamp(28px, 3.2vw, 46px);
    letter-spacing: -0.035em;
}

.category-view-all {
    flex: 0 0 auto;
    padding-bottom: 4px;
    color: rgba(255, 255, 255, 0.68);
    font-size: 14px;
    text-decoration: underline;
    text-underline-offset: 5px;
}

.category-view-all:hover,
.category-view-all:focus-visible {
    color: #fff;
}

.category-post-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 26px;
}

.category-post-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 14px;
    background: #121216;
    transition:
        transform 300ms cubic-bezier(0.16, 1, 0.3, 1),
        border-color 300ms ease,
        box-shadow 300ms ease,
        opacity 520ms ease;
}

.category-animation-climate-crisis { --category-card-animation: category-rise; }
.category-animation-economy { --category-card-animation: category-slide-left; }
.category-animation-entertainment { --category-card-animation: category-zoom; }
.category-animation-events,
.category-animation-event { --category-card-animation: category-event-glow; }
.category-animation-fashion { --category-card-animation: category-flip; }
.category-animation-food-health { --category-card-animation: category-slide-right; }
.category-animation-life-style { --category-card-animation: category-soft-pop; }
.category-animation-news { --category-card-animation: category-wipe; }
.category-animation-politics { --category-card-animation: category-swing; }
.category-animation-sports { --category-card-animation: category-bounce; }
.category-animation-technology { --category-card-animation: category-focus; }
.category-animation-travel { --category-card-animation: category-diagonal; }
.category-animation-world { --category-card-animation: category-orbit-in; }

body.has-category-animations .category-post-section.is-category-visible .category-post-heading {
    animation: category-heading-enter 500ms cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

body.has-category-animations .category-post-card:not(.is-card-visible) {
    opacity: 0;
    pointer-events: none;
}

body.has-category-animations .category-post-card.is-card-visible {
    animation-name: var(--category-card-animation, category-rise);
    animation-duration: 620ms;
    animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
    animation-delay: var(--card-reveal-delay, 0ms);
    animation-fill-mode: both;
}

@keyframes category-heading-enter {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes category-rise {
    from { opacity: 0; transform: translateY(28px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes category-slide-left {
    from { opacity: 0; transform: translateX(-36px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes category-zoom {
    from { opacity: 0; transform: scale(0.82); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes category-event-glow {
    from {
        opacity: 0;
        filter: saturate(0.45) brightness(0.7);
        box-shadow: 0 0 0 rgba(255, 143, 61, 0);
        transform: translateY(24px) scale(0.94);
    }
    to {
        opacity: 1;
        filter: saturate(1) brightness(1);
        box-shadow: 0 16px 42px rgba(255, 143, 61, 0.12);
        transform: translateY(0) scale(1);
    }
}

@keyframes category-flip {
    from { opacity: 0; transform: perspective(800px) rotateY(-38deg) translateY(12px); }
    to { opacity: 1; transform: perspective(800px) rotateY(0) translateY(0); }
}

@keyframes category-slide-right {
    from { opacity: 0; transform: translateX(38px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes category-soft-pop {
    from { opacity: 0; transform: translateY(18px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes category-wipe {
    from { opacity: 0; clip-path: inset(0 100% 0 0); }
    to { opacity: 1; clip-path: inset(0 0 0 0); }
}

@keyframes category-swing {
    from { opacity: 0; transform: translateY(24px) rotate(-4deg); }
    to { opacity: 1; transform: translateY(0) rotate(0); }
}

@keyframes category-bounce {
    0% { opacity: 0; transform: translateY(42px) scale(0.94); }
    72% { opacity: 1; transform: translateY(-5px) scale(1.01); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes category-focus {
    from { opacity: 0; filter: blur(12px); transform: scale(1.04); }
    to { opacity: 1; filter: blur(0); transform: scale(1); }
}

@keyframes category-diagonal {
    from { opacity: 0; transform: translate(-28px, 28px); }
    to { opacity: 1; transform: translate(0, 0); }
}

@keyframes category-orbit-in {
    from { opacity: 0; transform: translateY(24px) scale(0.72) rotate(7deg); }
    to { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
}

.category-post-card:hover,
.category-post-card:focus-within {
    transform: translateY(-6px);
    border-color: color-mix(in srgb, var(--section-color) 48%, rgba(255, 255, 255, 0.12));
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.32);
}

.category-post-card:hover .category-post-image img,
.category-post-card:focus-within .category-post-image img {
    transform: scale(1.045);
}

.category-post-image {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #191920;
}

.category-post-image img,
.category-post-placeholder {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-post-placeholder {
    background:
        radial-gradient(circle at 72% 24%, color-mix(in srgb, var(--section-color) 28%, transparent), transparent 32%),
        linear-gradient(135deg, #20202a, #101014);
}

.category-post-card-body {
    padding: 20px;
}

.category-post-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.45);
    font-size: 12px;
}

.category-post-meta span {
    color: var(--section-color);
    font-weight: 600;
}

.category-post-title {
    margin: 0 0 10px;
    font-size: clamp(19px, 1.7vw, 25px);
    line-height: 1.28;
}

.category-post-title a {
    color: #fff;
}

.category-post-title a:hover,
.category-post-title a:focus-visible {
    color: var(--section-color);
}

.category-post-excerpt {
    display: -webkit-box;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.58);
    font-size: 14px;
    line-height: 1.55;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.category-post-excerpt p {
    margin: 0;
}

/* ---- Scroll prompt ---- */
.scroll-hint {
    position: absolute;
    bottom: 24px;
    left: 50%;
    z-index: 30;
    color: rgba(255, 255, 255, 0.88);
    font-family: var(--font-body, "Inter", sans-serif);
    font-size: clamp(15px, 1.6vw, 20px);
    font-weight: 400;
    line-height: 1.2;
    text-align: center;
    letter-spacing: -0.02em;
    pointer-events: none;
    transform: translateX(-50%);
    transition: opacity 400ms ease, transform 400ms ease;
}

/* ---- Category spiral chapters ---- */
body.home,
body.blog {
    overflow-x: hidden;
    overflow-y: auto;
}

.category-spirals {
    position: relative;
    z-index: 11;
    background: #050506;
}

.category-spiral-section {
    --section-color: #8c6cff;
    position: relative;
    width: 100%;
    min-height: 100svh;
    overflow: hidden;
    border-top: 1px solid color-mix(in srgb, var(--section-color) 24%, transparent);
    background:
        radial-gradient(ellipse 60% 58% at 50% 54%, color-mix(in srgb, var(--section-color) 17%, transparent), transparent 72%),
        radial-gradient(circle at 14% 76%, color-mix(in srgb, var(--section-color) 8%, transparent), transparent 31%),
        #050506;
}

.category-spiral-section::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 0;
    width: min(78vw, 980px);
    aspect-ratio: 1.65;
    border-radius: 50%;
    opacity: 0.48;
    background:
        radial-gradient(ellipse at center, color-mix(in srgb, var(--section-color) 25%, transparent), transparent 64%);
    filter: blur(38px);
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.9);
    animation: category-ambient-glow 6.5s ease-in-out infinite;
    transition: opacity 260ms ease, filter 260ms ease;
}

.category-spiral-section.is-in-view::before {
    opacity: 0.82;
}

.category-spiral-section.is-scroll-moving::before {
    opacity: 1;
    filter: blur(28px) saturate(1.35);
    animation-duration: 850ms;
}

.category-spiral-section.is-scroll-moving .category-spiral-heading {
    transform: translate3d(0, -5px, 0);
}

.category-spiral-section.is-scroll-moving .spiral-card {
    filter: saturate(1.08) brightness(1.035);
}

.category-spiral-section.is-scroll-moving .category-wave path {
    stroke-dasharray: 24 12;
    animation: category-wave-travel 520ms linear infinite;
}

.category-spiral-section::after {
    content: "";
    position: absolute;
    right: 3.5vw;
    bottom: 8%;
    width: 1px;
    height: 22%;
    opacity: 0.32;
    background: linear-gradient(to bottom, transparent, var(--section-color), transparent);
    pointer-events: none;
}

@keyframes category-ambient-glow {
    0%, 100% { transform: translate(-50%, -50%) scale(0.88) rotate(-2deg); }
    50% { transform: translate(-50%, -50%) scale(1.08) rotate(2deg); }
}

@keyframes category-wave-travel {
    to { stroke-dashoffset: -36; }
}

/* Each editorial category has its own card silhouette and atmosphere. */
.category-layout-climate-crisis { --category-card-radius: 24px; --category-card-ratio: 0.66; }
.category-layout-economy { --category-card-radius: 7px; --category-card-ratio: 0.56; }
.category-layout-entertainment { --category-card-radius: 28px 8px; --category-card-ratio: 0.64; }
.category-layout-fashion { --category-card-radius: 30px 6px 30px 6px; --category-card-ratio: 0.7; }
.category-layout-food-health { --category-card-radius: 20px; --category-card-ratio: 0.62; }
.category-layout-life-style { --category-card-radius: 8px 26px; --category-card-ratio: 0.68; }
.category-layout-news { --category-card-radius: 4px; --category-card-ratio: 0.55; }
.category-layout-politics { --category-card-radius: 18px 4px; --category-card-ratio: 0.63; }
.category-layout-sports { --category-card-radius: 10px; --category-card-ratio: 0.58; }
.category-layout-technology { --category-card-radius: 5px 18px; --category-card-ratio: 0.6; }
.category-layout-travel { --category-card-radius: 26px; --category-card-ratio: 0.65; }
.category-layout-world { --category-card-radius: 50% 12px 12px 12px; --category-card-ratio: 0.66; }

.category-spiral-section .category-spiral-viewport {
    --spiral-card-height: calc(var(--spiral-card-width) * var(--category-card-ratio, 0.61));
}

.category-spiral-section .spiral-card {
    border-radius: var(--category-card-radius, 14px);
}

.category-layout-economy .spiral-card-overlay,
.category-layout-news .spiral-card-overlay,
.category-layout-technology .spiral-card-overlay {
    min-height: 58%;
    background: linear-gradient(to top, rgba(3, 3, 6, 0.96), rgba(3, 3, 6, 0.24) 64%, transparent);
}

.category-layout-entertainment .spiral-card-overlay,
.category-layout-fashion .spiral-card-overlay,
.category-layout-life-style .spiral-card-overlay {
    justify-content: center;
    text-align: center;
}

.category-layout-sports .spiral-card-title,
.category-layout-news .spiral-card-title {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.category-layout-travel .spiral-card-overlay,
.category-layout-world .spiral-card-overlay,
.category-layout-climate-crisis .spiral-card-overlay {
    min-height: 84%;
}

.category-spiral-viewport {
    position: absolute;
    inset: 0;
    width: 100%;
    background: transparent !important;
}

.category-spiral-heading {
    position: absolute;
    top: clamp(84px, 9vh, 120px);
    left: clamp(28px, 5vw, 76px);
    z-index: 50;
    width: min(430px, 37vw);
    pointer-events: none;
    transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1);
}

.category-spiral-heading a {
    display: inline-block;
    color: #fff;
    pointer-events: auto;
}

.category-spiral-heading h2 {
    margin: 0 0 4px 12px;
    color: #fff;
    font-family: var(--font-body, "Inter", sans-serif);
    font-size: clamp(18px, 1.55vw, 24px);
    font-weight: 600;
    letter-spacing: -0.025em;
}

.category-spiral-heading h2 span {
    margin-left: 7px;
    color: rgba(255, 255, 255, 0.56);
    font-size: 0.62em;
    font-weight: 400;
}

.category-wave {
    display: block;
    width: 100%;
    height: 42px;
    overflow: visible;
}

.category-wave path {
    fill: none;
    stroke: color-mix(in srgb, var(--section-color) 72%, white 28%);
    stroke-width: 1.15;
    vector-effect: non-scaling-stroke;
    filter: drop-shadow(0 0 4px color-mix(in srgb, var(--section-color) 44%, transparent));
}

.category-spiral-viewport.is-wheel-rotating,
.spiral-viewport.is-wheel-rotating {
    cursor: ew-resize;
}

.category-spiral-viewport.is-dragging,
.spiral-viewport.is-dragging {
    cursor: grabbing;
}

body.is-page-scrolling .category-spiral-viewport:not(.is-wheel-rotating):not(.is-dragging),
body.is-page-scrolling .spiral-viewport:not(.is-wheel-rotating):not(.is-dragging) {
    cursor: ns-resize;
}

.category-spiral-viewport.is-wheel-rotating .spiral-scene,
.spiral-viewport.is-wheel-rotating .spiral-scene {
    filter: saturate(1.2) brightness(1.08);
}

.category-spiral-viewport.is-wheel-rotating .spiral-card-link::after,
.spiral-viewport.is-wheel-rotating .spiral-card-link::after {
    animation: card-scroll-glow 620ms ease-in-out infinite alternate;
}

@keyframes card-scroll-glow {
    from {
        box-shadow:
            0 0 16px color-mix(in srgb, var(--glow-color) 24%, transparent) inset,
            0 0 1px rgba(255, 255, 255, 0.7) inset;
    }
    to {
        box-shadow:
            0 0 34px color-mix(in srgb, var(--glow-color) 58%, transparent) inset,
            0 0 4px rgba(255, 255, 255, 0.88) inset;
    }
}

.scroll-hint.is-hidden {
    opacity: 0;
    transform: translate(-50%, 12px);
}

.scroll-arrow {
    display: block;
    width: 32px;
    height: 42px;
    margin: 8px auto 0;
    overflow: visible;
    color: #ffffff;
    opacity: 1;
    animation: spiral-arrow 1.9s ease-in-out infinite;
}

.scroll-arrow path {
    fill: none;
    stroke: #ffffff;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

@keyframes spiral-arrow {
    0%, 100% { opacity: 1; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(7px); }
}

/* ---- List view ---- */
.list-viewport {
    position: relative;
    z-index: 5;
    min-height: 100vh;
    padding: 118px 24px 70px;
    background: #080809;
}

.list-container {
    max-width: 1040px;
    margin: 0 auto;
}

.list-item {
    display: flex;
    align-items: center;
    padding: 20px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    text-decoration: none;
    transition: background-color 250ms ease, transform 250ms ease;
}

.list-item:hover {
    background: rgba(255, 255, 255, 0.035);
    transform: translateX(7px);
}

.list-item-thumb {
    flex: 0 0 110px;
    width: 110px;
    height: 72px;
    margin-right: 22px;
    overflow: hidden;
    border-radius: 9px;
}

.list-item-thumb img,
.list-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.list-item-meta {
    display: flex;
    flex: 0 0 130px;
    width: 130px;
    flex-direction: column;
}

.list-item-date {
    margin-top: 5px;
    color: rgba(255, 255, 255, 0.42);
    font-size: 13px;
}

.list-item-content {
    flex: 1 1 auto;
    padding: 0 20px;
}

.list-item-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.3;
}

.list-item-title a {
    color: #f5f5f7;
}

.list-item-excerpt {
    display: -webkit-box;
    flex: 0 0 280px;
    width: 280px;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.43);
    font-size: 14px;
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.no-results-container {
    padding: 120px 20px;
    text-align: center;
}

.no-results-icon {
    margin-bottom: 16px;
    font-size: 64px;
    opacity: 0.3;
}

.no-results-title {
    margin-bottom: 8px;
    color: #f5f5f7;
    font-size: 28px;
}

.no-results-subtext {
    color: rgba(255, 255, 255, 0.45);
    font-size: 16px;
}

.nav-links {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
    padding: 20px 0;
}

.page-numbers {
    padding: 8px 16px;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.06);
    color: #f5f5f7;
    font-size: 14px;
}

.page-numbers:hover,
.page-numbers.current {
    background: rgba(108, 92, 231, 0.3);
    color: #fff;
}

@media (max-width: 980px) {
    .spiral-viewport,
    .category-spiral-viewport {
        --spiral-card-width: clamp(245px, 32vw, 310px);
        perspective: 1080px;
    }

    .list-item-excerpt {
        display: none;
    }

    .category-post-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 22px;
    }
}

@media (max-width: 700px) {
    .spiral-viewport,
    .category-spiral-viewport {
        --spiral-card-width: clamp(190px, 58vw, 235px);
        --spiral-card-height: calc(var(--spiral-card-width) * 0.61);
        height: 100svh;
        min-height: 620px;
        padding: 0;
        overflow: hidden;
        perspective: 720px;
        cursor: grab;
        touch-action: pan-y;
    }

    .spiral-card-title {
        font-size: clamp(12px, 3.4vw, 14px);
    }

    .spiral-card.is-held {
        transform: translate3d(0, 0, 390px) rotateY(0) rotateZ(0) scale(1.38) !important;
    }

    .scroll-hint {
        bottom: 18px;
        display: block;
        font-size: 13px;
    }

    .scroll-arrow {
        margin-top: 3px;
        font-size: 27px;
    }

    .category-spiral-section {
        min-height: max(100svh, 620px);
    }

    .category-spiral-section::before {
        width: 112vw;
        opacity: 0.62;
        filter: blur(26px);
    }

    .category-post-inner {
        padding: 54px 18px;
    }

    .category-post-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
        margin-bottom: 22px;
    }

    .category-post-heading h2 {
        font-size: 30px;
    }

    .category-post-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .category-post-card-body {
        padding: 18px;
    }

    .category-spiral-heading {
        top: 92px;
        left: 18px;
        width: min(72vw, 310px);
    }

    .category-spiral-heading h2 {
        margin-left: 7px;
        font-size: 17px;
    }

    .category-wave {
        height: 28px;
    }

    .list-item {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .list-item-meta {
        width: auto;
        flex-basis: auto;
        flex-direction: row;
        gap: 12px;
        margin-bottom: 8px;
    }

    .list-item-date {
        margin-top: 0;
    }

    .list-item-content {
        flex-basis: 100%;
        padding: 0;
    }
}

@media (max-width: 430px) {
    .spiral-viewport,
    .category-spiral-viewport {
        --spiral-card-width: clamp(178px, 56vw, 215px);
    }

    .spiral-card-overlay {
        padding: 16px 16px 14px;
    }

    .category-spiral-heading {
        top: 112px;
        width: 72vw;
    }

    .list-item-thumb {
        display: none;
    }
}

/* ---- Auto-scrolling one-line category rails ---- */
.category-post-section {
    overflow: hidden;
}

.category-post-section::before {
    content: "";
    position: absolute;
    inset: 8% auto auto 50%;
    z-index: 0;
    width: min(960px, 88vw);
    height: min(420px, 42vw);
    border-radius: 50%;
    opacity: 0.48;
    background: radial-gradient(ellipse at center, color-mix(in srgb, var(--section-color) 22%, transparent), transparent 68%);
    filter: blur(42px);
    pointer-events: none;
    transform: translateX(-50%);
    transition: opacity 420ms ease, transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

.category-post-section.is-category-visible::before {
    opacity: 0.78;
    transform: translateX(-50%) scale(1.05);
}

.category-post-inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: none;
    padding-right: 0;
    padding-left: 0;
}

.category-post-heading {
    width: min(1320px, calc(100% - clamp(40px, 8vw, 120px)));
    margin-right: auto;
    margin-left: auto;
}

.category-post-grid {
    position: relative;
    display: block;
    grid-template-columns: none;
    width: 100%;
    overflow: hidden;
    padding: 4px 0 18px;
    cursor: ew-resize;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}

.category-post-track {
    display: flex;
    width: max-content;
    transform: translate3d(0, 0, 0);
    animation: category-rail-scroll var(--category-rail-duration, 42s) linear infinite;
    animation-play-state: paused;
    will-change: transform;
}

.category-post-section.is-category-visible .category-post-track {
    animation-play-state: running;
}

.category-post-section:nth-child(3n + 1) {
    --category-rail-duration: 38s;
}

.category-post-section:nth-child(3n + 2) {
    --category-rail-duration: 44s;
}

.category-post-section:nth-child(3n + 3) {
    --category-rail-duration: 50s;
}

.category-rail-reverse .category-post-track {
    animation-direction: reverse;
}

.category-post-grid:hover .category-post-track,
.category-post-grid:focus-within .category-post-track,
.category-post-grid.is-user-touching .category-post-track {
    animation-play-state: paused;
}

.category-post-loop {
    display: flex;
    flex: 0 0 auto;
    gap: clamp(14px, 1.65vw, 24px);
    padding-right: clamp(14px, 1.65vw, 24px);
}

.category-post-card {
    width: clamp(270px, 29vw, 380px);
    min-width: clamp(270px, 29vw, 380px);
    flex: 0 0 clamp(270px, 29vw, 380px);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.02)),
        #121216;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
}

.category-post-card:hover,
.category-post-card:focus-within {
    transform: translateY(-8px) scale(1.015);
    box-shadow:
        0 22px 55px rgba(0, 0, 0, 0.42),
        0 0 34px color-mix(in srgb, var(--section-color) 16%, transparent);
}

body.has-category-animations .category-post-card.is-card-visible {
    animation-duration: 720ms;
}

@keyframes category-rail-scroll {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(-50%, 0, 0); }
}

@media (max-width: 980px) {
    .category-post-grid {
        grid-template-columns: none;
        gap: 0;
    }

    .category-post-card {
        width: clamp(250px, 44vw, 340px);
        min-width: clamp(250px, 44vw, 340px);
        flex-basis: clamp(250px, 44vw, 340px);
    }
}

@media (max-width: 700px) {
    .category-post-inner {
        padding-top: 52px;
        padding-bottom: 56px;
    }

    .category-post-heading {
        width: calc(100% - 36px);
    }

    .category-post-grid {
        grid-template-columns: none;
        gap: 0;
        padding-bottom: 12px;
        -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
        mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
    }

    .category-post-loop {
        gap: 14px;
        padding-right: 14px;
    }

    .category-post-card {
        width: min(82vw, 310px);
        min-width: min(82vw, 310px);
        flex-basis: min(82vw, 310px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .spiral-card,
    .spiral-card-link,
    .spiral-card-image,
    .scroll-hint {
        transition-duration: 0.01ms !important;
    }

    .scroll-arrow {
        animation: none;
    }

    .category-spiral-section::before,
    .category-spiral-section.is-scroll-moving .category-wave path,
    .category-spiral-viewport.is-wheel-rotating .spiral-card-link::after,
    .spiral-viewport.is-wheel-rotating .spiral-card-link::after {
        animation: none;
    }

    body.has-category-animations .category-post-heading,
    body.has-category-animations .category-post-card,
    .category-post-card,
    .category-post-section img,
    .category-post-track {
        opacity: 1;
        transform: none;
        animation: none !important;
        transition: none;
    }
}
