/*
 * Masaken Aljazeera — Design System 2026
 * Architectural editorial interface layered over the legacy stylesheet.
 */

:root {
    --logo-deep: #052bbf;
    --logo-royal: #083bd7;
    --logo-blue: #1260df;
    --logo-sky: #35afea;
    --logo-ice: #eaf8ff;
    --d26-ink: #071f56;
    --d26-muted: #607189;
    --d26-blue: var(--logo-royal);
    --d26-blue-2: var(--logo-sky);
    --d26-sky: #d9f3ff;
    --d26-surface: rgba(255, 255, 255, 0.88);
    --d26-surface-solid: #ffffff;
    --d26-canvas: #eef8ff;
    --d26-line: rgba(5, 43, 191, 0.13);
    --d26-shadow: 0 18px 50px rgba(5, 43, 191, 0.09);
    --d26-shadow-hover: 0 28px 70px rgba(5, 43, 191, 0.15);
    --d26-radius-sm: 14px;
    --d26-radius: 24px;
    --d26-radius-lg: 36px;
    --d26-ease: cubic-bezier(.2, .8, .2, 1);
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 110px;
}

body {
    color: var(--d26-ink);
    background:
        radial-gradient(circle at 9% 4%, rgba(53, 175, 234, 0.14), transparent 28rem),
        radial-gradient(circle at 92% 24%, rgba(5, 43, 191, 0.09), transparent 30rem),
        var(--d26-canvas);
    font-family: 'Tajawal', 'Cairo', system-ui, sans-serif;
    line-height: 1.75;
    margin-top: 108px;
    overflow-x: clip;
}

body::before {
    display: none;
}

::selection {
    color: #fff;
    background: var(--d26-blue);
}

img {
    max-width: 100%;
}

a,
button {
    -webkit-tap-highlight-color: transparent;
}

/* Header */
.header {
    top: 14px;
    left: max(14px, calc((100vw - 1480px) / 2));
    right: max(14px, calc((100vw - 1480px) / 2));
    width: auto;
    min-height: 76px;
    display: flex;
    align-items: center;
    overflow: visible;
    border: 1px solid rgba(255, 255, 255, 0.92);
    border-radius: 23px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 14px 45px rgba(28, 62, 105, 0.12);
    backdrop-filter: blur(22px) saturate(150%);
    -webkit-backdrop-filter: blur(22px) saturate(150%);
    transition: min-height .35s var(--d26-ease), top .35s var(--d26-ease),
        background .35s ease, box-shadow .35s ease;
}

.header::before {
    display: none;
}

.header.scrolled {
    top: 8px;
    min-height: 64px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 12px 36px rgba(28, 62, 105, 0.15);
}

.header-content {
    min-height: 74px;
    padding: 7px 13px 7px 7px;
}

.header-content > a {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    overflow: hidden;
}

.header .logo {
    width: auto;
    height: 58px;
    max-height: 58px;
    object-fit: contain;
    border-radius: 12px;
    transition: height .35s var(--d26-ease), transform .25s ease;
}

.header.scrolled .logo {
    height: 47px;
    max-height: 47px;
}

.nav {
    min-width: 0;
    align-self: stretch;
}

.nav-content {
    max-width: none;
    justify-content: flex-start;
    padding: 0 4px 0 14px;
}

.nav-menu {
    width: 100%;
    justify-content: flex-start;
    gap: 2px;
}

.nav-link {
    margin: 0;
    padding: .68rem .82rem;
    color: #284364;
    border: 1px solid transparent;
    border-radius: 13px;
    font-size: clamp(.71rem, .75vw, .88rem);
    font-weight: 700;
    font-family: 'Tajawal', 'Cairo', system-ui, sans-serif;
    letter-spacing: -.02em;
    transition: color .22s ease, background .22s ease, border-color .22s ease,
        transform .22s var(--d26-ease);
}

.nav-link::before,
.nav-link::after {
    display: none;
}

.nav-link:hover {
    color: var(--d26-blue);
    border-color: var(--d26-line);
    background: rgba(23, 105, 224, .065);
    transform: translateY(-1px);
    box-shadow: none;
}

.nav-link.active {
    color: #fff;
    border-color: var(--d26-blue);
    background: linear-gradient(135deg, var(--logo-deep), var(--logo-sky));
    box-shadow: 0 8px 20px rgba(5, 43, 191, .20);
    transform: none;
}

.progress-bar {
    height: 3px;
    background: linear-gradient(90deg, #69c0ff, var(--d26-blue));
}

/* Page frame */
.main-content {
    width: min(100% - 32px, 1480px);
    max-width: 1480px;
    margin: 0 auto;
    padding: 18px 0 70px;
    overflow: clip;
}

.section,
.band {
    margin-bottom: clamp(22px, 3vw, 46px);
}

.section {
    padding: clamp(24px, 3.4vw, 52px);
    border: 1px solid rgba(255, 255, 255, .9);
    border-radius: var(--d26-radius-lg);
    background: rgba(255, 255, 255, .78);
    box-shadow: var(--d26-shadow);
    backdrop-filter: blur(16px);
}

.section::before {
    display: none;
}

.section:hover {
    transform: none;
    box-shadow: var(--d26-shadow);
}

.section h1,
.section h2,
.section-head h2,
.page-hero h1,
.project-hero h1,
.map-page-header h1,
.project-title,
.project-card h3,
.certificate-card h3,
.team-card h3,
.service-card h3,
.why-card h3,
.value-card h3 {
    font-family: 'Noto Kufi Arabic', 'Tajawal', 'Cairo', system-ui, sans-serif;
    color: var(--d26-ink);
    letter-spacing: -.035em;
    line-height: 1.3;
}

.section h1 {
    font-size: clamp(2.2rem, 5vw, 5rem);
    font-weight: 900;
}

.section h2,
.section-head h2 {
    font-size: clamp(1.85rem, 3.2vw, 3.2rem);
    font-weight: 900;
}

.section h2::after {
    width: 34px;
    height: 4px;
    margin-top: 14px;
    border-radius: 10px;
    background: linear-gradient(90deg, var(--d26-blue), #73c6ff);
}

.section p,
.section-head p {
    color: var(--d26-muted);
    font-size: clamp(.96rem, 1.2vw, 1.08rem);
    line-height: 2;
}

.band {
    padding: clamp(34px, 5vw, 72px);
    border: 1px solid rgba(255, 255, 255, .8);
    border-radius: var(--d26-radius-lg);
    background: rgba(255, 255, 255, .56);
    box-shadow: 0 15px 55px rgba(30, 67, 113, .07);
    backdrop-filter: blur(14px);
}

.section-head {
    max-width: 810px;
    margin: 0 0 clamp(28px, 4vw, 52px) auto;
    text-align: right;
}

.section-head p {
    margin-inline: 0;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 13px;
    border: 1px solid rgba(23, 105, 224, .15);
    border-radius: 999px;
    color: var(--d26-blue);
    background: rgba(23, 105, 224, .07);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .02em;
}

.eyebrow::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #53adff;
    box-shadow: 0 0 0 5px rgba(83, 173, 255, .12);
}

/* Homepage hero */
.home-page {
    margin-top: 108px;
}

body.projects-index,
body.certificates-page,
body.team-page,
body.contact-page,
body.maps-page,
body.project-detail {
    margin-top: 108px;
}

.home-page .main-content {
    padding-top: 6px;
}

.hero {
    min-height: min(790px, calc(100svh - 122px));
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    margin-bottom: clamp(25px, 4vw, 56px);
    padding: clamp(32px, 6vw, 86px);
    border-radius: 42px;
    text-align: right;
    isolation: isolate;
    box-shadow: 0 32px 80px rgba(15, 55, 105, .18);
}

.hero::before {
    content: '';
    position: absolute;
    inset: auto auto 0 0;
    width: min(40vw, 560px);
    aspect-ratio: 1;
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 50%;
    transform: translate(-35%, 38%);
    pointer-events: none;
}

.hero::after {
    content: '25';
    position: absolute;
    top: clamp(30px, 5vw, 70px);
    left: clamp(28px, 5vw, 72px);
    z-index: 2;
    color: rgba(255, 255, 255, .10);
    font-size: clamp(8rem, 20vw, 20rem);
    font-weight: 900;
    line-height: .8;
    letter-spacing: -.1em;
    pointer-events: none;
}

.hero-slides {
    border-radius: 42px;
}

.hero-slide {
    background-position:
        calc(50% + var(--hero-x, 0%))
        calc(50% + var(--hero-y, 0%));
}

.hero-slides::after {
    background:
        linear-gradient(90deg, rgba(7, 26, 54, .14), rgba(8, 31, 67, .36) 52%, rgba(6, 25, 55, .76)),
        linear-gradient(0deg, rgba(3, 18, 40, .72), transparent 58%);
}

.hero-content {
    width: min(100%, 920px);
    margin: 0;
    padding: 0;
    text-align: right;
    min-width: 0;
}

.hero .eyebrow {
    color: #fff !important;
    border-color: rgba(255, 255, 255, .24);
    background: rgba(255, 255, 255, .10) !important;
    backdrop-filter: blur(10px);
}

.hero .eyebrow::before {
    background: #8bd2ff;
}

.hero h1 {
    max-width: none;
    margin: 18px 0 14px;
    font-size: clamp(2.4rem, 4.8vw, 4.7rem);
    font-weight: 900;
    line-height: 1.02;
    letter-spacing: -.065em;
    text-shadow: 0 12px 35px rgba(0, 0, 0, .24);
    animation: none;
    white-space: nowrap;
}

.hero p {
    max-width: 760px;
    margin: 0;
    color: rgba(255, 255, 255, .88);
    font-size: clamp(1rem, 1.7vw, 1.32rem);
    line-height: 1.95;
}

.hero-actions {
    justify-content: flex-start;
    margin-top: 26px;
}

.cta-button,
.project-link,
.submit-btn,
.back-btn {
    min-height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: .82rem 1.45rem;
    border: 1px solid transparent;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, var(--d26-blue), var(--d26-blue-2));
    box-shadow: 0 12px 28px rgba(23, 105, 224, .20);
    font-weight: 800;
    text-decoration: none;
    transition: transform .25s var(--d26-ease), box-shadow .25s ease, background .25s ease;
}

