/* ===========================================
   rational.business - Styles
   Palette: #0A0E27 (Carbon Ink), #E8E8E8 (Digital Silver),
            #00D9FF (Accent Neon), #FF006E (Magenta),
            #3A3F4F, #6B7280, #A0A9B8
   Fonts: Space Mono (700, 400), IBM Plex Mono (400)
   Layout: Z-pattern, asymmetric
   =========================================== */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: #E8E8E8;
    color: #0A0E27;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.95rem, 2.2vw, 1.15rem);
    line-height: 1.7;
    overflow-x: hidden;
    position: relative;
}

/* ---- Constellation Canvas ---- */
#constellation-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* ---- Sweep Sections ---- */
.sweep {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding: 8vh 6vw;
}

/* ---- HERO SWEEP ---- */
.sweep-hero {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding-top: 18vh;
    padding-left: 15vw;
    min-height: 100vh;
    position: relative;
}

.hero-content {
    max-width: 50vw;
    position: relative;
    z-index: 2;
}

.hero-content h1 {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: clamp(2.4rem, 6.5vw, 5.5rem);
    letter-spacing: 0.12em;
    line-height: 1.15;
    color: #0A0E27;
    margin-bottom: 2.5rem;
    visibility: hidden;
}

.hero-content h1.typed {
    visibility: visible;
}

.hero-sub {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.95rem, 2.2vw, 1.15rem);
    line-height: 1.7;
    color: #3A3F4F;
    max-width: 38vw;
    opacity: 0;
    transition: opacity 600ms ease;
}

.hero-sub.visible {
    opacity: 1;
}

.hero-orbital {
    position: absolute;
    right: 5vw;
    top: 15vh;
    width: 40vw;
    max-width: 600px;
    z-index: 1;
    opacity: 0.6;
}

.orbital-ring {
    width: 100%;
    height: auto;
}

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: 6vh;
    left: 15vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    animation: float 2.5s ease-in-out infinite;
}

.scroll-label {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    color: #6B7280;
    text-transform: uppercase;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* ---- FIRST Z-SWEEP ---- */
.sweep-one {
    display: grid;
    grid-template-columns: 20vw 1fr 45vw;
    grid-template-rows: auto 1fr;
    gap: 2rem;
    padding-top: 12vh;
    padding-bottom: 12vh;
    min-height: 100vh;
}

.sweep-one-orbital {
    grid-column: 1;
    grid-row: 1 / 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.orbital-ring-small {
    width: 80%;
    max-width: 280px;
}

.orbital-keywords {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
}

.keyword {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    color: #6B7280;
    text-transform: uppercase;
}

.sweep-one-content {
    grid-column: 3;
    grid-row: 1;
    padding-left: 2vw;
}

.sweep-one-content h2 {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    letter-spacing: 0.12em;
    line-height: 1.2;
    color: #0A0E27;
    margin-bottom: 2rem;
    visibility: hidden;
}

.sweep-one-content h2.typed {
    visibility: visible;
}

.body-text {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.95rem, 2.2vw, 1.15rem);
    line-height: 1.7;
    color: #3A3F4F;
    margin-bottom: 1.8rem;
}

.pull-quote {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    letter-spacing: 0.08em;
    color: #0A0E27;
    border: none;
    margin: 2.5rem 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.pull-quote .star-glyph {
    color: #00D9FF;
    font-size: 1.2em;
}

.constellation-diagram {
    grid-column: 2 / 4;
    grid-row: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.network-svg {
    width: 100%;
    max-width: 500px;
    height: auto;
}

/* ---- SECOND Z-SWEEP ---- */
.sweep-two {
    display: grid;
    grid-template-columns: 42vw 1fr;
    gap: 4vw;
    padding-top: 12vh;
    padding-bottom: 12vh;
    padding-left: 10vw;
    min-height: 100vh;
    align-items: start;
}

.sweep-two-content {
    grid-column: 1;
}

.sweep-two-content h2 {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    letter-spacing: 0.12em;
    line-height: 1.2;
    color: #0A0E27;
    margin-bottom: 2rem;
    visibility: hidden;
}

.sweep-two-content h2.typed {
    visibility: visible;
}

.stat-highlight {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin: 3rem 0;
    padding: 2rem 0;
    border-top: 1px solid #A0A9B8;
    border-bottom: 1px solid #A0A9B8;
}

.stat-number {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 6rem);
    letter-spacing: 0.05em;
    color: #00D9FF;
    line-height: 1;
}

.stat-context {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    color: #6B7280;
    text-transform: uppercase;
}

.sweep-two-illustration {
    grid-column: 2;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 4vh;
}

.branch-svg {
    width: 80%;
    max-width: 400px;
    height: auto;
}

/* ---- THIRD SWEEP / CTA ---- */
.sweep-three {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
    text-align: center;
}

.sweep-three-content {
    position: relative;
    z-index: 2;
    max-width: 55vw;
}

.sweep-three-content h2 {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4rem);
    letter-spacing: 0.12em;
    line-height: 1.2;
    color: #0A0E27;
    margin-bottom: 2rem;
    visibility: hidden;
}

.sweep-three-content h2.typed {
    visibility: visible;
}

.sweep-three-content .body-text {
    text-align: center;
    max-width: 40vw;
    margin: 0 auto 3rem auto;
}

.cta-block {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-button {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 1rem 2.2rem;
    border: 2px solid #0A0E27;
    background: transparent;
    color: #0A0E27;
    cursor: pointer;
    transition: all 200ms ease;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.cta-button:hover {
    background: #00D9FF;
    border-color: #00D9FF;
    color: #0A0E27;
    transform: scale(1.08);
}

.cta-button .star-glyph {
    transition: color 200ms ease;
}

.cta-button:hover .star-glyph {
    color: #0A0E27;
}

.cta-secondary {
    border-color: #6B7280;
    color: #6B7280;
}

.cta-secondary:hover {
    background: #FF006E;
    border-color: #FF006E;
    color: #E8E8E8;
}

.sweep-three-orbital {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80vw;
    max-width: 700px;
    z-index: 1;
    pointer-events: none;
}

.orbital-ring-cta {
    width: 100%;
    height: auto;
}

/* ---- FOOTER ---- */
.site-footer {
    position: relative;
    z-index: 1;
    padding: 6vh 10vw;
    text-align: center;
    border-top: 1px solid #A0A9B8;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.footer-brand .star-glyph {
    color: #00D9FF;
    font-size: 1.2rem;
}

.footer-name {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.12em;
    color: #0A0E27;
}

.footer-tagline {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: #6B7280;
    text-transform: uppercase;
}

.footer-nature {
    margin: 1rem 0;
}

.footer-leaf {
    width: 200px;
    height: auto;
}

.footer-copy {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    color: #A0A9B8;
}

/* ---- Star Glyphs ---- */
.star-glyph {
    color: #00D9FF;
    display: inline-block;
    cursor: default;
    position: relative;
}

.star-glyph.pulse {
    animation: star-pulse 2s ease-in-out infinite;
}

@keyframes star-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
}

/* Star ripple effect on hover */
.star-glyph::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 217, 255, 0.3) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    pointer-events: none;
    transition: width 300ms ease, height 300ms ease, opacity 300ms ease;
    opacity: 0;
}

