/* EZ Bits site styles. One file for both directions: logical properties (inline-start/end) flip for Arabic.
   Contrast figures are WCAG ratios against the surface named beside them. */

:root {
    color-scheme: light dark;

    --surface: #FFFFFF;
    --surface-2: #F2F5F4;          /* grouped background: cards, footer */
    --label: #0D1F20;              /* 17.0:1 on surface */
    --label-2: #52605F;            /* 6.6:1 on surface, 6.0:1 on surface-2 */
    --accent: #1F7576;             /* brand teal: 5.4:1 on surface, 4.95:1 on surface-2 */
    --accent-ink: #FFFFFF;         /* text on accent: 5.4:1 */
    --accent-soft: rgba(31, 117, 118, .10);
    --signal: #F9A84F;             /* brand orange: decoration only, never text */
    --separator: rgba(13, 31, 32, .12);
    --glass: rgba(255, 255, 255, .78);
    --shadow: 0 1px 2px rgba(13, 31, 32, .06), 0 12px 32px rgba(13, 31, 32, .08);

    --font: 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --radius: 18px;
    --radius-sm: 12px;
    --wrap: 1120px;
    --section: clamp(72px, 10vw, 128px);
}

@media (prefers-color-scheme: dark) {
    :root {
        --surface: #0B1213;
        --surface-2: #162021;
        --label: #E9F0EF;          /* 16.4:1 */
        --label-2: #9AABAA;        /* 7.9:1 on surface, 7.0:1 on surface-2 */
        --accent: #5CC2C0;         /* 9.0:1 on surface, 7.9:1 on surface-2 */
        --accent-ink: #06292A;     /* 7.3:1 on accent */
        --accent-soft: rgba(92, 194, 192, .14);
        --separator: rgba(233, 240, 239, .14);
        --glass: rgba(11, 18, 19, .72);
        --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px rgba(0, 0, 0, .35);
    }
}

@media (prefers-contrast: more) {
    :root {
        --label-2: var(--label);
        --separator: currentColor;
    }
}


/*** Base ***/
html { scroll-padding-top: 72px; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 1.0625rem;          /* 17px */
    line-height: 1.6;
    color: var(--label);
    background: var(--surface);
    -webkit-font-smoothing: antialiased;
}

[dir="rtl"] body { line-height: 1.8; }   /* Arabic needs taller lines than Latin */

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font);
    color: var(--label);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

[dir="rtl"] :is(h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6) {
    letter-spacing: 0;           /* tracking breaks Arabic joins */
    line-height: 1.4;
}

h3, .h3 { font-size: 1.3125rem; font-weight: 600; letter-spacing: -0.01em; }   /* 21px */

a { color: var(--accent); }
a:hover { color: var(--accent); }

:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
    border-radius: 6px;
}

img { max-width: 100%; height: auto; }

.wrap {
    max-width: var(--wrap);
    margin-inline: auto;
    padding-inline: 22px;
}

.section { padding-block: var(--section); }
.section + .section { padding-top: 0; }
.section-alt { background: var(--surface-2); }
.section-alt + .section { padding-top: var(--section); }

.display {
    font-size: clamp(2.5rem, 6vw, 4.5rem);    /* 40-72px */
    line-height: 1.04;
    letter-spacing: -0.035em;
    margin: 0 0 20px;
}

.title {
    font-size: clamp(1.875rem, 4vw, 3rem);    /* 30-48px */
    margin: 0 0 16px;
}

.eyebrow {
    display: block;
    margin-bottom: 10px;
    font-size: .9375rem;
    font-weight: 600;
    color: var(--accent);
}

.lead {
    font-size: clamp(1.125rem, 1.6vw, 1.3125rem);    /* 18-21px */
    line-height: 1.55;
    color: var(--label-2);
    max-width: 62ch;
}

.section-head { margin-bottom: 48px; }
.section-head.center { text-align: center; }
.section-head.center .lead { margin-inline: auto; }

.muted { color: var(--label-2); }


/*** Buttons: one filled style for the main action, a plain link for the rest ***/
.btn-fill,
.btn-plain {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 26px;
    border: 0;
    border-radius: 999px;
    font-size: 1.0625rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color .2s, color .2s, opacity .2s;
}

