/* =============================================
   localcop.dev - Dark-Mode Scholarly Aurora
   ============================================= */

/* --- Design Palette Reference ---
   #0B0E17 - Background Deep
   #141829 - Background Elevated
   #3DFFA2 - Aurora Green
   #1ABFBF - Aurora Teal
   #7B5CFF - Aurora Violet
   #F0C75E - Aurora Gold
   #E2E4EB - Text Primary
   #8A8FA3 - Text Secondary
*/

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    scroll-snap-type: y proximity;
    background: #0B0E17;
}

body {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.05vw, 1.1rem);
    line-height: 1.72;
    color: #E2E4EB;
    background: #0B0E17;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Aurora Ambient Background --- */
#aurora-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.aurora-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.05;
}

.aurora-orb-1 {
    width: 60vw;
    height: 60vw;
    top: -20%;
    left: -15%;
    background: radial-gradient(circle, #3DFFA2 0%, transparent 70%);
    animation: auroraFloat1 15s ease-in-out infinite;
}

.aurora-orb-2 {
    width: 50vw;
    height: 50vw;
    top: 30%;
    right: -20%;
    background: radial-gradient(circle, #7B5CFF 0%, transparent 70%);
    animation: auroraFloat2 22s ease-in-out infinite;
}

.aurora-orb-3 {
    width: 45vw;
    height: 45vw;
    bottom: -10%;
    left: -10%;
    background: radial-gradient(circle, #1ABFBF 0%, transparent 70%);
    animation: auroraFloat3 30s ease-in-out infinite;
}

@keyframes auroraFloat1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(5vw, 3vh) scale(1.1); }
    66% { transform: translate(-3vw, 5vh) scale(0.95); }
}

@keyframes auroraFloat2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-4vw, -5vh) scale(1.05); }
    66% { transform: translate(3vw, 4vh) scale(1.1); }
}

@keyframes auroraFloat3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(6vw, -3vh) scale(1.08); }
}

/* --- Geometric Decorations (Right Margin) --- */
#geo-decorations {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.geo-circle {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(123, 92, 255, 0.10);
    animation: geoRotate 120s linear infinite;
}

.geo-circle-1 {
    width: 240px;
    height: 240px;
    top: 12%;
    right: 3%;
}

.geo-circle-2 {
    width: 140px;
    height: 140px;
    top: 45%;
    right: 8%;
    animation-duration: 100s;
    animation-direction: reverse;
}

.geo-circle-3 {
    width: 80px;
    height: 80px;
    top: 78%;
    right: 5%;
    animation-duration: 80s;
}

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

.geo-hex-group {
    position: absolute;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    width: 90px;
}

.geo-hex-group-1 {
    top: 32%;
    right: 4%;
}

.geo-hex-group-2 {
    top: 65%;
    right: 6%;
}

.geo-hex {
    width: 32px;
    height: 28px;
    position: relative;
    opacity: 0.08;
}

.geo-hex::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: transparent;
    border: 1px solid #1ABFBF;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.geo-line {
    position: absolute;
    width: 300px;
    height: 1px;
    background: rgba(61, 255, 162, 0.06);
    transform-origin: center;
}

.geo-line-1 {
    top: 20%;
    right: 0;
    transform: rotate(15deg);
}

.geo-line-2 {
    top: 40%;
    right: -5%;
    transform: rotate(75deg);
    width: 400px;
}

.geo-line-3 {
    top: 60%;
    right: 2%;
    transform: rotate(15deg);
}

.geo-line-4 {
    top: 80%;
    right: -3%;
    transform: rotate(75deg);
    width: 350px;
}

/* --- Left-Edge Waypoint Navigation --- */
#waypoints {
    position: fixed;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.waypoint-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(-50%);
    z-index: -1;
}

.waypoint {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(138, 143, 163, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s ease;
    cursor: pointer;
    text-decoration: none;
    display: block;
}

.waypoint.active {
    background: #3DFFA2;
    border-color: #3DFFA2;
    box-shadow: 0 0 12px rgba(61, 255, 162, 0.4), 0 0 24px rgba(61, 255, 162, 0.15);
    animation: waypointPulse 2s ease-in-out infinite;
}

@keyframes waypointPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

/* --- Main Content --- */
#content {
    position: relative;
    z-index: 10;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 48px 0 72px;
}

/* --- Snap Sections --- */
.snap-section {
    min-height: 100vh;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    padding: 80px 0;
    position: relative;
}

