/* ═══════════════════════════════════════════════════════
   JURA — VALUE TAB
   Hero, features apparatus, pinned suite, vault suite,
   illumination matrix, tone checker, and monolith.
═══════════════════════════════════════════════════════ */

/* ── 4. THE CENTER STAGE (Hero) ── */

#center-stage {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start; 
    padding: 0 max(5vw, 4rem);
    box-sizing: border-box;
    scroll-snap-align: center;
}

.welcome-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    max-width: 900px; 
    gap: 1.5rem;
}

.welcome-title {
    font-family: 'Epilogue', sans-serif;
    font-size: clamp(4rem, 8vw, 80px);
    font-weight: 200;
    line-height: 1.1;
    letter-spacing: -0.04em;
    color: #FFFFFF;
    margin: 0;
    opacity: 0; 
}

.welcome-title .text-gradient {
    font-family: 'Cormorant Garamond', Georgia, serif;
    background-image: 
        radial-gradient(circle at 50% 50%, #C4B5D4 0%, transparent 55%),
        radial-gradient(circle at 50% 50%, #4D638C 0%, transparent 60%),
        linear-gradient(135deg, #A2B9E7 0%, #4D638C 50%, #A2B9E7 100%);
    background-size: 250% 250%, 250% 250%, 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: liquid-iridescence 8s ease-in-out infinite alternate;
    font-weight: 400; 
    display: block; 
}

.welcome-subtitle {
    font-family: 'Inter', sans-serif; 
    font-size: clamp(1rem, 1.5vw, 18px);
    font-weight: 400; 
    line-height: 1.6;
    color: #ffffff; 
    max-width: 42rem;
    opacity: 0; 
    margin: 0;
    text-shadow:
        0 0 6px  rgba(0, 0, 0, 1),
        0 0 18px rgba(0, 0, 0, 0.9),
        0 0 38px rgba(0, 0, 0, 0.7);
}

@keyframes cinematic-text-up {
    from { opacity: 0; transform: translateY(40px); filter: blur(8px); }
    to   { opacity: 1; transform: translateY(0);    filter: blur(0); }
}


/* ── 5. THE DYNAMIC TYPOGRAPHIC EXHIBITION ── */

#features-apparatus {
    position: relative;
    width: 100%;
    padding: 10vh max(5vw, 4rem) 30vh max(5vw, 4rem);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 30vh;
}


/* --- EXHIBIT A: THE PINNED INDEX --- */

.pinned-suite {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 4rem;
    width: 100%;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    padding-top: 3rem;
}

.pin-left {
    position: sticky;
    top: 25vh; 
    width: 35%;
}

.pin-num {
    font-family: 'Space Grotesk', monospace;
    font-size: 1rem;
    letter-spacing: 0.2em;
    color: #A2B9E7;
    margin-bottom: 1rem;
    display: block;
    text-transform: uppercase;
}

.pin-title {
    font-family: 'Epilogue', sans-serif;
    font-size: clamp(3rem, 5vw, 5rem);
    font-weight: 200;
    line-height: 1.1;
    color: #fff;
    margin: 0;
    letter-spacing: -0.03em;
}

.pin-right {
    width: 60%;
    display: flex;
    flex-direction: column;
    gap: 30vh; 
    padding-bottom: 20vh; 
}

.pin-item {
    scroll-snap-align: center;
}

.pin-item h3 {
    font-family: 'Epilogue', sans-serif;
    font-size: 2.5rem;
    font-weight: 300;
    color: #fff;
    margin: 0 0 1rem 0;
    letter-spacing: -0.02em;
}

.pin-item p { 
    font-family: 'Inter', sans-serif; 
    font-size: 1.15rem; 
    font-weight: 400; 
    line-height: 1.8; 
    color: #ffffff;
    opacity: 0;
    margin: 0; 
    max-width: 600px; 
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    text-shadow:
        0 0 6px  rgba(0, 0, 0, 1),
        0 0 18px rgba(0, 0, 0, 0.9),
        0 0 38px rgba(0, 0, 0, 0.7);
}

/* Fired by the JavaScript Intersection Observer */
.pin-item p.in-view {
    opacity: 1;
    transform: translateY(0);
}


/* --- EXHIBIT B: THE STATIC REPLACEMENT ENGINE (Vault) --- */

.vault-suite {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* The invisible container that never moves */
.vault-display {
    position: sticky;
    top: 35vh; 
    height: 0;
    width: 100%;
    z-index: 10;
}

/* Text stacks absolutely, one card per track */
.vault-content {
    position: absolute;
    top: 0;
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: 1.5rem;
    padding-top: 2.5rem; 
    opacity: 0; 
    will-change: opacity, transform;
    pointer-events: none; 
}

/* Odd cards anchor left */
.vault-content:nth-child(odd) {
    left: 0;
    right: auto;
}

/* Even cards anchor right */
.vault-content:nth-child(even) {
    left: auto;
    right: 0;
}

.vault-content:nth-child(1) {
    border-top: 1px solid rgba(255, 255, 255, 0.4);
}

.vault-content:nth-child(n+2) {
    border-top: none;
    padding-top: calc(2.5rem + 2px);
}

.vault-content:nth-child(n+2)::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    /* Direct hardware scaling mapping to the JS signal */
    transform: scaleX(var(--line-progress, 0));
    transform-origin: left;
    background-image: 
        radial-gradient(circle at 50% 50%, #C4B5D4 0%, transparent 55%),
        radial-gradient(circle at 50% 50%, #4D638C 0%, transparent 60%),
        linear-gradient(135deg, #A2B9E7 0%, #4D638C 50%, #A2B9E7 100%);
    background-size: 250% 250%, 250% 250%, 300% 300%;
    animation: liquid-iridescence 8s ease-in-out infinite alternate;
}

/* Even (right-anchored) cards draw their line from right to left */
.vault-content:nth-child(even)::before {
    left: auto;
    right: 0;
    transform-origin: right;
}

/* Ensure the even (right-anchored) cards draw their line from right to left */
.vault-content:nth-child(even)::before {
    left: auto;
    right: 0;
    transform-origin: right;
}

/* Draw the line fully across the 800px box when the card becomes active */
.vault-content.is-active:nth-child(n+2)::before {
    width: 100%;
}

/* The physical empty tracks you scroll through */
.vault-track {
    height: 120vh; 
    width: 100%;
    scroll-snap-align: center; 
}

.vault-title {
    font-family: 'Epilogue', sans-serif;
    font-size: clamp(2.5rem, 4vw, 4.5rem);
    font-weight: 200;
    color: #ffffff;
    margin: 0;
    letter-spacing: -0.02em;
    
    /* Dynamic Hardware Mapping */
    opacity: var(--line-progress, 0); 
    transform: translateY(calc((1 - var(--line-progress, 0)) * 40px));
    filter: blur(calc((1 - var(--line-progress, 0)) * 8px));
    
    /* Optical Dampener: Smooths the raw scroll data ticks */
    transition: opacity 0.4s ease-out, transform 0.4s ease-out, filter 0.4s ease-out;
}

.vault-content p {
    font-family: 'Inter', sans-serif;
    font-size: 1.15rem;
    line-height: 1.8;
    color: #ffffff;
    margin: 0;
    
    /* Dynamic Hardware Mapping */
    opacity: var(--line-progress, 0); 
    transform: translateY(calc((1 - var(--line-progress, 0)) * 80px));
    filter: blur(calc((1 - var(--line-progress, 0)) * 12px));
    
    /* Optical Dampener: A longer physical lag inherently creates the reading stagger */
    transition: opacity 0.6s ease-out, transform 0.6s ease-out, filter 0.6s ease-out;
}


/* --- EXHIBIT C: THE ILLUMINATION MATRIX --- */

.matrix-suite {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6rem;
    width: 100%;
    min-height: 100vh;
    align-content: center; /* Forces the internal grid items to the absolute vertical center */
    scroll-snap-align: center;
}

.matrix-item {
    padding: 3rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    margin-top: 15px; 
    
    /* Pre-arrival state: Invisible and sunk */
    opacity: 0;
    transform: translateY(40px);
    
    /* Compound transition: manages both the hover mechanics and the arrival fade */
    transition: margin-top 0.6s cubic-bezier(0.16, 1, 0.3, 1), 
                border-color 0.6s,
                opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1),
                transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* The Arrival Trigger */
.matrix-item.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* Slight stagger so the right card trails the left organically */
.matrix-item:nth-child(2) {
    transition-delay: 0s, 0s, 0.15s, 0.15s;
}

.matrix-item:hover {
    margin-top: 0;
    border-top-color: #fff; 
}

.matrix-item h3 { 
    font-family: 'Epilogue', sans-serif; 
    font-size: 2rem; 
    font-weight: 300; 
    color: #fff;
    margin: 0 0 1.5rem 0; 
}

.matrix-item p { 
    font-family: 'Inter', sans-serif; 
    font-size: 1.1rem; 
    line-height: 1.8; 
    color: #ffffff; 
    margin: 0; 
}

/* Tenth-Lining Special Effects */
.matrix-item:nth-child(1) p {
    position: relative;
    animation: text-space-pulse 6s infinite ease-in-out;
    
    /* The Spatial Boundary: Provides an invisible, rigid 180px cavity. 
       The text wraps freely inside without ever pushing the CSS Grid walls. */
    display: block;
    min-height: 180px; 
}

.matrix-item:nth-child(1) p::after {
    content: "10";
    position: absolute;
    right: -3.5rem; 
    top: 2.97rem; 
    transform: translateY(-50%);
    font-family: 'Space Grotesk', monospace;
    font-size: 0.85rem;
    color: #4D638C;
    opacity: 0.6; 
    pointer-events: none;
    letter-spacing: 0; 
    word-spacing: 0;
}

@keyframes text-space-pulse {
    0%, 100% { word-spacing: 0px; }
    50%       { word-spacing: 6px; } 
}

/* Tone Checker Morphing Engine */
.tc-container {
    display: inline-flex;
    position: relative;
    vertical-align: bottom;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    overflow: hidden;
    margin-right: 0.25em; 
}

.tc-text {
    display: inline-block;
    transition: opacity 0.8s ease, filter 0.8s ease; 
}

.tc-formal {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    filter: blur(4px);
    color: #A2B9E7;
}

.tc-informal {
    opacity: 1;
    filter: blur(0px);
    color: #ffffff;
}

.tc-strike {
    position: absolute;
    left: 0;
    top: 50%;
    height: 2px;
    width: 0%;
    background-image: 
        radial-gradient(circle at 50% 50%, #C4B5D4 0%, transparent 55%),
        radial-gradient(circle at 50% 50%, #4D638C 0%, transparent 60%),
        linear-gradient(135deg, #A2B9E7 0%, #4D638C 50%, #A2B9E7 100%);
    background-size: 250% 250%, 250% 250%, 300% 300%;
    animation: liquid-iridescence 8s ease-in-out infinite alternate;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
}

/* JS Triggered States */
.tc-container.is-striking .tc-strike { width: 100%; }
.tc-container.is-formal .tc-informal { opacity: 0; filter: blur(4px); }
.tc-container.is-formal .tc-formal   { opacity: 1; filter: blur(0px); }
.tc-container.is-formal .tc-strike   { opacity: 0; }


/* --- EXHIBIT D: THE MONOLITH --- */

#monolith-apparatus {
    position: relative;
    width: 100%;
    height: 100vh;
    scroll-snap-align: center; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}

/* The Optical Dampener */
#monolith-apparatus::after {
    content: '';
    position: absolute;
    inset: 0;
    background-color: #000000;
    opacity: 0;
    pointer-events: none; 
    z-index: 5; 
    transition: opacity 15s linear; 
}

#monolith-apparatus.is-focused::after {
    opacity: 0.35; 
}

#monolith-apparatus:has(.join-button:hover)::after {
    opacity: 0.50;
    transition: opacity 5s linear; 
}

.monolith-text-layer {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: none; 
    padding: 0 max(5vw, 4rem);
    text-align: center;
    z-index: 1;
}

.monolith-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 800px;
    transform: translateY(-5vh);
}

/* --- THE MONOLITH CINEMATICS --- */

.monolith-title {
    position: relative; /* Base for the iridescent spectral twin */
    font-family: 'Epilogue', sans-serif;
    font-size: clamp(5rem, 10vw, 10rem); /* Increased scale for dominance */
    font-weight: 200;
    line-height: 1;
    letter-spacing: -0.04em;
    color: #ffffff; /* The final settled state */
    margin: 0 0 0.5rem 0; /* Tightened to bring speech text right underneath */
    
    opacity: 0;
    filter: blur(12px);
    transform: translateY(30px);
    transition: opacity 1.8s cubic-bezier(0.16, 1, 0.3, 1), 
                filter 1.8s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 1.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.monolith-title::after {
    content: "Habeas Totus.";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 50% 50%, #C4B5D4 0%, transparent 55%),
        radial-gradient(circle at 50% 50%, #4D638C 0%, transparent 60%),
        linear-gradient(135deg, #A2B9E7 0%, #4D638C 50%, #A2B9E7 100%);
    background-size: 250% 250%, 250% 250%, 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: liquid-iridescence 8s ease-in-out infinite alternate;
    
    /* THE ETERNAL GLOW: Active from the first frame of appearance */
    filter: drop-shadow(0 0 25px rgba(162, 185, 231, 0.7)); 
    opacity: 1;
    transition: opacity 2.5s ease, filter 2.5s ease;
}

#monolith-apparatus.is-revealed .monolith-title {
    opacity: 1;
    filter: blur(0px);
    transform: translateY(0);
    transition-delay: 0.6s;
}

/* THE SETTLING: Fades out the glow and iridescence to reveal white text at 9.5s */
#monolith-apparatus.is-revealed .monolith-title::after {
    opacity: 0;
    filter: drop-shadow(0 0 0px transparent);
    transition: opacity 2.5s ease 9.5s, filter 2.5s ease 9.5s;
}

.monolith-item p { 
    font-family: 'Inter', sans-serif; 
    font-size: 1.05rem; 
    font-weight: 400; 
    line-height: 1.6; 
    margin: 0 auto;
    color: #ffffff;
    max-width: 680px; /* Constrains width to ensure speech stays centered under title */
    text-shadow: 0 0 6px rgba(0, 0, 0, 1), 0 0 18px rgba(0, 0, 0, 0.9);
}

.monolith-btn-layer {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding-bottom: 12vh;
    z-index: 10;
    
    /* ANTI-GHOSTING STATE */
    opacity: 0;
    visibility: hidden; /* Physically removes it from the browser's paint engine */
    pointer-events: none;
    transform: translateY(20px);
    transition: opacity 1.5s ease, transform 1.5s ease, visibility 0s linear;
}

#monolith-apparatus.is-revealed .monolith-btn-layer {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
    /* Synchronized with the end of the "Habeas Totus" settling sequence */
    transition: opacity 1.5s ease 9.5s, transform 1.5s ease 9.5s, visibility 0s linear 9.5s;
}

/* The Speech Rhythm Engine */
.mono-chunk {
    display: inline-block;
    margin-right: 0.25em; /* Mathematically controlled spacing */
    opacity: 0;
    filter: blur(8px);
    transform: translateY(15px);
}

@keyframes monolith-speak {
    0%   { opacity: 0; filter: blur(8px); transform: translateY(15px); }
    100% { opacity: 1; filter: blur(0px); transform: translateY(0); }
}

/* Delays mapped to human phrasing */
#monolith-apparatus.is-revealed .mc-1 { animation: monolith-speak 1s cubic-bezier(0.16, 1, 0.3, 1) 2.2s forwards; }
#monolith-apparatus.is-revealed .mc-2 { animation: monolith-speak 1s cubic-bezier(0.16, 1, 0.3, 1) 3.2s forwards; }
#monolith-apparatus.is-revealed .mc-3 { animation: monolith-speak 1s cubic-bezier(0.16, 1, 0.3, 1) 4.2s forwards; }
/* Heavy pause before the shift in tone */
#monolith-apparatus.is-revealed .mc-4 { animation: monolith-speak 1s cubic-bezier(0.16, 1, 0.3, 1) 5.8s forwards; }
#monolith-apparatus.is-revealed .mc-5 { animation: monolith-speak 1s cubic-bezier(0.16, 1, 0.3, 1) 6.8s forwards; }
#monolith-apparatus.is-revealed .mc-6 { animation: monolith-speak 1s cubic-bezier(0.16, 1, 0.3, 1) 7.4s forwards; }
#monolith-apparatus.is-revealed .mc-7 { animation: monolith-speak 1s cubic-bezier(0.16, 1, 0.3, 1) 8.2s forwards; }

.monolith-btn-layer {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding-bottom: 12vh;
    pointer-events: none;
    z-index: 10;
    
    /* Pre-arrival state */
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.5s ease, transform 1.5s ease;
}

#monolith-apparatus.is-revealed .monolith-btn-layer {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    transition-delay: 9.5s; /* Only appears after the final word */
}