/* Design System & Variable Architecture 
   Inspired precisely by reference images.
*/

@font-face {
    font-family: 'Vazirmatn';
    src: url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/fonts/webfonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/fonts/webfonts/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
}

:root {
    --primary-color: #fca92a;
    /* Main yellow-orange accent */
    --primary-hover: #e59318;
    --dark-color: #3f3f3f;
    /* Neutral dark gray for headers and buttons */
    --light-bg: #ffffff;
    --gray-bg: #f5f5f5;
    --text-main: #333333;
    --text-muted: #777777;
    --footer-bg: #414143;
    --font-sans: 'Vazirmatn', system-ui, -apple-system, sans-serif;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}


/* Base Reset */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    background-color: var(--light-bg);
    color: var(--text-main);
    line-height: 1.7;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-smooth);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}


/* Button UI Components */

.btn-outline {
    border: 2px solid var(--dark-color);
    padding: 10px 24px;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--dark-color);
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    display: inline-block;
}

.btn-outline:hover {
    background-color: var(--dark-color);
    color: #fff;
}

.btn-solid {
    background-color: var(--primary-color);
    color: #fff;
    padding: 12px 32px;
    font-weight: 700;
    font-size: 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: inline-block;
}

.btn-solid:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-dark-solid {
    background-color: var(--dark-color);
    color: #fff;
    padding: 14px 28px;
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}

.btn-dark-solid:hover {
    background-color: #2b2b2b;
    transform: translateY(-2px);
}


/* Header Section Style */

.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
    transition: var(--transition-smooth);
}

.header-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    font-weight: 700;
    color: #222;
    font-size: 1rem;
    padding: 5px 0;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition-smooth);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.logo {
    color: #111;
    display: flex;
    align-items: center;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
}

.menu-toggle .bar {
    width: 25px;
    height: 3px;
    background-color: var(--dark-color);
    transition: var(--transition-smooth);
}


/* Section Common Titles */

.section-title {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    color: #222;
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
}

.center-title {
    text-align: center;
    width: 100%;
}

.center-title::after {
    content: '';
    display: block;
    width: 350px;
    height: 4px;
    background-color: var(--primary-color);
    margin: 15px auto 0 auto;
}


/* Hero Section Style */

.hero-section {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 40% 60%;
    align-items: center;
    padding-top: 80px;
}

.hero-left-bg {
    background-color: #f9ab26;
    height: 100%;
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero-image-container {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    overflow: hidden;
}

.fallback-portrait {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.hero-portrait {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center bottom;
    display: block;
}

.hero-content {
    padding: 0 10% 0 5%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-title {
    font-size: clamp(1.9rem, 5vw, 2.8rem);
    font-weight: 700;
    color: #222;
    margin-bottom: 15px;
}

.hero-subtitle {
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    color: #666;
    margin-bottom: 35px;
}


/* About Section Style */

.about-section {
    padding: 100px 40px;
    background-color: #fff;
}

.about-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.about-text p {
    color: var(--text-muted);
    margin-bottom: 20px;
    text-align: justify;
}

.about-image-wrapper {
    border-radius: 4px;
    overflow: hidden;
    height: 450px;
}

.about-fallback-image {
    width: 100%;
    height: 100%;
    background-size: cover;
}


/* Services Section Style */

.services-section {
    padding: 100px 40px;
    background-color: #fff;
}

.services-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 60px auto;
}

.section-subtitle {
    color: var(--text-muted);
    margin-top: 15px;
}

.services-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.service-card {
    height: 645px;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: var(--transition-smooth);
}

.service-card::before {
    content: '';
    position: absolute;
    inset: 0;
    mix-blend-mode: multiply;
    transition: var(--transition-smooth);
}

.yellow-tint::before {
    background: #cccc22;
}

.blue-tint::before {
    background: #3344cc;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.card-overlay-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #fff;
    z-index: 2;
    padding: 20px;
}

.card-overlay-content h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}


/* Portfolio Section Style */

.portfolio-section {
    padding: 100px 40px;
    background-color: #fff;
}

.portfolio-header {
    max-width: 1200px;
    margin: 0 auto 40px auto;
    border-bottom: 4px solid var(--primary-color);
    padding-bottom: 10px;
    width: fit-content;
}

.portfolio-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-auto-rows: 240px;
    gap: 20px;
}

.portfolio-item {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.03);
    transition: var(--transition-smooth);
}

