/* ========================================
   Root Variables
======================================== */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --background: #f4f7fb;
    --surface: #ffffff;
    --text: #172033;
    --muted: #667085;
    --border: #e4e7ec;
    --success: #22c55e;
    --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    --shadow-hover: 0 16px 35px rgba(15, 23, 42, 0.14);
}

/* ========================================
   Reset
======================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;
    line-height: 1.6;
    color: var(--text);
    background:
        radial-gradient(
            circle at top left,
            rgba(37, 99, 235, 0.09),
            transparent 30rem
        ),
        var(--background);
}

a {
    color: inherit;
}

/* ========================================
   Header
======================================== */

.header {
    padding: clamp(3rem, 8vw, 6rem) 1.25rem;
    text-align: center;
    color: #ffffff;
    background:
        linear-gradient(
            135deg,
            rgba(15, 23, 42, 0.97),
            rgba(37, 99, 235, 0.92)
        );
}

.header h1 {
    margin: 0;
    font-size: clamp(2.4rem, 7vw, 4.75rem);
    line-height: 1.05;
    letter-spacing: -0.05em;
}

.header p {
    max-width: 720px;
    margin: 1rem auto 0;
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: rgba(255, 255, 255, 0.82);
}

/* ========================================
   Main Sections
======================================== */

main {
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto;
    padding: clamp(2rem, 5vw, 4.5rem) 0;
}

.section {
    margin-bottom: clamp(2.75rem, 6vw, 5rem);
}

.section h2 {
    position: relative;
    margin: 0 0 1.5rem;
    padding-bottom: 0.65rem;
    font-size: clamp(1.4rem, 3vw, 2rem);
    letter-spacing: -0.025em;
}

.section h2::after {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 52px;
    height: 4px;
    content: "";
    border-radius: 999px;
    background: var(--primary);
}

/* ========================================
   Responsive Grid
======================================== */

.grid {
    display: grid;
    grid-template-columns: repeat(
        auto-fit,
        minmax(min(100%, 250px), 1fr)
    );
    gap: 1.25rem;
}

/* ========================================
   Cards
======================================== */

.card {
    position: relative;
    display: flex;
    min-height: 190px;
    padding: 1.5rem;
    overflow: hidden;
    flex-direction: column;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow);
    transition:
        transform 180ms ease,
        box-shadow 180ms ease,
        border-color 180ms ease;
}

.card::before {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    content: "";
    background: linear-gradient(
        90deg,
        var(--primary),
        #7c3aed
    );
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 180ms ease;
}

.card:hover,
.card:focus-within {
    border-color: rgba(37, 99, 235, 0.35);
    box-shadow: var(--shadow-hover);
    transform: translateY(-5px);
}

.card:hover::before,
.card:focus-within::before {
    transform: scaleX(1);
}

.card h3 {
    margin: 0.75rem 0 0.45rem;
    font-size: 1.25rem;
    line-height: 1.25;
}

.card h3 a {
    text-decoration: none;
    color: var(--text);
}

.card h3 a::after {
    position: absolute;
    inset: 0;
    content: "";
}

.card h3 a:hover {
    color: var(--primary);
}

.card p {
    margin: 0;
    color: var(--muted);
}

/* ========================================
   Status Indicator
======================================== */

.status {
    position: relative;
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.13);
}

.status::after {
    position: absolute;
    inset: 0;
    content: "";
    border-radius: inherit;
    background: inherit;
    animation: status-pulse 2s infinite;
}

@keyframes status-pulse {
    0% {
        opacity: 0.65;
        transform: scale(1);
    }

    70%,
    100% {
        opacity: 0;
        transform: scale(2.25);
    }
}

/* ========================================
   Footer
======================================== */

.footer {
    padding: 2rem 1.25rem;
    text-align: center;
    color: var(--muted);
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.footer a {
    font-weight: 600;
    text-decoration: none;
    color: var(--primary);
}

.footer a:hover {
    text-decoration: underline;
}

/* ========================================
   Accessibility
======================================== */

.card h3 a:focus-visible,
.footer a:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.4);
    outline-offset: 4px;
    border-radius: 4px;
}

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

/* ========================================
   Small Screens
======================================== */

@media (max-width: 540px) {
    main {
        width: min(100% - 1.25rem, 1180px);
    }

    .header {
        padding: 3rem 1rem;
    }

    .grid {
        gap: 1rem;
    }

    .card {
        min-height: 165px;
        padding: 1.25rem;
        border-radius: 15px;
    }
}

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.app-icon {
    display: flex;
    width: 68px;
    height: 68px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.app-icon img {
    display: block;
    width: 100%;
    height: 100%;
    padding: 7px;
    object-fit: contain;
}

.card:hover .app-icon,
.card:focus-within .app-icon {
    transform: scale(1.04);
}

.app-icon {
    transition: transform 180ms ease;
}