/* ==========================================
   reasr.one — Zen Triadic Void
   Colors: #182838, #384858, #A05080, #C8A040, #40A0A0, #FAFCFE
   Fonts: Nunito (300, 400, 700), JetBrains Mono (300)
   ========================================== */

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

:root {
    --deep-blue: #182838;
    --slate: #384858;
    --magenta: #A05080;
    --gold: #C8A040;
    --teal: #40A0A0;
    --white: #FAFCFE;
    --collage-layer: rgba(160, 80, 128, 0.06);
    --thread-line: rgba(160, 80, 128, 0.08);
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: var(--white);
    color: var(--slate);
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    line-height: 1.9;
    overflow-x: hidden;
}

::selection {
    background-color: rgba(64, 160, 160, 0.15);
    color: var(--deep-blue);
}

/* ==========================================
   Digital Thread Canvas (Fixed Background SVG)
   stroke: #A05080, stroke-width: 0.5px, opacity: 0.08
   ========================================== */
#digital-threads {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    opacity: 0.08;
}

/* ==========================================
   Collage Fragment Particles
   ========================================== */
#collage-fragments {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1;
}

.collage-particle {
    position: absolute;
    opacity: 0;
    animation: floatParticle 20s ease-in-out infinite;
}

@keyframes floatParticle {
    0% {
        opacity: 0;
        transform: translateY(0) rotate(0deg);
    }
    10% {
        opacity: 0.06;
    }
    50% {
        opacity: 0.04;
        transform: translateY(-50px) rotate(20deg);
    }
    90% {
        opacity: 0.06;
    }
    100% {
        opacity: 0;
        transform: translateY(0) rotate(0deg);
    }
}

/* ==========================================
   Cursor Glow Orb
   ========================================== */
#cursor-glow {
    position: fixed;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(64, 160, 160, 0.03) 0%, transparent 70%);
    pointer-events: none;
    z-index: 1;
    transform: translate(-50%, -50%);
    transition: opacity 0.8s ease;
    opacity: 0;
}

#cursor-glow.active {
    opacity: 1;
}

/* ==========================================
   Void Sections — Ma Negative Space
   Content occupies 40% of viewport width
   Margins: clamp(100px, 20vw, 280px) on sides
   Vertical spacing: 20vh between sections
   ========================================== */
.void-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20vh clamp(100px, 20vw, 280px);
    z-index: 2;
}

.void-content {
    position: relative;
    width: 100%;
    max-width: 600px;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 1.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.void-content.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================
   Void Labels — JetBrains Mono 300
   Color: #A05080 (triadic magenta)
   ========================================== */
.void-label {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 300;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    color: var(--magenta);
    text-transform: uppercase;
    margin-bottom: 2rem;
}

/* ==========================================
   Hero Section — Opening Void
   ========================================== */
#hero {
    flex-direction: column;
}

#hero .void-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-title {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 4.5vw, 3.2rem);
    color: var(--deep-blue);
    letter-spacing: 0.3em;
    margin-bottom: 1rem;
}

.title-dot {
    color: var(--teal);
    display: inline-block;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hero-title:hover .title-dot {
    transform: scale(1.4);
}

.hero-subtitle {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 300;
    font-size: 0.8rem;
    letter-spacing: 0.25em;
    color: var(--slate);
    text-transform: lowercase;
}

/* ==========================================
   Lottie-like Morph Orbs
   ========================================== */
.lottie-orb {
    position: relative;
    margin-top: 4rem;
}

.morph-svg {
    width: 160px;
    height: 160px;
}

.morph-large {
    width: 240px;
    height: 240px;
}

.morph-closing {
    width: 100px;
    height: 100px;
}

/* CSS fallback rotation for morph paths */
.morph-path,
.morph-path-fluid {
    transform-origin: center;
}

/* ==========================================
   Scroll Indicator
   ========================================== */
.scroll-indicator {
    position: absolute;
    bottom: 8vh;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    opacity: 0;
    animation: fadeInScroll 2s ease-out 2.5s forwards;
}

@keyframes fadeInScroll {
    to {
        opacity: 1;
    }
}

.scroll-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, var(--magenta), transparent);
    animation: scrollPulse 2.5s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% {
        opacity: 0.3;
        transform: scaleY(1);
    }
    50% {
        opacity: 0.7;
        transform: scaleY(1.3);
    }
}

/* ==========================================
   Collage Cards
   ========================================== */
.collage-card {
    position: relative;
    background: transparent;
    border: 1px solid rgba(56, 72, 88, 0.06);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.8s ease, box-shadow 0.8s ease;
}

.collage-card:hover {
    border-color: rgba(56, 72, 88, 0.15);
    box-shadow: 0 20px 60px rgba(24, 40, 56, 0.03);
}

.card-inner {
    padding: clamp(2rem, 4vw, 3.5rem);
    position: relative;
}

.card-accent {
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    opacity: 0.5;
    transition: opacity 0.8s ease, width 0.8s ease;
}

.collage-card:hover .card-accent {
    opacity: 1;
    width: 4px;
}