.portfolio-item:hover {
    transform: scale(1.02);
}

.mock-img {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}


/* Exact placement from reference image grid architecture */

.item-1 {
    grid-column: span 2;
    grid-row: span 1;
}

.item-2 {
    grid-column: span 2;
    grid-row: span 2;
}

.item-3 {
    grid-column: span 2;
    grid-row: span 1;
}

.item-4 {
    grid-column: span 2;
    grid-row: span 1;
}

.item-5 {
    grid-column: span 2;
    grid-row: span 1;
}

.item-6 {
    grid-column: span 2;
    grid-row: span 1;
}

.style-apple {
    background-color: #f73e8f;
}

.style-book-front {
    background-color: #b366ff;
}

.style-magazine {
    background-color: #ff3377;
}

.style-bottle {
    background-color: #a3e0d8;
}

.style-poster {
    background-color: #3b5998;
}

.style-cards {
    background-color: #ff8080;
}


/* Blog Section Style */

.blog-section {
    padding: 100px 40px;
    background-color: #fff;
}

.blog-header {
    max-width: 1200px;
    margin: 0 auto 40px auto;
    border-bottom: 4px solid var(--primary-color);
    padding-bottom: 10px;
    width: fit-content;
}

.blog-grid {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.blog-card {
    width: 380px;
}

.blog-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    padding: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
}

.blog-img-wrapper {
    position: relative;
    height: 200px;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 15px;
}

.blog-mock-img {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

.code-bg {
    background-color: #2e3033;
}

.workspace-bg {
    background-color: #e6e9ed;
}

.moving-bg {
    background-color: #d1d5db;
}

.blog-date {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #fff;
    color: #222;
    padding: 8px 12px;
    border-radius: 4px;
    font-weight: 700;
    text-align: center;
    line-height: 1.2;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.blog-badge {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: var(--primary-color);
    color: #fff;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
}

.blog-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.blog-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.5;
}

.blog-card-title a:hover {
    color: var(--primary-color);
}

.blog-card-excerpt {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 20px;
    flex-grow: 1;
    text-align: justify;
}

.blog-more-link {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 0.9rem;
}

.blog-more-link:hover {
    color: var(--primary-hover);
    padding-right: 5px;
}


/* Footer Section Style */

.main-footer {
    background-color: var(--footer-bg);
    color: #d1d5db;
    padding: 60px 40px 20px 40px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    border-bottom: 1px solid #555557;
    padding-bottom: 40px;
}

.footer-widget h4 {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 20px;
    font-weight: 700;
}

.social-icons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    height: 100%;
    align-items: center;
}

.social-icons a {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.social-icons a:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    font-size: 0.85rem;
    color: #9ca3af;
}


/* Tablet Layout Media Queries */

@media (max-width: 1023px) {
    .hero-section {
        grid-template-columns: 1fr;
    }
    .hero-left-bg {
        height: 400px;
    }
    .hero-content {
        padding: 60px 20px;
        text-align: center;
    }
    .about-container {
        grid-template-columns: 1fr;
    }
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 200px;
    }
    .item-1,
    .item-2,
    .item-3,
    .item-4,
    .item-5,
    .item-6 {
        grid-column: span 1;
        grid-row: span 1;
    }
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .footer-container {
        grid-template-columns: repeat(2, 1fr);
    }
}


/* Mobile Layout Media Queries */

@media (max-width: 767px) {
    .header-cta {
        display: none;
    }
    .menu-toggle {
        display: flex;
    }
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: #fff;
        flex-direction: column;
        gap: 0;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-in-out;
    }
    .nav-links.open {
        max-height: 400px;
    }
    .nav-links li {
        width: 100%;
        text-align: center;
    }
    .nav-links a {
        display: block;
        padding: 15px;
        border-bottom: 1px solid #eee;
    }
    .services-grid,
    .blog-grid,
    .footer-container,
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
}


/* ===== CERTIFICATES ===== */

.certificate-slider {
    max-width: 1500px;
    margin: auto;
    position: relative;
    overflow: visible;
    padding: 50px 100px;
}

.certificate-track {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 80px;
}

.certificate-card {
    width: 340px;
    background: #fff;
    border-radius: 22px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 15px 40px rgba(0, 0, 0, .08), 0 5px 15px rgba(0, 0, 0, .04);
    transition: .7s;
}

