/* ═══════════════════════════════════════════════════════════════
   OVERVIEW — Gateway page design
   Extracted from overview.html
   ═══════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════
   GATEWAY PAGE — Premium Entry Experience
   Left-aligned, consistent margins matching site container
   ═══════════════════════════════════════════════════════════════ */

/* Teacher colors: now defined centrally in terraforms.css as --floor-color etc.
   Gateway layout vars — scoped to this page: */
body.theme-dark.overview-page {
    --gateway-max-width: var(--max-width);
    --gateway-padding: clamp(2rem, 5vw, 4rem);
    /* Dark background scale */
    --gw-bg-hero: #0a0a0f;
    --gw-bg-mid: #1a1917;
    --gw-bg-teachers: #151413;
    --gw-bg-eighth: #1f1c2a;
    --gw-bg-books: #0f0f12;
}

/* ═══════════════════════════════════════════════════════════════
   GATEWAY CONTAINER — Consistent left edge across all sections
   ═══════════════════════════════════════════════════════════════ */

.gateway-container {
    width: 100%;
    max-width: var(--gateway-max-width);
    margin: 0 auto;
    padding: 0 var(--gateway-padding);
}

/* Ensure hero container aligns with rest of page */
.gateway-hero .gateway-container {
    width: 100%;
}

/* ═══════════════════════════════════════════════════════════════
   HERO — Full Viewport, Left-Aligned Content
   ═══════════════════════════════════════════════════════════════ */

.gateway-hero {
    min-height: 60vh;
    background: linear-gradient(135deg, var(--gw-bg-hero) 0%, var(--gw-bg-mid) 50%, var(--charcoal) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: calc(var(--spacing-xxl) + 80px) 0 var(--spacing-xl);
    position: relative;
    overflow: hidden;
}

/* Gold Particle Field */
.gateway-particles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
}

.gateway-particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--gold, var(--gold));
    border-radius: var(--radius-full);
    opacity: 0;
    animation: particle-drift var(--dur-slow) var(--ease-in-out) infinite;
}

.gateway-particle--lg {
    width: 4px;
    height: 4px;
    box-shadow: var(--glow-gold-sm);
}

/* Primary particle field positions */
.gateway-particles .gateway-particle:nth-child(1) { left: 5%; animation-delay: calc(0 * var(--particle-delay-unit)); }
.gateway-particles .gateway-particle:nth-child(2) { left: 15%; animation-delay: calc(2 * var(--particle-delay-unit)); }
.gateway-particles .gateway-particle:nth-child(3) { left: 25%; animation-delay: calc(4 * var(--particle-delay-unit)); }
.gateway-particles .gateway-particle:nth-child(4) { left: 35%; animation-delay: calc(1 * var(--particle-delay-unit)); }
.gateway-particles .gateway-particle:nth-child(5) { left: 45%; animation-delay: calc(5 * var(--particle-delay-unit)); }
.gateway-particles .gateway-particle:nth-child(6) { left: 55%; animation-delay: calc(3 * var(--particle-delay-unit)); }
.gateway-particles .gateway-particle:nth-child(7) { left: 65%; animation-delay: calc(6 * var(--particle-delay-unit)); }
.gateway-particles .gateway-particle:nth-child(8) { left: 75%; animation-delay: calc(2.5 * var(--particle-delay-unit)); }
.gateway-particles .gateway-particle:nth-child(9) { left: 85%; animation-delay: calc(4.5 * var(--particle-delay-unit)); }
.gateway-particles .gateway-particle:nth-child(10) { left: 95%; animation-delay: calc(1.5 * var(--particle-delay-unit)); }

/* Secondary particle field (faded) */
.gateway-particles--faded { opacity: 0.5; }
.gateway-particles--faded .gateway-particle:nth-child(1) { left: 10%; animation-delay: calc(0.5 * var(--particle-delay-unit)); }
.gateway-particles--faded .gateway-particle:nth-child(2) { left: 30%; animation-delay: calc(2.5 * var(--particle-delay-unit)); }
.gateway-particles--faded .gateway-particle:nth-child(3) { left: 50%; animation-delay: calc(4.5 * var(--particle-delay-unit)); }
.gateway-particles--faded .gateway-particle:nth-child(4) { left: 70%; animation-delay: calc(1.5 * var(--particle-delay-unit)); }
.gateway-particles--faded .gateway-particle:nth-child(5) { left: 90%; animation-delay: calc(3.5 * var(--particle-delay-unit)); }

