/* Pen & ink layer. Loaded after style.css. */
:root {
    --ink-blue: #26355d;
}

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

@keyframes fade {
    to {
        opacity: 0;
    }
}

@keyframes write {
    from {
        clip-path: inset(0 100% 0 0);
    }

    to {
        clip-path: inset(0 0 0 0);
    }
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
}

.ink-progress {
    position: fixed;
    inset: 0 0 auto 0;
    height: 2px;
    background: var(--ink-blue);
    transform: scaleX(0);
    transform-origin: left;
    z-index: 20;
}

/* Hero: a pen signs the page */
.flourish {
    display: block;
    width: min(320px, 70%);
    height: 24px;
    margin-top: 18px;
    overflow: visible;
}

.flourish path:first-child {
    fill: none;
    stroke: var(--ink-blue);
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: draw 2.4s .3s var(--ease) forwards;
}

.nib {
    fill: var(--ink-blue);
    animation: fade .6s 2.9s forwards;
}

.pens {
    font-family: var(--serif);
    font-style: italic;
    font-size: 18px;
    color: var(--c-stone);
    margin: 14px 0 0;
    animation: write 1.8s 1.2s var(--ease) backwards;
}

.pens em {
    color: var(--ink-blue);
}

/* Sticky nav with scrollspy */
.nav {
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 14px 0;
    margin-bottom: 56px;
    background: color-mix(in srgb, var(--c-bg) 92%, transparent);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--c-border);
    overflow-x: auto;
    white-space: nowrap;
}

.nav a[aria-current] {
    color: var(--c-ink);
    border-color: var(--ink-blue);
}

section {
    scroll-margin-top: 72px;
}

/* Reveal on scroll (only when JS is running) */
.js .row {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .6s var(--ease), transform .6s var(--ease), background .2s ease;
}

.js .row.in {
    opacity: 1;
    transform: none;
}

.js .section-divider {
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 1.1s var(--ease);
}

.js .section-row.in .section-divider {
    transform: none;
}

/* Exhibits */
.work-title::after {
    content: " +";
    color: var(--c-stone);
}

.exhibit[open] .work-title::after {
    content: " \2212";
}

.exhibit[open] .exhibit-body {
    animation: rise .5s var(--ease);
}

.exhibit[hidden] {
    display: none;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.chip {
    font: 400 10px var(--sans);
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--c-muted-aa);
    background: transparent;
    border: 1px solid var(--c-border);
    padding: 8px 14px;
    cursor: pointer;
    transition: all .15s ease;
}

.chip:hover {
    border-color: var(--c-accent);
}

.chip[aria-pressed="true"] {
    background: var(--c-ink);
    color: var(--c-bg);
    border-color: var(--c-ink);
}

/* Timeline: ink line that fills as you scroll */
.timeline {
    position: relative;
}

.timeline::before,
.timeline::after {
    content: "";
    position: absolute;
    left: 155px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--c-border);
}

.timeline::after {
    background: var(--ink-blue);
    transform-origin: top;
    transform: scaleY(var(--p, 0));
}

.event::after {
    content: "";
    position: absolute;
    left: 151px;
    top: 34px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--c-bg);
    border: 1px solid var(--c-stone);
    transition: background .4s ease .3s, border-color .4s ease .3s;
}

.event.in::after {
    background: var(--ink-blue);
    border-color: var(--ink-blue);
}

/* Journey: each stop is inked in turn */
.journey {
    list-style: none;
    margin: 20px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    row-gap: 28px;
}

.journey li {
    position: relative;
    padding: 22px 16px 0 0;
}

.journey li::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--c-ink);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .7s var(--ease) calc(var(--i) * 70ms);
}

.journey li.in::before {
    transform: none;
}

.stop-year {
    display: block;
    font-family: var(--serif);
    font-size: 28px;
    line-height: 1;
    color: var(--c-ink-3);
}

.journey strong {
    display: block;
    font-family: var(--serif);
    font-size: 20px;
    font-weight: 400;
    color: var(--c-ink-2);
    margin-top: 6px;
}

.note {
    font-size: 13px;
    color: var(--c-stone);
}

/* Archive card */
.fact {
    margin: 20px 0 24px;
    padding: 28px 12px 0;
    border-top: 1px solid var(--c-ink);
    max-width: 44rem;
}

.fact blockquote {
    margin: 0;
    font-family: var(--serif);
    font-size: 24px;
    line-height: 1.5;
    color: var(--c-ink-2);
}

.fact figcaption {
    margin-top: 12px;
    font-size: 11px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--c-muted-aa);
}

.fact.turn blockquote {
    animation: write 1.4s var(--ease);
}

.write-in .reflection-text {
    animation: write 1.6s var(--ease) both;
}

#archive .btn {
    margin-left: 12px;
}

@media (max-width: 760px) {

    .timeline::before,
    .timeline::after,
    .event::after {
        display: none;
    }

    .nav {
        gap: 20px;
        flex-wrap: nowrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    .flourish path:first-child {
        animation: none;
        stroke-dashoffset: 0;
    }

    .nib {
        display: none;
    }

    .js .row {
        opacity: 1;
        transform: none;
    }

    .js .section-divider,
    .journey li::before {
        transform: none;
    }

    .pens,
    .fact.turn blockquote,
    .write-in .reflection-text,
    .exhibit[open] .exhibit-body {
        animation: none;
    }
}