/*
 * Catalogue launcher layout. Design-system tokens (light + dark), the env stripe,
 * and focus styles live in the shared library stylesheet, loaded before this file:
 *   _content/Haven.Finance.Web.DesignSystem/haven-finance-designsystem.css
 */
body {
    margin: 0;
    font-family: var(--font);
    background: var(--color-bg);
    color: var(--color-text);
}

.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: calc(var(--grid) * 4);
    padding: calc(var(--grid) * 7) calc(var(--grid) * 5);
    background: linear-gradient(
        120deg,
        var(--hero-from) 0%,
        var(--hero-mid) 55%,
        var(--hero-to) 100%);
    color: var(--hero-text);
}

.hero-greeting {
    margin: 0 0 calc(var(--grid) * 1);
    font-size: 1rem;
    font-weight: var(--weight-normal);
    color: var(--hero-text-muted);
}

.hero-title {
    margin: 0;
    font-size: 3.5rem;
    line-height: 1.05;
    font-weight: var(--weight-bold);
    color: var(--hero-text);
}

.hero-descriptor {
    margin: calc(var(--grid) * 1.5) 0 0;
    font-size: 1.125rem;
    font-weight: var(--weight-normal);
    color: var(--hero-text-muted);
}

.hero-mark {
    height: 150px;
    width: auto;
    flex: 0 0 auto;
    filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.35));
}

@media (max-width: 640px) {
    .hero {
        flex-direction: column-reverse;
        align-items: flex-start;
        padding: calc(var(--grid) * 5) calc(var(--grid) * 3);
    }

    .hero-mark {
        height: 96px;
    }

    .hero-title {
        font-size: 2.5rem;
    }
}

.tile-grid {
    display: grid;
    gap: calc(var(--grid) * 3);
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    padding: calc(var(--grid) * 4) calc(var(--grid) * 5) calc(var(--grid) * 8);
}

.tile {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
        "chip title"
        "chip desc"
        "meta meta";
    gap: calc(var(--grid) * 0.5) calc(var(--grid) * 2);
    padding: calc(var(--grid) * 3);
    border-radius: var(--radius);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    text-decoration: none;
    color: var(--color-text);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

/* Only interactive (anchor) tiles lift — a disabled tile is a <div class="tile
   tile-disabled"> and must stay inert (spec §4.2). */
a.tile:hover,
a.tile:focus-visible {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary);
}

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

    a.tile:hover,
    a.tile:focus-visible {
        transform: none;
    }
}

.tile-chip {
    grid-area: chip;
    align-self: start;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--haven-500), var(--haven-700));
    color: #ffffff;
    font-weight: var(--weight-bold);
    font-size: 0.9rem;
}

.tile-title {
    grid-area: title;
    font-weight: var(--weight-bold);
    font-size: 1.0625rem;
}

.tile-description {
    grid-area: desc;
    color: var(--color-text-secondary);
    font-size: 0.875rem;
    line-height: 1.4;
}

.tile-meta {
    grid-area: meta;
    display: flex;
    align-items: center;
    gap: calc(var(--grid) * 1);
    margin-top: calc(var(--grid) * 1.5);
    padding-top: calc(var(--grid) * 1.5);
    border-top: 1px dashed var(--color-border);
    /* pebble-700, not pebble-500: the 0.75rem meta text must clear WCAG AA 4.5:1
       on --color-surface (pebble-500 is ~3.4:1). */
    color: var(--color-text-secondary);
    font-size: 0.75rem;
}

.tile-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--signal-green-400);
}

.tile-disabled {
    opacity: 0.55;
    filter: saturate(0.4);
    cursor: not-allowed;
}

.tile-disabled .tile-status-dot {
    background: var(--pebble-400);
}

/* The Manage access tile is exclusive to Finance.AccessAdmin holders; its elevated treatment
   is the visible mark of that role. */
.tile-admin {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
    background:
        linear-gradient(160deg,
            color-mix(in srgb, var(--haven-500) 6%, var(--color-surface)),
            var(--color-surface));
}

.tile-admin .tile-chip {
    background: linear-gradient(135deg, var(--haven-700), var(--color-primary));
}

.load-error {
    padding: var(--grid) calc(var(--grid) * 3);
    color: var(--color-error);
}