.btn-fill { color: var(--accent-ink); background: var(--accent); }
.btn-fill:hover { color: var(--accent-ink); opacity: .88; }
.btn-fill:disabled { opacity: .5; }

.btn-plain { padding-inline: 12px; color: var(--accent); background: transparent; }
.btn-plain:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }

.chev { font-size: .8em; }
[dir="rtl"] .chev { transform: scaleX(-1); }


/*** Header: the one translucent layer, floating over content ***/
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--glass);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--separator);
}

@media (prefers-reduced-transparency: reduce) {
    .site-header { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

.site-header .navbar {
    max-width: var(--wrap);
    min-height: 60px;
    margin-inline: auto;
    padding: 0 22px;
}

.brand {
    display: inline-flex;
    align-items: baseline;
    gap: 1px;
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--label);
    text-decoration: none;
    direction: ltr;              /* Latin wordmark: the dot follows it in Arabic too */
    unicode-bidi: isolate;
}

.brand:hover { color: var(--label); }

/* The signal dot: the brand's orange, spent in one place */
.brand::after {
    content: "";
    width: 7px;
    height: 7px;
    margin-inline-start: 2px;
    border-radius: 50%;
    background: var(--signal);
}

.site-header .nav-link {
    padding: 8px 14px !important;
    font-size: .9375rem;
    font-weight: 500;
    color: var(--label-2);
    border-radius: 999px;
}

.site-header .nav-link:hover { color: var(--label); }

/* Current page: label colour plus a filled pill, not colour alone */
.site-header .nav-link.active {
    color: var(--label);
    background: var(--accent-soft);
}

.lang-switch {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid var(--separator);
    border-radius: 999px;
    font-size: .9375rem;
    font-weight: 500;
    color: var(--label);
    background: none;
    text-decoration: none;
}

.lang-switch:hover { color: var(--label); background: var(--accent-soft); }

.site-header .navbar-toggler {
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    color: var(--label);
    box-shadow: none;
}

.site-header .dropdown-menu {
    background: var(--surface);
    border: 1px solid var(--separator);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
}

.site-header .dropdown-item { color: var(--label); }
.site-header .dropdown-item.active,
.site-header .dropdown-item:active { color: var(--accent-ink); background: var(--accent); }

@media (max-width: 991.98px) {
    .site-header .navbar-collapse { padding-bottom: 12px; }
    .site-header .nav-link { padding: 12px 14px !important; font-size: 1.0625rem; }
}


/*** Hero ***/
.hero {
    padding-top: clamp(56px, 9vw, 112px);
    text-align: center;
    overflow: hidden;
}

.hero .lead { margin: 0 auto 32px; }

.hero .display { max-width: 20ch; margin-inline: auto; }
[dir="rtl"] .hero .display { max-width: 22ch; line-height: 1.3; }

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 8px;
    justify-content: center;
}

/* Signature: the studio's shipped work, fanned like screens on a desk */
.work-stack {
    position: relative;
    max-width: 980px;
    height: clamp(220px, 44vw, 460px);
    margin: clamp(48px, 7vw, 80px) auto 0;
}

.work-stack figure {
    position: absolute;
    bottom: -12%;
    left: 50%;
    width: 52%;
    margin: 0;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface-2);
    box-shadow: var(--shadow), 0 0 0 1px var(--separator);
    transform: translateX(-50%);
    animation: work-fan .9s cubic-bezier(.2, .8, .2, 1) both;
}

.work-stack figure img { display: block; width: 100%; aspect-ratio: 5 / 4; object-fit: cover; }

.work-stack figure:nth-child(1) { z-index: 2; --to: translateX(-50%); bottom: -4%; }
.work-stack figure:nth-child(2) { z-index: 1; --to: translateX(-112%) rotate(-6deg) scale(.86); }
.work-stack figure:nth-child(3) { z-index: 1; --to: translateX(12%) rotate(6deg) scale(.86); }
.work-stack figure { transform: var(--to); }

@keyframes work-fan {
    from { transform: translateX(-50%) translateY(40px) scale(.9); opacity: 0; }
    to   { transform: var(--to); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .work-stack figure { animation: none; }
}

@media (max-width: 575.98px) {
    .work-stack { height: 62vw; }
    .work-stack figure { width: 78%; }
    .work-stack figure:nth-child(n+2) { display: none; }
}


/*** Page header (inner pages): a large title on the plain surface ***/
.page-head { padding-block: clamp(48px, 7vw, 88px) 0; }
.page-head .display { margin-bottom: 0; }

.crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 12px;
    padding: 0;
    list-style: none;
    font-size: .9375rem;
    color: var(--label-2);
}

