/* Hero — كتاب رقمي مفتوح (SVG + نيون + جزيئات) */
.hero-mind-wrap,
.hero-book-wrap {
    --hm-glow: color-mix(in srgb, var(--hm-neon, var(--c-primary)) 55%, transparent);
    --hm-glow-alt: color-mix(in srgb, var(--hm-neon-alt, var(--c-secondary)) 45%, transparent);
    position: relative;
    width: 100%;
    max-width: min(500px, 100%);
    margin-inline: auto;
    aspect-ratio: 500 / 520;
    display: flex;
    align-items: center;
    justify-content: center;
    isolation: isolate;
    perspective: 1100px;
}

.hero-mind__canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    animation: hm-fade-in 1.2s ease 0.3s forwards;
}

.hero-mind__pulse-rings {
    position: absolute;
    inset: 10% 8% 12%;
    z-index: 0;
    pointer-events: none;
}

.hero-mind__pulse-ring {
    position: absolute;
    inset: 0;
    border-radius: 42% 42% 8% 8%;
    border: 2px solid var(--hm-neon, var(--c-primary));
    box-shadow: 0 0 18px var(--hm-glow), 0 0 40px var(--hm-glow);
    opacity: 0;
    animation: hm-ai-pulse 3.5s ease-out infinite;
}

.hero-mind__pulse-ring--2 {
    inset: 10%;
    border-color: var(--hm-neon-alt, var(--c-secondary));
    box-shadow: 0 0 14px var(--hm-glow-alt);
    animation-delay: 1.2s;
}

.hero-mind-scene {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: min(460px, 92vw);
    transform-style: preserve-3d;
    will-change: transform;
    transition: transform 0.12s ease-out;
}

.hero-mind-svg,
.hero-book-svg {
    display: block;
    width: 100%;
    height: auto;
    max-height: min(520px, 78vw);
    overflow: visible;
    filter: drop-shadow(0 0 24px var(--hm-glow));
}

.hero-book__halo {
    opacity: 0;
    animation: hm-halo-in 1.3s ease 0.1s forwards, hm-halo-pulse 6s ease-in-out 2s infinite;
}

.hero-book__volume {
    opacity: 0;
    transform-origin: 250px 395px;
    animation: hm-book-in 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards,
        hm-book-float 7s ease-in-out 2.2s infinite;
}

.hero-book__cover,
.hero-book__page {
    opacity: 0;
    animation: hm-fade-in 0.9s ease 0.45s forwards;
}

.hero-book__page--L {
    transform-origin: 250px 395px;
    animation: hm-page-open-L 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.35s forwards;
}

.hero-book__page--R {
    transform-origin: 250px 395px;
    animation: hm-page-open-R 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.45s forwards;
}

.hero-book__line {
    stroke-dasharray: 140;
    stroke-dashoffset: 140;
    opacity: 0;
    animation: hm-line-draw 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-book__lines--L .hero-book__line:nth-child(1) { animation-delay: 0.7s; }
.hero-book__lines--L .hero-book__line:nth-child(2) { animation-delay: 0.78s; }
.hero-book__lines--L .hero-book__line:nth-child(3) { animation-delay: 0.86s; }
.hero-book__lines--L .hero-book__line:nth-child(4) { animation-delay: 0.94s; }
.hero-book__lines--L .hero-book__line:nth-child(5) { animation-delay: 1.02s; }
.hero-book__lines--L .hero-book__line:nth-child(6) { animation-delay: 1.1s; }
.hero-book__lines--L .hero-book__line:nth-child(7) { animation-delay: 1.18s; }

.hero-book__lines--R .hero-book__line:nth-child(1) { animation-delay: 0.75s; }
.hero-book__lines--R .hero-book__line:nth-child(2) { animation-delay: 0.83s; }
.hero-book__lines--R .hero-book__line:nth-child(3) { animation-delay: 0.91s; }
.hero-book__lines--R .hero-book__line:nth-child(4) { animation-delay: 0.99s; }
.hero-book__lines--R .hero-book__line:nth-child(5) { animation-delay: 1.07s; }
.hero-book__lines--R .hero-book__line:nth-child(6) { animation-delay: 1.15s; }
.hero-book__lines--R .hero-book__line:nth-child(7) { animation-delay: 1.23s; }

.hero-book__digital {
    opacity: 0;
    animation: hm-fade-in 1s ease 0.9s forwards;
}

.hero-book__link {
    stroke-dasharray: 120;
    stroke-dashoffset: 120;
    animation: hm-line-draw 1s ease 1.1s forwards;
}

.hero-book__node {
    opacity: 0;
    transform: scale(0);
    transform-origin: center;
    animation: hm-node-pop 0.5s cubic-bezier(0.34, 1.4, 0.64, 1) 1.2s forwards,
        hm-node-pulse 2.5s ease-in-out 2s infinite;
}

.hero-book__scan {
    opacity: 0;
    animation: hm-book-scan 4s ease-in-out 1.4s infinite;
}

.hero-book__spine,
.hero-book__bookmark {
    opacity: 0;
    animation: hm-fade-in 0.8s ease 0.55s forwards;
}

.hero-book__bookmark {
    transform-origin: 250px 88px;
    animation: hm-bookmark-sway 3s ease-in-out 1.6s infinite;
}

.hero-book__outline {
    stroke-dasharray: 900;
    stroke-dashoffset: 900;
    opacity: 0;
    animation: hm-outline-draw 1.8s cubic-bezier(0.22, 1, 0.36, 1) 0.25s forwards,
        hm-neon-flicker 4s ease-in-out 2.5s infinite;
}

.hero-book__outline--cover {
    stroke-dasharray: 600;
    animation-delay: 0.4s;
}

.hero-book__glyph {
    opacity: 0;
    animation: hm-glyph-float 4s ease-in-out infinite;
}

.hero-book__float-glyphs .hero-book__glyph:nth-child(1) {
    animation-delay: 1.3s;
    transform-origin: 88px 72px;
}

.hero-book__float-glyphs .hero-book__glyph:nth-child(2) {
    animation-delay: 1.5s;
    transform-origin: 395px 78px;
}

.hero-book__float-glyphs .hero-book__glyph:nth-child(3) {
    animation-delay: 1.7s;
    transform-origin: 118px 52px;
}

.hero-book__float-glyphs .hero-book__glyph:nth-child(4) {
    animation-delay: 1.9s;
    transform-origin: 368px 55px;
}

.hero-illus--mind {
    max-width: min(520px, 100%);
    min-height: clamp(300px, 44vw, 480px);
}

.hero-illus--mind .hero-illus-inner {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero:has(.hero-illus--mind) .hero-atlas {
    display: none !important;
}

.hero:has(.hero-illus--mind) .hero-digital-bg__pulse {
    opacity: 0.18;
    inset: 18% 22%;
}

.hero-mind-float-cards {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
}

.hero-mind-float-cards .float-card {
    opacity: 0;
    animation: hm-card-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-mind-float-cards .float-card-1 {
    animation: hm-card-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) 1.1s forwards,
        landing-hero-card-drift-a 11s ease-in-out 1.8s infinite;
}

.hero-mind-float-cards .float-card-2 {
    animation: hm-card-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) 1.25s forwards,
        landing-hero-card-drift-b 9.5s ease-in-out 2s infinite;
}

.hero-mind-float-cards .float-card-3 {
    animation: hm-card-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) 1.4s forwards,
        landing-hero-card-drift-c 8s ease-in-out 2.2s infinite;
}