.star-glyph:hover::after {
    width: 40px;
    height: 40px;
    opacity: 1;
}

/* ---- Fade Reveal ---- */
.fade-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 300ms ease, transform 300ms ease;
}

.fade-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ---- SVG Draw Path Animation ---- */
.draw-path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 1.5s ease;
}

.draw-path.drawn {
    stroke-dashoffset: 0;
}

/* ---- Typewriter Cursor ---- */
.typewriter-cursor {
    display: inline-block;
    width: 3px;
    height: 1em;
    background: #00D9FF;
    margin-left: 2px;
    animation: blink-cursor 0.7s step-end infinite;
    vertical-align: text-bottom;
}

@keyframes blink-cursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .sweep-hero {
        padding-left: 8vw;
        padding-top: 12vh;
    }

    .hero-content {
        max-width: 80vw;
    }

    .hero-sub {
        max-width: 70vw;
    }

    .hero-orbital {
        display: none;
    }

    .sweep-one {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        padding-left: 8vw;
        padding-right: 8vw;
    }

    .sweep-one-orbital {
        grid-column: 1;
        grid-row: 1;
        flex-direction: row;
        gap: 1rem;
    }

    .orbital-ring-small {
        display: none;
    }

    .orbital-keywords {
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.8rem;
    }

    .sweep-one-content {
        grid-column: 1;
        grid-row: 2;
        padding-left: 0;
    }

    .constellation-diagram {
        grid-column: 1;
        grid-row: 3;
    }

    .sweep-two {
        grid-template-columns: 1fr;
        padding-left: 8vw;
        padding-right: 8vw;
    }

    .sweep-two-illustration {
        grid-column: 1;
    }

    .sweep-three-content {
        max-width: 85vw;
    }

    .sweep-three-content .body-text {
        max-width: 80vw;
    }
}

@media (max-width: 600px) {
    .hero-content h1,
    .sweep-one-content h2,
    .sweep-two-content h2,
    .sweep-three-content h2 {
        letter-spacing: 0.06em;
    }

    .cta-block {
        flex-direction: column;
        align-items: center;
    }

    .stat-number {
        font-size: clamp(2.5rem, 12vw, 4rem);
    }
}
