/* ── SELF-HOSTED FONTS ── */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/inter-v20-latin-regular.woff2') format('woff2');
}
@font-face {
    font-family: 'Orbitron';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('fonts/orbitron-v35-latin-700.woff2') format('woff2');
}
@font-face {
    font-family: 'Orbitron';
    font-style: normal;
    font-weight: 900;
    font-display: swap;
    src: url('fonts/orbitron-v35-latin-700.woff2') format('woff2');
}

/* ── DESIGN TOKENS ── */
:root {
    --bg-dark:      #050510;
    --primary:      #00f2ff;
    --secondary:    #bd00ff;
    --accent-web:   #92FE9D;
    --glass:        rgba(255, 255, 255, 0.05);
    --border:       rgba(255, 255, 255, 0.1);
    --text-main:    #ffffff;
    --text-muted:   #94a3b8;
    --radius-card:  24px;
    --radius-icon:  20px;
    --radius-btn:   12px;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── BASE ── */
html { scroll-behavior: smooth; }

body {
    background-color: var(--bg-dark);
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ── SKIP LINK ── */
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}
.sr-only:focus {
    position: static;
    width: auto; height: auto;
    padding: 8px 16px; margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    background: var(--primary);
    color: #000;
    font-weight: 700;
    z-index: 9999;
    border-radius: 4px;
}

/* ── CANVAS BACKGROUND ── */
#particle-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ── MAIN LAYOUT ── */
main {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 24px 80px;
}

/* ── HEADER ── */
header {
    text-align: center;
    margin-bottom: 80px;
    animation: fadeInDown 0.9s ease-out both;
}

.brand {
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: clamp(2.2rem, 8vw, 4.5rem);
    letter-spacing: 0.12em;
    background: linear-gradient(135deg, #fff 20%, var(--primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1.1;
}

.tagline {
    color: var(--primary);
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-size: clamp(0.7rem, 2vw, 0.9rem);
    margin-top: 14px;
    opacity: 0.8;
}

/* ── APP GRID ── */
.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
    perspective: 1200px;
}

/* ── GLASS CARD ── */
.app-card {
    text-decoration: none;
    color: inherit;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 32px 28px;
    position: relative;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform-style: preserve-3d;
    will-change: transform;
}

/* Animated gradient border on hover */
.app-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-card);
    padding: 1.5px;
    background: linear-gradient(135deg, transparent 30%, rgba(0,242,255,0.5), transparent 70%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.4;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.app-card:hover::before { opacity: 1; }
.app-card:hover { border-color: rgba(0,242,255,0.3); box-shadow: 0 20px 60px rgba(0,0,0,0.6); }

/* Web card variant */
.app-card--web::before {
    background: linear-gradient(135deg, transparent 30%, rgba(146,254,157,0.5), transparent 70%);
}
.app-card--web:hover { border-color: rgba(146,254,157,0.3); }

/* Focus visible */
.app-card:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
    border-radius: var(--radius-card);
}

.card-content { transform: translateZ(20px); display: flex; flex-direction: column; height: 100%; }

/* ── ICON ── */
.icon-wrapper {
    width: 88px;
    height: 88px;
    margin-bottom: 22px;
    position: relative;
    border-radius: var(--radius-icon);
    background: #000;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    flex-shrink: 0;
}
.icon-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-icon);
    display: block;
}
.glow {
    position: absolute;
    inset: 0;
    border-radius: var(--radius-icon);
    box-shadow: 0 0 24px var(--primary);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.glow--web { box-shadow: 0 0 24px var(--accent-web); }
.app-card:hover .glow { opacity: 0.65; }

/* ── TEXT ── */
h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1.1rem, 3vw, 1.35rem);
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1.3;
}

.category {
    color: var(--primary);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 14px;
    font-weight: 700;
}
.category--web { color: var(--accent-web); }

.desc {
    color: var(--text-muted);
    font-size: 0.93rem;
    line-height: 1.65;
    margin-bottom: 28px;
    flex: 1;
}

/* ── CTA BUTTON ── */
.btn-action {
    margin-top: auto;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    padding: 13px 18px;
    border-radius: var(--radius-btn);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 0.9rem;
    transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.btn-action i { font-size: 1.1rem; transition: transform 0.25s ease; }

.app-card:hover .btn-action {
    background: var(--primary);
    color: #000;
    border-color: transparent;
    box-shadow: 0 0 24px rgba(0,242,255,0.45);
}
.app-card:hover .btn-action i { transform: translateX(3px); }

.btn-action--web { border-color: rgba(146,254,157,0.15); }
.app-card--web:hover .btn-action {
    background: var(--accent-web);
    color: #000;
    border-color: transparent;
    box-shadow: 0 0 24px rgba(146,254,157,0.4);
}

/* ── FOOTER ── */
footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-top: 80px;
    opacity: 0.65;
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: center;
}
.footer-links {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
}
.footer-links a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.82rem;
    transition: opacity 0.2s;
    opacity: 0.8;
}
.footer-links a:hover { opacity: 1; }
.footer-links a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 3px;
}

/* ── ANIMATIONS ── */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-40px); }
    to   { opacity: 1; transform: translateY(0); }
}

.app-card {
    animation: fadeInUp 0.6s ease-out both;
}
.app-card:nth-child(1) { animation-delay: 0.1s; }
.app-card:nth-child(2) { animation-delay: 0.2s; }
.app-card:nth-child(3) { animation-delay: 0.3s; }
.app-card:nth-child(4) { animation-delay: 0.4s; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════
   BREAKPOINTS
═══════════════════════════════════════════════════════════════ */

/* 2-column on medium tablets */
@media (max-width: 900px) {
    main { padding: 48px 20px 64px; }
    header { margin-bottom: 56px; }
    .app-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
}

/* Single column on mobile */
@media (max-width: 600px) {
    main { padding: 40px 16px 56px; }
    header { margin-bottom: 40px; }
    .app-grid { grid-template-columns: 1fr; gap: 16px; }
    .app-card { padding: 24px 20px; border-radius: 18px; }
    .icon-wrapper { width: 76px; height: 76px; margin-bottom: 16px; }
    h2 { font-size: 1.1rem; }
    .desc { font-size: 0.9rem; }
    footer { margin-top: 56px; }
}

@media (max-width: 380px) {
    .app-card { padding: 20px 16px; }
    .btn-action { font-size: 0.82rem; padding: 11px 14px; }
}

/* ── REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}