/* Fonts - IRANSans */
@font-face {
    font-family: 'IRANSans';
    src: url('../fonts/IRANSansWeb.woff2') format('woff2'),
         url('../fonts/IRANSansWeb.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IRANSans';
    src: url('../fonts/IRANSansWeb_Medium.woff2') format('woff2'),
         url('../fonts/IRANSansWeb_Medium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IRANSans';
    src: url('../fonts/IRANSansWeb_Bold.woff2') format('woff2'),
         url('../fonts/IRANSansWeb_Bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IRANSans';
    src: url('../fonts/IRANSansWeb_Black.woff2') format('woff2'),
         url('../fonts/IRANSansWeb_Black.woff') format('woff');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --primary-color: #4a148c; /* Deep Purple */
    --primary-dark: #310b63;
    --secondary-color: #6a1b9a; /* Lighter Purple */
    --accent-color: #8e24aa;
    --text-main: #333333;
    --text-muted: #666666;
    --bg-light: #f8f9fc;
    --bg-white: #ffffff;
    --surface-soft: #f3e5f5;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 6px;
    --shadow-soft: 0 10px 25px rgba(74, 20, 140, 0.05);
    --shadow-hover: 0 15px 35px rgba(74, 20, 140, 0.1);
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'IRANSans', Tahoma, Arial, sans-serif;
    color: var(--text-main);
    background-color: var(--bg-light);
    line-height: 1.8;
    letter-spacing: 0;
}

/* Typography with clamp() for elegant, official sizes */
h1, .display-4 { font-size: clamp(1.5rem, 3vw, 2.2rem) !important; font-weight: 800 !important; line-height: 1.4; color: var(--primary-dark); }
h2, .display-5 { font-size: clamp(1.3rem, 2.5vw, 1.8rem) !important; font-weight: 800 !important; color: var(--primary-color); }
h3, .display-6 { font-size: clamp(1.2rem, 2vw, 1.5rem) !important; font-weight: 700 !important; color: var(--primary-color); }
h4 { font-size: clamp(1.1rem, 1.8vw, 1.3rem) !important; font-weight: 700 !important; }
h5, h6 { font-size: clamp(1rem, 1.5vw, 1.1rem) !important; font-weight: 700 !important; }
p, li, .lead, .fs-5 { font-size: clamp(0.9rem, 1.2vw, 0.95rem) !important; line-height: 1.9; color: var(--text-muted); text-align: justify; }

/* Custom Utilities */
.text-primary { color: var(--primary-color) !important; }
.bg-primary { background-color: var(--primary-color) !important; }
.text-secondary { color: var(--text-muted) !important; }
.text-gold, .text-accent { color: var(--secondary-color) !important; }
.bg-gold, .bg-accent { background-color: var(--secondary-color) !important; }

/* Buttons */
.btn {
    border-radius: 999px;
    font-weight: 500;
    font-size: clamp(0.85rem, 1vw, 0.95rem);
    padding: 0.6rem 1.5rem;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: var(--primary-color);
    color: #fff !important;
    box-shadow: 0 4px 10px rgba(74, 20, 140, 0.2);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(74, 20, 140, 0.3);
}

.btn-outline-primary {
    background: transparent;
    border: 1px solid var(--primary-color) !important;
    color: var(--primary-color) !important;
    box-shadow: none;
}

.btn-outline-primary:hover {
    background: var(--surface-soft);
    color: var(--primary-color) !important;
}

.btn-gold {
    background: var(--secondary-color);
    color: #fff !important;
}

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

/* Header Glassmorphism */
.main-header {
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.main-header.shadow-sm {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05) !important;
}

.navbar-nav .nav-link {
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.navbar-nav .nav-link:hover, .navbar-nav .nav-link.active {
    color: var(--primary-color) !important;
    background: var(--surface-soft);
}

/* Hero Section */
.hero-section {
    padding: clamp(60px, 10vw, 100px) 0 clamp(40px, 8vw, 80px);
    background: linear-gradient(180deg, var(--bg-white) 0%, var(--bg-light) 100%);
    position: relative;
    overflow: hidden;
}

.hero-img-wrapper {
    position: relative;
    z-index: 1;
    display: inline-block;
}

.hero-img {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    max-height: 450px;
    object-fit: cover;
    width: 100%;
    position: relative;
    z-index: 2;
    border: 1px solid rgba(0,0,0,0.05);
}

/* Section Title */
.section-title {
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
    margin-bottom: clamp(20px, 4vw, 40px);
    color: var(--primary-color);
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* Timeline */
.timeline {
    position: relative;
    padding-right: 30px;
}
.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    right: 5px;
    height: 100%;
    width: 2px;
    background: rgba(74, 20, 140, 0.1);
}
.timeline-item {
    position: relative;
    margin-bottom: 30px;
    background: var(--bg-white);
    padding: 25px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(0,0,0,0.02);
    transition: transform 0.2s;
}
.timeline-item:hover {
    transform: translateX(-5px);
    box-shadow: var(--shadow-hover);
}
.timeline-item::before {
    content: '';
    position: absolute;
    top: 30px;
    right: -31px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: var(--primary-color);
    border: 3px solid var(--bg-white);
}
.timeline-date {
    display: inline-block;
    color: var(--secondary-color);
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 10px;
}

/* Skill Card */
.skill-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(0,0,0,0.02);
    transition: transform 0.2s;
    height: 100%;
}
.skill-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}
.progress-custom {
    height: 6px;
    border-radius: 3px;
    background-color: var(--surface-soft);
}
.progress-custom .progress-bar {
    background: var(--primary-color);
    border-radius: 3px;
}

/* Cards (Projects, Articles, Certs) */
.project-card, .article-card, .cert-card, .gallery-card {
    border: 1px solid rgba(0,0,0,0.03);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: all 0.3s ease;
    background: var(--bg-white);
    height: 100%;
}
.project-card:hover, .article-card:hover, .cert-card:hover, .gallery-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}
.card-img-wrapper {
    overflow: hidden;
    position: relative;
}
.card-img-wrapper img {
    transition: transform 0.4s ease;
    object-fit: cover;
    height: 200px;
    width: 100%;
}

/* Quote Section */
.quote-section {
    background: var(--primary-dark);
    color: white;
    padding: clamp(50px, 8vw, 80px) 0;
    position: relative;
    text-align: center;
}
.quote-icon {
    font-size: 2.5rem;
    color: var(--surface-soft);
    opacity: 0.5;
    margin-bottom: 20px;
}
.quote-text {
    line-height: 1.8 !important;
    font-weight: 500;
    font-size: clamp(1.1rem, 2vw, 1.4rem);
}

/* Stats */
.stat-box {
    text-align: center;
    padding: 30px 15px;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(0,0,0,0.02);
    transition: transform 0.2s;
}
.stat-box:hover {
    transform: translateY(-5px);
}
.stat-number {
    font-size: clamp(2rem, 3vw, 2.5rem);
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
}

/* Footer */
footer {
    background-color: var(--text-main) !important;
}
.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    transition: all 0.2s;
    color: #fff;
}
.social-links a:hover {
    background: var(--primary-color);
}
