/*
Theme Name: Ultimate Portfolio Master
Author: Iriza & Gemini
Description: Responsive premium project portfolio with glass header, dark mode and animated project logos.
Version: 2.1
*/

:root {
    --bg: #f5f7fb;
    --surface: rgba(255,255,255,.88);
    --surface-solid: #ffffff;
    --text: #111827;
    --muted: #667085;
    --line: rgba(17,24,39,.09);
    --primary: #1769ff;
    --primary-dark: #0755dc;
    --shadow: 0 18px 50px rgba(20,34,70,.09);
    --card-shadow: 0 8px 30px rgba(16,24,40,.045);
    --radius: 24px;
    --chrome-bg: rgba(226,236,255,.86);
    --chrome-solid: #e2ecff;
    --chrome-line: rgba(23,105,255,.16);
    --chrome-card: rgba(255,255,255,.62);
    --card-border: #7da8f5;
    --card-ring: rgba(23,105,255,.14);
    --container: 1240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body,
html {
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
    background: var(--bg);
    color: var(--text);
    transition: background .3s ease, color .3s ease;
}
body { min-width: 320px; overflow-x: hidden; }
a { color: inherit; }
button,
input { font: inherit; }

/* Header */
.glass-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 10px 0;
    background: var(--chrome-bg);
    border-bottom: 1px solid var(--chrome-line);
    box-shadow: 0 6px 24px rgba(23,105,255,.06);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    transition: background .3s ease, border-color .3s ease;
}
.header-inner {
    width: min(var(--container), calc(100% - 32px));
    min-height: 50px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.site-brand {
    min-width: 0;
    display: flex;
    align-items: center;
    color: var(--text);
    text-decoration: none;
}
.header-iby-logo { display: inline-flex; align-items: center; }
.header-iby-ring {
    position: relative;
    width: 150px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0,229,255,.18);
    border-radius: 999px;
    background: radial-gradient(circle at 30% 25%, #123b67, #07101f 70%);
    box-shadow: 0 0 24px rgba(0,200,255,.13), inset 0 0 18px rgba(0,229,255,.08);
    overflow: hidden;
    animation: headerLogoFloat 3s ease-in-out infinite;
}
.header-iby-ring::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    border: 2px solid transparent;
    border-top-color: #00e5ff;
    border-right-color: #007bff;
    animation: ibyRotate 2.2s linear infinite;
}
.header-iby-main,
.header-iby-sub { position: relative; z-index: 1; display: block; text-align: center; }
.header-iby-main {
    font-size: 14px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: 1.7px;
    color: #fff;
    text-shadow: 0 0 8px rgba(0,229,255,.65), 0 0 16px rgba(0,229,255,.25);
}
.header-iby-sub {
    margin-top: 4px;
    font-size: 7px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: 3.6px;
    color: #00e5ff;
    text-shadow: 0 0 8px #00e5ff;
}
#dark-toggle {
    flex: 0 0 42px;
    width: 42px !important;
    height: 42px !important;
    padding: 0 !important;
    display: grid;
    place-items: center;
    border: 1px solid var(--line) !important;
    border-radius: 14px !important;
    background: var(--surface-solid) !important;
    color: var(--text);
    box-shadow: 0 5px 20px rgba(0,0,0,.06);
    cursor: pointer;
    font-size: 17px;
    line-height: 1;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
#dark-toggle:hover { transform: translateY(-2px) rotate(4deg); box-shadow: 0 9px 24px rgba(0,0,0,.10); }
#dark-toggle:focus-visible,
.site-brand:focus-visible { outline: 3px solid rgba(23,105,255,.30); outline-offset: 3px; }

