/**
 * Component Styles - EduProd
 */

/* ===== HEADER ===== */
.header {
    position: sticky;
    top: 0;
    z-index: var(--z-fixed);
    background: rgba(10, 14, 26, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    transition: var(--transition-base);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) 0;
}

/* Logo */
.logo-wrapper {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    transition: var(--transition-base);
}

.logo-wrapper:hover {
    transform: translateY(-2px);
}

.logo-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--brand-navy), var(--brand-orange));
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(244, 123, 32, 0.3);
    position: relative;
    overflow: hidden;
}

.logo-icon i {
    font-size: 1.5rem;
    color: white;
    z-index: 1;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-main {
    font-size: 1.6rem;
    font-weight: var(--font-extrabold);
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #fff, #a0d0ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.logo-sub {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: var(--font-medium);
    letter-spacing: 0.5px;
}

/* Navigation */
.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.nav-link {
    color: var(--text-secondary);
    font-weight: var(--font-medium);
    font-size: var(--text-sm);
    position: relative;
    padding: var(--space-xs) 0;
    transition: var(--transition-base);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--physics-primary), var(--chemistry-primary));
    transition: width var(--transition-base);
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link-cta {
    background: linear-gradient(135deg, var(--physics-primary), var(--chemistry-primary));
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-full);
    color: var(--physics-bg);
    font-weight: var(--font-semibold);
}

.nav-link-cta::after {
    display: none;
}

.nav-link-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(92, 225, 230, 0.4);
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: var(--space-xs);
}

.hamburger-line {
    width: 24px;
    height: 2px;
    background: var(--text-secondary);
    transition: var(--transition-base);
}

/* ===== HERO SECTION ===== */
.hero {
    padding: var(--space-3xl) 0;
    position: relative;
    min-height: 85vh;
    display: flex;
    align-items: center;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 460px);
    align-items: center;
    gap: var(--space-2xl, var(--space-xl));
    max-width: 1200px;
    margin: 0 auto;
}

.hero-content {
    text-align: left;
}

.hero-grid .hero-cta-group {
    justify-content: flex-start;
}

.hero-media {
    position: relative;
}

.hero-demo-video {
    display: block;
    width: 100%;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-lg);
}

.hero-media-caption {
    position: absolute;
    left: var(--space-md);
    bottom: var(--space-md);
    background: rgba(10, 14, 26, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md, 12px);
    padding: 0.6rem 0.9rem;
    max-width: calc(100% - 2 * var(--space-md));
}

.hero-media-caption span {
    display: block;
    font-size: 0.65rem;
    font-weight: var(--font-bold);
    letter-spacing: 0.06em;
    color: var(--physics-primary);
    margin-bottom: 0.15rem;
}

.hero-media-caption strong {
    display: block;
    font-size: 0.86rem;
    color: var(--text-primary);
}

@media (max-width: 960px) {
    .hero-grid {
        grid-template-columns: 1fr;
    }
    .hero-content {
        text-align: center;
    }
    .hero-grid .hero-cta-group {
        justify-content: center;
    }
    .hero-media {
        max-width: 500px;
        margin: 0 auto;
    }
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    background: rgba(92, 225, 230, 0.1);
    border: 1px solid rgba(92, 225, 230, 0.3);
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--physics-primary);
    margin-bottom: var(--space-lg);
}

.hero-title {
    margin-bottom: var(--space-md);
}

.gradient-text {
    background: linear-gradient(135deg, var(--physics-primary), var(--chemistry-primary), var(--math-primary), var(--biology-primary));
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: gradientShift 8s ease infinite;
}

.hero-description {
    font-size: var(--text-xl);
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto var(--space-xl);
    line-height: 1.7;
}

