/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

/* Grain Texture Background */
@keyframes grain {
    0%, 100% {
        opacity: 0.04;
    }
    50% {
        opacity: 0.06;
    }
}

:root {
    /* Color Palette */
    --bg-primary: #F6F2EC;
    --bg-secondary: #EDE8E0;
    --text-primary: #2A2D3A;
    --text-secondary: #8A8278;
    --accent-brass: #8B7D5E;
    --accent-navy: #1E2A4A;
    --border-taupe: #C0B8A8;
    --candle-amber: #D4B070;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Grain overlay texture */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.02) 2px,
            rgba(0, 0, 0, 0.02) 4px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.02) 2px,
            rgba(0, 0, 0, 0.02) 4px
        );
    background-size: 200px 200px;
    pointer-events: none;
    z-index: -1;
}

/* Candle glow decorative elements */
body::after {
    content: '';
    position: fixed;
    width: 24px;
    height: 24px;
    background: radial-gradient(circle, rgba(212, 176, 112, 0.3) 0%, transparent 70%);
    filter: blur(20px);
    pointer-events: none;
    z-index: -1;
    top: 20%;
    right: 10%;
}

.page-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 80px 40px;
}

/* Typography */
h1, h2, h3 {
    font-family: 'Instrument Serif', serif;
    font-weight: 400;
    letter-spacing: 0.04em;
}

/* Block Styles */
.block {
    margin: 0 auto;
    opacity: 0;
    transition: opacity 0.8s ease-out, filter 0.8s ease-out;
    filter: blur(0.5px);
}

.block.visible {
    opacity: 1;
    filter: blur(0);
}

/* Block I: The Instrument */
.block-instrument {
    text-align: center;
    margin-bottom: 120px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.domain-name {
    font-size: clamp(1.8rem, 4vw, 3rem);
    letter-spacing: 0.04em;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 16px;
    font-family: 'Instrument Serif', serif;
}

.tagline {
    font-size: clamp(0.875rem, 1.5vw, 1rem);
    color: var(--text-secondary);
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    letter-spacing: 0.02em;
}

/* Block II: Description */
.block-description {
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 120px;
}

.section-title {
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    margin-bottom: 24px;
    color: var(--text-primary);
    font-weight: 400;
    letter-spacing: 0.03em;
    font-family: 'Instrument Serif', serif;
}

.description-text {
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.8;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-weight: 400;
}

/* Block III: Methodology */
.block-methodology {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 120px;
}

.methodology-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-top: 40px;
}

.methodology-item {
    padding: 24px;
    border: 1px solid var(--bg-secondary);
    background-color: rgba(255, 255, 255, 0.3);
    transition: all 0.4s ease;
}

.methodology-item:hover {
    border-color: var(--accent-brass);
    background-color: rgba(139, 125, 94, 0.05);
    transform: translateY(-2px);
}

.method-number {
    display: block;
    font-size: 2rem;
    font-weight: 400;
    color: var(--accent-brass);
    margin-bottom: 12px;
    font-family: 'Instrument Serif', serif;
    letter-spacing: 0.04em;
}

.method-title {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 12px;
    font-family: 'Instrument Serif', serif;
    letter-spacing: 0.02em;
}

.method-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
}

/* Block III: Demonstration (Plot Curve) */
.block-demonstration {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 120px;
}

.plot-curve-container {
    margin-top: 40px;
    padding: 40px;
    border: 1px solid var(--border-taupe);
    background-color: rgba(192, 184, 168, 0.02);
}

.plot-curve {
    width: 100%;
    max-width: 800px;
    height: auto;
}

.plot-path {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    animation: drawPath 2s ease-in-out forwards;
}

@keyframes drawPath {
    to {
        stroke-dashoffset: 0;
    }
}

.arc-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    fill: var(--text-secondary);
    letter-spacing: 0.04em;
    text-anchor: middle;
    animation: fadeInLabels 0.5s ease-in-out 2s forwards;
    opacity: 0;
}

@keyframes fadeInLabels {
    to {
        opacity: 1;
    }
}

/* Block IV: Philosophy */
.block-philosophy {
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 120px;
    padding: 40px;
    border-left: 2px solid var(--accent-brass);
    background-color: rgba(139, 125, 94, 0.02);
}

.philosophy-text {
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.9;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-weight: 400;
}

/* Block V: Call to Action */
.block-cta {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 120px;
    text-align: center;
    padding: 60px 40px;
    background-color: rgba(139, 125, 94, 0.03);
    border: 1px solid var(--bg-secondary);
}

.cta-button {
    display: inline-block;
    padding: 16px 48px;
    margin-top: 20px;
    background-color: var(--accent-navy);
    color: var(--bg-primary);
    border: none;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    text-transform: lowercase;
}

.cta-button:hover {
    background-color: var(--accent-brass);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(42, 45, 58, 0.15);
}

.cta-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(42, 45, 58, 0.1);
}

.cta-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 16px;
    font-family: 'IBM Plex Mono', monospace;
    letter-spacing: 0.01em;
}

/* Spacers */
.spacer {
    height: 80px;
    margin: 0 auto;
    max-width: 1px;
    background-color: var(--bg-secondary);
}

/* Footer */
.footer {
    margin-top: 80px;
    padding-top: 40px;
    border-top: 1px solid var(--bg-secondary);
    text-align: center;
}

.footer-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-family: 'IBM Plex Mono', monospace;
    letter-spacing: 0.01em;
}

/* Responsive Design */
@media (max-width: 768px) {
    .page-container {
        padding: 60px 24px;
    }

    .block-instrument {
        margin-bottom: 100px;
    }

    .block-description,
    .block-philosophy,
    .block-cta {
        margin-bottom: 100px;
    }

    .block-methodology {
        margin-bottom: 100px;
    }

    .methodology-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .cta-button {
        padding: 14px 40px;
        font-size: 0.9rem;
    }

    .spacer {
        height: 60px;
    }
}

@media (max-width: 480px) {
    .page-container {
        padding: 40px 16px;
    }

    .domain-name {
        font-size: 1.5rem;
    }

    .tagline {
        font-size: 0.8rem;
    }

    .section-title {
        font-size: 1.1rem;
    }

    .description-text,
    .philosophy-text {
        font-size: 0.9rem;
    }

    .block-instrument {
        margin-bottom: 80px;
    }

    .block-description,
    .block-philosophy,
    .block-cta,
    .block-methodology {
        margin-bottom: 80px;
    }

    .methodology-item {
        padding: 16px;
    }

    .method-number {
        font-size: 1.5rem;
    }

    .cta-button {
        padding: 12px 32px;
        font-size: 0.85rem;
    }

    .spacer {
        height: 48px;
    }
}
