/* ==========================================================================
   brayden-beckius v5: cloth & selvedge
   The thread is the material, not an object on top of it. The page is a fine
   plain weave; craft shows at the edges (woven bands, fringe); essays carry a
   selvedge rail that is woven in as you read. Weaving vocabulary only: warp,
   weft, selvedge, fringe. No stitches.
   ========================================================================== */

/* 1. Ground: an over-under plain weave, only visible up close
   ------------------------------------------------------------------------- */
body {
    background-color: var(--v3-paper);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10'%3E%3Cg fill='%231F2A22' fill-opacity='.055'%3E%3Crect x='.6' y='1.4' width='3.8' height='2.2' rx='1.1'/%3E%3Crect x='6.4' y='.6' width='2.2' height='3.8' rx='1.1'/%3E%3Crect x='1.4' y='5.6' width='2.2' height='3.8' rx='1.1'/%3E%3Crect x='5.6' y='6.4' width='3.8' height='2.2' rx='1.1'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 10px 10px;
}
/* clip, not hidden: "hidden" turns the viewport into a scroll box and stops sticky things (progress strip, rail) sticking */
.gh-viewport { position: relative; overflow-x: clip; }

/* Long-form reading sits on plain paper; the weave stays in the margins */
.post-template .gh-article,
.page-template .gh-article { position: relative; isolation: isolate; }
.post-template .gh-article::before,
.page-template .gh-article::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    z-index: -1;
    width: min(100%, calc(var(--content-width, 720px) + 48px));
    transform: translateX(-50%);
    background: var(--v3-paper);
}

@media (prefers-contrast: more) {
    body { background-image: none; }
}

/* 2. Navigation helpers: skip link, anchor offsets, scroll progress
   ------------------------------------------------------------------------- */
.v5-skip {
    position: absolute;
    left: 16px;
    top: -80px;
    z-index: 2000;
    padding: 12px 18px;
    border-radius: 999px;
    background: var(--v3-ink);
    color: var(--v3-white);
    font-weight: 600;
    text-decoration: none;
}
.v5-skip:focus { top: 12px; color: var(--v3-white); }
.v5-content-start { display: block; height: 0; outline: none; }

[id] { scroll-margin-top: 110px; }
html { scroll-behavior: smooth; }

/* Reading progress (posts only): a woven moss strip just outside the right edge of the essay's paper column.
   It runs the height of the article and stays in view while you read (the track is sticky); it fills as you
   read and keeps the furthest point reached, so scrolling back up doesn't empty it (v3.js initProgress). */
.v5-progress {
    position: absolute;
    top: 0;
    bottom: 0;
    left: min(calc(50% + (var(--content-width, 720px) + 48px) / 2 + 12px), calc(100% - 12px));
    z-index: 1;
    width: 6px;
    pointer-events: none;
}
.v5-progress-track {
    position: sticky;
    top: 100px;
    height: calc(100vh - 160px);
    overflow: hidden;
    border-radius: 2px;
    background: rgb(47 93 58 / 0.12);
}
.v5-progress span {
    display: block;
    width: 100%;
    height: 100%;
    background-image:
        repeating-linear-gradient(0deg, rgb(255 255 255 / 0.35) 0 1px, transparent 1px 3px),
        linear-gradient(var(--v3-moss), var(--v3-moss));
    transform: scaleY(var(--v5-read, 0));
    transform-origin: 50% 0;
    transition: transform 0.15s linear;
}
@media (max-width: 767px) {
    .v5-progress { width: 4px; left: calc(100% - 10px); }
}

/* 3. Shape: pills for buttons, 4px for anything made of cloth
   ------------------------------------------------------------------------- */
.gh-viewport :is(.gh-button, .gh-form, .gh-form-input) { border-radius: 999px !important; }

.v3-scale-card,
.v3-subscribe-card,
.v3-events-aside,
.v3-photo-strip img,
.v3-date-tile,
.v3-invite-card,
.gh-article-image img,
.gh-card-image img,
.gh-content :is(.kg-image-card, .kg-gallery-card) img { border-radius: 4px; }
.v5-events-img { border-radius: 2px; }

.v5-btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 22px;
    border: 1.5px solid var(--v3-moss);
    border-radius: 999px;
    color: var(--v3-moss);
    font-weight: 600;
    font-size: 16px;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.v5-btn-outline:hover { background: var(--v3-moss); color: var(--v3-white); }

/* 4. Woven edges: a narrow band of weft along the top and bottom of a piece of cloth
   ------------------------------------------------------------------------- */
.v3-scale-card,
.v3-subscribe-card {
    position: relative;
    overflow: hidden;
}
.v3-scale-card { padding: 34px 26px; --v5-edge: var(--v3-scale); }
.v3-subscribe-card { --v5-edge: var(--v3-moss); padding-top: clamp(34px, 5vw, 58px); padding-bottom: clamp(34px, 5vw, 58px); }
.v3-scale-card::before, .v3-scale-card::after,
.v3-subscribe-card::before, .v3-subscribe-card::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 6px;
    background-color: var(--v5-edge);
    background-image: repeating-linear-gradient(90deg, rgb(255 255 255 / 0.4) 0 1px, transparent 1px 3px);
    pointer-events: none;
}
.v3-scale-card::before, .v3-subscribe-card::before { top: 0; }
.v3-scale-card::after, .v3-subscribe-card::after { bottom: 0; }
.v3-scale-title { font-size: 28px; }

/* Followed from the hero diagram: ring the tile in its scale colour */
.v3-scale-card:target { outline: 3px solid var(--v3-scale); outline-offset: 4px; }

/* The email field as woven tape */
.v3-subscribe-row input {
    border: 0;
    border-radius: 4px;
    box-shadow: inset 0 3px 0 var(--v3-moss), inset 0 -3px 0 var(--v3-moss), inset 1px 0 0 var(--v3-field), inset -1px 0 0 var(--v3-field);
}
input::placeholder { color: var(--v3-muted); opacity: 1; }

/* Fringe: loose warp ends hanging from a section's lower edge */
.v3-invite.v5-fringed { overflow: visible; margin-bottom: 36px; }
/* One fringe for the whole site: assets/images/fringe.svg (a 768px tile of threads 8px apart, random lengths 10-34px)
   used as a mask, so each use only sets its colour (--v5-fringe-colour) and size. Used by the invitation band (moss),
   the footer's cloth end (undyed) and the end of the essay rail (scaled to the rail's 3.25px warp). */