.hero-cta-group {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== BUTTONS ===== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    background: linear-gradient(135deg, #0891b2, #06b6d4);
    padding: 0.72rem 1.35rem;
    border-radius: var(--radius-md);
    font-weight: var(--font-bold);
    font-size: 0.98rem;
    line-height: 1.15;
    color: #ffffff;
    box-shadow: 0 7px 20px rgba(6, 182, 212, 0.24);
    transition: all var(--transition-spring);
    border: 1px solid rgba(255, 255, 255, 0.18);
    cursor: pointer;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0e7490, #0891b2);
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(6, 182, 212, 0.34);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    background: rgba(92, 225, 230, 0.08);
    padding: 0.70rem 1.3rem;
    border-radius: var(--radius-md);
    font-weight: var(--font-bold);
    font-size: 0.98rem;
    color: var(--physics-primary);
    border: 2px solid var(--physics-primary);
    transition: all var(--transition-spring);
    cursor: pointer;
}

.btn-secondary:hover {
    background: var(--physics-primary);
    color: var(--physics-bg);
    transform: translateY(-4px);
}

/* ===== SECTIONS ===== */
.section-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.section-title {
    margin-bottom: var(--space-sm);
}

.section-subtitle {
    font-size: var(--text-lg);
    color: var(--text-tertiary);
    max-width: 600px;
    margin: 0 auto;
}

/* ===== SUBJECT PORTALS ===== */
.subject-portals {
    padding: var(--space-3xl) 0;
    background: linear-gradient(180deg, rgba(15, 23, 41, 0.5) 0%, rgba(10, 14, 26, 0.8) 100%);
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
}

.portals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-lg);
}

/* ===== PORTAL CARD LINK WRAPPER ===== */
.portal-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform var(--transition-spring);
}

.portal-card-link:hover {
    transform: translateY(-12px);
}

/* ===== PORTAL CARD ===== */
.portal-card {
    background: var(--bg-card);
    border: 2px solid var(--border-subtle);
    border-radius: var(--radius-2xl);
    padding: var(--space-xl);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    transform-origin: center center;
    height: 100%;
    /* Ensure full height inside link */
}

.portal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, transparent, rgba(92, 225, 230, 0.05));
    opacity: 0;
    transition: opacity var(--transition-spring);
}

.portal-card-link:hover .portal-card::before {
    opacity: 1;
}

/* Subject-specific borders */
.portal-card-physics {
    border-color: var(--physics-primary);
}

.portal-card-link:hover .portal-card-physics {
    border-color: var(--physics-primary);
    box-shadow: var(--shadow-glow-physics);
}

.portal-card-chemistry {
    border-color: var(--chemistry-primary);
}

.portal-card-link:hover .portal-card-chemistry {
    border-color: var(--chemistry-primary);
    box-shadow: var(--shadow-glow-chemistry);
}

.portal-card-math {
    border-color: var(--math-primary);
}

.portal-card-link:hover .portal-card-math {
    border-color: var(--math-primary);
    box-shadow: var(--shadow-glow-math);
}

.portal-card-biology {
    border-color: var(--biology-primary);
}

.portal-card-link:hover .portal-card-biology {
    border-color: var(--biology-primary);
    box-shadow: var(--shadow-glow-biology);
}

.portal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.portal-svg-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 8px currentColor);
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.portal-card-link:hover .portal-svg-icon {
    transform: scale(1.1);
}

/* Ensure SVG animations play */
.portal-icon img {
    pointer-events: none;
}


.portal-card:hover .portal-icon {
    transform: rotate(5deg) scale(1.1);
}

.portal-icon-physics {
    background: linear-gradient(135deg, rgba(92, 225, 230, 0.2), rgba(92, 225, 230, 0.05));
    color: var(--physics-primary);
}

.portal-icon-chemistry {
    background: linear-gradient(135deg, rgba(77, 184, 184, 0.2), rgba(77, 184, 184, 0.05));
    color: var(--chemistry-primary);
}

.portal-icon-math {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.05));
    color: var(--math-primary);
}

.portal-icon-biology {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.05));
    color: var(--biology-primary);
}

.portal-badge {
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.portal-badge-live {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.1));
    color: var(--biology-primary);
    border: 1px solid var(--biology-primary);
}

.portal-badge-soon {
    background: rgba(139, 156, 184, 0.1);
    color: var(--text-tertiary);
    border: 1px solid rgba(139, 156, 184, 0.3);
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.portal-title {
    font-size: var(--text-3xl);
    margin-bottom: var(--space-sm);
}

.portal-card-physics .portal-title {
    color: var(--physics-primary);
}

.portal-card-chemistry .portal-title {
    color: var(--chemistry-primary);
}

.portal-card-math .portal-title {
    color: var(--math-primary);
}

.portal-card-biology .portal-title {
    color: var(--biology-primary);
}

.portal-description {
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
    line-height: 1.7;
}

.portal-mock-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: var(--text-sm, 0.85rem);
    font-weight: var(--font-semibold, 600);
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    margin-bottom: var(--space-md);
}

.portal-mock-live {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.12);
}

