/* Portfolio - Design system */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

:root {
    --portfolio-bg: #F2EEE9;
    --portfolio-purple: #723366;
    --portfolio-purple-light: #877279;
    --portfolio-black: #010101;
    --portfolio-gray: #84807F;
    --portfolio-card-bg: #ECE4E2;
    --portfolio-contact-bg: #FAF2EF;
    --portfolio-envelope: #E9C1C2;
    --portfolio-cert-issuer: #79525F;
    --portfolio-shadow: 0px 0px 8px rgba(114, 51, 102, 0.12);
    --portfolio-skills-bg: rgba(114, 51, 102, 0.05);
    --portfolio-ellipse-border: rgba(114, 51, 102, 0.3);
    --portfolio-ellipse-fill: rgba(114, 51, 102, 0.1);
    --portfolio-dashed: rgba(114, 51, 102, 0.5);
}

/* تلوين السكرول باللون البنفسجي الأساسي */
html {
    scrollbar-color: var(--portfolio-purple) var(--portfolio-bg);
    scrollbar-width: thin;
}
html::-webkit-scrollbar {
    width: 10px;
}
html::-webkit-scrollbar-track {
    background: var(--portfolio-bg);
}
html::-webkit-scrollbar-thumb {
    background: var(--portfolio-purple);
    border-radius: 5px;
}
html::-webkit-scrollbar-thumb:hover {
    background: #5d2952;
}

* {
    box-sizing: border-box;
}

.portfolio-page {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background: var(--portfolio-bg);
    color: var(--portfolio-black);
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

.portfolio-container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    min-height: 4700px;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
    z-index: 1;
}

/* Large screens: keep content readable, avoid over-stretching */
@media (min-width: 1600px) {
    .portfolio-hero-inner,
    .portfolio-about-inner,
    .portfolio-mine-inner,
    .portfolio-experience-inner,
    .portfolio-certificates-inner,
    .portfolio-skills-inner {
        max-width: 1400px;
    }
}

/* Section base */
.portfolio-section {
    width: 100%;
    max-width: 100%;
    flex: none;
    position: relative;
    overflow-x: hidden;
    overflow-y: hidden;
}

/* Buttons - Frame 1686561521 style */
.portfolio-btn {
    box-sizing: border-box;
    display: inline-flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding: 12px 24px;
    gap: 8px;
    min-width: 258px;
    min-height: 48px;
    background: #723366;
    border: none;
    border-radius: 32px;
    font-family: 'Inter', sans-serif;
    font-style: normal;
    font-weight: 700;
    font-size: 20px;
    line-height: 24px;
    color: #FFFFFF;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s;
    /* إطار خارجي: فجوة 4px ثم حد 1.5px */
    box-shadow: 0 0 0 4px var(--portfolio-bg), 0 0 0 5.5px #877279;
}

.portfolio-btn:hover {
    opacity: 0.9;
}

.portfolio-btn-sm {
    min-width: 0;
    padding: 8px 24px;
    font-size: 16px;
    line-height: 19px;
}

.portfolio-link-underline {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    padding: 0 4px 16px 4px;
    border-bottom: 2px solid var(--portfolio-purple);
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 20px;
    line-height: 24px;
    color: var(--portfolio-purple);
    text-decoration: none;
}

/* CV Download dropdown (Figma Frame 1686561349) */
.portfolio-cv-dropdown-wrap {
    position: relative;
    z-index: 2;
}

.portfolio-cv-dropdown-trigger {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    padding: 0 0 16px 0;
    border: none;
    border-bottom: 2px solid var(--portfolio-purple);
    background: transparent;
    font-family: 'Inter', sans-serif;
    font-weight: bold;
    font-size: 20px;
    line-height: 24px;
    color: var(--portfolio-purple);
    cursor: pointer;
}

.portfolio-cv-dropdown {
    box-sizing: border-box;
    position: absolute;
    left: 0;
    top: 100%;
    margin-top: 4px;
    width: 195px;
    padding: 0 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #F2EEE9;
    border: 1px solid #723366;
    box-shadow: 0px 0px 8px rgba(69, 69, 69, 0.12);
    border-radius: 8px;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.2s ease-out, transform 0.2s ease-out, visibility 0.2s;
}

.portfolio-cv-dropdown.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.portfolio-cv-dropdown-item {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 16px;
    gap: 8px;
    width: 100%;
    border-bottom: 0.5px solid #723366;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 16px;
    line-height: 19px;
    color: #010101;
    text-decoration: none;
}

.portfolio-cv-dropdown-item:last-child {
    border-bottom: none;
}

.portfolio-cv-dropdown-item:hover {
    color: #723366;
}

/* Section title - Montserrat */
.portfolio-section-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 36px;
    line-height: 44px;
    text-align: center;
}

/* Hero */
.portfolio-hero {
    min-height: 750px;
    background: var(--portfolio-bg);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 104px 120px 80px;
    gap: 24px;
    overflow: hidden;
}

.portfolio-hero-inner {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 24px;
    max-width: 1200px;
    width: 100%;
}

.portfolio-hero-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 40px;
    max-width: 588px;
}

.portfolio-hero-headline {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.portfolio-hero-headline .hey {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 24px;
    line-height: 29px;
    color: var(--portfolio-black);
}

.portfolio-typed-text {
    display: inline-block;
    min-width: 0.4em;
    font-size: 1.5em;
    line-height: 1.2;
    color: var(--portfolio-purple);
}

.portfolio-typed-cursor {
    display: inline-block;
    font-weight: 700;
    font-size: 1.5em;
    line-height: 1.2;
    color: var(--portfolio-purple);
    animation: portfolio-cursor-blink 0.8s step-end infinite;
}

@keyframes portfolio-cursor-blink {
    50% { opacity: 0; }
}

.portfolio-hero-title-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    position: relative;
}

.portfolio-hero-title-row .uiux {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 52px;
    line-height: 63px;
    color: var(--portfolio-black);
}

.portfolio-hero-designer-wrap {
    position: relative;
    display: inline-block;
}

.portfolio-hero-designer-wrap .designer {
    position: relative;
    z-index: 1;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 52px;
    line-height: 63px;
    color: var(--portfolio-black);
}

/* خط زخرفي تحت عنوان UI/UX Designer */
.portfolio-hero-title-underline {
    display: block;
    width: 100%;
    max-width: 452px;
    height: 21px;
    margin-top: 4px;
}

.portfolio-hero-desc {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 16px;
    line-height: 19px;
    color: var(--portfolio-gray);
    max-width: 588px;
}

.portfolio-hero-cta {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 24px;
}

/* خط متقطع من اليسار يوشّر على الزر */
.portfolio-hero-cta-line {
    position: absolute;
    height: 151.33px;
    width: 316px;
    left: -340px;
    top: 134%;
    transform: translateY(-50%) rotate(82deg) matrix(-0.35, 0.94, 0.94, 0.35, 0, 0) scaleX(-1);
    pointer-events: none;
    z-index: 0;
}

.portfolio-hero-cta .portfolio-btn {
    position: relative;
    z-index: 1;
}

.portfolio-hero-right {
    position: relative;
    width: 588px;
    min-height: 396px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portfolio-hero-image-wrap {
    position: relative;
    width: 280px;
    height: 380px;
}

.portfolio-hero-image-wrap .img-outer {
    position: absolute;
    width: 280px;
    height: 380px;
    left: 24px;
    top: 16px;
    border: 1px solid var(--portfolio-purple);
    border-radius: 100px;
}

/* صورة البروفايل: خلفية للـ PNG + عرض منضبط داخل الإطار */
.portfolio-profile-img {
    background-color: #393B3A !important; /* خلفية عند استخدام PNG شفاف */
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
}

.portfolio-hero-image-wrap .img-inner {
    position: absolute;
    width: 280px;
    height: 380px;
    left: 0;
    top: 0;
    background: #393B3A center/cover no-repeat;
    border: 1px solid var(--portfolio-purple);
    border-radius: 100px;
    overflow: hidden;
    transition: transform 0.5s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.portfolio-hero-image-wrap:hover .img-inner {
    transform: translate(24px, 12px);
}

.portfolio-hero-social {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 44px;
}

.portfolio-hero-social .follow {
    font-size: 16px;
    line-height: 19px;
    color: var(--portfolio-black);
    transform: rotate(-90deg);
    white-space: nowrap;
}

.portfolio-hero-social .line {
    width: 42px;
    height: 0;
    border: 0.5px solid var(--portfolio-black);
    transform: rotate(-90deg);
    margin-top: 22px;
    margin-bottom: 4px;
}

.portfolio-hero-social-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.portfolio-hero-social-links a {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    aspect-ratio: 1;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--portfolio-black);
}

/* دائرة LinkedIn "in" - نفس ستايل Be بدون خط */
.portfolio-social-in {
    position: relative;
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    aspect-ratio: 1;
    flex-shrink: 0;
    border-radius: 50%;
    background: #000000;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background-color 0.35s ease, color 0.35s ease, transform 0.35s ease;
}

.portfolio-social-in:hover {
    background: #723366;
    color: #FFFFFF;
    transform: scale(1.08);
}

.portfolio-social-in-text {
    font-family: 'Fustat', 'Inter', sans-serif;
    font-weight: 700;
    font-size: 16px;
    line-height: 23px;
    color: #FFFFFF;
}

/* دائرة الهاتف - أيقونة phone.png، نفس ستايل in و Be */
.portfolio-social-phone {
    position: relative;
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    aspect-ratio: 1;
    flex-shrink: 0;
    border-radius: 50%;
    background: #010101;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background-color 0.35s ease, transform 0.35s ease;
}

.portfolio-social-phone:hover {
    background: #723366;
    transform: scale(1.08);
}

.portfolio-social-phone-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    display: block;
}

