/* ronri.org -- cinematic logic, candy-bright, layered-depth */

:root {
    --coral: #FF8A80;
    --mint: #A7F3D0;
    --neon: #8B5CF6;
    --deep: #6D28D9;
    --lemon: #FEF08A;
    --teal: #2DD4BF;
    --cream: #FFF7ED;

    --font-head: "Space Grotesk", system-ui, sans-serif;
    --font-body: "DM Sans", system-ui, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--deep);
    background: var(--cream);
    overflow-x: hidden;
    line-height: 1.75;
}

/* === Scene & Layer System === */

.scene {
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    width: 100%;
}

.layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.layer.background {
    z-index: 1;
    opacity: 0.55;
}

.layer.midground {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(40px, 6vw, 96px);
    min-height: 100vh;
}

.layer.foreground {
    z-index: 3;
    pointer-events: none;
}

/* === Opening Scene === */

.scene-opening {
    background: linear-gradient(135deg, var(--coral) 0%, var(--lemon) 50%, var(--mint) 100%);
}

.scene-opening .layer.midground {
    align-items: center;
    text-align: center;
}

.geo-shape {
    position: absolute;
    opacity: 0.25;
    mix-blend-mode: multiply;
}

.geo-circle {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: var(--neon);
    top: 12%;
    left: 8%;
    animation: float 14s ease-in-out infinite;
}

.geo-circle-2 {
    width: 180px;
    height: 180px;
    background: var(--teal);
    top: 65%;
    right: 12%;
    left: auto;
    animation-delay: -4s;
    animation-duration: 18s;
}

.geo-square {
    width: 220px;
    height: 220px;
    background: var(--deep);
    top: 60%;
    right: 18%;
    transform: rotate(15deg);
    animation: float 16s ease-in-out infinite;
    animation-delay: -2s;
}

.geo-square-2 {
    width: 140px;
    height: 140px;
    background: var(--coral);
    top: 18%;
    right: 22%;
    transform: rotate(-22deg);
    animation-delay: -7s;
}

.geo-triangle {
    width: 0;
    height: 0;
    border-left: 120px solid transparent;
    border-right: 120px solid transparent;
    border-bottom: 200px solid var(--lemon);
    background: transparent;
    top: 40%;
    left: 50%;
    transform: translateX(-50%) rotate(8deg);
    opacity: 0.3;
    animation: float 20s ease-in-out infinite;
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-30px) rotate(5deg); }
}

.geo-square {
    animation-name: float-square;
}

@keyframes float-square {
    0%, 100% { transform: rotate(15deg) translateY(0); }
    50% { transform: rotate(20deg) translateY(-25px); }
}

.geo-square-2 {
    animation-name: float-square-2;
}

@keyframes float-square-2 {
    0%, 100% { transform: rotate(-22deg) translateY(0); }
    50% { transform: rotate(-15deg) translateY(20px); }
}

.geo-triangle {
    animation-name: float-tri;
}

@keyframes float-tri {
    0%, 100% { transform: translateX(-50%) rotate(8deg) translateY(0); }
    50% { transform: translateX(-50%) rotate(12deg) translateY(-20px); }
}

.wordmark {
    position: relative;
    font-family: var(--font-head);
    font-weight: 700;
    font-size: clamp(48px, 11vw, 144px);
    letter-spacing: -0.04em;
    color: var(--deep);
    line-height: 1;
}

.wordmark-text {
    display: inline-block;
}

.wordmark-underline {
    display: block;
    height: 8px;
    background: var(--neon);
    border-radius: 4px;
    margin: 18px auto 0;
    width: 0;
    box-shadow:
        0 0 10px var(--neon),
        0 0 20px var(--neon),
        0 0 40px var(--neon);
    animation: draw-underline 0.6s 0.4s ease-out forwards;
}

@keyframes draw-underline {
    from { width: 0; }
    to { width: 78%; }
}

.subtitle {
    margin-top: 28px;
    font-family: var(--font-head);
    font-weight: 500;
    font-size: clamp(18px, 2.4vw, 28px);
    color: var(--deep);
    letter-spacing: 0.04em;
    opacity: 0;
    animation: fade-up 0.8s 1.0s ease-out forwards;
}

