/* ============================================
   eyes.team - The Optical Herbarium
   Y2K-era academic research lab aesthetic
   ============================================ */

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

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

body {
    font-family: 'Lora', Georgia, serif;
    background: #2c1e0e;
    color: #4a3925;
    overflow-x: hidden;
    cursor: none;
}

/* --- Custom Cursor --- */
@media (pointer: fine) {
    body { cursor: none; }
}
@media (pointer: coarse) {
    body { cursor: auto; }
    #specimen-lens { display: none; }
}

/* --- Specimen Lens (Cursor Follow) --- */
#specimen-lens {
    position: fixed;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 2px solid #c8ccd4;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.23, 1, 0.32, 1),
                border-color 0.3s ease;
    background: radial-gradient(circle, rgba(248, 240, 224, 0.15) 0%, transparent 70%);
    box-shadow: 0 0 20px rgba(212, 165, 74, 0.15),
                inset 0 0 30px rgba(200, 204, 212, 0.1);
    backdrop-filter: contrast(1.1) saturate(1.2);
    mix-blend-mode: normal;
}

#specimen-lens.visible {
    opacity: 1;
}

#specimen-lens.focused {
    border-color: #d4a54a;
    border-width: 3px;
    box-shadow: 0 0 30px rgba(212, 165, 74, 0.3),
                inset 0 0 40px rgba(212, 165, 74, 0.1);
}

#lens-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(248, 240, 224, 0.08) 0%, transparent 60%);
}

/* --- Eye Navigation --- */
#eye-nav {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9000;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.eye-indicator {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    width: 38px;
    height: 16px;
    transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.eye-indicator .eye-svg {
    width: 30px;
    height: 12px;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.eye-indicator:not(.active) .eye-svg {
    transform: scaleY(0.3);
    opacity: 0.5;
}

.eye-indicator.active .eye-svg {
    transform: scaleY(1);
    opacity: 1;
}

.eye-indicator:hover .eye-svg {
    transform: scaleY(0.7);
    opacity: 0.8;
}

.eye-indicator.active:hover .eye-svg {
    transform: scaleY(1);
    opacity: 1;
}

/* --- Background Plane --- */
#bg-plane {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    transform: translateZ(-200px);
}

.botanical-drift {
    width: 200%;
    height: 100%;
    position: relative;
    animation: drift-left 120s linear infinite;
}

@keyframes drift-left {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

.bg-botanical {
    position: absolute;
    opacity: 0.4;
}

.bg-botanical-1 {
    width: 200px;
    height: 300px;
    top: 10%;
    left: 5%;
}

.bg-botanical-2 {
    width: 160px;
    height: 240px;
    top: 50%;
    left: 35%;
}

.bg-botanical-3 {
    width: 180px;
    height: 260px;
    top: 20%;
    left: 65%;
}

/* --- Layers (Sections) --- */
.layer {
    position: relative;
    z-index: 1;
}

/* --- COVER --- */
#cover {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2c1e0e;
    position: relative;
    overflow: hidden;
}

.cover-content {
    text-align: center;
    position: relative;
    z-index: 2;
}

.cover-title-container {
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.cover-title-top,
.cover-title-bottom {
    transition: transform 1.2s cubic-bezier(0.23, 1, 0.32, 1),
                opacity 1s cubic-bezier(0.23, 1, 0.32, 1);
}

.cover-title-top {
    clip-path: inset(0 0 50% 0);
}

.cover-title-bottom {
    position: absolute;
    top: 0;
    left: 0;
    clip-path: inset(50% 0 0 0);
}

.cover-title-top.open {
    transform: translateY(-60px);
    opacity: 0;
}

.cover-title-bottom.open {
    transform: translateY(60px);
    opacity: 0;
}

.cover-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: clamp(5rem, 12vw, 10rem);
    color: #d4a54a;
    line-height: 1;
    text-shadow: 0 2px 20px rgba(212, 165, 74, 0.3);
}

.cover-subtitle {
    font-family: 'Caveat', cursive;
    font-size: clamp(1.1rem, 2.5vw, 1.6rem);
    color: #9a8b76;
    margin-top: 1.5rem;
    font-style: italic;
    opacity: 0.9;
}

.cover-scroll-hint {
    margin-top: 3rem;
    animation: bob 2s ease-in-out infinite;
}

@keyframes bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

.scroll-arrow {
    opacity: 0.6;
}