/* دائرة GitHub - أيقونة github.png في الوسط */
.portfolio-social-github {
    position: relative;
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    aspect-ratio: 1;
    flex-shrink: 0;
    border-radius: 50%;
    background: #010101;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background-color 0.35s ease, transform 0.35s ease;
}

.portfolio-social-github:hover {
    background: #723366;
    transform: scale(1.08);
}

.portfolio-social-github-icon {
    width: 26px;
    height: 23px;
    object-fit: contain;
    display: block;
}

/* دائرة Behance "Be" - خلفية داكنة وكلام أبيض، عند الهوفر خلفية بنفسجي + أنيميشن */
.portfolio-social-be {
    position: relative;
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    aspect-ratio: 1;
    flex-shrink: 0;
    border-radius: 50%;
    background: #000000;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background-color 0.35s ease, color 0.35s ease, transform 0.35s ease;
}

.portfolio-social-be:hover {
    background: #723366;
    color: #FFFFFF;
    transform: scale(1.08);
}

.portfolio-social-be-text {
    font-family: 'Fustat', 'Inter', sans-serif;
    font-weight: 700;
    font-size: 16px;
    line-height: 23px;
    color: #FFFFFF;
}

/* خط صغير فوق حرف e */
.portfolio-social-be-e {
    position: relative;
    display: inline-block;
}

.portfolio-social-be-e::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 5px;
    width: 66%;
    height: 2px;
    background: #FFFFFF;
    border-radius: 0;
    transform: none;
}

/* الشاشات الكبيرة: دوائر السوشيال ومحتواها أكبر شوي */
@media (min-width: 1200px) {
    .portfolio-hero-social-links a {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }
    .portfolio-hero-social-links .portfolio-social-in,
    .portfolio-hero-social-links .portfolio-social-phone,
    .portfolio-hero-social-links .portfolio-social-github,
    .portfolio-hero-social-links .portfolio-social-be {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }
    .portfolio-hero-social-links .portfolio-social-in-text,
    .portfolio-hero-social-links .portfolio-social-be-text {
        font-size: 18px;
        line-height: 24px;
    }
    .portfolio-hero-social-links .portfolio-social-phone-icon {
        width: 24px;
        height: 24px;
    }
    .portfolio-hero-social-links .portfolio-social-github-icon {
        width: 28px;
        height: 24px;
    }
}

/* Decorative ellipses - hero */
.portfolio-hero .ellipse {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    animation: portfolio-ellipse-float 6s ease-in-out infinite;
}

@keyframes portfolio-ellipse-float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-12px) rotate(3deg); }
}

/* دوائر زخرفية - أحجام ومواضع مختلفة + تأخير للانيميشن */
.portfolio-hero .ellipse-dec-1 {
    width: 50px;
    height: 50px;
    left: 54%;
    top: 59%;
    border: 2px solid var(--portfolio-ellipse-border);
    animation-delay: 0s;
}
.portfolio-hero .ellipse-dec-2 {
    width: 30px;
    height: 30px;
    top: 4%;
    right: 39%;
    border: 2px solid var(--portfolio-ellipse-border);
    animation-delay: 0.8s;
}
.portfolio-hero .ellipse-dec-3 {
    width: 50px;
    height: 50px;
    right: 8%;
    top: 59%;
    border: 2px solid var(--portfolio-ellipse-border);
    animation-delay: 1.6s;
}
.portfolio-hero .ellipse-dec-4 {
    width: 25px;
    height: 25px;
    right: 47%;
    top: 75%;
    background: var(--portfolio-ellipse-fill);
    animation-delay: 2.4s;
}
.portfolio-hero .ellipse-dec-5 {
    width: 35px;
    height: 35px;
    right: 4%;
    top: 32%;
    border: 2px solid var(--portfolio-ellipse-border);
    animation-delay: 3.2s;
}

.portfolio-hero .ellipse-151 {
    width: 50px;
    height: 50px;
    top: 87%;
    right: 15%;
    border: 2px solid var(--portfolio-ellipse-border);
    animation-delay: 0.4s;
}
.portfolio-hero .ellipse-152 {
    width: 50px;
    height: 50px;
    top: 11%;
    right: 11%;
    border: 2px solid var(--portfolio-ellipse-border);
    animation-delay: 1.2s;
}
.portfolio-hero .ellipse-150 {
    width: 60px;
    height: 60px;
    right: 45%;
    top: 98px;
    background: var(--portfolio-ellipse-fill);
    animation-delay: 2s;
}

/* Ellipse 155 style - دوائر زخرفية */
.portfolio-hero .ellipse-155,
.portfolio-hero .ellipse-156 {
    box-sizing: border-box;
    width: 25px;
    height: 25px;
    background: rgba(114, 51, 102, 0.1);
    border: 1px solid rgba(114, 51, 102, 0.3);
}
.portfolio-hero .ellipse-155 {
    left: 1026px;
    top: 530px;
    animation-delay: 2.8s;
}
.portfolio-hero .ellipse-156 {
    right: 27%;
    top: 95%;
    animation-delay: 3.6s;
}

/* دائرة متقطعة داخل المحتوى - يسار الكونتينر */
.portfolio-page-circle-left {
    position: absolute;
    left: -220px;
    top: 2%;
    transform: translateY(-50%);
    width: 350px;
    height: 350px;
    pointer-events: none;
    z-index: 1;
    animation: portfolio-circle-rotate 155s linear infinite;
}

@keyframes portfolio-circle-rotate {
    from { transform: translateY(-50%) rotate(0deg); }
    to { transform: translateY(-50%) rotate(360deg); }
}

/* About */
.portfolio-about {
    position: relative;
    min-height: 516px;
    background: var(--portfolio-bg);
    margin-top: 5%;
    padding: 40px 200px 60px;
}

/* About - decorative circles */
.portfolio-about-circle {
    box-sizing: border-box;
    position: absolute;
    width: 50px;
    height: 50px;
    border: 2px solid rgba(114, 51, 102, 0.3);
    border-radius: 50%;
    pointer-events: none;
}
.portfolio-about-circle-1 {
    right: 33%;
    top: 1%;
    width: 30px !important;
    height: 30px !important;
}
.portfolio-about-circle-2 {
    right: 11%;
    bottom: 13%;
}

.portfolio-about-inner {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 51px;
    max-width: 1166px;
    margin: 0 auto;
}

.portfolio-about-image-wrap {
    width: 303px;
    height: 396px;
    flex-shrink: 0;
    position: relative;
}

.portfolio-about-image-wrap .frame {
    position: absolute;
    width: 303px;
    height: 396px;
    left: 0;
    top: 0;
    border: 1px solid var(--portfolio-purple);
    border-radius: 200px 200px 0 0;
}

.portfolio-about-image-wrap .img {
    position: absolute;
    width: 286.62px;
    height: 380px;
    left: 8px;
    top: 8px;
    background: #393B3A center/cover no-repeat;
    border-radius: 200px 200px 0 0;
    overflow: hidden;
}

.portfolio-about-content {
    display: flex;
    flex-direction: column;
    gap: 40px;
    max-width: 685px;
}

.portfolio-about-content h2 {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 36px;
    line-height: 44px;
    color: var(--portfolio-black);
    margin: 0;
}

.portfolio-about-content h2 .about-me-blend {
    color: var(--portfolio-purple);
}

.portfolio-about-content .text {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 150%;
    color: var(--portfolio-black);
    margin: 0;
}

.portfolio-about .portfolio-btn-sm {
    width: 185px;
    min-width: 150px;
}

/* My Portfolio section */
.portfolio-mine {
    position: relative;
    min-height: 717px;
    background: var(--portfolio-bg);
    padding: 40px 88px 80px;
}

.portfolio-mine-circle-right {
    position: absolute;
    right: -120px;
    top: 15%;
    transform: translateY(-50%);
    width: 240px;
    height: 240px;
    pointer-events: none;
    z-index: 1;
    opacity: 0.7;
    animation: portfolio-mine-circle-spin 140s linear infinite;
}

@keyframes portfolio-mine-circle-spin {
    from { transform: translateY(-50%) rotate(0deg); }
    to { transform: translateY(-50%) rotate(360deg); }
}

.portfolio-mine-inner {
    max-width: 1487px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 64px;
}

.portfolio-mine-title-wrap {
    position: relative;
    display: inline-block;
}

.portfolio-mine-title-circle {
    position: absolute;
    left: 10%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 90px;
    height: 90px;
    opacity: 1;
    pointer-events: none;
    z-index: 0;
}

