@font-face {
    font-family: 'DMSans';
    src: url('fonts/DM_Sans/DMSans-VariableFont_opsz,wght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Montserrat';
    src: url('fonts/Montserrat/Montserrat-VariableFont_wght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --primary-color: #0E4B8C;
    --primary-light: #1f78d1;
    --primary-dark: #082f57;
    --accent-color: #D84727;
    --background-color: #FFFFFF;
    --text-color: #020202;
    --success-color: #2ecc71;
    --font-main: 'DMSans', 'Montserrat', 'Proxima Nova', sans-serif;
    --font-alt: 'Montserrat', 'Proxima Nova', sans-serif;
}

* {
    box-sizing: border-box;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

html, body {
    margin: 0;
    min-height: 100vh;
}

body {
    font-family: var(--font-main);
    background: linear-gradient(120deg, var(--primary-dark), var(--primary-color) 45%, var(--primary-light) 100%);
    background-size: 200% 200%;
    animation: gradientShift 18s ease infinite;
    color: var(--background-color);
    display: flex;
    flex-direction: column;
    position: relative;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.bg-decor {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.bg-decor .blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.35;
    will-change: transform;
}

.bg-decor .blob-1 {
    width: 42vw;
    height: 42vw;
    top: -10%;
    left: -10%;
    background: var(--accent-color);
    animation: floatBlob 20s ease-in-out infinite alternate;
}

.bg-decor .blob-2 {
    width: 36vw;
    height: 36vw;
    bottom: -12%;
    right: -8%;
    background: #63c7ff;
    animation: floatBlob 24s ease-in-out infinite alternate-reverse;
}

@keyframes floatBlob {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(4%, -6%) scale(1.12); }
    100% { transform: translate(-5%, 5%) scale(0.92); }
}

header,
main,
footer {
    position: relative;
    z-index: 1;
}

header {
    background: rgba(0, 0, 0, 0.18);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 32px;
    flex-wrap: wrap;
    animation: slideIn 0.6s ease-out;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo {
    height: 42px;
    display: block;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.25));
    transition: transform 0.4s ease;
}

.logo:hover {
    transform: scale(1.1);
}

.brand-text {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.brand-text h1 {
    margin: 0;
    font-size: 1.2em;
    font-family: var(--font-alt);
    font-weight: 700;
    letter-spacing: 0.2px;
}

.brand-tagline {
    font-size: 0.78em;
    opacity: 0.8;
    letter-spacing: 0.3px;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-box {
    flex: 1 1 320px;
    max-width: 380px;
    display: flex;
    justify-content: flex-end;
}

.search-box input {
    width: 100%;
    padding: 11px 18px;
    font-size: 0.95em;
    font-family: var(--font-main);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 999px;
    outline: none;
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.search-box input:focus {
    box-shadow: 0 0 0 4px rgba(216, 71, 39, 0.35), 0 6px 16px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

main {
    flex: 1;
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 28px 32px 40px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.intro {
    font-size: 1em;
    opacity: 0.9;
    margin: 0 0 24px;
    animation: slideIn 0.8s ease-out;
}

.app-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 20px;
    text-align: left;
}

.app-link {
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: rgba(255, 255, 255, 0.97);
    color: var(--primary-color);
    text-decoration: none;
    padding: 20px;
    border-radius: 16px;
    font-family: var(--font-main);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
    opacity: 0;
    transform: translateY(16px);
    animation: cardIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: var(--delay, 0s);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease, color 0.3s ease;
}

@keyframes cardIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.app-link::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--accent-color);
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.3s ease;
}

.app-link:hover {
    background-color: var(--accent-color);
    color: white;
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.3);
}

.app-link:hover::before {
    transform: scaleY(1);
}

.app-link:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

.app-link-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.app-link-name {
    font-size: 1.08em;
    font-weight: 600;
    line-height: 1.3;
}

.app-icon {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 10px;
    background: rgba(14, 75, 140, 0.06);
    padding: 5px;
    transition: transform 0.3s ease;
}

.app-link:hover .app-icon {
    transform: scale(1.08) rotate(-2deg);
}

/* Apps not yet cut over to cloud.briot.in — still points at products.briot.in */
.app-link--legacy .app-icon {
    filter: grayscale(40%);
}

.badge-live,
.badge-legacy {
    flex-shrink: 0;
    font-size: 0.68em;
    font-family: sans-serif;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.badge-live {
    background: rgba(46, 204, 113, 0.12);
    color: #1a9850;
}

.badge-live .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success-color);
    box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.6);
    animation: pulseDot 1.8s ease-out infinite;
}

@keyframes pulseDot {
    0% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.6); }
    70% { box-shadow: 0 0 0 6px rgba(46, 204, 113, 0); }
    100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}

.badge-legacy {
    background: rgba(14, 75, 140, 0.1);
    color: var(--primary-color);
}

.app-link--legacy:hover .badge-legacy {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.app-link:hover .badge-live {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.no-results {
    opacity: 0.85;
    font-size: 1.05em;
    margin-top: 24px;
    text-align: center;
    animation: slideIn 0.4s ease-out;
}

footer {
    background: rgba(0, 0, 0, 0.18);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    text-align: center;
    padding: 10px;
    font-size: 0.82em;
    font-family: var(--font-main);
    flex-shrink: 0;
}

footer a {
    color: white;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.25s ease;
}

footer a:hover {
    color: var(--accent-color);
}

@media (max-width: 640px) {
    header {
        justify-content: center;
        text-align: center;
        padding: 16px 20px;
    }

    .brand {
        justify-content: center;
        width: 100%;
    }

    .search-box {
        justify-content: center;
        max-width: none;
    }

    main {
        padding: 24px 20px 32px;
    }
}