.kicker {
    margin-top: 8px;
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--deep);
    opacity: 0;
    animation: fade-up 0.8s 1.4s ease-out forwards;
}

@keyframes fade-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 0.85; transform: translateY(0); }
}

/* === Fish === */

.fish {
    position: absolute;
    width: 120px;
    height: 60px;
    fill: var(--teal);
    filter: drop-shadow(0 0 6px rgba(139, 92, 246, 0.6));
}

.fish-1 {
    top: 70%;
    left: 0;
    animation: swim 14s linear infinite;
}

.fish-2 {
    top: 80%;
    left: 0;
    width: 90px;
    height: 45px;
    fill: var(--coral);
    animation: swim 17s linear infinite;
    animation-delay: -5s;
}

.fish-3 {
    top: 88%;
    left: 0;
    width: 70px;
    height: 35px;
    fill: var(--neon);
    animation: swim 12s linear infinite;
    animation-delay: -9s;
    filter: drop-shadow(0 0 8px var(--neon));
}

@keyframes swim {
    0% { transform: translateX(-150px) translateY(0) scaleX(1); }
    25% { transform: translateX(25vw) translateY(-22px) scaleX(1); }
    50% { transform: translateX(50vw) translateY(0) scaleX(1); }
    75% { transform: translateX(75vw) translateY(22px) scaleX(1); }
    100% { transform: translateX(calc(100vw + 150px)) translateY(0) scaleX(1); }
}

.fish-glow {
    position: absolute;
    width: 100px;
    height: 50px;
    fill: var(--teal);
    filter:
        drop-shadow(0 0 6px var(--neon))
        drop-shadow(0 0 14px var(--neon));
    top: 75%;
    left: 0;
    animation: swim 16s linear infinite;
}

.fish-glow-2 {
    top: 40%;
    width: 70px;
    height: 35px;
    fill: var(--coral);
    animation-delay: -8s;
    animation-duration: 19s;
}

.fish-glow-3 {
    top: 85%;
    width: 80px;
    height: 40px;
    fill: var(--neon);
    animation-delay: -3s;
    animation-duration: 13s;
}

.fish-glow-4 {
    top: 30%;
    width: 90px;
    height: 45px;
    fill: var(--coral);
    animation-delay: -6s;
    animation-duration: 15s;
}

.fish-glow-5 {
    top: 78%;
    width: 110px;
    height: 55px;
    fill: var(--teal);
    animation-delay: -11s;
    animation-duration: 18s;
}

.fish-glow-6 {
    top: 60%;
    width: 100px;
    height: 50px;
    fill: var(--neon);
    animation-delay: -2s;
    animation-duration: 14s;
}

/* === Act Scenes === */

.scene-act {
    color: var(--deep);
}

.color-field {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.field-coral {
    background: linear-gradient(160deg, var(--coral) 0%, var(--lemon) 100%);
}

.field-lemon {
    background: linear-gradient(180deg, var(--lemon) 0%, var(--mint) 100%);
}

.field-mint {
    background: linear-gradient(200deg, var(--mint) 0%, var(--cream) 100%);
}

.field-coral-2 {
    background: linear-gradient(140deg, var(--coral) 0%, var(--neon) 50%, var(--deep) 100%);
}

.scene-act .layer.background {
    opacity: 0.85;
}

.act-four .layer.background {
    opacity: 1;
}

.act-four .act-heading,
.act-four .act-body,
.act-four .scene-marker {
    color: var(--cream);
}

.scene-marker {
    display: flex;
    align-items: center;
    gap: 16px;
    font-family: var(--font-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    margin-bottom: 28px;
    color: var(--deep);
    opacity: 0.85;
}

.scene-marker-light {
    color: var(--cream);
}

.scene-divider {
    width: 60px;
    height: 1px;
    background: currentColor;
}

.scene-number {
    font-weight: 400;
}

.scene-title {
    font-weight: 400;
}

.act-heading {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: clamp(28px, 5vw, 64px);
    letter-spacing: -0.02em;
    line-height: 1.15;
    max-width: 22ch;
    margin-bottom: 32px;
}

.act-body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(16px, 1.5vw, 18px);
    line-height: 1.75;
    max-width: 56ch;
    margin-bottom: 24px;
}

.act-body em {
    font-style: italic;
    color: var(--neon);
    font-weight: 500;
}

.neon-term {
    color: var(--neon);
    text-shadow:
        0 0 10px var(--neon),
        0 0 20px var(--neon),
        0 0 40px rgba(139, 92, 246, 0.6);
    font-weight: 700;
}

.act-four .neon-term {
    color: var(--lemon);
    text-shadow:
        0 0 10px var(--lemon),
        0 0 20px var(--lemon),
        0 0 40px rgba(254, 240, 138, 0.6);
}

.underlined {
    position: relative;
    display: inline;
    background-image: linear-gradient(var(--neon), var(--neon));
    background-repeat: no-repeat;
    background-size: 0% 3px;
    background-position: 0 100%;
    padding-bottom: 4px;
    transition: background-size 0.6s ease-out;
}

.underlined.is-drawn {
    background-size: 100% 3px;
}

.logic-notation {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--cream);
    background: var(--deep);
    padding: 22px 26px;
    border-radius: 4px;
    box-shadow:
        0 0 0 1px var(--neon),
        0 0 16px rgba(139, 92, 246, 0.4),
        0 18px 40px rgba(109, 40, 217, 0.25);
    max-width: 56ch;
    line-height: 1.8;
    white-space: pre-wrap;
}