.portfolio-mine-title-wrap .portfolio-mine-title {
    position: relative;
    z-index: 1;
}

.portfolio-mine-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 36px;
    line-height: 44px;
    text-align: center;
    color: var(--portfolio-purple);
}

.portfolio-mine-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 485px));
    gap: 0px;
    justify-content: center;
    width: 100%;
    max-width: 1487px;
    margin: 0 auto;
}

/* زر More + سهمين – يظهر بالتلفون فقط عندما يوجد أكثر من 3 مشاريع/شهادات */
.portfolio-more-trigger {
    display: none;
}
.portfolio-cert-more-trigger {
    flex: 0 0 100%;
    width: 100%;
}
.portfolio-skills-more-trigger {
    grid-column: 1 / -1;
    width: 100%;
}

.portfolio-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    width: 405px;
    min-height: auto;
    border-radius: 24px;
    flex-shrink: 0;
    justify-self: center;
    overflow: hidden;
    transition: width 0.3s ease, min-height 0.3s ease, background 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
}

.portfolio-mine-grid:hover .portfolio-card {
    opacity: 0.5;
}

.portfolio-mine-grid .portfolio-card:hover {
    opacity: 1;
}

.portfolio-card:hover {
    width: 485px;
    min-height: auto;
    align-items: center;
    padding: 4px 4px 8px;
    gap: 24px;
    background: #FFFFFF;
    box-shadow: 0px 0px 8px rgba(69, 69, 69, 0.12);
    border-radius: 16px;
}

.portfolio-card:hover .portfolio-card-top .portfolio-card-details-main {
    display: none;
}

.portfolio-card:hover .portfolio-card-hover {
    display: flex;
}

.portfolio-card-top {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    align-self: stretch;
}

.portfolio-card-image {
    width: 100%;
    height: 302.88px;
    background: var(--portfolio-card-bg) center/cover;
    border-radius: 8px;
    transition: height 0.3s ease;
}

.portfolio-card:hover .portfolio-card-image {
    height: 356.73px;
}

.portfolio-card-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.portfolio-card-tags {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
}

.portfolio-tag {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 8px 16px;
    background: var(--portfolio-purple-light);
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 12px;
    line-height: 15px;
    color: #FFFFFF;
}

.portfolio-card-title-row {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.portfolio-card-title {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 16px;
    line-height: 19px;
    color: var(--portfolio-black);
}

.portfolio-card-type {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 16px;
    line-height: 19px;
    color: var(--portfolio-black);
}

.portfolio-card-arrow {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    border: 2px solid var(--portfolio-purple);
    border-radius: 80px;
    transform: rotate(45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--portfolio-purple);
    text-decoration: none;
}

.portfolio-card-arrow svg,
.portfolio-card-arrow img {
    width: 20px;
    height: 24px;
    object-fit: contain;
    rotate: -41deg;
}

/* Card hover-only content */
.portfolio-card-hover {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    padding: 0 16px;
    gap: 16px;
    width: 100%;
    min-width: 0;
    align-self: stretch;
}

.portfolio-card-meta {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.portfolio-card-title-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.portfolio-card-hover .portfolio-card-title,
.portfolio-card-hover .portfolio-card-type {
    margin: 0;
    text-align: left;
}

.portfolio-card-date {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 12px;
    line-height: 15px;
    color: #010101;
    flex-shrink: 0;
}

.portfolio-card-description {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 12px;
    line-height: 150%;
    color: #010101;
    margin: 0;
    width: 100%;
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
}

.portfolio-card-skills {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 12px;
}

.portfolio-card-skill {
    width: 32px;
    height: 32px;
    min-width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: clip;
    white-space: nowrap;
    background: #010101;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 700;
    border-radius: 6px;
}

.portfolio-card:hover .portfolio-card-skill {
    width: auto;
    min-width: 32px;
    max-width: 100%;
    overflow: visible;
    white-space: nowrap;
}

.portfolio-card-btn {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding: 12px 24px;
    gap: 8px;
    width: 172px;
    height: 40px;
    box-sizing: border-box;
    border: none;
    border-radius: 32px;
    background: #723366;
    color: #FFFFFF;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 20px;
    line-height: 24px;
    text-decoration: none;
    flex-shrink: 0;
    align-self: center;
    box-shadow: 0 0 0 4px var(--portfolio-bg), 0 0 0 5.5px #877279;
}

.portfolio-card-btn:hover {
    opacity: 0.9;
}

/* Experience */
.portfolio-experience {
    min-height: 755px;
    background: var(--portfolio-bg);
    padding: 40px 200px 80px;
}

.portfolio-experience-inner {
    position: relative;
    max-width: 1040px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 64px;
}

/* Group 117 - decorative ellipses */
.portfolio-exp-deco {
    position: absolute;
    width: 99px;
    height: 105px;
    right: -28%;
    top: 4%;
  
    pointer-events: none;
    z-index: 0;
}

.portfolio-exp-ellipse {
    position: absolute;
    box-sizing: border-box;
    border-radius: 50%;
}

.portfolio-exp-ellipse-158 {
    height: 60px;
    left: 39.39%;
    right: 0;
    top: 0;
    background: rgba(114, 51, 102, 0.1);
}

.portfolio-exp-ellipse-153 {
    height: 12px;
    left: 1.01%;
    right: 86.87%;
    top: 0;
    background: rgba(114, 51, 102, 0.1);
}

.portfolio-exp-ellipse-152 {
    height: 30px;
    left: 0;
    right: 69.7%;
    top: 75px;
    border: 2px solid rgba(114, 51, 102, 0.3);
    background: transparent;
}

.portfolio-experience-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 36px;
    line-height: 44px;
    text-align: center;
    color: var(--portfolio-purple);
    width: 100%;
}

.portfolio-experience-title .experience-word-black {
    color: var(--portfolio-black);
}

.portfolio-experience-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
}

.portfolio-experience-row {
    display: flex;
    flex-direction: row;
    gap: 24px;
    width: 100%;
}

.portfolio-exp-card {
    width: 508px;
    min-height: 203px;
    height: 203px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 24px;
    gap: 24px;
    background: #ECE4E2;
    box-shadow: 0px 0px 8px rgba(114, 51, 102, 0.12);
    border-radius: 24px;
    box-sizing: border-box;
    transition: height 0.3s ease;
    overflow: hidden;
}

.portfolio-exp-card.desc-visible {
    height: auto;
    min-height: 203px;
}

.portfolio-exp-cta-cell {
    position: relative;
    width: 508px;
}

.portfolio-exp-card-cta {
    width: 508px;
    height: 203px;
    padding: 16px 24px;
    box-sizing: border-box;
}

.portfolio-exp-cta-ribbon {
    position: absolute;
    top: -20px;
    left: -24px;
    width: 80px;
    height: auto;
    object-fit: contain;
    z-index: 2;
    pointer-events: none;
    rotate: -17deg;
}

.portfolio-exp-cta-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
    width: 100%;
    height: 100%;
    justify-content: center;
}

.portfolio-exp-cta-line {
    position: absolute;
    width: 45%;
    height: 55%;
    left: -45%;
    top: 429px;
    transform: translateY(-50%) rotate(134deg) scaleX(-1);
    pointer-events: none;
    z-index: 1;
}

.portfolio-exp-cta-wrap .portfolio-btn {
    position: relative;
    z-index: 1;
}

.portfolio-exp-card-cta .heading {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 36px;
    line-height: 44px;
    color: #000000;
    margin: 0 0 24px 0;
}

.portfolio-exp-card .company {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 20px;
    line-height: 24px;
    color: var(--portfolio-black);
    margin: 0;
}

.portfolio-exp-card .role {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 24px;
    line-height: 29px;
    color: var(--portfolio-black);
    margin: 0;
}

.portfolio-exp-card .desc {
    display: none;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 150%;
    color: var(--portfolio-black);
    margin: 0;
}

.portfolio-exp-card.desc-visible .desc {
    display: block;
}

.portfolio-exp-card .date {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 19px;
    color: var(--portfolio-black);
    margin: 0;
}

/* Certificates */
.portfolio-certificates {
    min-height: 496px;
    background: var(--portfolio-bg);
    padding: 40px 96px 80px;
}

.portfolio-certificates-inner {
    position: relative;
    max-width: 1248px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 64px;
}

/* نفس الديكور (Group 117) في سكشن Certificates */
.portfolio-certificates-inner .portfolio-exp-deco {
    right: -18%;
    top: 13%;
}

.portfolio-certificates-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 36px;
    line-height: 44px;
    text-align: center;
    color: var(--portfolio-black);
    width: 100%;
}

.portfolio-certificates-title .certificates-word-purple {
    color: var(--portfolio-purple);
}

.portfolio-certificates-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 24px;
    width: 100%;
    max-width: 1245px;
    margin: 0 auto;
}

/* 1 card: بلنص */
.portfolio-certificates-grid .portfolio-cert-card:first-child:nth-last-child(1) {
    margin-left: auto;
    margin-right: auto;
}

/* 2 cards: كِلاهم بلنص - justify-content: center يكفيهم */

/* 3 cards: جنب بعض بلنص - justify-content: center يكفيهم */

