/* monopole.bar — Dark-academia neon singularity bar */

/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: #0D0D0D;
    color: #C8B89A;
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 18px;
    line-height: 1.7;
    overflow-x: hidden;
    position: relative;
}

/* Noise grain overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* ===== Intro Overlay ===== */
#intro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: #0D0D0D;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

#intro-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#intro-svg {
    width: 60vmin;
    height: 60vmin;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.field-line {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    transition: stroke-dashoffset 2.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.field-line.animate {
    stroke-dashoffset: 0;
}

.intro-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-style: italic;
    font-size: 56px;
    color: #F4E8C1;
    letter-spacing: 0.08em;
    position: relative;
    z-index: 2;
    margin-top: 12vmin;
    opacity: 0;
}

.intro-title.visible {
    opacity: 1;
}

.intro-title .letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.intro-title .letter.show {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Radial Navigation ===== */
#radial-nav {
    position: fixed;
    top: 32px;
    right: 32px;
    z-index: 5000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    opacity: 0;
    transition: opacity 0.6s ease 3.5s;
}

#radial-nav.visible {
    opacity: 1;
}

.nav-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #00E5FF;
    cursor: pointer;
    position: relative;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
    box-shadow: 0 0 0px #00E5FF;
}

.nav-dot:hover {
    box-shadow: 0 0 8px #00E5FF;
    transform: scale(1.3);
}

.nav-label {
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: #00E5FF;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.nav-dot:hover .nav-label {
    opacity: 1;
}

/* ===== Main Container: Split Screen ===== */
#main-container {
    display: flex;
    min-height: 100vh;
    opacity: 0;
    transition: opacity 0.8s ease;
}

#main-container.visible {
    opacity: 1;
}

/* Left Panel: Field Diagram */
#field-panel {
    width: 40%;
    position: sticky;
    top: 0;
    height: 100vh;
    background: linear-gradient(170deg, #1A1A2E 0%, #2D1B4E 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#field-diagram {
    width: 85%;
    height: 85%;
}

.diag-line {
    animation: fieldPulse 4s ease-in-out infinite alternate;
}

.diag-line:nth-child(2n) {
    animation-delay: -1s;
    animation-duration: 5s;
}

.diag-line:nth-child(3n) {
    animation-delay: -2s;
    animation-duration: 3.5s;
}

.diag-line:nth-child(4n+1) {
    animation-delay: -0.5s;
    animation-duration: 4.5s;
}

@keyframes fieldPulse {
    0% { opacity: 0.2; stroke-width: 0.6; }
    100% { opacity: 0.6; stroke-width: 1.2; }
}

.equation-text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    fill: #00E5FF;
    opacity: 0.25;
}

/* Right Panel: Content */
#content-panel {
    width: 60%;
    padding: 80px 60px 120px 60px;
}

/* ===== Content Sections ===== */
.content-section {
    margin-bottom: 80px;
    opacity: 0;
    transform: translateX(80px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.content-section.in-view {
    opacity: 1;
    transform: translateX(0);
}

.content-section:nth-child(2) {
    transition-delay: 0.12s;
}

.content-section:nth-child(3) {
    transition-delay: 0.24s;
}

.section-divider {
    margin-bottom: 40px;
}

.section-divider svg {
    width: 100%;
    height: 20px;
}

/* Patent-style border */
.patent-border {
    border: 1px solid rgba(0, 229, 255, 0.12);
    padding: 40px;
    position: relative;
    clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 20px 100%, 0 calc(100% - 20px));
}

.patent-border::before {
    content: '';
    position: absolute;
    top: -1px;
    right: -1px;
    width: 20px;
    height: 20px;
    border-bottom: 1px solid rgba(0, 229, 255, 0.12);
    transform: rotate(45deg);
    transform-origin: bottom right;
}

.section-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: 32px;
    color: #F4E8C1;
    margin-bottom: 24px;
    letter-spacing: 0.02em;
}

.body-text {
    color: #C8B89A;
    margin-bottom: 16px;
}

.body-text.secondary {
    color: #8A7B6B;
}

.code-text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 14px;
    color: #00E5FF;
    margin-top: 20px;
}

.equation-block {
    text-align: center;
    padding: 24px 0;
    margin: 20px 0;
    border-top: 1px solid rgba(0, 229, 255, 0.08);
    border-bottom: 1px solid rgba(0, 229, 255, 0.08);
}

.equation-block .code-text {
    font-size: 18px;
    margin-top: 0;
}

/* ===== Footer ===== */
#site-footer {
    text-align: center;
    padding: 40px 20px;
    border-top: 1px solid rgba(0, 229, 255, 0.08);
}

.footer-text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    color: #8A7B6B;
}

#session-id {
    color: #00E5FF;
}

/* ===== Diagonal Clip-Path Transitions ===== */
.content-section + .content-section {
    clip-path: polygon(0 7%, 100% 0, 100% 100%, 0 100%);
    padding-top: 40px;
}

/* ===== Interactive Element Hover ===== */
a, .interactive {
    color: #00E5FF;
    text-decoration: none;
    transition: box-shadow 0.3s ease, color 0.3s ease;
}

a:hover, .interactive:hover {
    box-shadow: 0 0 8px #00E5FF;
}

/* ===== Mobile Responsive ===== */
@media (max-width: 768px) {
    #main-container {
        flex-direction: column;
    }

    #field-panel {
        width: 100%;
        height: 30vh;
        position: sticky;
        top: 0;
        z-index: 100;
    }

    #content-panel {
        width: 100%;
        padding: 40px 24px 80px 24px;
    }

    .intro-title {
        font-size: 36px;
    }

    .section-title {
        font-size: 26px;
    }

    .patent-border {
        padding: 24px;
    }

    .content-section + .content-section {
        clip-path: none;
    }

    #radial-nav {
        top: auto;
        bottom: 20px;
        right: 20px;
        flex-direction: row;
    }

    .nav-label {
        display: none;
    }
}