/* IBYIWACU ONLINE loader */
#page-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #050816;
}
.loader-content { position: relative; text-align: center; }
.iby-logo-loader { position: relative; display: flex; align-items: center; justify-content: center; }
.iby-glow {
    position: absolute;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: #007bff;
    filter: blur(120px);
    opacity: .15;
    pointer-events: none;
}
.iby-ring {
    width: 190px;
    height: 190px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.08);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: ibyFloat 3s ease-in-out infinite;
}
.iby-ring::before {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 4px solid transparent;
    border-top-color: #00e5ff;
    border-right-color: #007bff;
    animation: ibyRotate 1.5s linear infinite;
}
.iby-ring::after {
    content: '';
    position: absolute;
    inset: 17px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 25%, #123b67, #07101f 70%);
    box-shadow: 0 0 40px rgba(0,200,255,.25), inset 0 0 25px rgba(0,229,255,.12);
}
.iby-logo-text { position: relative; z-index: 5; text-align: center; line-height: 1.15; animation: ibyLogoGlow 2s ease-in-out infinite; }
.iby-main { display: block; font-size: 20px; font-weight: 900; letter-spacing: 2px; color: #fff; text-shadow: 0 0 8px rgba(0,229,255,.8), 0 0 18px rgba(0,229,255,.4); }
.iby-sub { display: block; margin-top: 6px; font-size: 11px; font-weight: bold; letter-spacing: 5px; color: #00e5ff; text-shadow: 0 0 10px #00e5ff; }
.iby-particle { position: absolute; z-index: 6; width: 4px; height: 4px; border-radius: 50%; background: #00e5ff; box-shadow: 0 0 12px #00e5ff; animation: ibyParticle 2.5s infinite ease-in-out; }
.iby-p1 { top: -20px; left: 35px; }
.iby-p2 { top: 35px; right: -20px; animation-delay: .5s; }
.iby-p3 { bottom: -20px; right: 45px; animation-delay: 1s; }
.iby-p4 { bottom: 35px; left: -20px; animation-delay: 1.5s; }
.loader-status { display: block; margin-top: 18px; color: rgba(255,255,255,.58); font-size: 10px; letter-spacing: 2px; text-transform: uppercase; }
@keyframes ibyLogoGlow { 0%,100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@keyframes ibyRotate { to { transform: rotate(360deg); } }
@keyframes ibyFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes ibyParticle { 0%,100% { opacity: .2; transform: scale(.6); } 50% { opacity: 1; transform: scale(1.5); } }
@keyframes headerLogoFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }

/* Home */
.home-shell {
    width: min(var(--container), calc(100% - 32px));
    margin: 0 auto;
    padding: 42px 0 70px;
}
.home-hero {
    position: relative;
    min-height: 260px;
    padding: clamp(34px, 6vw, 70px);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    overflow: hidden;
    border-radius: 32px;
    color: #fff;
    background:
        radial-gradient(circle at 80% 15%, rgba(23,105,255,.28), transparent 34%),
        radial-gradient(circle at 10% 100%, rgba(109,40,217,.17), transparent 35%),
        #101828;
    box-shadow: 0 25px 70px rgba(16,24,40,.18);
}
.home-hero::before,
.home-hero::after {
    content: '';
    position: absolute;
    inset: -18%;
    pointer-events: none;
}
.home-hero::before {
    opacity: .75;
    background-image:
        radial-gradient(circle, rgba(0,229,255,.85) 0 1.5px, transparent 2.5px),
        radial-gradient(circle, rgba(120,169,255,.72) 0 1px, transparent 2px),
        radial-gradient(circle, rgba(255,255,255,.55) 0 1px, transparent 2px);
    background-size: 120px 120px, 170px 170px, 230px 230px;
    background-position: 0 0, 35px 70px, 90px 20px;
    animation: heroDotsMove 14s linear infinite;
}
.home-hero::after {
    opacity: .12;
    background-image: radial-gradient(rgba(255,255,255,.7) 1px, transparent 1px);
    background-size: 22px 22px;
    animation: heroGridMove 18s linear infinite;
}
@keyframes heroDotsMove {
    0% { transform: translate3d(-2%, -2%, 0); }
    50% { transform: translate3d(3%, 2%, 0); }
    100% { transform: translate3d(-2%, -2%, 0); }
}
@keyframes heroGridMove {
    from { background-position: 0 0; }
    to { background-position: 44px 30px; }
}
.hero-copy,
.hero-badge { position: relative; z-index: 2; }
.eyebrow,
.section-kicker {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .18em;
}
.eyebrow { opacity: .7; }
.home-hero h1 {
    max-width: 720px;
    margin: 12px 0 10px;
    font-size: clamp(34px, 5vw, 64px);
    line-height: 1.04;
    letter-spacing: -.045em;
}
.home-hero h1 span { color: #78a9ff; }
.home-hero p {
    max-width: 600px;
    margin: 0;
    color: rgba(255,255,255,.70);
    font-size: clamp(13px, 1.8vw, 16px);
    line-height: 1.7;
}
.hero-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 13px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    font-size: 11px;
    white-space: nowrap;
}
.badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #62f5a8;
    box-shadow: 0 0 12px #62f5a8;
}

/* Search */
.project-toolbar {
    position: relative;
    z-index: 2;
    max-width: 980px;
    margin: -28px auto 42px;
}
.project-search {
    position: relative;
    min-height: 62px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border: 1px solid rgba(17,24,39,.08);
    border-radius: 18px;
    background: rgba(255,255,255,.96);
    box-shadow: var(--shadow);
    transition: border-color .2s ease, box-shadow .2s ease;
}
.project-search:focus-within {
    border-color: rgba(23,105,255,.35);
    box-shadow: 0 18px 50px rgba(20,34,70,.13), 0 0 0 4px rgba(23,105,255,.07);
}
.search-icon {
    width: 42px;
    flex: 0 0 42px;
    text-align: center;
    color: #98a2b3;
    font-size: 27px;
    line-height: 1;
}
.project-search input[type='search'] {
    flex: 1;
    min-width: 0;
    height: 46px;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font-size: 14px;
}
.project-search input[type='search']::placeholder { color: #98a2b3; }
.project-search input[type='search']::-webkit-search-cancel-button { cursor: pointer; }
.project-search button {
    border: 0;
    border-radius: 12px;
    padding: 13px 18px;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font: 600 13px Poppins, sans-serif;
    transition: background .2s ease, transform .2s ease;
}
.project-search button:hover { background: var(--primary-dark); transform: translateY(-1px); }
.project-search button span { margin-left: 7px; }

/* Project section */
.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}
.section-heading h2 {
    margin: 4px 0 0;
    font-size: clamp(22px, 3vw, 30px);
    line-height: 1.2;
    letter-spacing: -.03em;
}
.section-kicker { color: var(--primary); }
.project-count,
.search-label { color: var(--muted); font-size: 12px; }

.grid-layout {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}
.project-card {
    position: relative;
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--card-shadow);
    transition: transform .28s ease, box-shadow .28s ease, border-color .28s ease;
}
.project-card:hover {
    transform: translateY(-6px);
    border-color: rgba(23,105,255,.28);
    box-shadow: var(--shadow), 0 0 0 3px rgba(23,105,255,.10);
}
.project-media {
    position: relative;
    display: block;
    min-height: 190px;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #e9eef7;
    text-decoration: none;
}
.project-media img,
.project-media video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s cubic-bezier(.2,.7,.2,1);
}
.project-card:hover .project-media img,
.project-card:hover .project-media video { transform: scale(1.045); }

