/* ==========================================================================
   About Us Page Styles — v2 (Cylindrical Carousel Edition)
   ========================================================================== */

/* --- 1. Pulse Hero --- */
.ab-hero {
    position: relative;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    background: var(--d);
    display: flex;
    align-items: center;
    justify-content: center;
}
#pulseCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}
.ab-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    pointer-events: none;
}
.ab-title {
    font-size: clamp(40px, 6vw, 80px);
    font-weight: 900;
    color: var(--t1);
    line-height: 1.2;
    margin-bottom: 20px;
    text-shadow: 0 10px 30px rgba(0,0,0,0.8);
}
.gradient-text {
    background: var(--gc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.ab-desc {
    font-size: 18px;
    color: var(--t2);
    font-weight: 300;
}

/* --- 2. Flashlight --- */
.ab-flashlight {
    position: relative;
    height: 80vh;
    background: var(--d2);
    overflow: hidden;
    cursor: crosshair;
}
.flash-dark-layer {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 1;
}
.flash-dark-layer h2 {
    font-size: 36px;
    color: var(--t2);
    opacity: 0.3;
}
.flash-reveal-layer {
    position: absolute;
    inset: 0;
    z-index: 2;
    background-size: cover;
    background-position: center;
    -webkit-mask-image: radial-gradient(circle 180px at var(--mouse-x, -999px) var(--mouse-y, -999px), black 40%, transparent 100%);
    mask-image: radial-gradient(circle 180px at var(--mouse-x, -999px) var(--mouse-y, -999px), black 40%, transparent 100%);
}

/* ==========================================================================
   3. Tech Leads — WebGL Vertical Video Carousel
   ========================================================================== */

.ab-tech-leads {
    position: relative;
    background: var(--d);
    overflow: hidden;
}

.ab-tech-leads.tl-empty .tl-carousel-wrap::after {
    content: 'تک‌لیدی برای نمایش ثبت نشده است.';
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tm);
    font-size: 15px;
}

.tl-carousel-wrap {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 560px;
    background:
        radial-gradient(ellipse 80% 60% at 50% 40%, var(--pu) 0%, transparent 70%),
        var(--d);
    overflow: hidden;
}

#tlHeroCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    z-index: 1;
    cursor: grab;
    touch-action: none;
}

#tlHeroCanvas:active {
    cursor: grabbing;
}

.tl-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    pointer-events: none;
}

.tl-panel-close,
.tl-active-panel.is-open,
.tl-nav {
    pointer-events: auto;
}

.tl-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.06);
    z-index: 12;
    pointer-events: none;
}

.tl-progress-fill {
    height: 100%;
    width: 0;
    background: var(--gc);
    transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: var(--sg);
}

.tl-hover-chip {
    position: absolute;
    bottom: clamp(56px, 8vw, 72px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 14;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 22px;
    border-radius: 99px;
    background: rgba(5, 12, 10, 0.9);
    border: 1px solid color-mix(in srgb, var(--accent, var(--p)) 50%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: var(--sh), 0 0 24px var(--pg);
    pointer-events: none;
    animation: tlChipIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.tl-hover-chip[hidden] {
    display: none !important;
}

@keyframes tlChipIn {
    from { opacity: 0; transform: translateX(-50%) translateY(8px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.tl-hover-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--t1);
    white-space: nowrap;
}

.tl-hover-role {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--accent, var(--pl));
    white-space: nowrap;
}

.tl-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 14;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--pbr);
    background: rgba(5, 12, 10, 0.78);
    color: var(--pl);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.tl-nav:hover {
    background: var(--pu);
    border-color: var(--p);
    transform: translateY(-50%) scale(1.06);
}

.tl-nav-prev {
    inset-inline-start: clamp(16px, 3vw, 32px);
}

.tl-nav-next {
    inset-inline-end: clamp(16px, 3vw, 32px);
}

.tl-section-title {
    position: absolute;
    top: clamp(28px, 5vw, 52px);
    inset-inline-end: clamp(20px, 5vw, 48px);
    text-align: end;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.45s ease;
}

.tl-carousel-counter {
    position: absolute;
    bottom: clamp(24px, 4vw, 40px);
    inset-inline-end: clamp(20px, 4vw, 48px);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.28em;
    color: var(--tm);
    font-variant-numeric: tabular-nums;
    pointer-events: none;
    transition: opacity 0.45s ease;
}

.tl-active-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 20;
    --accent: var(--p);
    background: linear-gradient(to top, rgba(5, 12, 10, 0.98) 0%, rgba(8, 15, 13, 0.9) 65%, transparent 100%);
    border-top: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 32px clamp(20px, 4vw, 48px) clamp(28px, 4vw, 40px);
    transform: translateY(110%);
    opacity: 0;
    transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.45s ease;
    pointer-events: none;
}

.tl-active-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(120px, 30%);
    height: 3px;
    border-radius: 99px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.85;
}