.cta-button:hover,
.project-link:hover,
.submit-btn:hover,
.back-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 35px rgba(23, 105, 224, .28);
}

.cta-button.secondary {
    color: #fff;
    border-color: rgba(255, 255, 255, .35);
    background: rgba(255, 255, 255, .10);
    box-shadow: none;
    backdrop-filter: blur(12px);
}

.hero-stats {
    width: min(100%, 850px);
    justify-content: flex-start;
    gap: 0;
    margin-top: 35px;
    padding: 18px 0 0;
}

.hero-stat {
    min-width: 150px;
    padding: 0 20px;
    border-left: 1px solid rgba(255, 255, 255, .22);
}

.hero-stat:first-child {
    padding-right: 0;
}

.hero-stat:last-child {
    border-left: 0;
}

.hero-stat .num {
    font-size: clamp(1.75rem, 3vw, 2.8rem);
}

.hero-stat .label {
    color: rgba(255, 255, 255, .72);
    font-size: .78rem;
}

/* Bento grids */
.values-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 16px;
}

.value-card {
    grid-column: span 4;
    min-height: 180px;
    padding: 26px;
    border: 1px solid var(--d26-line);
    border-radius: var(--d26-radius);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .96), rgba(239, 246, 255, .72));
    box-shadow: none;
}

.value-card:hover {
    transform: translateY(-5px);
    border-color: rgba(23, 105, 224, .28);
    box-shadow: var(--d26-shadow);
}

.value-card h3 {
    color: var(--d26-ink);
    font-size: 1.1rem;
}

.services-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 16px;
}

.service-card {
    grid-column: span 4;
    min-height: 235px;
    padding: 28px;
    border: 1px solid rgba(23, 105, 224, .11);
    border-radius: 26px;
    background:
        radial-gradient(circle at 0 0, rgba(101, 177, 255, .13), transparent 48%),
        rgba(255, 255, 255, .82);
    box-shadow: none;
}

.service-card:nth-child(1),
.service-card:nth-child(4) {
    grid-column: span 6;
}

.service-card:nth-child(1) {
    color: #fff;
    background:
        radial-gradient(circle at 20% 0, rgba(116, 203, 255, .38), transparent 42%),
        linear-gradient(135deg, #0c4da8, #1876ee);
}

.service-card:nth-child(1) h3,
.service-card:nth-child(1) p {
    color: #fff;
}

.service-card:hover {
    transform: translateY(-7px);
    border-color: rgba(23, 105, 224, .27);
    box-shadow: var(--d26-shadow-hover);
}

.service-card .icon,
.why-card .icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    margin-bottom: 35px;
    border: 1px solid rgba(23, 105, 224, .13);
    border-radius: 16px;
    background: rgba(23, 105, 224, .08);
    font-size: 1.45rem;
}

.service-card h3 {
    color: var(--d26-ink);
    font-size: 1.15rem;
}

.service-card p {
    color: var(--d26-muted);
}

.featured-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-auto-rows: 245px;
    gap: 16px;
}

.featured-card {
    grid-column: span 4;
    height: auto;
    min-height: 245px;
    border-radius: 28px;
    box-shadow: none;
}

.featured-card:nth-child(1),
.featured-card:nth-child(4) {
    grid-column: span 8;
}

.featured-card:nth-child(1) {
    grid-row: span 2;
}

.featured-card:nth-child(2),
.featured-card:nth-child(3) {
    grid-column: span 4;
}

.featured-card::after {
    background: linear-gradient(0deg, rgba(3, 17, 38, .92), rgba(3, 17, 38, .06) 72%);
}

.featured-card .overlay {
    padding: 26px;
}

.featured-card h3 {
    max-width: 90%;
    font-size: clamp(1.1rem, 1.8vw, 1.65rem);
}

.featured-card .tag {
    border: 1px solid rgba(255, 255, 255, .20);
    background: rgba(255, 255, 255, .12);
    backdrop-filter: blur(10px);
}

.why-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.why-card {
    min-height: 220px;
    padding: 28px;
    border: 1px solid var(--d26-line);
    border-radius: 24px;
    background: rgba(255, 255, 255, .72);
}

.why-card:hover {
    transform: translateY(-6px);
    background: #fff;
    box-shadow: var(--d26-shadow);
}

/* Partners */
.partners-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
}

.partner-item {
    min-height: 105px;
    padding: 14px;
    border: 1px solid rgba(31, 69, 116, .08);
    border-radius: 18px;
    background: rgba(255, 255, 255, .76);
    box-shadow: none;
}

.partner-item img {
    max-height: 72px;
    filter: grayscale(1);
    opacity: .68;
    transition: filter .3s ease, opacity .3s ease, transform .3s var(--d26-ease);
}

.partner-item:hover {
    transform: translateY(-4px);
    border-color: rgba(23, 105, 224, .20);
    box-shadow: 0 14px 35px rgba(31, 69, 116, .10);
}

.partner-item:hover img {
    filter: none;
    opacity: 1;
    transform: scale(1.04);
}

/* Projects index */
.projects-index .main-content > .section:first-child,
.certificates-page .main-content > .section:first-child,
.contact-page .main-content > .section:first-child {
    position: relative;
    overflow: hidden;
    padding-top: clamp(42px, 7vw, 95px);
}

