/* =============================================================================
   SitePilot demo template — catalogue page

   Styles only design.html. Unlike designer.css, this page IS part of the demo
   site, so it uses the theme tokens throughout: the catalogue has to repaint
   with the scheme, otherwise a client is comparing animations against colours
   they have already rejected.
   ========================================================================== */

.spec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }

.spec {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* The stage is a fixed-height box so every specimen plays in the same space
   and the grid does not reflow as things move. A tile that resized while its
   animation ran would make two effects impossible to compare. */
.spec-stage {
    height: 128px;
    display: grid;
    place-items: center;
    background: var(--surface-alt);
    border-bottom: 1px solid var(--line);
    overflow: hidden;
    perspective: 900px;
}
.spec-block {
    width: 132px;
    padding: 16px 14px;
    border-radius: var(--radius);
    background: var(--brand);
    color: var(--on-brand);
    font-size: .82rem;
    text-align: center;
    line-height: 1.3;
    box-shadow: 0 6px 18px var(--brand-ring);
}

.spec-body { padding: 14px 15px 15px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.spec-body h3 { margin: 0; font-family: var(--sans); font-size: .95rem; font-weight: 600; color: var(--ink); }
.spec-body p { margin: 0; font-size: .82rem; color: var(--ink-soft); flex: 1; }
.spec-key {
    font: 400 .72rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: var(--ink-soft);
    opacity: .75;
}
.spec-actions { display: flex; gap: 7px; margin-top: 10px; }

/* Small controls, distinct from the site's .btn so they do not compete with
   the button-hover specimens sitting next to them. */
.mini {
    font: inherit;
    font-size: .78rem;
    padding: 6px 11px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
}
.mini:hover { border-color: var(--brand); color: var(--brand); }
.mini[aria-pressed="true"], .mini.on {
    background: var(--brand);
    border-color: var(--brand);
    color: var(--on-brand);
}

.bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 26px; }
.bar .spacer { flex: 1; }

/* --- palette ------------------------------------------------------------- */

.swatches { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 12px; }
.swatch {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
}
.swatch .chip { height: 56px; }
.swatch .meta { padding: 9px 11px; }
.swatch .meta strong { display: block; font-size: .82rem; font-weight: 600; color: var(--ink); }
.swatch .meta code {
    font: 400 .74rem/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: var(--ink-soft);
}

.preset-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.preset-card {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
    font: inherit;
    color: var(--ink);
    text-align: left;
}
.preset-card:hover { border-color: var(--brand); }
.preset-card .strip { display: flex; flex: none; border-radius: 4px; overflow: hidden; }
.preset-card .strip i { width: 15px; height: 34px; display: block; }
.preset-card span { font-size: .9rem; }

/* --- pattern specimens ---------------------------------------------------
   The gradient definitions themselves live in styles.css, where each pattern's
   rule carries a `.p-<key>::before` selector alongside the site-wide ones. This
   only supplies the layer they paint on, so there is still exactly one place
   that defines what a pattern looks like. */

.pattern-swatch {
    position: relative;
    height: 116px;
    border-radius: var(--radius) var(--radius) 0 0;
    background: linear-gradient(160deg, var(--dark-1), var(--dark-2) 55%, var(--dark-3));
    overflow: hidden;
}
.pattern-swatch::before {
    content: "";
    position: absolute;
    inset: 0;
    color: var(--on-dark);
    background-repeat: repeat;
    background-position: center;
    /* Follows the strength slider, but floored: at 0% every tile would be an
       identical empty rectangle and the catalogue would stop telling you
       anything. What is being compared here is the shape. */
    opacity: max(.14, var(--pattern-opacity));
}

/* --- rotator demo -------------------------------------------------------- */

.rot-demo {
    background: linear-gradient(160deg, var(--dark-1), var(--dark-2) 55%, var(--dark-3));
    border-radius: var(--radius);
    padding: 34px 30px 44px;
    color: var(--on-dark);
}
.rot-demo .rotator { min-height: 2.6em; }
.rot-demo .rotator-item { font-size: clamp(1.4rem, 4vw, 2.1rem); }

/* --- hover demos --------------------------------------------------------- */

.demo-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px 18px;
    box-shadow: var(--shadow);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.demo-card h3 { margin: 0 0 4px; font-family: var(--sans); font-size: .92rem; font-weight: 600; color: var(--ink); }
.demo-card p { margin: 0; font-size: .8rem; color: var(--ink-soft); }

/* Mirrors .btn so the specimens behave like the real thing, without inheriting
   the site-wide hover choice — each one demonstrates a different hover. */
.demo-btn {
    display: inline-block;
    background: var(--brand);
    color: var(--on-brand);
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: 11px 20px;
    font-size: .9rem;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: background .18s ease, transform .18s ease, box-shadow .18s ease, color .18s ease;
}
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn-cell { text-align: center; }
.btn-cell .spec-key { display: block; margin-top: 7px; }

.note-strip {
    border-left: 3px solid var(--brand);
    background: var(--surface-alt);
    padding: 14px 16px;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: .88rem;
    color: var(--ink-soft);
}