.portal-mock-soon {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.12);
}

.portal-stats {
    display: flex;
    gap: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: var(--space-md);
}

.stat-item {
    flex: 1;
}

.stat-value {
    font-size: var(--text-2xl);
    font-weight: var(--font-extrabold);
    margin-bottom: 0.2rem;
}

.portal-card-physics .stat-value {
    color: var(--physics-primary);
}

.portal-card-chemistry .stat-value {
    color: var(--chemistry-primary);
}

.portal-card-math .stat-value {
    color: var(--math-primary);
}

.portal-card-biology .stat-value {
    color: var(--biology-primary);
}

.stat-label {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
}

.portal-cta {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-full);
    font-weight: var(--font-semibold);
    transition: all var(--transition-spring);
    border: 2px solid;
    margin-top: var(--space-sm);
}

.portal-card-physics .portal-cta {
    background: linear-gradient(135deg, rgba(92, 225, 230, 0.1), transparent);
    border-color: var(--physics-primary);
    color: var(--physics-primary);
}

.portal-card-physics .portal-cta:hover {
    background: var(--physics-primary);
    color: var(--physics-bg);
    transform: translateX(5px);
}

.portal-card-chemistry .portal-cta {
    background: linear-gradient(135deg, rgba(77, 184, 184, 0.1), transparent);
    border-color: var(--chemistry-primary);
    color: var(--chemistry-primary);
}

.portal-card-chemistry .portal-cta:hover {
    background: var(--chemistry-primary);
    color: white;
    transform: translateX(5px);
}

.portal-card-math .portal-cta {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), transparent);
    border-color: var(--math-primary);
    color: var(--math-primary);
}

.portal-card-biology .portal-cta {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), transparent);
    border-color: var(--biology-primary);
    color: var(--biology-primary);
}

.portal-cta-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== METHODOLOGY ===== */
.methodology {
    padding: var(--space-3xl) 0;
    background: rgba(10, 14, 26, 0.95);
    border-top: 1px solid var(--border-subtle);
}

.methodology-content {
    display: flex;
    align-items: center;
    gap: var(--space-3xl);
    flex-wrap: wrap;
}

.methodology-visual {
    flex: 1 1 400px;
    display: flex;
    justify-content: center;
}

.loop-container {
    position: relative;
    width: 400px;
    height: 400px;
}

.loop-circle {
    width: 100%;
    height: 100%;
    border: 3px dashed rgba(92, 225, 230, 0.3);
    border-radius: 50%;
    animation: rotate 40s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* The ring is what actually orbits the six stages around the circle,
   continuously and in order -- this is the part that reads as "a loop"
   rather than six badges that happen to sit in a circle. */
.loop-ring {
    position: absolute;
    inset: 0;
    animation: rotate 24s linear infinite;
}

.loop-step {
    position: absolute;
    width: 80px;
    height: 80px;
}

.loop-step-inner {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 41, 0.9);
    border: 2px solid;
    border-color: inherit;
    border-radius: 50%;
    font-weight: var(--font-bold);
    cursor: pointer;
    transition: transform var(--transition-spring);
    /* Counter-rotate at the same speed as .loop-ring so each stage's
       number and label stay upright while still travelling around the
       circle, and pulse in sequence (Learn, then Visualise, ...) so the
       six stages visibly hand off to one another, cycling forever. */
    animation: rotateReverse 24s linear infinite, loop-step-pulse 9s ease-in-out infinite;
    animation-delay: 0s, calc(var(--i, 0) * -1.5s);
}

@keyframes rotateReverse {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(-360deg);
    }
}

/* Uses box-shadow/filter only (never transform) -- .loop-step-inner's
   transform is already driven by rotateReverse, and a second animation
   touching the same property would silently override it each frame. */
@keyframes loop-step-pulse {
    0%, 12%, 100% {
        box-shadow: none;
        filter: none;
    }
    6% {
        box-shadow: 0 0 22px 4px currentColor;
        filter: brightness(1.35);
    }
}

.loop-step:hover .loop-step-inner {
    transform: scale(1.2) !important;
    z-index: 10;
}

.step-num {
    font-size: 1.5rem;
    margin-bottom: 0.2rem;
}

.step-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.loop-step-1 {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    border-color: var(--physics-primary);
    color: var(--physics-primary);
}

.loop-step-2 {
    top: 15%;
    right: 5%;
    border-color: var(--chemistry-primary);
    color: var(--chemistry-primary);
}

