/* Ahmed Hafız — site styles */
:root {
    --bg: #0b0d10;
    --bg-alt: #111418;
    --surface: #161a1f;
    --line: #23282f;
    --text: #eef0f2;
    --muted: #9aa3ad;
    --accent: #d4ff5a;
    --accent-ink: #0b0d10;
    --radius: 14px;
    --wrap: 1180px;
    --font-display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
    --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
:root[lang="ar"] {
    --font-display: "IBM Plex Sans Arabic", "Inter", system-ui, sans-serif;
    --font-body: "IBM Plex Sans Arabic", "Inter", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background:
        radial-gradient(900px 600px at 85% -10%, rgba(212, 255, 90, .07), transparent 60%),
        var(--bg);
    background-repeat: no-repeat;
    color: var(--text);
    font: 400 16px/1.65 var(--font-body);
    -webkit-font-smoothing: antialiased;
}
[dir="rtl"] body { background-position: left top; background:
        radial-gradient(900px 600px at 15% -10%, rgba(212, 255, 90, .07), transparent 60%),
        var(--bg); background-repeat: no-repeat; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; line-height: 1.08; margin: 0; overflow-wrap: break-word; hyphens: auto; }
p { margin: 0; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* Arabic: no negative tracking, a little more leading */
[lang="ar"] h1, [lang="ar"] h2, [lang="ar"] h3 { letter-spacing: 0; line-height: 1.3; }
[lang="ar"] body { line-height: 1.8; }
[lang="ar"] .stats dt, [lang="ar"] .label { letter-spacing: 0; text-transform: none; }

.wrap { width: min(100% - 48px, var(--wrap)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: -9999px; }
.skip:focus { inset-inline-start: 16px; top: 16px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px; }

/* Buttons */
.btn {
    white-space: nowrap;
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    height: 52px; padding: 0 24px;
    background: var(--accent); color: var(--accent-ink);
    font: 600 15px/1 var(--font-body);
    border: 1px solid var(--accent); border-radius: 999px; cursor: pointer;
    transition: transform .2s ease, background .2s ease, color .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn .arrow { display: inline-block; transition: transform .2s ease; }
.btn:hover .arrow { transform: translateX(3px); }
[dir="rtl"] .btn .arrow { transform: scaleX(-1); }
[dir="rtl"] .btn:hover .arrow { transform: scaleX(-1) translateX(3px); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--text); }
.btn--sm { height: 40px; padding: 0 18px; font-size: 14px; }
.btn--block { width: 100%; }
.btn[aria-busy="true"] { opacity: .75; cursor: progress; transform: none; }

/* Progress */
.progress {
    position: fixed; top: 0; inset-inline: 0; height: 2px; z-index: 60;
    background: var(--accent); transform-origin: left; transform: scaleX(0);
}
[dir="rtl"] .progress { transform-origin: right; }

/* Nav */
.nav {
    position: sticky; top: 0; z-index: 50;
    background: rgba(11, 13, 16, .72);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color .3s ease;
}
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav__inner { display: flex; align-items: center; gap: 28px; height: 72px; }
.brand { font: 600 20px/1 var(--font-display); letter-spacing: -0.02em; white-space: nowrap; }
[lang="ar"] .brand { letter-spacing: 0; }
.brand__dot { color: var(--accent); }
.nav__links { display: flex; gap: 28px; margin-inline-start: auto; font-size: 14.5px; color: var(--muted); }
.nav__links a { position: relative; transition: color .2s; padding: 6px 0; }
.nav__links a:hover, .nav__links a.is-active { color: var(--text); }
.nav__links a::after {
    content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 1px; background: var(--accent);
    transform: scaleX(0); transform-origin: left; transition: transform .3s ease;
}
[dir="rtl"] .nav__links a::after { transform-origin: right; }
.nav__links a.is-active::after { transform: scaleX(1); }
.nav__toggle { display: none; }
.mobile-menu { display: none; }

/* Language switcher */
.lang { position: relative; }
.lang__btn {
    display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 12px;
    background: transparent; border: 1px solid var(--line); border-radius: 999px;
    color: var(--text); font: 500 13px/1 var(--font-body); cursor: pointer; transition: border-color .2s;
}
.lang__btn:hover, .lang__btn[aria-expanded="true"] { border-color: #4a525c; }
.lang__btn svg { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 1.6; }
.lang__menu {
    position: absolute; top: calc(100% + 8px); inset-inline-end: 0; min-width: 168px; z-index: 70;
    list-style: none; margin: 0; padding: 6px; background: var(--surface);
    border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
}
.lang__menu a {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 12px; border-radius: 8px; font-size: 14.5px; color: var(--muted); transition: background .15s, color .15s;
}
.lang__menu a:hover { background: #1d2228; color: var(--text); }
.lang__menu a[aria-current="true"] { color: var(--text); }
.lang__menu a[aria-current="true"]::after {
    content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
}
.lang__menu a[lang="ar"] { font-family: "IBM Plex Sans Arabic", var(--font-body); }

/* Hero */
.hero { padding: clamp(72px, 12vw, 150px) 0 72px; position: relative; }
.eyebrow {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px;
    font-size: 13.5px; color: var(--muted);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(212,255,90,.15); animation: pulse 2.4s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(212,255,90,0); } }
.hero__title { margin-top: 28px; font-size: clamp(36px, 6vw, 80px); font-weight: 500; max-width: 21ch; text-wrap: balance; }
[lang="ru"] .hero__title { font-size: clamp(32px, 5.4vw, 72px); max-width: 22ch; }
[lang="ar"] .hero__title { font-weight: 600; font-size: clamp(34px, 5.6vw, 74px); max-width: 22ch; }
.hero__title em { font-style: normal; color: var(--accent); }
.hero__bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; margin-top: 48px; flex-wrap: wrap; }
.hero__lead { max-width: 520px; font-size: 18px; color: var(--muted); }
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); margin: 88px 0 0; border-top: 1px solid var(--line); }
.stats div { padding-block-start: 24px; padding-inline-end: 24px; }
.stats div + div { padding-inline-start: 24px; border-inline-start: 1px solid var(--line); }
.stats dt { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.stats dd { margin: 6px 0 0; font: 500 22px/1.2 var(--font-display); }

/* Hero badges: company role + availability */
.badges { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.role {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 6px 14px 6px 8px; border-radius: 999px;
    background: var(--surface); border: 1px solid var(--line);
    font-size: 13.5px; font-weight: 500; color: var(--text); transition: border-color .2s;
}
[dir="rtl"] .role { padding: 6px 8px 6px 14px; }
.role:hover { border-color: #2AC5F4; }
.role svg { width: 22px; height: 22px; flex: none; }

/* Profscode */
.company {
    display: grid; grid-template-columns: 1.15fr 1fr; gap: 56px; align-items: center;
    padding: clamp(28px, 5vw, 56px); border-radius: 24px;
    background:
        radial-gradient(600px 300px at 100% 0%, rgba(42, 197, 244, .10), transparent 60%),
        var(--surface);
    border: 1px solid var(--line);
}
[dir="rtl"] .company { background: radial-gradient(600px 300px at 0% 0%, rgba(42, 197, 244, .10), transparent 60%), var(--surface); }
.company__logo { width: min(260px, 70%); height: auto; margin: 22px 0 26px; }
.company h2 { font-size: clamp(28px, 3.4vw, 42px); margin-bottom: 14px; }
.company__brand > p { color: var(--muted); max-width: 520px; margin-bottom: 28px; }
.company__facts { margin: 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.company__facts div { padding: 18px 0; border-bottom: 1px solid var(--line); }
.company__facts dt { font-size: 13px; color: #2AC5F4; font-weight: 500; margin-bottom: 4px; }
.company__facts dd { margin: 0; font-size: 15.5px; }

/* Clients */
.clients { border-block: 1px solid var(--line); }
.clients__inner { display: flex; align-items: center; gap: 40px; padding: 28px 0; flex-wrap: wrap; }
.clients__label { font-size: 13px; color: var(--muted); max-width: 190px; line-height: 1.4; }
.clients__list { list-style: none; margin: 0; padding: 0; display: flex; flex: 1; justify-content: space-between; gap: 24px 40px; flex-wrap: wrap; }
.clients__list li { font: 600 clamp(17px, 1.8vw, 22px)/1 "Bricolage Grotesque", var(--font-display); color: #6b7580; letter-spacing: -0.01em; transition: color .2s; }
.clients__list li:hover { color: var(--text); }

/* Sections */
.section { padding: clamp(80px, 11vw, 140px) 0; }
.section--alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.section__head { margin-bottom: 56px; }
.section__head h2, .contact__info h2 { font-size: clamp(32px, 4.4vw, 54px); margin-top: 14px; text-wrap: balance; }
.section__head--row { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; flex-wrap: wrap; }
.section__note { max-width: 360px; color: var(--muted); }
.label { font-size: 13px; color: var(--accent); letter-spacing: .06em; text-transform: uppercase; font-weight: 500; }

/* Services */
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.service {
    padding: 32px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    display: flex; flex-direction: column; gap: 14px;
    transition: border-color .25s ease, transform .25s ease;
}
.service:hover { border-color: #3a414b; transform: translateY(-4px); }
.service__icon { width: 48px; height: 48px; border-radius: 12px; background: rgba(212,255,90,.08); display: grid; place-items: center; margin-bottom: 8px; }
.service__icon svg { width: 24px; height: 24px; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.service h3 { font-size: 22px; }
.service p { color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: auto 0 0; padding-top: 10px; }
.tags li { font-size: 12.5px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }

/* Projects */
.projects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.project {
    display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden;
    background: var(--surface); border: 1px solid var(--line);
    transition: border-color .25s ease, transform .25s ease;
}
.project:hover { border-color: #3a414b; transform: translateY(-4px); }
.project__media { aspect-ratio: 16 / 10; overflow: hidden; display: grid; place-items: center; }
.project__media img { transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.project__media .fit-cover { width: 100%; height: 100%; object-fit: cover; }
.project__media .fit-contain { width: 62%; height: 72%; object-fit: contain; }
.project:hover .project__media img { transform: scale(1.04); }
.project__body { display: flex; justify-content: space-between; gap: 20px; padding: 24px 26px 28px; }
.project__type { font-size: 13px; color: var(--muted); }
.project h3 { font-size: 24px; margin: 4px 0 8px; }
.project p { color: var(--muted); font-size: 15px; }
.project__arrow {
    flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line);
    display: grid; place-items: center; font-size: 18px; transition: all .25s ease;
}
[dir="rtl"] .project__arrow { transform: scaleX(-1); }
.project:hover .project__arrow { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* About */
.about { display: grid; grid-template-columns: 1fr 1.2fr; gap: 64px; }
.about .section__head { margin: 0; }
.about__lead { font: 500 clamp(20px, 2.2vw, 26px)/1.45 var(--font-display); letter-spacing: -0.01em; margin-bottom: 20px; }
[lang="ar"] .about__lead { letter-spacing: 0; line-height: 1.7; }
.about__text > p:not(.about__lead) { color: var(--muted); }
.stack { margin-top: 32px; padding-top: 28px; border-top: 1px solid var(--line); }
.stack__label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.stack .tags { padding-top: 0; }
[dir="rtl"] .stack .tags { justify-content: flex-end; }
.checks { list-style: none; padding: 0; margin: 32px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; }
.checks li { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.checks li::before {
    content: ""; flex: none; width: 18px; height: 18px; border-radius: 50%;
    background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b0d10' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center/12px no-repeat;
}

/* Process */
.process { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.process li { padding-top: 24px; border-top: 1px solid var(--line); }
.process span { font: 500 14px/1 var(--font-display); color: var(--accent); }
.process h3 { font-size: 22px; margin: 18px 0 10px; }
.process p { color: var(--muted); font-size: 15px; }

/* Contact */
.contact { display: grid; grid-template-columns: 1fr 1.1fr; gap: 64px; align-items: start; }
.contact__info > p { color: var(--muted); margin-top: 18px; max-width: 420px; font-size: 17px; }
.contact__list { list-style: none; padding: 0; margin: 40px 0 0; border-top: 1px solid var(--line); }
.contact__list li { display: flex; justify-content: space-between; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.contact__list span { color: var(--muted); font-size: 14px; }
.contact__list a { font-weight: 500; transition: color .2s; overflow-wrap: anywhere; min-width: 0; }
.contact__list a:hover { color: var(--accent); }
[dir="rtl"] .contact__list a { text-align: right; }
.socials { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.socials a { display: inline-block; padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; transition: border-color .2s, color .2s; }
.socials a:hover { border-color: var(--accent); color: var(--accent); }

.form { padding: 36px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; display: grid; gap: 18px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.field { display: grid; gap: 8px; min-width: 0; }
.field label { font-size: 13.5px; color: var(--muted); font-weight: 500; }
.field input, .field textarea {
    width: 100%; padding: 14px 16px; background: var(--bg); color: var(--text);
    border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 15px;
    transition: border-color .2s, box-shadow .2s; resize: vertical;
}
[dir="rtl"] .field input[dir="ltr"] { text-align: right; }
.field input::placeholder, .field textarea::placeholder { color: #5d6670; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(212,255,90,.12); }
.field.is-invalid input, .field.is-invalid textarea { border-color: #ff8a80; }
.field__err { color: #ff8a80; font-size: 13px; }
.field__err:empty { display: none; }
.alert { padding: 14px 16px; border-radius: 10px; font-size: 14.5px; }
.alert:focus { outline: none; }
.alert--ok { background: rgba(212,255,90,.1); color: var(--accent); border: 1px solid rgba(212,255,90,.3); }
.alert--err { background: rgba(255,138,128,.08); color: #ff8a80; border: 1px solid rgba(255,138,128,.3); }
.form__note { font-size: 13px; color: var(--muted); text-align: center; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 72px 0 32px; font-size: 14.5px; color: var(--muted); background: var(--bg-alt); }
.footer__top { display: grid; grid-template-columns: 2fr 1fr 1fr 1.4fr; gap: 40px; padding-bottom: 56px; }
.footer__brand .brand { color: var(--text); font-size: 24px; }
.footer__brand p { margin-top: 14px; max-width: 280px; }
.footer__col { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-width: 0; }
.footer__col span { color: var(--text); font-weight: 500; margin-bottom: 4px; }
.footer__col a { transition: color .2s; overflow-wrap: anywhere; }
.footer__col a:hover { color: var(--accent); }
.footer__bottom { display: flex; justify-content: space-between; gap: 16px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 13.5px; flex-wrap: wrap; }

.footer__company { display: inline-flex; flex-direction: column; gap: 8px; margin-top: 22px; opacity: .85; transition: opacity .2s; }
.footer__company:hover { opacity: 1; }
.footer__company img { width: 130px; height: auto; }
.footer__company span { font-size: 13px; }
.footer__address { margin-top: 4px; font-size: 14px; line-height: 1.5; }

/* Back to top */
.to-top {
    position: fixed; inset-inline-end: 24px; bottom: 24px; z-index: 40; width: 46px; height: 46px; border-radius: 50%;
    display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line);
    opacity: 0; transform: translateY(12px); pointer-events: none; transition: all .3s ease;
}
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { border-color: var(--accent); }
.to-top svg { width: 18px; height: 18px; fill: none; stroke: var(--text); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Reveal */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1); }
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .js .reveal { opacity: 1; transform: none; transition: none; }
    .dot { animation: none; }
}

/* Responsive */
@media (max-width: 1080px) {
    .nav__inner { gap: 20px; }
    .nav__links { gap: 20px; }
}
@media (max-width: 980px) {
    .nav__links { display: none; }
    .lang { margin-inline-start: auto; }
    .footer__top { grid-template-columns: 1fr 1fr; }
    .footer__brand { grid-column: 1 / -1; }
    .hero__bottom { flex-direction: column; align-items: flex-start; }
    .services { grid-template-columns: 1fr; }
    .process { grid-template-columns: 1fr 1fr; gap: 32px 20px; }
    .about, .contact, .company { grid-template-columns: 1fr; gap: 40px; }
    .stats { grid-template-columns: 1fr 1fr; }
    .stats div:nth-child(3) { padding-inline-start: 0; border-inline-start: 0; }
    .stats div:nth-child(n+3) { margin-top: 20px; }
    /* hamburger from here so the language switcher keeps its room */
    .nav__toggle {
        display: grid; gap: 6px; padding: 10px; background: none; border: 0; cursor: pointer;
    }
    .nav__toggle span { display: block; width: 22px; height: 2px; background: var(--text); transition: transform .25s; }
    .nav__toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
    .nav__toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }
    .mobile-menu:not([hidden]) { display: grid; padding: 8px 24px 24px; border-bottom: 1px solid var(--line); }
    .mobile-menu a { padding: 14px 0; font: 500 22px/1.2 var(--font-display); border-bottom: 1px solid var(--line); }
}
@media (max-width: 760px) {
    .nav__cta { display: none; }
    .nav__inner { gap: 12px; }
    .projects { grid-template-columns: 1fr; }
    .field-row, .checks { grid-template-columns: 1fr; }
    .form { padding: 24px; }
    .hero__cta { width: 100%; flex-direction: column; }
    .hero__cta .btn { width: 100%; }
    .stats { margin-top: 56px; }
    .stats dd { font-size: 19px; }
    .hero__lead { font-size: 17px; }
    .hero__title br { display: none; }
    .clients__inner { gap: 18px; padding: 24px 0; }
    .clients__label { max-width: none; }
    .section__head { margin-bottom: 40px; }
    .project__body { padding: 20px; }
}
@media (max-width: 480px) {
    .wrap { width: min(100% - 32px, var(--wrap)); }
    .process { grid-template-columns: 1fr; }
    .footer__top { grid-template-columns: 1fr; gap: 32px; }
    .contact__list li { flex-direction: column; gap: 4px; }
    .to-top { inset-inline-end: 16px; bottom: 16px; }
    .clients__list { justify-content: flex-start; gap: 16px 28px; }
    .service, .form { padding: 22px; }
    .stats div { padding-inline-end: 12px; }
    .stats div + div { padding-inline-start: 12px; }
    .brand { font-size: 18px; }
}
@media (max-width: 360px) {
    .hero__title { font-size: 31px; }
    .section__head h2, .contact__info h2 { font-size: 30px; }
    [lang="ru"] .hero__title { font-size: 30px; }
    .lang__btn { padding: 0 10px; }
}
