/* =====================================================================
   DIMOV ENGINES — minimal edition
   ===================================================================== */

:root {
    --bg:     #0a0a0b;
    --ink:    #ececed;
    --muted:  #8b8b90;
    --dim:    #5a5a60;
    --rule:   #1e1e21;
    --rule-2: #2c2c31;
    --hover:  rgba(255, 255, 255, .025);

    --c-verge: #e0332f;
    --c-cull:  #3d8ddb;
    --c-dense: #064800;
    --c-rapid: #b06fc8;

    --shell: 1080px;
    --ease:  cubic-bezier(.22, 1, .36, 1);

    --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; }

::selection { background: var(--ink); color: var(--bg); }

.shell {
    width: min(var(--shell), 100% - 48px);
    margin-inline: auto;
}

.soft { color: var(--muted); }

/* =====================================================================
   SECTIONS
   ===================================================================== */

.band { padding: clamp(80px, 11vw, 132px) 0; }

/* The table is the first thing on screen. */
.band--first { padding-top: clamp(48px, 10vh, 104px); }

/* Two classes, so this beats the generic .head rule declared below it —
   otherwise its border stacks on top of the list's own top border. */
.head.head--page {
    align-items: flex-end;
    padding-bottom: 0;
    margin-bottom: clamp(20px, 3vh, 32px);
    border-bottom: none;
}

.head__page {
    margin: 0;
    font-size: clamp(2rem, 5vw, 3.4rem);
    font-weight: 300;
    line-height: 1;
    letter-spacing: -.035em;
}

.head--page .head__count { padding-bottom: .35em; }

.head {
    display: flex;
    align-items: baseline;
    gap: 18px;
    padding-bottom: 20px;
    margin-bottom: clamp(34px, 5vw, 52px);
    border-bottom: 1px solid var(--rule);
}

.head__num {
    font-family: var(--mono);
    font-size: .68rem;
    letter-spacing: .2em;
    color: var(--dim);
}

.head__title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 500;
    letter-spacing: -.01em;
}

.head__count {
    margin-left: auto;
    font-family: var(--mono);
    font-size: .68rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--dim);
}

/* =====================================================================
   ENGINE LIST
   ===================================================================== */

.list {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--rule);
}

.row {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px 64px;
    align-items: center;
    gap: 24px;
    padding: clamp(18px, 3vh, 28px) 14px clamp(18px, 3vh, 28px) 0;
    border-bottom: 1px solid var(--rule);
    transition: background .35s var(--ease);
}

.row[data-engine="verge"] { --c: var(--c-verge); }
.row[data-engine="cull"]  { --c: var(--c-cull); }
.row[data-engine="dense"] { --c: var(--c-dense); }
.row[data-engine="rapid"] { --c: var(--c-rapid); }

.row::before {
    content: "";
    position: absolute;
    left: -14px;
    right: -14px;
    top: 0;
    bottom: 0;
    background: var(--hover);
    opacity: 0;
    transition: opacity .35s var(--ease);
    pointer-events: none;
}

.row:hover::before { opacity: 1; }

/* the accent bar that grows on hover */
.row::after {
    content: "";
    position: absolute;
    left: -14px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--c);
    transform: scaleY(0);
    transform-origin: center;
    transition: transform .4s var(--ease);
}

.row:hover::after,
.row:focus-within::after { transform: scaleY(1); }

.row:focus-within::before { opacity: 1; }

/* Whole row is the link — laid over the content, out of grid flow. */
.row__hit {
    position: absolute;
    inset: 0 -14px;
    z-index: 2;
    border-radius: 2px;
}

.row__hit:focus { outline: none; }

.row__hit:focus-visible {
    outline: 1px solid var(--c);
    outline-offset: -1px;
}


.row__id { min-width: 0; }

.row__rule {
    display: block;
    width: 18px;
    height: 1px;
    margin-bottom: 12px;
    background: var(--c);
    transition: width .45s var(--ease);
}

.row:hover .row__rule { width: 54px; }

.row__name {
    margin: 0 0 4px;
    font-size: clamp(1.5rem, 3.2vw, 2.1rem);
    font-weight: 400;
    letter-spacing: -.025em;
    line-height: 1.1;
}

.row__kind {
    margin: 0;
    font-size: .89rem;
    color: var(--muted);
    max-width: 56ch;
}

.spec {
    display: grid;
    gap: 10px;
    margin: 0;
}

.spec > div {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 12px;
    align-items: baseline;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--rule);
}

.spec > div:last-child { border-bottom: none; padding-bottom: 0; }

.spec dt {
    font-family: var(--mono);
    font-size: .6rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--dim);
}

.spec dd {
    margin: 0;
    font-size: .84rem;
    color: var(--ink);
}

/* ---- status dot ---- */

.st {
    position: relative;
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 9px;
    border-radius: 50%;
    vertical-align: .05em;
}

.st--active { background: var(--ink); }