.act-four .logic-notation {
    color: var(--lemon);
    background: rgba(0, 0, 0, 0.4);
}

/* Operators row */

.operators-row {
    display: flex;
    flex-wrap: wrap;
    gap: 36px 56px;
    margin-bottom: 36px;
}

.operator {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.operator-glyph {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: clamp(28px, 4vw, 48px);
    letter-spacing: -0.01em;
}

.operator-meaning {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--deep);
    opacity: 0.78;
    letter-spacing: 0.02em;
}

/* === Aquarium === */

.scene-aquarium {
    background: var(--deep);
    color: var(--cream);
    min-height: 110vh;
}

.aquarium-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(139, 92, 246, 0.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(139, 92, 246, 0.12) 1px, transparent 1px);
    background-size: 48px 48px;
    opacity: 0.7;
}

.scene-aquarium .layer.background {
    opacity: 1;
}

.scene-aquarium .layer.midground {
    color: var(--cream);
}

.aquarium-heading {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: clamp(28px, 5vw, 64px);
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: 48px;
    color: var(--cream);
    max-width: 22ch;
}

.aquarium-tanks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
}

.tank {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(139, 92, 246, 0.5);
    border-radius: 6px;
    padding: 24px;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.18);
}

.tank-label {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--mint);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    margin-bottom: 18px;
    opacity: 0.9;
}

.tank-water {
    position: relative;
    height: 240px;
    background: linear-gradient(180deg, rgba(45, 212, 191, 0.08), rgba(139, 92, 246, 0.16));
    border-radius: 4px;
    overflow: hidden;
}

.aq-fish {
    position: absolute;
    width: 60px;
    height: 30px;
    filter: drop-shadow(0 0 5px var(--neon)) drop-shadow(0 0 10px var(--neon));
}

/* Syllogism formation: triangle */
.aq-fish-syl-1 { top: 18%; left: 50%; transform: translateX(-50%); fill: var(--teal); animation: drift-soft 6s ease-in-out infinite; }
.aq-fish-syl-2 { top: 60%; left: 22%; fill: var(--coral); animation: drift-soft 7s ease-in-out infinite; animation-delay: -2s; }
.aq-fish-syl-3 { top: 60%; left: 62%; fill: var(--lemon); animation: drift-soft 7.5s ease-in-out infinite; animation-delay: -3.5s; }

/* Chain formation: diagonal line */
.aq-fish-ch-1 { top: 14%; left: 6%;  fill: var(--teal); animation: drift-soft 6s ease-in-out infinite; }
.aq-fish-ch-2 { top: 36%; left: 28%; fill: var(--mint); animation: drift-soft 6.4s ease-in-out infinite; animation-delay: -1s; }
.aq-fish-ch-3 { top: 56%; left: 50%; fill: var(--coral); animation: drift-soft 6.8s ease-in-out infinite; animation-delay: -2s; }
.aq-fish-ch-4 { top: 74%; left: 70%; fill: var(--lemon); animation: drift-soft 7.2s ease-in-out infinite; animation-delay: -3s; }