/* Gateway section title — light variant */
.gateway-section__title--light { color: var(--ivory); }

@keyframes particle-drift {
    0% { opacity: 0; transform: translateY(100vh) scale(0); }
    15% { opacity: 0.5; }
    85% { opacity: 0.5; }
    100% { opacity: 0; transform: translateY(-10vh) scale(1); }
}

.gateway-hero__content {
    position: relative;
    z-index: 2;
}

.gateway-hero__label {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-weight: 300;
    color: var(--white-70);
    letter-spacing: 0.02em;
    margin-bottom: var(--spacing-xs, 0.5rem);
    display: block;
    animation: fadeInUp 1s ease 0.2s both;
}

.gateway-hero__title {
    font-family: var(--font-display, 'Cinzel', serif);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 400;
    line-height: 1;
    color: var(--ivory);
    margin: 0 0 var(--spacing-md, 2rem);
    letter-spacing: 0.02em;
    animation: fadeInUp 1s ease 0.4s both;
}

.gateway-hero__subtitle {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: clamp(1.0625rem, 2vw, 1.25rem);
    font-weight: 300;
    line-height: 1.75;
    color: var(--white-85);
    max-width: 600px;
    margin: 0 0 var(--spacing-lg, 3rem);
    animation: fadeInUp 1s ease 0.6s both;
}

.gateway-hero__actions {
    display: flex;
    gap: var(--spacing-sm, 1rem);
    flex-wrap: wrap;
    animation: fadeInUp 1s ease 0.8s both;
}

.gateway-hero__cta {
    display: inline-block;
    font-family: var(--font-mono, 'Space Grotesk', monospace);
    font-size: var(--text-xs);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    padding: var(--spacing-sm) var(--spacing-md-plus);
    border: 1px solid var(--gold, var(--gold));
    color: var(--gold, var(--gold));
    text-decoration: none;
    transition: all 0.4s ease;
}

.gateway-hero__cta:hover {
    background: var(--gold, var(--gold));
    color: var(--black);
    box-shadow: var(--glow-gold-lg);
}

.gateway-hero__cta--primary {
    background: var(--gold, var(--gold));
    color: var(--black);
}

.gateway-hero__cta--primary:hover {
    background: var(--gold-on-dark);
    border-color: var(--gold-on-dark);
    box-shadow: 0 0 50px var(--gold-40);
}

.gateway-hero__scroll {
    position: absolute;
    bottom: var(--spacing-md, 2rem);
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-mono, 'Space Grotesk', monospace);
    font-size: var(--text-2xs);
    color: var(--white-40);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    animation: fadeInUp 1s ease 1s both;
    text-align: center;
}