.crumbs a { color: var(--label-2); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.crumbs li + li::before { content: "/"; margin-inline-end: 6px; opacity: .5; }


/*** About ***/
.about-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: clamp(32px, 6vw, 80px);
    align-items: center;
}

.about-grid p { color: var(--label-2); }

.cap-list {
    margin: 0;
    padding: 8px;
    list-style: none;
    background: var(--surface-2);
    border-radius: var(--radius);
}

.cap-list li {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 16px;
    font-size: 1.125rem;
    font-weight: 600;
}

.cap-list li + li { border-top: 1px solid var(--separator); }

.cap-list i {
    width: 36px;
    height: 36px;
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: var(--accent);
    background: var(--accent-soft);
    font-size: .95rem;
}

@media (max-width: 991.98px) {
    .about-grid { grid-template-columns: 1fr; }
}


/*** Cards (services, team) ***/
.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

@media (max-width: 991.98px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 575.98px) { .card-grid { grid-template-columns: 1fr; } }

.tile {
    position: relative;
    height: 100%;
    padding: 32px 28px;
    border-radius: var(--radius);
    background: var(--surface-2);
}

.section-alt .tile { background: var(--surface); }

.tile h3 { margin: 20px 0 10px; }
.tile p { margin: 0; color: var(--label-2); }
.tile h3 a { color: inherit; text-decoration: none; }
.tile:has(.stretched-link):hover { box-shadow: var(--shadow); }

.tile-icon {
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    color: var(--accent-ink);
    background: var(--accent);
    font-size: 1.35rem;
}


/*** Horizontal shelf (projects, team): 3 cards on desktop, 2 on tablet, 1 and a peek on phones ***/
.hscroll { position: relative; }

.hscroll-track {
    position: relative; /* containing block for .visually-hidden spans, so the track clips them instead of the page widening */
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 4px;
    scroll-behavior: smooth;
    overscroll-behavior-x: contain;
    padding: 4px 4px 20px;
    scrollbar-width: none;
}

.hscroll-track::-webkit-scrollbar { display: none; }

.hscroll-slide {
    flex: 0 0 calc((100% - 40px) / 3);
    scroll-snap-align: start;
}

/* Arrows sit under the shelf, aligned to the end, like a gallery's paddles */
.hscroll-controls {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
}

.hscroll-nav {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    color: var(--label);
    background: var(--surface-2);
    transition: background-color .2s, opacity .2s;
}

.section-alt .hscroll-nav { background: var(--surface); }
.hscroll-nav:hover { background: var(--accent-soft); }
.hscroll-nav:disabled { opacity: .35; cursor: default; }

[dir="rtl"] .hscroll-nav i { display: inline-block; transform: scaleX(-1); }

@media (max-width: 991.98px) {
    .hscroll-slide { flex-basis: calc((100% - 20px) / 2); }
}

@media (max-width: 575.98px) {
    .hscroll-slide { flex-basis: 85%; }
    .hscroll-controls { display: none; }    /* phones swipe */
}

@media (prefers-reduced-motion: reduce) {
    .hscroll-track { scroll-behavior: auto; }
}


/*** Projects ***/
/* Filter: a segmented control */
.segmented {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 2px;
    margin: 0 0 32px;
    padding: 3px;
    list-style: none;
    border-radius: 999px;
    background: var(--surface-2);
}

.segmented button {
    min-height: 36px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    font: inherit;
    font-size: .9375rem;
    font-weight: 500;
    color: var(--label-2);
    background: none;
}

.segmented li.active button {
    color: var(--label);
    background: var(--surface);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
}

.work-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface-2);
}

.work-card .shot { display: block; overflow: hidden; }
.work-card .shot img { display: block; width: 100%; aspect-ratio: 5 / 4; object-fit: cover; transition: transform .4s; }
.work-card .shot:hover img { transform: scale(1.03); }

.work-card .body {
    flex-grow: 1;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 20px 22px 24px;
}