.projects-index .main-content > .section:first-child::after,
.certificates-page .main-content > .section:first-child::after,
.contact-page .main-content > .section:first-child::after {
    content: '';
    position: absolute;
    top: -160px;
    left: -80px;
    width: 440px;
    height: 440px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59, 140, 255, .16), transparent 68%);
    pointer-events: none;
}

.project-filters {
    position: sticky;
    top: 96px;
    z-index: 20;
    display: flex;
    gap: 8px;
    margin: 30px 0;
    padding: 8px;
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, .85);
    border-radius: 18px;
    background: rgba(255, 255, 255, .82);
    box-shadow: 0 10px 35px rgba(30, 67, 113, .08);
    backdrop-filter: blur(18px);
}

.filter-btn {
    flex: 0 0 auto;
    padding: .72rem 1.15rem;
    border: 1px solid transparent;
    border-radius: 12px;
    color: #405776;
    background: transparent;
    box-shadow: none;
}

.filter-btn:hover {
    color: var(--d26-blue);
    border-color: var(--d26-line);
    background: rgba(23, 105, 224, .06);
    transform: none;
}

.filter-btn.active {
    color: #fff;
    background: linear-gradient(135deg, var(--d26-blue), var(--d26-blue-2));
    box-shadow: 0 8px 22px rgba(23, 105, 224, .20);
}

.projects-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.project-card {
    min-width: 0;
    overflow: hidden;
    padding: 0;
    border: 1px solid rgba(23, 105, 224, .10);
    border-radius: 26px;
    background: #fff;
    box-shadow: 0 12px 35px rgba(29, 65, 110, .08);
}

.project-card[hidden] {
    display: none !important;
}

.project-card::before {
    display: none;
}

.project-card:hover {
    transform: translateY(-8px);
    border-color: rgba(23, 105, 224, .24);
    box-shadow: var(--d26-shadow-hover);
}

.project-thumb {
    height: 235px;
    border-radius: 0;
}

.project-card:hover .project-thumb img {
    transform: scale(1.055);
}

.project-info {
    padding: 23px;
}

.project-info h3 {
    min-height: 3.2em;
    margin-bottom: 10px;
    color: var(--d26-ink);
    font-size: 1.02rem;
    line-height: 1.65;
}

.project-info p {
    min-height: 3.4em;
    color: var(--d26-muted);
    font-size: .88rem;
    line-height: 1.75;
}

.project-link {
    min-height: 42px;
    margin-top: 14px;
    padding: .6rem 1rem;
    border-radius: 11px;
    font-size: .84rem;
}

/* Project details */
.project-detail {
    margin-top: 108px;
}

.project-detail .main-content {
    max-width: 1320px;
}

.project-hero,
body:has(.project-hero) .project-hero {
    min-height: 440px;
    display: flex;
    align-items: flex-end;
    margin-bottom: 22px;
    padding: clamp(35px, 6vw, 72px) !important;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: var(--d26-radius-lg) !important;
    text-align: right;
    background:
        radial-gradient(circle at 12% 5%, rgba(122, 201, 255, .32), transparent 35%),
        linear-gradient(135deg, #0a376f, #1670d8 62%, #53a9f8) !important;
    box-shadow: 0 26px 70px rgba(14, 61, 124, .20);
}

.project-hero::after {
    content: 'PROJECT';
    position: absolute;
    top: 25px;
    left: 34px;
    color: rgba(255, 255, 255, .13);
    font-size: clamp(3rem, 9vw, 8rem);
    font-weight: 900;
    letter-spacing: -.07em;
}

.project-hero .hero-content {
    max-width: 940px;
    margin: 0;
    text-align: right;
}

.project-hero h1,
body:has(.project-hero) .project-hero h1 {
    max-width: 950px;
    color: #fff;
    font-size: clamp(2rem, 4.8vw, 4.8rem);
    line-height: 1.28;
    letter-spacing: -.045em;
    animation: none;
}

.project-hero p {
    color: rgba(255, 255, 255, .78);
}

body:has(.project-hero) .values-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

body:has(.project-hero) .value-card {
    grid-column: auto;
    min-height: 120px;
    padding: 20px;
    border-radius: 18px;
}

body:has(.project-hero) .section {
    padding: clamp(24px, 4vw, 48px);
    border-radius: 30px;
}

.gallery-section,
.owner-logo-section,
.map-section {
    margin-bottom: 22px;
    padding: clamp(24px, 4vw, 48px);
    border: 1px solid rgba(255, 255, 255, .9);
    border-radius: 30px;
    background: rgba(255, 255, 255, .80);
    box-shadow: var(--d26-shadow);
}

.pgallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.pgallery a {
    border-radius: 19px;
    box-shadow: none;
}

.map-container {
    border-radius: 22px;
    box-shadow: none;
}

/* Certificates, team and contact */
.certificate-card,
.team-member,
.equipment-card,
.contact-form {
    border: 1px solid var(--d26-line);
    border-radius: 24px;
    background: rgba(255, 255, 255, .82);
    box-shadow: none;
}

.certificate-card:hover,
.team-member:hover,
.equipment-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--d26-shadow);
}

.form-group input,
.form-group textarea {
    min-height: 52px;
    border: 1px solid rgba(31, 69, 116, .16);
    border-radius: 13px;
    background: rgba(255, 255, 255, .9);
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--d26-blue);
    box-shadow: 0 0 0 4px rgba(23, 105, 224, .10);
    transform: none;
}

/* Utility controls */
.theme-toggle,
.back-to-top {
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255, 255, 255, .85);
    border-radius: 15px;
    color: var(--d26-blue);
    background: rgba(255, 255, 255, .84);
    box-shadow: 0 10px 28px rgba(22, 58, 104, .12);
    backdrop-filter: blur(14px);
}

.theme-toggle {
    right: auto;
    left: 22px;
    bottom: 78px;
    top: auto;
}

.back-to-top {
    right: auto;
    left: 22px;
    bottom: 22px;
}

.loading {
    background: rgba(245, 249, 255, .96);
    backdrop-filter: blur(18px);
}

.loading-spinner {
    border-color: rgba(23, 105, 224, .14);
    border-top-color: var(--d26-blue);
}

/* Branded loading mark */
.loading,
.loading-screen {
    background:
        radial-gradient(circle at 50% 42%, rgba(53, 175, 234, .18), transparent 18rem),
        linear-gradient(180deg, rgba(246, 251, 255, .98), rgba(232, 246, 255, .96)) !important;
}

.loading-spinner {
    position: relative;
    width: 112px;
    height: 112px;
    border: 0;
    border-radius: 30px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .92), rgba(232, 246, 255, .74));
    box-shadow:
        0 24px 70px rgba(5, 43, 191, .16),
        inset 0 1px 0 rgba(255, 255, 255, .82);
    animation: msakenLoaderPulse 1.8s ease-in-out infinite;
}

.loading-spinner::before {
    content: '';
    position: absolute;
    inset: 19px;
    z-index: 2;
    background: url('images/logo-msaken.png') center / contain no-repeat;
    filter: drop-shadow(0 10px 18px rgba(5, 43, 191, .20));
    animation: msakenLogoFloat 1.8s ease-in-out infinite;
}

.loading-spinner::after {
    content: '';
    position: absolute;
    inset: -8px;
    border: 3px solid rgba(53, 175, 234, .14);
    border-top-color: var(--logo-deep, #052bbf);
    border-left-color: var(--logo-sky, #35afea);
    border-radius: 36px;
    animation: spin 1.15s linear infinite;
}

.loading-screen {
    color: var(--logo-deep, #052bbf) !important;
}

.loading-screen h2 {
    margin-top: 24px;
    color: var(--logo-deep, #052bbf);
    font-size: clamp(1rem, 2vw, 1.35rem);
    font-weight: 800;
}

@keyframes msakenLoaderPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.035);
    }
}

@keyframes msakenLogoFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
}