.gateway-hero__scroll::after {
    content: '';
    display: block;
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, var(--gold-50), transparent);
    margin: var(--spacing-xs-plus) auto 0;
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(1); }
    50% { opacity: 0.8; transform: scaleY(1.2); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════
   SECTIONS — Left-aligned, consistent vertical rhythm
   ═══════════════════════════════════════════════════════════════ */

.gateway-section {
    padding: var(--spacing-xxl) 0;
}

.gateway-section--dark {
    background: linear-gradient(180deg, var(--gw-bg-mid) 0%, var(--charcoal) 100%);
    color: var(--ivory);
}

.gateway-section--cream {
    background: var(--cream);
    color: var(--earth);
}

.gateway-section--deep {
    background: var(--bg-deep);
    color: var(--ivory);
}

.gateway-section__label {
    font-family: var(--font-mono, 'Space Grotesk', monospace);
    font-size: var(--text-2xs);
    color: var(--gold);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin-bottom: var(--spacing-sm);
    display: block;
}

.gateway-section--cream .gateway-section__label {
    color: var(--gold-deep);
}

.gateway-section--cream .gateway-link--gold {
    color: var(--gold-deep);
    border-bottom-color: rgba(122, 101, 32, 0.35);
}

.gateway-section__title {
    font-family: var(--font-display, 'Cinzel', serif);
    font-size: clamp(1.625rem, 4vw, 2.5rem);
    font-weight: 400;
    line-height: 1.2;
    margin: 0 0 var(--spacing-md);
}

.gateway-section--dark .gateway-section__title,
.gateway-section--deep .gateway-section__title {
    color: var(--ivory);
}

.gateway-section--cream .gateway-section__title {
    color: var(--black);
}

.gateway-section__text {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: var(--text-base);
    line-height: 1.85;
    margin: 0 0 1.75em;
    max-width: 680px;
}

.gateway-section__text:last-of-type {
    margin-bottom: 0;
}

/* ═══════════════════════════════════════════════════════════════
   BURST — The Incantation
   ═══════════════════════════════════════════════════════════════ */

.gateway-burst {
    font-family: var(--font-display, 'Cinzel', serif);
    font-size: clamp(1.25rem, 3vw, 1.5rem);
    line-height: 1.6;
    border-left: 3px solid var(--gold);
    padding: var(--spacing-sm) 0 var(--spacing-sm) var(--spacing-md);
    margin: var(--spacing-lg) 0;
    max-width: 680px;
}

.gateway-section--dark .gateway-burst,
.gateway-section--deep .gateway-burst {
    color: var(--ivory);
}

.gateway-section--cream .gateway-burst {
    color: var(--black);
    border-left-color: var(--gold);
}

/* ═══════════════════════════════════════════════════════════════
   TEACHERS GRID — Seven Forces
   ═══════════════════════════════════════════════════════════════ */

.gateway-teachers {
    padding: var(--spacing-xxl) 0 var(--spacing-md);
    background: linear-gradient(180deg, var(--gw-bg-teachers) 0%, var(--gw-bg-mid) 100%);
}

.gateway-teachers__intro {
    margin-bottom: var(--spacing-lg);
}

.gateway-teachers__text {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: var(--text-base);
    line-height: 1.8;
    color: var(--white-70);
    max-width: 600px;
    margin: 0;
}

/* Override tf-card colors for dark background */
.gateway-section--dark .tf-card--teacher,
.gateway-section--deep .tf-card--teacher {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--white-10);
}

.gateway-section--dark .tf-card--teacher:hover,
.gateway-section--deep .tf-card--teacher:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--gold);
    box-shadow: 0 8px 32px rgba(196, 168, 85, 0.2);
}

.gateway-teachers .tf-card__text {
    color: var(--white-70);
}

/* ═══════════════════════════════════════════════════════════════
   EIGHTH TEACHER — Special Treatment
   ═══════════════════════════════════════════════════════════════ */

.gateway-eighth {
    padding: var(--spacing-sm, 1rem) 0 var(--spacing-xl, 8rem);
    background: linear-gradient(180deg, var(--gw-bg-mid) 0%, var(--gw-bg-eighth) 100%);
}

.gateway-eighth__content {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md, 2rem);
}

.gateway-eighth__icon {
    font-family: var(--font-display, 'Cinzel', serif);
    font-size: var(--text-5xl);
    color: var(--eighth-color);
    text-shadow: 0 0 40px rgba(123, 107, 138, 0.5);
    flex-shrink: 0;
}

.gateway-eighth__label {
    font-family: var(--font-mono, 'Space Grotesk', monospace);
    font-size: var(--text-2xs);
    color: var(--eighth-color);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin-bottom: var(--spacing-2xs);
}

.gateway-eighth__title {
    font-family: var(--font-display, 'Cinzel', serif);
    font-size: clamp(1.25rem, 3vw, 1.625rem);
    color: var(--ivory);
    margin: 0 0 var(--spacing-sm-plus, 1.5rem);
}

.gateway-eighth__text {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: var(--text-base);
    line-height: 1.8;
    color: var(--white-85);
    margin: 0;
    max-width: 600px;
}

/* ═══════════════════════════════════════════════════════════════
   CONDITIONS — Who This Is For
   ═══════════════════════════════════════════════════════════════ */

.gateway-conditions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs, 0.5rem);
    margin: var(--spacing-md, 2rem) 0;
}