.cover-endpaper-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 100%;
    background-image:
        radial-gradient(ellipse 40px 60px at 80px 100px, rgba(138, 111, 78, 0.06) 0%, transparent 70%),
        radial-gradient(ellipse 30px 50px at 200px 200px, rgba(90, 114, 71, 0.04) 0%, transparent 70%),
        radial-gradient(ellipse 50px 40px at 350px 150px, rgba(138, 111, 78, 0.05) 0%, transparent 70%);
    background-size: 500px 400px;
    animation: drift-left 120s linear infinite;
    pointer-events: none;
    z-index: 1;
}

/* --- FRONTISPIECE --- */
#frontispiece {
    min-height: 100vh;
    background: #f8f0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(2rem, 5vh, 4rem) clamp(1rem, 5vw, 4rem);
    position: relative;
}

.frontispiece-content {
    max-width: 1200px;
    width: 100%;
}

.frontispiece-illustration {
    display: flex;
    justify-content: center;
    margin-bottom: clamp(2rem, 5vh, 4rem);
}

.eye-illustration {
    width: min(70vw, 500px);
    height: auto;
}

.draw-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 0.1s linear;
}

.draw-fill {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.frontispiece-panels {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: clamp(1rem, 2vw, 2rem);
}

.frontispiece-panel {
    background: rgba(252, 246, 235, 0.88);
    backdrop-filter: blur(6px);
    padding: clamp(1.5rem, 3vw, 2.5rem);
    border-radius: 4px;
    border: 1px solid rgba(200, 204, 212, 0.3);
    box-shadow: 0 4px 20px rgba(44, 30, 14, 0.08);
    opacity: 0;
    transform: translateY(40px) translateZ(-50px);
    transition: opacity 0.8s cubic-bezier(0.23, 1, 0.32, 1),
                transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.frontispiece-panel.visible {
    opacity: 1;
    transform: translateY(0) translateZ(0);
}

.panel-left {
    grid-column: 1 / 6;
}

.panel-right {
    grid-column: 7 / 13;
    margin-top: 2rem;
}

.panel-heading {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: clamp(1.4rem, 3vw, 2rem);
    color: #3a2810;
    margin-bottom: 1rem;
    line-height: 1.1;
}

.panel-body {
    font-family: 'Lora', Georgia, serif;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    line-height: 1.72;
    color: #4a3925;
    margin-bottom: 1rem;
}

.annotation {
    font-family: 'Caveat', cursive;
    font-size: clamp(0.85rem, 1.4vw, 1rem);
    color: #8a6f4e;
    display: block;
    margin-top: 0.5rem;
    font-style: italic;
}

/* --- SPECIMENS --- */
#specimens {
    min-height: 300vh;
    background: linear-gradient(180deg, #f8f0e0 0%, #ede3d0 30%, #f8f0e0 60%, #ede3d0 100%);
    padding: clamp(4rem, 8vh, 8rem) clamp(1rem, 5vw, 4rem);
    perspective: 1200px;
}

.specimens-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: clamp(2rem, 4vh, 4rem) clamp(1rem, 2vw, 2rem);
}

.specimen-card {
    opacity: 0;
    transform: translateY(40px) translateZ(-50px);
    transition: opacity 0.8s cubic-bezier(0.23, 1, 0.32, 1),
                transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.specimen-card.visible {
    opacity: 1;
    transform: translateY(0) translateZ(0);
}

.specimen-01 { grid-column: 1 / 8; }
.specimen-02 { grid-column: 5 / 13; margin-top: 2rem; }
.specimen-03 { grid-column: 2 / 9; }
.specimen-04 { grid-column: 6 / 13; margin-top: -1rem; }
.specimen-05 { grid-column: 1 / 10; }

.specimen-frame {
    background: rgba(252, 246, 235, 0.92);
    backdrop-filter: blur(6px);
    padding: clamp(1.5rem, 3vw, 2.5rem);
    border-radius: 4px;
    border: 2px solid transparent;
    border-image: linear-gradient(135deg, #c8ccd4, #e8eaee, #a0a4ac, #c8ccd4) 1;
    box-shadow: 0 4px 24px rgba(44, 30, 14, 0.1),
                inset 0 1px 0 rgba(200, 204, 212, 0.3);
    position: relative;
}

.specimen-frame::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 8px;
    height: 100%;
    background: repeating-linear-gradient(
        180deg,
        #3a2810 0px, #3a2810 4px,
        #8a6f4e 4px, #8a6f4e 6px,
        #ede3d0 6px, #ede3d0 10px
    );
    opacity: 0.4;
    border-radius: 4px 0 0 4px;
}

.specimen-header {
    margin-bottom: 1rem;
    padding-left: 16px;
}

.specimen-number {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.8rem;
    color: #9a8b76;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: block;
    margin-bottom: 0.25rem;
}

.specimen-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
    color: #3a2810;
    line-height: 1.1;
}

.specimen-body {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.5rem;
    padding-left: 16px;
    align-items: start;
}

.specimen-motif {
    width: 100px;
    height: 100px;
}

.specimen-svg {
    width: 100%;
    height: 100%;
}

.specimen-text {
    font-family: 'Lora', Georgia, serif;
    font-size: clamp(0.95rem, 1.6vw, 1.1rem);
    line-height: 1.72;
    color: #4a3925;
}

.specimen-annotation {
    grid-column: 1 / -1;
}

.specimen-data {
    display: block;
    margin-top: 1rem;
    padding-left: 16px;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.8rem;
    color: #9a8b76;
    letter-spacing: 0.02em;
}

/* --- APPENDIX --- */
#appendix {
    min-height: 100vh;
    background: #2c1e0e;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

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

.floating-fragments {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.fragment {
    position: absolute;
    left: var(--x);
    top: var(--y);
    font-family: 'Caveat', cursive;
    font-size: clamp(0.9rem, 1.5vw, 1.2rem);
    color: #8a6f4e;
    opacity: 0.5;
    white-space: nowrap;
    transition: transform 2s cubic-bezier(0.23, 1, 0.32, 1),
                opacity 1s ease;
    animation: float-gentle 8s ease-in-out infinite;
    animation-delay: calc(var(--x, 0) * 0.1);
}

@keyframes float-gentle {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(5px, -8px) rotate(0.5deg); }
    50% { transform: translate(-3px, 4px) rotate(-0.3deg); }
    75% { transform: translate(7px, 6px) rotate(0.2deg); }
}

.appendix-center-quote {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 2;
}

.center-quote-text {
    font-family: 'Lora', Georgia, serif;
    font-size: clamp(1.3rem, 3vw, 2rem);
    color: #f8f0e0;
    line-height: 1.8;
    font-style: italic;
    text-shadow: 0 2px 20px rgba(212, 165, 74, 0.2);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.2s cubic-bezier(0.23, 1, 0.32, 1),
                transform 1.2s cubic-bezier(0.23, 1, 0.32, 1);
}

.center-quote-text.visible {
    opacity: 1;
    transform: translateY(0);
}

.appendix-colophon {
    position: absolute;
    bottom: 2rem;
    left: 0;
    width: 100%;
    text-align: center;
}

.colophon-text {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.75rem;
    color: #9a8b76;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.6;
}

/* --- Content Panel Chrome Frame --- */
.content-panel {
    position: relative;
}

/* --- Draw-path animation for SVGs --- */
.draw-path.drawn {
    stroke-dashoffset: 0;
}

.draw-fill.drawn {
    opacity: 1;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    #eye-nav {
        left: 10px;
        gap: 12px;
    }

    .eye-indicator {
        width: 28px;
        height: 12px;
    }

    .eye-indicator .eye-svg {
        width: 22px;
        height: 10px;
    }

    .frontispiece-panels {
        grid-template-columns: 1fr;
    }

    .panel-left,
    .panel-right {
        grid-column: 1 / -1;
    }

    .panel-right {
        margin-top: 0;
    }

    .specimens-grid {
        grid-template-columns: 1fr;
    }

    .specimen-01,
    .specimen-02,
    .specimen-03,
    .specimen-04,
    .specimen-05 {
        grid-column: 1 / -1;
        margin-top: 0;
    }

    .specimen-body {
        grid-template-columns: 1fr;
    }

    .specimen-motif {
        width: 80px;
        height: 80px;
        margin: 0 auto;
    }

    #specimen-lens {
        display: none;
    }

    body {
        cursor: auto;
    }
}

/* --- Scrollbar Styling --- */

/* --- Botanical Green & Iris Blue Accents --- */
.specimen-frame:hover {
    border-image: linear-gradient(135deg, #3b5998, #c8ccd4, #5a7247, #c8ccd4) 1;
}

.panel-heading::after {
    content: '';
    display: block;
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, #3b5998, #5a7247);
    margin-top: 0.5rem;
    opacity: 0.6;
}

.specimen-title::after {
    content: '';
    display: block;
    width: 30px;
    height: 2px;
    background: #3b5998;
    margin-top: 0.4rem;
    opacity: 0.5;
}

.eye-indicator.active .eye-svg ellipse {
    filter: drop-shadow(0 0 4px #5a7247);
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #2c1e0e;
}

::-webkit-scrollbar-thumb {
    background: #8a6f4e;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #d4a54a;
}
