/* ============================================
   logical.day — Holographic Formalism
   Pastel · Editorial-Flow · Tractatus
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --bg-primary: #f5f0eb;
    --bg-alt: #ede5f3;
    --text-primary: #2b2438;
    --text-secondary: #6b5e7a;
    --accent-iris: #b8a9d4;
    --accent-rose: #e8b4c8;
    --accent-seafoam: #a8d8cb;
    --accent-gold: #f0d9a0;
    --holo-glow: #c9b8e8;
    --marble-vein: #c9b8d4;
    --holo-hue-offset: 0deg;
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Source Sans 3', 'Source Sans Pro', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

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

body {
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    line-height: 1.72;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    position: relative;
}

/* --- Floating Logical Symbols --- */
.floating-symbols {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.float-sym {
    position: absolute;
    font-family: var(--font-display);
    font-style: italic;
    color: var(--accent-iris);
    opacity: 0.04;
    animation: floatY 8s ease-in-out infinite alternate;
    will-change: transform;
}

@keyframes floatY {
    0% { transform: translateY(0); }
    100% { transform: translateY(-10px); }
}

/* --- Holographic Sidebar (Desktop) --- */
.holo-sidebar {
    position: fixed;
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 100;
}

.sidebar-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-iris), var(--accent-rose), var(--accent-seafoam), var(--accent-gold), var(--accent-iris));
    background-size: 300% 300%;
    animation: holographic-shift 8s ease infinite;
    opacity: 0.35;
    cursor: pointer;
    transition: opacity 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.sidebar-badge.active {
    opacity: 1;
    box-shadow: 0 0 20px rgba(184, 169, 212, 0.4), 0 0 40px rgba(232, 180, 200, 0.15);
    transform: scale(1.15);
    animation: holographic-shift 8s ease infinite, badge-pulse 2s ease-in-out infinite;
}

.sidebar-badge:hover {
    opacity: 0.8;
    box-shadow: 0 0 15px rgba(184, 169, 212, 0.35), 0 0 30px rgba(232, 180, 200, 0.15);
}

@keyframes badge-pulse {
    0%, 100% { box-shadow: 0 0 20px rgba(184, 169, 212, 0.4), 0 0 40px rgba(232, 180, 200, 0.15); }
    50% { box-shadow: 0 0 30px rgba(184, 169, 212, 0.6), 0 0 50px rgba(232, 180, 200, 0.25); }
}

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

/* --- Proposition Blocks --- */
.proposition {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-primary);
    overflow: hidden;
}

.proposition.alt-bg {
    background-color: var(--bg-alt);
}

.prop-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 20vw;
    color: var(--text-primary);
    opacity: 0.04;
    pointer-events: none;
    user-select: none;
    z-index: 1;
    line-height: 1;
}

.prop-inner {
    position: relative;
    z-index: 2;
    width: clamp(320px, 60vw, 720px);
    padding: 60px 0;
    margin: 0 auto;
}

/* --- Proposition Title Zone --- */
.prop-title-zone {
    min-height: 15vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-bottom: 24px;
}

.prop-number {
    font-family: var(--font-display);
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1rem, 1.5vw, 1.5rem);
    color: var(--accent-iris);
    display: block;
    margin-bottom: 8px;
}

.prop-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    color: var(--text-primary);
    line-height: 1.15;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.prop-title em {
    font-weight: 400;
    font-style: italic;
}

.proposition.revealed .prop-title {
    opacity: 1;
    transform: translateY(0);
}

/* --- Proposition Visual Zone --- */
.prop-visual-zone {
    min-height: 30vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 12px;
    position: relative;
    margin-bottom: 24px;
}

/* --- Skeleton Loading --- */
.skeleton-block {
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent-iris), var(--accent-rose), var(--accent-seafoam), var(--accent-gold), var(--accent-iris));
    background-size: 400% 400%;
    animation: skeleton-shimmer 2s ease infinite;
    opacity: 1;
    transition: opacity 0.4s ease;
}

.skeleton-title {
    width: 80%;
    height: 28px;
}

.skeleton-body {
    width: 100%;
    height: 18px;
}

.skeleton-body.short {
    width: 60%;
}

.proposition.revealed .skeleton-block {
    opacity: 0;
    pointer-events: none;
}

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

/* --- Venn Diagrams --- */
.venn-demo {
    position: relative;
    width: 220px;
    height: 160px;
    margin: 20px auto;
    opacity: 0;
    transition: opacity 0.6s ease 0.4s;
}

.proposition.revealed .venn-demo {
    opacity: 1;
}

