@import url('https://v1.fontapi.ir/css/Vazir');

/* لایه استایل دهی داینامیک بر پایه متغیرها */
:root {
    /* تم دارک پیش‌فرض (سرمه‌ای کریستالی با هدر مشکی خالص) */
    --space-bg: #060d1a;
    --glass-fill: rgba(255, 255, 255, 0.02);
    --glass-edge: rgba(255, 255, 255, 0.05);
    --glass-edge-top: rgba(255, 255, 255, 0.18);
    --neon-cyan: #00f0ff;
    --text-high: #ffffff;
    --text-low: #cbd5e1;
    --slate-gray: #64748b;
    --muted-gray: #1e293b;
    --ambient-gradient: radial-gradient(circle at 80% 20%, #0d1e3d 0%, #060d1a 70%);

    /* تغییر رنگ هدر به مشکی شیشه‌ای غلیظ و لوکس */
    --header-bg: rgba(28, 43, 77, 0.96);
    --image-filter: none;

    --sb-track: rgba(255, 255, 255, 0.01);
    --sb-thumb: #1e293b;
    --sb-thumb-hover: #00f0ff;

    --font-stack: 'Vazir', Tahoma, sans-serif;
}

/* حالت لایت مود: پالت خاکستری مات بتنی با هدر مشکی زغالی مینی‌مال */
body.light-mode {
    --space-bg: #d1d5db;
    --glass-fill: rgba(255, 255, 255, 0.35);
    --glass-edge: rgba(0, 0, 0, 0.12);
    --glass-edge-top: rgba(255, 255, 255, 0.5);
    --neon-cyan: #111827;
    --text-high: #111827;
    --text-low: #374151;
    --slate-gray: #4b5563;
    --muted-gray: #e5e7eb;
    --ambient-gradient: linear-gradient(180deg, #d1d5db 0%, #cbd5e1 100%);

    /* هدر مشکی زغالی غلیظ در لایت‌مود جهت تضاد شدید با خاکستری پس‌زمینه */
    --header-bg: rgba(17, 24, 39, 0.96);
    --image-filter: grayscale(100%) contrast(105%);

    --sb-track: #d1d5db;
    --sb-thumb: #9ca3af;
    --sb-thumb-hover: #4b5563;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    background-color: var(--space-bg);
    color: var(--text-high);
    font-family: var(--font-stack);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* اصلاح اسکرول‌بار اختصاصی ویندوز */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: var(--sb-track);
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--sb-thumb);
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--sb-thumb-hover);
}

.custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: var(--sb-thumb) var(--sb-track);
}

/* بک‌گراند نوری اتمسفریک */
.light-ambient {
    position: fixed;
    width: 100vw;
    height: 100vh;
    top: 0;
    left: 0;
    z-index: -2;
    pointer-events: none;
    background: var(--ambient-gradient);
}

body.light-mode .light-ambient {
    background: var(--space-bg);
}

.blur-core {
    position: absolute;
    border-radius: 50%;
    filter: blur(130px);
    opacity: 0.06;
    width: 500px;
    height: 500px;
    background: var(--neon-cyan);
    bottom: -10%;
    left: -10%;
}

/* هدر فیکس مشکی خالص (کاملاً متمایز از محتوای اسکرول‌شده) */
.glass-navigation {
    position: fixed;
    top: 25px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 80px);
    max-width: 1200px;
    z-index: 1000;
    background: var(--header-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-edge);
    border-top: 1px solid var(--glass-edge-top);
    border-radius: 50px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transition: background-color 0.4s ease, box-shadow 0.4s ease;
}

/* رنگ متون هدر در حالت لایت‌مود که هدرش مشکی است، باید سفید بماند */
body.light-mode .glass-navigation {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

body.light-mode .glass-navigation .nav-logo,
body.light-mode .glass-navigation .nav-menu a {
    color: #e5e7eb;
}

body.light-mode .glass-navigation .nav-menu a:hover {
    color: #ffffff;
}

.nav-inner {
    padding: 14px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 0.5px;
}

.nav-menu a {
    color: var(--text-low);
    text-decoration: none;
    font-size: 0.85rem;
    margin-right: 30px;
    transition: color 0.2s;
}

.nav-menu a:hover {
    color: var(--text-high);
}

.theme-btn-pill {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

/* گلس مورفیسم کارتها */
.ultra-glass {
    background: var(--glass-fill);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid var(--glass-edge);
    border-top: 1px solid var(--glass-edge-top);
    border-radius: 20px;
}

.main-viewport {
    max-width: 1200px;
    margin: 180px auto 40px auto;
    padding: 0 40px;
}

/* انیمیشن ریویل اسکرول */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(25px);
    transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1), transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: transform, opacity;
}