.v5-fringe,
.gh-footer.v3-footer::after,
.v5-rail-fringe {
    background-color: var(--v5-fringe-colour, var(--v3-moss));
    -webkit-mask: url("../images/fringe.svg") repeat-x 0 0 / 768px 36px;
    mask: url("../images/fringe.svg") repeat-x 0 0 / 768px 36px;
}
.v5-fringe {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -35px;
    height: 36px;
    pointer-events: none;
}
.v3-invite-copy .v3-h2 { font-size: clamp(32px, 3.6vw, 44px); line-height: 1.15; }

/* 5. Type scale: one size for every section heading
   ------------------------------------------------------------------------- */
.v3-h2,
.v3-h2.is-strong,
.v3-latest-list > .v3-h2,
.v3-subscribe-copy .v3-h2 { font-weight: 400; font-size: clamp(32px, 3.6vw, 44px); line-height: 1.15; }
.v3-events-aside .v3-h2 { font-size: 28px; }

/* 6. Home
   ------------------------------------------------------------------------- */
/* Hero diagram: one link to the detail below, in place of the caption */
.v5-diagram-link { display: flex; justify-content: center; min-height: 48px; margin: 0; }
.v5-diagram-link { align-items: center; margin-top: 4px; }
.v5-diagram-link .v5-btn-outline { min-width: 240px; justify-content: center; }

/* The bursts play once on load (and again when a scale is tapped); the river is still */
/* --v5-burst-to / --v5-burst-time are set by v3.js replay(): a chosen ring keeps the burst inside it */
@keyframes v5-ripple-a { 0% { transform: scale(1); opacity: 0.55; } 75% { opacity: 0.3; } 100% { transform: scale(var(--v5-burst-to, 9)); opacity: 0; } }
@keyframes v5-ripple-b { 0% { transform: scale(1); opacity: 0.55; } 75% { opacity: 0.3; } 100% { transform: scale(var(--v5-burst-to, 9)); opacity: 0; } }
.v3-ripple { opacity: 0; animation: v5-ripple-a var(--v5-burst-time, 5s) cubic-bezier(0.2, 0.6, 0.3, 1) 1 both; }
.v3-ripple.is-again { animation-name: v5-ripple-b; }
.v3-ripple-2 { animation-delay: 1.1s; }
.v3-river { animation: none; }


.v5-events-img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; object-position: 30% 30%; }

.v3-subscribe { padding-top: 0; padding-bottom: 88px; }
.v3-latest { padding-top: 88px; }
.v3-photo-strip { padding-top: 0; }

/* 6b. Splash: the hero fills the screen at every size
   ------------------------------------------------------------------------- */
body.home-template .gh-viewport > .v3-hero {
    box-sizing: border-box;
    min-height: 100vh;
    min-height: 100svh;
    padding-top: 130px;
    padding-bottom: 40px;
    align-content: center;
}
body.home-template .v3-hero .v3-diagram svg { max-height: max(260px, calc(100svh - 330px)); }

/* Scale buttons: one joined control rather than loose pills */
.v3-scale-buttons {
    display: inline-grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 0;
    border: 1.5px solid var(--v3-border);
    border-radius: 999px;
    overflow: hidden;
    background: var(--v3-paper);
}
.v3-scale-btn {
    min-height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 0;
    background: transparent;
    font-size: 14px;
    white-space: nowrap;
}
.v3-scale-btn + .v3-scale-btn { box-shadow: inset 1.5px 0 0 var(--v3-border); }
.v3-scale-btn[aria-pressed="true"] { box-shadow: none; }
.v3-scale-btn:focus-visible { outline-offset: -3px; border-radius: 999px; }

@media (max-width: 899px) {
    body.home-template .gh-viewport > .v3-hero {
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        gap: 20px;
        min-height: 100vh;
        min-height: 100svh;
        padding-top: 104px;
        padding-bottom: 20px;
    }
    .v3-hero-copy { flex: 0 0 auto; gap: 16px; }
    .v3-hero-title { font-size: clamp(32px, 8.4vw, 44px); }
    .v3-hero-lede { font-size: 16px; line-height: 1.55; }
    .v3-hero .v3-actions { gap: 4px 20px; }
    body.home-template .v3-hero .v3-diagram { flex: 0 0 auto; gap: 10px; }
    /* Fill what the copy leaves on screen, but never shrink so far that the labels can't be read */
    body.home-template .v3-hero .v3-diagram svg {
        width: 100%;
        height: clamp(200px, calc(100svh - 580px), 380px);
        max-height: none;
    }
    .v3-scale-buttons { display: grid; width: 100%; max-width: 420px; }
    .v3-scale-btn { padding: 0 6px; font-size: 13px; }
    .v5-diagram-link { min-height: 48px; margin-top: 0; }
    .v5-diagram-link .v5-btn-outline { min-height: 44px; }
}
@media (max-width: 359px) {
    .v3-scale-btn { font-size: 12px; padding: 0 4px; }
}

/* Section hand-off button under the scale tiles */
.v5-section-next { display: flex; justify-content: center; margin-top: 8px; }

