/* ExumaLabs — project list (the plain counterpart of the 3D hub; also its fallback on phones,
   reduced motion and no WebGL). Neutral frame; each project brings its own colors on hover.
   Cross-document View Transitions into project pages. */

@view-transition { navigation: auto; }

:root {
    --base-bg: #f3f2ee;
    --base-fg: #121317;
    --base-ac: #00A3FF;
    --page-bg: var(--base-bg);
    --page-fg: var(--base-fg);
    --page-ac: var(--base-ac);
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Roboto, system-ui, sans-serif;
    --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    --gutter: clamp(16px, 4vw, 56px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    background: var(--page-bg);
    color: var(--page-fg);
    font: 400 16px/1.5 var(--font);
    -webkit-font-smoothing: antialiased;
    transition: background-color .45s ease, color .45s ease;
}
a { color: inherit; }

.top {
    display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    padding: 22px var(--gutter);
}
.brand { font-weight: 700; letter-spacing: -.02em; text-decoration: none; font-size: 17px; }
.top__meta { margin: 0; font-size: 13px; opacity: .6; }

.intro {
    margin: clamp(40px, 9vh, 110px) var(--gutter) clamp(40px, 7vh, 80px);
    max-width: 17em;
    font-size: clamp(1.9rem, 3.6vw, 3.4rem); line-height: 1.06; font-weight: 700; letter-spacing: -.03em;
}
.intro span { opacity: .4; }

/* ---------- Index: a grid of project cards (the 3D hub's plain, accessible counterpart) ---------- */
.index {
    list-style: none; margin: 0 var(--gutter); padding: 0;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 44px 28px;
}
.row a {
    display: grid; grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "media media" "name state" "kind kind";
    align-items: baseline; gap: 6px 12px;
    text-decoration: none; transition: opacity .3s;
}
.row__media {
    grid-area: media; display: block; width: 100%; aspect-ratio: 16 / 10; margin-bottom: 14px;
    object-fit: cover; object-position: var(--pos, center top); border-radius: 14px;
    background: color-mix(in srgb, currentColor 8%, transparent);
    box-shadow: 0 1px 0 color-mix(in srgb, currentColor 10%, transparent), 0 24px 50px -30px rgba(0,0,0,.45);
    transition: transform .45s cubic-bezier(.2,.8,.2,1), box-shadow .45s;
}
.row__n { display: none; }
.row__name {
    grid-area: name; width: fit-content;
    font-size: clamp(1.8rem, 2.6vw, 2.5rem); line-height: 1.02; font-weight: 700; letter-spacing: -.035em;
    transition: color .3s;
}
.row__state { grid-area: state; text-align: right; font: 500 12px/1 var(--mono); opacity: .55; }
.row__kind { grid-area: kind; font-size: 14px; opacity: .6; }

/* Active card (hover / focus / just-returned): the page takes the project's colors. */
.index.has-active .row:not(.is-active) a { opacity: .45; }
.row.is-active .row__name, .row.is-active .row__state { color: var(--ac); opacity: 1; }
.row.is-active .row__media { transform: translateY(-6px); box-shadow: 0 1px 0 color-mix(in srgb, currentColor 10%, transparent), 0 34px 60px -28px rgba(0,0,0,.6); }

.foot {
    display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap;
    padding: clamp(60px, 12vh, 140px) var(--gutter) 32px;
    font-size: 14px;
}
.foot p { margin: 0; max-width: 34em; opacity: .7; }
.foot__copy { font-family: var(--mono); font-size: 12px; }

:focus-visible { outline: 2px solid var(--page-ac); outline-offset: 4px; }

/* Touch: no hover tint, nothing dims. */
@media (hover: none) {
    .index.has-active .row:not(.is-active) a { opacity: 1; }
    .row.is-active .row__media { transform: none; }
}

/* ---------- View transition timing ---------- */
::view-transition-group(*) { animation-duration: .55s; animation-timing-function: cubic-bezier(.2,.8,.2,1); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .35s; }

@media (prefers-reduced-motion: reduce) {
    body, .row__name, .row__media, .row a { transition: none; }
    .row.is-active .row__media { transform: none; }
    ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
