.back-to-projects {
    display: inline-block;
    margin-top: 1.5rem;
}

/* The download, as a sticker card like Serum's name card */
.get-it {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    max-width: 600px;
    margin: 0 auto 3rem;
    padding: 1.25rem 1.5rem;
    background: var(--card);
    border: var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transform: rotate(-0.6deg);
}

.file-mark {
    flex: none;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--sun);
    border: var(--border);
    font-size: 1.2rem;
    color: var(--ink);
}

.get-it h2 {
    text-align: left;
    font-size: 1.3rem;
    padding: 0;
    margin: 0 0 0.25rem;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    letter-spacing: 0;
}

.get-it p {
    margin: 0 0 0.9rem;
    color: var(--ink-soft);
}

/* The download button: a pill with the hard sticker shadow */
a.download {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    padding: 0.5rem 1.1rem;
    border: var(--border);
    border-radius: 999px;
    box-shadow: 3px 3px 0 var(--shadow-ink);
    transition: transform 0.2s, box-shadow 0.2s;
}

a.download::after {
    display: none;
}

a.download:hover,
a.download:focus-visible {
    color: #fff;
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 var(--shadow-ink);
}

.intro {
    max-width: 680px;
    margin: 0 auto 2rem;
    font-size: 1.05rem;
}

.intro p {
    margin-bottom: 1rem;
    text-wrap: pretty;
}

/* Jump links to the four groups */
.groups {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    max-width: 760px;
    margin: 0 auto 1rem;
}

.groups a {
    color: var(--ink);
    font-weight: 500;
    font-size: 0.95rem;
    background: var(--card);
    border: var(--border);
    border-radius: 999px;
    padding: 0.25rem 0.9rem;
}

.groups a::after {
    display: none;
}

.groups a:hover,
.groups a:focus-visible {
    color: var(--accent);
}

/* Each group of rules has its own colour, set on the section as --c */
.group {
    max-width: 760px;
    margin: 4rem auto 0;
}

.group > h2 {
    padding-bottom: 0;
}

.group-lede {
    text-align: center;
    color: var(--ink-soft);
    margin-bottom: 2rem;
}

.rules {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.rule {
    position: relative;
    padding: 1.4rem 1.5rem 1.5rem 4.6rem;
    background: var(--card);
    border: var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transform: rotate(-0.25deg);
}

.rule:nth-child(even) {
    transform: rotate(0.25deg);
}

.rule::before {
    content: attr(data-n);
    position: absolute;
    left: 1.2rem;
    top: 1.25rem;
    display: grid;
    place-items: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    background: var(--c);
    border: var(--border);
    color: var(--ink);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.1rem;
    font-variant-numeric: tabular-nums;
}

/* The blue badge needs light text */
.group[data-colour="0"] .rule::before {
    color: #fff;
}

/* A paragraph written below a group's last rule */
.group-after {
    text-align: center;
    color: var(--ink-soft);
    margin-top: 1.5rem;
}

/* Shown only until voice.js has built the rules, or if it can't */
.rules-fallback {
    text-align: center;
    margin: 2rem 0;
}

/* A section of VOICE.md that has no rules and no bold opening */
.prose {
    max-width: 680px;
    margin: 4rem auto 0;
    text-align: center;
}

.prose p {
    color: var(--ink-soft);
    text-wrap: balance;
}

.rule h3 {
    font-size: 1.25rem;
    line-height: 1.3;
    margin: 0.3rem 0 0.4rem;
    text-wrap: balance;
}

.rule p {
    color: var(--ink-soft);
    margin-bottom: 0.5rem;
    text-wrap: pretty;
}

.rule p.tr {
    color: var(--ink);
}

.tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: var(--sun);
    color: var(--ink);
    border: 1.5px solid var(--outline);
    border-radius: 999px;
    padding: 0 0.55rem;
    margin-right: 0.3rem;
    vertical-align: 0.1em;
}

/* Before and after, set like strings in the product */
.pair {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.45rem 0.9rem;
    align-items: baseline;
    margin: 0.9rem 0 0;
    padding: 0.85rem 1rem;
    background: var(--paper);
    border-radius: 10px;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

.pair dt {
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.pair dt.was {
    color: #b0305a;
}

.pair dt.now {
    color: #0f7354;
}

.pair dd {
    margin: 0;
    color: var(--ink);
    overflow-wrap: anywhere;
}


/* The last rule, as the loudest sticker on the page */
.aloud {
    max-width: 600px;
    margin: 4.5rem auto 0;
    padding: 1.5rem 1.75rem;
    background: var(--pink);
    border: var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transform: rotate(0.8deg);
    text-align: center;
}

.aloud h2 {
    padding: 0 0 0.25rem;
    font-size: 2rem;
}

.aloud p {
    margin: 0;
    font-size: 1.1rem;
    text-wrap: balance;
}

.closing {
    max-width: 680px;
    margin: 2.5rem auto 3rem;
    text-align: center;
}

.closing p {
    color: var(--ink-soft);
    margin-bottom: 1rem;
    text-wrap: balance;
}

@media (max-width: 600px) {
    .get-it {
        flex-direction: column;
        gap: 0.75rem;
    }

    .rule {
        padding: 4rem 1.1rem 1.2rem;
    }

    .rule::before {
        left: 1.1rem;
        top: 1.1rem;
    }

    .pair {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.1rem;
    }

    .pair dd + dt {
        margin-top: 0.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    a.download {
        transition: none;
    }
}