.reveal-on-scroll.active {
    opacity: 1;
    transform: translateY(0);
}

/* هیرو */
.hero-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 60px;
    align-items: center;
    margin-bottom: 90px;
}

/* انیمیشن افکت تایپ */
.typing-container {
    display: inline-block;
}

.typing-text {
    font-size: 3.2rem;
    font-weight: 900;
    white-space: nowrap;
    overflow: hidden;
    border-left: 3px solid var(--neon-cyan);
    width: 0;
    animation: typing 2s steps(10, end) forwards, blink 0.75s step-end infinite;
}

.media-panel {
    width: 100%;
    max-width: 400px;
    height: auto;
    aspect-ratio: 4 / 3;
    margin: 0 auto;
}

.media-panel img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.equilizer {
  height: 30px;
  width: 30px;
  transform: rotate(180deg);
}

.bar {
  fill: rgb(255, 255, 255);
  width: 18px;
  animation: equalize 4s 0s infinite;
}

.bar:nth-child(1) { 
  animation-delay: -1.9s;
}

.bar:nth-child(2) { 
  animation-delay: -2s;
}

.bar:nth-child(3) { 
  animation-delay: -2.3s;
}

.bar:nth-child(4) { 
  animation-delay: -2.4s;
}

.bar:nth-child(5) { 
  animation-delay: -2.1s;
}

@keyframes equalize {
  0% {
    height: 60px;
  }
  4% {
    height: 50px;
  }
  8% {
    height: 40px;
  }
  12% {
    height: 30px;
  }
  16% {
    height: 20px;
  }
  20% {
    height: 30px;
  }
  24% {
    height: 40px;
  }
  28% {
    height: 10px;
  }
  32% {
    height: 40px;
  }
  36% {
    height: 60px;
  }
  40% {
    height: 20px;
  }
  44% {
    height: 40px;
  }
  48% {
    height: 70px;
  }
  52% {
    height: 30px;
  }
  56% {
    height: 10px;
  }
  60% {
    height: 30px;
  }
  64% {
    height: 50px;
  }
  68% {
    height: 60px;
  }
  72% {
    height: 70px;
  }
  76% {
    height: 80px;
  }
  80% {
    height: 70px;
  }
  84% {
    height: 60px;
  }
  88% {
    height: 50px;
  }
  92% {
    height: 60px;
  }
  96% {
    height: 70px;
  }
  100% {
    height: 80px;
  }
}
@keyframes typing {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

@keyframes blink {

    from,
    to {
        border-color: transparent;
    }

    50% {
        border-color: var(--neon-cyan);
    }
}

.meta-tags {
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--neon-cyan);
    font-weight: bold;
}

.meta-tags .dot {
    width: 4px;
    height: 4px;
    background: var(--slate-gray);
    border-radius: 50%;
}

.minimal-desc {
    color: var(--text-low);
    font-size: 0.95rem;
    max-width: 500px;
    line-height: 1.8;
    text-align: justify;
}

/* تصویر هیرو */
.frame-glass {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--glass-edge);
    aspect-ratio: 4 / 3;
    background: var(--muted-gray);
    width: 100%;
    filter: var(--image-filter);
    transition: filter 0.3s ease;
}

.image-placeholder-box {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    letter-spacing: 2px;
    font-weight: 700;
    color: var(--slate-gray);
    opacity: 0.5;
}

.laser-scanner {
    position: absolute;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
    top: 0;
    z-index: 2;
    animation: scan 4s linear infinite;
}

@keyframes scan {
    0% {
        top: 0%;
    }

    50% {
        top: 100%;
    }

    100% {
        top: 0%;
    }
}

/* ریلی افقی */
.section-block {
    margin-bottom: 90px;
}

.block-title {
    font-size: 1.3rem;
    font-weight: 900;
    margin-bottom: 35px;
    position: relative;
    padding-right: 15px;
}

.block-title::before {
    content: '';
    position: absolute;
    right: 0;
    top: 15%;
    width: 4px;
    height: 70%;
    background: var(--neon-cyan);
    border-radius: 2px;
}

.horizontal-scroll-container {
    display: flex;
    gap: 25px;
    overflow-x: auto;
    padding-bottom: 20px;
    scroll-snap-type: x mandatory;
}

.scroll-card {
    flex: 0 0 350px;
    scroll-snap-align: start;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 245px;
    transition: border-color 0.3s ease;
}

.scroll-card:hover {
    border-color: var(--neon-cyan);
}

