/* ppuzzl.bid - Bauhaus Ethereal Blue Editorial */

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

html {
    scroll-behavior: smooth;
}

body {
    background: #f0f4f8;
    color: #0d1b2a;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.75;
    overflow-x: hidden;
}

/* Title Block */
.title-block {
    position: relative;
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 80px 40px 40px;
    background: #f0f4f8;
    overflow: hidden;
}

.title-grid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
    gap: 40px;
}

.title-text {
    flex: 1;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.title-text.visible {
    opacity: 1;
}

.domain-title {
    font-family: 'EB Garamond', serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4rem);
    color: #0d1b2a;
    letter-spacing: 0.02em;
}

.title-rule {
    width: 0;
    height: 2px;
    background: #1b4965;
    margin: 16px 0;
    transition: width 0.6s ease 0.4s;
}

.title-text.visible .title-rule {
    width: 100%;
}

.title-sub {
    font-family: 'EB Garamond', serif;
    font-weight: 400;
    font-style: italic;
    font-size: 1rem;
    color: #1b4965;
}

.title-circle {
    flex-shrink: 0;
}

.grain-circle {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: #5fa8d3;
    position: relative;
    transform: scale(0.3);
    opacity: 0;
    transition: transform 1.2s ease, opacity 1.2s ease;
}

.grain-circle.visible {
    transform: scale(1);
    opacity: 1;
}

.grain-circle::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background:
        repeating-conic-gradient(rgba(27, 73, 101, 0.06) 0deg, transparent 1deg, transparent 4deg) 0 0 / 3px 3px,
        repeating-conic-gradient(transparent 0deg, rgba(27, 73, 101, 0.04) 2deg, transparent 3deg) 1px 1px / 4px 4px;
    pointer-events: none;
}

/* Wave SVGs */
.wave-svg {
    width: 100%;
    height: 60px;
    display: block;
    margin-top: 20px;
}

.wave-divider {
    width: 100%;
    height: 40px;
    display: block;
}

.wave {
    animation: wave-drift 20s linear infinite;
}

.w2 {
    animation-duration: 25s;
    animation-direction: reverse;
}

.w3 {
    animation-duration: 30s;
}

@keyframes wave-drift {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Tutorial Flow */
.tutorial-flow {
    max-width: 100%;
}

/* Tutorial Section */
.tutorial-section {
    padding: 80px 40px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.tutorial-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-light {
    background: #f0f4f8;
    color: #0d1b2a;
}

.section-dark {
    background: #0d1b2a;
    color: #e8f0f8;
}

.section-grid {
    display: grid;
    grid-template-columns: 3fr 7fr;
    gap: 40px;
    max-width: 1100px;
    margin: 0 auto;
    align-items: start;
}

/* Section Number */
.section-number-col {
    text-align: center;
}

.section-number {
    font-family: 'EB Garamond', serif;
    font-weight: 700;
    font-size: clamp(4rem, 10vw, 10rem);
    color: #5fa8d3;
    display: block;
    line-height: 1;
    opacity: 0;
    transform: scale(2);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.tutorial-section.visible .section-number {
    opacity: 1;
    transform: scale(1);
}

.bauhaus-mark {
    width: 50px;
    height: 50px;
    margin-top: 16px;
    opacity: 0;
    transition: opacity 0.5s ease 0.3s, transform 0.5s ease 0.3s;
    transform: rotate(-360deg);
}

.tutorial-section.visible .bauhaus-mark {
    opacity: 1;
    transform: rotate(0deg);
}

/* Section Content / Tilt Card */
.section-content {
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease 0.2s, transform 0.4s ease 0.2s;
}

.tutorial-section.visible .section-content {
    opacity: 1;
    transform: translateY(0);
}

.tilt-card {
    perspective: 800px;
    transform-style: preserve-3d;
    padding: 32px;
    border-radius: 4px;
    position: relative;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.section-light .tilt-card {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(27, 73, 101, 0.08);
}

.section-dark .tilt-card {
    background: rgba(27, 73, 101, 0.2);
    border: 1px solid rgba(95, 168, 211, 0.15);
}

.tilt-highlight {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0;
    background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.15) 0%, transparent 60%);
    transition: opacity 0.3s ease;
    z-index: 0;
}

.section-heading {
    font-family: 'EB Garamond', serif;
    font-weight: 600;
    font-size: clamp(1.4rem, 3vw, 2rem);
    letter-spacing: 0.02em;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.section-body {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.75;
    max-width: 60ch;
    position: relative;
    z-index: 1;
}

/* Code Block */
.code-block {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    background: rgba(13, 27, 42, 0.8);
    color: #bee9e8;
    padding: 16px 20px;
    border-radius: 4px;
    margin-top: 20px;
    overflow-x: auto;
    position: relative;
    z-index: 1;
}

.section-light .code-block {
    background: #0d1b2a;
    color: #bee9e8;
}

/* Annotation */
.annotation {
    margin-top: 20px;
    padding-left: 16px;
    border-left: 2px solid #5fa8d3;
    transform: rotate(-1deg);
    position: relative;
    z-index: 1;
}

.annotation-text {
    font-family: 'EB Garamond', serif;
    font-weight: 400;
    font-style: italic;
    font-size: 14px;
    line-height: 1.6;
    color: #1b4965;
}

.section-dark .annotation-text {
    color: #bee9e8;
}

.section-dark .annotation {
    border-left-color: #bee9e8;
}

/* Footer Grid */
.footer-grid-section {
    padding: 80px 40px;
    background: #f0f4f8;
    text-align: center;
}

.footer-compositions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 600px;
    margin: 0 auto 40px;
}

.footer-cell {
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.footer-cell.visible {
    opacity: 1;
    transform: scale(1);
}

.footer-cell svg {
    width: 60px;
    height: 60px;
}

/* Grain overlay for footer cells */
.footer-cell::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-conic-gradient(rgba(27, 73, 101, 0.04) 0deg, transparent 1deg, transparent 5deg) 0 0 / 3px 3px;
    pointer-events: none;
}

.footer-domain {
    font-family: 'EB Garamond', serif;
    font-weight: 700;
    font-size: 1.2rem;
    color: #1b4965;
    /* cad2c5 sage gray reference */
    border-top: 1px solid #cad2c5;
    display: inline-block;
    padding-top: 12px;
}

/* Responsive */
@media (max-width: 700px) {
    .title-grid {
        flex-direction: column;
        text-align: center;
    }

    .grain-circle {
        width: 120px;
        height: 120px;
    }

    .section-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .section-number-col {
        display: flex;
        align-items: center;
        gap: 16px;
        justify-content: center;
    }

    .section-number {
        font-size: clamp(3rem, 8vw, 6rem);
    }

    .footer-compositions {
        grid-template-columns: repeat(3, 1fr);
    }

    .tutorial-section {
        padding: 60px 20px;
    }
}