/* --- Glassmorphic Cards --- */
.glass-card {
    background: rgba(20, 24, 41, 0.6);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 56px 64px;
    position: relative;
    max-width: 75%;
    transition: border-color 0.3s ease;
    opacity: 0;
    transform: translateY(40px) scale(0.96);
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.glass-card.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.card-aurora-border {
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    border-radius: 17px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.6s ease;
    background: linear-gradient(135deg, #3DFFA2, #1ABFBF, #7B5CFF, #3DFFA2);
    background-size: 300% 300%;
    animation: auroraBorder 20s linear infinite;
    z-index: -1;
}

.glass-card:hover .card-aurora-border {
    opacity: 0.3;
}

.glass-card.visible .card-aurora-border {
    opacity: 0.15;
}

@keyframes auroraBorder {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.card-inner {
    position: relative;
    z-index: 1;
}

/* --- Stagger Animation Children --- */
[data-stagger] {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.glass-card.visible [data-stagger="0"] {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0ms;
}

.glass-card.visible [data-stagger="1"] {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 100ms;
}

.glass-card.visible [data-stagger="2"] {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 200ms;
}

.glass-card.visible [data-stagger="3"] {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 300ms;
}

/* --- Hero Section --- */
.hero-card {
    max-width: 70%;
}

.hero-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 4.5vw, 3.2rem);
    letter-spacing: -0.02em;
    color: #E2E4EB;
    margin-bottom: 24px;
    line-height: 1.15;
}

.hero-thesis {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(1.05rem, 1.3vw, 1.25rem);
    line-height: 1.72;
    color: #8A8FA3;
    max-width: 600px;
    margin-bottom: 32px;
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.meta-label {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.8rem, 0.9vw, 0.95rem);
    letter-spacing: 0.05em;
    color: #8A8FA3;
    text-transform: uppercase;
}

.meta-divider {
    width: 24px;
    height: 1px;
    background: rgba(138, 143, 163, 0.3);
}

/* --- Research Sections --- */
.research-section {
    position: relative;
}

.section-watermark {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 700;
    font-size: 15vw;
    color: rgba(123, 92, 255, 0.03);
    line-height: 1;
    pointer-events: none;
    z-index: 0;
    user-select: none;
}

.section-number {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 700;
    font-size: clamp(1rem, 1.2vw, 1.2rem);
    letter-spacing: 0.05em;
    color: #7B5CFF;
    display: block;
    margin-bottom: 16px;
}

.section-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(1.3rem, 3vw, 2rem);
    letter-spacing: -0.02em;
    color: #E2E4EB;
    margin-bottom: 24px;
    line-height: 1.2;
}

.section-body {
    max-width: 65ch;
}

.section-body p {
    margin-bottom: 16px;
    color: #E2E4EB;
}

.section-body p:last-child {
    margin-bottom: 0;
}

.section-body a {
    color: #1ABFBF;
    text-decoration: none;
    position: relative;
    display: inline;
}

.section-body a::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 1px;
    background: #1ABFBF;
    transition: width 0.25s ease;
}

.section-body a:hover::after {
    width: 100%;
}

.code-inline {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.9em;
    color: #3DFFA2;
    background: rgba(61, 255, 162, 0.06);
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.02em;
}

/* --- Section Meta Tags --- */
.section-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.meta-tag {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.7rem, 0.8vw, 0.8rem);
    letter-spacing: 0.05em;
    color: #8A8FA3;
    background: rgba(138, 143, 163, 0.08);
    padding: 4px 12px;
    border-radius: 4px;
    border: 1px solid rgba(138, 143, 163, 0.1);
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    #content {
        padding: 0 32px 0 56px;
    }

    .glass-card {
        max-width: 90%;
        padding: 40px 40px;
    }

    .hero-card {
        max-width: 90%;
    }

    .section-watermark {
        font-size: 20vw;
    }
}

@media (max-width: 768px) {
    #waypoints {
        display: none;
    }

    #content {
        padding: 0 20px;
    }

    .glass-card {
        max-width: 100%;
        padding: 32px 24px;
    }

    .hero-card {
        max-width: 100%;
    }

    .snap-section {
        min-height: auto;
        padding: 60px 0;
        scroll-snap-align: none;
    }

    .section-watermark {
        font-size: 25vw;
    }

    .geo-circle,
    .geo-hex-group,
    .geo-line {
        display: none;
    }

    .hero-title {
        font-size: clamp(1.6rem, 6vw, 2.4rem);
    }

    .section-meta {
        gap: 8px;
    }
}

/* --- Gold Accent (Sparingly Used) --- */
.meta-tag:hover {
    border-color: #F0C75E;
    color: #F0C75E;
}

/* --- Elevated Background Reference --- */
.glass-card .card-inner {
    background: transparent;
    /* Elevated surface: #141829 at 0.6 opacity via parent glass-card */
}

/* --- Selection Color --- */
::selection {
    background: rgba(26, 191, 191, 0.25);
    color: #E2E4EB;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #0B0E17;
}

::-webkit-scrollbar-thumb {
    background: rgba(138, 143, 163, 0.2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(138, 143, 163, 0.4);
}