.gateway-condition {
    font-family: var(--font-mono, 'Space Grotesk', monospace);
    font-size: var(--text-2xs);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 1px solid rgba(160, 115, 92, 0.4);
    color: var(--floor-color);
    background: rgba(160, 115, 92, 0.08);
}

/* ═══════════════════════════════════════════════════════════════
   THREE LIVING BOOKS
   ═══════════════════════════════════════════════════════════════ */

.gateway-books {
    padding: var(--spacing-xl, 8rem) 0;
    background: linear-gradient(180deg, var(--gw-bg-books) 0%, var(--gw-bg-mid) 100%);
}

.gateway-books__grid {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm, 1rem);
    margin-top: var(--spacing-lg, 3rem);
}

.gateway-book {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: start;
    gap: var(--spacing-md, 2rem);
    padding: var(--spacing-md, 2rem);
    background: var(--white-03);
    border: 1px solid var(--white-05);
    text-decoration: none;
    transition: all 0.4s ease;
}

.gateway-book:hover {
    background: var(--white-03);
    border-color: var(--gold-20);
    transform: translateX(8px);
}

.gateway-book__number {
    font-family: var(--font-mono, 'Space Grotesk', monospace);
    font-size: var(--text-2xs);
    color: var(--gold, var(--gold));
    letter-spacing: 0.2em;
    text-transform: uppercase;
    padding-top: var(--spacing-2xs);
}

.gateway-book__content {
    flex: 1;
}

.gateway-book__title {
    font-family: var(--font-display, 'Cinzel', serif);
    font-size: clamp(1.25rem, 3vw, 1.5rem);
    color: var(--ivory);
    margin: 0 0 0.25rem;
}

.gateway-book__sub {
    font-family: var(--font-mono, 'Space Grotesk', monospace);
    font-size: var(--text-2xs);
    color: var(--gold, var(--gold));
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin: 0 0 var(--spacing-sm, 1rem);
}

.gateway-book__desc {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: var(--text-xs-plus);
    line-height: 1.7;
    color: var(--white-70);
    margin: 0;
    max-width: 500px;
}

.gateway-book__arrow {
    font-family: var(--font-display, 'Cinzel', serif);
    font-size: var(--text-xl);
    color: var(--gold, var(--gold));
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
    padding-top: var(--spacing-2xs);
}

.gateway-book:hover .gateway-book__arrow {
    opacity: 1;
    transform: translateX(0);
}

@media (max-width: 768px) {
    .gateway-book {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm, 1rem);
    }

    .gateway-book__number {
        order: -1;
    }

    .gateway-book__arrow {
        display: none;
    }

    .gateway-book:hover {
        transform: translateX(0);
    }
}

/* ═══════════════════════════════════════════════════════════════
   FINAL CTA — The Close
   ═══════════════════════════════════════════════════════════════ */

.gateway-final {
    padding: var(--spacing-xl, 8rem) 0;
    background: var(--bg-deep);
    position: relative;
    overflow: hidden;
}

.gateway-final__etymology {
    font-family: var(--font-display, 'Cinzel', serif);
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    color: var(--gold, var(--gold));
    margin: 0 0 var(--spacing-sm, 1rem);
    letter-spacing: 0.08em;
}

.gateway-final__text {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: var(--text-base);
    line-height: 1.8;
    color: var(--white-85);
    margin: 0 0 var(--spacing-lg, 3rem);
    max-width: 600px;
}

.gateway-final__actions {
    display: flex;
    gap: var(--spacing-sm, 1rem);
    flex-wrap: wrap;
}

.gateway-final__cta {
    font-family: var(--font-mono, 'Space Grotesk', monospace);
    font-size: var(--text-xs);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    padding: var(--spacing-sm) var(--spacing-md-plus);
    border: 1px solid var(--gold, var(--gold));
    color: var(--gold, var(--gold));
    text-decoration: none;
    transition: all 0.4s ease;
}

.gateway-final__cta:hover {
    background: var(--gold, var(--gold));
    color: var(--black);
}

.gateway-final__cta--primary {
    background: var(--gold, var(--gold));
    color: var(--black);
}

.gateway-final__cta.gateway-final__cta--primary,
a.gateway-final__cta.gateway-final__cta--primary {
    color: var(--charcoal);
}

