/* ============================================================
   KAKURITSU.COM - Styles
   Probability Theory | Graffiti-Calculus Aesthetic
   ============================================================ */

/* ============================================================
   CSS Reset & Base
   ============================================================ */

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

html, body {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
}

body {
    background: linear-gradient(135deg, #0B1120 0%, #060A14 100%);
    color: #C8D8E8;
    font-family: "Nunito Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.65;
    letter-spacing: 0;
    scroll-behavior: smooth;
    background-attachment: fixed;
}

/* ============================================================
   Typography
   ============================================================ */

h1, h2, h3 {
    font-family: "Chakra Petch", sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

code, pre {
    font-family: "Fira Code", monospace;
    color: #7EB8FF;
    font-size: 14px;
    font-weight: 400;
}

/* ============================================================
   Background & Texture
   ============================================================ */

.background-noise {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cdefs%3E%3Cfilter id='concrete'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch' seed='42'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3C/defs%3E%3Crect width='200' height='200' fill='%230B1120' filter='url(%23concrete)' opacity='0.05'/%3E%3C/svg%3E");
    opacity: 0.05;
    pointer-events: none;
    z-index: 0;
}

/* ============================================================
   Section Base Styles
   ============================================================ */

.section {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: #0B1120;
}

.section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(5, 10, 20, 0.3);
    pointer-events: none;
}

.grid-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(90deg, #1A2A3F 1px, transparent 1px),
        linear-gradient(0deg, #1A2A3F 1px, transparent 1px);
    background-size: 83.33px 83.33px;
    opacity: 0.15;
    pointer-events: none;
    z-index: 1;
}

.section-content {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 80px 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    z-index: 5;
}

/* ============================================================
   Data Readout Strips
   ============================================================ */

.data-readout {
    position: absolute;
    left: 0;
    right: 0;
    height: 40px;
    background-color: rgba(26, 42, 63, 0.6);
    border-top: 1px solid #1A2A3F;
    border-bottom: 1px solid #1A2A3F;
    display: flex;
    align-items: center;
    padding: 0 40px;
    font-family: "Fira Code", monospace;
    font-size: 11px;
    color: #5A7A9A;
    overflow: hidden;
    white-space: nowrap;
    z-index: 4;
}

.data-readout.top {
    top: 0;
}

.data-readout.bottom {
    bottom: 0;
}

/* ============================================================
   Section Headers (Wildstyle)
   ============================================================ */

.section-header {
    font-size: 96px;
    font-weight: 700;
    margin-bottom: 40px;
    text-shadow: 
        0 0 20px #4A8FE7,
        0 0 60px rgba(74, 143, 231, 0.3);
    width: 100%;
}

.header-svg {
    width: 100%;
    max-width: 600px;
    height: auto;
}

.wildstyle-text {
    fill: #C8D8E8;
    filter: drop-shadow(0 0 10px #4A8FE7);
}

/* ============================================================
   Section 1: AXIOMS
   ============================================================ */

.section-1 {
    background-color: #0B1120;
}

.axiom-blocks {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    width: 100%;
    margin-top: 60px;
}

.axiom-block {
    background-color: rgba(26, 42, 63, 0.4);
    border-left: 3px solid #4A8FE7;
    padding: 30px;
    border-radius: 0;
    box-shadow: 0 0 20px rgba(74, 143, 231, 0.2);
}

.axiom-title {
    color: #E8F0FF;
    font-size: 18px;
    margin-bottom: 15px;
    font-family: "Chakra Petch", sans-serif;
}

.axiom-formula {
    display: block;
    background-color: rgba(74, 143, 231, 0.1);
    padding: 12px;
    margin: 12px 0;
    border-left: 2px solid #7EB8FF;
    font-size: 13px;
}

.axiom-text {
    color: #C8D8E8;
    font-size: 14px;
    line-height: 1.6;
    margin-top: 15px;
}

/* ============================================================
   Section 2: DISTRIBUTIONS
   ============================================================ */

.section-2 {
    background-color: #0B1120;
}

.distributions-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    width: 100%;
    margin-top: 40px;
    align-items: center;
}

.distributions-visualizer {
    position: relative;
    width: 100%;
    height: 400px;
    background-color: rgba(26, 42, 63, 0.3);
    border: 1px solid #1A2A3F;
    box-shadow: 0 0 30px rgba(74, 143, 231, 0.1);
}

.distribution-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.distribution-labels {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.distribution-label {
    font-family: "Fira Code", monospace;
    font-size: 12px;
    fill: #5A7A9A;
}

.distributions-text {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.distribution-block {
    background-color: rgba(26, 42, 63, 0.3);
    padding: 20px;
    border-left: 3px solid #00B4FF;
}

.dist-title {
    color: #E8F0FF;
    font-size: 16px;
    margin-bottom: 10px;
    font-family: "Chakra Petch", sans-serif;
}

.dist-formula {
    display: block;
    background-color: rgba(126, 184, 255, 0.08);
    padding: 10px;
    margin: 10px 0;
    border-left: 2px solid #7EB8FF;
    font-size: 12px;
}

.dist-annotation {
    color: #C8D8E8;
    font-size: 13px;
    line-height: 1.5;
    margin-top: 10px;
    font-style: italic;
    color: #5A7A9A;
}

/* ============================================================
   Section 3: BAYES
   ============================================================ */

.section-3 {
    background-color: #0B1120;
    justify-content: center;
}

.section-3 .section-content {
    align-items: center;
    text-align: center;
}

.bayes-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.bayes-header {
    text-align: center;
    width: 100%;
}

.bayes-svg {
    max-width: 800px;
    width: 100%;
    height: auto;
}

.bayes-eq-left, .bayes-eq-right, .bayes-eq-symbol {
    fill: #C8D8E8;
    filter: drop-shadow(0 0 8px #4A8FE7);
}

.bayes-subtitle {
    color: #C8D8E8;
    font-size: 18px;
    line-height: 1.6;
    max-width: 600px;
    font-style: italic;
    color: #5A7A9A;
}

.bayes-breakdown {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
    margin-top: 60px;
    width: 100%;
}

.bayes-term {
    background-color: rgba(26, 42, 63, 0.4);
    padding: 25px;
    border-radius: 4px;
    min-width: 140px;
    text-align: center;
    box-shadow: 0 0 20px rgba(74, 143, 231, 0.15);
}

.term-label {
    display: block;
    font-family: "Fira Code", monospace;
    font-size: 16px;
    color: #7EB8FF;
    font-weight: 600;
    margin-bottom: 8px;
}

.term-name {
    display: block;
    color: #E8F0FF;
    font-size: 14px;
    font-family: "Chakra Petch", sans-serif;
    font-weight: 600;
    margin-bottom: 8px;
}

.term-text {
    color: #5A7A9A;
    font-size: 12px;
    line-height: 1.5;
    margin: 0;
}

.bayes-arrow {
    color: #4A8FE7;
    font-size: 28px;
    font-weight: bold;
}

/* ============================================================
   Section 4: STOCHASTIC
   ============================================================ */

.section-4 {
    background-color: #0B1120;
}

.stochastic-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    width: 100%;
    margin-top: 40px;
    align-items: center;
}

.stochastic-visualizer {
    position: relative;
    width: 100%;
    height: 400px;
    background-color: rgba(26, 42, 63, 0.3);
    border: 1px solid #1A2A3F;
    box-shadow: 0 0 30px rgba(74, 143, 231, 0.1);
}

.stochastic-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.stochastic-text {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.stochastic-block {
    background-color: rgba(26, 42, 63, 0.3);
    padding: 20px;
    border-left: 3px solid #00B4FF;
}

.stoch-title {
    color: #E8F0FF;
    font-size: 16px;
    margin-bottom: 10px;
    font-family: "Chakra Petch", sans-serif;
}

.stoch-formula {
    display: block;
    background-color: rgba(126, 184, 255, 0.08);
    padding: 10px;
    margin: 10px 0;
    border-left: 2px solid #7EB8FF;
    font-size: 12px;
}

.stoch-annotation {
    color: #C8D8E8;
    font-size: 13px;
    line-height: 1.5;
    margin-top: 10px;
    font-style: italic;
    color: #5A7A9A;
}

/* ============================================================
   Section 5: CONVERGENCE
   ============================================================ */

.section-5 {
    background-color: #0B1120;
    justify-content: flex-end;
}

.section-5 .section-content {
    align-items: flex-end;
}

.convergence-content {
    display: flex;
    gap: 60px;
    width: 100%;
    align-items: flex-end;
    justify-content: space-between;
}

.convergence-block {
    flex: 1;
    max-width: 400px;
}

.conv-title {
    color: #E8F0FF;
    font-size: 18px;
    margin-bottom: 15px;
    font-family: "Chakra Petch", sans-serif;
}

.conv-formula {
    display: block;
    background-color: rgba(74, 143, 231, 0.1);
    padding: 15px;
    margin: 15px 0;
    border-left: 3px solid #7EB8FF;
    font-size: 14px;
}

.conv-text {
    color: #C8D8E8;
    font-size: 14px;
    line-height: 1.6;
    margin-top: 15px;
}

.convergence-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.convergence-sigma {
    width: 150px;
    height: 150px;
}

.sigma-pulsing {
    animation: pulse-glow 2.5s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        opacity: 1;
        filter: drop-shadow(0 0 20px #4A8FE7);
    }
    50% {
        opacity: 0.7;
        filter: drop-shadow(0 0 40px #00B4FF);
    }
}

/* ============================================================
   Drip Marks
   ============================================================ */

.drip-marks {
    position: absolute;
    bottom: 40px;
    width: 100%;
    display: flex;
    justify-content: space-around;
    padding: 0 60px;
    z-index: 3;
}

.drip {
    width: 2px;
    height: 60px;
    background: linear-gradient(to bottom, #1A2A3F, transparent);
    opacity: 0.4;
    animation: drip-animate 3s ease-in forwards;
}

@keyframes drip-animate {
    from {
        transform: translateY(-60px);
        opacity: 0.4;
    }
    to {
        transform: translateY(0);
        opacity: 0.1;
    }
}

/* ============================================================
   Stencil Watermarks
   ============================================================ */

.stencil-watermark {
    position: absolute;
    top: 50%;
    right: 40px;
    transform: translateY(-50%);
    font-size: 400px;
    opacity: 0.05;
    color: #4A8FE7;
    font-weight: bold;
    pointer-events: none;
    z-index: 2;
    line-height: 1;
}

/* ============================================================
   Navigation Tags (Left Sidebar)
   ============================================================ */

.nav-tags {
    position: fixed;
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 30px;
    z-index: 100;
}

.nav-tag {
    width: 50px;
    height: 50px;
    border: 2px solid #4A8FE7;
    background-color: transparent;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: #4A8FE7;
}

.nav-tag:hover {
    border-color: #00B4FF;
    box-shadow: 0 0 15px rgba(0, 180, 255, 0.5);
    color: #00B4FF;
}

.nav-tag.active {
    background-color: rgba(74, 143, 231, 0.2);
    border-color: #00B4FF;
    box-shadow: 0 0 20px rgba(74, 143, 231, 0.6),
                0 0 40px rgba(0, 180, 255, 0.4);
    color: #00B4FF;
}

.tag-svg {
    width: 28px;
    height: 28px;
    stroke: currentColor;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Pink accent for critical moments */
.nav-tag:nth-child(3) {
    border-color: #FF3C7A;
    color: #FF3C7A;
}

.nav-tag:nth-child(3):hover {
    border-color: #FF3C7A;
    box-shadow: 0 0 15px rgba(255, 60, 122, 0.5);
}

/* ============================================================
   Monte Carlo Canvas (Background)
   ============================================================ */

.monte-carlo-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    opacity: 0.3;
}

/* ============================================================
   Scan Lines
   ============================================================ */

.scan-lines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(74, 143, 231, 0.03) 2px,
        rgba(74, 143, 231, 0.03) 4px
    );
    pointer-events: none;
    z-index: 200;
}

/* ============================================================
   Interactive Elements
   ============================================================ */

a {
    color: #4A8FE7;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

a:hover {
    color: #00B4FF;
    border-bottom-color: #00B4FF;
}

button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1024px) {
    .axiom-blocks {
        grid-template-columns: 1fr;
    }

    .distributions-layout,
    .stochastic-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .distributions-visualizer,
    .stochastic-visualizer {
        height: 300px;
    }

    .bayes-breakdown {
        gap: 20px;
    }

    .convergence-content {
        gap: 30px;
        flex-direction: column;
    }

    .stencil-watermark {
        font-size: 200px;
        right: 20px;
    }

    .nav-tags {
        left: 15px;
        gap: 20px;
    }

    .nav-tag {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 768px) {
    .section-content {
        padding: 40px 30px;
    }

    .section-header {
        font-size: 48px;
        margin-bottom: 30px;
    }

    .axiom-blocks,
    .distributions-layout,
    .stochastic-layout {
        gap: 20px;
        margin-top: 30px;
    }

    .data-readout {
        padding: 0 20px;
        font-size: 9px;
        height: 30px;
    }

    .bayes-breakdown {
        flex-direction: column;
        gap: 15px;
    }

    .bayes-term {
        width: 100%;
    }

    .convergence-visual {
        min-height: 150px;
    }

    .convergence-sigma {
        width: 100px;
        height: 100px;
    }

    .nav-tags {
        left: 10px;
        gap: 15px;
    }

    .nav-tag {
        width: 35px;
        height: 35px;
    }
}

/* ============================================================
   Utility
   ============================================================ */

.hidden {
    display: none;
}

.no-scroll {
    overflow: hidden;
}
