/* ========================================================================== 
   OnTime Systems Portfolio — v2.0.1
   Uses the exact corporate navbar/footer from the main website.
   ========================================================================== */

.portfolio-page {
    background: #ffffff;
    color: #172033;
}

.portfolio-page .header {
    padding: 12px 0;
    background: rgba(255,255,255,.97);
    box-shadow: 0 5px 24px rgba(10,37,64,.07);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.portfolio-page .header .brand-name,
.portfolio-page .header .nav-link,
.portfolio-page .header .mobile-toggle {
    color: var(--navy);
}

.portfolio-page .header .brand-icon {
    border-color: rgba(10,37,64,.18);
    box-shadow: 0 8px 20px rgba(10,37,64,.10), 0 0 0 3px rgba(253,126,20,.045);
}

.portfolio-page .header .nav-link:hover,
.portfolio-page .header .nav-link.active {
    color: #0f2c4b;
}

.portfolio-main {
    padding-top: 82px;
    overflow: hidden;
}

.works-container {
    width: min(1380px, calc(100% - 48px));
    margin-inline: auto;
}

/* Hero */
.portfolio-hero {
    position: relative;
    padding: 62px 0 42px;
    border-bottom: 1px solid #edf0f4;
    background:
        radial-gradient(circle at 83% 10%, rgba(253,126,20,.08), transparent 24%),
        radial-gradient(circle at 12% 0%, rgba(10,37,64,.055), transparent 27%),
        linear-gradient(180deg, #fff 0%, #fdfefe 100%);
}

.portfolio-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: .32;
    background-image: radial-gradient(rgba(10,37,64,.16) .7px, transparent .7px);
    background-size: 22px 22px;
    mask-image: linear-gradient(to bottom, black, transparent 78%);
}

.portfolio-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 920px;
    text-align: center;
}

.portfolio-kicker {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid #e2e7ec;
    border-radius: 999px;
    color: #41536a;
    background: rgba(255,255,255,.88);
    box-shadow: 0 5px 18px rgba(15,23,42,.035);
    font-size: .78rem;
    font-weight: 800;
}

.portfolio-kicker i { color: var(--orange); }

.portfolio-hero h1 {
    max-width: 820px;
    margin: 18px auto 13px;
    color: #0a1525;
    font-size: clamp(2rem, 3.2vw, 3rem);
    line-height: 1.36;
    letter-spacing: -.025em;
    font-weight: 900;
}

.portfolio-hero h1 span { color: #33475f; }

.portfolio-hero p {
    max-width: 790px;
    margin: 0 auto;
    color: #6f7f93;
    font-size: .98rem;
    line-height: 2;
    font-weight: 500;
}

.portfolio-capabilities {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 22px;
}

.portfolio-capabilities span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    color: #526176;
    background: #f5f7f9;
    border: 1px solid #e8ecf0;
    font-size: .75rem;
    font-weight: 700;
}

.portfolio-capabilities i { color: #0f2c4b; }

/* Toolbar / filters */
.works-section { padding: 38px 0 72px; }

.works-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 26px;
}

.works-count {
    color: #78879a;
    font-size: .82rem;
    font-weight: 700;
}

.works-count strong {
    color: #0f2c4b;
    font-size: 1rem;
}

.works-filters {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-chip {
    min-height: 38px;
    padding: 0 15px;
    border: 1px solid #e2e6eb;
    border-radius: 999px;
    color: #5f6f83;
    background: #fff;
    font: 800 .78rem/1 "Cairo", sans-serif;
    cursor: pointer;
    transition: .22s ease;
}

.filter-chip:hover,
.filter-chip.active {
    border-color: #0f2c4b;
    color: #fff;
    background: #0f2c4b;
    box-shadow: 0 8px 20px rgba(15,44,75,.12);
}

/* Portfolio cards */
.works-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.work-card {
    position: relative;
    min-width: 0;
    height: 430px;
    overflow: hidden;
    padding: 21px 18px 0;
    border: 1.5px solid #dfe3e7;
    border-radius: 27px;
    background: #fff;
    box-shadow: 0 8px 28px rgba(15,23,42,.035);
    transition: transform .26s ease, box-shadow .26s ease, border-color .26s ease;
}

.work-card:hover {
    transform: translateY(-5px);
    border-color: #cfd5dc;
    box-shadow: 0 22px 48px rgba(15,23,42,.09);
}

.work-card.is-hidden { display: none; }

.card-topline {
    height: 88px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.client-logo {
    max-width: 60%;
    height: 67px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.client-logo img {
    max-width: 100%;
    max-height: 61px;
    object-fit: contain;
    object-position: right center;
}

.client-logo.text-logo strong {
    color: #111820;
    font-size: 1.18rem;
    font-weight: 900;
    line-height: 1.4;
}

.type-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 27px;
    padding: 1px 12px;
    border-radius: 999px;
    color: #101317;
    background: #efefef;
    font-size: .72rem;
    font-weight: 900;
    direction: ltr;
    white-space: nowrap;
}

.screens-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.screen-shot {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1.74 / 1;
    border: 1px solid #171b21;
    border-radius: 10px;
    background: #f8fafc;
    cursor: pointer;
    text-decoration: none;
    isolation: isolate;
}

.screen-shot::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: rgba(5, 12, 22, .24);
    opacity: 0;
    transition: opacity .25s ease;
}

.screen-shot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform .32s ease, filter .25s ease;
}