@keyframes hm-book-in {
    from { opacity: 0; transform: scale(0.9) translateY(16px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes hm-book-float {
    0%, 100% { transform: scale(1) translateY(0); }
    50% { transform: scale(1.015) translateY(-5px); }
}

@keyframes hm-page-open-L {
    from { opacity: 0; transform: perspective(500px) rotateX(22deg) rotateY(-12deg); }
    to { opacity: 1; transform: perspective(500px) rotateX(0deg) rotateY(0deg); }
}

@keyframes hm-page-open-R {
    from { opacity: 0; transform: perspective(500px) rotateX(22deg) rotateY(12deg); }
    to { opacity: 1; transform: perspective(500px) rotateX(0deg) rotateY(0deg); }
}

@keyframes hm-line-draw {
    to { stroke-dashoffset: 0; opacity: 0.55; }
}

@keyframes hm-outline-draw {
    to { stroke-dashoffset: 0; opacity: 1; }
}

@keyframes hm-book-scan {
    0%, 100% { opacity: 0; transform: translateY(0); }
    10% { opacity: 0.75; }
    50% { opacity: 0.5; transform: translateY(260px); }
    60% { opacity: 0; }
}

@keyframes hm-bookmark-sway {
    0%, 100% { transform: rotate(-4deg); }
    50% { transform: rotate(4deg); }
}

@keyframes hm-glyph-float {
    0%, 100% { opacity: 0.45; transform: translateY(0); }
    50% { opacity: 0.95; transform: translateY(-8px); }
}

@keyframes hm-ai-pulse {
    0% { transform: scale(0.88); opacity: 0.55; }
    75% { transform: scale(1.05); opacity: 0; }
    100% { opacity: 0; }
}

@keyframes hm-halo-in { to { opacity: 1; } }
@keyframes hm-halo-pulse {
    0%, 100% { opacity: 0.75; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}
@keyframes hm-fade-in { to { opacity: 1; } }
@keyframes hm-neon-flicker {
    0%, 100% { filter: drop-shadow(0 0 4px var(--hm-glow)); }
    50% { filter: drop-shadow(0 0 12px var(--hm-glow)) drop-shadow(0 0 20px var(--hm-glow-alt)); }
}
@keyframes hm-node-pop { to { opacity: 1; transform: scale(1); } }
@keyframes hm-node-pulse {
    0%, 100% { opacity: 0.65; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.35); }
}
@keyframes hm-card-in { to { opacity: 1; } }

@media (max-width: 900px) {
    .hero-mind-wrap { max-width: min(380px, 92vw); }
}

@media (prefers-reduced-motion: reduce) {
    .hero-mind-scene { transition: none !important; }
    .hero-mind__canvas { display: none; }
    .hero-mind__pulse-ring,
    .hero-book__halo,
    .hero-book__volume,
    .hero-book__cover,
    .hero-book__page,
    .hero-book__line,
    .hero-book__outline,
    .hero-book__glyph,
    .hero-book__node,
    .hero-book__scan,
    .hero-book__bookmark,
    .hero-mind-float-cards .float-card {
        animation: none !important;
        opacity: 1 !important;
        stroke-dashoffset: 0 !important;
        transform: none !important;
    }
}