/* --- Slideshow (amafoto/video menshi kuri card imwe) --- */
.media-slides {
    position: absolute;
    inset: 0;
}
.media-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity .45s ease;
}
.media-slide.is-active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}
.media-slide img,
.media-slide video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s cubic-bezier(.2,.7,.2,1);
}
.project-card:hover .media-slide.is-active img,
.project-card:hover .media-slide.is-active video { transform: scale(1.045); }

.media-arrow {
    position: absolute;
    top: 50%;
    z-index: 3;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: none;
    border-radius: 50%;
    background: rgba(17,24,39,.55);
    backdrop-filter: blur(6px);
    color: #fff;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity .2s ease, background .2s ease, transform .15s ease;
}
.media-arrow:active { transform: translateY(-50%) scale(.9); }
.media-prev { left: 10px; }
.media-next { right: 10px; }
@media (hover: hover) {
    .project-media.has-slider:hover .media-arrow { opacity: 1; }
}
.media-arrow:hover { background: rgba(17,24,39,.78); }

.media-dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 12px;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.media-dot {
    width: 6px;
    height: 6px;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: rgba(255,255,255,.5);
    cursor: pointer;
    transition: transform .2s ease, background .2s ease, width .2s ease;
}
.media-dot.is-active {
    width: 16px;
    background: #fff;
}
.media-overlay {
    position: absolute;
    inset: 0;
    opacity: .75;
    background: linear-gradient(180deg, transparent 45%, rgba(0,0,0,.5));
}
.media-top-label {
    position: absolute;
    top: 13px;
    left: 13px;
    z-index: 2;
    padding: 6px 9px;
    border-radius: 999px;
    color: #fff;
    background: rgba(17,24,39,.56);
    backdrop-filter: blur(8px);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .13em;
}
.view-chip {
    position: absolute;
    right: 14px;
    bottom: 14px;
    padding: 8px 11px;
    border-radius: 999px;
    color: #fff;
    background: rgba(17,24,39,.62);
    backdrop-filter: blur(8px);
    font-size: 10px;
    font-weight: 600;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .25s ease, transform .25s ease;
}
.project-card:hover .view-chip,
.project-media:focus-visible .view-chip { opacity: 1; transform: none; }
.view-chip b { margin-left: 5px; font-size: 12px; }
.media-count {
    position: absolute;
    left: 13px;
    bottom: 13px;
    padding: 5px 8px;
    border-radius: 8px;
    color: #fff;
    background: rgba(17,24,39,.58);
    font-size: 9px;
}
.media-placeholder {
    height: 100%;
    display: grid;
    place-items: center;
    color: var(--primary);
    background: linear-gradient(135deg,#e9effb,#dce7ff);
    font-size: 32px;
}

/* Project logo */
.project-logo-row {
    padding: 12px 18px 0;
    display: flex;
    align-items: center;
}
.project-logo-badge {
    position: relative;
    width: 42px;
    height: 42px;
    padding: 7px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--surface-solid);
    box-shadow: 0 9px 24px rgba(16,24,40,.10);
    isolation: isolate;
    animation: projectLogoFloat 2.8s ease-in-out infinite;
}
.project-logo-ring {
    position: absolute;
    inset: -4px;
    z-index: -1;
    border: 1px solid rgba(23,105,255,.18);
    border-radius: 16px;
    pointer-events: none;
    animation: projectLogoPulse 2.4s ease-in-out infinite;
}
.project-logo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}
@keyframes projectLogoPulse {
    0%, 100% { transform: scale(1); opacity: .45; }
    50% { transform: scale(1.10); opacity: 1; }
}
@keyframes projectLogoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

