/* ============================================================
   renai.science — Retro-Futurist Laboratory Aesthetic
   Palette: Gold on Void (#0A0805 → #E8D5A0)
   ============================================================ */

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

:root {
    --void:        #0A0805;
    --primary-gold:#D4A017;
    --deep-gold:   #C9971C;
    --antique-gold:#B8966A;
    --warm-cream:  #E8D5A0;
    --surface-dark:#1A1208;
    --surface-mid: #2A1F0E;
    --dim-annot:   #7A6535;
    --muted-gold:  #B8A882;
}

html {
    scroll-behavior: smooth;
    background-color: var(--void);
}

body {
    background-color: var(--void);
    color: var(--muted-gold);
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 16px;
    line-height: 1.9;
    overflow-x: hidden;
    cursor: crosshair;
}

/* ------ GRAIN TEXTURE OVERLAY ------ */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
    background-size: 200px 200px;
}

/* ------ SECTION ARCHITECTURE ------ */
.act {
    position: relative;
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
    background-color: var(--void);
}

/* ------ HAIRLINE RULES ------ */
.hairline-rule {
    width: 60vw;
    height: 1px;
    background-color: var(--primary-gold);
    opacity: 0.25;
    margin: 0 auto;
    transition: opacity 0.4s ease;
}

.hairline-rule.visible {
    opacity: 0.3;
}

/* ------ ACT I: TRANSMISSION HEADER ------ */
.act-i {
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    position: relative;
}

/* Cartographic Grid Background */
.grid-bg {
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(
            to right,
            rgba(212, 160, 23, 0.06) 0px,
            rgba(212, 160, 23, 0.06) 0.5px,
            transparent 0.5px,
            transparent 40px
        ),
        repeating-linear-gradient(
            to bottom,
            rgba(212, 160, 23, 0.06) 0px,
            rgba(212, 160, 23, 0.06) 0.5px,
            transparent 0.5px,
            transparent 40px
        );
    will-change: transform;
    pointer-events: none;
}

.act-i-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding-bottom: 18vh;
    padding-left: 5vw;
    width: 100%;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 800ms cubic-bezier(0.16, 1, 0.3, 1),
                transform 800ms cubic-bezier(0.16, 1, 0.3, 1);
}

.act-i-content.revealed {
    opacity: 1;
    transform: translateY(0);
}

.logotype {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 14vw;
    font-weight: 400;
    color: var(--primary-gold);
    letter-spacing: -0.02em;
    line-height: 0.9;
    text-transform: uppercase;
    display: block;
    margin-bottom: 280px;
}

.hairline-rule#hairline-rule-i {
    margin: 0 0 0 0;
    width: 60vw;
}

.subtitle {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    color: var(--deep-gold);
    opacity: 0.7;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin-top: 16px;
    opacity: 0;
    transition: opacity 800ms cubic-bezier(0.16, 1, 0.3, 1) 240ms;
}

.subtitle.revealed {
    opacity: 0.7;
}

/* ------ ACT II: SPECIMEN FIELD ------ */
.act-ii {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    position: relative;
    padding-right: 12%;
}

.heart-wrapper {
    position: relative;
    width: 280px;
    height: 320px;
    flex-shrink: 0;
    animation: cardiac-pulse 2400ms ease-in-out infinite;
    will-change: transform;
}

@keyframes cardiac-pulse {
    0%, 100% { transform: scale(1.0); }
    50%       { transform: scale(1.02); }
}

