/* rinji.org - Cottagecore meets Hand-Drawn */

:root {
    --warm-canvas: #f5efe5;
    --graphite: #4a4440;
    --community-red: #a83828;
    --mutual-aid: #4a8848;
    --warmth: #d8a838;
    --open-air: #c0d8e8;
    --thumbtack: #d0c8b8;
    --pencil-line: #8a8078;
    --herb: #d8e0c8;
}

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

body {
    font-family: 'Merriweather', serif;
    font-weight: 400;
    color: var(--graphite);
    background-color: var(--warm-canvas);
    overflow-x: hidden;
    line-height: 1.8;
    font-size: clamp(0.9rem, 1vw, 1.1rem);
}

h3 {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--community-red);
}

/* Paper noise */
#paper-noise {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    opacity: 0.025;
    pointer-events: none;
    z-index: 1000;
}

/* Section 1: Welcome Board */
#welcome-board {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5vh 5vw;
    position: relative;
}

.hero-title {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    color: var(--graphite);
    filter: url(#wobbleFilter);
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.3s forwards;
}

.hero-subtitle {
    margin-top: 1rem;
    font-family: 'Merriweather', serif;
    font-size: clamp(0.95rem, 1.2vw, 1.2rem);
    color: var(--pencil-line);
    text-align: center;
}

.hero-subtitle .word {
    display: inline-block;
    opacity: 0;
    animation: wordFadeIn 0.3s ease forwards;
}

.hero-subtitle .word:nth-child(1) { animation-delay: 0.8s; }
.hero-subtitle .word:nth-child(2) { animation-delay: 0.9s; }
.hero-subtitle .word:nth-child(3) { animation-delay: 1.0s; }
.hero-subtitle .word:nth-child(4) { animation-delay: 1.1s; }
.hero-subtitle .word:nth-child(5) { animation-delay: 1.2s; }
.hero-subtitle .word:nth-child(6) { animation-delay: 1.3s; }
.hero-subtitle .word:nth-child(7) { animation-delay: 1.4s; }
.hero-subtitle .word:nth-child(8) { animation-delay: 1.5s; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes wordFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.house-sketch {
    position: absolute;
    bottom: 8vh;
    right: 10vw;
    width: 80px;
    height: 70px;
    transform: rotate(-3deg);
    opacity: 0.6;
}

.sketch-path {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    animation: drawPath 0.8s ease 1.5s forwards;
}

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

/* Section 2: Bulletin Board */
#bulletin-board {
    padding: 6rem 5vw;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
    max-width: 1000px;
    margin: 0 auto;
}

.community-card {
    background-color: var(--warm-canvas);
    border: 1.5px solid var(--pencil-line);
    padding: 2rem;
    box-shadow: 3px 4px 0 var(--thumbtack);
    opacity: 0;
    transition: opacity 0.3s ease-out, transform 0.3s ease-out, box-shadow 0.2s ease;
}

.community-card.visible {
    opacity: 1;
}

.community-card:hover {
    transform: rotate(0deg) !important;
    box-shadow: 5px 6px 2px var(--thumbtack);
}

.card-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 1rem;
}

.card-title {
    margin-bottom: 0.5rem;
}

.community-card p {
    font-size: 0.9rem;
    line-height: 1.7;
}

/* Alternate card backgrounds */
.community-card:nth-child(1) { background-color: #fcf8f0; }
.community-card:nth-child(2) { background-color: var(--herb); }
.community-card:nth-child(3) { background-color: var(--open-air); }
.community-card:nth-child(4) { background-color: #f8ecd8; }
.community-card:nth-child(5) { background-color: var(--herb); }
.community-card:nth-child(6) { background-color: #fcf8f0; }

/* Section 3: Timeline */
#timeline-section {
    padding: 6rem 5vw;
    position: relative;
    min-height: 120vh;
}

.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    width: 20px;
    height: 100%;
    transform: translateX(-50%);
    z-index: 1;
}

#timeline-path {
    stroke-dasharray: 3000;
    stroke-dashoffset: 3000;
    transition: stroke-dashoffset 0.1s linear;
}

.timeline-events {
    position: relative;
    z-index: 2;
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

.timeline-node {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

.timeline-node.visible {
    opacity: 1;
}

.node-left {
    flex-direction: row;
    padding-right: 50%;
}

.node-right {
    flex-direction: row-reverse;
    padding-left: 50%;
    text-align: right;
}

.node-circle {
    width: 16px;
    height: 16px;
    border: 2px solid var(--community-red);
    border-radius: 50%;
    background-color: var(--warm-canvas);
    flex-shrink: 0;
    transform: scale(0);
    transition: transform 0.3s ease-out;
}

.timeline-node.visible .node-circle {
    transform: scale(1);
}

.node-content h3 {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.node-content p {
    font-size: 0.9rem;
    line-height: 1.7;
}

/* Section 4: The Gathering */
#gathering {
    padding: 4rem 5vw 8rem;
    text-align: center;
}

.gathering-line {
    width: 40vw;
    height: 4px;
    margin: 0 auto 2rem;
    display: block;
}

.gathering-message {
    font-family: 'Merriweather', serif;
    font-size: clamp(1rem, 1.3vw, 1.2rem);
    color: var(--graphite);
    max-width: 40ch;
    margin: 0 auto 3rem;
    line-height: 1.8;
}

.community-icons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.community-icons svg {
    width: 30px;
    height: 25px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.community-icons svg.visible {
    opacity: 0.7;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    .card-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }

    .node-left,
    .node-right {
        padding: 0;
        flex-direction: row;
        text-align: left;
    }
}

@media (max-width: 500px) {
    .card-grid {
        grid-template-columns: 1fr;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .hero-title,
    .hero-subtitle .word,
    .community-card,
    .timeline-node,
    .community-icons svg {
        opacity: 1 !important;
        transform: none !important;
    }

    .sketch-path {
        stroke-dashoffset: 0 !important;
    }

    #timeline-path {
        stroke-dashoffset: 0 !important;
    }

    .node-circle {
        transform: scale(1) !important;
    }
}
