/* masugomi.com - Wabi-sabi media criticism */
/* Colors from DESIGN.md */
:root {
    --soil: #2c2418;
    --bark: #4a3b2a;
    --moss: #6b7c52;
    --parchment: #d4c9a8;
    --rust: #8b5e3c;
    --ink-wash: #3d3830;
    --fog: #a89e88;
    --lichen: #8a9a6e;
}

/* Body fade-in like opening a heavy wooden door */
@keyframes body-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Grain breathing animation */
@keyframes grain-breathe {
    0%, 100% { opacity: 0.03; }
    50% { opacity: 0.06; }
}

/* Ginkgo leaf slow rotation */
@keyframes leaf-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--soil);
    color: var(--parchment);
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 17px;
    font-weight: 400;
    line-height: 1.78;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    animation: body-fade-in 0.8s ease-out forwards;
}

/* SVG filter hidden */
#grain-svg {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* Grain overlay */
#grain-overlay {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    filter: url(#grain-filter);
    opacity: 0.04;
    mix-blend-mode: overlay;
    pointer-events: none;
    z-index: 1000;
    animation: grain-breathe 4s ease-in-out infinite;
    background: var(--fog);
}

/* Leaf scroll indicators */
#leaf-indicators {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 18px;
    z-index: 900;
}

.leaf-indicator {
    width: 12px;
    height: 16px;
    position: relative;
    opacity: 0.1;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.leaf-indicator::before,
.leaf-indicator::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 14px;
    border-radius: 50% 50% 50% 0;
    background: radial-gradient(ellipse at center, var(--moss), var(--lichen));
    top: 0;
    left: 50%;
}

.leaf-indicator::before {
    transform: translateX(-70%) rotate(-15deg);
}

.leaf-indicator::after {
    transform: translateX(-30%) rotate(15deg);
}

.leaf-indicator.active {
    opacity: 0.8;
    transform: translateY(4px);
}

/* Content column - editorial flow with meandering */
#content-column {
    width: 55%;
    margin-left: 8%;
    padding-top: 60px;
    padding-bottom: 100px;
    position: relative;
    z-index: 1;
    transition: margin-left 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Domain label */
.domain-label {
    font-family: 'DM Mono', monospace;
    font-size: 14px;
    color: var(--rust);
    letter-spacing: 0.08em;
    margin-bottom: 80px;
    opacity: 0.7;
}

/* Proclamation zones */
.proclamation {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 0;
}

.proclamation h1,
.proclamation p {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(36px, 6vw, 72px);
    font-weight: 300;
    line-height: 1.15;
    letter-spacing: 0.03em;
    color: var(--parchment);
    text-shadow: 0 0 8px rgba(107, 124, 82, 0.15);
    transition: text-shadow 1.2s ease;
    max-width: 90%;
}

.proclamation h1:hover,
.proclamation p:hover {
    text-shadow: 0 0 16px rgba(107, 124, 82, 0.3);
}

.proclamation em {
    font-style: italic;
}