/* Footer */
.footer {
    width: min(100% - 32px, 1480px);
    margin: 0 auto 16px;
    padding: 28px clamp(20px, 4vw, 52px);
    overflow: hidden;
    border-radius: 28px;
    background:
        radial-gradient(circle at 0 0, rgba(103, 186, 255, .22), transparent 35%),
        linear-gradient(135deg, #0b315f, #135fb8);
    box-shadow: 0 22px 60px rgba(15, 56, 108, .18);
}

.footer::before {
    opacity: .25;
}

.footer-content {
    max-width: 1400px;
    text-align: right;
}

.footer h3 {
    margin-bottom: 5px;
    color: #fff;
    font-size: 1.2rem;
    animation: none;
}

.footer p {
    margin: 2px 0;
    color: rgba(255, 255, 255, .72);
    font-size: .78rem;
}

/* Motion */
[data-d26-reveal] {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity .75s var(--d26-ease), transform .75s var(--d26-ease);
    transition-delay: var(--d26-delay, 0ms);
}

[data-d26-reveal].is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Safety: internal pages must never stay blank if reveal observer is delayed/blocked. */
body.d26-ready:not(.home-page) [data-d26-reveal] {
    opacity: 1;
    transform: none;
    transition-delay: 0ms;
}

.d26-menu-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 998;
    padding: 0;
    border: 0;
    background: rgba(5, 20, 43, .34);
    backdrop-filter: blur(3px);
    opacity: 0;
}

.d26-menu-backdrop.active {
    display: block;
    opacity: 1;
}

/* Dark mode */
[data-theme="dark"] {
    --d26-ink: #eef6ff;
    --d26-muted: #a8b7ca;
    --d26-canvas: #071323;
    --d26-surface: rgba(12, 28, 49, .82);
    --d26-surface-solid: #0d1d32;
    --d26-line: rgba(104, 176, 255, .16);
}

[data-theme="dark"] body {
    background:
        radial-gradient(circle at 10% 4%, rgba(31, 111, 209, .18), transparent 30rem),
        #071323;
}

[data-theme="dark"] .header {
    border-color: rgba(255, 255, 255, .08);
    background: rgba(9, 24, 43, .88);
}

[data-theme="dark"] .nav-link {
    color: #c4d4e8;
}

[data-theme="dark"] .section,
[data-theme="dark"] .band,
[data-theme="dark"] .gallery-section,
[data-theme="dark"] .owner-logo-section,
[data-theme="dark"] .map-section {
    border-color: rgba(255, 255, 255, .06);
    background: rgba(12, 29, 51, .78);
}

[data-theme="dark"] .service-card,
[data-theme="dark"] .why-card,
[data-theme="dark"] .value-card,
[data-theme="dark"] .project-card,
[data-theme="dark"] .partner-item {
    color: var(--d26-ink);
    border-color: rgba(104, 176, 255, .13);
    background: rgba(15, 34, 58, .82);
}

[data-theme="dark"] .section h1,
[data-theme="dark"] .section h2,
[data-theme="dark"] .section-head h2,
[data-theme="dark"] .service-card h3,
[data-theme="dark"] .why-card h3,
[data-theme="dark"] .value-card h3,
[data-theme="dark"] .project-info h3 {
    color: var(--d26-ink);
}

