/* VORTEX GROUP — HOME */

.reveal { opacity: 1; transform: none; }
[data-page="home"] .section { margin-top: 76px; }

/* ---------- العمل المميز: بوابة الدوامة ---------- */
.feature {
    position: relative; overflow: hidden; border-radius: 26px; background: #050b14;
    border: 1px solid rgba(118, 229, 253, 0.2);
    box-shadow: 0 40px 120px rgba(19, 171, 210, 0.14), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
    animation: feature-in 900ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
@keyframes feature-in { from { opacity: 0; transform: scale(0.985); } }
.feature:empty { display: none; }
.feature-bg { position: absolute; inset: -50px; background-size: cover; background-position: center; filter: blur(46px) saturate(1.5); opacity: 0.5; }
.feature::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(4, 7, 13, 0.3), rgba(4, 7, 13, 0.94)); }
.feature-swirl { position: absolute; z-index: 1; left: -10%; top: 50%; width: 680px; margin-top: -340px; opacity: 0.11; animation: vx-spin 120s linear infinite; pointer-events: none; }

.feature-inner { position: relative; z-index: 2; display: flex; align-items: center; gap: 84px; min-height: 500px; padding: 64px 84px; }
.feature-portal { --pw: 260px; position: relative; width: var(--pw); flex-shrink: 0; }
.feature-poster {
    position: relative; z-index: 2; aspect-ratio: 2 / 3; overflow: hidden; border-radius: 12px; background: var(--vortex-black-3);
    border: 1px solid rgba(255, 255, 255, 0.22); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7), 0 0 80px rgba(19, 171, 210, 0.4);
}
.feature-poster img { width: 100%; height: 100%; object-fit: cover; }
.ring {
    position: absolute; left: 50%; top: 50%; border-radius: 50%; pointer-events: none;
    border: 1px solid rgba(118, 229, 253, 0.3); animation: vx-spin 40s linear infinite;
}
.ring::before { content: ""; position: absolute; left: 50%; top: -5px; width: 9px; height: 9px; margin-left: -4.5px; border-radius: 50%; background: var(--vortex-cyan-light); box-shadow: 0 0 14px 3px rgba(118, 229, 253, 0.8); }
.ring.r1 { width: calc(var(--pw) * 2); height: calc(var(--pw) * 2); margin: calc(var(--pw) * -1) 0 0 calc(var(--pw) * -1); }
.ring.r2 { width: calc(var(--pw) * 2.55); height: calc(var(--pw) * 2.55); margin: calc(var(--pw) * -1.275) 0 0 calc(var(--pw) * -1.275); border-style: dashed; border-color: rgba(118, 229, 253, 0.2); animation-duration: 70s; animation-direction: reverse; }
.ring.r2::before { width: 6px; height: 6px; margin-left: -3px; top: -3px; background: #fff; }
.ring.r3 { width: calc(var(--pw) * 3.2); height: calc(var(--pw) * 3.2); margin: calc(var(--pw) * -1.6) 0 0 calc(var(--pw) * -1.6); border-color: rgba(118, 229, 253, 0.12); animation-duration: 110s; }
.ring.r3::before { display: none; }

.feature-text { min-width: 0; }
.feature-text > * { animation: rise 800ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.feature-text > :nth-child(2) { animation-delay: 120ms; }
.feature-text > :nth-child(3) { animation-delay: 240ms; }
.feature-text > :nth-child(4) { animation-delay: 360ms; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
.feature-meta { display: flex; flex-wrap: wrap; align-items: center; color: var(--vortex-white-soft); font-size: 14px; font-weight: 500; }
.feature-meta span { padding-inline-end: 14px; margin-inline-end: 14px; border-inline-end: 1px solid var(--border-strong); line-height: 1; }
.feature-meta span:last-child { padding: 0; margin: 0; border: 0; }
.feature-meta .st { color: var(--vortex-cyan-light); font-weight: 600; }
.feature-text h1 { margin: 18px 0 16px; max-width: 16ch; font-size: clamp(38px, 5.2vw, 72px); font-weight: 700; line-height: 1.12; color: #fff; text-shadow: 0 0 50px rgba(19, 171, 210, 0.45); }
.feature-text p { max-width: 58ch; margin-bottom: 0; color: #c9d3da; font-size: 16px; line-height: 2; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.feature-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.feature-actions .btn { min-height: 50px; padding-inline: 26px; font-size: 15px; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { padding: 3px 12px; border: 1px solid var(--border-strong); border-radius: 6px; background: transparent; color: var(--vortex-white-soft); font-size: 12.5px; font-weight: 500; }

/* ---------- آخر الفصول ---------- */
.latest-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.latest-card {
    position: relative; display: flex; align-items: center; gap: 16px; padding: 16px; overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.09); border-radius: 18px;
    background: linear-gradient(135deg, rgba(19, 171, 210, 0.1), rgba(255, 255, 255, 0.02));
    transition: border-color 300ms, box-shadow 300ms, transform 300ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.latest-card::before {
    content: attr(data-n); position: absolute; left: 12px; bottom: -22px; font-size: 104px; font-weight: 700; line-height: 1; direction: ltr;
    color: rgba(118, 229, 253, 0.07); pointer-events: none; transition: color 300ms, transform 500ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.latest-card:hover { transform: translateY(-5px); border-color: rgba(118, 229, 253, 0.5); box-shadow: 0 0 0 1px rgba(118, 229, 253, 0.2), 0 20px 50px rgba(19, 171, 210, 0.2); }
.latest-card:hover::before { color: rgba(118, 229, 253, 0.16); transform: translateX(8px); }
.latest-cover { position: relative; width: 70px; height: 100px; flex-shrink: 0; overflow: hidden; border-radius: 8px; background: var(--vortex-black-3); border: 1px solid var(--border-strong); box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5); }
.latest-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 400ms ease; }
.latest-card:hover .latest-cover img { transform: scale(1.08); }
.latest-info { position: relative; flex: 1; min-width: 0; }
.latest-info h3 { font-size: 16.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.latest-chapter { margin-top: 4px; color: var(--vortex-cyan-light); font-weight: 600; font-size: 14.5px; }
.latest-time { margin-top: 2px; color: var(--vortex-gray); font-size: 12.5px; }
.new-badge { display: inline-block; margin-bottom: 6px; padding: 1px 10px; border-radius: 4px; background: rgba(19, 171, 210, 0.18); color: var(--vortex-cyan-light); font-size: 11.5px; font-weight: 600; }
.new-badge i { display: none; }
.latest-go { position: relative; color: var(--vortex-gray-dark); transition: color 200ms, transform 300ms; }
.latest-card:hover .latest-go { color: var(--vortex-cyan-light); transform: translateX(-4px); }

/* ---------- أضيفت حديثًا ---------- */
.head-tools, .section-head > .head-tools { display: flex; flex-direction: row; align-items: center; gap: 18px; }
.shelf-nav { display: flex; gap: 6px; }
.shelf-nav button { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid rgba(118, 229, 253, 0.25); border-radius: 50%; background: rgba(255, 255, 255, 0.03); color: var(--vortex-white); cursor: pointer; transition: border-color 200ms, color 200ms, box-shadow 200ms; }
.shelf-nav button:hover { border-color: rgba(118, 229, 253, 0.7); color: var(--vortex-cyan-light); box-shadow: 0 0 18px rgba(19, 171, 210, 0.3); }
.shelf-nav .flip .icon { transform: scaleX(-1); }

.shelf { display: flex; gap: 18px; overflow-x: auto; padding: 8px 4px 16px; scroll-snap-type: x proximity; scrollbar-width: none; }
.shelf::-webkit-scrollbar { display: none; }
.shelf-card { flex: 0 0 140px; display: block; scroll-snap-align: start; transition: transform 300ms cubic-bezier(0.2, 0.7, 0.2, 1); }
.shelf-card:hover { transform: translateY(-8px); }
.shelf-cover { position: relative; aspect-ratio: 2 / 3; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 10px; background: var(--vortex-black-3); transition: border-color 300ms, box-shadow 300ms; }
.shelf-card:hover .shelf-cover { border-color: rgba(118, 229, 253, 0.6); box-shadow: 0 0 0 1px rgba(118, 229, 253, 0.25), 0 20px 44px rgba(19, 171, 210, 0.3); }
.shelf-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 500ms ease; }
.shelf-card:hover .shelf-cover img { transform: scale(1.06); }
.shelf-rank { display: none; }
.shelf-new { position: absolute; z-index: 2; top: 8px; right: 8px; padding: 1px 9px; border-radius: 4px; background: var(--vortex-cyan); color: #031116; font-size: 11px; font-weight: 700; box-shadow: 0 0 14px rgba(19, 171, 210, 0.6); }
.shelf-card h3 { margin: 12px 2px 0; font-size: 14px; font-weight: 600; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shelf-card small { display: block; margin: 2px 2px 0; color: var(--vortex-gray); font-size: 12px; }

/* ---------- استكشف الأقسام ---------- */
.genre-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.genre-tile {
    position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between;
    min-height: 100px; padding: 0 26px; border: 1px solid rgba(255, 255, 255, 0.09); border-radius: 18px;
    background: linear-gradient(135deg, rgba(19, 171, 210, 0.13), rgba(255, 255, 255, 0.02));
    font-size: 19px; font-weight: 700; transition: border-color 300ms, box-shadow 300ms, transform 300ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.genre-tile::before {
    content: ""; position: absolute; left: -34px; top: 50%; width: 140px; height: 140px; margin-top: -70px; pointer-events: none;
    background: url(../assets/vortex-mark-cyan.png) center / contain no-repeat; opacity: 0.16;
    transition: transform 900ms cubic-bezier(0.2, 0.7, 0.2, 1), opacity 300ms;
}
.genre-tile:hover { transform: translateY(-4px); border-color: rgba(118, 229, 253, 0.55); box-shadow: 0 18px 44px rgba(19, 171, 210, 0.22); }
.genre-tile:hover::before { transform: rotate(200deg) scale(1.12); opacity: 0.5; }
.genre-tile span { position: relative; }
.genre-tile .icon { position: relative; color: var(--vortex-cyan-light); transition: transform 300ms; }
.genre-tile:hover .icon { transform: translateX(-5px); }

@media (max-width: 1000px) {
    .latest-grid { grid-template-columns: 1fr; }
    .genre-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .feature-inner { gap: 56px; padding: 48px; }
    .feature-portal { --pw: 210px; }
}

@media (max-width: 720px) {
    [data-page="home"] .section { margin-top: 54px; }
    .feature { border-radius: 20px; }
    .feature-inner { flex-direction: column; align-items: flex-start; gap: 34px; min-height: 0; padding: 28px 24px 30px; }
    .feature-portal { --pw: 150px; margin: 40px 0 36px 0; }
    .feature-text h1 { max-width: none; }
    .feature-text p { font-size: 14.5px; }
    .feature-actions { margin-top: 26px; width: 100%; }
    .feature-actions .btn { flex: 1; padding-inline: 12px; }
    .shelf-nav { display: none; }
    .shelf-card { flex-basis: 116px; }
    .genre-tile { min-height: 80px; padding: 0 18px; font-size: 16px; }
    .latest-card::before { font-size: 80px; }
}
