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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
}

#intro, #outro {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
}

#intro {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

#intro h1 {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

#intro p {
    font-size: 1.5rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.intro-subtitle {
    font-size: 1.1rem;
    opacity: 0.8;
    font-weight: 300;
}

#outro {
    background: #f7f7f7;
}

#outro h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.outro-instruction {
    font-size: 1.1rem;
    color: #666;
    margin-top: 1rem;
}

.quit-button {
    margin-top: 2rem;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
}

.quit-button:hover {
    background: #5568d3;
}

#scrolly {
    position: relative;
    display: flex;
    padding: 0;
}

figure {
    position: sticky;
    top: 0;
    left: 0;
    width: 50%;
    height: 100vh;
    margin: 0;
    background: #1a1a1a;
    background-size: cover;
    background-position: center;
    transition: background 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
}

#graphic {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.graphic-content {
    text-align: center;
    color: white;
    padding: 2rem;
    position: relative;
    z-index: 10;
}

.graphic-content.has-background #graphic-title,
.graphic-content.has-background #graphic-number {
    text-shadow: 0 2px 12px rgba(0,0,0,0.9);
}

#graphic-number {
    font-size: 6rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 1rem;
    transition: all 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
    letter-spacing: -0.05em;
}

#graphic-title {
    font-size: 1.5rem;
    font-weight: 300;
    opacity: 0.9;
    margin: 0;
    transition: all 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
}

#graphic-details {
    font-size: 1rem;
    opacity: 0.7;
    margin-top: 1rem;
    transition: all 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
}

#graphic-svg {
    width: 100%;
    max-width: 500px;
    height: 300px;
    margin: 2rem auto 0;
    display: none;
}

#graphic-image {
    width: 100%;
    max-width: 600px;
    height: auto;
    margin: 2rem auto 0;
    display: none;
    border-radius: 8px;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.8s cubic-bezier(0.4, 0.0, 0.2, 1);
}

#graphic-image.active {
    opacity: 1;
    transform: scale(1);
}

#graphic-svglogos {
    display: none;
    margin: 2rem auto 0;
    max-width: 600px;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    padding: 1rem;
}

#graphic-svglogos.active {
    display: grid;
}

#graphic-svglogos img {
    width: 100%;
    max-width: 120px;
    height: auto;
    margin: 0 auto;
    opacity: 0;
}

#graphic-svglogos img.anim-fade {
    transform: scale(0.8);
    transition: all 0.8s cubic-bezier(0.4, 0.0, 0.2, 1);
}

#graphic-svglogos img.anim-fade.show {
    opacity: 1;
    transform: scale(1);
}

#graphic-svglogos img.anim-slide {
    transform: translateX(-100px);
    transition: all 0.8s cubic-bezier(0.4, 0.0, 0.2, 1);
}

#graphic-svglogos img.anim-slide.show {
    opacity: 1;
    transform: translateX(0);
}

#graphic-svglogos img.anim-rotate {
    transform: rotate(-180deg) scale(0.3);
    transition: all 1s cubic-bezier(0.4, 0.0, 0.2, 1);
}

#graphic-svglogos img.anim-rotate.show {
    opacity: 1;
    transform: rotate(0) scale(1);
}

#graphic-svglogos img.anim-bounce {
    transform: translateY(100px) scale(0.5);
    transition: all 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

#graphic-svglogos img.anim-bounce.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

#graphic-d3grid {
    display: none;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    padding: 2rem;
    max-width: 700px;
    margin: 0 auto;
}

#graphic-d3grid.active {
    display: grid;
}

#graphic-d3grid svg {
    width: 100%;
    height: 200px;
}

article {
    position: relative;
    width: 50%;
    padding: 0;
}

.step {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem 3rem;
    opacity: 0.3;
    transition: opacity 0.5s;
}

.step.is-active {
    opacity: 1;
}

.step .animate-line {
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.step.is-active .animate-line {
    opacity: 1;
}

.step.is-active .animate-line:nth-child(1) { transition-delay: 0.1s; }
.step.is-active .animate-line:nth-child(2) { transition-delay: 0.2s; }
.step.is-active .animate-line:nth-child(3) { transition-delay: 0.3s; }
.step.is-active .animate-line:nth-child(4) { transition-delay: 0.4s; }
.step.is-active .animate-line:nth-child(5) { transition-delay: 0.5s; }
.step.is-active .animate-line:nth-child(6) { transition-delay: 0.6s; }

.step.is-active ul .animate-line:nth-child(1) { transition-delay: 0.3s; }
.step.is-active ul .animate-line:nth-child(2) { transition-delay: 0.4s; }
.step.is-active ul .animate-line:nth-child(3) { transition-delay: 0.5s; }
.step.is-active ul .animate-line:nth-child(4) { transition-delay: 0.6s; }

.step h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #667eea;
    font-weight: 600;
}

.step p {
    font-size: 1.2rem;
    color: #555;
    margin-bottom: 1rem;
}

.step ul, .step ol {
    font-size: 1.1rem;
    color: #555;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.step li {
    margin-bottom: 0.5rem;
}

.step strong {
    color: #667eea;
    font-weight: 600;
}

.step .example {
    background: #f5f5f5;
    padding: 1rem;
    border-left: 4px solid #667eea;
    font-style: italic;
    color: #666;
}

.step a {
    color: #667eea;
    text-decoration: none;
    border-bottom: 1px solid #667eea;
    transition: all 0.2s;
}

.step a:hover {
    color: #5568d3;
    border-bottom-color: #5568d3;
}

@media (max-width: 768px) {
    #scrolly {
        flex-direction: column;
    }

    figure {
        position: relative;
        width: 100%;
        height: 50vh;
    }

    article {
        width: 100%;
    }

    .step {
        min-height: 50vh;
    }
}