/* 4 cards: الرابعة تحت بلنص (margin يخليها بلنص) */
/* .portfolio-certificates-grid .portfolio-cert-card:nth-child(4):nth-last-child(1) {
    margin-left: calc((100% - 397px) / 2);
} */

/* 5 cards: التنين تحت بلنص (margin يسار على الرابع + يمين أوتو على الخامس) */
.portfolio-certificates-grid .portfolio-cert-card:nth-child(4):nth-last-child(2) {
    margin-left: calc((100% - (397px * 2 + 24px)) / 2);
}
.portfolio-certificates-grid .portfolio-cert-card:nth-child(5):nth-last-child(1) {
    margin-right: auto;
}

.portfolio-cert-card {
    position: relative;
    overflow: hidden;
    flex: 0 0 397px;
    width: 397px;
    min-height: 110px;
    height: auto;
    align-self: flex-start;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 24px;
    gap: 24px;
    background: #ECE4E2;
    border-radius: 24px;
    border-left: 5px solid #723366;
    border-top: 5px solid #723366;
    box-shadow: 6px 0 14px rgba(114, 51, 102, 0.2), 0 6px 14px rgba(114, 51, 102, 0.18);
}

/* Hover: دوائر تملأ الكارد بالبنفسجي ثم ظهور السهم */
.portfolio-cert-card-fill {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 120px;
    height: 120px;
    margin-left: -60px;
    margin-top: -60px;
    border-radius: 50%;
    background: var(--portfolio-purple);
    transform: scale(0);
    opacity: 0.95;
    pointer-events: none;
}

.portfolio-cert-card:hover .portfolio-cert-card-fill-1 {
    animation: portfolio-cert-fill 0.5s ease-out forwards;
}

.portfolio-cert-card:hover .portfolio-cert-card-fill-2 {
    animation: portfolio-cert-fill 0.5s ease-out 0.12s forwards;
}

.portfolio-cert-card:hover .portfolio-cert-card-fill-3 {
    animation: portfolio-cert-fill 0.5s ease-out 0.24s forwards;
}

@keyframes portfolio-cert-fill {
    to {
        transform: scale(4);
        opacity: 0.95;
    }
}

.portfolio-cert-card:hover .portfolio-cert-card-fill {
    opacity: 0.95;
}

.portfolio-cert-card-arrow {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.6);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    z-index: 2;
    transition: opacity 0.35s ease 0.3s, transform 0.35s ease 0.3s;
}

.portfolio-cert-card-arrow img {
    width: 21px;
    height: 21px;
    object-fit: contain;
}

.portfolio-cert-card:hover .portfolio-cert-card-arrow {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.portfolio-cert-card-content {
    position: relative;
    z-index: 1;
    transition: opacity 0.25s ease;
}

.portfolio-cert-card:hover .portfolio-cert-card-content {
    opacity: 0;
    pointer-events: none;
}

.portfolio-cert-card:hover .portfolio-cert-date {
    opacity: 0;
    pointer-events: none;
}

.portfolio-cert-card-name {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 16px;
    line-height: 19px;
    color: #010101;
    margin: 0;
}

.portfolio-cert-meta {
    display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 142px;
        width: 100%;
        margin-top: 28px;
}

.portfolio-cert-issuer {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 16px;
    line-height: 19px;
    color: #79525F;
    max-width: 15ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: bottom;
}

.portfolio-cert-date {
    position: absolute;
    right: 16px;
    bottom: 16px;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 12px;
    line-height: 15px;
    color: #010101;
    white-space: nowrap;
    z-index: 1;
    transition: opacity 0.25s ease;
}

/* Skills */
.portfolio-skills {
    min-height: 446px;
    background: var(--portfolio-bg);
    padding: 40px 120px 80px;
}

.portfolio-skills-inner {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 64px;
}

/* دوائر زخرفية + ريبون في سكشن Skills */
.portfolio-skills-inner .ellipse {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    animation: portfolio-ellipse-float 6s ease-in-out infinite;
}

.portfolio-skills-inner .ellipse-dec-1:nth-of-type(1) {
    width: 40px;
    height: 40px;
    right: 24%;
    top: 13%;
    border: 2px solid var(--portfolio-ellipse-border);
    animation-delay: 0s;
}

.portfolio-skills-inner .ellipse-dec-1:nth-of-type(2) {
    width: 30px;
    height: 30px;
    right: 32%;
    top: 106%;
    left: auto;
    border: 2px solid var(--portfolio-ellipse-border);
    animation-delay: 1.2s;
}

.portfolio-skills-inner .ellipse-155 {
    box-sizing: border-box;
    width: 25px;
    height: 25px;
   
    top: 26%;
    left: 17%;
    background: rgba(114, 51, 102, 0.1);
    border: 1px solid rgba(114, 51, 102, 0.3);
    animation-delay: 0.6s;
}

.portfolio-skills-inner .portfolio-skills-ribbon {
    position: absolute;
    top: 7%;
  
    left: 3%;
    width: 84px;
    height: auto;
    object-fit: contain;
    z-index: 2;
    pointer-events: none;
    rotate: 23deg;
}

.portfolio-skills-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 36px;
    line-height: 44px;
    text-align: center;
    color: var(--portfolio-purple);
    width: 100%;
}

.portfolio-skills-title .skills-word-black {
    color: var(--portfolio-black);
}

.portfolio-skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    width: 100%;
}

.portfolio-skill-category {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 32px;
    gap: 24px;
    background: var(--portfolio-skills-bg);
    border-radius: 24px;
}

.portfolio-skill-category h3 {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 24px;
    line-height: 29px;
    color: var(--portfolio-black);
    margin: 0;
}

.portfolio-skill-tags {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
}

.portfolio-skill-tag {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 8px 16px;
    border: 0.5px solid var(--portfolio-purple);
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 12px;
    line-height: 15px;
    color: var(--portfolio-black);
    background: transparent;
    transition: background 0.25s ease, color 0.25s ease;
}

.portfolio-skill-tag:hover {
    background: var(--portfolio-purple);
    color: #FFFFFF;
}

/* Contact */
.portfolio-contact {
    min-height: 1190px;
    background: linear-gradient(360deg, #D9C8CE 0%, #E9E0DF 22.12%, #F2EEE9 69.23%);
    padding: 80px 24px 100px;
    position: relative;
}

.portfolio-contact-circle {
    position: absolute;
    right: -156px;
    top: 20%;
    transform: translateY(-50%);
    width: 240px;
    height: 240px;
    pointer-events: none;
    z-index: 1;
    opacity: 0.7;
    animation: portfolio-mine-circle-spin 140s linear infinite;
}

.portfolio-contact-inner {
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 64px;
    position: relative;
}

/* ريبونات Contact – 3 أحجام */
.portfolio-contact-ribbon {
    position: absolute;
    height: auto;
    object-fit: contain;
    z-index: 2;
    pointer-events: none;
}

.portfolio-contact-ribbon--sm {
    width: 75px;
    top: 8%;
    left: 8%;
    rotate: 24deg;
}

.portfolio-contact-ribbon--md {
    width: 53px;
    top: 46%;
    right: 10%;
    left: auto;
    rotate: 25deg;
}

.portfolio-contact-ribbon--lg {
    width: 57px;
    top: 48%;
    left: 16%;
    rotate: 27deg;
}

/* دوائر زخرفية Contact – 3 ellipse-dec-1 و 2 ellipse-155 */
.portfolio-contact-inner .ellipse {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    animation: portfolio-ellipse-float 6s ease-in-out infinite;
}

.portfolio-contact-inner .ellipse-dec-1:nth-of-type(1) {
    width: 50px;
    height: 50px;
    left: 6%;
    top: 67%;
    border: 2px solid var(--portfolio-ellipse-border);
    animation-delay: 0s;
}

.portfolio-contact-inner .ellipse-dec-1:nth-of-type(2) {
    width: 50px;
    height: 50px;
    right: 14%;
    top: 29%;
    left: auto;
    border: 2px solid var(--portfolio-ellipse-border);
    animation-delay: 1s;
}

.portfolio-contact-inner .ellipse-dec-1:nth-of-type(3) {
    width: 35px;
    height: 35px;
    right: 16%;
    bottom: 2%;
    left: auto;
    border: 2px solid var(--portfolio-ellipse-border);
    animation-delay: 2s;
}

.portfolio-contact-inner .ellipse-155 {
    box-sizing: border-box;
    width: 25px;
    height: 25px;
    left: 26%;
    background: rgba(114, 51, 102, 0.1);
    border: 1px solid rgba(114, 51, 102, 0.3);
}

.portfolio-contact-inner .ellipse-155:nth-of-type(1) {
    top: 28%;
    left: 8%;
    animation-delay: 0.6s;
}

.portfolio-contact-inner .ellipse-155:nth-of-type(2) {
    top: 72%;
    right: 12%;
    left: auto;
    animation-delay: 1.4s;
}

.portfolio-contact-inner .ellipse-150 {
    box-sizing: border-box;
    width: 60px;
    height: 60px;
    background: var(--portfolio-ellipse-fill);
}

.portfolio-contact-inner .ellipse-150:nth-of-type(6) {
    left: 6%;
    top: 48%;
    animation-delay: 0.8s;
}

.portfolio-contact-inner .ellipse-150:nth-of-type(7) {
    right: 18%;
    bottom: 28%;
    left: auto;
    width: 30px;
    height: 30px;
    animation-delay: 1.8s;
}

.portfolio-contact-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: bold;
    font-size: 36px;
    line-height: 43px;
    text-align: center;
    color: var(--portfolio-black);
    margin-bottom: 147px;
}