/* Responsive */
@media (max-width: 1180px) {
    .header {
        left: 10px;
        right: 10px;
    }

    .nav-link {
        padding-inline: .55rem;
        font-size: .72rem;
    }

    .services-grid,
    .featured-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .service-card,
    .service-card:nth-child(1),
    .service-card:nth-child(4) {
        grid-column: span 3;
    }

    .featured-card,
    .featured-card:nth-child(1),
    .featured-card:nth-child(2),
    .featured-card:nth-child(3),
    .featured-card:nth-child(4) {
        grid-column: span 3;
        grid-row: span 1;
    }

    .projects-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    html {
        font-size: 94%;
        scroll-padding-top: 84px;
    }

    body,
    .home-page,
    .project-detail {
        margin-top: 84px;
    }

    body.projects-index,
    body.certificates-page,
    body.team-page,
    body.contact-page,
    body.maps-page,
    body.project-detail {
        margin-top: 84px;
    }

    .header {
        top: 8px;
        left: 8px;
        right: 8px;
        min-height: 66px;
        border-radius: 19px;
    }

    .header-content {
        min-height: 64px;
        justify-content: center;
        padding: 5px 10px;
    }

    .header .logo,
    .header.scrolled .logo {
        height: 50px;
        max-height: 50px;
    }

    .mobile-menu-toggle {
        position: absolute;
        right: 13px;
        order: 0;
        width: 36px;
        height: 36px;
        padding: 7px;
        border: 1px solid var(--d26-line);
        border-radius: 11px;
        background: rgba(23, 105, 224, .06);
    }

    .nav.mobile-active {
        top: 82px;
        right: 8px;
        width: 50vw;
        min-width: 0;
        height: auto !important;
        max-height: calc(100svh - 92px);
        padding: 8px;
        overflow-y: auto;
        border: 1px solid rgba(255, 255, 255, .9);
        border-radius: 18px;
        background: rgba(255, 255, 255, .96);
        box-shadow: 0 24px 65px rgba(17, 54, 104, .22);
        backdrop-filter: blur(24px);
    }

    .nav-link {
        padding: .9rem .8rem;
        font-size: .78rem;
        border-radius: 10px;
        white-space: normal;
        line-height: 1.45;
    }

    [data-theme="dark"] .nav.mobile-active {
        border-color: rgba(255, 255, 255, .08);
        background: rgba(9, 24, 43, .97);
    }

    .main-content {
        width: min(100% - 16px, 1480px);
        padding-bottom: 35px;
    }

    .hero {
        min-height: calc(100svh - 100px);
        padding: 34px 22px;
        border-radius: 28px;
    }

    .hero-slides {
        border-radius: 28px;
    }

    .hero::after {
        top: 30px;
        left: 20px;
        font-size: 8rem;
    }

    .hero h1 {
        font-size: clamp(1.35rem, 6vw, 2rem);
        letter-spacing: -.055em;
        white-space: nowrap;
    }

    .hero p {
        font-size: .96rem;
        line-height: 1.8;
    }

    .hero-actions {
        gap: 8px;
        width: 100%;
        max-width: 100%;
    }

    .cta-button {
        min-height: 46px;
        padding: .72rem 1rem;
        font-size: .84rem;
    }

    .hero-stats {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 13px;
        border-top: 0;
    }

    .hero-stat {
        min-width: 0;
        padding: 10px 12px;
        border: 1px solid rgba(255, 255, 255, .15) !important;
        border-radius: 14px;
        background: rgba(255, 255, 255, .07);
        backdrop-filter: blur(10px);
    }

    .section,
    .band {
        padding: 25px 18px;
        border-radius: 25px;
    }

    .section-head {
        margin-bottom: 26px;
    }

    .values-grid,
    .services-grid,
    .featured-grid,
    .why-grid {
        display: grid;
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
    }

    .value-card,
    .service-card,
    .service-card:nth-child(n),
    .featured-card,
    .featured-card:nth-child(n),
    .why-card {
        grid-column: auto;
        grid-row: auto;
    }

    .service-card,
    .why-card,
    .value-card {
        min-height: 0;
        padding: 22px;
    }

    .service-card .icon,
    .why-card .icon {
        margin-bottom: 22px;
    }

    .featured-card {
        min-height: 280px;
    }

    .partners-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .partner-item {
        min-height: 80px;
        padding: 8px;
        border-radius: 13px;
    }

    .partner-item img {
        max-height: 56px;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 13px;
    }

    .project-card {
        display: grid;
        grid-template-columns: 38% 1fr;
        min-height: 165px;
        border-radius: 20px;
    }

    .project-thumb {
        width: 100%;
        height: 100%;
        min-height: 165px;
    }

    .project-info {
        padding: 16px;
    }

    .project-info h3 {
        min-height: 0;
        font-size: .88rem;
    }

    .project-info p {
        min-height: 0;
        font-size: .76rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .project-link {
        min-height: 36px;
        margin-top: 7px;
        padding: .42rem .7rem;
        font-size: .72rem;
    }

    .project-filters {
        top: 82px;
        margin: 20px -4px;
    }

    .project-hero,
    body:has(.project-hero) .project-hero {
        min-height: 350px;
        padding: 28px 20px !important;
        border-radius: 26px !important;
    }

    .project-hero h1,
    body:has(.project-hero) .project-hero h1 {
        font-size: clamp(1.85rem, 8.5vw, 3rem);
    }

    body:has(.project-hero) .values-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pgallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .theme-toggle,
    .back-to-top {
        left: 10px;
        width: 42px;
        height: 42px;
    }

    .theme-toggle {
        bottom: 62px;
    }

    .back-to-top {
        bottom: 10px;
    }

    .footer {
        width: calc(100% - 16px);
        margin-bottom: 8px;
        border-radius: 22px;
    }
}

@media (max-width: 440px) {
    .nav.mobile-active {
        width: 50vw;
    }

    .hero {
        padding-inline: 17px;
    }

    .hero-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    body:has(.project-hero) .values-grid {
        grid-template-columns: 1fr;
    }

    .project-card {
        grid-template-columns: 34% 1fr;
    }
}

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

/* Shared logo-inspired identity overrides */
.cta-button,
.project-link,
.submit-btn,
.filter-btn,
.map-action,
.filter-chip,
.project-status,
.stat-label,
.stat-number,
.info-label,
.info-value,
.gallery-control,
.nav-link {
    font-family: 'Tajawal', 'Cairo', system-ui, sans-serif;
}

.section h1,
.section h2,
.section-head h2,
.page-hero h1,
.project-hero h1,
.map-page-header h1,
.project-title,
.project-card h3,
.certificate-card h3,
.team-card h3,
.service-card h3,
.why-card h3,
.value-card h3,
.footer h3 {
    font-family: 'Noto Kufi Arabic', 'Tajawal', 'Cairo', system-ui, sans-serif;
}

.cta-button,
.project-link,
.submit-btn {
    background: linear-gradient(135deg, var(--logo-deep), var(--logo-sky));
    box-shadow: 0 18px 38px rgba(5, 43, 191, .20);
}

.filter-btn.active,
.filter-btn:hover,
.map-action.primary,
.project-status {
    background: linear-gradient(135deg, var(--logo-deep), var(--logo-sky));
    border-color: rgba(5, 43, 191, .18);
}

.eyebrow {
    font-family: 'Tajawal', 'Cairo', system-ui, sans-serif;
}

.eyebrow::before,
.section h2::after {
    background: linear-gradient(90deg, var(--logo-deep), var(--logo-sky));
}

/* Unified interior theme — logo-inspired across all non-home pages */
body:not(.home-page) {
    background:
        radial-gradient(circle at 92% 3%, rgba(53, 175, 234, .20), transparent 28rem),
        radial-gradient(circle at 8% 35%, rgba(5, 43, 191, .08), transparent 34rem),
        linear-gradient(180deg, #f2fbff 0%, #ffffff 44%, #eef8ff 100%);
}

body:not(.home-page) .main-content {
    padding-top: clamp(16px, 2vw, 28px);
}

body:not(.home-page) .main-content > .section:first-child {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .92);
    background:
        radial-gradient(circle at 88% 10%, rgba(53, 175, 234, .22), transparent 24rem),
        linear-gradient(135deg, rgba(255, 255, 255, .90), rgba(234, 248, 255, .70));
    box-shadow: 0 28px 90px rgba(5, 43, 191, .10);
}

body:not(.home-page) .main-content > .section:first-child::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image:
        linear-gradient(rgba(5, 43, 191, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(5, 43, 191, .045) 1px, transparent 1px);
    background-size: 54px 54px;
    mask-image: linear-gradient(90deg, transparent, #000 22%, #000 75%, transparent);
    pointer-events: none;
}

body:not(.home-page) .main-content > .section:first-child::after {
    content: 'MASAKEN';
    position: absolute;
    left: clamp(18px, 4vw, 64px);
    top: clamp(16px, 3vw, 44px);
    z-index: 0;
    color: rgba(5, 43, 191, .045);
    font-family: 'Noto Kufi Arabic', 'Tajawal', 'Cairo', sans-serif;
    font-size: clamp(3.8rem, 10vw, 11rem);
    font-weight: 800;
    letter-spacing: -.08em;
    line-height: 1;
    pointer-events: none;
}

body:not(.home-page) .main-content > .section:first-child > * {
    position: relative;
    z-index: 1;
}

body:not(.home-page) .main-content > .section:first-child h1 {
    margin-bottom: 14px;
    color: var(--logo-deep);
    font-size: clamp(2rem, 4.5vw, 4.4rem);
    line-height: 1.25;
}

body:not(.home-page) .main-content > .section:first-child > p {
    max-width: 920px;
    color: #38506f;
    font-size: clamp(.98rem, 1.25vw, 1.15rem);
    font-weight: 700;
}

.section,
.band,
.gallery-section,
.owner-logo-section,
.map-section,
.certificate-card,
.team-member,
.equipment-card,
.contact-form,
.contact-info,
.info-card,
.value-card,
.project-card,
.partner-item {
    border-color: rgba(5, 43, 191, .11);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .88), rgba(255, 255, 255, .68)),
        radial-gradient(circle at 100% 0, rgba(53, 175, 234, .09), transparent 18rem);
    box-shadow: 0 18px 58px rgba(5, 43, 191, .075);
}

.project-card,
.certificate-card,
.team-member,
.equipment-card,
.contact-form,
.contact-info,
.info-card,
.value-card {
    border-radius: 28px;
}

.project-card:hover,
.certificate-card:hover,
.team-member:hover,
.equipment-card:hover,
.value-card:hover {
    border-color: rgba(53, 175, 234, .34);
    box-shadow: 0 28px 76px rgba(5, 43, 191, .14);
}

.project-filters {
    position: relative;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: clamp(22px, 3vw, 36px) 0;
}

.filter-btn {
    border: 1px solid rgba(5, 43, 191, .12);
    border-radius: 999px;
    color: var(--logo-deep);
    background: rgba(255, 255, 255, .70);
    box-shadow: 0 10px 28px rgba(5, 43, 191, .07);
}

.filter-btn.active,
.filter-btn:hover {
    color: #fff;
    background: linear-gradient(135deg, var(--logo-deep), var(--logo-sky));
}

/* Project detail pages */
.project-detail .project-hero,
body:has(.project-hero) .project-hero {
    isolation: isolate;
    min-height: clamp(300px, 40vw, 440px) !important;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: clamp(30px, 4vw, 52px) !important;
    background:
        radial-gradient(circle at 86% 18%, rgba(53, 175, 234, .35), transparent 24rem),
        linear-gradient(135deg, #06184a 0%, #052bbf 50%, #35afea 135%) !important;
    box-shadow: 0 34px 100px rgba(5, 43, 191, .22);
}

.project-detail .project-hero::before,
body:has(.project-hero) .project-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: inherit;
    background:
        linear-gradient(90deg, rgba(3, 18, 64, .68), rgba(5, 43, 191, .26), rgba(3, 18, 64, .42)),
        linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
    background-size: auto, 58px 58px, 58px 58px;
    pointer-events: none;
}

