/* mores.quest -- a field notebook of cultural customs
   palette: #f5ede0 #2c2417 #c75c2a #4a7c59 #d4a574 #e8ddd0 #8b7d6b
   fonts: Caveat, Lora, Kalam (Google Fonts)
*/

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Lora", Georgia, serif;
    font-weight: 400;
    line-height: 1.85;
    color: #2c2417;
    background-color: #f5ede0;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------- aged paper grain ------------------------------------------ */
.paper-grain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    opacity: 0.6;
    background-image:
        radial-gradient(circle at 20% 18%, rgba(199, 92, 42, 0.06) 0%, transparent 45%),
        radial-gradient(circle at 80% 70%, rgba(74, 124, 89, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 50% 92%, rgba(212, 165, 116, 0.06) 0%, transparent 55%),
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.17 0 0 0 0 0.14 0 0 0 0 0.09 0 0 0 0.045 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
    background-blend-mode: multiply;
    mix-blend-mode: multiply;
}

/* ---------- hero ------------------------------------------------------ */
.hero {
    position: relative;
    z-index: 2;
    padding: clamp(4rem, 10vw, 7rem) 1.5rem 4rem;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.hero-stamp {
    display: inline-flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.5rem 1rem;
    border: 1.5px dashed #8b7d6b;
    border-radius: 4px;
    transform: rotate(-2.4deg);
    margin-bottom: 2rem;
    color: #8b7d6b;
    background: rgba(232, 221, 208, 0.4);
}

.stamp-line {
    font-family: "Kalam", "Caveat", cursive;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: lowercase;
}

.hero-title {
    font-family: "Caveat", "Kalam", cursive;
    font-weight: 700;
    font-size: clamp(3.2rem, 11vw, 7.5rem);
    line-height: 0.95;
    color: #2c2417;
    letter-spacing: -0.01em;
    margin-bottom: 1.2rem;
    transform: rotate(-1.5deg);
    display: inline-block;
}

.hero-dot {
    color: #c75c2a;
    display: inline-block;
    transform: translateY(-0.05em);
}

.hero-subtitle {
    font-family: "Lora", Georgia, serif;
    font-style: italic;
    font-size: clamp(1.05rem, 2vw, 1.2rem);
    color: #2c2417;
    max-width: 520px;
    margin: 0 auto 2rem;
    opacity: 0.92;
}

.hero-byline {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    font-family: "Kalam", cursive;
    font-size: 0.92rem;
    color: #8b7d6b;
    padding-top: 1rem;
    border-top: 1px solid rgba(139, 125, 107, 0.3);
    max-width: 520px;
    margin: 0 auto;
}

.quill {
    display: inline-block;
    width: 24px;
    height: 24px;
    background:
        radial-gradient(circle at 30% 30%, #c75c2a 0 3px, transparent 4px),
        linear-gradient(135deg, transparent 45%, #4a7c59 47%, #4a7c59 53%, transparent 55%);
    border-radius: 50% 0 50% 0;
    transform: rotate(-25deg);
    flex-shrink: 0;
}

.hero-scroll-hint {
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-family: "Caveat", cursive;
    font-size: 1.3rem;
    color: #c75c2a;
    animation: bob 2.6s ease-in-out infinite;
}

.hint-arrow {
    width: 2px;
    height: 28px;
    background: #c75c2a;
    position: relative;
}

.hint-arrow::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: -5px;
    width: 12px;
    height: 12px;
    border-right: 2px solid #c75c2a;
    border-bottom: 2px solid #c75c2a;
    transform: rotate(45deg);
}

@keyframes bob {
    0%, 100% { transform: translateY(0); opacity: 0.85; }
    50% { transform: translateY(8px); opacity: 1; }
}

/* ---------- the path -------------------------------------------------- */
.path-wrap {
    position: relative;
    z-index: 2;
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1rem 4rem;
}

.path-svg {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.path-line {
    stroke-dashoffset: 0;
    opacity: 0.85;
}

/* ---------- stops ----------------------------------------------------- */
.stops {
    list-style: none;
    position: relative;
    z-index: 2;
    margin: 0;
    padding: 0;
}

.stop {
    position: relative;
    display: flex;
    margin: 3.5rem 0;
    min-height: 240px;
}

.stop-left {
    justify-content: flex-start;
}

.stop-right {
    justify-content: flex-end;
}

.stop-anchor {
    position: absolute;
    top: 1.8rem;
    left: 50%;
    width: 0;
    height: 0;
    transform: translateX(-50%);
}

.branch-line {
    position: absolute;
    top: 0;
    height: 2px;
    background:
        linear-gradient(90deg, #c75c2a 0 5px, transparent 5px 11px) repeat-x;
    background-size: 11px 2px;
    opacity: 0.7;
}

.stop-left .branch-right {
    right: 6px;
    width: 90px;
}

.stop-right .branch-left {
    left: 6px;
    width: 90px;
}

/* stop icons -- CSS-drawn cultural symbols */
.stop-icon {
    position: absolute;
    top: -7px;
    left: -7px;
    width: 16px;
    height: 16px;
    z-index: 3;
}

.icon-cup {
    background: #f5ede0;
    border: 2px solid #c75c2a;
    border-radius: 0 0 50% 50% / 0 0 70% 70%;
}
.icon-cup::after {
    content: "";
    position: absolute;
    top: -3px;
    left: 1px;
    width: 10px;
    height: 2px;
    background: #c75c2a;
    border-radius: 1px;
    transform: rotate(-6deg);
}

.icon-circle {
    background: #f5ede0;
    border: 2px solid #4a7c59;
    border-radius: 50%;
}
.icon-circle::after {
    content: "";
    position: absolute;
    inset: 3px;
    background: #4a7c59;
    border-radius: 50%;
    opacity: 0.5;
}

.icon-triangle {
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 14px solid #d4a574;
    background: transparent;
    top: -4px;
}
.icon-triangle::after {
    content: "";
    position: absolute;
    top: 6px;
    left: -3px;
    width: 6px;
    height: 6px;
    background: #f5ede0;
    border-radius: 50%;
}

.icon-cross {
    background: #f5ede0;
    border: 2px solid #c75c2a;
    border-radius: 50%;
}
.icon-cross::before,
.icon-cross::after {
    content: "";
    position: absolute;
    background: #c75c2a;
    border-radius: 1px;
}
.icon-cross::before {
    top: 50%;
    left: 2px;
    right: 2px;
    height: 2px;
    transform: translateY(-50%);
}
.icon-cross::after {
    left: 50%;
    top: 2px;
    bottom: 2px;
    width: 2px;
    transform: translateX(-50%);
}

.icon-spiral {
    border: 2px solid #4a7c59;
    border-radius: 50%;
    background:
        radial-gradient(circle at 60% 40%, transparent 0 2px, #4a7c59 2px 3px, transparent 3px 4px, #4a7c59 4px 5px, transparent 5px);
    background-color: #f5ede0;
}

.icon-leaf {
    background: #4a7c59;
    border-radius: 0 100% 0 100%;
    transform: rotate(-30deg);
    border: 1px solid #2c2417;
}
.icon-leaf::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent 47%, rgba(245, 237, 224, 0.7) 49%, rgba(245, 237, 224, 0.7) 51%, transparent 53%);
}

.icon-diamond {
    background: #d4a574;
    transform: rotate(45deg);
    border: 1.5px solid #2c2417;
    width: 14px;
    height: 14px;
    top: -5px;
    left: -7px;
}

.icon-dot {
    background: #c75c2a;
    border: 3px solid #f5ede0;
    border-radius: 50%;
    box-shadow: 0 0 0 1.5px #c75c2a;
}

/* ---------- stop card ------------------------------------------------- */
.stop-card {
    width: clamp(260px, 42%, 460px);
    background: #e8ddd0;
    background-image:
        linear-gradient(180deg, rgba(245, 237, 224, 0.6), rgba(232, 221, 208, 1));
    border: 1px solid rgba(139, 125, 107, 0.3);
    border-radius: 6px 14px 6px 14px;
    padding: 1.6rem 1.8rem 1.4rem;
    position: relative;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.5) inset,
        2px 4px 0 rgba(44, 36, 23, 0.04),
        4px 8px 14px rgba(44, 36, 23, 0.07);
    transform: rotate(-0.6deg);
    transition: transform 0.5s cubic-bezier(.22,.9,.3,1.2), box-shadow 0.4s ease;
    opacity: 0;
}

.stop-card.is-visible {
    opacity: 1;
    animation: settle 0.85s cubic-bezier(.2,.7,.25,1) both;
}

@keyframes settle {
    from {
        opacity: 0;
        transform: translateY(30px) rotate(-2.4deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotate(-0.6deg);
    }
}

.stop-right .stop-card {
    transform: rotate(0.7deg);
}

.stop-right .stop-card.is-visible {
    animation-name: settle-right;
}

@keyframes settle-right {
    from {
        opacity: 0;
        transform: translateY(30px) rotate(2.4deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotate(0.7deg);
    }
}

.stop-card:hover {
    transform: rotate(0deg) translateY(-2px);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.5) inset,
        3px 6px 0 rgba(44, 36, 23, 0.05),
        6px 14px 22px rgba(44, 36, 23, 0.12);
}

.stop-card::before {
    content: "";
    position: absolute;
    top: -10px;
    left: 22px;
    width: 36px;
    height: 16px;
    background: rgba(212, 165, 116, 0.55);
    border: 1px dashed rgba(139, 125, 107, 0.6);
    border-radius: 1px;
    transform: rotate(-4deg);
}

.stop-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.55rem 0.8rem;
    font-family: "Kalam", cursive;
    font-size: 0.86rem;
    color: #8b7d6b;
    margin-bottom: 0.6rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px dashed rgba(139, 125, 107, 0.45);
}

.stop-index {
    font-family: "Caveat", cursive;
    font-size: 1.5rem;
    color: #c75c2a;
    line-height: 1;
}

.stop-place {
    font-style: italic;
    color: #4a7c59;
    font-family: "Lora", serif;
    font-weight: 500;
}

.stop-tradition {
    margin-left: auto;
    font-family: "Kalam", cursive;
    font-size: 0.82rem;
    color: #8b7d6b;
}

.stop-title {
    font-family: "Caveat", cursive;
    font-weight: 700;
    font-size: clamp(1.6rem, 3.2vw, 2.2rem);
    line-height: 1.15;
    color: #2c2417;
    margin-bottom: 0.8rem;
    letter-spacing: -0.005em;
}

.stop-body {
    font-family: "Lora", serif;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.85;
    color: #2c2417;
    margin-bottom: 1rem;
}

.stop-quote {
    font-family: "Lora", serif;
    font-style: italic;
    font-size: 0.95rem;
    color: #c75c2a;
    padding: 0.4rem 0 0.4rem 0.9rem;
    border-left: 2px solid #c75c2a;
    margin-bottom: 0.7rem;
}

.margin-note {
    font-family: "Kalam", "Caveat", cursive;
    font-size: 0.85rem;
    color: #8b7d6b;
    line-height: 1.4;
    display: block;
    max-width: 70%;
    padding-top: 0.5rem;
    border-top: 1px dotted rgba(139, 125, 107, 0.4);
}

.margin-note-right {
    margin-left: auto;
    text-align: right;
    transform: rotate(-1.2deg);
}

.margin-note-left {
    margin-right: auto;
    text-align: left;
    transform: rotate(0.9deg);
}

/* ---------- ledger / lexicon ---------------------------------------- */
.ledger {
    position: relative;
    z-index: 2;
    max-width: 760px;
    margin: 6rem auto 4rem;
    padding: 3rem clamp(1.5rem, 5vw, 3rem);
    background: #e8ddd0;
    background-image:
        repeating-linear-gradient(
            180deg,
            transparent 0 28px,
            rgba(139, 125, 107, 0.18) 28px 29px
        );
    border: 1px solid rgba(139, 125, 107, 0.3);
    border-radius: 10px;
    box-shadow:
        4px 8px 0 rgba(44, 36, 23, 0.04),
        8px 18px 30px rgba(44, 36, 23, 0.08);
    transform: rotate(0.4deg);
}

.ledger::before {
    content: "";
    position: absolute;
    top: 0;
    left: 60px;
    bottom: 0;
    width: 1.5px;
    background: rgba(199, 92, 42, 0.4);
}

.ledger-title {
    font-family: "Caveat", cursive;
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 2.8rem);
    color: #c75c2a;
    margin-bottom: 0.4rem;
    transform: rotate(-1deg);
    display: inline-block;
}

.ledger-intro {
    font-family: "Kalam", cursive;
    font-size: 0.95rem;
    color: #8b7d6b;
    margin-bottom: 2rem;
    font-style: italic;
}

.ledger-list {
    list-style: none;
    display: grid;
    gap: 1.4rem;
}

.ledger-list li {
    display: grid;
    grid-template-columns: minmax(110px, 0.4fr) 1fr;
    gap: 1.4rem;
    align-items: baseline;
    padding-bottom: 1rem;
    border-bottom: 1px dashed rgba(139, 125, 107, 0.35);
}

.ledger-list li:last-child {
    border-bottom: none;
}

.ledger-word {
    font-family: "Caveat", cursive;
    font-weight: 700;
    font-size: 1.6rem;
    color: #4a7c59;
    line-height: 1;
}

.ledger-meaning {
    font-family: "Lora", serif;
    font-style: italic;
    font-size: 0.98rem;
    color: #2c2417;
    line-height: 1.7;
}

/* ---------- colophon -------------------------------------------------- */
.colophon {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 3rem 1.5rem 5rem;
    max-width: 600px;
    margin: 0 auto;
}

.colophon-line {
    font-family: "Kalam", cursive;
    font-size: 0.95rem;
    color: #8b7d6b;
    margin-bottom: 0.4rem;
    line-height: 1.6;
}

.colophon-line:first-child {
    font-family: "Caveat", cursive;
    font-size: 1.4rem;
    color: #c75c2a;
    margin-bottom: 0.8rem;
    transform: rotate(-1deg);
    display: inline-block;
}

.colophon-quiet {
    font-size: 0.78rem;
    color: #8b7d6b;
    letter-spacing: 0.05em;
    text-transform: lowercase;
    opacity: 0.7;
}

/* ---------- responsive ------------------------------------------------ */
@media (max-width: 760px) {
    .path-svg {
        left: 28px;
        transform: none;
        width: 60px;
    }

    .stop {
        margin: 2.5rem 0;
        min-height: auto;
    }

    .stop-left,
    .stop-right {
        justify-content: flex-end;
        padding-left: 60px;
    }

    .stop-anchor {
        left: 28px;
        transform: none;
    }

    .stop-left .branch-right,
    .stop-right .branch-left {
        left: 6px;
        right: auto;
        width: 30px;
    }

    .stop-card {
        width: 100%;
        transform: rotate(-0.4deg);
        padding: 1.2rem 1.3rem 1rem;
    }

    .stop-right .stop-card {
        transform: rotate(0.4deg);
    }

    .stop-card.is-visible {
        animation: settle-mobile 0.85s cubic-bezier(.2,.7,.25,1) both;
    }

    .stop-right .stop-card.is-visible {
        animation-name: settle-mobile-right;
    }

    @keyframes settle-mobile {
        from { opacity: 0; transform: translateY(20px) rotate(-1.6deg); }
        to   { opacity: 1; transform: translateY(0) rotate(-0.4deg); }
    }

    @keyframes settle-mobile-right {
        from { opacity: 0; transform: translateY(20px) rotate(1.6deg); }
        to   { opacity: 1; transform: translateY(0) rotate(0.4deg); }
    }

    .margin-note {
        max-width: 100%;
    }

    .margin-note-right {
        text-align: left;
        margin-left: 0;
    }

    .ledger {
        margin: 4rem 1rem 3rem;
        padding: 2rem 1.5rem 2rem 3.5rem;
    }

    .ledger::before {
        left: 28px;
    }

    .ledger-list li {
        grid-template-columns: 1fr;
        gap: 0.3rem;
    }
}

@media (max-width: 460px) {
    .stop-head {
        font-size: 0.78rem;
    }
    .stop-tradition {
        margin-left: 0;
        width: 100%;
    }
    .hero-stamp {
        font-size: 0.7rem;
    }
}