.loop-step-3 {
    top: 45%;
    right: 0;
    border-color: var(--math-primary);
    color: var(--math-primary);
}

.loop-step-4 {
    bottom: 15%;
    right: 10%;
    border-color: var(--biology-primary);
    color: var(--biology-primary);
}

.loop-step-5 {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    border-color: var(--physics-primary);
    color: var(--physics-primary);
}

.loop-step-6 {
    bottom: 15%;
    left: 10%;
    border-color: var(--chemistry-primary);
    color: var(--chemistry-primary);
}

.loop-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.loop-center i {
    font-size: 3rem;
    color: var(--brand-orange);
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 0 20px rgba(244, 123, 32, 0.5));
}

.loop-title {
    font-size: 1.1rem;
    font-weight: var(--font-bold);
    color: var(--text-primary);
}

.methodology-text {
    flex: 1 1 400px;
}

.methodology-text h2 {
    margin-bottom: var(--space-md);
}

.highlight {
    background: linear-gradient(135deg, var(--physics-primary), var(--chemistry-primary), var(--math-primary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.methodology-intro {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
}

.methodology-list {
    list-style: none;
}

.methodology-list li {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.methodology-list .step-num {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--physics-primary), var(--chemistry-primary));
    border-radius: 50%;
    font-weight: var(--font-extrabold);
    color: var(--physics-bg);
    font-size: var(--text-sm);
    flex-shrink: 0;
}

.step-content h4 {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    margin-bottom: 0.4rem;
    color: var(--text-primary);
}

.step-content p {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    line-height: 1.6;
}

/* ===== FEATURES ===== */
.features {
    padding: var(--space-3xl) 0;
    background: linear-gradient(180deg, rgba(15, 23, 41, 0.3) 0%, rgba(10, 14, 26, 0.6) 100%);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-lg);
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    transition: all var(--transition-spring);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--physics-primary), var(--chemistry-primary), var(--math-primary), var(--biology-primary));
    opacity: 0;
    transition: opacity var(--transition-spring);
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-card:hover {
    transform: translateY(-8px);
    border-color: var(--border-medium);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(92, 225, 230, 0.15), rgba(77, 184, 184, 0.05));
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-md);
    font-size: 1.8rem;
    color: var(--physics-primary);
    transition: transform var(--transition-spring);
}

.feature-card:hover .feature-icon {
    transform: rotateY(180deg);
}

.feature-card h3 {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: var(--text-sm);
}

/* ===== FEATURE STORY SECTIONS (narrative flow, one per feature) ===== */
/* ===== Sticky-scroll "learning loop" intro (stages 1-3 prototype) =====
   One sticky visual on the right stays pinned while the stage text scrolls
   past on the left; whichever stage is nearest the vertical centre of the
   viewport gets marked .is-active (by loop-scroll JS below), which fades
   the matching text card to full opacity and crossfades the matching
   visual into view. Falls back to a plain stacked column on narrow
   viewports, where the sticky visual sits pinned above the scrolling text
   instead of beside it. */
.loop-scroll-section {
    padding: var(--space-xl) 0;
}

.loop-scroll-grid {
    display: grid;
    grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
    gap: var(--space-2xl, var(--space-xl));
    align-items: start;
}

.loop-scroll-track {
    display: flex;
    flex-direction: column;
}

/* .loop-scroll-item is a transparent scroll-pacing spacer (its min-height
   sets how far you scroll before the next stage takes over) -- the visible
   card is the smaller .loop-scroll-card inside it, sized to match
   .loop-scroll-visual-stack so the two sides read as equal-sized panels
   instead of one stretched card next to a compact one. */
.loop-scroll-item {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-xl);
    opacity: 0.4;
    transition: opacity 0.4s ease;
}

/* The sticky panel needs room BELOW an item's centre point to stay pinned
   at top:0 for a full 100vh -- every item but the last gets that for free
   from the next item's own 70vh spacer. The last item has no next item to
   borrow from, so without this it would start unsticking (and scrolling
   out of view) before ever settling in the centre. Give it the same
   trailing room a phantom next item would have provided. */
.loop-scroll-item:last-child {
    margin-bottom: 70vh;
}