.card-num {
    font-size: 0.75rem;
    font-family: monospace;
    color: var(--neon-cyan);
    font-weight: bold;
}

.scroll-card h3 {
    font-size: 1.1rem;
    margin: 12px 0 8px 0;
}

.scroll-card p {
    color: var(--text-low);
    font-size: 0.85rem;
    line-height: 1.7;
    text-align: justify;
}

.project-action-link {
    font-size: 0.8rem;
    color: var(--neon-cyan);
    text-decoration: none;
    font-weight: 700;
    margin-top: 15px;
    align-self: flex-start;
}

/* بخش تدریس */
.education-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.edu-card {
    padding: 35px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 250px;
}

.edu-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.edu-header h3 {
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.5;
}

/* تصویر پروفایل دایره‌ای تکی بزرگ ۱:۱ در کارتهای تدریس */
.single-profile-avatar {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: var(--muted-gray);
    border: 2px solid var(--glass-edge-top);
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    flex-shrink: 0;
    filter: var(--image-filter);
    transition: all 0.3s ease;
    overflow: hidden;
}

.avatar-txt {
    font-size: 0.75rem;
    font-weight: 900;
    font-family: monospace;
    color: var(--text-high);
}

.edu-card p {
    color: var(--text-low);
    font-size: 0.85rem;
    line-height: 1.8;
    margin: 15px 0;
    text-align: justify;
}

.edu-badge {
    font-size: 0.75rem;
    color: var(--neon-cyan);
    font-weight: 700;
    align-self: flex-start;
}

/* لایوت باکس ارتباط (وسط‌چین شده) */
.connect-architecture {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    padding: 45px;
    gap: 45px;
}

.text-center-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    justify-content: center;
}

.text-center-box .block-title {
    padding-right: 0;
}

.text-center-box .block-title::before {
    right: 50%;
    transform: translateX(50%);
    top: -12px;
    width: 35px;
    height: 4px;
}

.connect-summary {
    color: var(--text-low);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* باکس انگلیسی ترمینال فشرده برای جزییات ارتباط */
.micro-terminal {
    margin: 25px 0;
    background: rgba(0, 0, 0, 0.12);
    padding: 20px;
    border-radius: 12px;
    font-size: 0.9rem;
    border: 1px solid var(--glass-edge);
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

body.light-mode .micro-terminal {
    background: rgba(0, 0, 0, 0.04);
}

.terminal-line {
    display: flex;
    justify-content: center;
    gap: 8px;
    font-family: monospace;
}

.term-lbl {
    color: var(--neon-cyan);
    font-weight: bold;
}

.term-val {
    color: var(--text-high);
    text-decoration: none;
    transition: opacity 0.2s;
}

.term-val:hover {
    opacity: 0.8;
}

.social-icons-wrapper {
    display: flex;
    gap: 14px;
    justify-content: center;
    width: 100%;
}

.social-icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: var(--glass-fill);
    border: 1px solid var(--glass-edge);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-high);
    transition: all 0.3s ease;
}

.social-icon-btn svg {
    width: 20px;
    height: 20px;
}

.social-icon-btn:hover {
    color: var(--neon-cyan);
    border-color: var(--neon-cyan);
    transform: scale(1.05);
}

/* فرم تماس مینی‌مال */
.minimal-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.field-float {
    position: relative;
}

.field-float input,
.field-float textarea {
    width: 100%;
    padding: 12px 0 6px 0;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--glass-edge);
    color: var(--text-high);
    font-family: var(--font-stack);
    font-size: 0.9rem;
    outline: none;
}

.field-float label {
    position: absolute;
    top: 12px;
    right: 0;
    color: var(--text-low);
    pointer-events: none;
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

.field-float input:focus~label,
.field-float input:not(:placeholder-shown)~label,
.field-float textarea:focus~label,
.field-float textarea:not(:placeholder-shown)~label {
    top: -12px;
    font-size: 0.75rem;
    color: var(--text-high);
    font-weight: bold;
}

.field-float input:focus,
.field-float textarea:focus {
    border-color: var(--neon-cyan);
}

/* دکمه ست‌شده با تم */
.action-btn {
    background: var(--neon-cyan);
    color: var(--space-bg);
    border: 1px solid var(--neon-cyan);
    padding: 14px;
    border-radius: 8px;
    font-family: var(--font-stack);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.85rem;
}

.action-btn:hover {
    background: transparent;
    color: var(--neon-cyan);
}

/* پلیر موزیک */
.sound-gif-pill {
    position: fixed;
    bottom: 30px;
    left: 40px;
    background: var(--glass-fill);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-edge);
    padding: 10px 20px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    z-index: 1000;
}