.card-body {
    min-width: 0;
    padding: 18px 19px 19px;
    display: flex;
    flex: 1;
    flex-direction: column;
}
.card-body h3 {
    margin: 8px 0 6px;
    overflow-wrap: anywhere;
    font-size: 18px;
    line-height: 1.3;
    letter-spacing: -.02em;
}
.card-body h3 a { text-decoration: none; }
.card-body h3 a:hover { color: var(--primary); }
.card-body p {
    margin: 0 0 18px;
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.btn-view {
    margin-top: auto;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 16px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(135deg,var(--primary),#4f8cff);
    box-shadow: 0 8px 20px rgba(23,105,255,.20);
    text-decoration: none;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .4px;
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}
.btn-view span {
    font-size: 16px;
    line-height: 1;
    transition: transform .2s ease;
}
.btn-view:hover {
    color: #fff;
    filter: brightness(1.06);
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(23,105,255,.28);
}
.btn-view:hover span { transform: translateX(3px); }
.btn-view:active { transform: translateY(0); }
.project-media:focus-visible,
.btn-view:focus-visible { outline: 3px solid rgba(23,105,255,.35); outline-offset: 2px; }

/* --- Tap / touch feedback kuri telefoni (:hover ntikora neza kuri touchscreen) --- */
.project-card.is-touching {
    transform: scale(.965) translateY(0);
    box-shadow: var(--card-shadow);
    transition: transform .15s ease;
}
.project-card.is-touching .project-media img,
.project-card.is-touching .project-media video {
    transform: scale(1.03);
}
.project-card.is-touching .btn-view {
    transform: scale(.97);
}

/* --- Animation igihe umukoresha afunguye App (launch) --- */
.grid-layout.has-launching .project-card:not(.is-launching) {
    opacity: .4;
    filter: saturate(.55) blur(.3px);
    transform: scale(.97);
    pointer-events: none;
    transition: opacity .32s ease, transform .32s ease, filter .32s ease;
}
.project-card.is-launching {
    animation: none !important;
    transform: scale(1.035) translateY(-4px);
    box-shadow: 0 30px 60px rgba(23,105,255,.30), var(--shadow);
    z-index: 3;
    transition: transform .35s cubic-bezier(.22,.61,.36,1), box-shadow .35s ease;
}
.project-card.is-launching .btn-view,
.project-card.is-launching .project-logo-badge {
    animation: none !important;
}
.card-launch-overlay {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(10,14,26,.58);
    backdrop-filter: blur(3px);
    color: #fff;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
}
.project-card.is-launching .card-launch-overlay {
    opacity: 1;
}
.card-launch-spinner {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    animation: cardLaunchSpin .7s linear infinite;
}
.card-launch-text {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
}
@keyframes cardLaunchSpin {
    to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
    .project-card.is-launching,
    .grid-layout.has-launching .project-card:not(.is-launching) { transition: none !important; }
    .card-launch-spinner { animation: none; opacity: .85; }
}

/* Empty state / pagination */
.empty-state {
    grid-column: 1 / -1;
    padding: 70px 20px;
    text-align: center;
    border: 1px dashed #cbd5e1;
    border-radius: 24px;
    background: var(--surface);
}
.empty-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 12px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--primary);
    background: #eef4ff;
    font-size: 24px;
}
.empty-state h2 { margin: 0 0 5px; font-size: 22px; }
.empty-state p { color: var(--muted); font-size: 13px; }
.empty-state a {
    display: inline-block;
    margin-top: 8px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}