.screen-shot:hover::after,
.screen-shot:focus-visible::after {
    opacity: 1;
}

.screen-shot:hover img,
.screen-shot:focus-visible img {
    transform: scale(1.025);
}

.screen-shot:focus-visible {
    outline: 3px solid rgba(253,126,20,.32);
    outline-offset: 2px;
}

.screen-shot.placeholder {
    display: grid;
    place-items: center;
    color: #aeb8c4;
    border-color: #d8dee5;
    background: linear-gradient(135deg, #fafbfc, #eff3f7);
}

.card-overlay {
    position: absolute;
    right: 14px;
    left: 14px;
    bottom: 13px;
    min-height: 88px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 13px 15px 13px 17px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 21px;
    color: #fff;
    background: rgba(12,14,17,.72);
    box-shadow: 0 16px 35px rgba(0,0,0,.18);
    backdrop-filter: blur(18px) saturate(120%);
    -webkit-backdrop-filter: blur(18px) saturate(120%);
}

.card-overlay::before {
    content: "";
    position: absolute;
    width: 145px;
    height: 145px;
    left: -35px;
    bottom: -65px;
    border-radius: 50%;
    background: rgba(253,126,20,.16);
    filter: blur(7px);
}

.project-meta {
    position: relative;
    z-index: 1;
    min-width: 0;
    text-align: right;
}

.project-meta h2 {
    margin: 0 0 3px;
    color: #fff;
    font-size: 1.16rem;
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: -.015em;
    overflow-wrap: anywhere;
}

.project-meta span {
    display: block;
    max-width: 230px;
    overflow: hidden;
    color: rgba(255,255,255,.82);
    font-size: .73rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: right;
}

.visit-arrow {
    position: relative;
    z-index: 1;
    width: 50px;
    height: 50px;
    flex: 0 0 50px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #101317;
    background: #fff;
    font-size: 1rem;
    transition: transform .25s ease, background .25s ease, box-shadow .25s ease;
}

.visit-arrow i {
    transform: rotate(45deg);
    transition: transform .26s ease;
}

.work-card:hover .visit-arrow {
    transform: translateX(2px);
    background: #fff;
    box-shadow: 0 8px 22px rgba(0,0,0,.12);
}

.work-card:hover .visit-arrow i {
    transform: rotate(0deg);
}

/* Empty state */
.works-empty {
    max-width: 980px;
    min-height: 290px;
    margin: 4px auto 0;
    display: grid;
    grid-template-columns: .82fr 1.18fr;
    align-items: center;
    gap: 38px;
    padding: 38px 44px;
    border: 1px solid #e1e6eb;
    border-radius: 28px;
    background: linear-gradient(135deg, #fbfcfd, #fff);
    box-shadow: 0 16px 44px rgba(15,23,42,.045);
}

.empty-visual {
    position: relative;
    min-height: 200px;
    display: grid;
    place-items: center;
}

.mini-browser {
    position: absolute;
    width: 190px;
    height: 118px;
    border: 1px solid #d8e0e8;
    border-radius: 15px;
    background:
        linear-gradient(#f0f3f7 0 22px, transparent 22px),
        linear-gradient(135deg, rgba(15,44,75,.08), rgba(253,126,20,.06)),
        #fff;
    box-shadow: 0 12px 30px rgba(10,37,64,.08);
}

.mini-browser::after {
    content: "";
    position: absolute;
    top: 8px;
    right: 12px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #fd7e14;
    box-shadow: 10px 0 #cbd5df, 20px 0 #cbd5df;
}

.mini-browser-one { transform: translate(-34px, 25px) rotate(-6deg); }
.mini-browser-two { transform: translate(34px, -25px) rotate(5deg); }

.empty-icon {
    position: relative;
    z-index: 2;
    width: 68px;
    height: 68px;
    display: grid;
    place-items: center;
    border-radius: 21px;
    color: #fff;
    background: #0f2c4b;
    box-shadow: 0 14px 28px rgba(15,44,75,.24);
    font-size: 1.38rem;
}

.empty-copy { text-align: right; }
.empty-label {
    display: inline-flex;
    margin-bottom: 9px;
    color: var(--orange);
    font-size: .75rem;
    font-weight: 900;
    letter-spacing: .04em;
}

.works-empty h2 {
    margin: 0 0 8px;
    color: #0f2c4b;
    font-size: 1.55rem;
    line-height: 1.5;
}

.works-empty p {
    margin: 0 0 18px;
    color: #718096;
    font-size: .9rem;
    line-height: 1.9;
}

.empty-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 43px;
    padding: 0 17px;
    border-radius: 12px;
    color: #fff;
    background: #0f2c4b;
    font-size: .82rem;
    font-weight: 800;
}

/* CTA before the same corporate footer */
.portfolio-cta-section { padding: 0 0 70px; }

.portfolio-cta-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 20px;
    padding: 28px 30px;
    overflow: hidden;
    border-radius: 25px;
    color: #fff;
    background:
        radial-gradient(circle at 8% 10%, rgba(253,126,20,.30), transparent 27%),
        linear-gradient(135deg, #0f2c4b, #071a2f);
    box-shadow: 0 18px 42px rgba(10,37,64,.17);
}

.portfolio-cta-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    color: #0f2c4b;
    background: #fff;
    font-size: 1.2rem;
}

.portfolio-cta-copy span {
    color: #b8c9da;
    font-size: .76rem;
    font-weight: 700;
}

.portfolio-cta-copy h2 {
    margin: 4px 0 0;
    color: #fff;
    font-size: 1.35rem;
    line-height: 1.5;
}

.portfolio-cta-button {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 18px;
    border-radius: 12px;
    color: #0f2c4b;
    background: #fff;
    font-size: .82rem;
    font-weight: 900;
    white-space: nowrap;
}

@media (max-width: 1180px) {
    .works-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .work-card { height: 440px; }
}

@media (max-width: 992px) {
    .portfolio-page .header .nav-menu .nav-link { color: rgba(255,255,255,.86); }
    .portfolio-page .header .nav-menu .nav-link:hover,
    .portfolio-page .header .nav-menu .nav-link.active { color: #fff; }
    .portfolio-page .header .nav-menu .nav-link::after { background: var(--orange); }
    .portfolio-main { padding-top: 76px; }
    .works-container { width: min(100% - 36px, 860px); }
    .portfolio-hero { padding: 50px 0 34px; }
    .portfolio-hero h1 { font-size: clamp(1.8rem, 5.6vw, 2.55rem); }
}

@media (max-width: 720px) {
    .works-container { width: min(100% - 26px, 560px); }
    .portfolio-main { padding-top: 72px; }
    .portfolio-hero { padding: 38px 0 28px; }
    .portfolio-kicker { min-height: 34px; font-size: .72rem; }
    .portfolio-hero h1 {
        margin-top: 14px;
        font-size: clamp(1.65rem, 8.2vw, 2.2rem);
        line-height: 1.45;
    }
    .portfolio-hero p { font-size: .87rem; line-height: 1.9; }
    .portfolio-capabilities { margin-top: 17px; }
    .portfolio-capabilities span { min-height: 31px; font-size: .69rem; }
    .works-section { padding: 26px 0 50px; }
    .works-toolbar { align-items: flex-start; flex-direction: column; gap: 10px; }
    .works-filters {
        width: 100%;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
        scrollbar-width: none;
    }
    .works-filters::-webkit-scrollbar { display: none; }
    .filter-chip { flex: 0 0 auto; }
    .works-grid { grid-template-columns: 1fr; gap: 16px; }
    .work-card { height: 376px; padding: 17px 13px 0; border-radius: 24px; }
    .card-topline { height: 81px; padding-inline: 2px; }
    .client-logo { height: 59px; max-width: 61%; }
    .client-logo img { max-height: 54px; }
    .client-logo.text-logo strong { font-size: 1.05rem; }
    .type-badge { min-height: 26px; padding-inline: 11px; font-size: .69rem; }
    .screens-grid { gap: 7px; }
    .screen-shot { border-radius: 9px; }
    .card-overlay { right: 9px; left: 9px; bottom: 9px; min-height: 84px; border-radius: 20px; padding: 12px 14px; }
    .project-meta h2 { font-size: 1.05rem; }
    .project-meta span { font-size: .69rem; max-width: 190px; }
    .visit-arrow { width: 48px; height: 48px; flex-basis: 48px; }
    .works-empty {
        min-height: auto;
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 27px 22px;
        border-radius: 24px;
    }
    .empty-visual { min-height: 160px; }
    .mini-browser { width: 156px; height: 96px; }
    .empty-copy { text-align: center; }
    .works-empty h2 { font-size: 1.25rem; }
    .works-empty p { font-size: .84rem; }
    .portfolio-cta-section { padding-bottom: 48px; }
    .portfolio-cta-card {
        grid-template-columns: auto 1fr;
        padding: 23px 20px;
        gap: 15px;
        border-radius: 22px;
    }
    .portfolio-cta-copy h2 { font-size: 1.08rem; }
    .portfolio-cta-button { grid-column: 1 / -1; width: 100%; }
}