.venn-circle-sm {
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.venn-circle-sm.venn-a {
    left: 10px;
    top: 20px;
    background: linear-gradient(135deg, rgba(184, 169, 212, 0.25), rgba(232, 180, 200, 0.2));
    border: 1.5px solid rgba(184, 169, 212, 0.4);
}

.venn-circle-sm.venn-b {
    left: 70px;
    top: 20px;
    background: linear-gradient(135deg, rgba(232, 180, 200, 0.25), rgba(168, 216, 203, 0.2));
    border: 1.5px solid rgba(232, 180, 200, 0.4);
}

/* Triple Venn */
.venn-demo.triple {
    width: 260px;
    height: 200px;
}

.venn-demo.triple .venn-a {
    left: 20px;
    top: 10px;
}

.venn-demo.triple .venn-b {
    left: 100px;
    top: 10px;
}

.venn-demo.triple .venn-c {
    left: 60px;
    top: 70px;
    background: linear-gradient(135deg, rgba(168, 216, 203, 0.25), rgba(240, 217, 160, 0.2));
    border: 1.5px solid rgba(168, 216, 203, 0.4);
}

/* Nested Venn */
.venn-demo.nested {
    width: 200px;
    height: 200px;
}

.venn-demo.nested .venn-outer {
    width: 180px;
    height: 180px;
    left: 10px;
    top: 10px;
    background: linear-gradient(135deg, rgba(184, 169, 212, 0.15), rgba(232, 180, 200, 0.1));
    border: 1.5px solid rgba(184, 169, 212, 0.3);
}

.venn-demo.nested .venn-inner {
    width: 100px;
    height: 100px;
    left: 50px;
    top: 50px;
    background: linear-gradient(135deg, rgba(232, 180, 200, 0.3), rgba(168, 216, 203, 0.25));
    border: 1.5px solid rgba(232, 180, 200, 0.5);
}

.venn-circle-sm.fading {
    animation: vennFade 4s ease-in-out infinite alternate;
}

@keyframes vennFade {
    0% { opacity: 0.7; }
    100% { opacity: 0.25; }
}

/* --- Truth Table Background --- */
.truth-table-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.6s ease 0.5s;
}

.proposition.revealed .truth-table-bg {
    opacity: 1;
}

.tt-row {
    display: flex;
    gap: 8px;
}

.tt-cell {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    display: inline-block;
}

.tt-cell.filled {
    background-color: var(--accent-iris);
    opacity: 0.08;
}

.tt-cell.hollow {
    border: 1px solid var(--accent-iris);
    opacity: 0.06;
}

/* --- Proposition Text Zone --- */
.prop-text-zone {
    min-height: 20vh;
    padding: 20px 0;
}

.prop-text-zone p {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.15vw, 1.25rem);
    line-height: 1.72;
    letter-spacing: 0.01em;
    color: var(--text-primary);
    margin-bottom: 1.5em;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.proposition.revealed .prop-text-zone p {
    opacity: 1;
    transform: translateY(0);
}

.proposition.revealed .prop-text-zone p:nth-child(1) {
    transition-delay: 0.5s;
}

.proposition.revealed .prop-text-zone p:nth-child(2) {
    transition-delay: 0.6s;
}

.proposition.revealed .prop-text-zone p:nth-child(3) {
    transition-delay: 0.7s;
}

.logic-term {
    font-family: var(--font-display);
    font-style: italic;
    color: var(--text-secondary);
}

.logic-symbol {
    font-family: var(--font-mono);
    font-size: 0.95em;
    background: rgba(200, 184, 212, 0.12);
    border-radius: 3px;
    padding: 2px 5px;
    color: var(--text-primary);
    white-space: nowrap;
}

/* --- Ionic Volutes --- */
.ionic-volute {
    display: block;
    width: 60px;
    height: 30px;
    margin: 16px auto;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.proposition.revealed .ionic-volute {
    opacity: 1;
}

.volute-path {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    transition: stroke-dashoffset 1.2s ease;
}

.proposition.revealed .volute-path {
    stroke-dashoffset: 0;
}

/* --- Marble Gutters --- */
.marble-gutter {
    height: 10vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-primary);
}

.marble-vein {
    width: 40%;
    height: 4px;
}

/* --- Hero Section --- */
.hero-proposition {
    flex-direction: column;
    gap: 0;
}

.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(4rem, 8vw, 8rem);
    background: linear-gradient(135deg, var(--accent-iris), var(--accent-rose), var(--accent-seafoam), var(--accent-gold), var(--accent-iris));
    background-size: 300% 300%;
    animation: holographic-shift 8s ease infinite;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
    margin-bottom: 24px;
}

.hero-epigraph {
    font-family: var(--font-body);
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1.1rem, 1.8vw, 1.5rem);
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