/* Counter-animate: elements start noisy, resolve to clarity */
.counter-animate {
    letter-spacing: 0.3em;
    opacity: 0.4;
    filter: blur(3px);
    transition: letter-spacing 2.5s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 2.5s cubic-bezier(0.16, 1, 0.3, 1),
                filter 2.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.counter-animate.resolved {
    letter-spacing: 0.03em;
    opacity: 1;
    filter: blur(0px);
}

/* Editorial blocks */
.editorial-block {
    padding: 80px 0;
}

.torn-paper {
    background: var(--bark);
    padding: 48px 40px;
    position: relative;
    max-width: 640px;
    border-left: 2px solid var(--rust);
}

/* Torn paper edges with clip-path */
.torn-paper-1 {
    clip-path: polygon(0% 2%, 3% 0%, 8% 1.5%, 15% 0.5%, 22% 2%, 30% 0%, 38% 1%, 45% 0.5%, 52% 2.5%, 60% 0%, 68% 1.5%, 75% 0.5%, 82% 2%, 90% 0.5%, 95% 1.5%, 100% 0%, 100% 97%, 97% 100%, 92% 98%, 85% 100%, 78% 98.5%, 70% 100%, 62% 98%, 55% 100%, 48% 97.5%, 40% 100%, 32% 98%, 25% 100%, 18% 98.5%, 10% 100%, 5% 98%, 0% 100%);
}

.torn-paper-2 {
    clip-path: polygon(0% 1%, 5% 0%, 12% 2%, 18% 0.5%, 25% 1.5%, 33% 0%, 40% 2%, 48% 0%, 55% 1.5%, 63% 0.5%, 70% 2%, 78% 0%, 85% 1%, 92% 0.5%, 97% 2%, 100% 0%, 100% 98%, 95% 100%, 88% 98.5%, 80% 100%, 72% 97.5%, 65% 100%, 58% 98%, 50% 100%, 42% 98.5%, 35% 100%, 28% 97%, 20% 100%, 12% 98.5%, 5% 100%, 0% 98%);
}

.torn-paper-3 {
    clip-path: polygon(0% 0.5%, 4% 2%, 10% 0%, 17% 1.5%, 24% 0%, 32% 2.5%, 39% 0.5%, 46% 1%, 54% 0%, 61% 2%, 69% 0.5%, 76% 1.5%, 84% 0%, 91% 2%, 96% 0.5%, 100% 1.5%, 100% 99%, 96% 97.5%, 90% 100%, 83% 98%, 76% 100%, 68% 97.5%, 61% 100%, 54% 98%, 46% 100%, 39% 98.5%, 31% 100%, 24% 97%, 17% 100%, 9% 98%, 3% 100%, 0% 98.5%);
}

.torn-paper-4 {
    clip-path: polygon(0% 1.5%, 6% 0%, 13% 2%, 20% 0.5%, 28% 1%, 35% 0%, 43% 2.5%, 50% 0%, 57% 1.5%, 65% 0.5%, 72% 2%, 80% 0%, 87% 1.5%, 93% 0.5%, 98% 2%, 100% 0.5%, 100% 98.5%, 94% 100%, 87% 97.5%, 80% 100%, 73% 98%, 65% 100%, 57% 97.5%, 50% 100%, 43% 98.5%, 35% 100%, 28% 97%, 20% 100%, 13% 98.5%, 6% 100%, 0% 97%);
}

.torn-paper p {
    margin-bottom: 1.5em;
    max-width: 38em;
}

.torn-paper p:last-child {
    margin-bottom: 0;
}

/* Annotation labels */
.annotation {
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--moss);
    display: block;
    margin-bottom: 24px;
}

/* Ma pause zones */
.ma-pause {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 40px;
}

.ma-rule {
    border: none;
    height: 1px;
    background-color: var(--ink-wash);
    width: 120px;
    opacity: 0.4;
}

/* Ginkgo leaf divider */
.ginkgo-divider {
    width: 24px;
    height: 32px;
    position: relative;
    animation: leaf-spin 60s linear infinite;
}

.ginkgo-divider::before,
.ginkgo-divider::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 28px;
    border-radius: 50% 50% 50% 0;
    background: radial-gradient(ellipse at center, var(--moss), var(--lichen));
    opacity: 0.25;
    top: 0;
    left: 50%;
}

.ginkgo-divider::before {
    transform: translateX(-70%) rotate(-15deg);
}

.ginkgo-divider::after {
    transform: translateX(-30%) rotate(15deg);
}

/* Progressive degradation - later sections look more decayed */
.proclamation-final .counter-animate {
    color: var(--fog);
}

.ma-pause-final .ma-rule {
    opacity: 0.2;
}

/* Closing space */
.closing-space {
    height: 40vh;
}

/* Background leaf tessellation */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-conic-gradient(
        var(--soil) 0deg,
        rgba(107, 124, 82, 0.02) 30deg,
        var(--soil) 60deg
    );
    pointer-events: none;
    z-index: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #content-column {
        width: 85%;
        margin-left: 7.5%;
    }

    .proclamation h1,
    .proclamation p {
        font-size: clamp(28px, 8vw, 56px);
    }

    .torn-paper {
        padding: 32px 24px;
    }

    #leaf-indicators {
        right: 12px;
    }
}
