/* ============================================================
   KARMABADGE.COM - STYLES
   1970s Instructional Filmstrip Aesthetic
   ============================================================ */

:root {
    --color-ground: #1A1714;
    --color-surface: #2A2520;
    --color-projection: #F5ECD7;
    --color-primary-accent: #C4A265;
    --color-secondary-accent: #8B7340;
    --color-tertiary-accent: #D4845A;
    --color-contrast: #5A6B6E;
    --color-muted: #9B9285;

    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'IBM Plex Mono', monospace;

    --animation-snap: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
    scroll-behavior: auto;
}

body {
    background-color: var(--color-ground);
    color: var(--color-projection);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    font-feature-settings: 'tnum';
    overflow-x: hidden;
}

/* ============================================================
   FRAME STRUCTURE
   ============================================================ */

.frame {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-ground);
    border: 1px solid rgba(196, 162, 101, 0.15);
    border-left: none;
    border-right: none;
    overflow: hidden;
}

.frame-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 64px;
}

/* Parallax background layer */
.frame::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, rgba(196, 162, 101, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

.frame-content {
    z-index: 1;
}

/* ============================================================
   FRAME 1 - TITLE CARD
   ============================================================ */

.frame-1 .frame-content {
    flex-direction: column;
    gap: 48px;
}

.badge-glyph {
    width: 120px;
    height: 120px;
    margin: 0 auto;
}

.domain-title {
    font-family: var(--font-display);
    font-size: 72px;
    font-weight: 600;
    letter-spacing: -0.03em;
    text-align: center;
    color: var(--color-projection);
    text-rendering: geometricPrecision;
}

.advance-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--color-primary-accent);
    animation: pulse-chevron 2s ease-in-out infinite;
}

@keyframes pulse-chevron {
    0%, 100% { opacity: 0.4; transform: translateX(-50%) translateY(0); }
    50% { opacity: 1; transform: translateX(-50%) translateY(4px); }
}

/* ============================================================
   FRAME 2 - WHAT IS KARMA
   ============================================================ */

.frame-2 .frame-content {
    flex-direction: row;
    gap: 60px;
    align-items: flex-start;
    padding-top: 80px;
    padding-bottom: 80px;
}

.left-column {
    flex: 0 0 40%;
    margin-left: 64px;
}

.right-panel {
    flex: 1;
}

.frame-title {
    font-family: var(--font-display);
    font-size: 48px;
    font-weight: 600;
    letter-spacing: -0.03em;
    margin-bottom: 40px;
    color: var(--color-projection);
    text-rendering: geometricPrecision;
}

.steps-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.steps-list li {
    font-size: 14px;
    line-height: 1.65;
    color: var(--color-projection);
    padding-left: 32px;
    position: relative;
}

.steps-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 24px;
    height: 24px;
    border: 1px solid var(--color-primary-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    counter-increment: step-counter;
}

.step-label {
    font-weight: 600;
    color: var(--color-tertiary-accent);
    display: inline-block;
    width: 70px;
}

.karma-graph {
    width: 100%;
    height: 400px;
}

/* ============================================================
   FRAME 3 - THE BADGE SYSTEM
   ============================================================ */

.frame-3 .frame-content {
    position: relative;
    flex-direction: column;
    gap: 40px;
}

.badge-center {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 0 auto;
}

.procedural-badge {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 20px rgba(196, 162, 101, 0.3));
}

.orbital-annotations {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.annotation-block {
    position: absolute;
    width: 160px;
    padding: 16px;
    background-color: rgba(42, 37, 32, 0.6);
    border: 1px solid var(--color-secondary-accent);
    border-radius: 2px;
    font-size: 12px;
    line-height: 1.5;
}

.annotation-block p {
    margin-top: 8px;
    color: var(--color-muted);
    font-size: 11px;
}

.annotation-label {
    font-family: var(--font-display);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-tertiary-accent);
}

.annotation-1 { top: 0; left: 50%; transform: translateX(-50%); }
.annotation-2 { top: 60px; right: 40px; }
.annotation-3 { bottom: 60px; right: 40px; }
.annotation-4 { bottom: 0; left: 50%; transform: translateX(-50%); }

.seed-display {
    font-size: 12px;
    color: var(--color-muted);
    position: absolute;
    bottom: 40px;
    right: 64px;
    font-family: var(--font-body);
}

#seed-value {
    color: var(--color-primary-accent);
    font-weight: 600;
}

/* ============================================================
   FRAME 4 - HOW IT WORKS
   ============================================================ */