.tl-active-panel.is-open {
    transform: translateY(0);
    opacity: 1;
}

.tl-active-panel[hidden] {
    display: none !important;
}

.tl-panel-close {
    position: absolute;
    top: 16px;
    inset-inline-end: clamp(20px, 4vw, 48px);
    width: 36px;
    height: 36px;
    border: 1px solid var(--pbr);
    border-radius: 50%;
    background: var(--pu);
    color: var(--pl);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s;
    z-index: 2;
}

.tl-panel-close:hover {
    background: var(--pb);
    border-color: var(--p);
}

.tl-panel-inner {
    max-width: 640px;
    margin: 0 auto;
    text-align: center;
    padding-top: 8px;
}

.tl-panel-name {
    margin: 0 0 6px;
    font-size: clamp(22px, 3vw, 28px);
    font-weight: 700;
    color: var(--t1);
}

.tl-panel-role {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent, var(--pl));
    letter-spacing: 0.06em;
}

.tl-panel-stats {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.tl-panel-stats[hidden] {
    display: none !important;
}

.tl-panel-stats span {
    font-size: 11px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 99px;
    background: var(--pu);
    border: 1px solid var(--pbr);
    color: var(--t2);
}

.tl-panel-bio {
    margin: 0 0 14px;
    font-size: 14px;
    line-height: 1.65;
    color: var(--t2);
    max-width: 520px;
    margin-inline: auto;
}

.tl-panel-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 7px;
}

.tl-panel-tags span {
    font-size: 11px;
    padding: 5px 12px;
    border-radius: 99px;
    background: var(--pu);
    border: 1px solid var(--pbr);
    color: var(--pl);
}

.tl-section-title.is-visible {
    opacity: 1;
}

.tl-watermark {
    display: block;
    font-size: clamp(36px, 6vw, 64px);
    font-weight: 800;
    color: rgba(255, 255, 255, 0.06);
    line-height: 1;
    margin-bottom: 8px;
    user-select: none;
}

.tl-eyebrow {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--p);
    margin-bottom: 10px;
}

.tl-heading {
    margin: 0;
    font-size: clamp(22px, 3vw, 32px);
    font-weight: 600;
    color: var(--t1);
    line-height: 1.2;
}

.tl-heading > span:not(.gradient-text) {
    color: var(--p);
}

.tl-subline {
    margin: 10px 0 0;
    font-size: 13px;
    color: var(--tm);
    letter-spacing: 0.04em;
}

.tl-hint {
    position: absolute;
    bottom: clamp(20px, 4vw, 36px);
    inset-inline-start: clamp(20px, 4vw, 48px);
    margin: 0;
    font-size: 11px;
    color: var(--tm);
    letter-spacing: 0.06em;
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: none;
    transition: opacity 0.4s;
}

.tl-hint-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--p);
    box-shadow: 0 0 12px var(--pg);
    animation: tlHintPulse 2s ease-in-out infinite;
}

@keyframes tlHintPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(0.85); }
}

.tl-mobile-carousel {
    min-height: 100vh;
    min-height: 100dvh;
    padding: clamp(24px, 5vw, 48px) 20px 32px;
    background: var(--d);
}

.tl-mobile-carousel[hidden] {
    display: none !important;
}

.tl-mobile-head {
    text-align: center;
    margin-bottom: 28px;
}

