/* holos.works - Chrome-metallic generative minimalism */

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

html {
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

body {
    font-family: 'Work Sans', sans-serif;
    background: #e8e8f0;
    color: #2a2a3a;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    position: relative;
}

/* ============================================
   SCANLINE OVERLAY
   ============================================ */
#scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    background: repeating-linear-gradient(
        0deg,
        transparent 0px,
        transparent 2px,
        rgba(0, 0, 0, 0.03) 2px,
        rgba(0, 0, 0, 0.03) 4px
    );
}

/* ============================================
   GLITCH TRANSITION OVERLAY
   ============================================ */
#glitch-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
    opacity: 0;
    mix-blend-mode: screen;
    background: rgba(61, 90, 254, 0.08);
    transition: opacity 0.1s ease;
}

#glitch-overlay.active {
    opacity: 1;
    transform: translate(3px, -2px);
}

/* ============================================
   BOOK SPINE
   ============================================ */
#spine {
    position: fixed;
    left: 0;
    top: 0;
    width: 48px;
    height: 100vh;
    background: linear-gradient(180deg, #d8d8e8, #b0b0c0, #d0d0e0);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 24px 0;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.06);
}

#spine-logo {
    font-family: 'Jost', sans-serif;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: #2a2a3a;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
}

#spine-chapter {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.65rem;
    color: #6a6a7e;
    letter-spacing: 0.05em;
}

#spine-progress {
    width: 2px;
    height: 120px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 1px;
    position: relative;
    overflow: hidden;
}

#spine-progress-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: #3d5afe;
    border-radius: 1px;
    transition: height 0.3s ease;
}

/* ============================================
   HORIZONTAL SCROLL CONTAINER
   ============================================ */
#scroll-container {
    display: flex;
    flex-direction: row;
    height: 100vh;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding-left: 48px;
    -webkit-overflow-scrolling: touch;
}

#scroll-container::-webkit-scrollbar {
    display: none;
}

#scroll-container {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ============================================
   CHAPTERS
   ============================================ */
.chapter {
    flex: 0 0 100vw;
    height: 100vh;
    position: relative;
    scroll-snap-align: start;
    overflow: hidden;
    background: linear-gradient(135deg, #e8e8f0 0%, #d0d0e0 50%, #e8e8f0 100%);
}

.chapter:nth-child(odd) {
    background: linear-gradient(135deg, #f2f2f8 0%, #e0e0ec 50%, #f2f2f8 100%);
}

.chapter-120 {
    flex: 0 0 120vw;
}

.chapter-150 {
    flex: 0 0 150vw;
}

.chapter-80 {
    flex: 0 0 80vw;
}

/* Chapter background canvas */
.chapter-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.4;
}

/* Ghost chapter numbers */
.chapter-ghost-number {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Jost', sans-serif;
    font-weight: 700;
    font-size: 12vw;
    color: #2a2a3a;
    opacity: 0.04;
    z-index: 2;
    pointer-events: none;
    user-select: none;
}

/* Chapter content wrapper */
.chapter-content {
    position: relative;
    z-index: 10;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* ============================================
   ZONE SYSTEM (TOP 55% / BOTTOM 45%)
   ============================================ */
.top-zone {
    height: 55%;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.bottom-zone {
    height: 45%;
    display: flex;
    align-items: flex-start;
    padding: 2rem 8vw;
    overflow: hidden;
}

.zone-divider {
    width: 100%;
    height: 1px;
    background: #b8b8c8;
    flex-shrink: 0;
}

.content-left {
    padding-left: 8vw;
    padding-right: 4vw;
    max-width: 100%;
}

.bottom-zone-content {
    max-width: 60ch;
}

/* ============================================
   TYPOGRAPHY - HEADLINES
   ============================================ */
.site-title {
    font-family: 'Jost', sans-serif;
    font-weight: 700;
    font-size: clamp(2.4rem, 8vw, 5rem);
    letter-spacing: -0.02em;
    line-height: 1.05;
    color: #2a2a3a;
    margin-bottom: 1rem;
}

.site-subtitle {
    font-family: 'Work Sans', sans-serif;
    font-weight: 400;
    font-size: 1.2rem;
    color: #6a6a7e;
    line-height: 1.65;
    margin-bottom: 2rem;
}

.chapter-heading {
    font-family: 'Jost', sans-serif;
    font-weight: 600;
    font-size: clamp(2.4rem, 5.5vw, 5rem);
    letter-spacing: -0.02em;
    line-height: 1.05;
    color: #2a2a3a;
    margin-bottom: 2rem;
}

/* ============================================
   TYPOGRAPHY - BODY
   ============================================ */
.body-text {
    font-family: 'Work Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.4vw, 1.15rem);
    line-height: 1.65;
    color: #2a2a3a;
    max-width: 52ch;
    margin-bottom: 1.2rem;
}

/* ============================================
   TYPOGRAPHY - FOOTNOTES & MONO
   ============================================ */
.footnote, .footnote-text {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.72rem, 0.9vw, 0.85rem);
    line-height: 1.6;
    color: #6a6a7e;
    margin-bottom: 0.6rem;
}

.fn-marker {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-style: italic;
    color: #3d5afe;
    cursor: default;
}

.fn-num {
    color: #3d5afe;
    margin-right: 0.3rem;
}

/* ============================================
   PULL QUOTES
   ============================================ */
.pull-quote {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.6rem, 3vw, 2.8rem);
    line-height: 1.3;
    color: #2a2a3a;
    max-width: 52ch;
    margin: 1.5rem 0 1.5rem 0;
    padding: 0;
    border: none;
}

/* Glitch reveal effect for pull quotes */
.glitch-reveal {
    position: relative;
}

.glitch-reveal.glitching::before,
.glitch-reveal.glitching::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    font-family: inherit;
    font-weight: inherit;
    font-style: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
}