.frame-4 .frame-content {
    justify-content: center;
    align-items: center;
}

.projection-rectangle {
    position: relative;
    width: 80%;
    max-width: 700px;
    padding: 60px;
    background-color: var(--color-projection);
    color: var(--color-ground);
    border: 1px solid var(--color-secondary-accent);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.3);
}

.projection-rectangle .frame-title {
    color: var(--color-ground);
    margin-bottom: 40px;
}

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

.registration-mark {
    position: absolute;
    width: 16px;
    height: 16px;
    color: var(--color-secondary-accent);
    opacity: 0.3;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.registration-mark.top-left { top: 20px; left: 20px; }
.registration-mark.top-right { top: 20px; right: 20px; }
.registration-mark.bottom-left { bottom: 20px; left: 20px; }
.registration-mark.bottom-right { bottom: 20px; right: 20px; }

.steps-vertical {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.step-item {
    display: flex;
    gap: 24px;
    opacity: 0.4;
}

.step-item.visible {
    opacity: 1;
    animation: fadeInSlide 0.6s ease-out forwards;
}

.step-number {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
    color: var(--color-secondary-accent);
    flex-shrink: 0;
    min-width: 40px;
}

.step-item p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--color-ground);
}

@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Stagger animation for steps */
.step-item-1.visible { animation-delay: 0ms; }
.step-item-2.visible { animation-delay: 80ms; }
.step-item-3.visible { animation-delay: 160ms; }
.step-item-4.visible { animation-delay: 240ms; }

/* ============================================================
   FRAME 5 - PROVENANCE TRAIL
   ============================================================ */

.frame-5 .frame-content {
    flex-direction: column;
    gap: 40px;
    padding-top: 80px;
    padding-bottom: 80px;
}

.filmstrip-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    overflow: hidden;
    height: 320px;
    background-color: var(--color-surface);
    border: 1px solid var(--color-secondary-accent);
    border-radius: 2px;
}

.filmstrip-track {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    display: flex;
    gap: 12px;
    padding: 12px;
    will-change: transform;
}

.filmstrip-frame {
    flex: 0 0 240px;
    height: 280px;
    background-color: rgba(42, 37, 32, 0.8);
    border: 1px solid var(--color-secondary-accent);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.thumbnail-art {
    width: 100%;
    height: 100%;
}

.filmstrip-label {
    text-align: center;
    font-size: 12px;
    color: var(--color-muted);
    margin-top: 20px;
}

/* ============================================================
   FRAME 6 - COLOPHON
   ============================================================ */

.frame-6 .frame-content {
    flex-direction: column;
    gap: 40px;
    text-align: center;
}

.colophon-text {
    font-size: 16px;
    color: var(--color-muted);
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.8;
}

.seal-generative {
    width: 200px;
    height: 200px;
    margin: 0 auto;
}

/* ============================================================
   REEL COUNTER
   ============================================================ */

.reel-counter {
    position: fixed;
    bottom: 32px;
    right: 32px;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--color-muted);
    letter-spacing: 0.05em;
    pointer-events: none;
    z-index: 10;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.procedural-badge {
    animation: pulse 3s ease-in-out infinite;
}

.seal-generative {
    animation: pulse 3s ease-in-out infinite;
}

/* ============================================================
   ANNOTATION LINES
   ============================================================ */

svg.annotation-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

svg.annotation-line path {
    stroke: var(--color-primary-accent);
    stroke-width: 1px;
    opacity: 0.6;
    fill: none;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
}

svg.annotation-line circle {
    fill: var(--color-primary-accent);
    opacity: 0.6;
}

/* ============================================================
   RESPONSIVE CONSIDERATIONS
   ============================================================ */

@media (max-width: 1024px) {
    .domain-title {
        font-size: 56px;
    }

    .frame-title {
        font-size: 40px;
    }

    .frame-2 .frame-content {
        flex-direction: column;
    }

    .left-column {
        flex: 1;
    }

    .right-panel {
        flex: 1;
    }
}

@media (max-width: 768px) {
    .frame-content {
        padding: 40px;
    }

    .domain-title {
        font-size: 42px;
    }

    .frame-title {
        font-size: 32px;
    }

    .projection-rectangle {
        width: 95%;
        padding: 40px;
    }

    .badge-center {
        width: 200px;
        height: 200px;
    }

    .filmstrip-container {
        height: 240px;
    }

    .filmstrip-frame {
        flex: 0 0 180px;
        height: 220px;
    }
}