.active-card {
    opacity: 1;
    filter: none;
    box-shadow: 0 30px 70px rgba(0, 0, 0, .18), 0 10px 25px rgba(0, 0, 0, .1);
    z-index: 10;
}

.certificate-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 35px 80px rgba(0, 0, 0, .2);
}

.certificate-card img {
    width: 100%;
    height: 430px;
    object-fit: contain;
    background: white;
    padding: 10px;
}

.certificate-info {
    padding: 20px;
    text-align: center;
}

.certificate-info h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #333;
}

.certificate-info p {
    color: #666;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    border: none;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 32px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, .15);
    z-index: 100;
    transition: .4s;
}

.slider-btn:hover {
    background: #fca92a;
    color: #fff;
    transform: translateY(-50%) scale(1.1);
}

.prev {
    left: -30px;
}

.next {
    right: -30px;
}


/* Lightbox */

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 99999;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 15px;
}


/* ===== Mobile ===== */

@media (max-width:767px) {
    .certificate-slider {
        padding: 30px 15px;
        overflow: hidden;
    }
    .active-card {
        opacity: 1;
        transform: scale(1);
    }
    .certificate-card img {
        height: 420px;
        object-fit: contain;
    }
    .slider-btn {
        width: 50px;
        height: 50px;
        font-size: 26px;
    }
    .prev {
        left: 5px;
    }
    .next {
        right: 5px;
    }
}


/* ========= Modal ========= */

.certificate-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .85);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
}

.certificate-modal.active {
    display: flex;
}

.modal-content {
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#modalImage {
    max-width: 100%;
    max-height: 85vh;
    transition: transform 0.3s ease;
    transform-origin: center center;
    user-select: none;
    pointer-events: none;
    transform-origin: center center;
    display: block;
    margin: auto;
}

.modal-toolbar {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 100000;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 10px;
    border-radius: 16px;
}

.modal-toolbar button,
.modal-toolbar a {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, .3);
    transition: .3s;
}

.modal-toolbar button:hover,
.modal-toolbar a:hover {
    background: #fca92a;
    color: white;
}

.modal-toolbar button:hover,
.modal-toolbar a:hover {
    background: #fca92a;
    color: white;
}

@media(max-width:767px) {
    .modal-toolbar {
        top: 10px;
        right: 10px;
        gap: 8px;
    }
    .modal-toolbar button,
    .modal-toolbar a {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
}


/* ================= CERTIFICATES ================= */

.certificate-slider {
    max-width: 1700px;
    margin: auto;
    padding: 60px 80px;
    position: relative;
    overflow: hidden;
}

.active-card {
    transform: scale(1.12);
    opacity: 1;
    box-shadow: 0 25px 70px rgba(0, 0, 0, .18);
    z-index: 5;
}

.certificate-card:hover {
    transform: translateY(-12px);
}

.certificate-card img {
    width: 100%;
    height: 450px;
    object-fit: contain;
    background: #fff;
    padding: 10px;
}

.certificate-info {
    padding: 20px;
    text-align: center;
}

.certificate-info h3 {
    color: #222;
    margin-bottom: 10px;
    font-size: 24px;
}

.certificate-info p {
    color: #777;
}

.slider-btn:hover {
    background: var(--primary-color);
    color: #fff;
}

.prev {
    left: 5px;
}

.next {
    right: 5px;
}


/* ================= MODAL ================= */

.certificate-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 99999;
}

.certificate-modal.active {
    display: flex;
}

.modal-toolbar {
    position: absolute;
    top: 25px;
    right: 25px;
    display: flex;
    gap: 15px;
}

.modal-toolbar button:hover,
.modal-toolbar a:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}


/* ================= TABLET ================= */

@media(max-width:1023px) {
    .certificate-slider {
        padding: 60px 20px;
    }
    .certificate-track {
        gap: 20px;
    }
    .certificate-card {
        width: 280px;
    }
    .certificate-card img {
        height: 380px;
    }
}


/* ===== Responsive دقیقا مثل نمونه کارها ===== */

@media (max-width:1023px) {
    .certificate-track {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
        justify-items: center;
    }

    .active-card {
        transform: none;
        box-shadow: 0 15px 40px rgba(0, 0, 0, .08);
    }
    .slider-btn {
        display: none;
    }
}

@media (max-width:767px) {
    .certificate-track {
        grid-template-columns: 1fr;
    }
}