.pagination { display: flex; justify-content: center; margin-top: 36px; }
.pagination ul {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.pagination a,
.pagination span {
    min-width: 38px;
    height: 38px;
    padding: 0 11px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-solid);
    text-decoration: none;
    font-size: 11px;
}
.pagination .current { border-color: var(--primary); background: var(--primary); color: #fff; }

/* Live search */
#projects-grid { transition: opacity .18s ease, transform .18s ease; }
#projects-grid.is-searching { opacity: .48; transform: translateY(3px); pointer-events: none; }

/* Footer */
.site-footer {
    margin-top: 72px;
    padding: 28px 20px;
    color: var(--muted);
    background: var(--chrome-solid);
    border-top: 1px solid var(--chrome-line);
    transition: background .3s ease, border-color .3s ease;
}
.footer-inner {
    width: min(100%, var(--container));
    min-height: 92px;
    margin: 0 auto;
    padding: 22px 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border: 1px solid var(--chrome-line);
    border-radius: 24px;
    background: var(--chrome-card);
    box-shadow: 0 18px 50px rgba(16,24,40,.06);
    backdrop-filter: blur(14px);
}
.footer-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.footer-mark {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: var(--primary);
    background: rgba(23,105,255,.10);
    font-size: 18px;
}
.footer-brand strong { display: block; color: var(--text); font-size: 13px; }
.footer-brand p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.footer-copy {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 9px;
    font-size: 10px;
}
.footer-copy span:first-child { color: var(--text); font-weight: 700; }
.footer-dot { opacity: .45; }

/* Dark mode */
body.dark-mode {
    --bg: #080b12;
    --surface: rgba(17,24,39,.82);
    --surface-solid: #111827;
    --text: #f8fafc;
    --muted: #98a2b3;
    --line: rgba(255,255,255,.09);
    --shadow: 0 22px 60px rgba(0,0,0,.35);
    --card-shadow: 0 10px 32px rgba(0,0,0,.20);
    --chrome-bg: rgba(18,27,48,.88);
    --chrome-solid: #121b30;
    --chrome-line: rgba(120,160,255,.16);
    --chrome-card: rgba(255,255,255,.04);
    --card-border: #4a6fb5;
    --card-ring: rgba(120,170,255,.16);
}
html.dark-preload body { background: #080b12; color: #f8fafc; }
body.dark-mode .glass-header { box-shadow: 0 6px 24px rgba(0,0,0,.35); }
body.dark-mode .project-search { background: rgba(17,24,39,.96); border-color: var(--line); }
body.dark-mode .project-search input[type='search'] { color: #fff; }
body.dark-mode .media-placeholder { background: linear-gradient(135deg,#151d2e,#111827); }
body.dark-mode .empty-icon { background: rgba(23,105,255,.14); }
body.dark-mode .project-logo-badge { box-shadow: 0 12px 28px rgba(0,0,0,.28); }
body.dark-mode .footer-inner { box-shadow: 0 22px 60px rgba(0,0,0,.25); }


/* App card motion */
@keyframes cardEnter {
    from { opacity: 0; transform: translateY(22px) scale(.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes appCardFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}
@keyframes appButtonFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}
@keyframes appButtonShine {
    0% { transform: translateX(-130%) skewX(-18deg); opacity: 0; }
    20% { opacity: .55; }
    55%, 100% { transform: translateX(180%) skewX(-18deg); opacity: 0; }
}
.project-card {
    animation: cardEnter .5s cubic-bezier(.22,.61,.36,1) both,
               appCardFloat 4.8s ease-in-out infinite;
    animation-delay: 0s,
                      calc(0.5s + var(--card-index, 0) * -0.7s);
    will-change: transform, opacity;
}
.project-card:hover {
    animation-play-state: running, paused;
}
.btn-view {
    position: relative;
    overflow: hidden;
    animation: appButtonFloat 2.8s ease-in-out infinite;
    animation-delay: calc(var(--card-index, 0) * -0.35s);
    will-change: transform;
}
.btn-view::after {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 38%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.30), transparent);
    transform: translateX(-130%) skewX(-18deg);
    animation: appButtonShine 3.8s ease-in-out infinite;
    pointer-events: none;
}
.btn-view:hover {
    animation-play-state: paused;
}
@media (prefers-reduced-motion: reduce) {
    .project-card,
    .btn-view,
    .btn-view::after { animation: none !important; }
}

@media (prefers-reduced-motion: reduce) {
    .home-hero::before,
    .home-hero::after { animation: none; }
}

/* Responsive */
@media (max-width: 980px) {
    .grid-layout { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
    .home-hero { min-height: 230px; }
}
@media (max-width: 640px) {
    .header-inner { width: calc(100% - 20px); }
    .glass-header { padding: 10px 0; }
    .header-iby-ring { width: 132px; height: 42px; }
    .header-iby-main { font-size: 12px; }
    .header-iby-sub { font-size: 6px; letter-spacing: 3px; }
    .site-name { max-width: 48vw; font-size: 13px; }
    #dark-toggle { flex-basis: 40px; width: 40px !important; height: 40px !important; }
    .home-shell { width: calc(100% - 20px); padding: 24px 0 50px; }
    .home-hero {
        min-height: 300px;
        padding: 30px 24px;
        border-radius: 24px;
        align-items: flex-start;
        flex-direction: column;
        justify-content: flex-end;
    }
    .hero-badge { display: none; }
    .project-toolbar { margin: -20px 2px 30px; }
    .project-search { min-height: 58px; padding: 6px; border-radius: 15px; }
    .search-icon { width: 34px; flex-basis: 34px; font-size: 23px; }
    .project-search input[type='search'] { height: 42px; font-size: 13px; }
    .project-search button { padding: 12px 13px; }
    .project-search button span { display: none; }
    .section-heading { align-items: flex-start; flex-direction: column; gap: 4px; margin-left: 2px; }
    .grid-layout { grid-template-columns: 1fr; gap: 16px; }
    .project-card { border-radius: 20px; }
    .project-media { min-height: 0; aspect-ratio: 16 / 10; }
    .view-chip { opacity: 1; transform: none; }
    .project-logo-row { padding: 11px 16px 0; }
    .project-logo-badge { width: 38px; height: 38px; padding: 6px; border-radius: 12px; }
    .project-logo-ring { border-radius: 15px; }
    .card-body { padding: 16px; }
    .card-body h3 { font-size: 17px; }
    .card-body p { font-size: 12px; -webkit-line-clamp: 3; }
    .site-footer { margin-top: 50px; padding: 20px 10px 18px; }
    .footer-inner { min-height: auto; padding: 20px; border-radius: 20px; flex-direction: column; align-items: flex-start; }
    .footer-copy { justify-content: flex-start; line-height: 1.5; }
}
@media (max-width: 380px) {
    .home-shell { width: calc(100% - 14px); }
    .home-hero { padding: 26px 20px; }
    .home-hero h1 { font-size: 29px; }
    .home-hero p { font-size: 12px; }
    .project-search { gap: 5px; }
    .search-icon { width: 30px; flex-basis: 30px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .iby-ring, .iby-logo-text, .iby-particle, .header-iby-ring, .header-iby-ring::before { animation: none !important; }
}


/* ===== FUNGURA APP button: igaragara neza + yerekana ko hari ibindi imbere ===== */
.btn-stack {
    --stack-gap-1: 6px;
    --stack-gap-2: 12px;
    position: relative;
    margin-top: auto;
    padding-bottom: 16px;
    isolation: isolate;
}
.btn-stack .btn-view {
    position: relative;
    z-index: 2;
    margin-top: 0;
    min-height: 52px;
    padding: 14px 18px;
    gap: 12px;
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 15px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .8px;
    background: linear-gradient(135deg, #1769ff 0%, #3b82ff 55%, #5b9bff 100%);
    box-shadow: 0 10px 24px rgba(23,105,255,.34), inset 0 1px 0 rgba(255,255,255,.35);
    animation: btnGlow 2.6s ease-in-out infinite;
    animation-delay: calc(var(--card-index, 0) * -0.35s);
    will-change: box-shadow, transform;
}
.btn-stack .btn-view:hover { animation-play-state: running; transform: translateY(-2px); }
.btn-stack .btn-view:active { transform: translateY(0) scale(.98); }
.btn-stack .btn-label { font-size: 13px; line-height: 1; transition: letter-spacing .25s ease; }

/* Agashusho ka "app grid" (utudomo 4) */
.btn-stack .btn-icon {
    width: 18px; height: 18px; flex: 0 0 18px;
    display: grid; grid-template-columns: 1fr 1fr; gap: 3px;
    font-size: 0; transition: transform .35s cubic-bezier(.22,.61,.36,1);
}
.btn-stack .btn-icon i {
    display: block; border-radius: 3px; background: #fff; opacity: .95;
    transition: transform .3s ease, border-radius .3s ease;
}
.btn-stack .btn-view:hover .btn-icon,
.btn-stack:focus-within .btn-icon { transform: rotate(90deg); }
.btn-stack .btn-view:hover .btn-icon i,
.btn-stack:focus-within .btn-icon i { border-radius: 50%; }

/* Utwambi dutatu (»») dukomeza kugenda: bwerekana ko hari ibindi imbere */
.btn-stack .btn-chevrons { display: inline-flex; align-items: center; margin-left: 2px; font-size: 0; }
.btn-stack .btn-chevrons i {
    width: 8px; height: 8px; margin-left: -2px;
    border-top: 2.5px solid #fff; border-right: 2.5px solid #fff;
    transform: rotate(45deg);
    opacity: .25;
    animation: chevronWave 1.4s ease-in-out infinite;
}
.btn-stack .btn-chevrons i:nth-child(2) { animation-delay: .18s; }
.btn-stack .btn-chevrons i:nth-child(3) { animation-delay: .36s; }
.btn-stack .btn-view:hover .btn-chevrons i,
.btn-stack:focus-within .btn-chevrons i { animation-duration: .7s; }

/* Ibice biri inyuma y'ibutto (nk'amakarita ahetse): bitangiye gusohoka iyo ukozeho */
.btn-stack .btn-layer {
    position: absolute;
    top: 0; height: 52px;
    border-radius: 15px;
    background: linear-gradient(135deg, rgba(23,105,255,.55), rgba(91,155,255,.55));
    transition: transform .4s cubic-bezier(.22,.61,.36,1), opacity .3s ease, left .4s ease, right .4s ease;
    pointer-events: none;
}
.btn-stack .btn-layer-1 { z-index: 1; left: 9px; right: 9px; opacity: .55; transform: translateY(var(--stack-gap-1)); }
.btn-stack .btn-layer-2 { z-index: 0; left: 18px; right: 18px; opacity: .30; transform: translateY(var(--stack-gap-2)); }
.btn-stack:hover .btn-layer-1,
.btn-stack:focus-within .btn-layer-1,
.project-card:hover .btn-stack .btn-layer-1,
.project-card.is-touching .btn-stack .btn-layer-1 { left: 5px; right: 5px; opacity: .8; transform: translateY(9px); }
.btn-stack:hover .btn-layer-2,
.btn-stack:focus-within .btn-layer-2,
.project-card:hover .btn-stack .btn-layer-2,
.project-card.is-touching .btn-stack .btn-layer-2 { left: 10px; right: 10px; opacity: .55; transform: translateY(18px); }
.btn-stack:hover .btn-label,
.btn-stack:focus-within .btn-label { letter-spacing: 1.2px; }

/* Iyo App itangiye gufungura: ibice bifungana bikajya mu ibutto */
.project-card.is-launching .btn-stack .btn-layer-1,
.project-card.is-launching .btn-stack .btn-layer-2 { left: 0; right: 0; opacity: 0; transform: translateY(0); }
.project-card.is-launching .btn-stack .btn-chevrons i { animation-duration: .35s; }

@keyframes btnGlow {
    0%, 100% { box-shadow: 0 10px 24px rgba(23,105,255,.30), inset 0 1px 0 rgba(255,255,255,.35); }
    50%      { box-shadow: 0 14px 32px rgba(23,105,255,.52), 0 0 0 5px rgba(23,105,255,.10), inset 0 1px 0 rgba(255,255,255,.35); }
}
@keyframes chevronWave {
    0%, 100% { opacity: .25; transform: translateX(-2px) rotate(45deg); }
    50%      { opacity: 1;   transform: translateX(3px) rotate(45deg); }
}
body.dark-mode .btn-stack .btn-view { border-color: rgba(255,255,255,.18); }
body.dark-mode .btn-stack .btn-layer { background: linear-gradient(135deg, rgba(59,130,255,.50), rgba(91,155,255,.40)); }

@media (prefers-reduced-motion: reduce) {
    .btn-stack .btn-view,
    .btn-stack .btn-chevrons i { animation: none !important; }
    .btn-stack .btn-chevrons i { opacity: .8; }
    .btn-stack .btn-layer,
    .btn-stack .btn-icon,
    .btn-stack .btn-icon i { transition: none; }
}


/* ===== Akamenyetso kagaragara ku muzenguruko wa buri card ya app ===== */
.project-card {
    border: 2px solid var(--card-border);
    box-shadow: 0 0 0 4px var(--card-ring), var(--card-shadow);
    transition: transform .28s ease, box-shadow .28s ease, border-color .28s ease;
}
.project-card:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 5px rgba(23,105,255,.22), var(--shadow);
}
body.dark-mode .project-card:hover {
    border-color: #6fa0ff;
    box-shadow: 0 0 0 5px rgba(111,160,255,.22), var(--shadow);
}
.project-card.is-launching {
    border-color: var(--primary);
    box-shadow: 0 0 0 5px rgba(23,105,255,.28), 0 30px 60px rgba(23,105,255,.30), var(--shadow);
}

/* ===== Logo hagati na hagati, izina rya app munsi yayo ===== */
.project-logo-row {
    padding: 18px 18px 0;
    justify-content: center;
}
.project-logo-badge {
    width: 68px;
    height: 68px;
    padding: 10px;
    border-radius: 20px;
}
.project-logo-ring { border-radius: 24px; inset: -5px; }
.project-logo { border-radius: 12px; }
.project-card .card-body { align-items: stretch; text-align: center; }
.project-card .card-body h3 { margin: 12px 0 8px; text-align: center; }
.project-card .card-body p { text-align: center; }
/* Niba card idafite logo, izina ntiriba rikoze ku mpera y'ifoto */
.project-card .project-media + .card-body { padding-top: 20px; }
.project-card .project-logo-row + .card-body { padding-top: 0; }
@media (max-width: 640px) {
    .project-logo-row { padding: 16px 16px 0; }
    .project-logo-badge { width: 60px; height: 60px; padding: 9px; border-radius: 18px; }
    .project-logo-ring { border-radius: 22px; }
}

/* ===== Header na Footer bihora bifite design ya dark mode (light cyangwa dark) ===== */
.glass-header,
.site-footer {
    --text: #f8fafc;
    --muted: #98a2b3;
    --line: rgba(255,255,255,.09);
    --surface: rgba(17,24,39,.82);
    --surface-solid: #111827;
    --shadow: 0 22px 60px rgba(0,0,0,.35);
    --chrome-bg: rgba(18,27,48,.92);
    --chrome-solid: #121b30;
    --chrome-line: rgba(120,160,255,.16);
    --chrome-card: rgba(255,255,255,.04);
    color: var(--text);
}
.glass-header { box-shadow: 0 6px 24px rgba(0,0,0,.35); }
.site-footer { color: var(--muted); }
.footer-inner { box-shadow: 0 22px 60px rgba(0,0,0,.25); }
#dark-toggle { box-shadow: 0 5px 20px rgba(0,0,0,.30); }
#dark-toggle:hover { box-shadow: 0 9px 24px rgba(0,0,0,.45); }