.gateway-final__cta.gateway-final__cta--primary:hover,
a.gateway-final__cta.gateway-final__cta--primary:hover {
    background: var(--gold-on-dark);
    border-color: var(--gold-on-dark);
    box-shadow: 0 0 40px var(--gold-40);
    color: var(--charcoal);
}

/* ═══════════════════════════════════════════════════════════════
   CONVERGENCE SOURCES — Six-cell grid on cream background
   ═══════════════════════════════════════════════════════════════ */

.gateway-sources {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md) var(--spacing-lg);
    margin: var(--spacing-lg) 0;
}

.gateway-source {
    border-left: 2px solid rgba(122, 101, 32, 0.35);
    padding-left: var(--spacing-sm);
}

.gateway-source__name {
    display: block;
    font-family: var(--font-mono, 'Space Grotesk', monospace);
    font-size: var(--text-2xs);
    font-weight: 600;
    color: var(--gold-deep);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.gateway-source__finding {
    display: block;
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: var(--text-sm);
    line-height: 1.7;
}

/* Multiple hero subtitles — reduce gap between them */
.gateway-hero__subtitle + .gateway-hero__subtitle {
    margin-top: calc(-1 * var(--spacing-md));
}

@media (max-width: 768px) {
    .gateway-sources {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
}

@media (min-width: 769px) and (max-width: 1000px) {
    .gateway-sources {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ═══════════════════════════════════════════════════════════════
   DIAGNOSIS ARCHETYPES — Three incomplete-sequence mirrors
   ═══════════════════════════════════════════════════════════════ */

.gateway-archetypes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
    margin: var(--spacing-lg) 0 0;
}

.gateway-archetype {
    border-left: 2px solid var(--gold-deep);
    padding-left: var(--spacing-sm);
}

.gateway-archetype__formula {
    display: block;
    font-family: var(--font-mono, 'Space Grotesk', monospace);
    font-size: var(--text-2xs);
    font-weight: 600;
    color: var(--gold-deep);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.gateway-archetype__name + .gateway-archetype__formula {
    margin-top: -0.25rem;
}

.gateway-archetype__name {
    font-family: var(--font-display, 'Cinzel', serif);
    font-size: var(--text-md);
    font-weight: 400;
    color: var(--black);
    margin: 0 0 0.75rem;
}

.gateway-archetype__text {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: var(--text-sm);
    line-height: 1.75;
    color: var(--earth);
    margin: 0;
}

@media (max-width: 768px) {
    .gateway-archetypes {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
}

/* ═══════════════════════════════════════════════════════════════
   ARCHETYPES ON DARK SECTIONS
   ═══════════════════════════════════════════════════════════════ */

.gateway-section--dark .gateway-archetype {
    border-left-color: var(--gold-40);
}

.gateway-section--dark .gateway-archetype__formula {
    color: var(--gold);
}

.gateway-section--dark .gateway-archetype__name {
    color: var(--ivory);
}

.gateway-section--dark .gateway-archetype__text {
    color: var(--ivory-80);
}

/* ═══════════════════════════════════════════════════════════════
   UTILITY — Spacing and link styles for overview page
   ═══════════════════════════════════════════════════════════════ */

.gateway-section__grid-offset {
    margin-top: var(--spacing-md);
}

.gateway-section__text-offset {
    margin-top: var(--spacing-md);
}

.gateway-link--gold {
    color: var(--gold, var(--gold));
    text-decoration: none;
}

.gateway-link--gold:hover {
    text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 1000px) {
    .gateway-teachers__grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .gateway-hero {
        min-height: auto;
        padding: 140px 0 var(--spacing-xl, 8rem);
    }

    .gateway-section {
        padding: var(--spacing-lg, 4rem) 0;
    }

    .gateway-teachers__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gateway-eighth__content {
        flex-direction: column;
        gap: var(--spacing-sm, 1rem);
    }

    .gateway-eighth__icon {
        font-size: var(--text-2xl);
    }

    .gateway-final__actions {
        flex-direction: column;
    }

    .gateway-final__cta {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .gateway-teachers__grid {
        grid-template-columns: 1fr;
    }

    .gateway-conditions {
        flex-direction: column;
    }

    .gateway-condition {
        text-align: center;
    }
}