/* Invitation band with the photo beside it */
.v5-invite-inner {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: 56px;
    align-items: center;
    padding-top: 88px;
    padding-bottom: 88px;
}
.v5-invite-inner:not(:has(.v5-invite-photo, .v5-gallery)) { grid-template-columns: 1fr; }
.v5-invite-photo { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.v5-invite-photo img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    object-position: 50% 45%;
    border-radius: 4px;
    background: var(--v3-moss-dark);
}
.v5-invite-photo figcaption { font-size: 14px; color: #CFD8C6; }
.v5-invite-text { display: flex; flex-direction: column; gap: 28px; }
.v5-invite-text .v3-invite-copy { flex: none; }
@media (max-width: 899px) {
    .v5-invite-inner { grid-template-columns: 1fr; gap: 32px; padding-top: 56px; padding-bottom: 64px; }
    .v5-invite-photo img { aspect-ratio: 3 / 2; }
}

/* Footer: no rule. On home the invitation band's fringe marks the boundary; on other pages
   the footer opens with the end of a piece of cloth: a narrow undyed band and its loose warp ends. */
.gh-footer.v3-footer { position: relative; border-top: 0; }
.gh-footer.v3-footer::before,
.gh-footer.v3-footer::after { content: ""; position: absolute; left: 0; right: 0; pointer-events: none; }
.gh-footer.v3-footer::before {
    top: 0;
    height: 4px;
    background-color: #BDB49C;
    background-image: repeating-linear-gradient(90deg, rgb(255 255 255 / 0.4) 0 1px, transparent 1px 3px);
}
.gh-footer.v3-footer::after { top: 3px; height: 36px; --v5-fringe-colour: #BDB49C; }
.v5-fringed + .gh-footer.v3-footer::before,
.v5-fringed + .gh-footer.v3-footer::after { display: none; }
.gh-footer.v3-footer .v5-footer-inner { padding-top: 72px; }
.v5-fringed + .gh-footer.v3-footer .v5-footer-inner { padding-top: 48px; }

/* Forms never overflow their card */
.v3-subscribe-row input { min-width: 0; width: 100%; box-sizing: border-box; }

@media (max-width: 599px) {
    /* Standard mobile pattern: stack the actions full width, primary filled, secondary outlined, same height */
    .v3-hero .v3-actions { flex-direction: column; align-items: stretch; gap: 10px; }
    .v3-hero .v3-actions .v3-btn { width: 100%; justify-content: center; }
    .v3-hero .v3-actions .v3-arrow {
        justify-content: center;
        min-height: 48px;
        padding: 0 20px;
        border: 1.5px solid var(--v3-moss);
        border-radius: 999px;
    }
    /* Email field and button stack full width */
    .v3-subscribe-row { flex-direction: column; }
    .v3-subscribe-row input { flex: 0 0 auto; height: 52px; }
    .v3-subscribe-row .v3-btn { width: 100%; justify-content: center; }
    .v3-subscribe-card { padding-left: 22px; padding-right: 22px; }
}

/* 7. Footer
   ------------------------------------------------------------------------- */
.v5-footer-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 32px 48px;
    justify-content: space-between;
    align-items: flex-start;
    padding-top: 40px;
    padding-bottom: 44px;
    font-size: 15px;
}
.v5-footer-brand { flex: 1 1 260px; display: flex; flex-direction: column; gap: 6px; }
.v5-footer-name { font-family: var(--v3-serif); font-variation-settings: "SOFT" 70; font-size: 20px; font-weight: 600; color: var(--v3-ink); }
.v5-footer-tag { font-size: 14px; color: var(--v3-muted); }
.v5-footer-nav { display: flex; flex-wrap: wrap; gap: 0 48px; }
.v5-footer-nav > div { display: flex; flex-direction: column; }
.v5-footer-head { padding-bottom: 2px; font-size: 13px; font-weight: 600; color: var(--v3-muted); }
.v5-footer-nav a { padding: 10px 0; color: var(--v3-ink); text-decoration: none; }
.v5-footer-nav a:hover { color: var(--v3-moss); text-decoration: underline; }
.v5-to-top { align-self: flex-end; }
.v5-footer-inner .v3-footer-small { flex-basis: 100%; margin: 0; font-size: 13px; color: var(--v3-muted); }

/* 8. Essays: the selvedge rail (built by v3.js on wide screens)
   ------------------------------------------------------------------------- */
.v5-rail { display: none; }
@media (min-width: 1200px) {
    .v5-rail {
        display: block;
        grid-column: wide-start / main-start;
        grid-row: 1 / span 400;
        align-self: start;
        position: sticky;
        top: 120px;
        justify-self: end;
        width: 220px;
        margin: 0 40px 0 0 !important;
        font-size: 14px;
    }
    /* Its own scroll area when taller than the screen (v3.js follow): the wheel over it scrolls only the rail.
       The edges fade where there is more to scroll to. */
    .v5-rail {
        max-height: calc(100vh - 152px);
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
        scrollbar-color: rgb(47 93 58 / 0.35) transparent;
        padding-right: 2px;
    }
    .v5-rail.can-down { -webkit-mask-image: linear-gradient(#000 calc(100% - 48px), transparent); mask-image: linear-gradient(#000 calc(100% - 48px), transparent); }
    .v5-rail.can-up { -webkit-mask-image: linear-gradient(transparent, #000 48px); mask-image: linear-gradient(transparent, #000 48px); }
    .v5-rail.can-up.can-down { -webkit-mask-image: linear-gradient(transparent, #000 48px, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(transparent, #000 48px, #000 calc(100% - 48px), transparent); }
    .v5-rail ol { margin: 0; padding: 0; list-style: none; }
    .v5-rail li {
        display: grid;
        grid-template-columns: 1fr 14px;
        gap: 14px;
        min-height: 76px;
        margin: 0;
        padding: 0;
        font-size: 14px;
        line-height: 1.35;
    }
    .v5-rail a {
        padding: 2px 0 10px;
        text-align: right;
        color: var(--v3-muted);
        text-decoration: none;
    }
    .v5-rail a:hover { color: var(--v3-ink); text-decoration: underline; }
    .v5-rail li.is-current a { color: var(--v3-ink); font-weight: 600; }

    .v5-warp {
        position: relative;
        display: block;
        background-color: #EFEADC;
        background-image: repeating-linear-gradient(90deg, #BDB49C 0 1px, transparent 1px 3.25px);
    }
    .v5-cloth {
        position: absolute;
        inset: 0;
        transform: scaleY(0);
        transform-origin: 50% 0;
        transition: transform 0.15s linear;
        background-image:
            repeating-linear-gradient(90deg, rgb(255 255 255 / 0.28) 0 1px, transparent 1px 3.25px),
            repeating-linear-gradient(0deg, var(--v5-weft) 0 3px, var(--v5-weft-2) 3px 6px);
    }
    .v5-rail .is-moss { --v5-weft: #2F5D3A; --v5-weft-2: #3F7149; }
    .v5-rail .is-river { --v5-weft: #2E5E73; --v5-weft-2: #3E7187; }
    .v5-rail .is-clay { --v5-weft: #A4482A; --v5-weft-2: #B65C3E; }
    .v5-rail .is-ochre { --v5-weft: #7A5A0E; --v5-weft-2: #8E6D1E; }

    .v5-rail-end {
        display: grid;
        grid-template-columns: 1fr 14px;
        gap: 14px;
        margin: 0;
        font-size: 13px;
        text-align: right;
        color: #A39C88;
        transition: color 0.3s ease;
    }
    .v5-rail-fringe {
        display: block; grid-column: 2; width: 14px; height: 36px; --v5-fringe-colour: currentColor;
        /* 8px thread spacing scaled to the warp's 3.25px; drawn twice, 0.4px apart, so the narrowed threads keep ~1px width */
        -webkit-mask: url("../images/fringe.svg") -1px 0 / 312px 36px repeat-x, url("../images/fringe.svg") -0.6px 0 / 312px 36px repeat-x;
        mask: url("../images/fringe.svg") -1px 0 / 312px 36px repeat-x, url("../images/fringe.svg") -0.6px 0 / 312px 36px repeat-x;
    }
    .v5-rail.is-done .v5-rail-end { color: #8C836B; }

    /* Where the rail shows (essays with 3+ sections), it is the progress marker: no right-hand strip as well */
    .v3-article:has(.v5-rail) .v5-progress { display: none; }

    /* The rail replaces the old right-hand contents list */
    .v3-toc { display: none !important; }
}

/* 9. Carried over from v4: lost page, past events
   ------------------------------------------------------------------------- */
.v4-lost {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 40px 64px;
    padding-top: 48px;
    padding-bottom: 96px;
}
.v4-lost svg { flex: 0 1 300px; width: 100%; max-width: 300px; height: auto; }
.v4-lost-copy { flex: 1 1 360px; display: flex; flex-direction: column; gap: 18px; }
.v4-lost-code { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: 0.08em; color: var(--v3-clay); }
.v4-lost-copy p { margin: 0; font-size: 17px; line-height: 1.6; color: var(--v3-body); }
@keyframes v4-unravel { to { stroke-dashoffset: 0; } }
.v4-lost-strand { stroke-dasharray: 900; stroke-dashoffset: 900; animation: v4-unravel 2.4s ease-out 0.2s forwards; }

.v3-scale-btn { background-color: var(--v3-paper); }
.v3-event-list.is-past .v3-date-tile { background: var(--v3-paper); border: 1px solid var(--v3-border); }

/* 10. Reduced motion, print
   ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .v3-ripple { animation: none; opacity: 0; }
    .v5-cloth { transition: none; }
    .v4-lost-strand { animation: none; stroke-dashoffset: 0; }
    .v5-progress span { transition: none; }
}

@media print {
    .v5-progress, .v5-rail, .v5-fringe { display: none; }
    body { background-image: none; }
}

/* 10. Type: Alegreya + Alegreya Sans
   The body's font-size-adjust enlarges Alegreya Sans' short lowercase. Serif text keeps its set size. */
h1, h2, h3, h4, h5, h6, .is-title,
.v3-featured-quote blockquote, .v3-date-day, .gh-card-title, .gh-container-title,
.gh-article-excerpt, .gh-content > blockquote.kg-blockquote-alt,
.v5-note.is-start .v5-note-excerpt, .v5-footer-name { font-size-adjust: none; }
.v3-event-body h3 { font-size-adjust: 0.5; }
.v3-event-list.is-full .v3-event-body h3 { font-size-adjust: none; }

/* 11. Hero headline in motion (option C) and the loom intro
   ------------------------------------------------------------------------- */
.v5-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.v5-weave-title .v5-line { display: block; position: relative; width: fit-content; max-width: 100%; }
.v5-weave-title .v5-ink { display: block; }
.v5-weft { position: absolute; left: 0; right: 0; bottom: 0.06em; height: 4px; opacity: 0; transform-origin: 0 50%; pointer-events: none;
    background-color: var(--c); background-image: repeating-linear-gradient(90deg, rgb(255 255 255 / 0.45) 0 1px, transparent 1px 3px); }

/* The second line moves through each scale. All words share one grid cell, so the line never changes size. */
.v5-words { display: inline-grid; justify-items: start; }
.v5-word { grid-area: 1 / 1; color: var(--w); opacity: 0; transition: opacity 0.35s ease; }
.v5-word.is-on { opacity: 1; animation: v5-word-in 0.55s cubic-bezier(0.2, 0.7, 0.3, 1) both; }
@keyframes v5-word-in { from { opacity: 0; transform: translateY(0.28em); } }

.v5-words-ctl { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--v3-muted); }
.v5-words-ctl[hidden] { display: none; }
.v5-pause { flex: none; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0;
    border: 1.5px solid var(--v3-field); border-radius: 999px; background: transparent; color: var(--v3-ink); cursor: pointer; transition: border-color 0.2s ease; }
.v5-pause:hover { border-color: var(--v3-ink); }
.v5-pause .v5-icon-play, .v5-pause.is-paused .v5-icon-pause { display: none; }
.v5-pause.is-paused .v5-icon-play { display: block; }

/* Loom intro: first visit in a session only (class set inline in the hero partial) */
@keyframes v5-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes v5-fadein { from { opacity: 0; } }
@keyframes v5-rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes v5-wipe { from { clip-path: inset(-0.25em 100% -0.35em 0); } to { clip-path: inset(-0.25em 0 -0.35em 0); } }
@keyframes v5-weft { 0% { transform: scaleX(0); opacity: 1; } 72% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }
@keyframes v5-shuttle { 0% { offset-distance: 0%; opacity: 0; } 10% { opacity: 1; } 88% { opacity: 1; } 100% { offset-distance: 100%; opacity: 0; } }

.v5-shuttle { opacity: 0; pointer-events: none; offset-path: path("M70 250 C 120 215, 165 270, 220 256 S 330 205, 380 232"); offset-rotate: auto; }
.v5-intro .v3-hero .v5-stroke { stroke-dasharray: 1; animation: v5-draw 0.85s cubic-bezier(0.55, 0.1, 0.3, 1) var(--d) both; }
.v5-intro .v3-hero .v5-river-draw { animation-duration: 1.15s; }
.v5-intro .v3-hero .v5-fill,
.v5-intro .v3-hero .v5-fade { animation: v5-fadein 0.6s ease var(--d) both; }
.v5-intro .v3-hero .v5-rise { animation: v5-rise 0.6s cubic-bezier(0.2, 0.7, 0.3, 1) var(--d) both; }
.v5-intro .v3-hero .v5-ink { animation: v5-wipe 0.8s cubic-bezier(0.6, 0.05, 0.35, 1) var(--d) both; }
.v5-intro .v3-hero .v5-weft { animation: v5-weft 1.1s cubic-bezier(0.6, 0.05, 0.35, 1) var(--d) both; }
.v5-intro .v3-hero .v5-shuttle { animation: v5-shuttle 1.15s cubic-bezier(0.45, 0, 0.4, 1) var(--d) both; }
/* The Self bursts wait until the loom is drawn */
.v5-intro .v3-hero .v3-ripple { animation-delay: 2.3s; }
.v5-intro .v3-hero .v3-ripple-2 { animation-delay: 3.4s; }

@media (prefers-reduced-motion: reduce) {
    .v5-word, .v5-word.is-on { transition: none; animation: none; }
    .v5-intro .v3-hero * { animation: none !important; }
}
@media (max-width: 899px) {
    .v5-words-ctl { gap: 10px; font-size: 13px; }
    /* Tablets: make room for the pause row so the splash still fits one screen (phones tuck the button away) */
}
@media (min-width: 768px) and (max-width: 899px) {
    body.home-template .v3-hero:has(.v5-words-ctl:not([hidden])) .v3-diagram svg { height: clamp(190px, calc(100svh - 640px), 380px); }
}
/* Phones: just the icon, tucked into the empty top-right corner beside "Weaving". The hint stays for screen readers. */
@media (max-width: 767px) {
    .v3-hero-copy { position: relative; }
    .v5-words-ctl { position: absolute; top: 0; right: 0; }
    .v5-words-hint { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
    .v5-pause { border-color: var(--v3-border); color: var(--v3-muted); }
}

/* 12. Latest notes: one heading row across both columns, then a card per note
   ------------------------------------------------------------------------- */
.v3-latest { row-gap: 40px; }
.v5-latest-head {
    flex: 1 1 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px 32px;
    margin: 0;
    padding-bottom: 22px;
    border-bottom: 2px solid var(--v3-ink);
}
.v5-latest-lede { margin: 8px 0 0; font-size: 17px; color: var(--v3-body); }
.v5-latest-meta { margin: 0; font-size: 15px; color: var(--v3-muted); }
.v5-latest-meta a { font-weight: 600; }

.v5-notes-label { margin: 0 0 12px; font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--v3-muted); }
.v5-note-list { display: flex; flex-direction: column; gap: 14px; }

/* Each note is a white card with a woven band down its left edge in the note's scale colour */
.v5-note {
    /* Notes without a scale tag get an undyed wool edge, so they don't echo the moss subscribe card */
    --v5-edge: var(--v3-scale, #A89B7C);
    --v5-tag-ink: var(--v3-scale, var(--v3-ink));
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 24px;
    padding: 22px 24px 22px 30px;
    background: var(--v3-white);
    border: 1px solid var(--v3-border);
    border-radius: 4px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.v5-note::before {
    content: "";
    position: absolute;
    top: -1px;
    bottom: -1px;
    left: -1px;
    width: 6px;
    border-radius: 4px 0 0 4px;
    background-color: var(--v5-edge);
    background-image: repeating-linear-gradient(0deg, rgb(255 255 255 / 0.4) 0 1px, transparent 1px 3px);
}
.v5-note:hover { border-color: var(--v3-ink); box-shadow: 0 2px 14px rgb(31 42 34 / 0.08); }
.v5-note:has(.v5-note-title a:focus-visible) { outline: 2px solid var(--v3-river); outline-offset: 3px; }
.v5-note-title a:focus-visible { outline: none; }

.v5-note-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.v5-note-title { margin: 0; font-size: 24px; font-weight: 600; line-height: 1.25; }
.v5-note-title a { color: var(--v3-ink); text-decoration: none; }
/* The title link covers the card */
.v5-note-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: 4px; }
.v5-note:hover .v5-note-title a { text-decoration: underline; text-decoration-color: var(--v5-edge); text-decoration-thickness: 2px; text-underline-offset: 4px; }

.v5-note-meta { order: -1; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; margin: 0; font-size: 14px; color: var(--v3-muted); }
.v5-note-meta > :not(:first-child)::before { content: "·"; margin-right: 8px; }
.v5-note-tag { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; text-transform: capitalize; color: var(--v5-tag-ink); }
.v5-note-tag::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--v5-edge); }

.v5-note-excerpt {
    margin: 0;
    max-width: 62ch;
    font-size: 16px;
    line-height: 1.55;
    color: var(--v3-body);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.v5-note-img { position: relative; z-index: 1; flex: 0 0 auto; display: block; width: 132px; aspect-ratio: 4 / 3; }
.v5-note-img img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 2px; }

/* Start here: the same card, larger, on moss tint */
.v5-note.is-start { --v5-edge: var(--v3-moss); --v5-tag-ink: var(--v3-moss); margin-bottom: 36px; padding: 30px 32px 30px 38px; background: var(--v3-sage); border-color: #B4CD9F; }
.v5-note.is-start::before { width: 8px; }
.v5-note.is-start .v5-note-title { font-size: clamp(26px, 2.6vw, 32px); line-height: 1.2; }
.v5-note.is-start .v5-note-tag { text-transform: none; }
.v5-note.is-start .v5-note-excerpt { font-family: var(--v3-serif); font-style: italic; font-size: 20px; line-height: 1.45; color: var(--v3-moss); -webkit-line-clamp: 3; }
.v5-note.is-start .v5-note-img { width: 200px; }

.v3-latest-list .v3-more { align-self: flex-start; padding-top: 20px; }

@media (max-width: 560px) {
    .v5-latest-head { padding-bottom: 18px; }
    /* Phones: a small square thumbnail beside the text keeps the list short; Start here keeps a wide image on top */
    .v5-note { gap: 14px; padding: 18px 16px 18px 24px; }
    .v5-note-img { width: 84px; aspect-ratio: 1; }
    .v5-note.is-start { flex-direction: column; padding: 22px 20px 22px 28px; }
    .v5-note.is-start .v5-note-img { order: -1; width: 100%; aspect-ratio: 16 / 9; }
    .v5-note-title { font-size: 21px; }
    .v5-note-excerpt { -webkit-line-clamp: 3; }
}
@media (prefers-reduced-motion: reduce) { .v5-note { transition: none; } }

/* 13. Nested scales: click a card to highlight it
   ------------------------------------------------------------------------- */
.v3-scale-card { position: relative; transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease; }
.v5-scale-toggle {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: var(--v3-ink);
    text-align: left;
    cursor: pointer;
}
/* The title button covers the whole card */
.v5-scale-toggle::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: 4px; }
.v5-scale-toggle:focus-visible { outline: none; }
.v3-scale-card:has(.v5-scale-toggle:focus-visible) { outline: 3px solid var(--v3-scale); outline-offset: 4px; }
.v3-scale-card:hover .v5-scale-toggle { text-decoration: underline; text-decoration-color: var(--v3-scale); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.v3-scale-card.is-selected {
    border-color: var(--v3-scale);
    box-shadow: inset 0 0 0 2px var(--v3-scale), 0 10px 24px rgb(31 42 34 / 0.12);
    transform: translateY(-4px);
}
@media (prefers-reduced-motion: reduce) {
    .v3-scale-card { transition: none; }
    .v3-scale-card.is-selected { transform: none; }
}

/* "Come along" sits straight on the woven ground: no card fill or border */
.v3-events-aside { background: none; border: 0; padding: 0; }

/* 15. About page: intro header in the home page's style, real section headings, rail
   ------------------------------------------------------------------------- */
.v3-about-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 400px);
    align-items: center;
    gap: 40px 64px;
    padding-top: 56px;
    padding-bottom: 48px;
}
.v3-about-intro::after {
    /* the same ink rule that closes the "Latest posts" heading row */
    content: "";
    grid-column: 1 / -1;
    height: 2px;
    margin-top: 8px;
    background: var(--v3-ink);
}
.v3-about-copy { display: flex; flex-direction: column; gap: 22px; max-width: 640px; }
.v3-about-copy .v3-section-lede { margin: 0; font-size: 20px; }
.v3-about-portrait { max-width: none; margin: 0; }
.v3-about-portrait img { aspect-ratio: 4 / 5; border-radius: 4px; box-shadow: 0 2px 18px rgb(31 42 34 / 0.12); }


/* Body: Ghost wraps these headings in <strong>; keep them in the site's regular-weight serif */
.v3-about .gh-content > h2 {
    margin-top: 1.8em;
    padding-top: 28px;
    border-top: 1px solid var(--v3-border);
    font-weight: 400;
    font-size: clamp(30px, 3.2vw, 38px);
    line-height: 1.15;
}
.v3-about .gh-content > h2 strong { font-weight: inherit; }
.v3-about .gh-content > h2:first-child { margin-top: 0; }

/* Subheadings (made by v3.js from bold one-line paragraphs); scale names get a woven band in their colour */
.v3-about .gh-content > .v5-subhead {
    position: relative;
    margin-top: 1.6em;
    margin-bottom: -0.4em;
    font-family: var(--gh-font-heading, serif);
    font-weight: 500;
    font-size: 24px;
    line-height: 1.25;
    color: var(--v3-ink);
}
.v3-about .gh-content > .v5-subhead[data-tag] { padding-left: 18px; }
.v3-about .gh-content > .v5-subhead[data-tag]::before {
    content: "";
    position: absolute;
    top: 0.1em;
    bottom: 0.1em;
    left: 0;
    width: 6px;
    border-radius: 2px;
    background-color: var(--v3-scale);
    background-image: repeating-linear-gradient(0deg, rgb(255 255 255 / 0.4) 0 1px, transparent 1px 3px);
}

@media (max-width: 767px) {
    .v3-about-intro { grid-template-columns: 1fr; gap: 28px; padding-top: 32px; padding-bottom: 32px; }
    .v3-about-portrait { order: -1; }
    .v3-about-portrait img { aspect-ratio: 3 / 2; object-position: 50% 30%; }
    .v3-about-copy .v3-section-lede { font-size: 18px; }
}

/* 16. Home: About the author (between the nested scales and Latest posts)
   ------------------------------------------------------------------------- */
.v5-author {
    display: grid;
    grid-template-columns: minmax(220px, 340px) minmax(0, 1fr);
    align-items: center;
    gap: 40px 64px;
    padding-top: 80px;
    padding-bottom: 24px;
}
.v5-author-photo { margin: 0; }
.v5-author-photo { max-width: 340px; }
.v5-author-photo img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; box-shadow: 0 2px 18px rgb(31 42 34 / 0.12); }
.v5-author-text { display: flex; flex-direction: column; gap: 18px; max-width: 620px; }
.v5-author-text > p:not(.v3-eyebrow) { margin: 0; font-size: 18px; line-height: 1.6; color: var(--v3-body); }
.v5-author-text .v3-actions { margin-top: 6px; }
@media (max-width: 767px) {
    .v5-author { grid-template-columns: 1fr; gap: 28px; padding-top: 56px; }
    .v5-author-photo { max-width: 240px; }
}

/* 17. Floating "next section" arrow (phones only; built by v3.js initSkip). Points up at the end: back to top.
   ------------------------------------------------------------------------- */
.v5-skipnext { display: none; }
@media (max-width: 767px) {
    .v5-skipnext {
        position: fixed;
        right: 16px;
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        z-index: 40;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 52px;
        height: 52px;
        padding: 0;
        border: 0;
        border-radius: 999px;
        background: var(--v3-moss);
        color: var(--v3-white);
        font: 600 16px/1 var(--v3-sans);
        box-shadow: 0 6px 18px rgb(31 42 34 / .22);
        cursor: pointer;
        transition: opacity .2s ease, transform .2s ease, background-color .2s ease;
    }
    .v5-skipnext:active { background: var(--v3-moss-dark); }
    .v5-skipnext:focus-visible { outline: 3px solid var(--v3-ink); outline-offset: 3px; }
    .v5-skipnext-label { display: none; } /* arrow only; the button's aria-label names the destination */
    .v5-skipnext svg { width: 20px; height: 20px; transition: transform .25s ease; }
    .v5-skipnext.is-top svg { transform: rotate(180deg); }
    .v5-skipnext.is-hidden { opacity: 0; transform: translateY(12px); pointer-events: none; }
}
@media (prefers-reduced-motion: reduce) { .v5-skipnext, .v5-skipnext svg { transition: none; } }
@media print { .v5-skipnext { display: none !important; } }

/* 18. Phones: half the space above and below the subscribe card ("The inquiry continues.").
       The space above belongs to whatever comes before it (posts on home, the page body on About), so it is pulled up. */
@media (max-width: 767px) {
    .v3-subscribe { margin-top: -43px; padding-bottom: 50px; }
}

/* 19. Post page: keep the progress strip inside the article, room between the reply line and the subscribe card,
       and "More posts" as the home page's note cards (replacing Source's related-post grid)
   ------------------------------------------------------------------------- */
.v3-article { position: relative; }
.v3-article-end { margin-top: 48px; padding-bottom: 72px; }
.post-template .v3-subscribe { margin-top: 0; padding-bottom: 72px; }
.gh-video-post-embed { margin-top: 8px; }
.gh-video-post-embed .kg-embed-card { margin: 0; }
.gh-video-post-embed iframe { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border: 0; border-radius: 4px; }
.v5-more { padding-bottom: 96px; }
.v5-more .v5-latest-head { margin-bottom: 24px; }
@media (max-width: 767px) {
    .v3-article-end { margin-top: 36px; padding-bottom: 44px; }
    .post-template .v3-subscribe { padding-bottom: 44px; }
    .v5-more { padding-bottom: 64px; }
}

/* 20. Events page: contact links in the page head (the filters and the "Organising something?" card were removed) */
.v5-events-contact { gap: 12px 20px; margin-top: 4px; }
.v5-events-contact .v5-btn-outline svg { flex: none; width: 18px; height: 18px; }
/* Phones: the subscribe card is pulled up 43px (section 18), so the events list keeps its own room above it */
@media (max-width: 767px) { .v3-events-body { padding-bottom: 88px; } }

/* 21. Home invitation band: photo gallery (partials/components/gallery.hbs, v3.js initGallery).
       All photos share one grid cell and cross-fade; hidden ones are visibility: hidden so they aren't read out. */
.v5-gallery { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.v5-gallery-track { display: grid; }
.v5-slide {
    grid-area: 1 / 1;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease, visibility 0s linear 0.6s;
}
.v5-slide.is-on { opacity: 1; visibility: visible; transition: opacity 0.6s ease, visibility 0s; }
.v5-slide img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    object-position: 50% 30%; /* keeps faces in frame on the taller photos */
    border-radius: 4px;
    background: var(--v3-moss-dark);
}
.v5-slide figcaption { font-size: 14px; line-height: 1.45; color: #CFD8C6; text-align: left; }
.v5-gallery-ctl { display: flex; align-items: center; gap: 10px; }
.v5-gallery-ctl[hidden] { display: none; }
.v5-gallery-btn {
    flex: none;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1.5px solid rgb(255 255 255 / 0.45);
    border-radius: 999px;
    background: transparent;
    color: var(--v3-white);
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}
.v5-gallery-btn:hover { border-color: var(--v3-white); background: rgb(255 255 255 / 0.08); }
.v5-gallery-btn:focus-visible { outline: 2px solid var(--v3-white); outline-offset: 3px; }
.v5-gallery-btn[data-gallery="pause"] { margin-right: auto; }
.v5-gallery-btn .v5-icon-play, .v5-gallery-btn.is-paused .v5-icon-pause { display: none; }
.v5-gallery-btn.is-paused .v5-icon-play { display: block; }
.v5-gallery-count { min-width: 3.2em; text-align: center; font-size: 14px; font-variant-numeric: tabular-nums; color: #CFD8C6; }
.v5-gallery:focus-visible { outline: 2px solid var(--v3-white); outline-offset: 6px; border-radius: 4px; }
@media (max-width: 899px) { .v5-slide img { aspect-ratio: 3 / 2; } }
@media (prefers-reduced-motion: reduce) { .v5-slide, .v5-slide.is-on { transition: none; } }

/* 22. About intro: the "Start here" post shown as home's start-here card instead of a button */
.v3-about-copy .v5-note.is-start { margin-bottom: 0; }

/* 23. Home splash: contour lines woven into the ground (v3.js initContours draws them on this canvas, behind the hero) */
.v5-contours { position: absolute; left: 0; top: 0; z-index: -1; pointer-events: none; opacity: 0; transition: opacity 1.4s ease 0.6s; }
.v5-contours.is-on { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .v5-contours { transition: none; } }
@media (prefers-contrast: more) { .v5-contours { display: none; } }

/* 24. Splash: outlined buttons get the paper fill (like the scale buttons) so the weave and contour lines don't show through */
.v3-hero .v5-btn-outline,
.v3-hero .v5-pause { background-color: var(--v3-paper); }
.v3-hero .v5-btn-outline:hover { background-color: var(--v3-moss); }
/* "Get new posts by email" is an outlined button at every width (phones already stack it full width, section 9) */
.v3-hero .v3-actions .v3-arrow {
    min-height: 48px;
    padding: 0 22px;
    border: 1.5px solid var(--v3-moss);
    border-radius: 999px;
    background-color: var(--v3-paper);
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.v3-hero .v3-actions .v3-arrow:hover { background-color: var(--v3-moss); color: var(--v3-white); }

/* 25. Home post cards and the "Come along" column
   ------------------------------------------------------------------------- */
/* A patch of the splash's contour thread woven into each post card, in the card's scale colour, fading out before the text.
   assets/images/contours-woven.png is the contour map already cut into weave floats (black = thread), used as a mask. */
.v5-note { isolation: isolate; }
.v5-note::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: 4px;
    pointer-events: none;
    background-color: var(--v5-edge);
    opacity: 0.22;
    -webkit-mask-image: url("../images/contours-woven.png"), linear-gradient(to right, transparent 30%, #000 75%);
    mask-image: url("../images/contours-woven.png"), linear-gradient(to right, transparent 30%, #000 75%);
    -webkit-mask-size: 1280px 720px, 100% 100%;
    mask-size: 1280px 720px, 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: var(--v5-patch, -420px -200px), 0 0;
    mask-position: var(--v5-patch, -420px -200px), 0 0;
    -webkit-mask-composite: source-in;
    mask-composite: intersect;
    transition: opacity 0.3s ease;
}
.v5-note:hover::after { opacity: 0.4; }
.v5-note-text { position: relative; z-index: 1; }
/* each card gets a different stretch of the map */
.v5-note.is-start { --v5-patch: -300px -170px; }
.v5-note-list > .v5-note:nth-child(4n+1) { --v5-patch: -560px -470px; }
.v5-note-list > .v5-note:nth-child(4n+2) { --v5-patch: -120px -470px; }
.v5-note-list > .v5-note:nth-child(4n+3) { --v5-patch: -620px -230px; }
.v5-note-list > .v5-note:nth-child(4n+4) { --v5-patch: -260px -560px; }
.v5-note.is-start::after { opacity: 0.28; }
.v5-note.is-start:hover::after { opacity: 0.45; }

/* Video posts: a round play mark on the thumbnail */
.v5-play {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border-radius: 50%;
    background: rgb(31 42 34 / 0.72) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M5 3.2v9.6L12.8 8z' fill='%23fff'/%3E%3C/svg%3E") 55% 50% / 16px 16px no-repeat;
    box-shadow: 0 0 0 2px rgb(255 255 255 / 0.85);
    transition: transform 0.2s ease;
}
.v5-note:hover .v5-play { transform: scale(1.08); }
.v5-note.is-start .v5-play { width: 52px; height: 52px; margin: -26px 0 0 -26px; background-size: 20px 20px; }

/* "Come along": "All events" is an outlined button */
.v5-events-all { align-self: flex-start; }
.v3-events-empty { font-size: 16px; }

@media (prefers-reduced-motion: reduce) { .v5-note::after, .v5-play { transition: none; } }
@media (prefers-contrast: more) { .v5-note::after { display: none; } }

/* ---------- 26. All posts page (posts.hbs, route /posts/) ---------- */
.v5-posts-body { padding-bottom: clamp(48px, 8vw, 96px); }
.v5-posts-body .v5-note-list { max-width: 820px; }
.v5-posts-body > p { margin-top: 28px; }

/* ---------- 27. Graceful highlights: buttons ease in their colour and rise slightly; text links fade their underline in;
   the hero diagram's rings and link ease between scales instead of snapping ---------- */
:root { --v5-ease: cubic-bezier(0.25, 0.6, 0.3, 1); }

.v3-btn, .gh-button, .v5-btn-outline, .v3-scale-btn, .v5-pause, .gh-icon-button,
.v3-hero .v3-actions .v3-arrow, .v3-hero .v5-btn-outline {
    transition: background-color 0.35s var(--v5-ease), color 0.35s var(--v5-ease), border-color 0.35s var(--v5-ease),
                box-shadow 0.35s var(--v5-ease), transform 0.35s var(--v5-ease), opacity 0.2s ease;
}
.v3-btn:hover, .gh-button:hover, .v5-btn-outline:hover, .v3-scale-btn:hover,
.v3-hero .v3-actions .v3-arrow:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px -8px rgba(31, 42, 34, 0.45);
}
.v3-btn:active, .gh-button:active, .v5-btn-outline:active, .v3-scale-btn:active,
.v3-hero .v3-actions .v3-arrow:active { transform: translateY(0); box-shadow: none; transition-duration: 0.1s; }

/* Text links: the underline fades in rather than appearing */
.v3-arrow, .gh-navigation .nav a {
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 4px;
    transition: color 0.3s var(--v5-ease), text-decoration-color 0.3s var(--v5-ease);
}
.v3-arrow:hover, .gh-navigation .nav a:hover { text-decoration-color: currentColor; }
.v3-arrow span { transition: transform 0.3s var(--v5-ease); }
.v3-hero .v3-actions .v3-arrow, .v3-hero .v3-actions .v3-arrow:hover { text-decoration-color: transparent; }
.gh-navigation .nav .nav-current a { text-decoration-color: var(--v3-clay); text-underline-offset: 6px; }

/* Hero diagram: rings dim, brighten and thicken slowly; the link under it fades between scales (v3.js setLink) */
.v3-ring { transition: opacity 0.6s var(--v5-ease); }
.v3-ring circle { transition: stroke-width 0.6s var(--v5-ease); }
.v5-diagram-link .v5-btn-outline.is-swapping { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
    .v3-btn, .gh-button, .v5-btn-outline, .v3-scale-btn, .v5-pause, .gh-icon-button,
    .v3-hero .v3-actions .v3-arrow, .v3-hero .v5-btn-outline, .v3-arrow, .v3-arrow span, .gh-navigation .nav a,
    .v3-ring, .v3-ring circle { transition: none; }
    .v3-btn:hover, .gh-button:hover, .v5-btn-outline:hover, .v3-scale-btn:hover,
    .v3-hero .v3-actions .v3-arrow:hover { transform: none; }
}

/* ---------- 28. Splash subtitle on plain paper, so the weave and contour lines don't sit behind the text ---------- */
.v3-hero .v3-hero-lede {
    width: fit-content;
    max-width: 100%;
    margin-left: -10px;
    padding: 4px 10px;
    border-radius: 4px;
    background-color: var(--v3-paper);
}

/* ---------- 29. Phone menu extras: "Latest posts" and "Subscribe" continue the navigation list (the ul also has
   Source's .nav class, so it takes the same link style) ---------- */
.gh-navigation .v5-nav-mobile { display: none; }
@media (max-width: 767px) {
    .is-open#gh-navigation .gh-navigation-menu .v5-nav-mobile { display: flex; margin-top: -20px; }
    .is-open#gh-navigation .gh-navigation-menu .nav:has(+ .v5-nav-mobile) li:last-child a { border-bottom: 1px solid var(--color-border); }
    .is-open#gh-navigation .gh-navigation-menu .v5-nav-mobile a.v5-nav-subscribe {
        display: flex; align-items: center; justify-content: center; min-height: 44px; margin-top: 12px; padding: 0 28px;
        border: 0; border-radius: 999px; background: var(--v3-moss); color: #fff !important; font-weight: 600; text-decoration: none;
    }
}

/* ---------- 30. Subscribe card: one button that opens Ghost's sign-up popup (no email field on the card) ---------- */
.v5-subscribe-action { flex: 0 0 auto; }
.v5-subscribe-action .v3-btn { min-height: 52px; padding: 0 36px; }
@media (max-width: 767px) {
    .v5-subscribe-action { flex: 1 1 100%; }
    .v5-subscribe-action .v3-btn { width: 100%; justify-content: center; }
}