.tl-mobile-track {
    position: relative;
    height: min(72vh, 560px);
    overflow: hidden;
}

.tl-mobile-card {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.45s;
    transform-style: preserve-3d;
    will-change: transform, opacity;
}

.tl-mobile-card-inner {
    position: relative;
    z-index: 1;
    width: min(78vw, 300px);
    border-radius: 16px;
    overflow: hidden;
    background: var(--d3);
    border: 1px solid var(--pbr);
    box-shadow: var(--sh), 0 0 48px var(--pg);
}

.tl-mobile-card-inner video,
.tl-mobile-card-inner img {
    width: 100%;
    aspect-ratio: 9 / 16;
    object-fit: cover;
    display: block;
}

.tl-mobile-placeholder {
    width: 100%;
    aspect-ratio: 9 / 16;
    background: linear-gradient(160deg, color-mix(in srgb, var(--accent, var(--p)) 40%, var(--d)), var(--d));
}

.tl-mobile-card-info {
    padding: 18px 20px 22px;
}

.tl-mobile-card-info h3 {
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 700;
    color: var(--t1);
}

.tl-mobile-role {
    margin: 0 0 10px;
    font-size: 13px;
    color: var(--pl);
    font-weight: 600;
}

.tl-mobile-bio {
    margin: 0 0 14px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--t2);
}

.tl-mobile-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tl-mobile-tags span {
    font-size: 10px;
    padding: 4px 10px;
    border-radius: 99px;
    background: var(--pu);
    border: 1px solid var(--pbr);
    color: var(--pl);
}

.tl-mobile-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 24px;
}

.tl-mobile-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    padding: 0;
    background: var(--pb);
    cursor: pointer;
    transition: transform 0.3s, background 0.3s;
}

.tl-mobile-dot.is-active {
    background: var(--p);
    transform: scale(1.35);
}

.ab-tech-leads.tl-is-mobile .tl-carousel-wrap {
    display: none !important;
}

@media (max-width: 900px) {
    .tl-hint,
    .tl-nav {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tl-hint-dot {
        animation: none;
    }

    .tl-mobile-card {
        transition: none;
    }
}


/* --- 4. Scroll Time Machine --- */
.ab-time-machine {
    height: 300vh;
    position: relative;
    background: var(--d2);
}
.time-sticky-wrap {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.time-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, var(--pb), var(--d2));
    opacity: 0.5;
}
.time-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 800px;
}
.time-step {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0;
    text-align: center;
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.time-step.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}
.time-step h3 {
    font-size: 80px;
    -webkit-text-stroke: 2px var(--pl);
    color: transparent;
    margin-bottom: 20px;
}
.time-step p { font-size: 20px; color: var(--t1); }

/* --- 5. Core Values --- */
.ab-values {
    padding: 100px 5%;
    background: var(--d);
}
.values-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-top: 50px;
}
.value-item {
    font-size: clamp(60px, 8vw, 120px);
    font-weight: 900;
    color: transparent;
    -webkit-text-stroke: 2px rgba(255,255,255,0.1);
    text-transform: uppercase;
    cursor: pointer;
    transition: -webkit-text-stroke 0.4s ease, color 0.4s ease;
    -webkit-background-clip: text;
    background-clip: text;
    background-size: cover;
    background-position: center;
}
.value-item:hover {
    -webkit-text-stroke: 0px transparent;
    color: rgba(255,255,255,0.9);
}

/* --- 6. Physics --- */
.ab-physics {
    background: var(--d2);
    padding: 100px 0 0 0;
}
#physics-canvas-container {
    width: 100%;
    height: 60vh;
    overflow: hidden;
    cursor: grab;
}
#physics-canvas-container:active { cursor: grabbing; }

/* --- Shared --- */
.sec-hd {
    text-align: center;
    margin-bottom: 20px;
}
.sec-title {
    font-size: clamp(28px, 4vw, 48px);
    font-weight: 800;
    color: var(--t1);
}
.sec-title span { color: var(--pl, #0E946E); }
.sec-desc {
    color: var(--t2);
    font-size: 16px;
    margin-top: 10px;
}
