:root {
    --color-brand: #1ca97f;
    --color-brand-accent: #dbf793;
    --color-brand-dark: #127a5a;
    --color-text: #222;
    --color-text-muted: #333;
    --color-text-subtle: #666;
    --color-surface: #fff;
    --color-surface-muted: #efefef;
    --font-display: "Special Elite", "Courier New", monospace;
}

@font-face {
    font-family: "Special Elite";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("fonts/special-elite-v20-latin-regular.woff2") format("woff2");
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
    font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--color-text);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

a {
    color: var(--color-brand-dark);
}

a:hover {
    filter: brightness(85%);
}

/* Banner */

.banner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    background: var(--color-brand);
    color: var(--color-brand-accent);
    padding: 0.5rem 0.75rem;
}

@media (min-width: 48rem) {
    .banner {
        flex-direction: row;
        justify-content: space-between;
        padding: 0.5rem 1.25rem 0.5rem 0.75rem;
    }
}

.banner a {
    color: var(--color-brand-accent);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
}

.brand:hover {
    filter: none;
}

.logo {
    height: 44px;
    width: 44px;
    border-radius: 8px;
    display: block;
}

.brand-name {
    font-family: var(--font-display);
    font-size: 1.4rem;
    line-height: 1;
    margin-top: 0.2rem;
    color: var(--color-brand-accent);
}

.nav-links {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.nav-button {
    -webkit-appearance: none;
    appearance: none;
    display: inline-flex;
    align-items: center;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1;
    background: none;
    color: var(--color-brand-accent);
    text-decoration: none;
    white-space: nowrap;
    padding: 0.65rem 0.9rem 0.35rem;
    border: 1px solid var(--color-brand-accent);
    border-radius: 6px;
}

.nav-button:hover {
    background: var(--color-brand-accent);
    color: var(--color-brand-dark);
    cursor: pointer;
}

.nav-button:focus-visible {
    outline: 2px solid var(--color-brand-accent);
    outline-offset: 2px;
}

@media (max-width: 480px) {
    .nav-links {
        gap: 0.35rem;
    }

    .nav-button {
        font-size: 0.94rem;
        padding: 0.5rem 0.6rem 0.3rem;
    }

    .intro {
        padding: 0.5rem 2.25rem 0.4rem;
    }

    .intro p {
        font-size: 1rem;
    }
}

/* Layout */

main {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

iframe {
    display: block;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    border: none;
}

/* Intro */

.intro {
    position: relative;
    box-sizing: border-box;
    background: var(--color-surface-muted);
    width: 100%;
    flex: 0 0 auto;
    margin: 0 auto;
    padding: 0.5rem 2.5rem;
    text-align: center;
}

.intro p {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--color-text-muted);
}

.intro-toggle {
    position: absolute;
    top: 50%;
    right: 0.5rem;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 0.4rem;
    line-height: 0;
    cursor: pointer;
}

.intro-toggle:hover,
.intro-toggle:focus-visible {
    border-color: var(--color-brand-dark);
}

.intro-toggle-icon {
    display: block;
    transition: transform 0.2s ease;
}

.intro--collapsed .intro-toggle-icon {
    transform: rotate(180deg);
}

.intro--collapsed p {
    display: none;
}

.intro a {
    color: var(--color-brand-dark);
}

/* About modal */

.modal-overlay[hidden] {
    display: none;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    padding: 1rem;
}

.modal {
    position: relative;
    box-sizing: border-box;
    max-width: 32rem;
    width: 100%;
    max-height: calc(100% - 2rem);
    overflow-y: auto;
    background: var(--color-surface);
    border-radius: 8px;
    padding: 1.5rem 2rem;
}

@media (min-width: 640px) {
    .modal {
        max-width: 42rem;
    }
}

.modal h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--color-brand-dark);
    margin-top: 0;
}

.modal .modal-subheading {
    font-family: var(--font-display);
    color: var(--color-brand-dark);
    font-size: 1.25rem;
    margin: 2rem 0 1.175em 0;
}

.modal p {
    color: var(--color-text-muted);
    font-size: 1rem;
    line-height: 1.4;
}

.modal .modal-attribution {
    font-size: 0.8rem;
    color: var(--color-text-subtle);
}

.modal blockquote {
    font-style: italic;
    color: var(--color-text-subtle);
    font-size: 1rem;
    margin: 1rem 0 1.6rem 1rem;
    padding-left: 1rem;
    border-left: 3px solid var(--color-brand-dark);
}

.modal-callout {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin: 1rem 0;
}

.modal-callout-icon {
    flex-shrink: 0;
    color: var(--color-brand-dark);
}

.modal .modal-callout p {
    margin: 0;
    color: var(--color-brand-dark);
}

.modal-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: none;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--color-text-muted);
    cursor: pointer;
}

.modal-close:hover,
.modal-close:focus-visible {
    border-color: var(--color-brand-dark);
}

.modal-button {
    -webkit-appearance: none;
    appearance: none;
    display: inline-flex;
    align-items: center;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1;
    background: none;
    color: var(--color-brand-dark);
    text-decoration: none;
    white-space: nowrap;
    padding: 0.65rem 0.9rem 0.35rem;
    border: 1px solid var(--color-brand-dark);
    border-radius: 6px;
}

.modal-button:hover,
.modal-button:focus-visible {
    background: var(--color-brand-dark);
    color: var(--color-surface);
    cursor: pointer;
}

/* Share modal */

.modal.modal--compact {
    max-width: 24rem;
}

.share-links {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
}

.share-links .modal-button {
    box-sizing: border-box;
    justify-content: center;
    width: 100%;
}

/* A lone item on the last row spans both columns but keeps one column's width, centered */
.share-links li:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    justify-self: center;
    width: calc(50% - 0.25rem);
}

.modal .share-copy-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    box-sizing: border-box;
    min-height: 2.25rem;
    margin: 0.75rem 0 0;
    padding: 0.4rem 0.75rem;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 0.9rem;
    line-height: 1.3;
    text-align: center;
    overflow-wrap: anywhere;
}

.modal .share-copy-status.is-success {
    background: var(--color-brand-accent);
    border-color: var(--color-brand);
    color: var(--color-brand-dark);
    font-weight: 600;
}

.modal .share-copy-status.is-success::before {
    content: "\2713";
    font-weight: 700;
}

.modal .share-copy-status.is-error {
    background: var(--color-surface-muted);
    border-color: var(--color-text-subtle);
    color: var(--color-text);
}

@media (prefers-reduced-motion: no-preference) {
    .modal .share-copy-status.is-success,
    .modal .share-copy-status.is-error {
        animation: share-status-in 0.2s ease-out;
    }
}

@keyframes share-status-in {
    from {
        opacity: 0;
        transform: translateY(-0.25rem);
    }
}
@media (max-width: 480px) {
    .modal p,
    .modal blockquote {
        font-size: 1.04rem;
    }
}