/* A fixed height (not min-height) here and on .loop-scroll-visual-stack
   below guarantees the two panels are pixel-identical regardless of how
   much a given stage's copy happens to wrap -- min-height only matched by
   coincidence of the current text fitting under the floor; a longer edit,
   or simply different font metrics on a given browser/OS, could push past
   it and grow the card taller than the mockup. overflow:hidden is a guard
   against that same scenario rather than something expected to trigger. */
.loop-scroll-card {
    width: 100%;
    height: 500px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transform: scale(0.97);
    transition: transform 0.4s ease;
}

.loop-scroll-item.is-active .loop-scroll-card {
    transform: scale(1);
}

.loop-scroll-item.is-active {
    opacity: 1;
}

.loop-scroll-sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    align-items: center;
}

.loop-scroll-visual-stack {
    position: relative;
    width: 100%;
    max-width: 460px;
    height: 500px;
}

.loop-scroll-visual {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.loop-scroll-visual.is-active {
    opacity: 1;
    pointer-events: auto;
}

.loop-scroll-mobile-visual {
    display: none;
}

@media (max-width: 860px) {
    .loop-scroll-grid {
        grid-template-columns: 1fr;
    }
    .loop-scroll-sticky {
        display: none;
    }
    .loop-scroll-visual-stack {
        max-width: 100%;
        height: 320px;
    }
    .loop-scroll-item {
        min-height: auto;
        opacity: 1;
        transform: none;
        margin-bottom: var(--space-lg);
    }
    .loop-scroll-item:last-child {
        margin-bottom: 0;
    }
    .loop-scroll-card {
        height: auto;
        overflow: visible;
        transform: none;
        padding: var(--space-lg);
    }
    .loop-scroll-mobile-visual {
        display: block;
        position: relative;
        inset: auto;
        width: 100%;
        margin-top: var(--space-lg);
        opacity: 1;
        pointer-events: auto;
    }
    .loop-scroll-mobile-visual .mockup-window {
        max-width: none;
    }
}

.story-section {
    padding: var(--space-xl) 0;
    border-top: 1px solid var(--border-subtle);
}

.story-grid {
    display: grid;
    grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
    align-items: center;
    gap: var(--space-2xl, var(--space-xl));
}

.story-section--reverse .story-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
}

.story-section--reverse .story-copy {
    order: 2;
}

/* The mockup/simulation side stays dark (matching the real product's own
   dark UI); the text side is a dark glass card with a glowing cyan accent
   border, rather than either blending into the page (the original bug) or
   a flat light card (the first fix) -- the border + glowing number/kicker
   carry the delineation instead of a strong fill-colour contrast. */
.story-copy {
    background: rgba(13, 148, 136, 0.12);
    border: 1px solid rgba(0, 242, 254, 0.25);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    box-shadow: var(--shadow-lg), 0 0 32px rgba(0, 242, 254, 0.08);
}

.story-number {
    display: block;
    font-family: var(--font-display, inherit);
    font-size: 3rem;
    font-weight: var(--font-bold);
    line-height: 1;
    color: #00f2fe;
    opacity: 0.85;
    text-shadow: 0 0 18px rgba(0, 242, 254, 0.55);
    margin-bottom: var(--space-sm);
}

.story-kicker {
    display: inline-block;
    font-size: var(--text-xs, 0.75rem);
    font-weight: var(--font-bold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #00f2fe;
    margin-bottom: var(--space-sm);
}

.story-copy h3 {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: #f1f5f9;
    margin-bottom: var(--space-sm);
    line-height: 1.3;
}

.story-copy p {
    color: #f1f5f9;
    opacity: 0.75;
    line-height: 1.7;
    font-size: var(--text-sm);
    margin-bottom: var(--space-md);
}

.story-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    color: #00f2fe;
    font-weight: var(--font-semibold);
    text-decoration: none;
    font-size: var(--text-sm);
}

.story-link:hover {
    text-decoration: underline;
}

.story-visual {
    display: flex;
    justify-content: center;
}

/* The illustrated "mockup window" — a static (not live) representation of
   the real product UI, styled to match its actual dark theme rather than
   a generic screenshot placeholder. */
.mockup-window {
    width: 100%;
    max-width: 460px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.mockup-topbar {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0.9rem 1.2rem;
    border-bottom: 1px solid var(--border-subtle);
}

.mockup-dots {
    display: flex;
    gap: 6px;
}

.mockup-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-medium, rgba(255, 255, 255, 0.15));
}