.project-detail .project-hero::after,
body:has(.project-hero) .project-hero::after {
    color: rgba(255, 255, 255, .09);
    -webkit-text-stroke: 1px rgba(255, 255, 255, .13);
}

.project-hero .hero-content,
body:has(.project-hero) .project-hero .hero-content {
    position: relative;
    z-index: 1;
}

.project-hero h1,
body:has(.project-hero) .project-hero h1 {
    font-family: 'Noto Kufi Arabic', 'Tajawal', 'Cairo', sans-serif;
    width: min(100%, 980px);
    max-width: 980px;
    margin-inline-start: auto;
    overflow-wrap: anywhere;
    word-break: normal;
    hyphens: auto;
    font-size: clamp(1.65rem, 3.15vw, 3.35rem) !important;
    line-height: 1.34 !important;
    letter-spacing: -.035em;
    text-shadow: 0 16px 46px rgba(0, 0, 0, .20);
}

.project-hero p,
body:has(.project-hero) .project-hero p {
    color: rgba(245, 252, 255, .84);
    font-weight: 700;
}

.gallery-section,
.owner-logo-section,
.map-section {
    border: 1px solid rgba(5, 43, 191, .11);
    border-radius: 30px;
}

.project-completion-nav {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: clamp(18px, 3vw, 42px);
    overflow: hidden;
    background:
        radial-gradient(circle at 92% 10%, rgba(53, 175, 234, .18), transparent 20rem),
        linear-gradient(135deg, rgba(255,255,255,.90), rgba(234,248,255,.72));
}

.project-completion-nav::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: linear-gradient(180deg, var(--logo-deep), var(--logo-sky));
}

.project-completion-copy h2 {
    margin: 10px 0 8px;
    color: var(--logo-deep);
    font-size: clamp(1.3rem, 2.2vw, 2.25rem);
}

.project-completion-copy p {
    max-width: 760px;
    margin: 0;
    color: var(--d26-muted);
    font-weight: 700;
}

.project-completion-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.project-completion-actions .cta-button {
    white-space: nowrap;
}

.project-completion-actions .cta-button.secondary {
    color: var(--logo-deep);
    border: 1px solid rgba(5, 43, 191, .14);
    background: rgba(255, 255, 255, .76);
    box-shadow: 0 14px 34px rgba(5, 43, 191, .08);
}

.location-action-wrap {
    margin: 1.15rem 0 0;
    text-align: center;
}

.location-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: min(100%, 230px);
    color: #fff !important;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, .20);
    background: linear-gradient(135deg, var(--logo-deep), var(--logo-sky)) !important;
    box-shadow: 0 18px 42px rgba(5, 43, 191, .22);
}

.location-action:hover {
    transform: translateY(-3px);
    box-shadow: 0 24px 56px rgba(5, 43, 191, .28);
}

/* Team, certificates, contact */
.team-page .team-member,
.team-page .equipment-card,
.certificates-page .certificate-card,
.contact-page .contact-form,
.contact-page .contact-info {
    position: relative;
    overflow: hidden;
}

.team-page .team-member::before,
.team-page .equipment-card::before,
.certificates-page .certificate-card::before,
.contact-page .contact-form::before,
.contact-page .contact-info::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, var(--logo-deep), var(--logo-sky));
    opacity: .88;
}

.contact-page input,
.contact-page textarea,
.contact-page select {
    border-color: rgba(5, 43, 191, .14);
    border-radius: 16px;
    background: rgba(255, 255, 255, .80);
}

.contact-page input:focus,
.contact-page textarea:focus,
.contact-page select:focus {
    border-color: var(--logo-sky);
    box-shadow: 0 0 0 4px rgba(53, 175, 234, .16);
}

/* Maps page harmony */
.maps-page .map-page-header {
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, .24);
    background:
        radial-gradient(circle at 88% 12%, rgba(53, 175, 234, .30), transparent 18rem),
        linear-gradient(135deg, var(--logo-deep), var(--logo-blue) 58%, var(--logo-sky)) !important;
    box-shadow: 0 24px 76px rgba(5, 43, 191, .18);
}

.maps-page .panel,
.maps-page .info-card,
.maps-page .map-wrap {
    border-color: rgba(5, 43, 191, .12);
    box-shadow: 0 18px 54px rgba(5, 43, 191, .09);
}

@media (max-width: 768px) {
    body:not(.home-page) .main-content > .section:first-child {
        padding-top: 34px;
    }

    body:not(.home-page) .main-content > .section:first-child::after {
        font-size: 4rem;
        opacity: .75;
    }

    .project-filters {
        gap: 8px;
    }

    .filter-btn {
        flex: 1 1 calc(50% - 8px);
        min-width: 135px;
    }

    .project-completion-nav {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .project-completion-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .project-hero h1,
    body:has(.project-hero) .project-hero h1 {
        font-size: clamp(1.25rem, 6.2vw, 2rem) !important;
        line-height: 1.42 !important;
        max-width: 100%;
    }
}

/* Projects index card visibility fixes */
.projects-index .main-content > .section:first-child {
    overflow: visible;
    margin-bottom: clamp(14px, 1.8vw, 24px);
    padding-bottom: clamp(24px, 3vw, 40px);
}

.projects-index .main-content > .section:first-child > p {
    margin-bottom: 0;
}

.projects-index .projects-list-section {
    padding-top: clamp(12px, 1.6vw, 24px);
}

.projects-index .project-filters {
    position: relative;
    top: auto !important;
    justify-content: center;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto clamp(22px, 2.8vw, 36px);
}

.projects-index .projects-grid {
    position: relative;
    z-index: 1;
    align-items: stretch;
    margin-top: 0;
}

.projects-index .project-card {
    height: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: visible;
}

.projects-index .project-thumb {
    flex: 0 0 auto;
    overflow: hidden;
    border-radius: 28px 28px 0 0;
}

.projects-index .project-info {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: visible;
}

.projects-index .project-info h3,
.projects-index .project-info p {
    display: block;
    min-height: 0;
    overflow: visible;
    -webkit-line-clamp: unset;
    -webkit-box-orient: initial;
}

.projects-index .project-info h3 {
    margin-bottom: 10px;
}

.projects-index .project-info p {
    margin-bottom: 0;
}

.projects-index .project-link {
    width: fit-content;
    margin-top: auto;
}

@media (max-width: 768px) {
    .projects-index .main-content > .section:first-child {
        padding-top: 28px !important;
        padding-bottom: 18px !important;
        margin-bottom: 12px;
    }

    .projects-index .main-content > .section:first-child h1 {
        margin-bottom: 8px;
    }

    .projects-index .main-content > .section:first-child > p {
        margin-bottom: 0;
        line-height: 1.75;
    }

    .projects-index .project-filters {
        top: auto !important;
        width: 100%;
        justify-content: center;
        margin: 0 auto 16px !important;
    }

    .projects-index .project-card {
        display: grid;
        grid-template-columns: 36% minmax(0, 1fr);
        overflow: visible;
    }

    .projects-index .project-thumb {
        height: 100%;
        min-height: 165px;
        border-radius: 0 20px 20px 0;
    }

    .projects-index .project-info {
        padding: 14px;
    }

    .projects-index .project-info h3 {
        font-size: .84rem;
        line-height: 1.55;
    }

    .projects-index .project-info p {
        font-size: .74rem;
        line-height: 1.65;
    }
}

@media (max-width: 520px) {
    .projects-index .main-content > .section:first-child {
        padding: 24px 16px 16px !important;
    }

    .projects-index .projects-list-section {
        padding-top: 10px !important;
    }

    .projects-index .main-content > .section:first-child::after {
        top: 22px;
        left: 18px;
    }

    .projects-index .project-filters {
        gap: 8px;
        padding: 6px;
    }

    .projects-index .filter-btn {
        min-width: 0;
        flex: 1 1 calc(50% - 8px);
        padding: .72rem .8rem;
    }
}

/* Team / equipment page spacing fixes */
.team-page .team-page-hero {
    min-height: auto !important;
    display: block;
    margin-bottom: clamp(14px, 1.8vw, 24px);
    padding: clamp(30px, 4.8vw, 68px);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .92);
    border-radius: var(--d26-radius-lg);
    background:
        radial-gradient(circle at 88% 10%, rgba(53, 175, 234, .22), transparent 24rem),
        linear-gradient(135deg, rgba(255, 255, 255, .90), rgba(234, 248, 255, .70));
    box-shadow: 0 28px 90px rgba(5, 43, 191, .10);
    color: var(--logo-deep);
}

