/* The gallery's look: Zapli's ultramarine sheet on a light lavender-white ground, and a dark theme. */

:root {
    color-scheme: light dark;

    --sheet: #3b37d9;
    --on-sheet: #ffffff;
    --on-sheet-2: #e7e6ff;
    --sheet-chip: rgba(255, 255, 255, 0.16);

    --ground: #f6f6ff;
    --surface: #ffffff;
    --surface-2: #efeefb;
    --text: #1b1b24;
    --text-2: #4b4a5c;
    --line: #dcdbea;
    --line-strong: #bdbbdc;

    --accent: #3b37d9;
    --accent-hover: #2d29bd;
    --on-accent: #ffffff;
    --link: #3430c4;
    --chip: #e9e8ff;
    --on-chip: #2b28a6;
    --ok: #1d7a46;
    --focus: #3b37d9;

    --keyline: #ffffff;
    --lift: rgba(32, 0, 150, 0.38);
    --card-shadow: 0 1px 2px rgba(27, 27, 60, 0.06), 0 4px 16px rgba(27, 27, 60, 0.05);

    --radius-card: 20px;
    --radius-small: 12px;
    --gutter: 16px;
    --font:
        system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial,
        sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --sheet: #20237e;
        --on-sheet: #ffffff;
        --on-sheet-2: #d4d3fb;
        --sheet-chip: rgba(255, 255, 255, 0.12);

        --ground: #17171f;
        --surface: #1f1f29;
        --surface-2: #2a2a36;
        --text: #e6e5f0;
        --text-2: #c3c2d6;
        --line: #383748;
        --line-strong: #555470;

        --accent: #c2c1ff;
        --accent-hover: #d8d7ff;
        --on-accent: #17155c;
        --link: #c2c1ff;
        --chip: #2f2e52;
        --on-chip: #dddcff;
        --ok: #7fd8a2;
        --focus: #c2c1ff;

        --keyline: #f3f2fe;
        --lift: rgba(0, 0, 0, 0.6);
        --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    }
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--ground);
    color: var(--text);
    font: 1rem/1.55 var(--font);
    overflow-wrap: break-word;
}

img {
    max-width: 100%;
}

a {
    color: var(--link);
    text-underline-offset: 0.15em;
}

a:hover {
    text-decoration-thickness: 2px;
}

:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
    border-radius: 4px;
}

main:focus,
h1:focus {
    outline: none;
}

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

.skip {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 10;
    padding: 12px 16px;
    border-radius: var(--radius-small);
    background: var(--surface);
    color: var(--link);
    font-weight: 600;
    transform: translateY(-200%);
}

.skip:focus {
    transform: none;
}

.wrap {
    width: 100%;
    max-width: 72rem;
    margin: 0 auto;
    padding-left: max(var(--gutter), env(safe-area-inset-left));
    padding-right: max(var(--gutter), env(safe-area-inset-right));
}

/* ---- the sheet: the bar and the introduction ---- */

.sheet {
    background: var(--sheet);
    color: var(--on-sheet);
    padding-top: env(safe-area-inset-top);
}

.sheet a {
    color: var(--on-sheet);
}

.sheet :focus-visible {
    outline-color: var(--on-sheet);
}

.bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 64px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    font-weight: 700;
    font-size: 1.05rem;
    text-decoration: none;
}

.brand-mark {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    background: var(--keyline);
    box-shadow: 0 3px 0 var(--lift);
    position: relative;
}

.brand-mark::after {
    content: "";
    position: absolute;
    inset: 8px;
    border-radius: 3px;
    background: var(--sheet);
}

.bar-link {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 0 4px;
    font-weight: 600;
}

.hero {
    padding: 16px 0 36px;
}

.hero h1 {
    margin: 0 0 12px;
    font-size: clamp(2rem, 7vw, 3.25rem);
    line-height: 1.1;
    letter-spacing: -0.01em;
}

.lead {
    max-width: 40rem;
    margin: 0 0 20px;
    font-size: 1.15rem;
    color: var(--on-sheet-2);
}

.facts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 24px;
    padding: 0;
    list-style: none;
}

.facts li {
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--sheet-chip);
    font-size: 0.9rem;
    font-weight: 600;
}

/* The link to the guide for making your own app. */
.hero-more {
    margin: -12px 0 16px;
}

.hero-more a {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    font-weight: 600;
}