.portfolio-contact-card-wrap {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* الظرف هو الأساس – في التدفق يحدد الحجم */
.portfolio-envelope-base {
    position: relative;
    width: 70%;
    margin: 0 auto;
}

/* الظرف 70% من عرض الصفحة – المثلثات كلها نسب، في التدفق عشان يكون الأساس */
.portfolio-envelope-triangles {
    position: relative;
    width: 68%;
    margin: 0 auto;
    aspect-ratio: 679 / 702;
    z-index: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* دوما بلنصف – وسّط محتوى الظرف */
.envelope-triangles-inner {
    position: relative;
    width: 100%;
    height: 100%;
    min-width: 200px;
    min-height: 207px;
    overflow: hidden;
    aspect-ratio: 679 / 702;
    margin: 0 auto;
}

.portfolio-envelope-triangles .envelope-tri {
    position: absolute;
    object-fit: fill;
    object-position: center;
    pointer-events: none;
    display: block;
}

/* التوب – نسبة من ارتفاع الظرف عشان يضل تناسب */
.envelope-tri-top {
    top: 9.15%;
    left: 0;
    width: 100%;
    height: 35.8%;
    z-index: 2;
}

/* المركز – فوق النص تحت التوب، ملاصق للتوب والتحت */
.envelope-tri-center {
    top: 34.0%;
    left: 2px;
    width: 99%;
    height: 40.2%;
    z-index: 2;
}

/* تحت – ملاصق للمركز */
.envelope-tri-bottom {
    top: 57%;
    left: -44%;
    width: 188%;
    height: 40%;
    z-index: 2;
}

/* يسار الكارت – حدود ملاصقة مع باقي الظرف */
.envelope-tri-left {
    top: 0;
    left: 0;
    width: 52%;
    height: 128%;
    z-index: 2;
}

/* يمين الكارت – حدود ملاصقة مع باقي الظرف */
.envelope-tri-right {
    top: 0;
    right: 0;
    left: auto;
    width: 51%;
    height: 129%;
    z-index: 2;
}

/* الكربطة – أيقونة في نص الظرف */
.envelope-tri-icon {
    top: 65%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16%;
    height: auto;
    max-height: 22%;
    object-fit: contain;
    z-index: 6;
    pointer-events: none;
}

/* تابلت – نفس التصميم مع تناسب أفضل */
@media (max-width: 992px) {
    .portfolio-envelope-base {
        width: 78%;
    }
    .portfolio-envelope-triangles {
        width: 72%;
    }
    .portfolio-contact-form-wrap {
        width: 48%;
        max-width: 100%;
        min-height: 460px;
        padding: 24px;
    }
}

@media (max-width: 768px) {
    .portfolio-envelope-base {
        width: 88%;
    }
    .portfolio-envelope-triangles {
        width: 80%;
    }
    .envelope-triangles-inner {
        min-width: 180px;
        min-height: 186px;
    }
    .portfolio-contact-form-wrap {
        width: 72%;
        max-width: 100%;
        min-height: 420px;
        padding: 20px;
        clip-path: polygon(
            0 0,
            100% 0,
            100% calc(100% - 20px),
            94% 100%,
            50% calc(100% - 6px),
            6% 100%,
            0 calc(100% - 20px)
        );
        -webkit-clip-path: polygon(
            0 0,
            100% 0,
            100% calc(100% - 20px),
            94% 100%,
            50% calc(100% - 6px),
            6% 100%,
            0 calc(100% - 20px)
        );
    }
    /* إخفاء المثلث العلوي في الظرف على كل الشاشات الصغيرة */
    .envelope-tri-top {
        display: none !important;
    }
}

.portfolio-contact-envelope-wrap {
    position: absolute;
    left: 50%;
    top: 83%;
    transform: translate(-50%, -30%);
    width: 100%;
    max-width: 62%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 0;
    pointer-events: none;
}

/* Envelope من عناصر CSS - كل جزء مثلث أو شكل قابل للتحكم */
.portfolio-envelope {
    position: relative;
    width: 100%;
    max-width: 400px;
    padding-top: 70%;
}

.portfolio-envelope-part {
    position: absolute;
    box-sizing: border-box;
}

/* Polygon 10 - الغطاء العلوي الخارجي */
.portfolio-envelope-poly-10 {
    left: -181.47%;
    right: -177.2%;
    top: -94%;
    bottom: 115.55%;
    background: #E9C1C2;
    border: 1px dashed #FCDEF6;
    border-radius: 63px;
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

/* Polygon 11 - الغطاء الداخلي */
.portfolio-envelope-poly-11 {
    left: -177%;
    right: 44.12%;
    top: -25.63%;
    bottom: 4.86%;
    background: #922913;
    border: 1px dashed #be2125;
    border-radius: 138px;
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    transform: matrix(0, -1, -1, 0, 0, 0);
}

/* Polygon 11 - نسخة معكوسة بالجهة المقابلة (يمين) */
.portfolio-envelope-poly-11-right {
    left: 47.12%;
    right: -177%;
    top: -24.63%;
    bottom: 4.86%;
    background: #922913;
    border: 1px dashed #be2125;
    border-radius: 138px;
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    rotate: -92deg;
}

/* Polygon 13 - القاعدة السفلية */
.portfolio-envelope-poly-13 {
    left: -187.02%;
    right: -188.74%;
    top: 21.93%;
    bottom: 13%;
    background: #F2E4E1;
    border: 1px dashed #E9C1C2;
    border-radius: 94px;
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

/* Polygon 14 - المثلث الأمامي */
.portfolio-envelope-poly-14 {
    left: -173.34%;
    right: -172.07%;
    top: -18.62%;
    bottom: 66.67%;
    background: #E9C1C2;
    border: 1px dashed #7F3975;
    clip-path: polygon(50% 100%, 0% 0%, 100% 0%);
    /* transform: matrix(1, 0, 0, -1, 0, 0); */
    z-index: -1;
}

/* Polygon 12 - المثلث الصغير (تاب الظرف) - مثل الـ SVG */
.portfolio-envelope-poly-12 {
    box-sizing: border-box;
    position: absolute;
    left: 45.89%;
    right: 48.55%;
    top: 93.3%;
    bottom: 3.18%;
    background: #F2E4E1;
    border: 1px dashed #E9C1C2;
    border-radius: 16px;
    transform: rotate(-90deg);
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

/* الكارت يتحرك – فوق الظرف، الزوايا السفلى مقصوصة كأنه طالع من جوا الظرف */
.portfolio-contact-form-wrap {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 39%;
    max-width: 520px;
    min-height: 494px;
    padding: 28px;
    background: var(--portfolio-contact-bg);
    border: 1px dashed var(--portfolio-envelope);
    border-radius: 18px 18px 0 0;
    box-sizing: border-box;
    z-index: 1;
    /* إخفاء الزاويتين السفليتين – يوحي أن الكارت داخل الظرف */
    clip-path: polygon(
        0 0,
        100% 0,
        100% calc(100% - 24px),
        94% 100%,
        50% calc(100% - 8px),
        6% 100%,
        0 calc(100% - 24px)
    );
    -webkit-clip-path: polygon(
        0 0,
        100% 0,
        100% calc(100% - 24px),
        94% 100%,
        50% calc(100% - 8px),
        6% 100%,
        0 calc(100% - 24px)
    );
}

.portfolio-contact-form {
    display: flex;
    flex-direction: column;
    gap: 26px;
}

.portfolio-contact-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.portfolio-contact-field label {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 16px;
    line-height: 19px;
    color: var(--portfolio-black);
}

.portfolio-contact-field input,
.portfolio-contact-field textarea {
    width: 100%;
    padding: 10px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 18px;
    color: var(--portfolio-black);
    background: transparent;
    border: none;
    border-bottom: 0.5px solid var(--portfolio-black);
    outline: none;
}

.portfolio-contact-field input::placeholder,
.portfolio-contact-field textarea::placeholder {
    color: #1C1C1C;
}

.portfolio-contact-field textarea {
    min-height: 112px;
    resize: vertical;
}

.portfolio-contact-info {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
}

.portfolio-contact-info-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 12px;
    line-height: 15px;
    color: var(--portfolio-purple);
}

.portfolio-contact-info-item svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* زر الإرسال آخر شي تحت الظرف (تحت الـ base) */
.portfolio-contact-submit-wrap {
    margin-top: 25px;
    position: relative;
    z-index: 1;
    width: 70%;
    display: flex;
    justify-content: center;
}

@media (max-width: 768px) {
    .portfolio-contact-submit-wrap {
        width: 85%;
    }
}

/* Outer frame: 320×56, 2px solid #877279, radius 32px */
.portfolio-contact-submit-outer {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 320px;
    height: 56px;
    padding: 4px;
    border: 2px solid var(--portfolio-purple-light);
    border-radius: 32px;
    box-sizing: border-box;
}

.portfolio-contact-submit {
    width: 312px;
    height: 48px;
    padding: 12px 24px;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 20px;
    line-height: 24px;
    color: #FFFFFF;
    background: var(--portfolio-purple);
    border: none;
    border-radius: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* خط تاشر من تحت زر الإرسال */
.portfolio-contact-cta-line {
    position: absolute;
    left: 73%;
    top: 48%;
    transform: translate(-50%, 8px) scale(1.75) scaleY(1) scaleX(-1);
    transform-origin: 50% 0;
    width: 224px;
    height: 70px;
    pointer-events: none;
}

/* ========== Responsive (Tablet & Desktop) ========== */
@media (max-width: 1200px) {
    .portfolio-hero { padding: 60px 24px 48px; }
    .portfolio-hero-inner { flex-direction: column; text-align: center; max-width: 100%; }
    .portfolio-hero-left { align-items: center; max-width: 100%; }
    .portfolio-hero-cta { flex-wrap: wrap; justify-content: center; }
    .portfolio-about { padding: 40px 24px 48px; }
    .portfolio-about-inner { flex-direction: column; }
    .portfolio-experience { padding: 40px 24px 48px; }
    .portfolio-experience-row { flex-direction: column; }
    .portfolio-exp-card,
    .portfolio-exp-cta-cell,
    .portfolio-exp-card-cta { width: 100%; max-width: 100%; }
    .portfolio-certificates { padding: 40px 24px 48px; }
    .portfolio-skills { padding: 40px 24px 48px; }
    .portfolio-skills-grid { grid-template-columns: 1fr; }
    .portfolio-skill-category { max-width: 100%; }
    .portfolio-mine { padding: 40px 24px 80px; }
}

@media (max-width: 992px) {
    .portfolio-hero { padding: 56px 20px 40px; }
    .portfolio-hero-right { width: 100%; max-width: 100%; }
    .portfolio-hero-image-wrap { max-width: min(280px, 90vw); }
    .portfolio-mine-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px;
        max-width: 900px;
    }
    .portfolio-card { width: 100%; max-width: 100%; }
    .portfolio-card:hover { width: 100%; max-width: 100%; }
    .portfolio-experience { padding: 40px 20px 48px; }
    .portfolio-certificates { padding: 40px 20px 48px; }
    .portfolio-certificates-grid { max-width: 100%; }
    .portfolio-cert-card { flex: 0 0 100%; width: 100%; max-width: 420px; margin-left: auto; margin-right: auto; }
    .portfolio-certificates-grid .portfolio-cert-card:nth-child(4):nth-last-child(1),
    .portfolio-certificates-grid .portfolio-cert-card:nth-child(4):nth-last-child(2) { margin-left: auto; }
    .portfolio-skills { padding: 40px 20px 48px; }
    .portfolio-contact { padding: 60px 20px 80px; }
}

@media (max-width: 768px) {
    .portfolio-hero { padding: 48px 16px 32px; }
    .portfolio-hero-title-row { flex-wrap: wrap; }
    .portfolio-hero-title-row .uiux,
    .portfolio-hero-designer-wrap .designer { font-size: 36px; line-height: 44px; }
    .portfolio-about { padding: 32px 16px 40px; }
    .portfolio-mine { padding: 32px 16px 48px; }
    .portfolio-mine-grid {
        grid-template-columns: 1fr;
        gap: 24px;
        max-width: min(405px, 100%);
        margin-left: auto;
        margin-right: auto;
    }
    .portfolio-card { width: 100%; max-width: 405px; margin: 0 auto; }
    .portfolio-card:hover { width: 100%; max-width: 405px; }
    .portfolio-experience { padding: 32px 16px 40px; }
    .portfolio-experience-inner { max-width: 100%; padding: 0 0; }
    .portfolio-exp-card,
    .portfolio-exp-cta-cell,
    .portfolio-exp-card-cta { width: 100%; max-width: 100%; }
    .portfolio-certificates { padding: 32px 16px 40px; }
    .portfolio-certificates-inner { max-width: 100%; }
    .portfolio-certificates-grid { max-width: min(400px, 100%); margin-left: auto; margin-right: auto; }
    .portfolio-cert-card { max-width: 100%; }
    .portfolio-skills { padding: 32px 16px 40px; }
    .portfolio-skills-inner { max-width: 100%; }
    .portfolio-contact { padding: 48px 16px 64px; }
    .portfolio-contact-info { flex-direction: column; align-items: flex-start; }
}

/* ========== Small phones (576px): mobile-style content width ========== */
@media (max-width: 576px) {
    /* المحتوى فوق الدوائر، الدوائر تبقى ظاهرة وراه */
    .portfolio-hero-inner { position: relative; z-index: 1; }
    .portfolio-about-inner { position: relative; z-index: 1; }
    .portfolio-mine-inner { position: relative; z-index: 1; }
    .portfolio-hero-headline .hey {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25em;
    }
    .portfolio-hero-hey-static { display: block; }
    .portfolio-hero-name-line { display: block; }
    .portfolio-hero-hey-a { display: none; }
    .portfolio-hero-inner { max-width: min(380px, calc(100% - 32px)); margin-left: auto; margin-right: auto; }
    .portfolio-about-inner { max-width: min(380px, calc(100% - 32px)); margin-left: auto; margin-right: auto; }
    .portfolio-mine-inner { max-width: min(380px, calc(100% - 32px)); margin-left: auto; margin-right: auto; }
    .portfolio-experience-inner { max-width: min(380px, calc(100% - 32px)); margin-left: auto; margin-right: auto; }
    .portfolio-certificates-inner { max-width: min(380px, calc(100% - 32px)); margin-left: auto; margin-right: auto; }
    .portfolio-certificates-grid .portfolio-cert-more-trigger { display: flex; }
    .portfolio-certificates-grid .portfolio-cert-card:nth-child(n+5) { display: none; }
    .portfolio-certificates-grid.show-all-certificates .portfolio-cert-card:nth-child(n+5) { display: flex; }
    .portfolio-certificates-grid.show-all-certificates .portfolio-cert-more-trigger { display: none; }
    .portfolio-skills-inner { max-width: min(380px, calc(100% - 32px)); margin-left: auto; margin-right: auto; }
    .portfolio-skills-grid .portfolio-skills-more-trigger { display: flex; }
    .portfolio-skills-grid .portfolio-skill-category:nth-child(n+5) { display: none; }
    .portfolio-skills-grid.show-all-skills .portfolio-skill-category:nth-child(n+5) { display: flex; }
    .portfolio-skills-grid.show-all-skills .portfolio-skills-more-trigger { display: none; }
    .portfolio-mine-grid { grid-template-columns: 1fr; max-width: min(380px, 100%); }
    .portfolio-more-trigger {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        width: auto;
        max-width: 380px;
        margin: 0 auto;
        padding: 12px 0;
        border: none;
        border-radius: 0;
        background: transparent;
        font-family: 'Inter', sans-serif;
        font-weight: 700;
        font-size: 20px;
        line-height: 1.2;
        color: var(--portfolio-purple);
        cursor: pointer;
    }
    .portfolio-more-trigger:hover,
    .portfolio-more-trigger:focus { opacity: 0.85; outline: none; }
    .portfolio-more-arrows {
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        gap: 1px;
        color: var(--portfolio-purple);
    }
    .portfolio-more-arrows svg { display: block; }
    .portfolio-mine-grid .portfolio-card:nth-child(n+5) { display: none; }
    .portfolio-mine-grid.show-all-projects .portfolio-card:nth-child(n+5) { display: flex; }
    .portfolio-mine-grid.show-all-projects .portfolio-more-trigger { display: none; }
    .portfolio-section-title,
    .portfolio-mine-title,
    .portfolio-experience-title,
    .portfolio-certificates-title,
    .portfolio-skills-title { font-size: clamp(18px, 4.8vw, 24px); line-height: 1.2; }
    /* دوائر الهيرو – مواضع وأحجام للتلفونات فقط */
    .portfolio-hero .ellipse-dec-2 {
        width: 20px;
        height: 20px;
        top: 52%;
        right: 74%;
        border: 2px solid var(--portfolio-ellipse-border);
        animation-delay: 0.8s;
    }
    .portfolio-hero .ellipse-dec-3 {
        width: 25px;
        height: 25px;
        right: 5%;
        top: 63%;
        border: 2px solid var(--portfolio-ellipse-border);
        animation-delay: 1.6s;
    }
    .portfolio-hero .ellipse-dec-4 {
        width: 40px;
        height: 40px;
        right: 86%;
        top: 56%;
        background: var(--portfolio-ellipse-fill);
        animation-delay: 2.4s;
    }
    .portfolio-hero .ellipse-dec-5 {
        width: 20px;
        height: 20px;
        right: 25%;
        top: 95%;
        border: 2px solid var(--portfolio-ellipse-border);
        animation-delay: 3.2s;
    }
}

/* ========== Responsive Mobile (Figma 375px) ========== */
@media (max-width: 480px) {
    .portfolio-contact {
        min-height: 1034px;
    }
    .portfolio-container {
        max-width: 100%;
        min-height: auto;
    }

    /* Hero - 343px content, column, 32px gap - مرفوع لفوق شوي بالتلفون */
    .portfolio-hero {
        min-height: auto;
        padding: 22px 16px 32px;
        padding-top: max(8px, calc(12px + env(safe-area-inset-top)));
    }
    .portfolio-hero-inner {
        position: relative;
        z-index: 1;
        flex-direction: column;
        gap: 32px;
        width: 100%;
        max-width: min(380px, 100%);
        margin: 0 auto;
    }
    .portfolio-hero-left {
        gap: 24px;
        max-width: 100%;
        align-items: flex-start;
    }
    .portfolio-hero-headline .hey {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25em;
        font-size: 20px;
        line-height: 24px;
    }
    .portfolio-hero-hey-static {
        display: block;
    }
    .portfolio-hero-name-line {
        display: block;
    }
    .portfolio-hero-hey-a {
        display: none;
    }
    .portfolio-hero-title-row .uiux,
    .portfolio-hero-designer-wrap .designer {
        font-size: 32px;
        line-height: 39px;
    }
    .portfolio-hero-title-underline {
        max-width: 100%;
        height: auto;
    }
    .portfolio-hero-desc {
        font-size: 14px;
        line-height: 17px;
    }
    .portfolio-hero-cta-line {
        display: none;
    }
    .portfolio-hero-cta {
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: flex-start;
        align-items: center;
        width: 100%;
        gap: 12px;
    }
    .portfolio-hero-cta .portfolio-btn {
        flex-shrink: 0;
    }
    .portfolio-hero-cta .portfolio-cv-dropdown-wrap {
        flex-shrink: 0;
    }
    .portfolio-btn {
        padding: 8px 9px;
        font-size: 16px;
        line-height: 17px;
        min-width: 0;
        width: 200px;
        height: 36px;
        max-width: 50%;
    }
    .portfolio-link-underline,
    .portfolio-cv-dropdown-trigger {
        font-size: 14px;
        line-height: 17px;
        padding-bottom: 12px;
    }
    .portfolio-cv-dropdown-wrap {
        position: relative;
    }
    .portfolio-cv-dropdown {
        left: auto;
        right: 0px;
        width: 140px;
        padding: 0 6px;
        min-width: 0;
    }
    .portfolio-cv-dropdown-item {
        padding: 10px 12px;
        font-size: 14px;
        line-height: 17px;
    }
    .portfolio-link-underline svg,
    .portfolio-cv-dropdown-trigger svg {
        width: 24px;
        height: 24px;
    }
    .portfolio-hero-right {
        width: 100%;
        min-height: auto;
        flex-direction: row;
        align-items: center;
        gap: 8px;
        justify-content: center;
    }
    .portfolio-hero-image-wrap {
        width: 258px;
        height: 350px;
        flex-shrink: 0;
    }
    .portfolio-hero-image-wrap .img-outer,
    .portfolio-hero-image-wrap .img-inner {
        width: 258px;
        height: 350px;
    }
    .portfolio-hero-image-wrap .img-outer {
        left: 22px;
        top: 15px;
    }
    .portfolio-hero-social {
        position: static;
        transform: none;
        flex-direction: column;
        justify-content: flex-end;
        margin-top: 69px;
    }
    .portfolio-hero-social-links .portfolio-social-in-text,
    .portfolio-hero-social-links .portfolio-social-be-text {
        font-size: 12px;
        line-height: 18px;
    }
    .portfolio-hero-social-links .portfolio-social-phone-icon {
        width: 16px;
        height: 16px;
    }
    .portfolio-hero-social-links .portfolio-social-github-icon {
        width: 20px;
        height: 18px;
    }
    .portfolio-hero .ellipse-151,
    .portfolio-hero .ellipse-152,
    .portfolio-hero .ellipse-150,
    .portfolio-hero .ellipse-155,
    .portfolio-hero .ellipse-156,
    .portfolio-page-circle-left,
    .portfolio-mine-circle-right {
        display: none;
    }

    /* About - 343px card, centered */
    .portfolio-about {
        min-height: auto;
        padding: 24px 16px 32px;
    }
    .portfolio-about-inner {
        flex-direction: column;
        gap: 24px;
        width: 100%;
        max-width: min(380px, 100%);
        margin: 0 auto;
    }
    .portfolio-about-image-wrap {
        display: none;
    }
    .portfolio-about-content {
        width: 100%;
        max-width: 100%;
        background: var(--portfolio-card-bg);
        border: 1px solid var(--portfolio-purple);
        border-radius: 24px;
        padding: 16px;
        gap: 24px;
        align-items: center;
    }
    .portfolio-about-content h2 {
        font-size: 20px;
        line-height: 24px;
        text-align: center;
    }
    .portfolio-about-content .text {
        font-size: 14px;
        line-height: 150%;
        text-align: center;
    }
    .portfolio-about .portfolio-btn,
    .portfolio-about .portfolio-btn-sm {
        font-size: 16px;
        line-height: 16px;
    }

    /* My Portfolio - 380px cards, 32px gap */
    .portfolio-mine {
        min-height: auto;
        padding: 24px 16px 32px;
    }
    .portfolio-mine-inner {
        gap: 24px;
        width: 100%;
        max-width: min(380px, 100%);
        margin: 0 auto;
    }
    .portfolio-mine-title {
        font-size: 20px;
        line-height: 24px;
    }
    .portfolio-mine-grid {
        flex-direction: column;
        gap: 32px;
        max-width: min(380px, 100%);
        margin-left: auto;
        margin-right: auto;
    }
    .portfolio-more-trigger {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        width: auto;
        max-width: 380px;
        margin: 0 auto;
        padding: 14px 0;
        border: none;
        border-radius: 0;
        background: transparent;
        font-family: 'Inter', sans-serif;
        font-weight: 700;
        font-size: 20px;
        line-height: 1.2;
        color: var(--portfolio-purple);
        cursor: pointer;
        transition: opacity 0.2s;
    }
    .portfolio-more-trigger:hover,
    .portfolio-more-trigger:focus {
        opacity: 0.85;
        outline: none;
    }
    .portfolio-more-arrows {
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        gap: 0px;
        color: var(--portfolio-purple);
    }
    .portfolio-more-arrows svg {
        display: block;
    }
    .portfolio-mine-grid .portfolio-card:nth-child(n+5) {
        display: none;
    }
    .portfolio-mine-grid.show-all-projects .portfolio-card:nth-child(n+5) {
        display: flex;
    }
    .portfolio-mine-grid.show-all-projects .portfolio-more-trigger {
        display: none;
    }
    .portfolio-card {
        width: 100%;
        max-width: min(380px, 100%);
        gap: 16px;
    }
    .portfolio-card:hover {
        width: 100%;
        max-width: min(380px, 100%);
        min-height: auto;
        padding: 0;
    }
    .portfolio-card:hover .portfolio-card-image {
        height: 256.52px;
    }
    .portfolio-card:hover .portfolio-card-top .portfolio-card-details-main {
        display: flex;
    }
    .portfolio-card:hover .portfolio-card-hover {
        display: none;
    }
    /* التلفون: الضغط على البطاقة يظهر نفس تأثير الهوفر (محتوى مفتوح) */
    .portfolio-card:focus,
    .portfolio-card:focus-within {
        outline: none;
        width: 100%;
        max-width: min(380px, 100%);
        min-height: auto;
        align-items: center;
        padding: 4px 4px 8px;
        gap: 24px;
        background: #FFFFFF;
        box-shadow: 0px 0px 8px rgba(69, 69, 69, 0.12);
        border-radius: 16px;
    }
    .portfolio-card:focus .portfolio-card-top .portfolio-card-details-main,
    .portfolio-card:focus-within .portfolio-card-top .portfolio-card-details-main {
        display: none;
    }
    .portfolio-card:focus .portfolio-card-hover,
    .portfolio-card:focus-within .portfolio-card-hover {
        display: flex;
    }
    .portfolio-card:focus .portfolio-card-image,
    .portfolio-card:focus-within .portfolio-card-image {
        height: 256.52px;
    }
    .portfolio-card:focus .portfolio-card-skills,
    .portfolio-card:focus-within .portfolio-card-skills {
        gap: 6px;
    }
    .portfolio-card:focus .portfolio-card-skill,
    .portfolio-card:focus-within .portfolio-card-skill {
        width: auto;
        height: 22px;
        min-width: 22px;
        padding: 0 5px;
        font-size: 10px;
        line-height: 12px;
        border-radius: 4px;
    }
    .portfolio-mine .portfolio-card-btn {
        padding: 8px 16px;
        width: 140px;
        height: 32px;
        font-size: 14px;
        line-height: 17px;
    }
    .portfolio-card-image {
        height: 256.52px;
    }
    .portfolio-mine-grid:hover .portfolio-card {
        opacity: 1;
    }
    .portfolio-tag {
        padding: 6px 12px;
    }
    .portfolio-card-title {
        font-size: 14px;
        line-height: 17px;
    }
    .portfolio-card-type {
        font-size: 14px;
        line-height: 17px;
    }
    .portfolio-card-arrow {
        width: 40px;
        height: 40px;
        border-width: 1px;
    }
    .portfolio-card-arrow svg,
    .portfolio-card-arrow img {
        width: 16px;
        height: 20px;
    }

    /* Experience - 343px cards, 24px gap */
    .portfolio-experience {
        min-height: auto;
        padding: 24px 16px 32px;
    }
    .portfolio-experience-inner {
        gap: 24px;
        width: 100%;
        max-width: min(380px, 100%);
        margin: 0 auto;
    }
    .portfolio-experience-title {
        font-size: 20px;
        line-height: 24px;
    }
    .portfolio-experience-grid {
        gap: 24px;
    }
    .portfolio-experience-row {
        flex-direction: column;
        gap: 24px;
    }
    .portfolio-exp-card {
        padding: 16px 24px;
        gap: 16px;
        width: 100%;
    }
    .portfolio-exp-card-cta .heading {
        font-size: 24px;
        line-height: 29px;
    }
    .portfolio-exp-cta-line {
        display: none;
    }
    .portfolio-exp-deco {
        display: none;
    }
    .portfolio-exp-card .company {
        font-size: 16px;
        line-height: 19px;
    }
    .portfolio-exp-card .role {
        font-size: 20px;
        line-height: 24px;
    }
    .portfolio-exp-card .desc {
        font-size: 14px;
    }
    .portfolio-exp-card .date {
        font-size: 14px;
        line-height: 17px;
    }

    /* Certificates - 343px column */
    .portfolio-certificates {
        min-height: auto;
        padding: 24px 16px 32px;
    }
    .portfolio-certificates-inner {
        gap: 24px;
        width: 100%;
        max-width: min(380px, 100%);
        margin: 0 auto;
    }
    .portfolio-certificates-title {
        font-size: 20px;
        line-height: 24px;
    }
    .portfolio-certificates-grid {
        max-width: min(380px, 100%);
        gap: 24px;
        margin: 0 auto;
    }
    .portfolio-certificates-grid .portfolio-cert-more-trigger {
        display: flex;
    }
    .portfolio-certificates-grid .portfolio-cert-card:nth-child(n+5) {
        display: none;
    }
    .portfolio-certificates-grid.show-all-certificates .portfolio-cert-card:nth-child(n+5) {
        display: flex;
    }
    .portfolio-certificates-grid.show-all-certificates .portfolio-cert-more-trigger {
        display: none;
    }
    .portfolio-certificates-grid .portfolio-cert-card:first-child:nth-last-child(1),
    .portfolio-certificates-grid .portfolio-cert-card:nth-child(4):nth-last-child(1),
    .portfolio-certificates-grid .portfolio-cert-card:nth-child(4):nth-last-child(2) {
        margin-left: 0;
    }
    .portfolio-cert-card {
        flex: 0 0 100%;
        width: 100%;
        max-width: min(380px, 100%);
        margin-left: 0;
        margin-right: 0;
    }
    .portfolio-cert-issuer {
        font-size: 14px;
        line-height: 17px;
    }

    /* Skills - 343px column, 16px category title */
    .portfolio-skills {
        min-height: auto;
        padding: 24px 16px 32px;
    }
    .portfolio-skills-inner {
        gap: 24px;
        width: 100%;
        max-width: min(380px, 100%);
        margin: 0 auto;
    }
    .portfolio-skills-inner .ellipse,
    .portfolio-skills-inner .portfolio-skills-ribbon {
        display: none;
    }
    .portfolio-skills-title {
        font-size: 20px;
        line-height: 24px;
    }
    .portfolio-skills-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .portfolio-skill-category {
        width: 100%;
        max-width: min(380px, 100%);
        padding: 24px 16px;
        gap: 24px;
    }
    .portfolio-skill-category h3 {
        font-size: 16px;
        line-height: 19px;
    }
    .portfolio-skill-tag {
        padding: 6px 12px;
    }
    .portfolio-skills-grid .portfolio-skills-more-trigger {
        display: flex;
    }
    .portfolio-skills-grid .portfolio-skill-category:nth-child(n+5) {
        display: none;
    }
    .portfolio-skills-grid.show-all-skills .portfolio-skill-category:nth-child(n+5) {
        display: flex;
    }
    .portfolio-skills-grid.show-all-skills .portfolio-skills-more-trigger {
        display: none;
    }

    /* Contact - 311px form, 20px title */
    .portfolio-contact {
        min-height: auto;
        padding: 64px 16px 48px;
        padding-bottom: max(48px, calc(24px + env(safe-area-inset-bottom)));
    }
    .portfolio-contact-inner {
        gap: 24px;
        max-width: 100%;
    }
    .portfolio-contact-title {
        font-size: 20px;
        line-height: 24px;
        margin-bottom: 32px;
    }
    .portfolio-contact-ribbon,
    .portfolio-contact-inner .ellipse {
        display: none;
    }
    .portfolio-contact-form-wrap {
        max-width: 311px;
        width: 90%;
        padding: 16px;
        min-height: 380px;
        clip-path: polygon(
            0 0,
            100% 0,
            100% calc(100% - 16px),
            93% 100%,
            50% calc(100% - 5px),
            7% 100%,
            0 calc(100% - 16px)
        );
        -webkit-clip-path: polygon(
            0 0,
            100% 0,
            100% calc(100% - 16px),
            93% 100%,
            50% calc(100% - 5px),
            7% 100%,
            0 calc(100% - 16px)
        );
    }
    .portfolio-contact-form {
        gap: 24px;
    }
    .portfolio-contact-field input,
    .portfolio-contact-field textarea {
        max-width: 100%;
    }
    .portfolio-contact-info {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 16px;
    }
    .portfolio-contact-submit-wrap {
        margin-top: 25px;
    }
    .portfolio-contact-submit-outer {
        width: 100%;
        max-width: 320px;
        height: 56px;
    }
    .portfolio-contact-submit {
        width: 100%;
        max-width: 312px;
        height: 48px;
        font-size: 16px;
        line-height: 19px;
        padding: 12px 24px;
    }
    .portfolio-contact-cta-line {
        display: none;
    }
    .portfolio-contact-envelope-wrap {
        max-width: 280px;
    }
}

@media (max-width: 480px) {
    .portfolio-contact-card-wrap {
        width: 431px;
        max-width: 100%;
        min-height: 272px;
        margin: 53px auto;
    }
    .portfolio-contact-inner {
        gap: 40px;
        width: 100%;
        max-width: 100%;
    }
    .portfolio-contact-form-wrap {
        max-width: 311px;
        width: 72%;
        padding: 16px;
        min-height: 515px;
        clip-path: polygon(
            0 0,
            100% 0,
            100% calc(100% - 16px),
            93% 100%,
            50% calc(100% - 5px),
            7% 100%,
            0 calc(100% - 16px)
        );
        -webkit-clip-path: polygon(
            0 0,
            100% 0,
            100% calc(100% - 16px),
            93% 100%,
            50% calc(100% - 5px),
            7% 100%,
            0 calc(100% - 16px)
        );
    }
    /* خلي الظرف أكبر من الكارت في الموبايل */
    .portfolio-envelope-base {
        width: 100%;
        max-width: 431px;
        margin: 0 auto;
    }
    .portfolio-envelope-triangles {
        width: 100%;
        max-width: 431px;
        margin: 0 auto;
        aspect-ratio: 431 / 291;
    }
    .envelope-triangles-inner {
        aspect-ratio: 431 / 291;
        min-height: 260px;
    }
    .portfolio-contact-cta-line {
        display: block;
    }
    /* إخفاء المثلث العلوي في الظرف على التلفونات */
    .envelope-tri-top {
        display: none;
    }
}
/* ========== Very small screens (320px–360px): no horizontal scroll ========== */
@media (max-width: 360px) {
    .portfolio-hero { padding-left: 12px; padding-right: 12px; }
    .portfolio-hero-inner { max-width: 100%; }
    .portfolio-hero-cta {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: flex-start;
        gap: 8px;
    }
    .portfolio-hero-cta .portfolio-btn {
        max-width: 50%;
        width: auto;
        min-width: 0;
        flex-shrink: 1;
    }
    .portfolio-hero-cta .portfolio-cv-dropdown-wrap {
        flex-shrink: 0;
    }
    .portfolio-about,
    .portfolio-mine,
    .portfolio-experience,
    .portfolio-certificates,
    .portfolio-skills { padding-left: 12px; padding-right: 12px; }
    .portfolio-contact { padding-left: 12px; padding-right: 12px; }
    .portfolio-contact-form-wrap { width: 95%; max-width: none; }
    .portfolio-contact-submit-outer,
    .portfolio-contact-submit { max-width: 100%; }
    /* نزل الظرف لتحت أكثر في الشاشات الصغيرة جدًا */
    .portfolio-envelope-base {
        margin: 40px auto 0;
    }
}

/* Prevent any horizontal overflow on all viewports */
.portfolio-page,
.portfolio-container,
.portfolio-section {
    min-width: 0;
}
.portfolio-container * {
    min-width: 0;
}
img.portfolio-profile-img,
.portfolio-hero-image-wrap .img-inner {
    max-width: 100%;
    object-fit: cover;
}