/* Contradiction: two opposed */
.aq-fish-co-1 { top: 30%; left: 14%; fill: var(--teal); animation: drift-soft 5.5s ease-in-out infinite; }
.aq-fish-co-2 { top: 56%; right: 14%; left: auto; transform: scaleX(-1); fill: var(--coral); animation: drift-soft-flip 5.8s ease-in-out infinite; animation-delay: -2s; }

@keyframes drift-soft {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(8px, -6px); }
    50% { transform: translate(0, 4px); }
    75% { transform: translate(-8px, -3px); }
}

@keyframes drift-soft-flip {
    0%, 100% { transform: scaleX(-1) translate(0, 0); }
    25% { transform: scaleX(-1) translate(-8px, -6px); }
    50% { transform: scaleX(-1) translate(0, 4px); }
    75% { transform: scaleX(-1) translate(8px, -3px); }
}

.aq-fish-syl-1 { transform: translateX(-50%); }
.aq-fish-syl-1.is-drift {
    animation: drift-soft-syl-top 6s ease-in-out infinite;
}

@keyframes drift-soft-syl-top {
    0%, 100% { transform: translateX(-50%) translate(0, 0); }
    50% { transform: translateX(-50%) translate(0, -6px); }
}

/* === Credits === */

.credits {
    position: relative;
    overflow: hidden;
    min-height: 90vh;
    background: var(--deep);
    color: var(--cream);
}

.credits .layer.background {
    opacity: 1;
}

.credits-vignette {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at center, transparent 0%, rgba(0, 0, 0, 0.5) 100%),
        linear-gradient(180deg, var(--deep), #4c1d95);
}

.credits .layer.midground {
    align-items: center;
    text-align: center;
    padding-block: 120px;
}

.credits-roll-label {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--mint);
    opacity: 0.8;
    margin-bottom: 16px;
}

.credits-title {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: clamp(36px, 6vw, 80px);
    letter-spacing: -0.02em;
    margin-bottom: 56px;
    color: var(--lemon);
    text-shadow:
        0 0 12px var(--lemon),
        0 0 26px var(--lemon),
        0 0 48px rgba(254, 240, 138, 0.6);
}

.credits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 28px 48px;
    max-width: 1100px;
    width: 100%;
    margin-bottom: 56px;
}

.credit-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.credit-role {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--mint);
    opacity: 0.85;
}

.credit-name {
    font-family: var(--font-head);
    font-weight: 500;
    font-size: clamp(16px, 1.6vw, 20px);
    color: var(--cream);
    letter-spacing: -0.01em;
}

.credits-fin {
    font-family: var(--font-head);
    font-weight: 500;
    font-size: 24px;
    letter-spacing: 0.4em;
    color: var(--coral);
    margin-top: 24px;
    text-shadow: 0 0 12px var(--coral), 0 0 24px var(--coral);
}

.fish-credits {
    width: 80px;
    height: 40px;
    fill: var(--teal);
    filter: drop-shadow(0 0 6px var(--neon)) drop-shadow(0 0 14px var(--neon));
}

.fish-credits-1 {
    top: 12%;
    left: 0;
    animation: swim 18s linear infinite;
}

.fish-credits-2 {
    top: 70%;
    left: 0;
    fill: var(--coral);
    animation: swim 22s linear infinite;
    animation-delay: -8s;
}

.fish-credits-3 {
    top: 86%;
    left: 0;
    width: 60px;
    height: 30px;
    fill: var(--lemon);
    animation: swim 15s linear infinite;
    animation-delay: -4s;
    filter: drop-shadow(0 0 6px var(--lemon)) drop-shadow(0 0 14px var(--lemon));
}

/* === Reveal animation triggers === */

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.9s ease-out, transform 0.9s ease-out;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.parallax-bg {
    will-change: transform;
}

/* === Responsive === */

@media (max-width: 720px) {
    .layer.midground {
        padding: 48px 24px;
    }
    .operators-row {
        gap: 24px 32px;
    }
    .aquarium-tanks {
        grid-template-columns: 1fr;
    }
    .geo-circle {
        width: 180px;
        height: 180px;
    }
    .geo-square {
        width: 140px;
        height: 140px;
    }
}