.pill-label {
    font-size: 0.75rem;
    font-weight: bold;
    color: var(--text-low);
}

.sound-waves {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    width: 20px;
    height: 18px;
}

.sound-waves span {
    width: 3px;
    background: var(--text-high);
    height: 2px;
    border-radius: 1px;
}

.sound-waves.playing span {
    animation: wave-pulse 1.2s infinite ease-in-out;
}

.sound-waves.playing span:nth-child(1) {
    animation-delay: 0.1s;
}

.sound-waves.playing span:nth-child(2) {
    animation-delay: 0.4s;
}

.sound-waves.playing span:nth-child(3) {
    animation-delay: 0.2s;
}

.sound-waves.playing span:nth-child(4) {
    animation-delay: 0.6s;
}

@keyframes wave-pulse {

    0%,
    100% {
        height: 3px;
    }

    50% {
        height: 18px;
    }
}

.global-footer {
    border-top: 1px solid var(--glass-edge);
    padding: 25px 40px;
    text-align: center;
    max-width: 1200px;
    margin: 40px auto 0 auto;
}

.global-footer p {
    font-size: 0.75rem;
    color: var(--slate-gray);
    line-height: 1.6;
}

@media (max-width: 968px) {

    .hero-layout,
    .connect-architecture,
    .education-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .glass-navigation {
        width: calc(100% - 40px);
        top: 15px;
    }

    .nav-menu {
        display: none;
    }

    .main-viewport {
        padding: 0 20px;
        margin-top: 140px;
    }
}

/* ===== اصلاحات ریسپانسیو برای موبایل (بدون تغییر در استایل‌های اصلی) ===== */

@media (max-width: 768px) {
    .scroll-card {
        flex: 0 0 280px;
        padding: 20px;
    }
    
    .edu-card {
        padding: 25px;
    }
    
    .connect-architecture {
        padding: 30px 25px;
    }
    
    .micro-terminal {
        padding: 15px;
    }
    
    .sound-gif-pill {
        bottom: 20px;
        left: 20px;
        padding: 8px 16px;
    }
}

@media (max-width: 480px) {
    .main-viewport {
        padding: 0 15px;
        margin-top: 120px;
    }
    
    .hero-layout {
        gap: 30px;
        margin-bottom: 50px;
    }
    
    .typing-text {
        font-size: 2rem;
        white-space: normal;
        border-left: none;
        animation: none;
        width: 100%;
        text-align: center;
    }
    
    .typing-container {
        display: block;
        text-align: center;
    }
    
    .meta-tags {
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .minimal-desc {
        text-align: center;
        font-size: 0.85rem;
    }
    
    .block-title {
        font-size: 1.1rem;
        text-align: center;
    }
    
    .block-title::before {
        right: 50%;
        transform: translateX(50%);
        width: 40px;
        height: 3px;
        top: -8px;
    }
    
    .scroll-card {
        flex: 0 0 260px;
        padding: 18px;
    }
    
    .scroll-card h3 {
        font-size: 0.95rem;
    }
    
    .scroll-card p {
        font-size: 0.75rem;
    }
    
    .education-grid {
        gap: 20px;
    }
    
    .edu-card {
        padding: 20px;
        min-height: auto;
    }
    
    .edu-header {
        flex-direction: column-reverse;
        align-items: center;
        text-align: center;
        gap: 12px;
    }
    
    .single-profile-avatar {
        width: 55px;
        height: 55px;
    }
    
    .edu-header h3 {
        font-size: 1rem;
    }
    
    .connect-architecture {
        padding: 25px 18px;
        gap: 25px;
    }
    
    .connect-summary {
        font-size: 0.8rem;
    }
    
    .terminal-line {
        flex-direction: column;
        align-items: center;
        gap: 4px;
    }
    
    .social-icons-wrapper {
        gap: 10px;
    }
    
    .social-icon-btn {
        width: 38px;
        height: 38px;
    }
    
    .social-icon-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .sound-gif-pill {
        bottom: 15px;
        left: 15px;
        padding: 6px 14px;
        gap: 8px;
    }
    
    .pill-label {
        font-size: 0.65rem;
    }
    
    .global-footer {
        padding: 20px 20px;
        margin-top: 20px;
    }
    
    .global-footer p {
        font-size: 0.65rem;
    }
}
/* اصلاح فریم شیشه‌ای دور عکس در موبایل */
@media (max-width: 768px) {
    .frame-glass {
        width: 100%;
        height: 100%;
        aspect-ratio: 4 / 3;
    }
    
    .image-placeholder-box {
        width: 100%;
        height: 100%;
        overflow: hidden;
    }
    
    .image-placeholder-box img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}