.accent-teal {
    background: var(--teal);
}

.accent-magenta {
    background: var(--magenta);
}

.accent-gold {
    background: var(--gold);
}

/* Collage overlay — mixed-media texture at 6% opacity */
.card-collage-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(135deg, transparent 40%, var(--collage-layer) 40.5%, var(--collage-layer) 41%, transparent 41.5%),
        linear-gradient(225deg, transparent 60%, var(--collage-layer) 60.5%, var(--collage-layer) 61%, transparent 61.5%),
        linear-gradient(45deg, transparent 70%, rgba(64, 160, 160, 0.03) 70.5%, rgba(64, 160, 160, 0.03) 71%, transparent 71.5%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 1s ease;
}

.collage-card:hover .card-collage-overlay {
    opacity: 1;
}

/* ==========================================
   Section Headings — Nunito 700
   Color: #182838 (triadic deep blue)
   ========================================== */
.section-heading {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
    color: var(--deep-blue);
    line-height: 1.3;
    margin-bottom: 1.5rem;
}

.section-heading-centered {
    text-align: center;
    margin-bottom: 3rem;
}

/* ==========================================
   Section Text — Nunito 300
   Color: #384858 (slate blue)
   ========================================== */
.section-text {
    font-family: 'Nunito', sans-serif;
    font-weight: 300;
    color: var(--slate);
    max-width: 480px;
    line-height: 1.9;
}

/* ==========================================
   Floating Fragments — Collage Visual Remnants
   ========================================== */
.floating-fragment {
    position: absolute;
    opacity: 0.35;
    transition: opacity 0.6s ease;
}

.floating-fragment:hover {
    opacity: 0.6;
}

.fragment-pos-1 {
    top: -40px;
    right: -60px;
}

.fragment-pos-2 {
    bottom: 20px;
    right: -80px;
}

.fragment-pos-3 {
    bottom: -30px;
    left: -50px;
}

.fragment-pos-4 {
    top: 20px;
    right: -40px;
}

.fragment-svg {
    width: 80px;
    height: 80px;
}

.fragment-small {
    width: 50px;
    height: 50px;
}

.fragment-tiny {
    width: 40px;
    height: 40px;
}

/* ==========================================
   Triadic Display — Three-Point Color Harmony
   ========================================== */
.triadic-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4rem;
    gap: 2rem;
}

.triadic-point {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    cursor: default;
}

.point-circle {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.6s ease;
}

.triadic-point:hover .point-circle {
    transform: scale(1.15);
}

.point-ring {
    position: absolute;
    top: -8px;
    left: -8px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 1px solid transparent;
    transition: border-color 0.6s ease, transform 1s ease;
}

.triadic-point:hover .point-ring {
    transform: rotate(90deg);
}

.point-teal .point-circle {
    background-color: var(--teal);
    box-shadow: 0 0 30px rgba(64, 160, 160, 0.2);
}

.point-teal:hover .point-circle {
    box-shadow: 0 0 40px rgba(64, 160, 160, 0.4);
}

.point-teal:hover .point-ring {
    border-color: rgba(64, 160, 160, 0.3);
}

.point-magenta .point-circle {
    background-color: var(--magenta);
    box-shadow: 0 0 30px rgba(160, 80, 128, 0.2);
}

.point-magenta:hover .point-circle {
    box-shadow: 0 0 40px rgba(160, 80, 128, 0.4);
}

.point-magenta:hover .point-ring {
    border-color: rgba(160, 80, 128, 0.3);
}

.point-gold .point-circle {
    background-color: var(--gold);
    box-shadow: 0 0 30px rgba(200, 160, 64, 0.2);
}

.point-gold:hover .point-circle {
    box-shadow: 0 0 40px rgba(200, 160, 64, 0.4);
}

.point-gold:hover .point-ring {
    border-color: rgba(200, 160, 64, 0.3);
}

.point-label {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--deep-blue);
}

.point-hex {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 300;
    font-size: 0.65rem;
    color: var(--slate);
    letter-spacing: 0.05em;
}

/* ==========================================
   Triadic Connector Triangle
   ========================================== */
.triadic-connector {
    display: flex;
    justify-content: center;
}

.connector-svg {
    width: 100%;
    max-width: 400px;
    height: auto;
    opacity: 0.5;
}

.connector-node {
    transition: r 0.4s ease;
}

/* ==========================================
   Thread Visualization
   stroke: #A05080, stroke-width: 0.5px, opacity: 0.08
   ========================================== */
.thread-visualization {
    margin-top: 3rem;
}

.thread-svg {
    width: 100%;
    height: auto;
    opacity: 0.5;
}

.thread-line {
    stroke: #384858;
    stroke-width: 0.3;
    opacity: 0;
    animation: threadReveal 1.5s ease-out forwards;
}

.thread-line-v {
    stroke-width: 0.2;
}

.thread-node {
    opacity: 0;
    animation: nodeAppear 0.8s ease-out 1s forwards;
}

.thread-node-small {
    opacity: 0;
    animation: nodeAppear 0.8s ease-out 1.3s forwards;
}