.glitch-reveal.glitching::before {
    color: rgba(61, 90, 254, 0.7);
    transform: translate(-3px, 1px);
    animation: glitch-r 0.4s ease-out forwards;
}

.glitch-reveal.glitching::after {
    color: rgba(124, 77, 255, 0.7);
    transform: translate(3px, -1px);
    animation: glitch-b 0.4s ease-out forwards;
}

@keyframes glitch-r {
    0% { transform: translate(-4px, 2px); opacity: 1; }
    100% { transform: translate(0, 0); opacity: 0; }
}

@keyframes glitch-b {
    0% { transform: translate(4px, -2px); opacity: 1; }
    100% { transform: translate(0, 0); opacity: 0; }
}

/* ============================================
   SCROLL HINT ARROW
   ============================================ */
.scroll-hint {
    display: inline-block;
}

.arrow-pulse {
    display: inline-block;
    font-size: 1.5rem;
    color: #3d5afe;
    animation: arrowPulse 2s ease-in-out infinite;
}

@keyframes arrowPulse {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(5px); }
}

/* ============================================
   GUTTERS
   ============================================ */
.gutter {
    flex: 0 0 15vw;
    height: 100vh;
    position: relative;
    background: #dcdce8;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.gutter-canvas {
    background: #c0c0d0;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0.5;
}

/* ============================================
   PROJECT CARDS
   ============================================ */
.project-cards {
    display: flex;
    gap: 3vw;
    margin-top: 1rem;
}