.team-page .team-page-hero::before {
    display: none;
}

.team-page .team-page-hero::after {
    content: 'TEAM';
    position: absolute;
    left: clamp(18px, 4vw, 64px);
    top: clamp(16px, 3vw, 44px);
    z-index: 0;
    color: rgba(5, 43, 191, .045);
    font-family: 'Noto Kufi Arabic', 'Tajawal', 'Cairo', sans-serif;
    font-size: clamp(3.8rem, 10vw, 11rem);
    font-weight: 800;
    letter-spacing: -.08em;
    line-height: 1;
    pointer-events: none;
}

.team-page .team-page-hero .hero-content {
    position: relative;
    z-index: 1;
    max-width: 980px;
    margin: 0;
    text-align: right;
}

.team-page .team-page-hero h1 {
    margin-bottom: 12px;
    color: var(--logo-deep);
    font-size: clamp(2rem, 4.5vw, 4.4rem);
    line-height: 1.25;
    text-shadow: none;
}

.team-page .team-page-hero p {
    max-width: 920px;
    margin-bottom: 0;
    color: #38506f;
    font-size: clamp(.98rem, 1.25vw, 1.15rem);
    font-weight: 700;
    line-height: 1.9;
}

.team-page .team-page-hero .cta-button {
    margin-top: 18px;
}

.team-page .section {
    overflow: visible;
}

.team-page .equipment-section {
    padding-top: clamp(18px, 2.4vw, 34px);
}

.team-page .equipment-section > p,
.team-page .team-section > p {
    margin-bottom: 0;
}

.team-page .values-grid {
    position: relative;
    z-index: 1;
    margin-top: clamp(16px, 2vw, 26px);
}

.team-page .value-card {
    height: auto;
    min-height: 0;
    overflow: visible;
}

@media (max-width: 768px) {
    .team-page .team-page-hero {
        padding: 28px 18px 20px !important;
        margin-bottom: 12px;
    }

    .team-page .team-page-hero::after {
        top: 22px;
        left: 18px;
        font-size: 4rem;
        opacity: .75;
    }

    .team-page .team-page-hero h1 {
        margin-bottom: 8px;
    }

    .team-page .team-page-hero p {
        line-height: 1.75;
    }

    .team-page .equipment-section {
        padding-top: 14px !important;
    }

    .team-page .values-grid {
        margin-top: 14px;
    }
}

/* Compact project detail headers across all project pages */
.project-detail .project-hero,
body:has(.project-hero) .project-hero {
    min-height: clamp(210px, 27vw, 315px) !important;
    margin-bottom: 16px !important;
    padding: clamp(24px, 4vw, 46px) !important;
    border-radius: clamp(22px, 3vw, 38px) !important;
}

.project-detail .project-hero::after,
body:has(.project-hero) .project-hero::after {
    top: clamp(14px, 2vw, 24px);
    left: clamp(16px, 2.8vw, 34px);
    font-size: clamp(2.6rem, 7vw, 7rem);
}

.project-detail .project-hero .hero-content,
body:has(.project-hero) .project-hero .hero-content {
    max-width: min(100%, 860px);
}

.project-detail .project-hero h1,
body:has(.project-hero) .project-hero h1 {
    max-width: 860px;
    font-size: clamp(1.25rem, 2.35vw, 2.55rem) !important;
    line-height: 1.38 !important;
    letter-spacing: -.025em;
}

.project-detail .project-hero p,
body:has(.project-hero) .project-hero p {
    font-size: clamp(.86rem, 1vw, 1rem);
    line-height: 1.75;
}

@media (max-width: 768px) {
    .project-detail .project-hero,
    body:has(.project-hero) .project-hero {
        min-height: 210px !important;
        margin-bottom: 12px !important;
        padding: 22px 16px !important;
        border-radius: 22px !important;
    }

    .project-detail .project-hero h1,
    body:has(.project-hero) .project-hero h1 {
        font-size: clamp(1.05rem, 5.1vw, 1.55rem) !important;
        line-height: 1.48 !important;
        max-width: 100%;
    }

    .project-detail .project-hero p,
    body:has(.project-hero) .project-hero p {
        font-size: .82rem;
    }
}

