/* ronri.net - Pop Art Koan: Logic as Art */

/* Custom Properties */
:root {
    --cream: #fffdf5;
    --indigo: #1a1a2e;
    --vermilion: #e63946;
    --ultramarine: #264de4;
    --charcoal: #2d2d3a;
    --parchment: #e8e2d6;
    --black: #0a0a0a;
    --halftone-pink: #f4a0a8;
    --muted: #8a8590;
    --dots: radial-gradient(circle, var(--halftone-pink) 1.2px, transparent 1.2px);
    --dot-size: 12px 12px;
    --dots-dark: radial-gradient(circle, var(--ultramarine) 1.2px, transparent 1.2px);
}

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

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

body {
    background: var(--cream);
    color: var(--charcoal);
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    line-height: 1.75;
    overflow: hidden;
}

/* Scroll Container */
.scroll-container {
    height: 100vh;
    height: 100dvh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
}

/* Page Indicator */
.page-indicator {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 12px;
    opacity: 0.3;
    transition: opacity 0.5s ease;
}

.page-indicator:hover {
    opacity: 0.7;
}

.indicator-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--black);
    transition: all 0.4s ease;
    cursor: pointer;
}

.indicator-dot.active {
    background: var(--vermilion);
    transform: scale(2);
}

/* Proposition Base */
.proposition {
    height: 100vh;
    height: 100dvh;
    scroll-snap-align: start;
    position: relative;
    overflow: hidden;
}

/* Ben-Day Dot Overlay */
.ben-day-overlay {
    position: absolute;
    inset: 0;
    background-image: var(--dots);
    background-size: var(--dot-size);
    opacity: 0.06;
    pointer-events: none;
    z-index: 1;
}

.ben-day-dark {
    background-image: var(--dots-dark);
    opacity: 0.1;
}

/* Typography */
.proposition-label {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 900;
    font-size: clamp(2.5rem, 6vw, 6rem);
    letter-spacing: -0.02em;
    color: var(--indigo);
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid var(--vermilion);
    width: 0;
    animation: typewriter 0.8s steps(1) forwards, blink-cursor 0.5s step-end infinite;
}

.proposition-label-light {
    color: var(--cream);
}

.proposition-label.typed {
    width: auto;
    border-right-color: transparent;
    animation: none;
}

@keyframes typewriter {
    0% { width: 0; }
    100% { width: 1.2em; }
}

@keyframes blink-cursor {
    0%, 100% { border-right-color: var(--vermilion); }
    50% { border-right-color: transparent; }
}

.logic-symbol {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    color: var(--vermilion);
}

/* =========================================
   PROPOSITION ALPHA - The Premise
   ========================================= */
.proposition-alpha {
    background: var(--cream);
    display: grid;
    place-items: center;
}

.alpha-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.therefore-symbol {
    width: 60vw;
    max-width: 700px;
    height: auto;
    position: absolute;
    left: 15%;
    top: 10%;
    z-index: 2;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 1.2s ease, transform 1.2s ease;
}

.proposition-alpha.in-view .therefore-symbol {
    opacity: 1;
    transform: scale(1);
}

.alpha-text {
    position: absolute;
    right: 20%;
    bottom: 30%;
    z-index: 3;
    text-align: right;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease 0.6s, transform 1s ease 0.6s;
}

.proposition-alpha.in-view .alpha-text {
    opacity: 1;
    transform: translateY(0);
}

.site-name {
    display: block;
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 900;
    font-size: 1.2rem;
    letter-spacing: 0.15em;
    color: var(--charcoal);
}

.site-subtitle {
    display: block;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 300;
    font-style: italic;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    color: var(--muted);
    margin-top: 0.5em;
}

/* =========================================
   PROPOSITION BETA - The Conjunction
   ========================================= */
.proposition-beta {
    background: var(--cream);
    display: grid;
    place-items: center;
}

.beta-content {
    width: 60%;
    max-width: 900px;
    text-align: center;
}

.beta-heading {
    margin-bottom: 2rem;
}

.panel-container {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 0;
}

.pop-panel {
    width: calc(45vw - 2rem);
    max-width: 380px;
    padding: 2.5rem 2rem;
    border: 4px solid var(--black);
    box-shadow: 6px 6px 0px var(--black);
    position: relative;
}

.panel-left {
    background: var(--cream);
    transform: translateX(-100px);
    opacity: 0;
    transition: transform 0.9s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.9s cubic-bezier(0.23, 1, 0.32, 1);
}

.panel-right {
    background: var(--indigo);
    transform: translateX(100px);
    opacity: 0;
    transition: transform 0.9s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.9s cubic-bezier(0.23, 1, 0.32, 1);
}

.proposition-beta.in-view .panel-left {
    transform: translateX(0);
    opacity: 1;
}

.proposition-beta.in-view .panel-right {
    transform: translateX(0);
    opacity: 1;
}

.panel-left .panel-text {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 600;
    font-size: clamp(1.1rem, 1.8vw, 1.35rem);
    color: var(--vermilion);
    line-height: 1.75;
}