.anatomical-heart {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.specimen-annotation {
    position: absolute;
    left: 8vw;
    top: 40%;
    display: flex;
    flex-direction: column;
    gap: 6px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 800ms cubic-bezier(0.16, 1, 0.3, 1),
                transform 800ms cubic-bezier(0.16, 1, 0.3, 1);
}

.specimen-annotation.revealed {
    opacity: 1;
    transform: translateY(0);
}

.annotation-label {
    font-family: 'Space Mono', monospace;
    font-size: 9px;
    color: var(--deep-gold);
    opacity: 0.7;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    display: block;
}

.annotation-measurements {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 8px;
}

.measurement {
    font-family: 'Space Mono', monospace;
    font-size: 9px;
    color: var(--dim-annot);
    letter-spacing: 0.2em;
    display: block;
}

/* ------ ACT III: DATA HORIZON ------ */
.act-iii {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    position: relative;
}

.waveform-upper-void {
    flex: 1;
    min-height: 50vh;
}

.waveform-container {
    position: relative;
    width: 100%;
    height: 80px;
    overflow: visible;
}

.oscilloscope-wave {
    width: 100%;
    height: 80px;
    display: block;
}

.waveform-annotation {
    padding: 20px 5vw;
    min-height: 20vh;
    display: flex;
    align-items: flex-start;
    opacity: 0;
    transition: opacity 800ms cubic-bezier(0.16, 1, 0.3, 1) 200ms;
}

.waveform-annotation.revealed {
    opacity: 1;
}

/* ------ ACT IV: LAYERED FIELD NOTES ------ */
.act-iv {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 8vh 0;
}

.field-note {
    position: absolute;
    width: 45vw;
    min-height: 40vh;
    background-color: rgba(26, 18, 8, 0.85);
    border: 1px solid rgba(212, 160, 23, 0.3);
    padding: 32px 36px;
    mix-blend-mode: screen;
    will-change: transform;
}

.field-note-back {
    transform: rotate(-1.5deg) translateX(-12vw) translateY(4vh);
    opacity: 0.8;
    z-index: 1;
}

.field-note-mid {
    transform: rotate(0deg) translateX(6vw) translateY(-2vh);
    opacity: 0.88;
    z-index: 2;
}

.field-note-front {
    transform: rotate(2deg) translateX(20vw) translateY(6vh);
    opacity: 0.92;
    z-index: 3;
}

.field-note-inner {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.field-note-header {
    font-family: 'Space Mono', monospace;
    font-size: 8px;
    color: var(--deep-gold);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    opacity: 0.9;
}

.field-note-text {
    font-family: 'Caveat', cursive;
    font-size: 18px;
    color: var(--warm-cream);
    line-height: 1.6;
    font-weight: 400;
}

.field-note-date {
    font-family: 'Space Mono', monospace;
    font-size: 8px;
    color: var(--dim-annot);
    letter-spacing: 0.2em;
    margin-top: 8px;
}

/* ------ ACT V: THE EQUATION ------ */
.act-v {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.equation-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 80vw;
    height: 70vh;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 800ms cubic-bezier(0.16, 1, 0.3, 1),
                transform 800ms cubic-bezier(0.16, 1, 0.3, 1);
}

.equation-container.revealed {
    opacity: 1;
    transform: translateY(0);
}

.equation-display {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 7vw;
    color: var(--primary-gold);
    letter-spacing: -0.02em;
    line-height: 1;
    text-align: center;
    position: relative;
    z-index: 2;
}

.equation-satellite {
    font-family: 'Space Mono', monospace;
    font-size: 9px;
    color: var(--deep-gold);
    opacity: 0.6;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    position: absolute;
}

.sat-1 { top: 15%;  left: 5%; }
.sat-2 { top: 20%;  right: 8%; }
.sat-3 { top: 38%;  left: 2%; }
.sat-4 { top: 42%;  right: 3%; }
.sat-5 { bottom: 22%; left: 6%; }
.sat-6 { bottom: 18%; right: 7%; }

.equation-annotation {
    padding: 0 5vw 4vh;
    opacity: 0;
    transition: opacity 800ms cubic-bezier(0.16, 1, 0.3, 1) 300ms;
}

.equation-annotation.revealed {
    opacity: 1;
}

/* ------ ACT VI: ARCHIVE FOOTER ------ */
.act-vi {
    min-height: 20vh;
    display: flex;
    flex-direction: column;
    background-color: var(--void);
    position: relative;
}

.footer-rule {
    width: 100%;
    opacity: 0.25;
    margin: 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0;
    padding: 5vh 5vw;
    flex: 1;
    align-items: center;
}

.footer-compass {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.compass-rose {
    width: 120px;
    height: 120px;
    opacity: 0.85;
}

.footer-domain {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.footer-logotype {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 28px;
    color: var(--primary-gold);
    letter-spacing: 0.05em;
    display: block;
}

.footer-tagline {
    font-family: 'Space Mono', monospace;
    font-size: 9px;
    color: var(--dim-annot);
    letter-spacing: 0.3em;
    display: block;
}

.footer-subjects {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.footer-subject-label {
    font-family: 'Space Mono', monospace;
    font-size: 8px;
    color: var(--deep-gold);
    letter-spacing: 0.3em;
    opacity: 0.7;
    display: block;
    margin-bottom: 6px;
}

.subject-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: right;
}

.subject-list li {
    font-family: 'Space Mono', monospace;
    font-size: 8px;
    color: var(--dim-annot);
    letter-spacing: 0.2em;
    opacity: 0.7;
    text-transform: uppercase;
}

/* ------ SCROLL-REVEAL ANIMATIONS ------ */
@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered annotation reveals */
.specimen-annotation.revealed .annotation-label:nth-child(1) {
    animation: fade-in-up 800ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.specimen-annotation.revealed .annotation-label:nth-child(2) {
    animation: fade-in-up 800ms cubic-bezier(0.16, 1, 0.3, 1) 120ms forwards;
}

.specimen-annotation.revealed .annotation-measurements {
    animation: fade-in-up 800ms cubic-bezier(0.16, 1, 0.3, 1) 240ms forwards;
}

/* Heart wrapper parallax */
.heart-wrapper {
    transition: none;
}

/* ------ SECONDARY HEART OPACITY PULSE ------ */
@keyframes heart-opacity {
    0%, 100% { opacity: 0.85; }
    50%       { opacity: 1.0; }
}

.heart-wrapper {
    animation:
        cardiac-pulse 2400ms ease-in-out infinite,
        heart-opacity 2600ms ease-in-out 200ms infinite;
}

/* ------ FIELD NOTE PARALLAX HELPERS ------ */
.field-note {
    transition: none;
}

/* ------ RESPONSIVE ADJUSTMENTS ------ */
@media (max-width: 900px) {
    .logotype {
        font-size: 18vw;
        margin-bottom: 160px;
    }

    .act-ii {
        justify-content: center;
        padding-right: 0;
        flex-direction: column;
        align-items: center;
    }

    .specimen-annotation {
        position: relative;
        left: auto;
        top: auto;
        padding: 5vh 8vw;
        order: 2;
    }

    .heart-wrapper {
        order: 1;
        margin-top: 8vh;
    }

    .field-note {
        width: 80vw;
    }

    .field-note-back,
    .field-note-mid,
    .field-note-front {
        position: relative;
        transform: none;
        margin: 2vh auto;
    }

    .act-iv {
        flex-direction: column;
        align-items: center;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 4vh;
        text-align: center;
    }

    .footer-compass {
        justify-content: center;
    }

    .footer-subjects {
        align-items: center;
    }

    .subject-list {
        text-align: center;
    }

    .equation-display {
        font-size: 10vw;
    }

    .sat-1, .sat-2, .sat-3, .sat-4, .sat-5, .sat-6 {
        display: none;
    }
}

/* ------ SCROLLBAR HIDE ------ */
::-webkit-scrollbar {
    width: 0;
    background: transparent;
}

/* ------ SELECTION ------ */
::selection {
    background: rgba(212, 160, 23, 0.2);
    color: var(--warm-cream);
}
