/* ==========================================================================
   KataLog: every project on one page (Pages/Projects.cshtml).
   The apps by family as compact cards, then the websites with a browser window each.
   Built on the binder's paper, ink and tones (binder.css); filters are added by js/projects.js.
   ========================================================================== */

.tone--web { --tone: var(--warn); --tone-ink: var(--warn); }

.dossier.projects {
    max-width: 1180px;
}

.projects__head {
    margin: 8px 0 28px;
}

.projects__title {
    margin-top: 0.5em;
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.05;
}

.projects__lead {
    max-width: 52ch;
    margin-top: 0.6em;
    color: var(--ink-soft);
    font-size: 1.05rem;
}

/* --- Filters: one chip per family, the pressed one filled with its tone ------- */
.projects__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 22px;
}

.projects__filters[hidden] { display: none; }

.projects__filter {
    padding: 0.5em 0.95em;
    border: 1.5px solid var(--tone, var(--ink));
    border-radius: 999px;
    background: transparent;
    color: var(--tone-ink, var(--ink));
    font: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 150ms, color 150ms;
}

.projects__filter[aria-pressed="true"] {
    background: var(--tone, var(--ink));
    color: var(--paper);
}

.projects__filter:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* --- Groups --------------------------------------------------------------- */
.projects__group {
    margin-top: 36px;
}

.projects__group[hidden] { display: none; }

.projects__family {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--tone);
    color: var(--tone-ink);
    font-family: var(--mono);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.projects__count {
    padding: 0.1em 0.55em;
    border-radius: 999px;
    background: color-mix(in srgb, var(--tone) 14%, transparent);
    letter-spacing: 0;
}

.projects__group-lead {
    margin-top: 12px;
    color: var(--ink-soft);
}

/* --- An app: icon, name, category, one line, platforms ----------------------- */
.projects__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(16.5rem, 1fr));
    gap: 14px;
    margin-top: 16px;
    padding: 0;
    list-style: none;
}

.project {
    display: flex;
    gap: 14px;
    height: 100%;
    padding: 16px;
    color: var(--ink);
    text-decoration: none;
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    transition: transform 160ms var(--ease), box-shadow 160ms, border-color 160ms;
}

.project:hover,
.project:focus-visible {
    border-color: var(--primary);
    box-shadow: var(--shadow-lift);
    transform: translateY(-2px);
}

.project:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.project__icon {
    flex: none;
    width: 56px;
    height: 56px;
    border-radius: 22%;
    box-shadow: 0 0 0 1px var(--rule);
}

.project__body {
    display: grid;
    align-content: start;
    gap: 3px;
    min-width: 0;
}

.project__name {
    font-size: 1.02rem;
    font-weight: 750;
    letter-spacing: -0.01em;
}

.project__category {
    color: var(--primary);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.project__tagline {
    color: var(--ink-soft);
    font-size: 0.88rem;
    line-height: 1.4;
}

.project__meta {
    margin-top: 4px;
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 0.72rem;
}

/* --- A website: the home page in a browser window, then its words ------------ */
.projects__works {
    display: grid;
    /* Two windows side by side on a desk, one under the other on a phone */
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 30rem), 1fr));
    gap: 28px;
    margin-top: 18px;
    padding: 0;
    list-style: none;
}

.work {
    display: grid;
    align-content: start;
    gap: 14px;
}

.work__window {
    display: block;
    text-decoration: none;
    overflow: hidden;
    background: #FFFFFF;
    border-radius: 10px;
    box-shadow: 0 0.5em 1.4em rgb(17 24 39 / 0.18), 0 0 0 1px rgb(17 24 39 / 0.08);
    transition: transform 200ms var(--ease), box-shadow 200ms;
}

.work__window:hover {
    transform: translateY(-3px);
    box-shadow: 0 1em 2em rgb(17 24 39 / 0.25), 0 0 0 1px rgb(17 24 39 / 0.08);
}

.work__bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    color: #4B5563;
    background: #E5E7EB;
    font-size: 0.72rem;
}

/* Three window buttons drawn with the shadows of one dot */
.work__dots {
    flex: none;
    width: 9px;
    height: 9px;
    margin-right: 22px;
    background: #F87171;
    border-radius: 50%;
    box-shadow: 14px 0 0 #FBBF24, 28px 0 0 #34D399;
}

.work__host {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    padding: 2px 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: #FFFFFF;
    border-radius: 6px;
}

.work__window img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    object-position: top;
}

.work__body {
    display: grid;
    justify-items: start;
    gap: 6px;
}

.work__name {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.work__tagline {
    margin-bottom: 6px;
    color: var(--ink-soft);
}

.projects__binder {
    margin-top: 44px;
    text-align: center;
}

@media (prefers-reduced-motion: reduce) {
    .project, .work__window { transition: none; }
}