.hero-holo-sheen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--accent-iris), var(--accent-rose), var(--accent-seafoam), var(--accent-gold), var(--accent-iris));
    background-size: 400% 400%;
    animation: holographic-shift 12s ease infinite;
    opacity: 0.03;
    pointer-events: none;
    z-index: 1;
}

/* --- Hero Venn Circles --- */
.hero-venn-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    height: 500px;
    z-index: 2;
    pointer-events: none;
}

.venn-circle {
    position: absolute;
    border-radius: 50%;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.venn-1 {
    width: 280px;
    height: 280px;
    top: 40px;
    left: 40px;
    background: linear-gradient(135deg, rgba(184, 169, 212, 0.15), rgba(232, 180, 200, 0.1));
    border: 1px solid rgba(184, 169, 212, 0.2);
    animation: vennRotate1 20s linear infinite;
}

.venn-2 {
    width: 250px;
    height: 250px;
    top: 60px;
    right: 40px;
    background: linear-gradient(135deg, rgba(232, 180, 200, 0.15), rgba(168, 216, 203, 0.1));
    border: 1px solid rgba(232, 180, 200, 0.2);
    animation: vennRotate2 25s linear infinite;
}

.venn-3 {
    width: 220px;
    height: 220px;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, rgba(168, 216, 203, 0.15), rgba(240, 217, 160, 0.1));
    border: 1px solid rgba(168, 216, 203, 0.2);
    animation: vennRotate3 30s linear infinite;
}

@keyframes vennRotate1 {
    0% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(15px, -10px) rotate(90deg); }
    50% { transform: translate(0, -5px) rotate(180deg); }
    75% { transform: translate(-15px, -10px) rotate(270deg); }
    100% { transform: translate(0, 0) rotate(360deg); }
}

@keyframes vennRotate2 {
    0% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(-10px, 15px) rotate(90deg); }
    50% { transform: translate(-5px, 0) rotate(180deg); }
    75% { transform: translate(-10px, -15px) rotate(270deg); }
    100% { transform: translate(0, 0) rotate(360deg); }
}

@keyframes vennRotate3 {
    0% { transform: translateX(-50%) translate(0, 0) rotate(0deg); }
    25% { transform: translateX(-50%) translate(10px, -15px) rotate(90deg); }
    50% { transform: translateX(-50%) translate(5px, 0) rotate(180deg); }
    75% { transform: translateX(-50%) translate(-10px, -15px) rotate(270deg); }
    100% { transform: translateX(-50%) translate(0, 0) rotate(360deg); }
}

/* --- Q.E.D. Section --- */
.qed-section {
    min-height: 40vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-primary);
}

.qed-tombstone {
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, var(--accent-iris), var(--accent-rose), var(--accent-seafoam), var(--accent-gold), var(--accent-iris));
    background-size: 300% 300%;
    animation: holographic-shift 8s ease infinite;
}

/* --- Responsive: Mobile --- */
@media (max-width: 768px) {
    .holo-sidebar {
        display: none;
    }

    .prop-watermark {
        display: none;
    }

    .prop-number {
        display: block;
        font-family: var(--font-display);
        font-size: 0.85rem;
        color: var(--accent-iris);
    }

    .prop-inner {
        width: 90vw;
        padding: 40px 5vw;
    }

    .hero-venn-container {
        width: 300px;
        height: 300px;
    }

    .venn-1 {
        width: 180px;
        height: 180px;
        top: 20px;
        left: 10px;
    }

    .venn-2 {
        width: 160px;
        height: 160px;
        top: 30px;
        right: 10px;
    }

    .venn-3 {
        width: 140px;
        height: 140px;
        bottom: 20px;
    }

    .prop-title {
        font-size: clamp(1.8rem, 6vw, 2.5rem);
    }

    .hero-title {
        font-size: clamp(2.5rem, 10vw, 5rem);
    }
}

@media (max-width: 1200px) and (min-width: 769px) {
    .holo-sidebar {
        left: 15px;
    }

    .sidebar-badge {
        width: 24px;
        height: 24px;
    }
}

/* --- Neon Glow Interaction States --- */
.prop-title:hover {
    text-shadow: 0 0 15px rgba(184, 169, 212, 0.35);
}

a {
    color: var(--accent-iris);
    text-decoration: none;
    transition: box-shadow 0.3s ease, color 0.3s ease;
}

a:hover {
    color: var(--holo-glow);
    box-shadow: 0 0 15px rgba(184, 169, 212, 0.35), 0 0 30px rgba(232, 180, 200, 0.15);
}

/* --- Selection Color --- */
::selection {
    background: rgba(184, 169, 212, 0.3);
    color: var(--text-primary);
}