/* Make team/equipment hero headline readable on the light glass header */
.team-page .team-page-hero h1,
[data-theme="dark"] .team-page .team-page-hero h1 {
    background: linear-gradient(100deg, var(--logo-deep) 0%, #0d55ce 58%, var(--logo-sky) 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: var(--logo-deep) !important;
    -webkit-text-stroke: .35px rgba(255, 255, 255, .45);
    text-shadow:
        0 1px 0 rgba(255, 255, 255, .38),
        0 14px 34px rgba(5, 43, 191, .16);
}

.team-page .team-page-hero p {
    text-shadow:
        0 1px 0 rgba(255, 255, 255, .42),
        0 10px 24px rgba(5, 43, 191, .12);
}

/* Unified main title system across all pages */
:root {
    --title-hero-bg:
        radial-gradient(circle at 88% 8%, rgba(53, 175, 234, .24), transparent 25rem),
        radial-gradient(circle at 10% 92%, rgba(5, 43, 191, .10), transparent 24rem),
        linear-gradient(135deg, rgba(255, 255, 255, .92), rgba(235, 249, 255, .72));
    --title-hero-line: rgba(255, 255, 255, .92);
    --title-main-gradient: linear-gradient(100deg, var(--logo-deep, #052bbf) 0%, #075fca 56%, var(--logo-sky, #35afea) 100%);
    --title-muted: #38506f;
}

body:not(.home-page) .main-content > .section:first-child,
.team-page .team-page-hero,
.project-detail .project-hero,
body:has(.project-hero) .project-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: auto !important;
    margin-bottom: clamp(16px, 2.2vw, 28px) !important;
    padding: clamp(34px, 5vw, 78px) clamp(22px, 5vw, 72px) !important;
    border: 1px solid var(--title-hero-line) !important;
    border-radius: clamp(24px, 3.3vw, 44px) !important;
    background: var(--title-hero-bg) !important;
    box-shadow: 0 26px 82px rgba(5, 43, 191, .10) !important;
    color: var(--logo-deep, #052bbf) !important;
}

body:not(.home-page) .main-content > .section:first-child::before,
.team-page .team-page-hero::before,
.project-detail .project-hero::before,
body:has(.project-hero) .project-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -2;
    background-image:
        linear-gradient(rgba(5, 43, 191, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(5, 43, 191, .035) 1px, transparent 1px);
    background-size: 38px 38px;
    mask-image: linear-gradient(135deg, rgba(0,0,0,.95), transparent 74%);
    pointer-events: none;
}

body:not(.home-page) .main-content > .section:first-child::after,
.team-page .team-page-hero::after,
.project-detail .project-hero::after,
body:has(.project-hero) .project-hero::after {
    content: 'MSAKEN';
    position: absolute;
    left: clamp(18px, 4vw, 64px);
    top: clamp(14px, 3vw, 42px);
    z-index: -1;
    color: rgba(5, 43, 191, .045);
    font-family: 'Readex Pro', 'Noto Kufi Arabic', 'Tajawal', 'Cairo', sans-serif;
    font-size: clamp(3.7rem, 10vw, 11rem);
    font-weight: 800;
    letter-spacing: -.09em;
    line-height: .9;
    pointer-events: none;
}

body:not(.home-page) .main-content > .section:first-child > h1,
.team-page .team-page-hero h1,
.project-detail .project-hero h1,
body:has(.project-hero) .project-hero h1,
.map-page-header .brand h1 {
    width: fit-content;
    max-width: min(100%, 1120px) !important;
    margin: 0 0 clamp(10px, 1.5vw, 18px) !important;
    font-family: 'Readex Pro', 'Noto Kufi Arabic', 'Tajawal', 'Cairo', system-ui, sans-serif !important;
    font-size: clamp(2rem, 4.8vw, 4.9rem) !important;
    font-weight: 700 !important;
    line-height: 1.22 !important;
    letter-spacing: -.055em !important;
    background: var(--title-main-gradient) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: var(--logo-deep, #052bbf) !important;
    -webkit-text-stroke: .35px rgba(255, 255, 255, .52);
    text-shadow:
        0 1px 0 rgba(255, 255, 255, .46),
        0 16px 36px rgba(5, 43, 191, .13) !important;
    animation: none !important;
    transform: none !important;
}

body:not(.home-page) .main-content > .section:first-child > p,
.team-page .team-page-hero p,
.project-detail .project-hero p,
body:has(.project-hero) .project-hero p,
.map-page-header .brand p {
    max-width: 960px !important;
    margin: 0 !important;
    color: var(--title-muted) !important;
    font-family: 'Readex Pro', 'Cairo', 'Tajawal', system-ui, sans-serif !important;
    font-size: clamp(.96rem, 1.22vw, 1.15rem) !important;
    font-weight: 600 !important;
    line-height: 1.95 !important;
    text-shadow:
        0 1px 0 rgba(255, 255, 255, .45),
        0 10px 24px rgba(5, 43, 191, .08) !important;
}

.projects-index .main-content > .section:first-child,
.certificates-page .main-content > .section:first-child,
.contact-page .main-content > .section:first-child {
    display: block !important;
    text-align: right !important;
}

.team-page .team-page-hero .hero-content,
.project-detail .project-hero .hero-content,
body:has(.project-hero) .project-hero .hero-content {
    position: relative;
    z-index: 1;
    max-width: 1120px !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: right !important;
}

/* Keep project detail titles compact but within the same visual identity */
.project-detail .project-hero,
body:has(.project-hero) .project-hero {
    padding: clamp(26px, 4vw, 50px) !important;
}

.project-detail .project-hero h1,
body:has(.project-hero) .project-hero h1 {
    max-width: 920px !important;
    font-size: clamp(1.35rem, 2.55vw, 2.75rem) !important;
    line-height: 1.42 !important;
    white-space: normal !important;
}

.project-detail .project-hero p,
body:has(.project-hero) .project-hero p {
    font-size: clamp(.84rem, 1vw, 1rem) !important;
    line-height: 1.78 !important;
}

/* Maps page uses internal CSS, so this normalizes its header to the same title language */
.map-page-header {
    margin: 18px auto !important;
    width: min(100% - 32px, 1480px) !important;
    border: 1px solid var(--title-hero-line) !important;
    border-radius: clamp(24px, 3.3vw, 44px) !important;
    background: var(--title-hero-bg) !important;
    box-shadow: 0 26px 82px rgba(5, 43, 191, .10) !important;
    color: var(--logo-deep, #052bbf) !important;
}

.map-page-header-inner {
    padding: clamp(26px, 4vw, 54px) clamp(20px, 4vw, 54px) !important;
}

.map-page-header .brand {
    align-items: center !important;
}

.map-page-header .brand .logo {
    color: #fff !important;
    background: linear-gradient(135deg, var(--logo-deep, #052bbf), var(--logo-sky, #35afea)) !important;
    box-shadow: 0 18px 42px rgba(5, 43, 191, .18) !important;
}

.map-page-header .brand h1 .accent {
    -webkit-text-fill-color: transparent !important;
    color: inherit !important;
}

.map-page-header-actions .map-theme-toggle {
    color: var(--logo-deep, #052bbf) !important;
    border-color: rgba(5, 43, 191, .16) !important;
    background: rgba(255, 255, 255, .62) !important;
}

[data-theme="dark"] body:not(.home-page) .main-content > .section:first-child,
[data-theme="dark"] .team-page .team-page-hero,
[data-theme="dark"] .project-detail .project-hero,
[data-theme="dark"] body:has(.project-hero) .project-hero,
body.dark .map-page-header {
    --title-hero-bg:
        radial-gradient(circle at 88% 8%, rgba(53, 175, 234, .18), transparent 25rem),
        radial-gradient(circle at 10% 92%, rgba(5, 43, 191, .22), transparent 24rem),
        linear-gradient(135deg, rgba(8, 31, 61, .92), rgba(9, 40, 77, .78));
    --title-hero-line: rgba(117, 205, 255, .18);
    --title-muted: #b8c9dc;
    box-shadow: 0 26px 82px rgba(0, 18, 48, .24) !important;
}

[data-theme="dark"] body:not(.home-page) .main-content > .section:first-child > h1,
[data-theme="dark"] .team-page .team-page-hero h1,
[data-theme="dark"] .project-detail .project-hero h1,
[data-theme="dark"] body:has(.project-hero) .project-hero h1,
body.dark .map-page-header .brand h1 {
    background: linear-gradient(100deg, #ffffff 0%, #dff7ff 46%, #63ccff 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    -webkit-text-stroke: .25px rgba(5, 43, 191, .45);
    text-shadow: 0 14px 34px rgba(0, 18, 48, .22) !important;
}

[data-theme="dark"] body:not(.home-page) .main-content > .section:first-child > p,
[data-theme="dark"] .team-page .team-page-hero p,
[data-theme="dark"] .project-detail .project-hero p,
[data-theme="dark"] body:has(.project-hero) .project-hero p,
body.dark .map-page-header .brand p {
    color: var(--title-muted) !important;
    text-shadow: 0 10px 24px rgba(0, 18, 48, .16) !important;
}

@media (max-width: 768px) {
    body:not(.home-page) .main-content > .section:first-child,
    .team-page .team-page-hero,
    .project-detail .project-hero,
    body:has(.project-hero) .project-hero {
        padding: 26px 18px 22px !important;
        border-radius: 24px !important;
        margin-bottom: 14px !important;
    }

    body:not(.home-page) .main-content > .section:first-child::after,
    .team-page .team-page-hero::after,
    .project-detail .project-hero::after,
    body:has(.project-hero) .project-hero::after {
        left: 16px;
        top: 18px;
        font-size: clamp(3.2rem, 18vw, 5.2rem);
    }

    body:not(.home-page) .main-content > .section:first-child > h1,
    .team-page .team-page-hero h1,
    .map-page-header .brand h1 {
        font-size: clamp(1.55rem, 8vw, 2.35rem) !important;
        line-height: 1.3 !important;
        letter-spacing: -.045em !important;
    }

    .project-detail .project-hero h1,
    body:has(.project-hero) .project-hero h1 {
        font-size: clamp(1.08rem, 5.2vw, 1.58rem) !important;
    }

    body:not(.home-page) .main-content > .section:first-child > p,
    .team-page .team-page-hero p,
    .map-page-header .brand p {
        font-size: .86rem !important;
        line-height: 1.8 !important;
    }

    .map-page-header {
        width: min(100% - 24px, 1480px) !important;
        margin-top: 12px !important;
        border-radius: 24px !important;
    }

    .map-page-header-inner {
        padding: 22px 16px !important;
        align-items: flex-start !important;
    }
}