/* a slow ring breathing out of every dot that's still being worked on */
.st--active::after,
.st--proto::after {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: 50%;
    border: 1px solid var(--ink);
    animation: stPing 2.4s var(--ease) infinite;
}

@keyframes stPing {
    0%        { transform: scale(1);   opacity: .7; }
    70%, 100% { transform: scale(2.6); opacity: 0; }
}

.st--proto {
    border: 1px solid var(--ink);
    background: transparent;
}

.st--archived { background: var(--dim); }

.row__logo {
    width: 52px;
    height: 52px;
    justify-self: end;
    object-fit: contain;
    transition: transform .45s var(--ease);
}

.row:hover .row__logo { transform: scale(1.06); }

/* Inline screenshot + its toggle — only used where there is no hover
   (desktop uses .peek instead). Closed until asked for. */
.row__shot,
.row__peek { display: none; }

@keyframes shotIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: none; }
}

/* =====================================================================
   PEEK — screenshot card pinned directly above or below the hovered row.
   Position and size are set by JS so it never overlaps that row.
   ===================================================================== */

.peek {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 40;
    pointer-events: none;
    opacity: 0;
    transform: translate3d(var(--px, 0), var(--py, 0), 0);
    scale: .96;
    transform-origin: center var(--oy, bottom);
    transition: opacity .22s var(--ease), scale .3s var(--ease);
}

.peek.is-on {
    opacity: 1;
    scale: 1;
}

/* Glide between rows only once already visible — never from a stale spot. */
.peek.is-on.is-gliding {
    transition: opacity .22s var(--ease), scale .3s var(--ease),
                transform .35s var(--ease), width .35s var(--ease),
                height .35s var(--ease);
}

.peek img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 1px solid var(--rule-2);
    border-radius: 6px;
    box-shadow: 0 24px 60px -18px rgba(0, 0, 0, .9);
    background: var(--rule);
}

@media (hover: none), (pointer: coarse), (max-width: 880px) {
    .peek { display: none; }
}

@media (max-width: 880px) {
    .row {
        grid-template-columns: minmax(0, 1fr) 52px;
        align-items: start;
        gap: 16px;
        padding: 26px 0;
    }
    .row__id   { grid-area: 1 / 1; }
    .row__logo { grid-area: 1 / 2; width: 42px; height: 42px; }
    .spec {
        grid-area: 2 / 1 / 3 / 3;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
        margin-top: 20px;
    }
    .spec > div {
        grid-template-columns: 1fr;
        gap: 3px;
        padding-bottom: 0;
        border-bottom: none;
    }
    /* Above .row__hit, so tapping it toggles instead of opening the link. */
    .row__peek {
        grid-area: 3 / 1 / 4 / 3;
        justify-self: start;
        position: relative;
        z-index: 3;
        display: inline-flex;
        align-items: center;
        gap: 9px;
        padding: 7px 12px;
        margin: -2px 0 0;
        border: 1px solid var(--rule-2);
        border-radius: 999px;
        background: none;
        color: var(--muted);
        font-family: var(--mono);
        font-size: .62rem;
        letter-spacing: .16em;
        text-transform: uppercase;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    /* plus that turns into a minus when open */
    .row__peek i {
        position: relative;
        width: 9px;
        height: 9px;
    }

    .row__peek i::before,
    .row__peek i::after {
        content: "";
        position: absolute;
        left: 0;
        top: 4px;
        width: 9px;
        height: 1px;
        background: currentColor;
        transition: transform .3s var(--ease);
    }

    .row__peek i::after { transform: rotate(90deg); }

    .row.is-open .row__peek { color: var(--ink); border-color: var(--c); }
    .row.is-open .row__peek i::after { transform: rotate(0deg); }

    .row.is-open .row__shot {
        display: block;
        grid-area: 4 / 1 / 5 / 3;
        width: 100%;
        height: auto;
        border: 1px solid var(--rule);
        border-radius: 6px;
        animation: shotIn .4s var(--ease) both;
    }
}

@media (max-width: 480px) {
    .row { grid-template-columns: minmax(0, 1fr) 40px; gap: 12px; }
    .row__logo { width: 34px; height: 34px; }}

/* =====================================================================
   FOOTER
   ===================================================================== */

.foot {
    padding: 34px 0 44px;
    border-top: 1px solid var(--rule);
}

.foot__in {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
}

.foot__copy,
.foot__list {
    font-family: var(--mono);
    font-size: .66rem;
    letter-spacing: .14em;
    color: var(--dim);
}

/* =====================================================================
   REVEAL  (opt-in — only once JS confirms it can undo it)
   ===================================================================== */

html.js .r {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .75s var(--ease), transform .75s var(--ease);
    transition-delay: var(--d, 0ms);
}

html.js .r.is-in {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    html.js .r { opacity: 1; transform: none; transition: none; }
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
    .st--active::after,
    .st--proto::after { display: none; }
}