.project-card {
    width: 300px;
    height: 400px;
    flex-shrink: 0;
    position: relative;
    border: 2px solid transparent;
    border-image: linear-gradient(180deg, #e8e8f0, #b0b0c0, #d0d0e0) 1;
    background: rgba(242, 242, 248, 0.8);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: perspective(800px) rotateY(2deg);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 2px 4px rgba(0, 0, 0, 0.08);
}

.project-card:hover {
    transform: perspective(800px) rotateY(0deg);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 4px 12px rgba(0, 0, 0, 0.12);
}

.card-canvas {
    width: 100%;
    height: 200px;
    flex-shrink: 0;
}

.card-title {
    font-family: 'Jost', sans-serif;
    font-weight: 600;
    font-size: 1.2rem;
    color: #2a2a3a;
    padding: 1rem 1rem 0.5rem;
    letter-spacing: -0.01em;
}

.card-desc {
    font-family: 'Work Sans', sans-serif;
    font-weight: 400;
    font-size: 0.9rem;
    color: #6a6a7e;
    line-height: 1.5;
    padding: 0 1rem;
    flex-grow: 1;
}

.card-ref {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    color: #3d5afe;
    padding: 0.5rem 1rem 1rem;
    display: block;
    text-align: right;
}

/* ============================================
   PROCESS STEPS
   ============================================ */
.process-steps {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.process-step {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}

.step-number {
    font-family: 'Jost', sans-serif;
    font-weight: 700;
    font-size: 4rem;
    line-height: 1;
    color: #7c4dff;
    flex-shrink: 0;
    width: 80px;
}

.step-content {
    max-width: 52ch;
}

.step-title {
    font-family: 'Jost', sans-serif;
    font-weight: 600;
    font-size: 1.2rem;
    color: #2a2a3a;
    margin-bottom: 0.3rem;
    letter-spacing: -0.01em;
}

/* ============================================
   BOOK CARDS
   ============================================ */
.book-cards {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
}

.book-card {
    width: 180px;
    height: 260px;
    position: relative;
    display: flex;
    background: rgba(242, 242, 248, 0.9);
    box-shadow: 2px 4px 12px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.book-card:hover {
    transform: translateY(-4px);
    box-shadow: 2px 8px 20px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.book-spine-stripe {
    width: 4px;
    height: 100%;
    flex-shrink: 0;
}

.book-card-content {
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.book-title {
    font-family: 'Jost', sans-serif;
    font-weight: 500;
    font-size: 1rem;
    color: #2a2a3a;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.book-author {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    color: #6a6a7e;
}

/* ============================================
   SIGNAL / CONTACT
   ============================================ */
.content-signal {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
}

.signal-heading {
    font-family: 'Jost', sans-serif;
    font-weight: 600;
    font-size: clamp(2rem, 4vw, 3rem);
    color: #2a2a3a;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.contact-line {
    display: inline-block;
}

.email-link {
    text-decoration: none;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
}

.email-text {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.4rem);
    color: #3d5afe;
}

.email-underline {
    width: 100%;
    height: 8px;
    margin-top: 4px;
}

.email-underline path {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    transition: stroke-dashoffset 0.8s ease;
}

.email-link:hover .email-underline path,
.email-link.animated .email-underline path {
    stroke-dashoffset: 0;
}

/* ============================================
   INDEX
   ============================================ */
.index-columns {
    display: flex;
    gap: 4vw;
    margin-top: 1rem;
}

.index-col {
    flex: 1;
    min-width: 0;
}

.index-entry {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.8rem;
    line-height: 1.8;
    color: #2a2a3a;
    white-space: nowrap;
}

/* ============================================
   MARGIN ANNOTATIONS
   ============================================ */
.margin-annotation {
    position: absolute;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 10px;
    color: #a0a0b8;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    z-index: 20;
    pointer-events: none;
    user-select: none;
}

/* ============================================
   ERROR / DISRUPTION STATE
   ============================================ */
.disruption-state {
    color: #ff3d57;
    border-color: #ff3d57;
}

/* ============================================
   SHAKE-ERROR ANIMATION
   ============================================ */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.shake-entry.shaking {
    animation: shake 0.3s ease-in-out 1;
}

/* For project cards that also have the perspective */
.project-card.shake-entry.shaking {
    animation: shakeCard 0.3s ease-in-out 1;
}

@keyframes shakeCard {
    0%, 100% { transform: perspective(800px) rotateY(2deg) translateX(0); }
    25% { transform: perspective(800px) rotateY(2deg) translateX(-4px); }
    75% { transform: perspective(800px) rotateY(2deg) translateX(4px); }
}

/* ============================================
   CHROME INTERACTIVE EFFECTS
   ============================================ */
.chrome-hover {
    background-size: 200% 200%;
    background-position: 0% 50%;
    transition: background-position 0.4s ease;
}

.chrome-hover:hover {
    background-position: 100% 50%;
}

/* ============================================
   DATA MOSH EFFECT (hover on cards)
   ============================================ */
@keyframes datamosh {
    0% { clip-path: inset(0 0 0 0); }
    20% { clip-path: inset(10px 0 0 5px); }
    40% { clip-path: inset(0 15px 5px 0); }
    60% { clip-path: inset(5px 0 10px 0); }
    80% { clip-path: inset(0 5px 0 15px); }
    100% { clip-path: inset(0 0 0 0); }
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 768px) {
    #spine {
        width: 36px;
    }

    #scroll-container {
        padding-left: 36px;
    }

    .content-left {
        padding-left: 5vw;
        padding-right: 3vw;
    }

    .project-cards {
        flex-wrap: nowrap;
        gap: 2vw;
    }

    .project-card {
        width: 240px;
        height: 340px;
    }

    .book-cards {
        gap: 1rem;
    }

    .book-card {
        width: 150px;
        height: 220px;
    }

    .step-number {
        font-size: 2.5rem;
        width: 50px;
    }

    .index-columns {
        flex-direction: column;
        gap: 1rem;
    }

    .chapter-150 {
        flex: 0 0 200vw;
    }

    .chapter-120 {
        flex: 0 0 150vw;
    }

    .gutter {
        flex: 0 0 10vw;
    }

    .bottom-zone {
        padding: 1rem 5vw;
    }
}