.mockup-tag {
    margin-left: auto;
    font-size: var(--text-xs, 0.72rem);
    font-weight: var(--font-semibold);
    color: var(--physics-primary);
    background: rgba(92, 225, 230, 0.1);
    border: 1px solid rgba(92, 225, 230, 0.25);
    padding: 0.2em 0.7em;
    border-radius: var(--radius-full);
}

.mockup-body {
    padding: 1.3rem 1.2rem 1.5rem;
}

.mockup-label {
    font-size: var(--text-xs, 0.7rem);
    font-weight: var(--font-bold);
    letter-spacing: 0.06em;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.6rem;
}

/* A small static field/graph diagram inside a mockup-window, styled to echo
   the real simulation's own dark canvas rather than leaving the card as
   numbers only. */
.mockup-diagram {
    background: #0a0e1f;
    border: 1px solid rgba(94, 234, 212, 0.15);
    border-radius: 12px;
    padding: 0.75rem;
    margin-bottom: var(--space-md);
}

.mockup-diagram svg {
    display: block;
    width: 100%;
    height: auto;
}

.mockup-question {
    color: var(--text-primary);
    font-weight: var(--font-semibold);
    font-size: var(--text-base, 0.98rem);
    line-height: 1.5;
    margin-bottom: 1rem;
}

.mockup-answer-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 0.9rem;
    border-radius: var(--radius-md, 12px);
    border: 1px solid var(--border-subtle);
    margin-bottom: 0.6rem;
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.mockup-answer-row .mockup-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: var(--font-bold);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    flex-shrink: 0;
}

.mockup-answer-row b {
    flex: 1;
    color: var(--text-secondary);
    font-weight: var(--font-medium, 500);
}

.mockup-answer-row i {
    flex-shrink: 0;
}

.mockup-answer-row.wrong {
    opacity: 0.7;
}

.mockup-answer-row.wrong i {
    color: #fb7185;
}

.mockup-answer-row.correct {
    border-color: rgba(52, 211, 153, 0.4);
    background: rgba(52, 211, 153, 0.08);
}

.mockup-answer-row.correct b {
    color: var(--text-primary);
}

.mockup-answer-row.correct i {
    color: #34d399;
}

.mockup-why-box {
    display: flex;
    gap: 0.7rem;
    background: rgba(92, 225, 230, 0.06);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md, 12px);
    padding: 0.8rem 1rem;
    margin-top: 0.9rem;
}

.mockup-why-box i {
    color: var(--physics-primary);
    margin-top: 0.15rem;
    flex-shrink: 0;
}

.mockup-why-box strong {
    display: block;
    color: var(--text-primary);
    font-size: var(--text-sm);
    margin-bottom: 0.2rem;
}

.mockup-why-box p {
    color: var(--text-secondary);
    font-size: 0.86rem;
    line-height: 1.6;
    margin: 0;
}

.mockup-timer {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    font-size: var(--text-xs, 0.75rem);
    font-weight: var(--font-semibold);
    color: #ffb454;
    background: rgba(255, 180, 84, 0.1);
    border: 1px solid rgba(255, 180, 84, 0.25);
    padding: 0.25em 0.7em;
    border-radius: var(--radius-full);
    margin-bottom: 0.9rem;
}

.mockup-method-box {
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed var(--border-medium, rgba(255, 255, 255, 0.15));
    border-radius: var(--radius-md, 12px);
    padding: 0.8rem 1rem;
    font-family: var(--font-mono, monospace);
    font-size: 0.86rem;
    color: var(--physics-primary);
    margin-top: 0.9rem;
}

.mockup-config-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: var(--text-sm);
}

.mockup-config-row:last-of-type {
    border-bottom: none;
}

.mockup-config-row span:first-child {
    color: var(--text-muted);
}

.mockup-config-row span:last-child {
    color: var(--text-primary);
    font-weight: var(--font-semibold);
}

.mockup-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.mockup-tag-pill {
    font-size: 0.76rem;
    font-weight: var(--font-semibold);
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    padding: 0.25em 0.7em;
    border-radius: var(--radius-full);
}

.mockup-btn {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 1.1rem;
    padding: 0.75rem;
    border-radius: var(--radius-md, 12px);
    background: linear-gradient(135deg, var(--physics-primary), #4db8b8);
    color: #03211c;
    font-weight: var(--font-bold);
    font-size: var(--text-sm);
    border: none;
}

.mockup-stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.7rem;
    margin-bottom: 1rem;
}