.panel-right .panel-text {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 600;
    font-size: clamp(1.1rem, 1.8vw, 1.35rem);
    color: var(--cream);
    line-height: 1.75;
}

.panel-gutter {
    width: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.conjunction-symbol {
    font-size: 4rem;
    opacity: 0;
    transition: opacity 0.6s ease 0.9s;
}

.proposition-beta.in-view .conjunction-symbol {
    opacity: 1;
}

/* =========================================
   PROPOSITION GAMMA - The Negation
   ========================================= */
.proposition-gamma {
    background: var(--indigo);
    display: grid;
    place-items: center;
}

.gamma-content {
    position: relative;
    z-index: 2;
    text-align: center;
    opacity: 0;
    transition: opacity 1.2s ease;
}

.proposition-gamma.in-view .gamma-content {
    opacity: 1;
}

.gamma-heading {
    margin-bottom: 1rem;
}

.negation-symbol {
    width: 200px;
    height: 200px;
    animation: rotate-slow 120s linear infinite;
    margin: 1rem auto;
    display: block;
}

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

.gamma-text {
    max-width: 480px;
    margin: 2rem auto 0;
}

.gamma-text p {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1.1rem, 1.8vw, 1.35rem);
    line-height: 1.75;
    color: var(--parchment);
}

/* =========================================
   PROPOSITION DELTA - The Implication
   ========================================= */
.proposition-delta {
    background: var(--cream);
    position: relative;
}

.delta-content {
    position: relative;
    width: 100%;
    height: 100%;
}

.delta-heading {
    position: absolute;
    left: 10%;
    top: 8%;
    z-index: 5;
}

.implication-card {
    position: absolute;
    max-width: 320px;
    padding: 1.8rem 1.5rem;
    border: 4px solid var(--black);
    box-shadow: 6px 6px 0px var(--black);
    background: var(--cream);
    z-index: 3;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.implication-card p {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 600;
    font-size: clamp(1.1rem, 1.8vw, 1.35rem);
    line-height: 1.75;
    color: var(--charcoal);
}

.implication-arrow {
    position: absolute;
    bottom: -30px;
    right: 20px;
    font-size: 3rem;
}

.card-1 {
    left: 10%;
    top: 20%;
    transition-delay: 0s;
}

.card-2 {
    left: 35%;
    top: 50%;
    transition-delay: 0.4s;
}

.card-3 {
    left: 60%;
    top: 75%;
    transition-delay: 0.8s;
}

.proposition-delta.in-view .implication-card {
    opacity: 1;
    transform: translateY(0);
}

.connecting-line {
    position: absolute;
    width: 2px;
    height: 0;
    background: var(--black);
    transform-origin: top left;
    transform: rotate(45deg);
    transition: height 0.8s ease;
    z-index: 2;
}

.line-1 {
    bottom: -10px;
    right: -10px;
}

.line-2 {
    bottom: -10px;
    right: -10px;
}

.proposition-delta.in-view .connecting-line {
    height: 120px;
}

/* =========================================
   PROPOSITION EPSILON - The Conclusion
   ========================================= */
.proposition-epsilon {
    background: var(--cream);
    display: grid;
    place-items: center;
}

.epsilon-content {
    text-align: center;
    position: relative;
}

.conclusion-text {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 600;
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    color: var(--charcoal);
    opacity: 0;
    transition: opacity 2s ease;
}

.proposition-epsilon.in-view .conclusion-text {
    opacity: 1;
}

.therefore-mark {
    color: var(--vermilion);
    font-family: 'Space Mono', monospace;
}

.final-line {
    position: absolute;
    top: calc(100% + 20px);
    right: -20px;
    width: 1px;
    height: 0;
    background: var(--black);
    opacity: 0.2;
    transform: rotate(45deg);
    transform-origin: top left;
    transition: height 4s ease 2s;
}

.proposition-epsilon.in-view .final-line {
    height: 200px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .proposition-label {
        animation: none;
        width: auto;
        border-right: none;
    }
    .negation-symbol {
        animation: none;
    }
    .panel-left,
    .panel-right,
    .implication-card,
    .gamma-content,
    .conclusion-text,
    .therefore-symbol,
    .alpha-text,
    .conjunction-symbol,
    .final-line,
    .connecting-line {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .beta-content {
        width: 90%;
    }

    .panel-container {
        flex-direction: column;
        align-items: center;
        gap: 0;
    }

    .pop-panel {
        width: 100%;
        max-width: 100%;
    }

    .panel-gutter {
        width: 100%;
        height: 50px;
    }

    .conjunction-symbol {
        font-size: 2.5rem;
    }

    .therefore-symbol {
        width: 80vw;
        left: 10%;
        top: 15%;
    }

    .alpha-text {
        right: 10%;
        bottom: 20%;
    }

    .implication-card {
        max-width: 240px;
    }

    .card-1 {
        left: 5%;
        top: 22%;
    }

    .card-2 {
        left: 20%;
        top: 48%;
    }

    .card-3 {
        left: 35%;
        top: 72%;
    }

    .page-indicator {
        right: 12px;
    }

    .delta-heading {
        left: 5%;
        top: 5%;
    }
}