.work-card .body > div { flex-grow: 1; }
.work-card .eyebrow { margin-bottom: 4px; font-size: .875rem; }
.work-card h3 { margin: 0; font-size: 1.0625rem; font-weight: 600; line-height: 1.45; letter-spacing: 0; }

.work-card .visit {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--accent);
    background: var(--accent-soft);
    text-decoration: none;
}

[dir="rtl"] .work-card .visit i { transform: scaleX(-1); }

@media (prefers-reduced-motion: reduce) {
    .work-card .shot img { transition: none; }
}

/* "+N more projects": closes the shelf and leads to the contact page */
.work-more {
    height: 100%;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 6px;
    padding: 32px 28px;
    border-radius: var(--radius);
    color: var(--accent-ink);
    background: var(--accent);
}

.work-more-count { font-size: clamp(3.5rem, 7vw, 5rem); font-weight: 700; line-height: 1; letter-spacing: -0.04em; }
.work-more p { margin: 0 0 16px; font-size: 1.125rem; font-weight: 500; }
.work-more a { align-self: flex-start; color: var(--accent-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }


/*** Team ***/
.person { text-align: center; }
.person img { width: 120px; height: 120px; margin-bottom: 18px; border-radius: 50%; object-fit: cover; }
.person h3 { margin: 0 0 4px; font-size: 1.1875rem; }
.person .role { color: var(--label-2); }

.person .socials { display: flex; justify-content: center; gap: 4px; margin-top: 14px; }
.person .socials a,
.footer .socials a {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--label-2);
    text-decoration: none;
}

.person .socials a:hover,
.footer .socials a:hover { color: var(--accent); background: var(--accent-soft); }


/*** Facts ***/
.facts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
    padding-block: 40px;
    border-block: 1px solid var(--separator);
}

.facts .num { font-size: clamp(2.5rem, 5vw, 3.5rem); font-weight: 700; line-height: 1.1; letter-spacing: -0.03em; color: var(--label); }
.facts p { margin: 4px 0 0; color: var(--label-2); }

@media (max-width: 767.98px) { .facts { grid-template-columns: repeat(2, 1fr); } }


/*** Forms ***/
.form-control {
    color: var(--label);
    background-color: var(--surface-2);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
}

.form-control:focus {
    color: var(--label);
    background-color: var(--surface);
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.form-floating > label { color: var(--label-2); }
.form-control::placeholder { color: var(--label-2); }

.contact-card {
    max-width: 720px;
    margin-inline: auto;
}

.alert { border-radius: var(--radius-sm); }

/* Visually hidden honeypot fields */
.hp { position: absolute; inset-inline-start: -9999px; width: 0; height: 0; overflow: hidden; }


/*** Text pages (privacy, terms…) ***/
.prose { max-width: 70ch; }
.prose h2 { margin: 40px 0 12px; font-size: 1.5rem; }
.prose h3 { margin: 28px 0 8px; }
.prose p, .prose li { color: var(--label-2); }


/*** Footer ***/
.footer {
    padding-block: 56px 28px;
    font-size: .9375rem;
    color: var(--label-2);
    background: var(--surface-2);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1.2fr;
    gap: 40px;
}

@media (max-width: 767.98px) { .footer-grid { grid-template-columns: 1fr; } }

.footer h2 {
    margin: 0 0 14px;
    font-size: .9375rem;
    font-weight: 600;
    letter-spacing: 0;
    color: var(--label);
}

.footer ul { margin: 0; padding: 0; list-style: none; }
.footer li { margin-bottom: 8px; }
.footer a { color: var(--label-2); text-decoration: none; }
.footer a:hover { color: var(--accent); text-decoration: underline; }
.footer .contact i { width: 20px; margin-inline-end: 8px; color: var(--accent); }
.footer .socials { display: flex; gap: 2px; margin: 8px 0 0 -10px; }
[dir="rtl"] .footer .socials { margin: 8px -10px 0 0; }

.copy-phone { padding: 0; border: 0; font: inherit; color: inherit; background: none; }
.copy-phone:hover { color: var(--accent); }

.nl-form { display: flex; gap: 8px; margin-top: 12px; }
.nl-form .form-control { min-height: 44px; background: var(--surface); }

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--separator);
    font-size: .875rem;
}

.footer-bottom nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