.mockup-stat {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md, 12px);
    padding: 0.7rem 0.9rem;
    text-align: center;
}

.mockup-stat strong {
    display: block;
    color: var(--physics-primary);
    font-size: 1.3rem;
    font-family: var(--font-mono, monospace);
}

.mockup-stat span {
    display: block;
    color: var(--text-muted);
    font-size: 0.72rem;
    margin-top: 0.2rem;
}

.mockup-mastery-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 0.6rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.mockup-mastery-row .mockup-mastery-label {
    width: 110px;
    flex-shrink: 0;
}

.mockup-mastery-bar {
    flex: 1;
    height: 6px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.mockup-mastery-bar span {
    display: block;
    height: 100%;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--physics-primary), #34d399);
}

.story-demo-video {
    display: block;
    width: 100%;
    max-width: 460px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-lg);
}

@media (max-width: 860px) {
    .story-grid,
    .story-section--reverse .story-grid {
        grid-template-columns: 1fr;
    }
    .story-section--reverse .story-copy {
        order: 0;
    }
}

/* ===== CALL TO ACTION ===== */
.cta-section {
    padding: var(--space-3xl) 0;
    background: linear-gradient(135deg, rgba(26, 46, 90, 0.4), rgba(15, 23, 41, 0.6));
    border-top: 1px solid var(--border-medium);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.cta-content h2 {
    font-size: clamp(2.5rem, 6vw, var(--text-6xl));
    margin-bottom: var(--space-md);
}

.cta-content p {
    font-size: var(--text-xl);
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
}

.cta-buttons {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== FOOTER ===== */
.footer {
    padding: var(--space-xl) 0 var(--space-lg);
    background: var(--bg-darker);
    border-top: 1px solid var(--border-subtle);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-xl);
    margin-bottom: var(--space-lg);
}

.footer-brand {
    flex: 1 1 300px;
}

.footer-logo-wrapper {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.footer-logo-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--brand-navy), var(--brand-orange));
    border-radius: var(--radius-md);
}

.footer-logo-icon i {
    font-size: 1.5rem;
    color: white;
}

.footer-logo-text {
    font-size: 1.5rem;
    font-weight: var(--font-extrabold);
    color: var(--text-primary);
}

.footer-tagline {
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
    font-size: var(--text-sm);
}

.footer-description {
    color: var(--text-tertiary);
    font-size: var(--text-sm);
    line-height: 1.6;
}

.footer-social {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.social-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(92, 225, 230, 0.1);
    border: 1px solid rgba(92, 225, 230, 0.3);
    border-radius: 50%;
    color: var(--physics-primary);
    transition: all var(--transition-spring);
}

.social-link:hover {
    background: var(--physics-primary);
    color: var(--physics-bg);
    transform: translateY(-3px);
}

.footer-links-group {
    flex: 1 1 150px;
}

.footer-heading {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: var(--space-xs);
}

.footer-links a {
    color: var(--text-tertiary);
    font-size: var(--text-sm);
    transition: all var(--transition-base);
    display: inline-block;
}

.footer-links a:hover {
    color: var(--physics-primary);
    transform: translateX(5px);
}

.footer-bottom {
    padding-top: var(--space-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.footer-copyright {
    color: var(--text-muted);
    font-size: var(--text-xs);
}

.footer-legal {
    display: flex;
    gap: var(--space-lg);
    flex-wrap: wrap;
}

.footer-legal a {
    color: var(--text-tertiary);
    font-size: var(--text-xs);
    transition: color var(--transition-base);
}

.footer-legal a:hover {
    color: var(--physics-primary);
}

/* ===== PORTAL ACTIONS ===== */
.portal-actions {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
    flex-wrap: wrap;
}

.portal-cta-primary {
    flex: 1;
    min-width: 180px;
}

/* ===== PREVIEW BUTTON (Below Card) ===== */
.portal-preview-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    width: 100%;
    padding: var(--space-md);
    margin-top: var(--space-md);
    border-radius: var(--radius-lg);
    font-weight: var(--font-semibold);
    font-size: var(--text-sm);
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-spring);
}

.portal-preview-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--physics-primary);
    color: var(--physics-primary);
    transform: translateY(-2px);
}

/* ===== PREVIEW MODAL ===== */
.preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.preview-modal.active {
    opacity: 1;
    pointer-events: all;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    z-index: 1;
    background: rgba(15, 23, 41, 0.95);
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-2xl);
    max-width: 90vw;
    max-height: 90vh;
    width: 1000px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.preview-modal.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-xl);
    border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    margin: 0;
}