.stickers {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.stickers:empty {
    display: none;
}

/* ---- stickers: a tool's icon with a white keyline and a lift below, as Zapli draws it ---- */

.sticker {
    flex: none;
    display: block;
    border: 3px solid var(--keyline);
    border-radius: 30%;
    background: var(--surface-2);
    box-shadow: 0 4px 0 var(--lift);
}

.card .sticker,
.detail .sticker {
    box-shadow:
        0 0 0 1px var(--line),
        0 4px 0 var(--lift);
}

.sticker-small {
    width: 44px;
    height: 44px;
    border-width: 2px;
}

.stickers .sticker:nth-child(3n + 1) {
    transform: rotate(-4deg);
}

.stickers .sticker:nth-child(3n + 2) {
    transform: rotate(3deg);
}

.sticker-medium {
    width: 60px;
    height: 60px;
}

.sticker-large {
    width: 96px;
    height: 96px;
    border-width: 4px;
}

.sticker-initial {
    display: grid;
    place-items: center;
    background: var(--sheet);
    color: var(--on-sheet);
    font-weight: 700;
    font-size: 1.4rem;
}

.sticker-large.sticker-initial {
    font-size: 2.4rem;
}

/* ---- the list ---- */

main {
    padding-top: 8px;
    padding-bottom: 48px;
}

.status {
    margin: 32px 0;
    color: var(--text-2);
}

.problem {
    margin: 32px 0;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    background: var(--surface);
}

.problem h2 {
    margin: 0 0 8px;
    font-size: 1.25rem;
}

.problem-detail {
    margin-bottom: 0;
    color: var(--text-2);
    font-size: 0.875rem;
}

.group {
    margin-top: 32px;
}

.group h2 {
    margin: 0 0 4px;
    font-size: clamp(1.35rem, 4.5vw, 1.75rem);
    line-height: 1.25;
}

.group-intro {
    max-width: 44rem;
    margin: 0 0 16px;
    color: var(--text-2);
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cards > li {
    display: flex;
    min-width: 0;
}

.card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    background: var(--surface);
    box-shadow: var(--card-shadow);
}

.card-head {
    display: flex;
    align-items: center;
    gap: 14px;
}

.card-title {
    min-width: 0;
}

.card h3 {
    margin: 0 0 4px;
    font-size: 1.25rem;
    line-height: 1.25;
}

.meta {
    margin: 0;
    color: var(--text-2);
    font-size: 0.875rem;
}

.meta + .meta {
    margin-top: 4px;
}

.chip {
    display: inline-block;
    padding: 1px 10px;
    border-radius: 999px;
    background: var(--chip);
    color: var(--on-chip);
    font-weight: 600;
}

.summary {
    margin: 0;
}

.card-foot {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto;
    padding-top: 4px;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}

.actions .button {
    flex: 1 1 auto;
}

.actions .runs-in + .button-quiet {
    flex: 0 0 auto;
}

.note {
    margin: 0;
    color: var(--text-2);
    font-size: 0.875rem;
}

.runs-in {
    display: inline-flex;
    flex: 1 1 auto;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    margin: 0;
    font-weight: 600;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--ok);
    flex: none;
}

.button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 10px 20px;
    border-radius: var(--radius-small);
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 650;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.button:hover {
    background: var(--accent-hover);
}

.button-quiet {
    background: transparent;
    color: var(--link);
    box-shadow: inset 0 0 0 1px var(--line-strong);
}

.button-quiet:hover {
    background: var(--surface-2);
}

.button-large {
    min-height: 52px;
    font-size: 1.05rem;
}

/* ---- screenshots: a strip that scrolls inside its card, never the page ---- */

.shots {
    /* Positioned, so the text only screen readers hear stays inside the strip and never widens the page. */
    position: relative;
    margin: 0 -16px;
    padding: 4px 16px 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
}

.shots:focus-visible {
    outline-offset: -3px;
    border-radius: var(--radius-small);
}

.shots-list {
    display: flex;
    gap: 10px;
    width: max-content;
    margin: 0;
    padding: 0;
    list-style: none;
}

.shots-list li {
    scroll-snap-align: start;
}

.shots img {
    display: block;
    width: 96px;
    height: auto;
    aspect-ratio: 9 / 20;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: var(--radius-small);
    background: var(--surface-2);
}

.shots-large {
    margin: 0 calc(-1 * var(--gutter));
    padding: 4px var(--gutter) 12px;
}

.shots-large figure {
    width: 168px;
    margin: 0;
}

.shots-large img {
    width: 168px;
}

.shots-large figcaption {
    margin-top: 8px;
    color: var(--text-2);
    font-size: 0.8125rem;
    line-height: 1.4;
}

.shot-link {
    position: relative;
    display: block;
    border-radius: var(--radius-small);
}

/* ---- a tool's detail view ---- */

.detail {
    max-width: 46rem;
    padding-top: 8px;
}

.back {
    margin: 8px 0 16px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 48px;
    font-weight: 600;
}

.detail-head {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
}

.detail-head h1 {
    margin: 4px 0 2px;
    font-size: clamp(1.75rem, 6vw, 2.5rem);
    line-height: 1.15;
}

.kind {
    margin: 0 0 8px;
    color: var(--text-2);
    font-weight: 600;
}

.detail-summary {
    margin: 0;
    font-size: 1.1rem;
}

.detail-action {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin: 0 0 20px;
}

.detail-action.tile {
    padding: 12px 16px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    background: var(--surface);
}

.facts-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 8.5rem), 1fr));
    gap: 12px;
    margin: 0 0 8px;
}

.facts-list div {
    padding: 10px 14px;
    border-radius: var(--radius-small);
    background: var(--surface-2);
}

.facts-list dt {
    color: var(--text-2);
    font-size: 0.8125rem;
}

.facts-list dd {
    margin: 0;
    font-weight: 600;
}

.detail h2 {
    margin: 32px 0 12px;
    font-size: 1.4rem;
    line-height: 1.25;
}

.description h3 {
    margin: 24px 0 8px;
    font-size: 1.15rem;
    line-height: 1.3;
}

.description p {
    margin: 0 0 12px;
}

.description ul {
    margin: 0 0 12px;
    padding-left: 1.25rem;
}

.description li {
    margin: 0 0 8px;
}

.description li::marker {
    color: var(--accent);
}

.source {
    margin: 32px 0 0;
}

/* ---- the footer ---- */

.footer {
    border-top: 1px solid var(--line);
    padding: 24px 0 calc(32px + env(safe-area-inset-bottom));
    color: var(--text-2);
    font-size: 0.9375rem;
}

.footer p {
    max-width: 44rem;
    margin: 0 0 8px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0 24px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-links a {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition: none !important;
        animation: none !important;
        scroll-behavior: auto !important;
    }
}