.thread-diagonal {
    stroke: #40A0A0;
    stroke-width: 0.4;
    opacity: 0;
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    animation: drawLine 2s ease-out 0.5s forwards;
}

.thread-diagonal-alt {
    stroke: #A05080;
}

.thread-diagonal-warm {
    stroke: #C8A040;
}

.thread-arc {
    stroke: var(--slate);
    stroke-width: 0.25;
    opacity: 0;
    stroke-dasharray: 150;
    stroke-dashoffset: 150;
    animation: drawLine 2.5s ease-out 1s forwards;
}

@keyframes threadReveal {
    to {
        opacity: 0.6;
    }
}

@keyframes nodeAppear {
    to {
        opacity: 1;
    }
}

@keyframes drawLine {
    to {
        opacity: 0.5;
        stroke-dashoffset: 0;
    }
}

/* Thread animations paused until visible */
#threads .thread-line,
#threads .thread-node,
#threads .thread-node-small,
#threads .thread-diagonal,
#threads .thread-arc {
    animation-play-state: paused;
}

#threads .void-content.visible .thread-line,
#threads .void-content.visible .thread-node,
#threads .void-content.visible .thread-node-small,
#threads .void-content.visible .thread-diagonal,
#threads .void-content.visible .thread-arc {
    animation-play-state: running;
}

/* ==========================================
   Memory Grid — Collage Fragments Section
   ========================================== */
.memory-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.memory-cell {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(56, 72, 88, 0.06);
    transition: border-color 0.6s ease, transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.memory-cell:hover {
    border-color: rgba(56, 72, 88, 0.15);
    transform: translateY(-4px);
}

.memory-texture {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.memory-cell-1 .memory-texture {
    background:
        linear-gradient(135deg, rgba(64, 160, 160, 0.08) 0%, transparent 50%),
        repeating-linear-gradient(0deg, transparent, transparent 8px, rgba(64, 160, 160, 0.03) 8px, rgba(64, 160, 160, 0.03) 9px);
}

.memory-cell-2 .memory-texture {
    background:
        radial-gradient(circle at 30% 70%, rgba(160, 80, 128, 0.08) 0%, transparent 50%),
        repeating-linear-gradient(45deg, transparent, transparent 6px, rgba(160, 80, 128, 0.03) 6px, rgba(160, 80, 128, 0.03) 7px);
}

.memory-cell-3 .memory-texture {
    background:
        linear-gradient(225deg, rgba(200, 160, 64, 0.08) 0%, transparent 50%),
        repeating-linear-gradient(90deg, transparent, transparent 10px, rgba(200, 160, 64, 0.03) 10px, rgba(200, 160, 64, 0.03) 11px);
}

.memory-mark {
    position: absolute;
    bottom: 12px;
    left: 14px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 300;
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    color: var(--magenta);
    opacity: 0.5;
}

.memory-caption {
    text-align: center;
    max-width: 440px;
    margin: 0 auto;
    font-size: clamp(0.82rem, 1vw, 0.95rem);
}

/* ==========================================
   Closing Section
   ========================================== */
#closing .void-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.closing-title {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 4.5vw, 3.2rem);
    color: var(--deep-blue);
    line-height: 1.4;
    margin-bottom: 3rem;
}

.closing-bar {
    width: 0px;
    height: 2px;
    background: linear-gradient(90deg, var(--teal), var(--magenta), var(--gold));
    margin-bottom: 2rem;
    border-radius: 1px;
    transition: width 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.closing-bar.expanded {
    width: 80px;
}

.closing-domain {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    color: var(--slate);
    margin-bottom: 3rem;
}

.closing-orb {
    margin-top: 1rem;
}

.closing-circle-1,
.closing-circle-2,
.closing-circle-3 {
    transform-origin: 60px 60px;
}

.closing-circle-1 {
    animation: closeOrbit1 20s linear infinite;
}

.closing-circle-2 {
    animation: closeOrbit2 15s linear infinite reverse;
}

.closing-circle-3 {
    animation: closeOrbit3 25s linear infinite;
}

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

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

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

/* ==========================================
   Responsive — Maintain Ma Space
   ========================================== */
@media (max-width: 1200px) {
    .void-section {
        padding: 15vh clamp(60px, 12vw, 200px);
    }
}

@media (max-width: 768px) {
    .void-section {
        padding: 12vh clamp(30px, 8vw, 100px);
    }

    .triadic-display {
        flex-direction: column;
        gap: 2.5rem;
    }

    .morph-svg {
        width: 120px;
        height: 120px;
    }

    .morph-large {
        width: 180px;
        height: 180px;
    }

    .floating-fragment {
        display: none;
    }

    .memory-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .memory-cell {
        aspect-ratio: 3 / 2;
    }
}

@media (max-width: 480px) {
    .void-section {
        padding: 10vh 24px;
    }

    .hero-title {
        letter-spacing: 0.15em;
    }

    .morph-closing {
        width: 80px;
        height: 80px;
    }
}