.modal-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
}

.modal-close:hover {
    background: rgba(255, 59, 48, 0.2);
    border-color: #ff3b30;
    color: #ff3b30;
    transform: rotate(90deg);
}

.modal-body {
    padding: var(--space-xl);
    overflow-y: auto;
    flex: 1;
}

.carousel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.carousel-track-container {
    flex: 1;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: rgba(10, 14, 26, 0.6);
    position: relative;
    min-height: 500px;
}

.carousel-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
}

.carousel-slide {
    min-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
    opacity: 0.4;
    transition: opacity 0.5s ease;
}

.carousel-slide.active {
    opacity: 1;
}

.carousel-slide img {
    max-width: 100%;
    max-height: 450px;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.carousel-caption {
    margin-top: var(--space-md);
    font-size: var(--text-base);
    color: var(--text-secondary);
    text-align: center;
    font-weight: var(--font-medium);
}

.carousel-nav {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-spring);
    flex-shrink: 0;
}

.carousel-nav:hover {
    background: var(--physics-primary);
    border-color: var(--physics-primary);
    color: var(--physics-bg);
    transform: scale(1.1);
}

.carousel-nav:active {
    transform: scale(0.95);
}

.carousel-nav i {
    font-size: 1.2rem;
}

.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all var(--transition-base);
}

.indicator.active {
    background: var(--physics-primary);
    border-color: var(--physics-primary);
    width: 32px;
    border-radius: 6px;
}

.indicator:hover:not(.active) {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.2);
}


.portal-preview-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--physics-primary);
    color: var(--physics-primary);
    transform: translateY(-2px);
}

.portal-preview-btn i {
    font-size: 1rem;
}

/* ===== CAROUSEL SECTION ===== */
.portal-wrapper {
    position: relative;
}

.portal-carousel-section {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.4s ease,
        margin-top 0.6s ease;
    margin-top: 0;
    background: rgba(15, 23, 41, 0.6);
    border-radius: var(--radius-2xl);
    border: 2px solid transparent;
}

.portal-carousel-section.expanded {
    max-height: 600px;
    opacity: 1;
    margin-top: var(--space-lg);
    border-color: var(--border-medium);
}

.carousel-container {
    padding: var(--space-xl);
    position: relative;
}

.carousel-close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    z-index: 10;
}

.carousel-close:hover {
    background: rgba(255, 59, 48, 0.2);
    border-color: #ff3b30;
    color: #ff3b30;
    transform: rotate(90deg);
}

.carousel-title {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    margin-bottom: var(--space-lg);
    text-align: center;
    color: var(--text-primary);
}

.carousel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.carousel-track-container {
    flex: 1;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: rgba(10, 14, 26, 0.6);
    position: relative;
    height: 400px;
}

.carousel-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
}

.carousel-slide {
    min-width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    opacity: 0.4;
    transition: opacity 0.5s ease;
}

.carousel-slide.active {
    opacity: 1;
}

.carousel-slide img {
    max-width: 100%;
    max-height: 320px;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.carousel-caption {
    margin-top: var(--space-md);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    text-align: center;
    font-weight: var(--font-medium);
}

.carousel-nav {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-spring);
    flex-shrink: 0;
}

.carousel-nav:hover {
    background: var(--physics-primary);
    border-color: var(--physics-primary);
    color: var(--physics-bg);
    transform: scale(1.1);
}

.carousel-nav:active {
    transform: scale(0.95);
}

.carousel-nav i {
    font-size: 1.2rem;
}

.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all var(--transition-base);
}

.indicator.active {
    background: var(--physics-primary);
    border-color: var(--physics-primary);
    width: 32px;
    border-radius: 6px;
}

.indicator:hover:not(.active) {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.2);
}

/* Subject-specific carousel borders */
.portal-wrapper[data-subject="physics"] .portal-carousel-section.expanded {
    border-color: var(--physics-primary);
}

.portal-wrapper[data-subject="chemistry"] .portal-carousel-section.expanded {
    border-color: var(--chemistry-primary);
}

.portal-wrapper[data-subject="math"] .portal-carousel-section.expanded {
    border-color: var(--math-primary);
}

.portal-wrapper[data-subject="biology"] .portal-carousel-section.expanded {
    border-color: var(--biology-primary);
}
